/* ============================================================
   InclusivaFinanceiro — Design System
   Herda Neo-Brutalist do InclusivaEdu/Connect
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@700&display=swap');

:root {
  --primary-blue: #3266F5;
  --primary-dark: #1E40AF;
  --bg-light: #F0F5FF;
  --deep-dark: #1A1B22;
  --white: #FFFFFF;
  --accent: #E5E9F4;
  --green: var(--primary-blue);
  --red: #EF4444;
  --yellow: #F59E0B;
  --orange: #F97316;
  --border-thick: 3px solid var(--deep-dark);
  --shadow-hard: 5px 5px 0px var(--deep-dark);
  --shadow-hard-hover: 7px 7px 0px var(--deep-dark);
  --radius-lg: 1.2rem;
  --radius-pill: 9999px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --bouncy-ease: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-light);
  color: var(--deep-dark);
  line-height: 1.6;
  background-image:
    linear-gradient(to right, rgba(50,102,245,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(50,102,245,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); letter-spacing: -0.05em; line-height: 1.1; }
a { text-decoration: none; color: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; background: var(--white); color: var(--deep-dark);
  padding: 1.5rem; display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 50; transition: transform 0.3s;
  border-right: var(--border-thick);
}

.sidebar-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2.5rem; padding: 0 0.5rem; }
.sidebar-brand .logo-mark {
  background: var(--primary-blue); width: 2.5rem; height: 2.5rem; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; border: var(--border-thick);
  font-size: 1.2rem; color: var(--white);
}
.sidebar-brand span { font-family: var(--font-heading); font-size: 1.1rem; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }

.nav-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem;
  border-radius: 0.75rem; cursor: pointer; transition: all 0.2s; font-weight: 500;
  color: #64748b; font-size: 0.95rem;
}
.nav-item:hover { background: var(--bg-light); color: var(--primary-blue); }
.nav-item.active { background: #EEF2FF; color: var(--primary-blue); font-weight: 700; border: 1px solid rgba(50,102,245,0.1); }
.nav-item i { width: 20px; height: 20px; }

.sidebar-footer { padding-top: 1rem; border-top: 1px solid #e2e8f0; }
.sidebar-footer a { color: #64748b; font-size: 0.85rem; }
.sidebar-footer a:hover { color: var(--primary-blue); }

.app-main { flex: 1; margin-left: 260px; padding: 2rem; }

/* ── KPI Cards ──────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.kpi-card {
  background: var(--white); border: var(--border-thick); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard); padding: 1.5rem; transition: transform 0.2s var(--bouncy-ease);
}
.kpi-card:hover { transform: translateY(-3px); }
.kpi-card.accent { border-color: var(--primary-blue); }
.kpi-card.green { border-color: var(--green); }
.kpi-card.red { border-color: var(--red); }
.kpi-card.yellow { border-color: var(--yellow); }

.kpi-label {
  font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.5rem; display: flex;
  align-items: center; gap: 0.5rem; font-weight: 500;
}
.kpi-label i { width: 16px; height: 16px; }
.kpi-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; }
.kpi-detail { font-size: 0.8rem; opacity: 0.5; margin-top: 0.25rem; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-container {
  background: var(--white); border: var(--border-thick); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard); overflow: hidden; margin-bottom: 1.5rem;
}
.table-header {
  padding: 1rem 1.5rem; border-bottom: var(--border-thick); display: flex;
  justify-content: space-between; align-items: center; background: var(--white);
}
.table-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }

table.brutalist { width: 100%; border-collapse: collapse; }
table.brutalist th {
  text-align: left; padding: 0.75rem 1.5rem; font-family: var(--font-heading);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-light); border-bottom: 2px solid var(--deep-dark);
}
table.brutalist td {
  padding: 0.75rem 1.5rem; border-bottom: 1px solid #eee; font-size: 0.9rem;
}
table.brutalist tr:hover td { background: rgba(50,102,245,0.03); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700;
  border: 2px solid var(--deep-dark);
}
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-gray { background: #F3F4F6; color: #374151; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem;
  padding: 0.6rem 1.2rem; border: var(--border-thick); border-radius: 12px;
  cursor: pointer; box-shadow: var(--shadow-hard); transition: all 0.2s var(--bouncy-ease);
  display: inline-flex; align-items: center; gap: 0.5rem; background: var(--white);
}
.btn:active { box-shadow: 1px 1px 0 var(--deep-dark); transform: translate(3px, 3px); }
.btn:hover { box-shadow: var(--shadow-hard-hover); transform: translateY(-2px); }
.btn-primary { background: var(--primary-blue); color: var(--white); }
.btn-green { background: var(--green); color: var(--white); }
.btn-red { background: var(--red); color: var(--white); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; box-shadow: 3px 3px 0 var(--deep-dark); }
.btn-sm:active { box-shadow: 1px 1px 0 var(--deep-dark); transform: translate(2px, 2px); }
.btn i { width: 16px; height: 16px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-family: var(--font-heading); font-weight: 700; margin-bottom: 0.4rem; font-size: 0.95rem; }
.form-input, select {
  width: 100%; padding: 0.75rem 1rem; font-family: var(--font-body); font-size: 0.95rem;
  border: var(--border-thick); border-radius: var(--radius-pill); background: var(--bg-light);
  transition: all 0.2s; outline: none;
}
.form-input:focus, select:focus { background: var(--white); box-shadow: 4px 4px 0 var(--primary-blue); border-color: var(--primary-blue); }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
  display: none; justify-content: center; align-items: center; z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--white); border: var(--border-thick); border-radius: var(--radius-lg);
  box-shadow: 12px 12px 0 var(--deep-dark); width: 90%; max-width: 550px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 1.5rem; border-bottom: var(--border-thick); display: flex;
  justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 1.3rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: var(--border-thick); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ── Charts ─────────────────────────────────────────────────── */
.chart-container {
  background: var(--white); border: var(--border-thick); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard); padding: 1.5rem; margin-bottom: 1.5rem;
}
.chart-title {
  font-family: var(--font-heading); font-size: 0.95rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.chart-wrap { position: relative; height: 250px; }

/* ── Filters ────────────────────────────────────────────────── */
.filter-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-pill {
  padding: 0.4rem 1rem; border: 2px solid var(--deep-dark); border-radius: var(--radius-pill);
  cursor: pointer; font-weight: 600; font-size: 0.85rem; background: var(--white);
  transition: all 0.2s;
}
.filter-pill:hover { background: var(--bg-light); }
.filter-pill.active { background: var(--deep-dark); color: var(--white); }

/* ── View Panel ─────────────────────────────────────────────── */
.view-panel { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Search ─────────────────────────────────────────────────── */
.search-input {
  padding: 0.5rem 1rem; border: 2px solid var(--deep-dark); border-radius: var(--radius-pill);
  font-size: 0.9rem; width: 250px; outline: none; background: var(--bg-light);
}
.search-input:focus { box-shadow: 3px 3px 0 var(--primary-blue); border-color: var(--primary-blue); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; padding: 1rem 1.5rem;
  border: var(--border-thick); border-radius: 1rem; box-shadow: var(--shadow-hard);
  font-weight: 700; z-index: 9999; animation: slideUp 0.3s var(--bouncy-ease);
  display: flex; align-items: center; gap: 0.5rem;
}
.toast-success { background: #D1FAE5; color: #065F46; }
.toast-error { background: #FEE2E2; color: #991B1B; }
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Login ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.login-card {
  background: var(--white); border: var(--border-thick); border-radius: var(--radius-lg);
  box-shadow: 12px 12px 0 var(--primary-blue); width: 100%; max-width: 450px; padding: 3rem;
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header .logo-icon {
  background: var(--primary-blue); width: 60px; height: 60px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: var(--border-thick); font-size: 1.8rem; margin-bottom: 1rem;
  color: var(--white);
}
.login-header h1 { font-size: 1.8rem; margin-bottom: 0.25rem; }
.login-header p { opacity: 0.6; font-size: 0.9rem; }
.login-submit { width: 100%; justify-content: center; margin-top: 0.5rem; padding: 0.9rem; font-size: 1.1rem; }

/* ── Payment Portal ─────────────────────────────────────────── */
.payment-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.payment-card {
  background: var(--white); border: var(--border-thick); border-radius: var(--radius-lg);
  box-shadow: 12px 12px 0 var(--deep-dark); width: 100%; max-width: 500px; overflow: hidden;
}
.payment-header { background: var(--primary-blue); color: var(--white); padding: 2rem; text-align: center; border-bottom: var(--border-thick); }
.payment-body { padding: 2rem; }
.qr-container {
  background: var(--white); border: var(--border-thick); border-radius: 1rem;
  padding: 1.5rem; text-align: center; margin: 1.5rem 0;
}
.qr-container img { max-width: 250px; border-radius: 0.5rem; }
.copy-btn {
  width: 100%; padding: 0.75rem; background: var(--bg-light); border: 2px solid var(--deep-dark);
  border-radius: var(--radius-pill); cursor: pointer; font-weight: 700; font-size: 0.95rem;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.copy-btn:hover { background: var(--deep-dark); color: var(--white); }
.status-waiting {
  text-align: center; padding: 1rem; background: #FEF3C7; border: 2px solid var(--deep-dark);
  border-radius: 1rem; font-weight: 700; color: #92400E; margin-top: 1rem;
  animation: pulse-bg 2s infinite;
}
.status-paid {
  text-align: center; padding: 1rem; background: #D1FAE5; border: 2px solid var(--deep-dark);
  border-radius: 1rem; font-weight: 700; color: #065F46; margin-top: 1rem;
}
@keyframes pulse-bg { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
}
