@charset "UTF-8";
/* base.css — Fonts, colours and sizes (design tokens), base elements, utility classes.
   Loaded in order by templates/partials/styles.html. */

/* =========================== 1. Fonts & reset ============================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================ 2. Design tokens ============================ */
:root {
  /* ---- brand: refreshed indigo, softer and more luminous than the old #2a2185 */
  --primary-50: #eef1ff;
  --primary-100: #e0e5ff;
  --primary-200: #c7cfff;
  --primary-400: #7c7bf0;
  --primary-500: #6366f1;
  --primary-600: #5145cd;
  --primary-700: #423bb0;
  --primary-900: #241f5c;

  /* ---- accent: emerald marks "active" and "positive" */
  --accent-400: #34d399;
  --accent-500: #10b981;
  --accent-600: #059669;

  /* ---- semantic */
  --success: #059669;
  --success-bg: #e7f8f1;
  --warning: #b45309;
  --warning-bg: #fdf3e2;
  --danger: #be2f36;
  --danger-bg: #fdeaeb;
  --info: #0e7490;
  --info-bg: #e2f4fa;

  /* ---- surfaces (light) */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --surface-3: #f1f3fa;
  --border: #e8eaf3;
  --border-strong: #d6dae8;

  /* ---- text (light) */
  --text: #16192c;
  --text-2: #565b7d;
  --text-3: #868bab;
  --text-on-primary: #ffffff;

  /* ---- sidebar: stays dark in both themes */
  --nav-bg: #1b1a3a;
  --nav-bg-2: #232152;
  --nav-text: #a9abd0;
  --nav-text-strong: #ffffff;
  --nav-hover: rgba(255, 255, 255, 0.07);
  --nav-active: rgba(52, 211, 153, 0.14);
  --nav-accent: var(--accent-400);
  --nav-border: rgba(255, 255, 255, 0.08);

  /* ---- type scale */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font-ui);
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.875rem;
  --fs-base: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: clamp(1.125rem, 1.6vw, 1.3rem);
  --fs-2xl: clamp(1.35rem, 2.4vw, 1.75rem);
  --fs-3xl: clamp(1.75rem, 3.4vw, 2.35rem);

  /* ---- spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --gutter: clamp(16px, 2.4vw, 32px);
  --gap: clamp(16px, 1.8vw, 24px);

  /* ---- radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* ---- elevation: low-spread, layered, never muddy */
  --shadow-xs: 0 1px 2px rgba(22, 25, 44, 0.05);
  --shadow-sm: 0 2px 6px rgba(22, 25, 44, 0.06);
  --shadow-md: 0 6px 18px rgba(22, 25, 44, 0.08);
  --shadow-lg: 0 18px 40px rgba(22, 25, 44, 0.14);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.3);

  /* ---- layout */
  --nav-w: 264px;
  --nav-w-collapsed: 80px;
  --topbar-h: 44px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.15s var(--ease);
  --t: 0.25s var(--ease);
  --t-slow: 0.35s var(--ease);
}

/* ---------------------------- dark theme --------------------------------- */
[data-theme="dark"] {
  --bg: #10111f;
  --surface: #181a2c;
  --surface-2: #1e2036;
  --surface-3: #23263e;
  --border: #2a2d47;
  --border-strong: #383c5c;

  --text: #eceefb;
  --text-2: #a3a7c6;
  --text-3: #7c81a3;

  --primary-50: #232455;
  --primary-100: #2b2c68;
  --primary-500: #8183f5;
  --primary-600: #6f70ef;

  --success-bg: #10352b;
  --warning-bg: #3a2a12;
  --danger-bg: #3a1c20;
  --info-bg: #12303c;
  --success: #4ade9f;
  --warning: #f0b45f;
  --danger: #f4868c;
  --info: #56c4e4;

  --nav-bg: #14152b;
  --nav-bg-2: #1c1d3e;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* =========================== 3. Base elements ============================= */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t), color var(--t);
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
}

a {
  color: var(--primary-600);
  text-decoration: none;
}
a:hover {
  color: var(--primary-500);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* numbers line up in tables and stat tiles */
.tnum,
table td,
.stat__value {
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* one consistent focus ring for every interactive element */
:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
  background-clip: content-box;
}

/* ============================= 4. Utilities =============================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--text-2);
}
.dim {
  color: var(--text-3);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.row--between {
  justify-content: space-between;
}
.row--wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.up {
  color: var(--success);
}
.down {
  color: var(--danger);
}
.grid {
  display: grid;
  gap: var(--gap);
}
.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
/* Four stat tiles never split 3 + 1 (auto-fit did, on tablets, leaving one
   tile stranded on its own row): four across when there is room, otherwise
   a 2 × 2 block. */
.grid--cards:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1279px) {
  .grid--cards:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* phone: two compact tiles a row, rather than one tall tile per screen-width */
@media (max-width: 640px) {
  .grid--cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
  }
  .grid--cards .stat {
    gap: var(--s-3);
    padding: var(--s-4);
  }
  .grid--cards .stat__icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }
  .grid--cards .stat__value {
    font-size: var(--fs-2xl);
  }
}
/* only the narrowest phones go back to one a row */
@media (max-width: 340px) {
  .grid--cards,
  .grid--cards:has(> :nth-child(4):last-child) {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* main content + rail, collapsing to one column when cramped */
.grid--split {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
@media (max-width: 1100px) {
  .grid--split {
    grid-template-columns: minmax(0, 1fr);
  }
}
