/* SE-Tracker styles.
   Colours live in the tokens below; dark mode swaps them via [data-theme="dark"],
   which a tiny script in _head.html sets from the theme switch (or the OS). */

/* ================= tokens ================= */

:root {
  color-scheme: light;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --primary: #1f1f1d;
  --primary-hover: #000000;
  --on-primary: #ffffff;
  --accent: #2d5bd0;
  --accent-strong: #2148ad;
  --accent-soft: #edf1fb;
  --accent-ring: rgba(45, 91, 208, 0.22);

  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --surface-raised: #ffffff;
  --sidebar: #fbfaf7;
  --border: #e3e1da;
  --border-strong: #d2cfc6;
  --text: #1f1f1d;
  --text-2: #4b4a46;
  --muted: #7a7872;
  --input: #ffffff;

  --green: #0ca30c;
  --yellow: #e59e0b;
  --red: #d03b3b;
  --gray: #a3a29b;

  --status-active: #0ca30c;
  --status-risk: #fab219;
  --status-low: #d03b3b;
  --status-none: #b5b4ad;
  --status-low-band: rgba(208, 59, 59, 0.06);
  --pill-active-bg: rgba(12, 163, 12, 0.1);
  --pill-active-fg: #0a6e0a;
  --pill-risk-bg: rgba(250, 178, 25, 0.16);
  --pill-risk-fg: #8a5a00;
  --pill-low-bg: rgba(208, 59, 59, 0.1);
  --pill-low-fg: #a52727;
  --pill-none-bg: rgba(120, 120, 120, 0.1);
  --pill-none-fg: #66666d;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-1-soft: rgba(42, 120, 214, 0.1);
  --chart-grid: #ecebe6;
  --chart-axis: #c3c2b7;

  --heat-0: #e3eefc; --heat-0-ink: #1c3f6e;
  --heat-1: #b7d3f6; --heat-1-ink: #173a66;
  --heat-2: #86b6ef; --heat-2-ink: #0d2c52;
  --heat-3: #3987e5; --heat-3-ink: #ffffff;
  --heat-4: #256abf; --heat-4-ink: #ffffff;
  --heat-5: #184f95; --heat-5-ink: #ffffff;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-xs: none;
  --shadow-sm: 0 1px 1px rgba(30, 28, 20, 0.03);
  --shadow-md: 0 2px 8px rgba(30, 28, 20, 0.06);
  --shadow-lg: 0 8px 28px rgba(30, 28, 20, 0.12);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 272px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #ecebe6;
  --primary-hover: #ffffff;
  --on-primary: #161614;
  --accent: #7ea2f0;
  --accent-strong: #9db8f5;
  --accent-soft: rgba(126, 162, 240, 0.13);
  --accent-ring: rgba(126, 162, 240, 0.3);

  --bg: #121211;
  --surface: #1a1a18;
  --surface-2: #1f1f1d;
  --surface-raised: #232321;
  --sidebar: #161615;
  --border: #2b2b28;
  --border-strong: #3a3a36;
  --text: #ecebe6;
  --text-2: #c4c2ba;
  --muted: #8d8b84;
  --input: #151514;

  --status-none: #5d5d63;
  --status-low-band: rgba(208, 59, 59, 0.1);
  --pill-active-bg: rgba(12, 163, 12, 0.16);
  --pill-active-fg: #5fd35f;
  --pill-risk-bg: rgba(250, 178, 25, 0.16);
  --pill-risk-fg: #fbc551;
  --pill-low-bg: rgba(230, 103, 103, 0.16);
  --pill-low-fg: #f08a8a;
  --pill-none-bg: rgba(255, 255, 255, 0.07);
  --pill-none-fg: #a5a5ad;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-1-soft: rgba(57, 135, 229, 0.16);
  --chart-grid: #262624;
  --chart-axis: #3a3a36;

  --heat-0: #13243b; --heat-0-ink: #9fc1ea;
  --heat-1: #104281; --heat-1-ink: #d6e6fb;
  --heat-2: #1c5cab; --heat-2-ink: #ffffff;
  --heat-3: #2a78d6; --heat-3-ink: #ffffff;
  --heat-4: #5598e7; --heat-4-ink: #0b1d33;
  --heat-5: #86b6ef; --heat-5-ink: #0b1d33;

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.5);
}

/* ================= base ================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-weight: 600; }
h2, h3 { font-weight: 600; }

.muted { color: var(--muted); font-weight: 400; }
.small-text { font-size: 12.5px; }
.block { display: block; }

code {
  font-family: var(--mono);
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection { background: var(--accent-ring); }

/* ================= layout ================= */

.layout { display: flex; min-height: 100vh; }

.content {
  flex: 1;
  min-width: 0;
  padding: 28px 40px 96px;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  animation: page-in 0.5s var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ================= brand ================= */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
}
.brand-mark .ico { width: 15px; height: 15px; stroke-width: 2.4; }
.brand-lg { font-size: 19px; }
.brand-lg .brand-mark { width: 30px; height: 30px; border-radius: 7px; }
.brand-lg .brand-mark .ico { width: 17px; height: 17px; }

.cohort-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

/* ================= sidebar ================= */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0 12px 12px;
  z-index: 30;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 6px 14px;
}

.nav-primary { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}
.nav-item .ico { color: var(--muted); transition: color 0.15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.nav-item.active .ico { color: var(--text); }

.nav-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 10px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.nav-count {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  letter-spacing: 0;
}
.nav-empty { color: var(--muted); font-size: 13px; padding: 4px 10px; margin: 0; }

.team-list { display: flex; flex-direction: column; gap: 2px; }

.team-link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background 0.15s, transform 0.15s var(--ease);
}
.team-link:hover { background: var(--surface-2); text-decoration: none; }
.team-link.active { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 7px 9px; }
.team-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.team-link-body { display: flex; flex-direction: column; min-width: 0; }
.team-link-title { font-weight: 600; font-size: 13.5px; }
.team-link-project { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-link-meta { font-size: 11.5px; color: var(--muted); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.dot-green { background: var(--status-active); color: var(--status-active); }
.dot-yellow { background: var(--status-risk); color: var(--status-risk); }
.dot-red { background: var(--status-low); color: var(--status-low); }
.dot-gray { background: var(--status-none); color: var(--status-none); }


.sidebar-new-team { margin: 8px 0 0; justify-content: center; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  flex-shrink: 0;
}
.avatar-lg { width: 38px; height: 38px; font-size: 15px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.theme-switch .ico { width: 14px; height: 14px; }
.sidebar-theme { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0; font-size: 13px; color: var(--muted); }

/* topbar + drawer (mobile only) */
.topbar { display: none; }
.scrim { display: none; }

/* ================= demo banner & toasts ================= */

.demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto 20px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-risk);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text-2);
  animation: page-in 0.5s var(--ease) both;
}
.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text);
}
.demo-pill .ico { width: 13px; height: 13px; }
.demo-cta { margin-left: auto; font-weight: 600; }

.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toasts .flash { pointer-events: auto; box-shadow: var(--shadow-lg); animation: toast-in 0.45s var(--ease) both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.flash {
  padding: 11px 14px 11px 40px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  position: relative;
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.flash::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--status-active);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.flash-error::before {
  background: var(--status-low);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / 11px no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.flash-ok { border-color: color-mix(in srgb, var(--status-active) 35%, var(--border)); }
.flash-error { border-color: color-mix(in srgb, var(--status-low) 40%, var(--border)); }
.flash-hide { opacity: 0; transform: translateX(16px); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
#import-result.flash { padding-left: 40px; margin-top: 16px; }

/* ================= page header ================= */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.eyebrow {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.page-title { font-size: 24px; line-height: 1.25; }
.page-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.meta-item .ico { width: 14px; height: 14px; }
.repo-link { color: var(--muted); max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-link:hover { color: var(--accent-strong); }

.team-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}
.back-link:hover { color: var(--accent-strong); text-decoration: none; }
.back-link .ico { width: 15px; height: 15px; transition: transform 0.2s var(--ease); }
.back-link:hover .ico { transform: translateX(-3px); }

/* ================= buttons ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.12s var(--ease), color 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .ico { width: 15px; height: 15px; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-ghost { background: transparent; box-shadow: none; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-large { padding: 10px 20px; font-size: 14.5px; }
.btn-block { width: 100%; }

.btn-danger-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--status-low); }
.btn-danger-ghost:hover { background: var(--pill-low-bg); border-color: color-mix(in srgb, var(--status-low) 30%, transparent); }

.btn-google { gap: 10px; padding: 10px 14px; font-size: 14px; }
.g-logo { width: 18px; height: 18px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0 2px;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* ================= forms ================= */

input, select, textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); cursor: default; border-color: var(--border); }
textarea { resize: vertical; min-height: 38px; 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' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  cursor: pointer;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

label > input, label > select, label > textarea { display: block; margin-top: 6px; }
label > .evidence-row { margin-top: 6px; }
label > .chips { font-weight: 400; }

fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; margin-bottom: 14px; }
.card-title .muted { font-size: 13px; font-weight: 400; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }

.team-form { display: flex; flex-direction: column; gap: 0; max-width: 920px; }
.member-rows { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin: -8px 0 6px; }
.member-rows th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.member-rows td { padding: 0 6px 0 0; }
.member-rows td:last-child { padding-right: 0; }
.member-rows tbody tr { animation: row-in 0.35s var(--ease) both; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.form-actions { display: flex; gap: 8px; margin: 20px 0 0; }

.danger-zone {
  max-width: 920px;
  margin-top: 36px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--status-low) 30%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--status-low) 4%, var(--surface));
}
.danger-zone .card-title { color: var(--status-low); }
.danger-zone form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.settings-form { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.auth-form label, .settings-form label { font-size: 13px; }
.settings-form p { margin: -6px 0 0; }
.settings-form .btn { align-self: flex-start; }

/* ================= tabs ================= */

.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 550;
  font-size: 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.tab .ico { width: 15px; height: 15px; }
.tab:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tab.active { color: var(--text); }
.tab.active .ico { color: var(--accent); }
.tab-count {
  font-size: 11px;
  font-weight: 650;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: 0 7px;
}
.tab.active .tab-count { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
.tab-indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
}
html:not(.js) .tab.active { box-shadow: inset 0 -2px 0 var(--accent); }

.tab-body { animation: page-in 0.4s var(--ease) both; }

/* ================= tables ================= */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.table-card.table-scroll { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr[data-href] { cursor: pointer; }
.data-table.compact td { padding: 9px 12px; }
.data-table.compact th { padding: 9px 12px; }
.card .data-table th { background: transparent; }
.card .table-scroll { margin: 0 -20px -20px; }
.card .table-scroll .data-table th:first-child, .card .table-scroll .data-table td:first-child { padding-left: 20px; }
.card .table-scroll .data-table th:last-child, .card .table-scroll .data-table td:last-child { padding-right: 20px; }

.row-action { text-align: right; }
.data-table tbody tr .row-action .btn { opacity: 0.6; transition: opacity 0.15s; }
.data-table tbody tr:hover .row-action .btn { opacity: 1; }

.call-no { font-weight: 650; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.attend { display: inline-flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.attend .meter { width: 64px; }

.avg-cell { font-weight: 650; font-variant-numeric: tabular-nums; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.status-active { background: var(--pill-active-bg); color: var(--pill-active-fg); }
.status-risk { background: var(--pill-risk-bg); color: var(--pill-risk-fg); }
.status-low { background: var(--pill-low-bg); color: var(--pill-low-fg); }
.status-none { background: var(--pill-none-bg); color: var(--pill-none-fg); }

.legend {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
}
.legend summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.legend ul { margin: 10px 0 2px; padding-left: 18px; color: var(--text-2); }
.legend li { margin: 3px 0; }

/* ================= empty states ================= */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-2);
}
.empty-state h1 { font-size: 22px; margin-bottom: 8px; color: var(--text); }
.empty-state p { max-width: 460px; margin: 0 auto 18px; }
.empty-state.small { padding: 32px 20px; }
.empty-state.small p { margin-bottom: 0; }
.empty-ico { width: 28px; height: 28px; color: var(--muted); margin-bottom: 8px; }
.hero-empty { padding: 80px 24px; border-style: solid; box-shadow: var(--shadow-sm); }

.empty-badge {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.empty-badge .ico { width: 20px; height: 20px; }
.empty-badge-danger { background: var(--pill-low-bg); color: var(--status-low); }


/* ================= calls tab ================= */

.inline-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.callout {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.callout .muted { font-size: 13px; }

/* ================= milestones tab ================= */

.milestone-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.chip {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s var(--ease), box-shadow 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.chip:active { transform: scale(0.95); }
.chip-nav { border-radius: 7px; border-color: transparent; background: transparent; padding: 5px 12px; }
.chip-nav:hover { background: var(--surface); border-color: transparent; color: var(--text); }
.chip-nav.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); border-color: var(--border); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chips .chip { font-size: 11.5px; padding: 2px 8px; font-weight: 500; }

.grid-table td { vertical-align: top; }
.grid-table input, .grid-table textarea { min-width: 150px; }
.grid-table select { width: 74px; }
.member-cell strong { display: block; white-space: nowrap; }
.member-cell .muted { font-size: 12px; }

.ynd { font-weight: 650; }
.ynd-Y, .ynd-Y:disabled { background-color: var(--pill-active-bg); color: var(--pill-active-fg); border-color: color-mix(in srgb, var(--status-active) 35%, transparent); }
.ynd-N, .ynd-N:disabled { background-color: var(--pill-low-bg); color: var(--pill-low-fg); border-color: color-mix(in srgb, var(--status-low) 35%, transparent); }

.save-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

.save-status { font-size: 13px; color: var(--muted); font-weight: 500; }
.save-status.ok { color: var(--pill-active-fg); animation: saved 0.6s var(--ease); }
.save-status.err { color: var(--pill-low-fg); }
.save-status.warn { color: var(--pill-risk-fg); }
.save-status.warn::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-risk);
  margin-right: 7px;
  vertical-align: 1px;
  animation: pulse-warn 1.6s ease-in-out infinite;
}

@keyframes saved {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: none; }
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ================= call form ================= */

.call-header { align-items: flex-end; }
.call-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.call-fields label > input, .call-fields label > select { width: auto; min-width: 92px; }
.call-fields input[type="date"] { min-width: 150px; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--pill-risk-bg);
  color: var(--pill-risk-fg);
  font-weight: 500;
  font-size: 13.5px;
}
.banner[hidden] { display: none; }

.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 20px;
  transition: opacity 0.25s, box-shadow 0.2s, border-color 0.2s, transform 0.2s var(--ease);
  animation: page-in 0.45s var(--ease) both;
}
.member-card:nth-child(2) { animation-delay: 0.05s; }
.member-card:nth-child(3) { animation-delay: 0.1s; }
.member-card:nth-child(4) { animation-delay: 0.15s; }
.member-card:nth-child(n + 5) { animation-delay: 0.2s; }
.member-card:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-ring); }
.member-card.absent { opacity: 0.55; background: var(--surface-2); }
.member-card.absent:focus-within { opacity: 1; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-head h2 { font-size: 16px; }
.card-head .muted { font-size: 12.5px; }
.card-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.card-total .muted { font-size: 12px; }
.total-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); font-family: var(--mono); transition: transform 0.2s var(--ease); }

.card-row { display: grid; gap: 12px; }
.two-col { grid-template-columns: 1fr 1fr; }
.toggle-row { display: flex; gap: 24px; }

.field { display: flex; align-items: center; gap: 10px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.yn {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.yn-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  width: 34px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.yn-btn:hover { color: var(--text); }
.yn-btn.on[data-val="1"] { background: var(--status-active); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--status-active) 40%, transparent); }
.yn-btn.on[data-val="0"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.yn-btn.pop { animation: pop 0.3s var(--ease); }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.carried {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  font-style: italic;
  color: var(--muted);
  margin-left: 4px;
}

.evidence-row { display: flex; gap: 8px; align-items: center; }
.evidence-open { flex-shrink: 0; }
.evidence-open .ico { width: 13px; height: 13px; }
.evidence-open[hidden] { display: none; }

.score-row { grid-template-columns: repeat(3, 1fr); padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.score { display: flex; flex-direction: column; gap: 6px; }
.score .field-label .muted { font-weight: 500; font-size: 11.5px; }
.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.step {
  width: 32px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.step:hover { background: var(--accent-soft); color: var(--accent-strong); }
.step:active { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.score-input {
  border: 0;
  border-radius: 0;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding: 7px 0;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
  background: transparent;
}
.score-input:focus { box-shadow: none; }
.score-input::-webkit-outer-spin-button, .score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.save-bar.sticky {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  margin-top: 20px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: bar-up 0.5s var(--ease) 0.15s both;
}
.save-bar.sticky .btn-primary { margin-left: auto; }
.save-bar.sticky #log-progress { font-size: 12.5px; }

@keyframes bar-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.member-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.member-pill {
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.member-pill:hover { border-color: var(--accent); color: var(--accent-strong); }
.member-pill.done { background: var(--pill-active-bg); color: var(--pill-active-fg); border-color: transparent; }
.member-pill.done::before { content: "✓ "; }
.member-pill.absent { text-decoration: line-through; opacity: 0.55; }

/* ================= import ================= */

.import-intro { max-width: 760px; margin: -8px 0 16px; }
.prompt-actions { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; }
.prompt-block {
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  max-height: 340px;
  overflow: auto;
  margin: 0;
}
.legend + .card { margin-top: 16px; }
#import-json { font-family: var(--mono); font-size: 12.5px; }

/* ================= auth ================= */

.auth-page { min-height: 100vh; background: var(--bg); }
.auth-corner { position: fixed; top: 16px; right: 16px; z-index: 5; }
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 48px 20px;
}
.auth-shell > .brand { margin-bottom: 6px; }
.auth-lede { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: page-in 0.4s var(--ease) both;
}
.auth-card h1 { font-size: 19px; }
.auth-card h1 + .auth-form { margin-top: 18px; }
.auth-card .toasts { position: static; max-width: none; margin-bottom: 12px; }
.auth-card .toasts:empty { display: none; }
.auth-card .toasts .flash { box-shadow: none; animation: none; }
.auth-card > .flash { margin: 12px 0; }
.auth-sub { margin: 4px 0 18px; font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { margin-top: 4px; padding: 9px; }
.auth-switch { font-size: 13.5px; margin: 16px 0 0; }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.auth-foot a { font-weight: 500; }

/* ================= overview ================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.kpi-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.kpi-label .ico { width: 13px; height: 13px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi .meter { margin-top: 4px; }
.kpi-alert .kpi-label { color: var(--pill-low-fg); }
.kpi-alert::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--status-low);
}

.meter {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.meter-fill {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 999px;
  background: var(--series-1);
  transition: width 1.1s var(--ease);
}

.card-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head-row .card-title { margin: 0; }
.card-hint { font-size: 12px; color: var(--muted); }
.sub-title { font-size: 13px; color: var(--text-2); margin: 18px 0 10px; }

.status-strip { margin-bottom: 16px; }
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.stack-seg { display: block; width: var(--w); height: 100%; transition: width 1.1s var(--ease); }
.stack-seg:first-child { border-radius: 999px 0 0 999px; }
.stack-seg:last-child { border-radius: 0 999px 999px 0; }
.stack-seg:only-child { border-radius: 999px; }

.status-bg-active { background: var(--status-active); }
.status-bg-risk { background: var(--status-risk); }
.status-bg-low { background: var(--status-low); }
.status-bg-none { background: var(--status-none); }
.series-1-bg { background: var(--series-1); }

.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-item strong { font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.swatch-dot { border-radius: 50%; }
.swatch-line { width: 16px; height: 2px; border-radius: 2px; }
.swatch-line.series-1 { background: var(--series-1); }
.swatch-line.series-2 { background: var(--series-2); }

.viz-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.viz-grid > .card { margin: 0; min-width: 0; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.chart-box { position: relative; width: 100%; }
.chart-tall { height: 320px; }
.chart-mid { height: 200px; }
.chart-short { height: 130px; }
.chart-caption { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.chart-caption ~ .chart-caption { margin-top: 14px; }

/* milestone heatmap */
.heatmap { border-collapse: separate; border-spacing: 4px; width: 100%; font-size: 13px; }
.card .table-scroll .heatmap { margin: 0; }
.card .table-scroll:has(.heatmap) { margin: 0; }
.heatmap th { font-size: 11.5px; font-weight: 650; color: var(--muted); text-align: center; padding: 2px 4px; white-space: nowrap; }
.heatmap th[scope="row"] { text-align: left; font-size: 13px; color: var(--text); padding-right: 12px; font-variant-numeric: tabular-nums; }
.heatmap th[scope="row"] a { color: var(--text); font-weight: 650; }
.heatmap th[scope="row"] .muted { font-weight: 400; font-size: 12px; }
.heat {
  min-width: 74px;
  height: 46px;
  border-radius: 8px;
  text-align: center;
  vertical-align: middle;
  padding: 4px 8px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
}
.heat:not(.heat-na):hover { outline: 2px solid var(--text); outline-offset: -2px; }
.heat-val { display: block; font-weight: 650; font-variant-numeric: tabular-nums; }
.heat-parts { display: flex; gap: 2px; margin-top: 3px; }
.heat-parts i { flex: 1; height: 3px; border-radius: 2px; background: color-mix(in srgb, currentColor 25%, transparent); position: relative; overflow: hidden; }
.heat-parts i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: currentColor; opacity: 0.85; }
.heat-0 { background: var(--heat-0); color: var(--heat-0-ink); }
.heat-1 { background: var(--heat-1); color: var(--heat-1-ink); }
.heat-2 { background: var(--heat-2); color: var(--heat-2-ink); }
.heat-3 { background: var(--heat-3); color: var(--heat-3-ink); }
.heat-4 { background: var(--heat-4); color: var(--heat-4-ink); }
.heat-5 { background: var(--heat-5); color: var(--heat-5-ink); }
.heat-empty {
  color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px);
  border: 1px dashed var(--border-strong);
}
.heat-na { background: transparent; }
.heat-legend { align-items: center; gap: 4px; }
.heat-legend .swatch { width: 22px; height: 10px; border-radius: 3px; }

/* team drill-down */
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 12px; }
.team-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.team-card:hover { border-color: var(--border-strong); }
.team-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.team-card-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); font-size: 14.5px; }
.team-card-title .dot { margin-top: 0; }
.team-card-avg { font-size: 19px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.team-card-avg small { font-size: 12px; color: var(--muted); font-weight: 600; }
.team-card-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card-stats { display: inline-flex; gap: 10px; font-size: 12px; color: var(--muted); justify-content: flex-end; align-items: center; }
.flag-count { display: inline-flex; align-items: center; gap: 3px; color: var(--pill-low-fg); font-weight: 650; }
.flag-count .ico { width: 13px; height: 13px; }

.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.member-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.6fr) minmax(48px, 1fr) 32px 36px 60px 14px;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.12s;
}
.member-row:hover { background: var(--surface); }
.member-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.member-avg { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.member-att { color: var(--muted); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.flag-dot { color: var(--status-low); display: inline-flex; }
.flag-dot .ico { width: 14px; height: 14px; }

.bar-track { display: block; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); border-radius: 999px; transition: width 1.1s var(--ease); }

.spark { width: 64px; height: 22px; overflow: visible; }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark-end { fill: var(--series-1); stroke: var(--surface); stroke-width: 1.2; }
.spark-gap { fill: var(--status-none); }

.reason-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.reason {
  font-size: 11.5px;
  font-weight: 550;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--pill-low-bg);
  color: var(--pill-low-fg);
  white-space: nowrap;
}
.all-clear { margin: 0; color: var(--pill-active-fg); font-weight: 600; }

/* reveal-on-scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-group > * { opacity: 0; transform: translateY(12px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), box-shadow 0.25s; transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal-group.in > * { opacity: 1; transform: none; }
.js .reveal-group.in > *:hover { transition-delay: 0s; }
.js .reveal:not(.in) .bar-fill,
.js .reveal:not(.in) .stack-seg,
.js .reveal-group:not(.in) .meter-fill { width: 0; }

/* ================= admin ================= */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}
.admin-bar .user-chip { margin: 0; padding: 4px 4px 4px 6px; max-width: 320px; }
.admin-bar-spacer { flex: 1; }
.admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
}
.admin-tag .ico { width: 12px; height: 12px; }
.admin-content { padding: 28px 28px 96px; }

.filter-row { margin-bottom: 18px; }
.ta-cell { display: inline-flex; align-items: center; gap: 10px; }
.ta-cell .avatar { width: 26px; height: 26px; font-size: 11.5px; }
.inline-bar { display: inline-grid; grid-template-columns: 70px auto; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }

.hbar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.hbar-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 24px; gap: 10px; align-items: center; }
.hbar-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

.table-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  position: relative;
  font-weight: 400;
}
.search .ico { position: absolute; left: 10px; color: var(--muted); width: 15px; height: 15px; }
.search input { padding-left: 32px; width: 240px; margin-top: 0; }
.student-table-wrap { max-height: 640px; overflow: auto; }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]:hover { color: var(--text); }
.sortable th[data-dir="asc"]::after { content: " ↑"; color: var(--accent-strong); }
.sortable th[data-dir="desc"]::after { content: " ↓"; color: var(--accent-strong); }
.table-empty { padding: 20px; text-align: center; }
.admin-summary { margin-top: 16px; }
.admin-summary .tab-body { animation: none; }
.admin-summary .table-card { box-shadow: none; }

/* ================= responsive ================= */

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-5, .span-7 { grid-column: span 12; }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 25;
    padding: 10px 16px;
    background: var(--sidebar);
    border-bottom: 1px solid var(--border);
  }
  .topbar .cohort-badge { margin-left: auto; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 40;
  }
  .nav-open .sidebar { transform: none; }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(10, 10, 14, 0.35);
    animation: fade-in 0.25s ease both;
  }
  .scrim[hidden] { display: none; }
  .content { padding: 20px 16px 96px; }
  .admin-content { padding: 20px 16px 96px; }
  .admin-bar { padding: 10px 16px; flex-wrap: wrap; }
  .admin-bar .user-meta { display: none; }
  .member-cards { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; top: 72px; max-width: none; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .page-title { font-size: 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .two-col, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .score-row { grid-template-columns: 1fr; }
  .toggle-row { gap: 16px; flex-wrap: wrap; }
  .card { padding: 16px; }
  .card .table-scroll { margin: 0 -16px -16px; }
  .card .table-scroll .data-table th:first-child, .card .table-scroll .data-table td:first-child { padding-left: 16px; }
  .team-cards { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: minmax(0, 1.3fr) minmax(40px, 1fr) 30px 34px 16px; }
  .member-row .spark { display: none; }
  .save-bar.sticky { bottom: 8px; }
  .save-bar.sticky .member-pills { display: none; }
  .search input { width: 100%; }
  .table-tools { width: 100%; }
  .search { width: 100%; }
  .demo-cta { margin-left: 0; }
  .auth-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal, .js .reveal-group > * { opacity: 1; transform: none; }
}

@media print {
  .sidebar, .topbar, .save-bar, .demo-banner, .toasts, .admin-bar { display: none !important; }
  .content { padding: 0; }
  .card, .kpi, .table-card { box-shadow: none; }
}
