/* VERIFIQ v2.2.0 - Complete Design System
   Copyright 2026 BBMW0 Technologies. Developed by Jia Wen Gan.
   Single-source dark navy theme. No legacy patch blocks.
   ═══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #060d1b;
  --navy:        #071220;
  --navy-2:      #0a1929;
  --navy-3:      #0e2035;
  --card:        #0d1e30;
  --card-2:      #112540;

  /* Borders */
  --border:      #1a3354;
  --border-2:    #234470;

  /* Text */
  --white:       #f0f4fb;
  --muted:       #6b8faf;
  --muted-2:     #9ab8d4;
  --mid-grey:    #8aaac8;

  /* Accents */
  --teal:        #00c8a8;
  --teal-l:      rgba(0,200,168,.14);
  --teal-m:      rgba(0,200,168,.45);
  --amber:       #f5a623;
  --gold:        #c9a84c;
  --sg-blue:     #3b82f6;
  --my-red:      #f87171;
  --green:       #22c55e;

  /* Semantic severity */
  --sev-critical: #ef4444;
  --sev-error:    #f97316;
  --sev-warning:  #eab308;
  --sev-pass:     #22c55e;
  --sev-info:     #3b82f6;

  /* Radius / shadow */
  --r:     8px;
  --r-sm:  5px;
  --r-lg:  14px;
  --shadow:    0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);

  /* Typography scale */
  --text-xs:   10px;
  --text-sm:   11px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   16px;
  --text-xl:   20px;

  /* Legacy aliases - referenced from JS template strings */
  --navy-dark:  #1a3354;   /* dark accent panel / section header bg */
  --black:      #060d1b;   /* near-black for form control text */
  --light-bg:   #0d1e30;   /* alternative card surface (same as --card) */
  --light-grey: #6b8faf;   /* muted text (same as --muted) */
  --text-muted: #9ab8d4;   /* body muted text (same as --muted-2) */
}

/* ── RESET ────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol',
               system-ui, -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code, pre, .monospace {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace !important;
}

/* ── BASE ─────────────────────────────────────────────────────────────────── */
body, html {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--white);
  background: var(--navy);
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
}

#app            { height: 100vh; overflow: hidden; }
#page-container { height: 100%; overflow-y: auto; padding: 20px 24px; }
#update-banner  { flex-shrink: 0; overflow: hidden; max-height: 90px; }

/* ── TYPOGRAPHY ───────────────────────────────────────────────────────────── */
h1 { font-size: 18px;  font-weight: 800; color: var(--white);  margin: 0 0 4px; letter-spacing: -.3px; }
h2 { font-size: 15px;  font-weight: 700; color: var(--white);  margin: 18px 0 8px; }
h3 { font-size: 13px;  font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 6px; }
p  { font-size: var(--text-base); line-height: 1.6; color: var(--muted-2); }
small { font-size: var(--text-sm); color: var(--muted); }

code {
  font-size: var(--text-sm);
  background: rgba(0,200,168,.1);
  color: var(--teal);
  padding: 2px 6px;
  border-radius: 4px;
}
pre code {
  background: var(--card);
  color: var(--white);
  display: block;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.6;
}

label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--muted-2);
  display: block;
  margin-bottom: 4px;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; filter: brightness(1.15); }

/* ── SCROLLBARS ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--teal-m); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ── CARDS ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.card-title    { font-size: var(--text-md); font-weight: 700; color: var(--white); letter-spacing: -.1px; }
.card-subtitle { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }

/* ── STAT GRID ────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-val {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -.5px;
}
.stat-lbl {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
}

.stat-val.green  { color: var(--green); }
.stat-val.amber  { color: var(--amber); }
.stat-val.red    { color: var(--sev-critical); }
.stat-val.teal   { color: var(--teal); }

/* KPI cards (dashboard) */
.kpi-card  { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.kpi-value { font-size: 28px; font-weight: 900; line-height: 1.1; color: var(--white); }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* ── SEVERITY BADGES ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: .3px;
}

.badge-critical { background: var(--sev-critical); color: #fff; }
.badge-error    { background: var(--sev-error);    color: #fff; }
.badge-warning  { background: var(--sev-warning);  color: #000; }
.badge-pass     { background: var(--sev-pass);     color: #fff; }
.badge-info     { background: var(--sev-info);     color: #fff; }

/* ── AGENCY BADGES ────────────────────────────────────────────────────────── */
.agency-BCA    { background: #1e3a5f; color: #60a5fa; border: 1px solid #1e3a5f; }
.agency-URA    { background: #1a1040; color: #a78bfa; border: 1px solid #312e81; }
.agency-SCDF   { background: #3b0000; color: #fca5a5; border: 1px solid #7f1d1d; }
.agency-LTA    { background: #0a2e1a; color: #4ade80; border: 1px solid #14532d; }
.agency-NEA    { background: #1e2800; color: #a3e635; border: 1px solid #3f6212; }
.agency-PUB    { background: #002a2a; color: #2dd4bf; border: 1px solid #0f766e; }
.agency-NParks { background: #0d2200; color: #86efac; border: 1px solid #166534; }
.agency-SLA    { background: #2a1500; color: #fdba74; border: 1px solid #9a3412; }
.agency-JTC    { background: #1a0030; color: #d8b4fe; border: 1px solid #6b21a8; }

[class^="agency-"], [class*=" agency-"] {
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 7px;
  display: inline-block;
  letter-spacing: .2px;
}

/* ── MODE INDICATORS ──────────────────────────────────────────────────────── */
.mode-sg       { color: var(--sg-blue); font-weight: 700; }
.mode-my       { color: var(--my-red);  font-weight: 700; }
.mode-combined { color: var(--teal);    font-weight: 700; }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled              { opacity: .38; cursor: not-allowed; }

.btn-primary  { background: var(--teal);        color: #000; }
.btn-teal     { background: var(--teal);        color: #000; }
.btn-outline  { background: transparent;        color: var(--teal);    border: 1.5px solid var(--teal); }
.btn-ghost    { background: transparent;        color: var(--muted-2); border: 1px solid var(--border); }
.btn-nav {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px; font-size: 12px;
  font-weight: 600; border: 1px solid var(--border);
  background: var(--card); color: var(--muted-2); cursor: pointer;
  font-family: inherit; transition: all .15s;
}

.btn-primary:hover, .btn-teal:hover { filter: brightness(1.12); }
.btn-outline:hover  { background: var(--teal-l); }
.btn-ghost:hover    { color: var(--white); border-color: var(--border-2); }
.btn-nav:hover      { background: var(--card-2); border-color: var(--teal-m); color: var(--white); }

/* ── SIDEBAR NAVIGATION ───────────────────────────────────────────────────── */
nav a, .nav-item, [class*="nav-"] > span, aside button, aside a {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: color .15s, background .15s;
}
nav a:hover, .nav-item:hover, aside button:hover {
  color: var(--white);
  background: var(--teal-l);
}
nav a.active, .nav-item.active, aside button.active {
  color: var(--teal);
  font-weight: 700;
}

/* Section labels in sidebar (WORKFLOW, RESULTS, etc.) */
.section-label,
[style*="font-size:10px"][style*="letter-spacing"] {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── TABS ─────────────────────────────────────────────────────────────────── */
.tab, [role="tab"] {
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.tab.active, [role="tab"][aria-selected="true"] {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 700;
}
.tab:hover { color: var(--white); }

/* ── FORM ELEMENTS ────────────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"],
select, textarea {
  background: var(--card);
  color: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-l);
}
select option { background: var(--card); color: var(--white); }

/* ── FILTER BAR ───────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 120px;
  height: 32px;
  padding: 4px 10px;
  font-size: var(--text-sm);
}
#sev-f, #disc-f, #ifc-f, #agency-f, #storey-f, #gw-f, #check-f {
  background: #0a1628;
  color: var(--white);
  border: 1px solid var(--border-2);
  font-size: 11px;
}

/* ── TABLES ───────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: var(--text-sm);
}

thead th {
  background: #071a2e;
  color: var(--muted-2);
  padding: 9px 12px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: .5px;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
  font-size: var(--text-sm);
  color: var(--white);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tbody td.cell-wrap { white-space: normal; max-width: none; overflow: visible; }

tbody tr:hover td { background: rgba(0,200,168,.06); }
tbody tr.row-critical td { background: rgba(239,68,68,.08); }
tbody tr.row-error    td { background: rgba(249,115,22,.08); }

/* Results table specific column widths */
table.results-table th:nth-child(1) { width: 80px; }
table.results-table th:nth-child(2) { width: 120px; }
table.results-table th:nth-child(3) { min-width: 180px; }
table.results-table th:nth-child(4) { width: 60px; }
table.results-table th:nth-child(5) { min-width: 200px; }
table.results-table th:nth-child(6) { min-width: 160px; }
table.results-table th:nth-child(7) { width: 70px; }

/* Results table text */
#results-table th { font-size: 10px; letter-spacing: .06em; }
#results-table td { font-size: 12px; line-height: 1.5; }
#results-table tr:hover td { filter: brightness(1.18); }

/* 3D viewer has its own mini-tables (stats, tree) - keep them dark */
#v-wrap table td { color: var(--muted-2); font-size: 11px; }
#v-wrap table th { color: var(--muted);   background: #071a2e; font-size: 10px; text-transform: uppercase; }

/* ── DETAIL / INFO PANELS ─────────────────────────────────────────────────── */
.detail-panel {
  background: var(--card-2);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-top: 10px;
}
.detail-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--muted);   font-size: 11px; min-width: 140px; flex-shrink: 0; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.detail-value { color: var(--white);   font-size: 13px; flex: 1; word-break: break-word; }

/* ── PROGRESS BARS ────────────────────────────────────────────────────────── */
.progress-bar-wrap,
.progress-track {
  background: var(--border);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}
.progress-bar-fill,
.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), rgba(0,200,168,.6));
  transition: width .3s ease;
}

/* ── LOADING ──────────────────────────────────────────────────────────────── */
.loading-overlay {
  background: rgba(6,13,27,.92);
  backdrop-filter: blur(8px);
}
.loading-spinner { border-top-color: var(--teal); }
.loading-label   { color: var(--muted-2); font-size: 13px; }

.loading-dots::after {
  content: '...';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%,100% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; }
}

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.empty-state .icon, .empty-state-icon { font-size: 36px; margin-bottom: 12px; display: block; }
.empty-state h3,   .empty-state-title { color: var(--muted-2); font-size: var(--text-lg); margin-bottom: 8px; font-weight: 600; }
.empty-state p,    .empty-state-desc  { font-size: var(--text-base); max-width: 300px; margin: 0 auto 18px; color: var(--muted); }

/* ── GUID ─────────────────────────────────────────────────────────────────── */
.guid {
  font-family: 'JetBrains Mono','Cascadia Code','Consolas',monospace;
  font-size: var(--text-xs);
  color: var(--muted);
  word-break: break-all;
  background: var(--card-2);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── SECTION RULE ─────────────────────────────────────────────────────────── */
.section-rule {
  border: none;
  border-top: 2px solid var(--teal);
  margin: 18px 0 14px;
  opacity: .3;
}

/* ── TEMPLATE SELECTOR ────────────────────────────────────────────────────── */
.template-card {
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  background: var(--card);
}
.template-card:hover     { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-l); }
.template-card.active    { border-color: var(--teal); background: var(--card-2); box-shadow: 0 0 0 2px var(--teal-l); }
.template-card .tmpl-name  { font-size: var(--text-base); font-weight: 700; color: var(--white); margin-bottom: 2px; }
.template-card .tmpl-desc  { font-size: var(--text-xs); color: var(--muted); line-height: 1.4; }
.template-card .tmpl-badge { font-size: var(--text-xs); font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-top: 5px; display: inline-block; }

/* ── 3D VIEWER ────────────────────────────────────────────────────────────── */
#viewer-wrap canvas {
  border-radius: 6px;
  display: block;
  width: 100%;
  height: 100%;
}
#v-canvas-wrap { min-height: 200px; }
#v-canvas      { display: block !important; }

/* Toolbar buttons must show emoji/unicode icons clearly */
#viewer-wrap button, button[onclick*="Viewer3DPage"], [id^="v-"],
.toolbar-btn {
  font-family: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif !important;
  font-size: 13px;
  color: var(--muted-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
#viewer-wrap button:hover, button[onclick*="Viewer3DPage"]:hover {
  color: var(--white);
  background: var(--teal-l);
  border-color: var(--teal-m);
}

#viewer-wrap [style*="background:#0a1628"],
#viewer-wrap [style*="background: #0a1628"] {
  background: #071522 !important;
  border-bottom: 1px solid var(--border) !important;
}

#viewer-wrap span[style*="font-size:9px"],
#viewer-wrap span[style*="font-size: 9px"] {
  color: var(--muted) !important;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── IFC TREE PANEL ───────────────────────────────────────────────────────── */
#ifc-tree-panel, [id*="ifc-tree"] {
  background: var(--card);
  border-right: 1px solid var(--border);
}
#ifc-tree, #v-tree { color: var(--muted-2); }
#ifc-tree div, #v-tree div { color: var(--muted-2); font-size: 12px; }
#ifc-tree-panel .tree-node { color: var(--muted-2); font-size: 12px; }
#ifc-tree-panel .tree-node:hover    { background: var(--teal-l); color: var(--white); }
#ifc-tree-panel .tree-node.selected { background: var(--teal-l); color: var(--teal); font-weight: 700; }

/* ── ELEMENT INSPECTOR ────────────────────────────────────────────────────── */
#element-inspector h4, [id*="inspector"] h4 {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
[id*="inspector"] .prop-name  { color: var(--muted-2); font-size: 11px; }
[id*="inspector"] .prop-value { color: var(--white);   font-size: 11px; }

/* ── 3D VIEWER STATUS / MODEL INFO ───────────────────────────────────────── */
#v-status, #v-engine, #v-model-info { color: var(--muted); font-size: 11px; }
#v-stats b { font-size: 13px; color: var(--white); }
#v-stats   { font-size: 12px; color: var(--muted-2); }

/* ── COMPLIANCE SCORE PANEL ───────────────────────────────────────────────── */
#compliance-score-panel, [id*="score-panel"] {
  background: linear-gradient(135deg, #071a2e, #0d2540);
  border-top: 1px solid var(--border);
}
#compliance-legend label, #compliance-legend { color: var(--muted-2); font-size: 12px; }

/* ── TOOLTIP ──────────────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0d1e30;
  color: var(--white);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 9999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── INLINE STYLE COLOUR OVERRIDES ───────────────────────────────────────── */
/* Correct light-mode inline colors so they're readable on dark background */
[style*="color:#374151"], [style*="color: #374151"] { color: var(--muted-2) !important; }
[style*="color:#475569"], [style*="color: #475569"] { color: var(--muted)   !important; }
[style*="color:#64748b"], [style*="color: #64748b"] { color: var(--muted)   !important; }
[style*="color:#6b7280"], [style*="color: #6b7280"] { color: var(--muted)   !important; }
[style*="color:#9ca3af"], [style*="color: #9ca3af"] { color: var(--muted-2) !important; }
[style*="color:#1e293b"], [style*="color: #1e293b"] { color: var(--muted-2) !important; }
[style*="color:#0f172a"], [style*="color: #0f172a"] { color: var(--white)   !important; }
[style*="color:#000"],    [style*="color: #000"]    { color: var(--white)   !important; }
[style*="color:#111"],    [style*="color:#222"]     { color: var(--white)   !important; }
[style*="color:#333"]                               { color: var(--white)   !important; }

/* Severity inline colors - override only where unreadable */
[style*="color:#eab308"], [style*="color:#EAB308"]   { color: #d97706 !important; }
[style*="color:#f97316"], [style*="color:#F97316"]   { color: #fb923c !important; }

/* Inline span severity badges */
span[style*="background:#ef4444"], span[style*="background:#EF4444"] { color: #fff !important; }
span[style*="background:#f97316"], span[style*="background:#F97316"] { color: #fff !important; }
span[style*="background:#eab308"], span[style*="background:#EAB308"] { color: #000 !important; }
span[style*="background:#22c55e"], span[style*="background:#22C55E"] { color: #fff !important; }

/* ── LAYOUT UTILITIES ─────────────────────────────────────────────────────── */
.two-col   { display: grid; grid-template-columns: 1fr 1fr;     gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.flex-row  { display: flex; align-items: center; gap: 8px; }
.flex-col  { display: flex; flex-direction: column; gap: 8px; }
.gap-sm    { gap: 6px; }
.gap-md    { gap: 12px; }
.mb-sm     { margin-bottom: 8px; }
.mb-md     { margin-bottom: 16px; }
.mb-lg     { margin-bottom: 24px; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  #page-container { padding: 16px 18px; }
  .three-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  #page-container { padding: 12px 14px; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar select, .filter-bar input { width: 100%; }
  thead th { font-size: 9px; padding: 7px 8px; }
  tbody td  { font-size: 10px; padding: 6px 8px; }
}
@media (max-width: 680px) {
  #page-container { padding: 10px; }
  .card { padding: 12px 14px; }
  h1 { font-size: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
