/* ============================================
   FUELTRACK PRO — STYLE.CSS
   Font: Plus Jakarta Sans + Space Grotesk
   Modes: Dark (default) + Light
============================================ */

/* ===== DARK THEME TOKENS ===== */
[data-theme="dark"] {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99,102,241,0.15);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gold: #eab308;

  --bg: #0c0e16;
  --surface: #13151f;
  --surface2: #1a1d2e;
  --surface3: #21253a;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.11);

  --text: #eef0ff;
  --text-muted: #7c85b0;
  --text-dim: #404668;

  --chart-grid: rgba(255,255,255,0.04);
  --chart-tick: #404668;
  --tooltip-bg: #1a1d2e;
  --tooltip-title: #7c85b0;
  --tooltip-body: #eef0ff;
}

/* ===== LIGHT THEME TOKENS ===== */
[data-theme="light"] {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-glow: rgba(79,70,229,0.1);
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --gold: #ca8a04;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface2: #f0f1f7;
  --surface3: #e8eaf3;
  --border: rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.12);

  --text: #111827;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;

  --chart-grid: rgba(0,0,0,0.05);
  --chart-tick: #9ca3af;
  --tooltip-bg: #ffffff;
  --tooltip-title: #6b7280;
  --tooltip-body: #111827;
}

/* ===== COMMON VARS ===== */
:root {
  --sidebar-w: 248px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --transition: 0.2s ease;
  --shadow: 0 4px 20px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
}

/* ===== RESET ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ===== LAYOUT ===== */
.app-container { display:flex; min-height:100vh; }

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left:0; top:0; bottom:0;
  z-index: 200;
  transition: transform var(--transition), background var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items:center; justify-content:center;
  font-size: 15px; color:#fff;
  flex-shrink:0;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-nav { padding: 14px 10px; flex:1; overflow-y:auto; }
.sidebar-nav ul { list-style:none; display:flex; flex-direction:column; gap:3px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  user-select: none;
}
.nav-item i { width: 17px; text-align:center; font-size:14px; }
.nav-item:hover { background:var(--surface2); color:var(--text); }
.nav-item.active { background:var(--primary-glow); color:var(--primary); font-weight:600; }
.nav-item .badge {
  margin-left:auto;
  background:var(--danger); color:#fff;
  font-size:9px; font-weight:700;
  width:16px; height:16px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction:column; gap:8px;
}

.sidebar-vehicle-box { padding: 0; }
.sv-label {
  font-size: 10px; text-transform:uppercase;
  letter-spacing:0.08em; color:var(--text-dim);
  display:block; margin-bottom:6px;
}
.sv-select {
  width:100%; background:var(--surface2);
  border:1px solid var(--border2); color:var(--text);
  border-radius:var(--radius-sm); padding:8px 10px;
  font-size:13px; font-family:inherit; cursor:pointer;
}
.sv-select:focus { outline:none; border-color:var(--primary); }

.theme-toggle {
  display:flex; align-items:center; gap:8px;
  width:100%; background:var(--surface2);
  border:1px solid var(--border); color:var(--text-muted);
  border-radius:var(--radius-sm); padding:9px 11px;
  font-size:13px; font-weight:500; font-family:inherit;
  cursor:pointer; transition:var(--transition);
}
.theme-toggle:hover { background:var(--surface3); color:var(--text); }
.theme-toggle i { font-size:14px; }

/* ============================================
   MAIN
============================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex:1; padding:28px;
  min-height:100vh;
}

/* ============================================
   PAGE
============================================ */
.page { display:none; }
.page.active { display:block; }

.page-header {
  display:flex; justify-content:space-between;
  align-items:center; gap:14px; flex-wrap:wrap;
  margin-bottom:24px;
}
.page-header > div:first-child { flex:1; min-width:0; }

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size:26px; font-weight:700;
  letter-spacing:-0.03em; color:var(--text);
}
.page-sub { font-size:13px; color:var(--text-muted); margin-top:3px; }

.mobile-menu-btn {
  display:none; position:fixed;
  top:14px; left:14px; z-index:300;
  width:42px; height:42px;
  background:var(--primary); border:none;
  border-radius:10px; color:#fff; font-size:17px;
  cursor:pointer; align-items:center; justify-content:center;
}

/* ============================================
   STAT STRIP
============================================ */
.stat-strip {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap:14px; margin-bottom:24px;
}

.stat-tile {
  padding:18px; border-radius:var(--radius);
  border:1px solid var(--border);
  display:flex; align-items:center; gap:14px;
  position:relative; overflow:hidden;
  transition: background var(--transition), border-color var(--transition);
}
.stat-tile::after {
  content:''; position:absolute;
  top:0; left:0; right:0; height:2px;
  border-radius:var(--radius) var(--radius) 0 0;
}
.tile-blue { background:rgba(99,102,241,0.07); }
.tile-blue::after { background:var(--primary); }
.tile-green { background:rgba(34,197,94,0.07); }
.tile-green::after { background:var(--success); }
.tile-gold { background:rgba(234,179,8,0.07); }
.tile-gold::after { background:var(--gold); }
.tile-red { background:rgba(239,68,68,0.07); }
.tile-red::after { background:var(--danger); }

.tile-icon {
  width:40px; height:40px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:16px; flex-shrink:0;
  background:var(--surface2);
}
.tile-blue .tile-icon { color:var(--primary); }
.tile-green .tile-icon { color:var(--success); }
.tile-gold .tile-icon { color:var(--gold); }
.tile-red .tile-icon { color:var(--danger); }

.tile-label { font-size:11px; color:var(--text-muted); margin-bottom:5px; font-weight:500; }
.tile-value {
  font-family:'Space Grotesk',sans-serif;
  font-size:20px; font-weight:700; line-height:1;
}

/* ============================================
   SUMMARY CARDS
============================================ */
.section-label {
  font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.1em;
  color:var(--text-dim); margin-bottom:12px;
  display:flex; align-items:center; gap:7px;
}

.summary-cards {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap:12px; margin-bottom:28px;
}

.s-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px 14px;
  display:flex; align-items:center; gap:11px;
  transition: background var(--transition);
}
.s-icon {
  width:36px; height:36px; background:var(--surface2);
  border-radius:9px; display:flex; align-items:center; justify-content:center;
  font-size:14px; color:var(--primary); flex-shrink:0;
}
.s-info { display:flex; flex-direction:column; min-width:0; }
.s-val {
  font-family:'Space Grotesk',sans-serif;
  font-size:16px; font-weight:700;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.s-lab { font-size:10px; color:var(--text-muted); margin-top:2px; }

/* ============================================
   CHARTS
============================================ */
.charts-grid {
  display:grid;
  grid-template-columns:2fr 1fr 1fr;
  gap:14px; min-width:0;
}
.chart-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px;
  min-width:0; overflow:hidden;
  transition: background var(--transition);
}
.chart-wide { grid-column:1; }
.chart-title {
  font-family:'Space Grotesk',sans-serif;
  font-size:12px; font-weight:600;
  color:var(--text-muted); margin-bottom:14px;
  text-transform:uppercase; letter-spacing:0.06em;
  display:flex; align-items:center; gap:6px;
}
.chart-wrap {
  position:relative; width:100%; height:200px;
}
.chart-wrap canvas {
  position:absolute; inset:0;
  width:100%!important; height:100%!important;
}
canvas { max-width:100%; display:block; }

/* ============================================
   BUTTONS
============================================ */
.btn-primary {
  background:var(--primary); color:#fff;
  border:none; border-radius:var(--radius-sm);
  padding:10px 18px; font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer;
  display:inline-flex; align-items:center; gap:7px;
  transition:var(--transition); white-space:nowrap;
}
.btn-primary:hover { background:var(--primary-dark); transform:translateY(-1px); }

.btn-secondary {
  background:var(--surface2); color:var(--text);
  border:1px solid var(--border2); border-radius:var(--radius-sm);
  padding:10px 18px; font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer; transition:var(--transition);
}
.btn-secondary:hover { background:var(--surface3); }

.btn-danger {
  background:rgba(239,68,68,0.12); color:var(--danger);
  border:1px solid rgba(239,68,68,0.25); border-radius:var(--radius-sm);
  padding:10px 18px; font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer; transition:var(--transition);
}
.btn-danger:hover { background:rgba(239,68,68,0.22); }

.btn-outline-green {
  background:rgba(34,197,94,0.08); color:var(--success);
  border:1px solid rgba(34,197,94,0.25); border-radius:var(--radius-sm);
  padding:10px 16px; font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer; transition:var(--transition);
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
}
.btn-outline-green:hover { background:rgba(34,197,94,0.15); }

.btn-outline-red {
  background:rgba(239,68,68,0.08); color:var(--danger);
  border:1px solid rgba(239,68,68,0.25); border-radius:var(--radius-sm);
  padding:10px 16px; font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer; transition:var(--transition);
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
}
.btn-outline-red:hover { background:rgba(239,68,68,0.15); }

.header-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* ============================================
   TABLE
============================================ */
.table-wrapper {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); overflow-x:auto;
}
table { width:100%; border-collapse:collapse; min-width:700px; }
thead { background:var(--surface2); }
th {
  padding:12px 14px; text-align:left;
  font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.07em;
  color:var(--text-muted); white-space:nowrap;
}
td {
  padding:12px 14px; font-size:13px;
  border-top:1px solid var(--border); color:var(--text);
  white-space:nowrap;
}
tbody tr:hover { background:var(--surface2); }
.empty-row { text-align:center; color:var(--text-dim); padding:40px!important; font-size:14px; white-space:normal; }

.del-btn {
  background:none; border:none; color:var(--text-dim);
  cursor:pointer; padding:5px 8px; border-radius:6px;
  font-size:13px; transition:var(--transition);
}
.del-btn:hover { color:var(--danger); background:rgba(239,68,68,0.08); }

/* ============================================
   MOBILE RECORD CARDS
============================================ */
.records-mobile { display:none; }

.rec-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px; margin-bottom:10px;
}
.rec-card-header {
  display:flex; justify-content:space-between;
  align-items:flex-start; margin-bottom:12px;
}
.rec-date { font-size:11px; color:var(--text-muted); }
.rec-vehicle { font-size:14px; font-weight:600; color:var(--primary); }
.rec-mileage { font-family:'Space Grotesk',sans-serif; font-size:22px; font-weight:700; }
.rec-mileage-label { font-size:11px; color:var(--text-muted); }
.rec-card-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.rec-cell { display:flex; flex-direction:column; }
.rec-cell-label { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.06em; }
.rec-cell-val { font-size:14px; font-weight:600; }
.rec-card-footer { margin-top:12px; display:flex; justify-content:flex-end; }

/* ============================================
   EXPENSE SUMMARY BAR
============================================ */
.expense-summary {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:12px; margin-bottom:20px;
}
.exp-sum-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px 16px;
  display:flex; align-items:center; gap:10px;
}
.exp-sum-icon {
  width:34px; height:34px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; flex-shrink:0; background:var(--surface2);
  color:var(--primary);
}
.exp-sum-val { font-family:'Space Grotesk',sans-serif; font-size:15px; font-weight:700; }
.exp-sum-lab { font-size:10px; color:var(--text-muted); }

/* Category pill in table */
.cat-pill {
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600;
}
.cat-service   { background:rgba(99,102,241,0.12); color:var(--primary); }
.cat-parts     { background:rgba(234,179,8,0.12); color:var(--gold); }
.cat-tyre      { background:rgba(34,197,94,0.12); color:var(--success); }
.cat-battery   { background:rgba(239,68,68,0.12); color:var(--danger); }
.cat-insurance { background:rgba(14,165,233,0.12); color:#0ea5e9; }
.cat-pollution { background:rgba(16,185,129,0.12); color:#10b981; }
.cat-cleaning  { background:rgba(168,85,247,0.12); color:#a855f7; }
.cat-other     { background:var(--surface2); color:var(--text-muted); }

/* ============================================
   VEHICLES
============================================ */
.vehicle-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:14px;
}
.vehicle-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px;
  position:relative; transition:var(--transition);
}
.vehicle-card:hover { border-color:var(--border2); }
.vehicle-card.is-active { border-color:var(--primary); background:var(--primary-glow); }
.vc-top { display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; }
.vc-icon {
  width:44px; height:44px; background:var(--surface2);
  border-radius:11px; display:flex; align-items:center;
  justify-content:center; font-size:20px; flex-shrink:0;
}
.vc-name { font-family:'Space Grotesk',sans-serif; font-size:16px; font-weight:700; }
.vc-number { font-size:12px; color:var(--text-muted); margin-top:2px; }
.vc-tags { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.vc-tag {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:5px; padding:3px 9px; font-size:11px; color:var(--text-muted); font-weight:500;
}
.vc-actions { display:flex; gap:7px; }
.vc-btn-set {
  flex:1; background:var(--primary-glow); color:var(--primary);
  border:1px solid var(--primary); border-radius:var(--radius-sm);
  padding:8px; font-size:12px; font-weight:600; font-family:inherit;
  cursor:pointer; transition:var(--transition);
}
.vc-btn-set:hover { background:rgba(99,102,241,0.2); }
.vc-btn-edit {
  background:var(--surface2); color:var(--text-muted);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:8px 11px; font-size:12px; font-family:inherit; cursor:pointer; transition:var(--transition);
}
.vc-btn-edit:hover { color:var(--text); background:var(--surface3); }
.vc-btn-del {
  background:none; color:var(--text-dim);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:8px 11px; font-size:12px; font-family:inherit; cursor:pointer; transition:var(--transition);
}
.vc-btn-del:hover { color:var(--danger); border-color:var(--danger); background:rgba(239,68,68,0.07); }
.active-badge {
  position:absolute; top:13px; right:13px;
  background:var(--primary); color:#fff;
  font-size:10px; font-weight:700; padding:3px 8px; border-radius:20px;
}

/* ============================================
   REMINDERS PAGE
============================================ */
.reminder-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(290px,1fr));
  gap:12px;
}
.rem-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px;
  position:relative; overflow:hidden;
}
.rem-card::before {
  content:''; position:absolute;
  left:0; top:0; bottom:0; width:4px;
}
.rem-ok::before   { background:var(--success); }
.rem-warn::before { background:var(--warning); }
.rem-overdue::before { background:var(--danger); }

.rem-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.rem-type { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; }
.rem-type.ok      { color:var(--success); }
.rem-type.warn    { color:var(--warning); }
.rem-type.overdue { color:var(--danger); }
.rem-vehicle { font-family:'Space Grotesk',sans-serif; font-size:15px; font-weight:700; margin-bottom:3px; }
.rem-date { font-size:12px; color:var(--text-muted); }
.rem-note { font-size:11px; color:var(--text-dim); margin-top:5px; }
.rem-days { font-size:12px; font-weight:600; margin-top:6px; }
.rem-days.ok      { color:var(--success); }
.rem-days.warn    { color:var(--warning); }
.rem-days.overdue { color:var(--danger); }
.rem-trigger-badge {
  display:inline-flex; align-items:center; gap:4px;
  background:var(--surface2); border:1px solid var(--border);
  border-radius:5px; padding:2px 7px; font-size:10px;
  color:var(--text-muted); margin-top:6px; font-weight:500;
}
.rem-del {
  background:none; border:none; color:var(--text-dim);
  cursor:pointer; font-size:13px; padding:4px;
  border-radius:5px; transition:var(--transition); flex-shrink:0;
}
.rem-del:hover { color:var(--danger); }

/* ============================================
   REMINDER TRIGGER TOGGLE
============================================ */
.toggle-group {
  display:flex; gap:6px; margin-top:2px;
}
.tg-btn {
  flex:1; padding:9px; border-radius:var(--radius-sm);
  font-size:13px; font-weight:600; font-family:inherit;
  cursor:pointer; transition:var(--transition);
  background:var(--surface2); color:var(--text-muted);
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.tg-btn.active { background:var(--primary-glow); color:var(--primary); border-color:var(--primary); }

.fg-group {
  display:contents;
}

/* ============================================
   KM REMINDER ALERT (inside record modal)
============================================ */
.km-reminder-alert {
  margin-top:14px;
  background:rgba(245,158,11,0.1);
  border:1px solid rgba(245,158,11,0.3);
  border-radius:var(--radius-sm);
  padding:12px 14px;
}
.kra-item {
  display:flex; align-items:flex-start; gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(245,158,11,0.15);
}
.kra-item:last-child { border-bottom:none; }
.kra-icon { color:var(--warning); font-size:14px; margin-top:1px; }
.kra-body { font-size:12px; line-height:1.5; }
.kra-title { font-weight:700; color:var(--warning); }
.kra-sub { color:var(--text-muted); }

/* ============================================
   SETTINGS
============================================ */
.settings-list { display:flex; flex-direction:column; gap:10px; }
.setting-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px 22px;
  display:flex; align-items:center; justify-content:space-between;
  gap:18px; flex-wrap:wrap;
  transition: background var(--transition);
}
.setting-info { display:flex; align-items:center; gap:14px; }
.setting-info > i {
  width:38px; height:38px; background:var(--surface2);
  border-radius:9px; display:flex; align-items:center; justify-content:center;
  font-size:15px; color:var(--primary);
}
.setting-info strong { font-size:14px; font-weight:600; display:block; }
.setting-info p { font-size:12px; color:var(--text-muted); margin-top:2px; }
.danger-card { border-color:rgba(239,68,68,0.18); }
.danger-card .setting-info > i { color:var(--danger); }

/* ============================================
   MODAL
============================================ */
.modal {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.65);
  backdrop-filter:blur(5px);
  display:none; justify-content:center; align-items:center;
  padding:16px; z-index:1000;
}
.modal.show { display:flex; }
.modal-card {
  background:var(--surface); border:1px solid var(--border2);
  width:100%; max-width:540px; border-radius:18px;
  box-shadow:var(--shadow-lg);
  animation:slideUp 0.2s ease;
  max-height:90vh; overflow-y:auto;
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}
.modal-hd {
  display:flex; justify-content:space-between; align-items:center;
  padding:18px 22px; border-bottom:1px solid var(--border);
}
.modal-hd h2 {
  font-family:'Space Grotesk',sans-serif;
  font-size:17px; font-weight:700;
}
.modal-close {
  background:var(--surface2); border:1px solid var(--border);
  color:var(--text-muted); width:30px; height:30px;
  border-radius:7px; cursor:pointer; font-size:19px;
  display:flex; align-items:center; justify-content:center;
  transition:var(--transition); line-height:1;
}
.modal-close:hover { color:var(--text); background:var(--surface3); }
.modal-body { padding:22px; }
.modal-ft {
  padding:14px 22px; border-top:1px solid var(--border);
  display:flex; justify-content:flex-end; gap:8px;
}

/* ============================================
   FORMS
============================================ */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.fg { display:flex; flex-direction:column; gap:6px; }
.fg label {
  font-size:11px; font-weight:700; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:0.05em;
}
.fg input, .fg select {
  background:var(--surface2); border:1px solid var(--border2);
  color:var(--text); border-radius:var(--radius-sm);
  padding:10px 13px; font-size:13.5px; font-family:inherit;
  transition:var(--transition);
}
.fg input:focus, .fg select:focus {
  outline:none; border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-glow);
}
.fg input::placeholder { color:var(--text-dim); }

.calc-preview {
  margin-top:14px; background:var(--surface2);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:14px; display:grid; grid-template-columns:1fr 1fr; gap:12px;
}
.cp-item { display:flex; flex-direction:column; gap:3px; }
.cp-item span { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.06em; }
.cp-item strong {
  font-family:'Space Grotesk',sans-serif;
  font-size:17px; color:var(--primary);
}

/* ============================================
   REMINDER POPUP (on load)
============================================ */
.reminder-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.78);
  backdrop-filter:blur(7px);
  z-index:2000;
  justify-content:center; align-items:center; padding:20px;
}
.reminder-popup {
  background:var(--surface); border:1px solid var(--border2);
  border-radius:20px; width:100%; max-width:460px;
  box-shadow:var(--shadow-lg); overflow:hidden;
  animation:slideUp 0.3s ease;
  max-height:85vh; display:flex; flex-direction:column;
}
.reminder-header {
  background:var(--surface2); padding:22px;
  text-align:center; border-bottom:1px solid var(--border);
}
.reminder-icon {
  width:52px; height:52px;
  background:rgba(245,158,11,0.12);
  border:2px solid var(--warning); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; color:var(--warning); margin:0 auto 12px;
  animation:pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow:0 0 0 0 rgba(245,158,11,0.3); }
  50%      { box-shadow:0 0 0 8px rgba(245,158,11,0); }
}
.reminder-header h2 { font-family:'Space Grotesk',sans-serif; font-size:19px; font-weight:700; margin-bottom:4px; }
#reminderSubtitle { font-size:12px; color:var(--text-muted); }
.reminder-list { padding:14px; overflow-y:auto; flex:1; }
.rl-item {
  display:flex; align-items:flex-start; gap:11px;
  padding:11px; background:var(--surface2);
  border-radius:9px; margin-bottom:7px; border-left:4px solid;
}
.rl-item.warn    { border-color:var(--warning); }
.rl-item.overdue { border-color:var(--danger); }
.rl-icon { font-size:16px; flex-shrink:0; margin-top:1px; }
.rl-item.warn .rl-icon    { color:var(--warning); }
.rl-item.overdue .rl-icon { color:var(--danger); }
.rl-body { flex:1; }
.rl-title { font-size:13px; font-weight:600; }
.rl-sub   { font-size:11px; color:var(--text-muted); margin-top:2px; }
.btn-noted {
  background:var(--primary); color:#fff; border:none;
  border-radius:0 0 20px 20px; padding:15px; width:100%;
  font-size:14px; font-weight:700; font-family:inherit; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:var(--transition);
}
.btn-noted:hover { background:var(--primary-dark); }

/* ============================================
   EMPTY STATES
============================================ */
.empty-state {
  color:var(--text-dim); font-size:14px; padding:48px;
  text-align:center; line-height:1.8;
  border:1px dashed var(--border); border-radius:var(--radius);
  grid-column:1/-1;
}

/* ============================================
   SCROLLBAR
============================================ */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--surface3); border-radius:10px; }

/* Sidebar overlay */
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:199; }
.sidebar-overlay.show { display:block; }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width:1200px) {
  .charts-grid { grid-template-columns:1fr 1fr; }
  .chart-wide  { grid-column:1 / -1; }
}

@media (max-width:900px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); box-shadow:8px 0 40px rgba(0,0,0,0.5); }
  .mobile-menu-btn { display:flex; }
  .main-content { margin-left:0; padding:66px 14px 22px; }
  .charts-grid { grid-template-columns:1fr; }
  .chart-wide  { grid-column:1; }
  .table-wrapper { display:none; }
  .records-mobile { display:block; }
  .page-header { flex-direction:column; align-items:flex-start; }
  .header-actions { width:100%; }
  .header-actions button { flex:1; justify-content:center; }
}

@media (max-width:600px) {
  .main-content { padding:60px 12px 20px; }
  .stat-strip { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-tile { padding:14px 12px; }
  .tile-value { font-size:17px; }
  .summary-cards { grid-template-columns:1fr 1fr; gap:10px; }
  .s-card { padding:12px 10px; gap:8px; }
  .chart-wrap { height:170px; }
  .form-grid { grid-template-columns:1fr; }
  .calc-preview { grid-template-columns:1fr; }
  .page-title { font-size:22px; }
  .modal-ft { flex-direction:column-reverse; }
  .modal-ft button { width:100%; justify-content:center; }
  .setting-card { flex-direction:column; align-items:flex-start; }
  .setting-card button, .setting-card label { width:100%; text-align:center; justify-content:center; }
  .rec-card-grid { grid-template-columns:1fr 1fr; }
  .toggle-group { flex-direction:column; }
}

@media (max-width:380px) {
  .stat-strip { grid-template-columns:1fr; }
  .summary-cards { grid-template-columns:1fr; }
}
CSSEOF
