/* =====================================================================
   School Management Software — design system
   Base components. The Campus theme at the end of this file sets the final look.
   ===================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-ext-500.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-ext-600.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-ext-700.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-ext-800.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(../fonts/PlusJakartaSans-latin-800.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }


:root {
  --paper: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #eceef1;
  --line: #dde1e6;
  --line-2: #e8ebef;
  --ink: #162739;
  --ink-2: #3f4d5e;
  --ink-3: #7a8796;
  --ink-4: #a8b2bd;

  --tungsten: #2fc4b2;
  --tungsten-ink: #0f7c6f;
  --tungsten-wash: #dcf6f2;
  --chroma: #18a383;
  --chroma-ink: #0d6e57;
  --chroma-wash: #dcf3ec;
  --steel: #3c536e;
  --steel-ink: #2d435d;
  --steel-wash: #e4eaf1;
  --rec: #d64545;
  --rec-ink: #a42c2c;
  --rec-wash: #fae3e1;
  --plum: #8a6cc0;
  --mute-wash: #eceef1;

  --rail: #162739;
  --rail-2: #1e3248;
  --rail-3: #2a4058;
  --rail-ink: #b3c0cf;
  --rail-ink-2: #7c90a6;

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
  --shadow-pop: 0 12px 32px -8px rgba(20, 18, 12, .22), 0 2px 6px rgba(20, 18, 12, .08);
  --shadow-card: 0 1px 0 rgba(20, 18, 12, .03);

  --f-ui: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-display: "Barlow Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --rail-w: 244px;
  --top-h: 56px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0c141d;
  --surface: #132030;
  --surface-2: #172638;
  --surface-3: #1d2e42;
  --line: #2a3d53;
  --line-2: #22354a;
  --ink: #eef2f6;
  --ink-2: #b6c2cf;
  --ink-3: #8597aa;
  --ink-4: #5a6d82;
  --tungsten-ink: #f2bb62;
  --tungsten-wash: #3a2d16;
  --chroma-ink: #4fd1ae;
  --chroma-wash: #12332b;
  --steel-ink: #9fb6d1;
  --steel-wash: #1c2c40;
  --rec-ink: #f08080;
  --rec-wash: #3a1b1b;
  --mute-wash: #1f2f42;
  --rail: #08111a;
  --rail-2: #0f1c2a;
  --rail-3: #1a2b3e;
  --shadow-pop: 0 16px 40px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--steel-ink); }
a.link:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.mono { font-family: var(--f-mono); font-size: .9em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { flex: none; vertical-align: middle; }
.text-ok { color: var(--chroma-ink); }
.text-bad { color: var(--rec-ink); }
.text-warn { color: var(--tungsten-ink); }
::selection { background: var(--tungsten); color: #1a1205; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.shell.rail-collapsed { --rail-w: 64px; }

.rail {
  position: sticky; top: 0; height: 100vh;
  background: var(--rail);
  color: var(--rail-ink);
  display: flex; flex-direction: column;
  border-right: 1px solid #000;
  z-index: 40;
}
.rail-brand {
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--rail-3);
  color: #fff;
  overflow: hidden;
}
.brand-mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 7px;
  background: var(--tungsten);
  display: grid; place-items: center;
  color: #1c1305;
  position: relative;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { line-height: 1.05; white-space: nowrap; }
.brand-text b { display: block; font-family: var(--f-display); font-size: 17px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.brand-text span { font-size: 10.5px; color: var(--rail-ink-2); letter-spacing: .14em; text-transform: uppercase; font-family: var(--f-mono); }

.rail-nav { flex: 1; overflow-y: auto; padding: 10px 10px 24px; scrollbar-width: thin; scrollbar-color: var(--rail-3) transparent; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-group-title {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; cursor: pointer;
  font: 600 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--rail-ink-2);
  padding: 6px 8px;
}
.nav-group-title .ico { transition: transform .15s; }
.nav-group.is-closed .nav-group-title .ico { transform: rotate(-90deg); }
.nav-group.is-closed .nav-items { display: none; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px;
  margin: 1px 0;
  border-radius: var(--r);
  color: var(--rail-ink);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
}
.nav-link:hover { background: var(--rail-2); color: #fff; }
.nav-link.is-active { background: var(--rail-3); color: #fff; }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tungsten);
}
.nav-link .count {
  margin-left: auto; font: 500 10.5px/1 var(--f-mono);
  padding: 3px 6px; border-radius: 3px; background: var(--rail-3); color: var(--rail-ink);
}
.nav-link .count.hot { background: var(--rec); color: #fff; }
.rail-foot { padding: 12px 16px; border-top: 1px solid var(--rail-3); font: 10.5px var(--f-mono); color: var(--rail-ink-2); letter-spacing: .06em; display: flex; justify-content: space-between; }

.shell.rail-collapsed .brand-text,
.shell.rail-collapsed .nav-link span,
.shell.rail-collapsed .nav-link .count,
.shell.rail-collapsed .nav-group-title,
.shell.rail-collapsed .rail-foot { display: none; }
.shell.rail-collapsed .nav-link { justify-content: center; padding: 9px 0; }
.shell.rail-collapsed .nav-group { margin-top: 6px; border-top: 1px solid var(--rail-3); padding-top: 6px; }
.shell.rail-collapsed .nav-group.is-closed .nav-items { display: block; }

.main { min-width: 0; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--r);
  border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn .dot-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--rec); color: #fff; font: 600 10px/16px var(--f-mono); text-align: center;
  border: 2px solid var(--paper);
}
.search-box { position: relative; flex: 0 1 440px; min-width: 200px; }
.search-box input {
  width: 100%; height: 36px;
  padding: 0 64px 0 36px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: inherit;
}
.search-box input:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tungsten) 25%, transparent); }
.search-box > .ico { position: absolute; left: 11px; top: 9px; color: var(--ink-3); }
.search-box kbd { position: absolute; right: 8px; top: 8px; }
kbd { font: 500 10.5px/1 var(--f-mono); padding: 3px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-3); background: var(--surface-2); }
.search-results {
  position: absolute; top: 42px; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); max-height: 420px; overflow: auto; padding: 6px; display: none;
}
.search-results.open { display: block; }
.search-results .sr-group { font: 600 10px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 4px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r); }
.search-results a:hover, .search-results a.is-focus { background: var(--surface-3); }
.search-results a small { color: var(--ink-3); margin-left: auto; font-family: var(--f-mono); font-size: 11px; }

.timecode {
  font: 500 12px var(--f-mono); color: var(--ink-3);
  padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); display: flex; align-items: center; gap: 7px; letter-spacing: .02em;
}
.timecode i { width: 7px; height: 7px; border-radius: 50%; background: var(--rec); animation: rec 1.6s infinite; }
@keyframes rec { 50% { opacity: .25; } }
.top-spacer { flex: 1; }
.branch-select {
  height: 34px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); font: 500 13px var(--f-ui); padding: 0 28px 0 10px; max-width: 200px;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2382858d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font: 600 12px var(--f-ui); color: #fff;
  background: linear-gradient(135deg, #3c536e, #162739);
  border: 1px solid var(--line);
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; border-radius: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 3px 6px 3px 3px; border-radius: 20px; color: var(--ink); }
.profile-btn:hover { background: var(--surface); }
.profile-btn .who { text-align: left; line-height: 1.15; }
.profile-btn .who b { display: block; font-size: 13px; font-weight: 600; }
.profile-btn .who span { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Dropdowns / popovers ---------- */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); padding: 6px; z-index: 60; display: none;
}
.dd.open > .dd-menu { display: block; animation: pop .12s ease-out; }
.dd-menu.left { left: 0; right: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.dd-menu a, .dd-menu button.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r); border: 0; background: none; cursor: pointer;
  font: 500 13px var(--f-ui); color: var(--ink); text-align: left;
}
.dd-menu a:hover, .dd-menu button.dd-item:hover { background: var(--surface-3); }
.dd-menu .dd-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-menu .dd-head { padding: 8px 10px 6px; font: 600 10px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.notif-menu { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.notif-menu .notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--tungsten-wash) 55%, transparent); }
.notif-item .n-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tungsten); margin-top: 6px; flex: none; }
.notif-item:not(.unread) .n-dot { background: var(--line); }
.notif-item b { font-weight: 600; font-size: 13px; display: block; }
.notif-item p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.notif-item time { font: 11px var(--f-mono); color: var(--ink-3); }

/* ---------- Page ---------- */
.content { padding: 22px 28px 60px; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: .5; }
.page-title { font-family: var(--f-display); font-size: 30px; font-weight: 600; letter-spacing: .005em; line-height: 1.05; }
.page-sub { color: var(--ink-3); margin-top: 4px; font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font: 600 13px var(--f-ui); letter-spacing: .01em;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--ink-4); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #22384f; border-color: #22384f; }
:root[data-theme="dark"] .btn-primary { background: var(--tungsten); border-color: var(--tungsten); color: #1c1305; }
:root[data-theme="dark"] .btn-primary:hover { background: #ffb43f; }
.btn-accent { background: var(--tungsten); border-color: var(--tungsten); color: var(--on-accent, #162739); }
.btn-accent:hover { filter: brightness(1.08); }
.btn-danger { color: var(--rec-ink); }
.btn-danger:hover { background: var(--rec-wash); border-color: var(--rec); }
.btn-solid-danger { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn-ghost { border-color: transparent; background: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: var(--r-sm); gap: 4px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.btn-group .btn.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); z-index: 1; }
.btn.is-loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3, .card-title { font-family: var(--f-display); font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.card-head .sub { font-size: 12px; color: var(--ink-3); }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.slate-label { font: 600 10.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.slate-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.slate-label:first-child { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-side { grid-template-columns: 320px minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }

/* ---------- KPI tiles ---------- */
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px 14px; overflow: hidden; min-width: 0;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--kpi-c, var(--ink-4)); }
.kpi.c-tungsten { --kpi-c: var(--tungsten); }
.kpi.c-chroma { --kpi-c: var(--chroma); }
.kpi.c-steel { --kpi-c: var(--steel); }
.kpi.c-rec { --kpi-c: var(--rec); }
.kpi.c-plum { --kpi-c: var(--plum); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 600 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.kpi-value { font-family: var(--f-display); font-size: 31px; font-weight: 600; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: .005em; }
.kpi-value small { font-size: 15px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.kpi a.kpi-link { position: absolute; inset: 0; }
.delta { display: inline-flex; align-items: center; gap: 2px; font: 600 11.5px var(--f-mono); padding: 1px 5px; border-radius: 3px; }
.delta.up { color: var(--chroma-ink); background: var(--chroma-wash); }
.delta.down { color: var(--rec-ink); background: var(--rec-wash); }
.delta.flat { color: var(--ink-3); background: var(--mute-wash); }
.kpi .spark { position: absolute; right: 12px; top: 34px; width: 84px; height: 26px; opacity: .9; }
.kpi:has(.spark) .kpi-value { padding-right: 90px; }

/* ---------- Slate (dashboard hero) ---------- */
.slate {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0;
  background: var(--rail); color: #e9e7e1; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid #000; margin-bottom: 18px;
}
.slate-stripes {
  width: 92px;
  background: var(--tungsten);
  border-right: 1px solid #000;
}
.slate-body { padding: 16px 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.slate-cell { padding: 2px 18px; border-left: 1px solid var(--rail-3); }
.slate-cell:first-child { border-left: 0; padding-left: 0; }
.slate-cell span { display: block; font: 500 10px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--rail-ink-2); }
.slate-cell b { display: block; font-family: var(--f-display); font-size: 22px; font-weight: 600; margin-top: 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slate-cell em { font-style: normal; font-size: 12px; color: var(--rail-ink); }
.slate-side { padding: 16px 22px; border-left: 1px solid var(--rail-3); display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px; }
.slate-side .tc { font: 600 20px var(--f-mono); color: var(--tungsten); letter-spacing: .02em; }
.slate-side .tc-l { font: 500 10px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--rail-ink-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > label .req { color: var(--rec); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: 14px var(--f-ui);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2382858d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tungsten) 22%, transparent); }
.input.is-invalid, .select.is-invalid { border-color: var(--rec); }
.input-sm, .select-sm { min-height: 30px; padding: 4px 8px; font-size: 13px; }
.select-sm { padding-right: 26px; }
.input-group { display: flex; }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--surface-2); color: var(--ink-3); font: 13px var(--f-mono); }
.input-group .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
:root[data-theme="dark"] .check input { accent-color: var(--tungsten); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 20px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--chroma); }
.switch input:checked::after { transform: translateX(14px); }
.form-section { padding: 18px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section h4 { font: 600 10.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- Filter bar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.toolbar .input, .toolbar .select { min-height: 32px; height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; width: auto; }
.toolbar .search { position: relative; min-width: 220px; flex: 1; max-width: 320px; }
.toolbar .search .input { width: 100%; padding-left: 30px; }
.toolbar .search .ico { position: absolute; left: 9px; top: 8px; color: var(--ink-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 13px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 500; border: 1px solid var(--line); }
.chip a { opacity: .6; } .chip a:hover { opacity: 1; }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bulkbar { display: none; align-items: center; gap: 8px; padding: 8px 14px; background: var(--tungsten-wash); border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.bulkbar.show { display: flex; }
.bulkbar b { font-family: var(--f-mono); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font: 600 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl th a { display: inline-flex; align-items: center; gap: 4px; }
.tbl th a:hover { color: var(--ink); }
.tbl th.sorted { color: var(--ink); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .08s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.is-selected { background: var(--tungsten-wash); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl td.right, .tbl th.right { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .cb { width: 36px; padding-right: 0; }
.tbl .actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); }
.tbl.compact td { padding: 7px 12px; }
.tbl.compact th { padding: 8px 12px; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main b { font-weight: 600; display: block; line-height: 1.25; }
.cell-main span { display: block; color: var(--ink-3); font-size: 12px; }
.cell-main span.avatar { display: grid; color: #fff; font-size: 10.5px; }
.id-tag { font: 500 11.5px var(--f-mono); color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.col-hidden { display: none; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); font: 500 12px var(--f-mono); color: var(--ink-2); background: var(--surface); padding: 0 6px; }
.pager .pages a:hover { border-color: var(--ink-4); }
.pager .pages .is-current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Pills / tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 3px; font: 600 11.5px var(--f-ui); letter-spacing: .01em; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill-ok { color: var(--chroma-ink); background: var(--chroma-wash); }
.pill-warn { color: var(--tungsten-ink); background: var(--tungsten-wash); }
.pill-bad { color: var(--rec-ink); background: var(--rec-wash); }
.pill-info { color: var(--steel-ink); background: var(--steel-wash); }
.pill-mute { color: var(--ink-3); background: var(--mute-wash); }
.pri { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.pri i { width: 8px; height: 8px; border-radius: 2px; }
.pri-bad i { background: var(--rec); } .pri-warn i { background: var(--tungsten); } .pri-info i { background: var(--steel); } .pri-mute i { background: var(--ink-4); }
.stage-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.stage-tag i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.score { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 5px; border-radius: 3px; font: 600 11.5px var(--f-mono); background: var(--mute-wash); color: var(--ink-2); }
.score.hot { background: var(--rec); color: #fff; }
.score.warm { background: var(--tungsten); color: #231703; }

/* ---------- Progress / meters ---------- */
.meter { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--c, var(--chroma)); border-radius: inherit; }
.meter.lg { height: 10px; }
.meter-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.meter-row .meter { grid-column: 1 / -1; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; font: 600 13px var(--f-ui); color: var(--ink-3); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .is-active { color: var(--ink); border-bottom-color: var(--tungsten); }
.tabs .count { font: 500 10.5px var(--f-mono); padding: 1px 5px; border-radius: 3px; background: var(--surface-3); }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 12.5px; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.stat-list li:last-child { border-bottom: 0; }
.stat-list b { font-variant-numeric: tabular-nums; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 40px; }
.timeline .t-ico { position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.timeline .t-ico.c-ok { color: var(--chroma-ink); border-color: var(--chroma); }
.timeline .t-ico.c-warn { color: var(--tungsten-ink); border-color: var(--tungsten); }
.timeline .t-ico.c-bad { color: var(--rec-ink); border-color: var(--rec); }
.timeline .t-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.timeline .t-head b { font-weight: 600; }
.timeline .t-head time { font: 11px var(--f-mono); color: var(--ink-3); margin-left: auto; }
.timeline .t-body { margin-top: 4px; color: var(--ink-2); font-size: 13px; white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; }

/* ---------- Kanban (clips on a timeline) ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: 60vh; align-items: flex-start; }
.k-col { flex: 0 0 272px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.k-col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.k-col-head i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.k-col-head .count { margin-left: auto; font: 500 11px var(--f-mono); color: var(--ink-3); }
.k-col-head .sum { font: 500 10.5px var(--f-mono); color: var(--ink-3); }
.k-list { padding: 8px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; min-height: 60px; flex: 1; }
.k-list.drag-over { background: color-mix(in srgb, var(--tungsten) 12%, transparent); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.k-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--ink-4)); border-radius: var(--r); padding: 9px 10px; cursor: grab; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.k-card:hover { border-color: var(--ink-4); border-left-color: var(--c); }
.k-card.dragging { opacity: .45; }
.k-card b { display: block; font-size: 13.5px; font-weight: 600; }
.k-card .k-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.k-card .k-meta .overdue { color: var(--rec-ink); font-weight: 600; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-h { padding: 8px; font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-d { min-height: 108px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12px; }
.cal-d.out { background: var(--surface-2); color: var(--ink-4); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--tungsten); }
.cal-d .d { font: 600 12px var(--f-mono); color: var(--ink-3); }
.cal-ev { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 3px; background: var(--steel-wash); color: var(--steel-ink); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--steel); }
.cal-ev.overdue { background: var(--rec-wash); color: var(--rec-ink); border-left-color: var(--rec); }
.cal-ev.done { background: var(--chroma-wash); color: var(--chroma-ink); border-left-color: var(--chroma); text-decoration: line-through; }

/* ---------- Empty / alerts ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .empty-art { width: 64px; height: 48px; margin: 0 auto 14px; border: 1.5px dashed var(--line); border-radius: 6px; display: grid; place-items: center; color: var(--ink-4); position: relative; }
.empty .empty-art::before, .empty .empty-art::after { content: ""; position: absolute; width: 10px; height: 10px; border: 2px solid var(--tungsten); }
.empty .empty-art::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.empty .empty-art::after { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.empty h4 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 14px; font-size: 13px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); border: 1px solid; font-size: 13.5px; }
.alert .ico { margin-top: 1px; }
.alert-info { background: var(--steel-wash); border-color: color-mix(in srgb, var(--steel) 35%, transparent); color: var(--steel-ink); }
.alert-warn { background: var(--tungsten-wash); border-color: color-mix(in srgb, var(--tungsten) 45%, transparent); color: var(--tungsten-ink); }
.alert-bad { background: var(--rec-wash); border-color: color-mix(in srgb, var(--rec) 35%, transparent); color: var(--rec-ink); }
.alert-ok { background: var(--chroma-wash); border-color: color-mix(in srgb, var(--chroma) 35%, transparent); color: var(--chroma-ink); }
.note-estimate { display: inline-flex; align-items: center; gap: 5px; font: 600 10px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--plum); border: 1px dashed var(--plum); padding: 2px 6px; border-radius: 3px; }

/* ---------- Modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 12, 14, .5); z-index: 80; display: none; animation: fade .15s; }
.overlay.open { display: block; }
@keyframes fade { from { opacity: 0; } }
.modal { position: fixed; left: 50%; top: 8vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 84vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); z-index: 90; display: none; }
.modal.lg { width: min(820px, calc(100vw - 24px)); }
.modal.open { display: block; animation: pop .15s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-family: var(--f-display); font-size: 19px; font-weight: 600; }
.modal-body { padding: 18px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); z-index: 90; transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .modal-body { flex: 1; overflow: auto; }
.drawer .form-actions { border-radius: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(400px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--rail); color: #ece9e3; border-radius: var(--r); box-shadow: var(--shadow-pop); border-left: 4px solid var(--steel); font-size: 13.5px; animation: toast-in .2s ease-out; }
.toast.success { border-left-color: var(--chroma); }
.toast.error { border-left-color: var(--rec); }
.toast.warning { border-left-color: var(--tungsten); }
.toast button { margin-left: auto; background: none; border: 0; color: #888; cursor: pointer; padding: 0; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.lbl { fill: var(--ink-3); font: 11px var(--f-mono); }
.chart .grid line { stroke: var(--line-2); }
.chart .tip { position: absolute; pointer-events: none; background: var(--rail); color: #f0ede7; padding: 7px 10px; border-radius: var(--r-sm); font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-pop); transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 5; }
.chart .tip b { font-family: var(--f-mono); font-weight: 600; }
.chart .tip.show { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.legend i.line { height: 3px; border-radius: 2px; }
.funnel-row { display: grid; grid-template-columns: 140px 1fr 48px 52px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.funnel-bar { height: 22px; background: var(--surface-3); border-radius: 3px; position: relative; overflow: hidden; }
.funnel-bar i { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 3px; }
.funnel-n { font: 600 12.5px var(--f-mono); text-align: right; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); counter-increment: rank; }
.rank-list li::before { content: counter(rank, decimal-leading-zero); font: 600 11px var(--f-mono); color: var(--ink-4); }
.rank-list li:last-child { border-bottom: 0; }

/* ---------- Insight cards ---------- */
.insight { display: grid; grid-template-columns: 4px 1fr auto; gap: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.insight .sev { background: var(--c); }
.insight .ins-body { padding: 14px 0; min-width: 0; }
.insight .ins-side { padding: 14px 14px 14px 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.insight h4 { font-size: 14.5px; font-weight: 600; }
.insight .why { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.insight .why b { font: 600 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.insight .rec { margin-top: 6px; font-size: 13px; padding: 7px 10px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r); }
.sev-critical { --c: var(--rec); } .sev-high { --c: #e2742f; } .sev-medium { --c: var(--tungsten); } .sev-low { --c: var(--steel); } .sev-info { --c: var(--ink-4); }

/* ---------- Steps (admission pipeline) ---------- */
.steps { display: flex; gap: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.steps .step { flex: 1; min-width: 108px; padding: 10px 12px; border-right: 1px solid var(--line-2); position: relative; }
.steps .step:last-child { border-right: 0; }
.steps .step span { display: block; font: 600 10px var(--f-mono); letter-spacing: .1em; color: var(--ink-4); }
.steps .step b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
.steps .step.done span { color: var(--chroma-ink); }
.steps .step.done b { color: var(--ink-2); }
.steps .step.current { background: var(--tungsten-wash); }
.steps .step.current b { color: var(--ink); }
.steps .step.current::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tungsten); }

/* ---------- Profile header ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 20px; flex-wrap: wrap; }
.profile-head h2 { font-family: var(--f-display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.profile-head .meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; color: var(--ink-3); font-size: 13px; }
.profile-head .meta span { display: inline-flex; gap: 5px; align-items: center; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid var(--line-2); }
.mini-stats div { padding: 12px 20px; border-right: 1px solid var(--line-2); }
.mini-stats div:last-child { border-right: 0; }
.mini-stats span { display: block; font: 600 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.mini-stats b { font-family: var(--f-display); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Auth / viewfinder ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 460px) 1fr; background: var(--paper); }
.auth-panel { padding: 48px 48px 32px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.auth-panel .brand { display: flex; align-items: center; gap: 12px; }
.auth-panel .brand .brand-mark { width: 38px; height: 38px; }
.auth-panel .brand b { font-family: var(--f-display); font-size: 21px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; display: block; line-height: 1; }
.auth-panel .brand span { font: 500 10.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.auth-form { margin: auto 0; padding: 40px 0; }
.auth-form h1 { font-family: var(--f-display); font-size: 34px; font-weight: 600; line-height: 1.05; }
.auth-form p.lead { color: var(--ink-3); margin: 8px 0 26px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .input { height: 42px; }
.auth-foot { font: 11px var(--f-mono); color: var(--ink-4); letter-spacing: .04em; display: flex; justify-content: space-between; }

/* ---------- Install ---------- */
.install-steps { display: flex; gap: 6px; margin: 18px 0 24px; }
.install-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.install-steps span.on { background: var(--tungsten); }
.check-list { list-style: none; margin: 0 0 20px; padding: 0; font-size: 13px; }
.check-list li { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }

/* ---------- Portal ---------- */
.portal-top { background: var(--rail); color: #ece9e3; }
.portal-top .inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 60px; }
.portal-nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.portal-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.portal-content { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; }

/* ---------- Print docs (receipts, forms) ---------- */
.doc { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 36px 40px; border: 1px solid var(--line); border-radius: var(--r-lg); }
:root[data-theme="dark"] .doc { color: #111; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid #111; }
.doc-head h1 { font-family: var(--f-display); font-size: 26px; text-transform: uppercase; letter-spacing: .02em; }
.doc-title { font: 600 12px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; margin: 18px 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc th, .doc td { border: 1px solid #d8d4cb; padding: 7px 9px; text-align: left; }
.doc th { background: #f4f2ed; font-weight: 600; }
.doc .sig { display: flex; justify-content: space-between; margin-top: 56px; font-size: 12px; }
.doc .sig span { border-top: 1px solid #111; padding-top: 6px; min-width: 180px; text-align: center; }
.cert { aspect-ratio: 1.414; max-width: 980px; margin: 0 auto; background: #fbfaf6; color: #1a1a1a; border: 14px solid #141518; outline: 2px solid var(--tungsten); outline-offset: -22px; padding: 7% 9%; text-align: center; display: flex; flex-direction: column; justify-content: center; position: relative; }
.cert h1 { font-family: var(--f-display); font-size: 44px; text-transform: uppercase; letter-spacing: .08em; }
.cert .who { font-family: var(--f-display); font-size: 38px; font-weight: 600; margin: 14px 0; border-bottom: 1px solid #bbb; display: inline-block; padding: 0 30px 6px; }

/* ---------- Misc ---------- */
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.copy-box { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; white-space: pre-wrap; }
.copy-box .btn { position: absolute; top: 8px; right: 8px; }
.code { font-family: var(--f-mono); font-size: 12px; background: var(--surface-3); padding: 2px 5px; border-radius: 3px; }
.diff { font-family: var(--f-mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-all; max-width: 420px; color: var(--ink-2); }
.att-grid { display: grid; grid-template-columns: 1fr repeat(4, 64px); }
.att-opt { display: inline-flex; }
.att-opt input { display: none; }
.att-opt span { display: grid; place-items: center; width: 34px; height: 30px; border: 1px solid var(--line); font: 600 12px var(--f-mono); cursor: pointer; color: var(--ink-3); background: var(--surface); margin-left: -1px; }
.att-opt:first-child span { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.att-opt:last-child span { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.att-opt input:checked + span.p { background: var(--chroma); color: #fff; border-color: var(--chroma); }
.att-opt input:checked + span.a { background: var(--rec); color: #fff; border-color: var(--rec); }
.att-opt input:checked + span.l { background: var(--tungsten); color: #231703; border-color: var(--tungsten); }
.att-opt input:checked + span.e { background: var(--steel); color: #fff; border-color: var(--steel); }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 2px; background: var(--surface-3); }
.heat i.p { background: var(--chroma); } .heat i.a { background: var(--rec); } .heat i.l { background: var(--tungsten); } .heat i.e { background: var(--steel); }
.tile-link { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color .12s, transform .12s; }
.tile-link:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.tile-link .t-ico { width: 38px; height: 38px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.tile-link b { display: block; font-size: 14px; font-weight: 600; }
.tile-link span { display: block; font-size: 12px; color: var(--ink-3); }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 28px; text-align: center; background: var(--surface-2); color: var(--ink-3); }
.dropzone.drag { border-color: var(--tungsten); background: var(--tungsten-wash); }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slate-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; }
  .slate-cell:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-21, .g-12, .g-side { grid-template-columns: 1fr; }
  .timecode { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .22s; }
  .shell.rail-open .rail { transform: none; box-shadow: var(--shadow-pop); }
  .shell.rail-collapsed { --rail-w: 264px; }
  .shell.rail-collapsed .brand-text, .shell.rail-collapsed .nav-link span, .shell.rail-collapsed .nav-group-title, .shell.rail-collapsed .rail-foot { display: revert; }
  .shell.rail-collapsed .nav-link { justify-content: flex-start; padding: 7px 10px; }
  .content { padding: 18px 16px 60px; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .profile-btn .who { display: none; }
  .branch-select { max-width: 130px; }
  .auth { grid-template-columns: 1fr; }
  .campus { display: none; }
  .auth-panel { padding: 28px 22px; }
  .slate { grid-template-columns: 1fr; }
  .slate-stripes { width: auto; height: 14px; border-right: 0; border-bottom: 1px solid #000; }
  .slate-side { border-left: 0; border-top: 1px solid var(--rail-3); align-items: flex-start; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dl { grid-template-columns: 120px 1fr; }
  .funnel-row { grid-template-columns: 110px 1fr 64px; }
  .page-title { font-size: 25px; }
  .insight { grid-template-columns: 4px 1fr; }
  .insight .ins-side { grid-column: 2; flex-direction: row; padding: 0 14px 14px 0; align-items: center; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slate-body { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 16px; }
  .slate-cell { padding: 2px 10px; }
  .slate-cell:nth-child(odd) { border-left: 0; padding-left: 0; }
  .kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .kpi .spark { display: none; }
  .kpi:has(.spark) .kpi-value { padding-right: 0; }
  .content { overflow-x: hidden; }
  .kpi-value { font-size: 25px; }
  .search-box kbd { display: none; }
  .topbar { padding: 0 10px; gap: 6px; }
  .branch-select { display: none; }
}
@media (min-width: 901px) { .only-mobile { display: none !important; } }

/* ---------- Print ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .rail, .topbar, .page-actions, .toolbar, .pager, .no-print, .toasts, .bulkbar { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  .doc { border: 0; padding: 0; }
  .tbl th { position: static; background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]::after { content: none; }
}

/* ---------- Branding ---------- */
.logo-plate { display: flex; align-items: center; background: #fff; border-radius: 8px; padding: 5px 9px; height: 40px; flex: 1; min-width: 0; }
.logo-plate img { height: 28px; width: auto; max-width: 100%; object-fit: contain; }
.rail-brand .brand-mark { background: #fff; display: none; }
.shell.rail-collapsed .rail-brand .logo-plate { display: none; }
.shell.rail-collapsed .rail-brand .brand-mark { display: grid; }
.rail-brand { padding: 0 12px; }
.auth-logo { height: 52px; width: auto; }
.portal-top .logo-plate { flex: 0 0 auto; height: 40px; }
.doc-logo { height: 46px; width: auto; margin-bottom: 6px; }
.brand-mark img { object-fit: contain; }
.doc-logo { display: block; max-width: 220px; object-fit: contain; }
.campus { position: relative; display: flex; align-items: center; background: radial-gradient(120% 90% at 85% 8%, var(--rail-3), var(--rail) 62%); color: #fff; overflow: hidden; }
.campus::after { content: ""; position: absolute; right: -130px; bottom: -130px; width: 420px; height: 420px; border-radius: 50%; border: 70px solid var(--tungsten); opacity: .13; }
.campus-inner { position: relative; z-index: 1; padding: 0 11%; max-width: 660px; }
.campus small { display: block; font: 500 11.5px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--tungsten); margin-bottom: 14px; }
.campus h2 { font-family: var(--f-display); font-size: clamp(34px, 3.8vw, 54px); font-weight: 600; line-height: 1.04; }
.campus p { color: var(--rail-ink); margin-top: 14px; font-size: 15px; }
.campus-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 10px; }
.campus-list li { padding: 12px 15px; border: 1px solid rgba(255,255,255,.12); border-left: 3px solid var(--tungsten); border-radius: 8px; background: rgba(255,255,255,.04); }
.campus-list b { display: block; font-size: 14px; }
.campus-list span { color: var(--rail-ink); font-size: 12.5px; }

.slate { grid-template-columns: minmax(0, 1fr) !important; }
.settings-logo { background: #fff; border: 1px solid var(--line); padding: 3px; }

/* =====================================================================
   Campus theme: white sidebar, soft cards, one accent colour from Settings.
   Loaded last on purpose: it restyles every component above.
   ===================================================================== */
:root {
  --paper: #f4f5fb; --surface: #ffffff; --surface-2: #f8f9fd; --surface-3: #eef0f8;
  --line: #e3e6f0; --line-2: #eef0f7;
  --ink: #1e2240; --ink-2: #454a6b; --ink-3: #737894; --ink-4: #aeb2c8;
  --tungsten: #4f46e5; --tungsten-ink: #3730a3; --tungsten-wash: #eef0ff;
  --chroma: #10b981; --chroma-ink: #047857; --chroma-wash: #d9f7ea;
  --steel: #0ea5e9; --steel-ink: #0369a1; --steel-wash: #e0f2fe;
  --rec: #ef4444; --rec-ink: #b91c1c; --rec-wash: #fee7e7;
  --amber: #f59e0b; --amber-ink: #92590a; --amber-wash: #fef3d7;
  --plum: #a855f7; --mute-wash: #eef0f8;
  --rail: #1e1b4b; --rail-2: #2a2766; --rail-3: #3a3683; --rail-ink: #c7cbe8; --rail-ink-2: #9499c4;
  --r-sm: 8px; --r: 10px; --r-lg: 16px;
  --shadow-card: 0 1px 2px rgba(30, 34, 64, .04), 0 10px 26px -18px rgba(30, 34, 64, .22);
  --shadow-pop: 0 18px 44px -12px rgba(30, 34, 64, .28), 0 3px 8px rgba(30, 34, 64, .08);
  --f-ui: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-display: var(--f-ui); --f-mono: var(--f-ui);
  --rail-w: 258px; --top-h: 66px;
}
:root[data-theme="dark"] {
  --paper: #0f1226; --surface: #181c36; --surface-2: #1e2340; --surface-3: #272c4f;
  --line: #2f3459; --line-2: #262b4c;
  --ink: #eceefb; --ink-2: #bfc3e0; --ink-3: #8f94b8; --ink-4: #5f648c;
  --chroma-ink: #5eead4; --chroma-wash: #10322e; --steel-ink: #7dd3fc; --steel-wash: #10293f;
  --rec-ink: #fca5a5; --rec-wash: #3b1a24; --amber-ink: #fcd34d; --amber-wash: #3a2c10; --mute-wash: #272c4f;
  --rail: #0b0d1f; --rail-2: #171a33; --rail-3: #272c4f;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
}
body { font-size: 14px; letter-spacing: -.003em; }
::selection { background: var(--tungsten); color: var(--on-accent, #fff); }

/* Sidebar */
.rail { background: var(--surface); color: var(--ink-2); border-right: 1px solid var(--line); }
.rail-brand { height: 76px; padding: 0 18px; border-bottom: 0; color: var(--ink); }
.logo-plate { background: none; padding: 0; height: 52px; border-radius: 0; }
.logo-plate img { height: 46px; object-position: left center; }
.rail-brand .brand-mark { background: none; }
.rail-nav { padding: 2px 14px 24px; scrollbar-color: var(--line) transparent; }
.nav-group { margin-top: 16px; }
.nav-group-title { font: 700 11.5px/1 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ink-4); padding: 6px 10px; }
.nav-link { padding: 9px 11px; margin: 2px 0; border-radius: 11px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.nav-link .ico { color: var(--ink-3); }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.is-active { background: var(--tungsten-wash); color: var(--tungsten-ink); font-weight: 700; }
.nav-link.is-active .ico { color: var(--tungsten); }
.nav-link.is-active::before { display: none; }
.nav-link .count { font: 700 11px/1 var(--f-ui); padding: 4px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); }
.nav-link .count.hot { background: var(--rec-wash); color: var(--rec-ink); }
.rail-foot { border-top: 1px solid var(--line-2); font: 500 11px var(--f-ui); letter-spacing: 0; color: var(--ink-4); }
.shell.rail-collapsed .nav-group { border-top-color: var(--line-2); }

/* Top bar */
.topbar { background: var(--surface); backdrop-filter: none; border-bottom: 1px solid var(--line); padding: 0 26px; }
.search-box input { height: 42px; border-radius: 99px; background: var(--surface-2); padding-left: 42px; }
.search-box > .ico { left: 15px; top: 13px; }
.search-box kbd { top: 11px; right: 12px; font-family: var(--f-ui); border-radius: 7px; }
.search-box input:focus { border-color: var(--tungsten); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; }
.icon-btn .dot-badge { font-family: var(--f-ui); }
.branch-select { height: 40px; border-radius: 12px; }
.avatar { background: linear-gradient(135deg, var(--tungsten), color-mix(in srgb, var(--tungsten) 55%, #ec4899)); border: 0; }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.xl { border-radius: 22px; }

/* Page */
.content { padding: 26px 30px 64px; }
.page-head { align-items: center; margin-bottom: 22px; }
.crumbs { font: 500 12.5px var(--f-ui); letter-spacing: 0; text-transform: none; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.page-sub { font-size: 14px; }

/* Buttons */
.btn { height: 40px; padding: 0 16px; border-radius: 12px; font: 600 13.5px var(--f-ui); letter-spacing: 0; }
.btn:hover { border-color: var(--tungsten); background: var(--tungsten-wash); color: var(--tungsten-ink); }
.btn-primary, :root[data-theme="dark"] .btn-primary { background: var(--tungsten); border-color: var(--tungsten); color: var(--on-accent, #fff); box-shadow: 0 8px 18px -10px var(--tungsten); }
.btn-primary:hover, :root[data-theme="dark"] .btn-primary:hover { background: var(--tungsten); border-color: var(--tungsten); color: var(--on-accent, #fff); filter: brightness(1.1); }
.btn-accent, .btn-accent:hover { color: var(--on-accent, #fff); background: var(--tungsten); border-color: var(--tungsten); box-shadow: 0 8px 18px -10px var(--tungsten); }
.btn-accent:hover { filter: brightness(1.1); }
.btn-danger:hover { background: var(--rec-wash); border-color: var(--rec); color: var(--rec-ink); }
.btn-solid-danger:hover { background: var(--rec); color: #fff; filter: brightness(.95); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-group .btn.is-active { background: var(--tungsten); border-color: var(--tungsten); color: var(--on-accent, #fff); }

/* Cards */
.card { border-color: var(--line-2); box-shadow: var(--shadow-card); }
.card-head { padding: 16px 20px; border-bottom-color: var(--line-2); }
.card-head h3, .card-title { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.card-body { padding: 20px; }
.card-foot { padding: 13px 20px; }
.slate-label { font: 700 13.5px var(--f-ui); letter-spacing: -.005em; text-transform: none; color: var(--ink); margin: 24px 0 12px; }
.slate-label::after { display: none; }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.g-auto-lg { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* KPI tiles */
.kpi { padding: 18px 18px 16px; border-color: var(--line-2); box-shadow: var(--shadow-card); }
.kpi::before { display: none; }
.kpi-ico { position: absolute; top: 15px; right: 15px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--kpi-c, var(--tungsten)); background: color-mix(in srgb, var(--kpi-c, var(--tungsten)) 13%, transparent); }
.kpi-label { font: 600 12.5px var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ink-3); padding-right: 44px; }
.kpi-value { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin-top: 9px; }
.kpi-value small { font-size: 13.5px; font-weight: 600; letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; }
.kpi .spark { top: auto; bottom: 13px; right: 15px; width: 72px; height: 22px; }
.kpi:has(.spark) .kpi-value { padding-right: 0; }
.kpi:has(.spark) .kpi-foot { padding-right: 78px; }
.delta { font: 700 11.5px var(--f-ui); padding: 2px 7px; border-radius: 99px; }
.mini-stats span { font: 600 12px var(--f-ui); letter-spacing: 0; text-transform: none; }
.mini-stats b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

/* Dashboard hero */
.slate { background: linear-gradient(118deg, var(--tungsten) 0%, color-mix(in srgb, var(--tungsten) 62%, #0ea5e9) 100%); color: #fff; border: 0; border-radius: 20px; box-shadow: 0 20px 36px -24px var(--tungsten); }
.slate-body { padding: 22px 24px; }
.slate-cell { border-left-color: rgba(255, 255, 255, .24); }
.slate-cell span { font: 600 12.5px var(--f-ui); letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, .78); }
.slate-cell b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }
.slate-cell em { color: rgba(255, 255, 255, .84); font-size: 12.5px; }

/* Forms */
.input, .select, .textarea { min-height: 42px; padding: 9px 13px; border-radius: 11px; font-size: 14px; }
.select { padding-right: 32px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--tungsten); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tungsten) 16%, transparent); }
.input-sm, .select-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.select-sm { padding-right: 26px; }
.input-group .addon { border-radius: 11px 0 0 11px; font-family: var(--f-ui); }
.input-group .input { border-radius: 0 11px 11px 0; }
.check input { accent-color: var(--tungsten); }
.switch input { width: 42px; height: 24px; }
.switch input::after { width: 20px; height: 20px; }
.switch input:checked { background: var(--tungsten); }
.switch input:checked::after { transform: translateX(18px); }
.form-section { padding: 20px; }
.form-section h4 { font: 700 13.5px var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ink); }
.form-actions { padding: 15px 20px; }
.toolbar { padding: 14px 16px; }
.toolbar .input, .toolbar .select { min-height: 38px; height: 38px; border-radius: 10px; }
.toolbar .search .ico { top: 12px; left: 11px; }
.toolbar .search .input { padding-left: 34px; }
.chip { height: 32px; padding: 0 13px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--surface); border-color: var(--line); }
.chip:hover { border-color: var(--tungsten); }
.chip.is-active { background: var(--tungsten); color: var(--on-accent, #fff); border-color: var(--tungsten); }

/* Tables */
.tbl th { font: 600 12.5px var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ink-3); padding: 12px 16px; }
.tbl td { padding: 13px 16px; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--tungsten) 4%, transparent); }
.tbl.compact td { padding: 10px 14px; }
.tbl.compact th { padding: 10px 14px; }
.id-tag { font: 600 11.5px var(--f-ui); border-radius: 7px; padding: 2px 8px; }
.pager .pages a, .pager .pages span { border-radius: 9px; font-family: var(--f-ui); }
.pager .pages .is-current { background: var(--tungsten); border-color: var(--tungsten); color: var(--on-accent, #fff); }

/* Pills: warnings stay amber whatever accent the college picks */
.pill { height: 24px; padding: 0 11px; border-radius: 99px; font: 600 12px var(--f-ui); }
.pill::before { display: none; }
.pill-warn { color: var(--amber-ink); background: var(--amber-wash); }
.text-warn { color: var(--amber-ink); }
.alert { border-radius: 13px; padding: 13px 16px; }
.alert-warn { background: var(--amber-wash); border-color: color-mix(in srgb, var(--amber) 40%, transparent); color: var(--amber-ink); }
.pri-warn i { background: var(--amber); }
.score { border-radius: 8px; font-family: var(--f-ui); }
.score.warm { background: var(--amber); color: #3b2502; }
.sev-medium { --c: var(--amber); }
.att-opt input:checked + span.l { background: var(--amber); color: #3b2502; border-color: var(--amber); }
.heat i.l { background: var(--amber); }
.legend i[style*="--c:var(--tungsten)"] { --c: var(--amber) !important; }
.note-estimate { font: 600 11px var(--f-ui); letter-spacing: 0; text-transform: none; border-radius: 99px; padding: 2px 9px; }
.meter { border-radius: 99px; height: 7px; }

/* Tabs */
.tabs { gap: 4px; padding: 8px 10px !important; border-bottom: 1px solid var(--line-2); }
.tabs a, .tabs button { padding: 8px 14px; border: 0; border-radius: 10px; margin: 0; font: 600 13px var(--f-ui); }
.tabs a:hover, .tabs button:hover { background: var(--surface-3); }
.tabs .is-active { background: var(--tungsten-wash); color: var(--tungsten-ink); }
.tabs .count { font: 700 11px var(--f-ui); border-radius: 99px; padding: 1px 7px; }

/* Labels that were technical capitals */
.dd-menu .dd-head, .search-results .sr-group, .cal-h, .steps .step span, .insight .why b { font-family: var(--f-ui); letter-spacing: 0; text-transform: none; font-size: 12px; }
.dd-menu { border-radius: 14px; }
.dd-menu a, .dd-menu button.dd-item { border-radius: 9px; font-family: var(--f-ui); }
.search-results a small, .notif-item time, .timeline .t-head time, .funnel-n, .rank-list li::before { font-family: var(--f-ui); }
.k-col { border-radius: 16px; }
.k-card { border-radius: 12px; }
.insight { border-color: var(--line-2); box-shadow: var(--shadow-card); }
.steps { border-color: var(--line-2); }
.funnel-bar, .funnel-bar i { border-radius: 8px; }
.tile-link { border-color: var(--line-2); box-shadow: var(--shadow-card); }
.tile-link:hover { border-color: var(--tungsten); }
.tile-link .t-ico { border-radius: 12px; background: var(--tungsten-wash); color: var(--tungsten); }
.empty .empty-art { border: 0; background: var(--tungsten-wash); color: var(--tungsten); border-radius: 16px; width: 56px; height: 56px; }
.empty .empty-art::before, .empty .empty-art::after { display: none; }
.toast { border-radius: 13px; color: #fff; }
.modal, .drawer { border-radius: 18px; }
.drawer { border-radius: 18px 0 0 18px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.copy-box { border-radius: 12px; }
.code { font-family: Consolas, "Cascadia Mono", monospace; border-radius: 6px; }
.chart .axis text, .chart text.lbl { font-family: var(--f-ui); }

/* Feature switches */
.feature-card { display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-card); cursor: pointer; transition: border-color .12s, opacity .12s; }
.feature-card:hover { border-color: var(--tungsten); }
.feature-card .t-ico { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--tungsten-wash); color: var(--tungsten); }
.feature-text { flex: 1; min-width: 0; }
.feature-text b { display: block; font-size: 14px; font-weight: 700; }
.feature-text span { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.feature-card .switch { flex: none; }
.feature-card .switch em { font-style: normal; font-size: 12px; font-weight: 700; width: 46px; color: var(--tungsten-ink); }
.feature-card.is-locked { background: var(--surface-2); }
.feature-card.is-locked .t-ico { background: var(--surface-3); color: var(--ink-4); }
.feature-card.is-locked .feature-text b { color: var(--ink-3); }
.feature-card.is-locked .switch em { color: var(--ink-3); }

/* Sign-in: one floating card on a soft background */
.auth { display: flex; align-items: center; justify-content: center; padding: 28px; grid-template-columns: none;
  background: radial-gradient(60% 70% at 12% 8%, color-mix(in srgb, var(--tungsten) 16%, transparent), transparent 70%), radial-gradient(55% 65% at 92% 92%, rgba(14, 165, 233, .15), transparent 70%), var(--paper); }
.auth-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(1060px, 100%); min-height: 640px; background: var(--surface); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-pop); }
.auth-panel { padding: 38px 44px 26px; background: none; border: 0; min-width: 0; }
.auth-logo { height: 56px; max-width: 260px; object-fit: contain; object-position: left center; }
.auth-form { padding: 22px 0; }
.auth-form h1 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.auth-form .input { height: 46px; }
.auth-foot { font: 500 11.5px var(--f-ui); letter-spacing: 0; }
.campus { margin: 14px; border-radius: 20px; background: linear-gradient(150deg, var(--tungsten), color-mix(in srgb, var(--tungsten) 58%, #0ea5e9)); }
.campus::after { right: -90px; bottom: -90px; width: 300px; height: 300px; border: 46px solid #fff; opacity: .1; }
.campus-inner { padding: 0 40px; }
.campus small { font: 600 12.5px var(--f-ui); letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, .85); }
.campus h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.14; }
.campus p { color: rgba(255, 255, 255, .86); }
.campus-list li { background: rgba(255, 255, 255, .13); border: 0; border-radius: 13px; }
.campus-list span { color: rgba(255, 255, 255, .84); }

/* Portal */
.portal-top { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line-2); }
.portal-top .inner { height: 70px; }
.portal-top .logo-plate { height: 50px; }
.portal-nav { border-bottom-color: var(--line); }
.portal-nav .tabs { border: 0; padding: 6px 20px !important; }

/* Documents keep a clean print look */
.doc-title { font-family: var(--f-ui); letter-spacing: .08em; font-weight: 700; }
.doc-head h1 { font-weight: 800; }
.doc { border-radius: 14px; }
.doc th { background: #f4f5fb; }
.doc th, .doc td { border-color: #dfe2ee; }
.cert { background: #fff; border-color: var(--tungsten); outline-color: color-mix(in srgb, var(--tungsten) 45%, #fff); }
.cert h1 { font-size: 36px; font-weight: 800; letter-spacing: .02em; }
.cert .who { font-weight: 800; }

@media (max-width: 900px) {
  .auth { padding: 0; align-items: stretch; }
  .auth-card { grid-template-columns: minmax(0, 1fr); border-radius: 0; }
  .auth-panel { padding: 28px 22px; }
  .content { padding: 20px 16px 60px; }
  .topbar { padding: 0 12px; }
  .slate-cell { border-left: 0; padding-left: 0; }
  .feature-card { padding: 13px 14px; }
}
@media print {
  .slate { background: none; color: #111; box-shadow: none; border: 1px solid #ccc; }
  .slate-cell span, .slate-cell b, .slate-cell em { color: #111; }
}

/* Refinements after visual review */
.g-auto { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.tbl td.mono, .tbl td .mono, .tbl td a.mono { white-space: nowrap; }
.card-head h3 { white-space: nowrap; }
.card-head .sub { text-align: right; }
.portal-top .brand-text span { text-transform: none; letter-spacing: 0; font-family: var(--f-ui); }
.auth-form > p.small { margin-top: 14px; }
.demo-login:hover { border-color: var(--tungsten) !important; }
