/* Bankalytics — shared shell: tokens, reset, sidebar, page container,
   base typography, card primitive, mobile collapse. Page-specific
   styles stay in each HTML file. */

:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #e7eaef;
  --line-soft: #eef0f4;
  --ink: #0d1117;
  --ink-mid: #4b5563;
  --ink-soft: #6b7280;
  --accent: #2b59ff;
  --accent-soft: #eef2ff;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.03);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  font-feature-settings: 'cv11','ss01','ss03';
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-left: 220px;
}

.num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'tnum','zero'; }

/* Sidebar */
.sidenav {
  position: fixed; top: 0; left: 0;
  width: 220px; height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 24px 14px;
  display: flex; flex-direction: column; gap: 22px;
  overflow-y: auto;
  z-index: 10;
}
.sidenav-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 4px; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 2px 4px rgba(43,89,255,.18);
}
.brand-text { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.sidenav-section { display: flex; flex-direction: column; gap: 2px; }
.sidenav-label {
  font-size: 11px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 0 10px 6px; font-weight: 500;
}
.sidenav-item {
  display: block; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: var(--ink-mid); text-decoration: none;
  transition: background .12s, color .12s;
}
.sidenav-item:hover { background: var(--line-soft); color: var(--ink); }
.sidenav-item.is-active {
  background: var(--accent-soft); color: var(--ink); font-weight: 500;
}

/* Page container + base headings */
.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 24px 56px; }
header.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
header.top > div:first-child { min-width: 0; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.sub { color: var(--ink-mid); font-size: 13px; }

/* Card primitive */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.card-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

@media (max-width: 920px) {
  body { padding-left: 0; }
  .sidenav {
    position: static; width: 100%; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 12px 16px; gap: 14px;
    flex-direction: row; align-items: center;
  }
  .sidenav-section { flex-direction: row; gap: 4px; }
  .sidenav-label { display: none; }
  .sidenav-item { padding: 6px 10px; white-space: nowrap; }
  .wrap { padding: 24px 16px 40px; }
}

/* Live/sample chip — used near page titles to signal data freshness.
   Rendered by assets/freshness-chip.js into <span id="freshness-chip">. */
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-mid);
  white-space: nowrap;
}
.live-chip .dot { width: 7px; height: 7px; border-radius: 999px; background: #cbd5e1; }
.live-chip.is-live   { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.live-chip.is-live   .dot { background: #22c55e; }
.live-chip.is-sample { background: #fef9c3; border-color: #fde68a; color: #854d0e; }
.live-chip.is-sample .dot { background: #ca8a04; }
.live-chip.is-fail   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.live-chip.is-fail   .dot { background: #ef4444; }
.live-chip.is-loading .dot { background: #94a3b8; }
