/* =====================================================
   GastosApp — app.css
   Dark theme, sidebar layout, Bootstrap override
   ===================================================== */

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

/* ── Variables ── */
:root {
  --bg-base:       #0d0f14;
  --bg-surface:    #13161d;
  --bg-elevated:   #1a1e28;
  --bg-hover:      #1f2433;
  --border:        rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.14);

  --accent:        #4f8ef7;
  --accent-hover:  #6ba3f9;
  --accent-dim:    rgba(79,142,247,0.15);

  --green:         #4ade80;
  --green-dim:     rgba(74,222,128,0.12);
  --red:           #f87171;
  --red-dim:       rgba(248,113,113,0.12);
  --yellow:        #fbbf24;
  --yellow-dim:    rgba(251,191,36,0.12);
  --blue:          #60a5fa;
  --blue-dim:      rgba(96,165,250,0.12);

  --text-primary:  #e8eaf0;
  --text-secondary:#8b90a0;
  --text-muted:    #555b6e;

  --sidebar-w:     240px;
  --sidebar-w-sm:  64px;
  --topbar-h:      60px;

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;

  --font-main:     'Space Grotesk', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.5);
}
/* Tema claro */
:root[data-theme="light"] {
  --bg-base:       #fdfaf6;  /* crema muy suave */
  --bg-surface:    #fffdf9;  /* blanco cálido */
  --bg-elevated:   #f8f4ee;  /* beige pastel */
  --bg-hover:      #f3ece3;  /* arena suave */
  --border:        rgba(120, 102, 84, 0.16);
  --border-bright: rgba(120, 102, 84, 0.24);

  --accent:        #7aa2f7;  /* azul pastel */
  --accent-hover:  #6a95f2;
  --accent-dim:    rgba(122, 162, 247, 0.18);

  --green:         #7dcfa1;  /* verde menta pastel */
  --green-dim:     rgba(125, 207, 161, 0.18);
  --red:           #f2a7a7;  /* coral pastel */
  --red-dim:       rgba(242, 167, 167, 0.18);
  --yellow:        #f4d58d;  /* vainilla pastel */
  --yellow-dim:    rgba(244, 213, 141, 0.2);
  --blue:          #8ecae6;  /* celeste pastel */
  --blue-dim:      rgba(142, 202, 230, 0.2);

  --text-primary:  #4e4a44;  /* marrón grisáceo suave */
  --text-secondary:#6b645d;
  --text-muted:    #918980;

  --shadow-sm:     0 2px 8px rgba(90, 72, 54, 0.08);
  --shadow-md:     0 6px 20px rgba(90, 72, 54, 0.10);
  --shadow-lg:     0 10px 34px rgba(90, 72, 54, 0.12);
}
:root[data-theme="light-rose"] {
  --bg-base:       #fdf8fc;
  --bg-surface:    #fffaff;
  --bg-elevated:   #f7eef8;
  --bg-hover:      #f2e6f5;
  --border:        rgba(122, 96, 134, 0.16);
  --border-bright: rgba(122, 96, 134, 0.24);

  --accent:        #b79ced;
  --accent-hover:  #a88ee6;
  --accent-dim:    rgba(183, 156, 237, 0.20);

  --green:         #8fd3b6;
  --green-dim:     rgba(143, 211, 182, 0.20);
  --red:           #f1a8bf;
  --red-dim:       rgba(241, 168, 191, 0.20);
  --yellow:        #f6d9a2;
  --yellow-dim:    rgba(246, 217, 162, 0.22);
  --blue:          #a8c7f0;
  --blue-dim:      rgba(168, 199, 240, 0.22);

  --text-primary:  #4f4457;
  --text-secondary:#6f6179;
  --text-muted:    #93879d;

  --shadow-sm:     0 2px 8px rgba(79, 68, 87, 0.08);
  --shadow-md:     0 6px 20px rgba(79, 68, 87, 0.10);
  --shadow-lg:     0 10px 34px rgba(79, 68, 87, 0.12);
}

:root[data-theme="light-mint"] {
  --bg-base:       #f4fbfa;
  --bg-surface:    #fbfffe;
  --bg-elevated:   #eaf7f5;
  --bg-hover:      #dff1ee;
  --border:        rgba(72, 108, 104, 0.16);
  --border-bright: rgba(72, 108, 104, 0.24);

  --accent:        #74b9d6;
  --accent-hover:  #65aac8;
  --accent-dim:    rgba(116, 185, 214, 0.20);

  --green:         #73cfa6;
  --green-dim:     rgba(115, 207, 166, 0.20);
  --red:           #efb0b0;
  --red-dim:       rgba(239, 176, 176, 0.20);
  --yellow:        #f0dc9c;
  --yellow-dim:    rgba(240, 220, 156, 0.22);
  --blue:          #8fc3ea;
  --blue-dim:      rgba(143, 195, 234, 0.22);

  --text-primary:  #334b49;
  --text-secondary:#4f6966;
  --text-muted:    #728886;

  --shadow-sm:     0 2px 8px rgba(51, 75, 73, 0.08);
  --shadow-md:     0 6px 20px rgba(51, 75, 73, 0.10);
  --shadow-lg:     0 10px 34px rgba(51, 75, 73, 0.12);
}
/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width .3s cubic-bezier(.4,0,.2,1), transform .3s;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-sm); }

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.logo-icon { font-size: 22px; flex-shrink: 0; }
.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.3px;
  transition: opacity .2s;
}

.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section {
  padding: 16px 10px 6px;
  overflow: hidden;
}
.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: all .18s;
  position: relative;
}
.nav-item i { font-size: 16px; flex-shrink: 0; }
.nav-item span { transition: opacity .2s; }
.sidebar.collapsed .nav-item span { opacity: 0; width: 0; pointer-events: none; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item-sub { padding-left: 20px; font-size: 13px; color: var(--text-muted); }
.nav-item-sub:hover { color: var(--text-secondary); }
.sidebar.collapsed .nav-item-sub { padding-left: 10px; }

/* Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .user-details { opacity: 0; width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  color: var(--text-muted);
  font-size: 17px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: all .2s;
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); background: var(--red-dim); }

/* ═══════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-w-sm); }

/* Top Bar */
.top-bar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.date-display {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  align-items: center; justify-content: center;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 28px 28px;
  max-width: 1400px;
  width: 100%;
}

/* ═══════════════════════════════════════
   BOOTSTRAP OVERRIDES
═══════════════════════════════════════ */
.form-control, .form-select {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-bright) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-main) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(79,142,247,.15) !important;
  background: var(--bg-elevated) !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }
.form-control-app, .form-select-app { font-size: 14px !important; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  font-family: var(--font-main) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
}
.btn-primary:hover { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }

.btn-outline-secondary {
  border-color: var(--border-bright) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-main) !important;
  border-radius: var(--radius-sm) !important;
}
.btn-outline-secondary:hover { background: var(--bg-hover) !important; color: var(--text-primary) !important; }

.btn-outline-danger {
  border-color: var(--red) !important;
  color: var(--red) !important;
  font-family: var(--font-main) !important;
  border-radius: var(--radius-sm) !important;
}
.btn-outline-danger:hover { background: var(--red-dim) !important; }

.btn-success { font-family: var(--font-main) !important; font-weight: 600 !important; border-radius: var(--radius-sm) !important; }

.alert {
  border-radius: var(--radius-md) !important;
  font-size: 14px !important;
  border: 1px solid !important;
}
.alert-success { background: var(--green-dim) !important; border-color: rgba(74,222,128,.3) !important; color: var(--green) !important; }
.alert-danger  { background: var(--red-dim) !important; border-color: rgba(248,113,113,.3) !important; color: var(--red) !important; }
.alert-info    { background: var(--blue-dim) !important; border-color: rgba(96,165,250,.3) !important; color: var(--blue) !important; }
.btn-close { filter: invert(1) brightness(.6); }

/* ═══════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════ */
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.kpi-ingresos  .kpi-icon { background: var(--green-dim); color: var(--green); }
.kpi-gastos    .kpi-icon { background: var(--red-dim);   color: var(--red);   }
.kpi-balance   .kpi-icon { background: var(--blue-dim);  color: var(--blue);  }
.kpi-pendientes .kpi-icon { background: var(--yellow-dim); color: var(--yellow); }

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  font-family: var(--font-mono);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* ═══════════════════════════════════════
   CHART CARDS
═══════════════════════════════════════ */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chart-card-header {
  padding: 16px 20px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}
.chart-card-body { padding: 20px; }

.btn-link-sm {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.btn-link-sm:hover { color: var(--accent-hover); }

/* Pending list */
.pending-list { }
.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  transition: background .15s;
}
.pending-item:last-child { border-bottom: none; }
.pending-item:hover { background: var(--bg-hover); }
.pending-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.pending-cliente { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-concepto { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-amount { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--green); flex-shrink: 0; margin-left: 12px; }

.empty-state-sm {
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   TABLES
═══════════════════════════════════════ */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-app {
  margin: 0 !important;
  color: var(--text-primary) !important;
  font-size: 14px !important;
}
.table-app thead th {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .8px !important;
  text-transform: uppercase !important;
  border-color: var(--border) !important;
  padding: 12px 16px !important;
  white-space: nowrap;
}
.table-app tbody tr {
  border-color: var(--border) !important;
  transition: background .15s;
}
.table-app tbody tr:hover { background: var(--bg-hover) !important; }
.table-app td { padding: 11px 16px !important; border-color: var(--border) !important; vertical-align: middle !important; }
.table-app tfoot td { border-color: var(--border) !important; padding: 12px 16px !important; background: var(--bg-elevated) !important; }

.table-total td { font-size: 14px !important; }

.concepto-cell { max-width: 260px; }

/* Badges */
.badge-estado {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  letter-spacing: .3px;
}
.badge-pendiente  { background: var(--yellow-dim) !important; color: var(--yellow) !important; }
.badge-pagada     { background: var(--green-dim) !important;  color: var(--green) !important;  }
.badge-parcial    { background: var(--blue-dim) !important;   color: var(--blue) !important;   }
.badge-cancelada  { background: rgba(100,100,120,.2) !important; color: var(--text-muted) !important; }

.badge-count {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  padding: 3px 10px !important;
  font-weight: 700 !important;
}

/* Action buttons */
.action-btns { display: flex; align-items: center; justify-content: center; gap: 4px; }
.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--accent); }
.btn-icon-danger:hover { background: var(--red-dim) !important; color: var(--red) !important; }

.link-subtle { color: var(--text-secondary); }
.link-subtle:hover { color: var(--accent); }

/* ═══════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════ */
.filter-bar { flex: 1; margin-right: 16px; }
.filter-select { min-width: 140px !important; max-width: 200px; font-size: 13px !important; }

.btn-new {
  white-space: nowrap;
  font-size: 13px !important;
  padding: 7px 14px !important;
  border-radius: var(--radius-sm) !important;
}

/* ═══════════════════════════════════════
   FORM CARD
═══════════════════════════════════════ */
.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 860px;
}

/* ═══════════════════════════════════════
   DETAIL CARDS
═══════════════════════════════════════ */
.detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.detail-header h4 { font-size: 18px; font-weight: 700; }
.amount-display { font-size: 26px; font-weight: 700; font-family: var(--font-mono); color: var(--green); }
.detail-body { margin-bottom: 20px; }
.detail-field { margin-bottom: 12px; }
.detail-field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 4px; }
.detail-field span { font-size: 14px; color: var(--text-primary); }
.detail-section { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.detail-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 14px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 20px; }

/* Field list for persona */
.detail-field-list { display: flex; flex-direction: column; gap: 10px; }
.detail-field-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); }
.detail-field-row i { color: var(--accent); font-size: 15px; width: 20px; text-align: center; }

.persona-avatar-wrap { text-align: center; padding: 10px 0 16px; }
.persona-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}

/* Pagos */
.pagos-list { display: flex; flex-direction: column; gap: 6px; }
.pago-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.pago-fecha { color: var(--text-secondary); }
.pago-cantidad { font-family: var(--font-mono); font-weight: 600; color: var(--green); }
.pago-resumen { padding: 12px; background: var(--bg-elevated); border-radius: var(--radius-sm); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { display: block; margin-bottom: 16px; color: var(--text-muted); opacity: .5; }
.empty-state p { font-size: 15px; margin-bottom: 20px; }

/* Flash messages */
.flash-msg { font-size: 14px; margin-bottom: 20px; }

/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */
body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-base);
  overflow: hidden;
}

.login-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.login-bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
}
.shape-1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -150px; }
.shape-2 { width: 400px; height: 400px; background: var(--green); bottom: -100px; right: -100px; }
.shape-3 { width: 300px; height: 300px; background: #a78bfa; top: 40%; left: 40%; }

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { font-size: 48px; display: block; margin-bottom: 12px; }
.login-title { font-size: 26px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); }

.login-input { height: 52px !important; padding-top: 20px !important; }
.login-input ~ label { color: var(--text-muted) !important; }

.btn-login {
  height: 48px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-login:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,142,247,.35); }

.login-footer { text-align: center; margin-top: 24px; }

/* ═══════════════════════════════════════
   SIDEBAR OVERLAY (MOBILE)
═══════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 999;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0 !important; }
  .mobile-toggle { display: inline-flex; }
  .sidebar-toggle { display: none; }
  .content-area { padding: 16px; }
  .filter-bar { flex-direction: column; }
  .filter-bar form { flex-direction: column !important; }
  .filter-select { max-width: 100% !important; }
  .kpi-value { font-size: 18px; }
}

@media (max-width: 480px) {
  .top-bar { padding: 0 16px; }
  .page-title { font-size: 15px; }
  .date-display { display: none; }
  .form-card { padding: 20px 16px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* Text helpers */
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.text-warning { color: var(--yellow) !important; }
.text-muted   { color: var(--text-muted) !important; }
