/* NAAAS Boarding Tracker - Global styles */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-weight: 700;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  transition: background-color .3s ease, color .3s ease;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.01em; }

/* ========= Theme tokens (default = heritage / light) ========= */
:root, [data-theme="light"][data-palette="heritage"] {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #FBFAF6;
  --ink: #1A1F2E;
  --ink-soft: #3D4458;
  --muted: #6B7388;
  --muted-2: #94A0B5;
  --line: #E5E1D6;
  --line-2: #EFEBE0;
  --primary: #0F1F38;
  --primary-soft: #1B3556;
  --primary-ink: #FFFFFF;
  --accent: #C8973F;
  --accent-soft: #F4E5C2;
  --accent-ink: #2A1F0A;
  --success: #2F7D5C;
  --success-soft: #D6EDDF;
  --warning: #C97A1A;
  --warning-soft: #FBE8CB;
  --danger: #B43B3B;
  --danger-soft: #F7DADA;
  --info: #2F65B6;
  --info-soft: #DEE9F7;
  --shadow-sm: 0 1px 2px rgba(15,31,56,.04);
  --shadow: 0 4px 16px -4px rgba(15,31,56,.08), 0 2px 4px rgba(15,31,56,.04);
  --shadow-lg: 0 24px 48px -12px rgba(15,31,56,.16), 0 4px 12px rgba(15,31,56,.06);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

[data-theme="dark"][data-palette="heritage"] {
  --bg: #0A1424;
  --surface: #0F1F38;
  --surface-2: #14253E;
  --ink: #F1ECDF;
  --ink-soft: #D5CFC0;
  --muted: #98A1B5;
  --muted-2: #6E7790;
  --line: #1F324F;
  --line-2: #182942;
  --primary: #D4A24E;
  --primary-soft: #F4E5C2;
  --primary-ink: #0A1424;
  --accent: #D4A24E;
  --accent-soft: #2A2418;
  --accent-ink: #F4E5C2;
  --success: #6FD4A1;
  --success-soft: #1A3328;
  --warning: #F4B560;
  --warning-soft: #33240F;
  --danger: #F08585;
  --danger-soft: #3B1818;
  --info: #80B0F0;
  --info-soft: #122440;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 16px -4px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.5);
}

/* Joyful palette - sage/coral, cream */
[data-theme="light"][data-palette="joyful"] {
  --bg: #FBF8F2;
  --surface: #FFFFFF;
  --surface-2: #F6F1E6;
  --ink: #1F2D29;
  --ink-soft: #3F4F4A;
  --muted: #6B7773;
  --muted-2: #98A39E;
  --line: #E7E1D2;
  --line-2: #F0EADD;
  --primary: #16877A;
  --primary-soft: #B7E3DC;
  --primary-ink: #FFFFFF;
  --accent: #FF7A59;
  --accent-soft: #FFD9CD;
  --accent-ink: #5C1A0F;
  --success: #2F7D5C;
  --success-soft: #D6EDDF;
  --warning: #D9921F;
  --warning-soft: #FBE5C0;
  --danger: #C53B3B;
  --danger-soft: #F8DCDC;
  --info: #2F7DB6;
  --info-soft: #D9E9F4;
}

[data-theme="dark"][data-palette="joyful"] {
  --bg: #0E1A18;
  --surface: #142623;
  --surface-2: #1B302C;
  --ink: #F1ECDF;
  --ink-soft: #D5CFC0;
  --muted: #98A39E;
  --muted-2: #6B7773;
  --line: #233E39;
  --line-2: #1A2F2B;
  --primary: #4ECDC4;
  --primary-soft: #1A3F3B;
  --primary-ink: #051210;
  --accent: #FF8E70;
  --accent-soft: #3F1D14;
  --accent-ink: #FFD9CD;
  --success: #6FD4A1;
  --success-soft: #14342A;
  --warning: #F4B560;
  --warning-soft: #33240F;
  --danger: #F08585;
  --danger-soft: #3B1818;
  --info: #80B0F0;
  --info-soft: #122440;
}

/* Aurora palette - violet + lime */
[data-theme="light"][data-palette="aurora"] {
  --bg: #F7F4FB;
  --surface: #FFFFFF;
  --surface-2: #F0EAF8;
  --ink: #1B1530;
  --ink-soft: #3E3656;
  --muted: #6F6884;
  --muted-2: #9B95AD;
  --line: #E7DFF3;
  --line-2: #F0EAF8;
  --primary: #6E59F2;
  --primary-soft: #DDD3FB;
  --primary-ink: #FFFFFF;
  --accent: #FFB347;
  --accent-soft: #FFE6C2;
  --accent-ink: #4A2A04;
  --success: #16A271;
  --success-soft: #CDEEDB;
  --warning: #E89A1A;
  --warning-soft: #FBE5C0;
  --danger: #D84545;
  --danger-soft: #F8DCDC;
  --info: #3074D1;
  --info-soft: #D6E5F8;
}

[data-theme="dark"][data-palette="aurora"] {
  --bg: #0F0B1E;
  --surface: #181332;
  --surface-2: #221B42;
  --ink: #F1ECDF;
  --ink-soft: #D5CFC0;
  --muted: #9B95AD;
  --muted-2: #6F6884;
  --line: #2C2351;
  --line-2: #1F1840;
  --primary: #9B86FF;
  --primary-soft: #2C2351;
  --primary-ink: #0B0817;
  --accent: #FFB347;
  --accent-soft: #3F2A0C;
  --accent-ink: #FFE6C2;
  --success: #6FD4A1;
  --success-soft: #14342A;
  --warning: #F4B560;
  --warning-soft: #33240F;
  --danger: #F08585;
  --danger-soft: #3B1818;
  --info: #80B0F0;
  --info-soft: #122440;
}

/* Font pairings — unified to Arial (bold) across all themes. */
:root,
[data-fonts="premium"],
[data-fonts="modern"],
[data-fonts="editorial"],
[data-fonts="neo"] {
  --font-display: Arial, Helvetica, system-ui, sans-serif;
  --font-body: Arial, Helvetica, system-ui, sans-serif;
}

/* ========= Core components ========= */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: all .2s ease; white-space: nowrap; min-height: 44px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); filter: brightness(1.05); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--line-2); }
.btn-link { background: none; color: var(--primary); padding: 6px 8px; min-height: auto; }
.btn-link:hover { text-decoration: underline; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px; }
.btn-sm { padding: 7px 12px; min-height: 32px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; min-height: 50px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); transition: all .3s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-pad { padding: 20px; }
.card-pad-lg { padding: 28px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.badge-paid, .badge-approved { background: var(--success-soft); color: var(--success); }
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-rejected, .badge-overdue { background: var(--danger-soft); color: var(--danger); }
.badge-unpaid { background: var(--surface-2); color: var(--muted); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Inputs */
.input, .select, .textarea { width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; outline: none; transition: all .2s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.input::placeholder { color: var(--muted-2); }
/* Strip up/down spinner buttons from number inputs — admin + customer prefer
   typing the value directly (the spinners block free entry and let the field
   bump to 0/min on stray clicks). */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* Headings/text */
.h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); font-weight: 600; letter-spacing: -0.02em; }
.h2 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 32px); font-weight: 600; letter-spacing: -0.015em; }
.h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sub { color: var(--muted); font-size: 14px; }
.tnum { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Utility */
.flex { display: flex; }
.aic { align-items: center; }
.jcb { justify-content: space-between; }
.jce { justify-content: flex-end; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.fw { width: 100%; }
.tac { text-align: center; }
.muted { color: var(--muted); }
.tnum-bn { font-variant-numeric: tabular-nums; }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

.fade-in { animation: fadeIn .4s ease both; }
.slide-up { animation: slideUp .4s ease both; }
.stagger > * { animation: slideUp .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .09s; }
.stagger > *:nth-child(4) { animation-delay: .12s; }
.stagger > *:nth-child(5) { animation-delay: .15s; }
.stagger > *:nth-child(6) { animation-delay: .18s; }
.stagger > *:nth-child(7) { animation-delay: .21s; }
.stagger > *:nth-child(8) { animation-delay: .24s; }

/* Progress bar */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); }

/* Table-ish list */
.list { display: flex; flex-direction: column; }
.list-row { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.list-row:last-child { border-bottom: none; }

/* Top app bar */
.appbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }

/* ─── SIDEBAR (refined) ───────────────────────────────── */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface-2) 50%, var(--surface)) 100%);
  border-right: 1px solid var(--line);
  padding: 20px 12px 16px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Hide native scrollbar but keep scroll functional */
.sidebar .col {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar .col::-webkit-scrollbar { display: none; width: 0; height: 0; }

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 0 4px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease, transform .12s ease;
  cursor: pointer;
  user-select: none;
}
.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.sidebar-link:active { transform: scale(0.98); }
.sidebar-link.active {
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 25%, transparent);
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 4px;
  background: var(--accent);
}
.sidebar-link .icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; }
.sidebar-link.active .icon { opacity: 1; }

/* Mobile bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); display: flex; justify-content: space-around; z-index: 40; }
.bottom-link { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .2s ease; }
.bottom-link.active { color: var(--primary); }
.bottom-link svg { width: 22px; height: 22px; }

/* KPI */
.kpi { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; overflow: hidden; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.kpi-value { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-icon { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--primary); }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* Property image (gradient placeholder) */
.proj-img { width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; position: relative; overflow: hidden; }
.proj-img.vc { background: linear-gradient(135deg, #1B3556 0%, #0F1F38 50%, #2C4A78 100%); }
.proj-img.hh { background: linear-gradient(135deg, #2D5F3F 0%, #4A8F5F 50%, #87C29D 100%); }
.proj-img-deco { position: absolute; inset: 0; opacity: .2; background-image: radial-gradient(circle at 20% 30%, white 1px, transparent 2px), radial-gradient(circle at 80% 60%, white 1px, transparent 2px), radial-gradient(circle at 50% 80%, white 1px, transparent 2px); background-size: 60px 60px, 80px 80px, 100px 100px; }
.proj-img-icon { position: absolute; right: 18px; bottom: 18px; color: white; opacity: .7; }
.proj-img-tag { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.18); backdrop-filter: blur(8px); color: white; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* Toast */
.toast-wrap { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 100; }
.toast { background: var(--ink); color: var(--surface); padding: 14px 22px; border-radius: 14px; font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); animation: slideUp .3s ease both; display: flex; align-items: center; gap: 10px; }

/* Modal
   - `.modal-back` itself scrolls when the modal is taller than the viewport,
     so the header is always reachable (no more "scroll the page to find the popup").
   - `align-items: safe center` keeps short modals vertically centered while
     letting tall modals stick to the top so the user can scroll down to the buttons. */
.modal-back { position: fixed; inset: 0; background: rgba(15,31,56,.5); backdrop-filter: blur(8px); z-index: 80; display: flex; align-items: safe center; justify-content: center; padding: 20px; overflow-y: auto; animation: fadeIn .2s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 540px; width: 100%; margin: auto; animation: scaleIn .25s ease both; box-shadow: var(--shadow-lg); }

/* Stepper */
.stepper { display: flex; gap: 8px; margin-bottom: 24px; }
.step { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.step.active { background: var(--primary); }
.step.done { background: var(--success); }

/* Mobile responsive */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .container { padding: 0 16px; }
  .card-pad { padding: 16px; }
  .card-pad-lg { padding: 18px; }
  .hide-mobile { display: none !important; }
  .main-content { padding-bottom: 80px !important; padding-top: 60px; }
  /* Mobile header — always fixed at the top */
  .appbar.show-mobile {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface);
  }
}
@media (min-width: 901px) {
  .show-mobile { display: none !important; }
  .bottom-nav { display: none; }
}

/* Focus visible */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Scroll-bar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* Hero / public */
.hero { padding: 60px 0 80px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } .hero { padding: 32px 0 48px; } }

/* Feature icons */
.feat-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }

/* Chart axes */
.chart-grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart-axis text { fill: var(--muted); font-size: 11px; }

/* Subtle decorative gradient blobs (very subtle) */
.gradient-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; pointer-events: none; }

/* Tabs */
.tabs { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 12px; gap: 2px; }
.tab { padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .2s ease; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Drag drop */
.drop-zone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; transition: all .2s ease; cursor: pointer; background: var(--surface-2); }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }

/* Pill check (installment selector) */
.installment-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: all .2s ease; background: var(--surface); }
.installment-row.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.installment-row.disabled { opacity: .5; cursor: not-allowed; }
.checkbox-vis { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .2s ease; }
.installment-row.selected .checkbox-vis { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* Method picker tile */
.method-tile { padding: 14px 12px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: all .2s ease; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--surface); }
.method-tile.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.method-tile-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: white; }

/* Notification dot */
.notif-dot { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ──────────────────────────────────────────────────────────
   RESPONSIVE — small device improvements
   ────────────────────────────────────────────────────────── */

/* Default helper classes available on all screen sizes */
.resp-fw { width: 100%; }

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  /* Sidebar hidden, only show appbar on mobile */
  .sidebar { display: none; }
  .main-content { width: 100%; }
  .container { padding-left: 16px !important; padding-right: 16px !important; }
  .resp-padding { padding-left: 16px; padding-right: 16px; }

  /* Stack rows that have .resp-stack into vertical column */
  .resp-stack { flex-direction: column !important; align-items: stretch !important; }
  .resp-stack > * { width: 100%; }

  /* Grids — collapse to 2 cols */
  .grid-4, .resp-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: 1fr 1fr !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .grid[style*="gridTemplateColumns"] { grid-template-columns: 1fr !important; }

  /* Hero stacks */
  .hero-grid { grid-template-columns: 1fr !important; }

  /* Headings smaller */
  .h1 { font-size: clamp(26px, 6vw, 36px) !important; }
  .h2 { font-size: clamp(22px, 5vw, 28px) !important; }
  .h3 { font-size: 16px !important; }

  /* Modals full-width on small */
  .modal-content { width: 92vw !important; max-width: 92vw !important; }

  /* Reduce KPI cards padding */
  .card-pad-lg { padding: 18px !important; }
  .card-pad    { padding: 14px !important; }
}

/* Phone (≤ 600px) */
@media (max-width: 600px) {
  /* KPI grid → single column on phone */
  .grid-4, .resp-grid-4 { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .grid-3 { grid-template-columns: 1fr !important; }

  /* Tables get horizontal scroll (already set min-width) — make it obvious */
  table { font-size: 12px; }
  th, td { padding: 10px 12px !important; }

  /* Bottom nav padding */
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); }
  body { padding-bottom: 76px; }

  /* Cards full-bleed */
  .container { padding-left: 12px !important; padding-right: 12px !important; }
  .resp-padding { padding-left: 12px; padding-right: 12px; }

  /* Bigger tap targets */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; padding: 6px 12px; }
  .btn-icon { min-height: 38px; min-width: 38px; }

  /* Input + select bigger */
  .input, .textarea, select.input { font-size: 16px; }  /* prevents iOS zoom */

  /* Auth layout */
  .auth-grid { grid-template-columns: 1fr !important; }
  .auth-grid > div:first-child { display: none !important; }

  /* Hero stats stack */
  .hero .row.gap-32 > div { font-size: 13px; }

  /* Hide sidebar/desktop-only items */
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }

  /* Larger headings, less padding */
  h1.h1 { line-height: 1.2; }
  .card-pad-lg { padding: 14px !important; }

  /* OTP boxes smaller */
  .otp-boxes input { width: 38px !important; height: 48px !important; font-size: 18px !important; }
}

/* Very small phones (≤ 380px) */
@media (max-width: 380px) {
  .grid-4, .resp-grid-4 { grid-template-columns: 1fr !important; }
  .h2 { font-size: 20px !important; }
}

/* Touch-friendly scrolling for overflow tables */
.card > div[style*="overflowX"] { -webkit-overflow-scrolling: touch; }

/* File upload dropzone hover */
.dropzone-hover { transition: border-color .15s ease, background .15s ease; }
.dropzone-hover:hover { border-color: var(--primary) !important; background: var(--surface-3, #f7f8fa) !important; }
