/* ==========================================================================
   Cubeology Coaching OS — Premium design system (Claude revamp)
   Light + dark themes, mobile-first, no external CSS dependencies.
   ========================================================================== */
:root {
  --bg: #f3f4f9;
  --bg-grad: radial-gradient(1200px 500px at 85% -10%, rgba(99,102,241,.10), transparent 60%), radial-gradient(900px 400px at -10% 0%, rgba(16,185,129,.07), transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f8;
  --line: #e4e7f1;
  --line-strong: #d3d8e8;
  --ink: #0d1124;
  --ink-2: #4a5169;
  --ink-3: #8189a3;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: rgba(79,70,229,.09);
  --brand-ink: #3730a3;
  --good: #0f9f6e;
  --good-soft: rgba(15,159,110,.11);
  --warn: #d98a06;
  --warn-soft: rgba(217,138,6,.12);
  --bad: #dc3d4b;
  --bad-soft: rgba(220,61,75,.10);
  --info: #0891b2;
  --info-soft: rgba(8,145,178,.11);
  --shadow-xs: 0 1px 2px rgba(15,20,50,.05);
  --shadow-sm: 0 1px 2px rgba(15,20,50,.05), 0 4px 14px rgba(15,20,50,.05);
  --shadow-md: 0 2px 4px rgba(15,20,50,.05), 0 12px 32px rgba(15,20,50,.09);
  --shadow-lg: 0 8px 20px rgba(15,20,50,.08), 0 30px 70px rgba(15,20,50,.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --bottom-nav-h: 68px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-grad: none;
  --surface: #0b0b0d;
  --surface-2: #121214;
  --surface-3: #1a1a1d;
  --line: #1f1f23;
  --line-strong: #2d2d33;
  --ink: #f4f4f6;
  --ink-2: #a3a3ab;
  --ink-3: #6f6f78;
  --brand: #8b93ff;
  --brand-2: #a78bfa;
  --brand-soft: rgba(139,147,255,.13);
  --brand-ink: #c4c8ff;
  --good: #3ddc97;
  --good-soft: rgba(61,220,151,.12);
  --warn: #f5b942;
  --warn-soft: rgba(245,185,66,.12);
  --bad: #ff6b7a;
  --bad-soft: rgba(255,107,122,.12);
  --info: #4cc9e8;
  --info-soft: rgba(76,201,232,.12);
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 0 0 1px #1f1f23;
  --shadow-lg: 0 20px 60px rgba(0,0,0,.8), 0 0 0 1px #26262b;
  color-scheme: dark;
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; min-height: 100dvh;
}
body.auth-checking { visibility: hidden; }
h1,h2,h3,h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
img,svg { max-width: 100%; }
.num, .kpi-value, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0,1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: 18px 14px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; color: var(--ink); text-decoration: none !important; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px rgba(79,70,229,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.03em; }
.brand-sub { font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: .02em; margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 0; background: transparent;
  color: var(--ink-2); font-weight: 600; font-size: 14px; text-align: left; width: 100%; position: relative; transition: background .2s var(--ease), color .2s;
}
.nav-link svg { width: 19px; height: 19px; flex: none; stroke-width: 1.9; }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--brand), var(--brand-2)); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-family: var(--font-display); flex: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 24px; }
.profile-chip .who { min-width: 0; flex: 1; }
.profile-chip .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chip .who span { font-size: 11px; color: var(--ink-3); }
.foot-actions { display: flex; gap: 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.topbar-sub { font-size: 12px; color: var(--ink-3); display: block; font-family: var(--font); font-weight: 500; letter-spacing: 0; }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center;
  color: var(--ink-2); position: relative; transition: transform .15s var(--ease), background .2s, border-color .2s; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-btn { display: none; }
.content { padding: 8px 28px 56px; width: 100%; max-width: 1320px; margin: 0 auto; }
.view { animation: viewIn .45s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { color: var(--ink-2); margin-top: 4px; font-size: 14px; max-width: 62ch; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s; text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 17px; height: 17px; }
.btn-primary, .btn.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.32), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); filter: brightness(1.07); box-shadow: 0 10px 24px rgba(79,70,229,.4), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-secondary { background: var(--surface-2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-good { background: var(--good); border-color: transparent; color: #fff; }
.btn-good:hover { background: var(--good); filter: brightness(1.08); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.grid { display: grid; gap: 18px; }
.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-main { grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); }
.mt { margin-top: 18px; } .mt-lg { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 28px 30px; color: #fff; isolation: isolate;
  background: radial-gradient(900px 380px at 100% 0%, rgba(124,58,237,.55), transparent 60%), radial-gradient(700px 360px at 0% 120%, rgba(16,185,129,.28), transparent 55%), linear-gradient(135deg, #0d1124 0%, #181c46 55%, #25206b 100%);
  box-shadow: var(--shadow-lg);
}
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(circle at 80% 20%, #000, transparent 70%); mask-image: radial-gradient(circle at 80% 20%, #000, transparent 70%); }
.hero-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero h1 { font-size: 30px; font-weight: 800; color: #fff; }
.hero p { color: rgba(255,255,255,.72); font-size: 14px; margin-top: 4px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); font-size: 12px; font-weight: 600; color: #fff; backdrop-filter: blur(8px); text-decoration: none !important; }
.hero-chip svg { width: 13px; height: 13px; }
.hero-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(8px); }
.hero .btn:hover { background: rgba(255,255,255,.2); }
.hero .btn-primary { background: #fff; color: #1e1b6e; border-color: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.hero .btn-primary:hover { background: #fff; filter: none; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.hero-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 14px 16px; backdrop-filter: blur(10px); }
.hero-stat span { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.62); }
.hero-stat b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-stat small { color: rgba(255,255,255,.62); font-size: 12px; }

/* ---------- KPI cards ---------- */
.kpi { position: relative; overflow: hidden; padding: 18px 20px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.kpi::after { content: ''; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, var(--kpi-c, var(--brand)) 0%, transparent 70%); opacity: .13; pointer-events: none; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--kpi-c, var(--brand)) 14%, transparent); color: var(--kpi-c, var(--brand)); flex: none; }
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -.035em; margin-top: 12px; line-height: 1.05; }
.kpi-value small { font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 3px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); min-height: 28px; }
.kpi-spark { width: 92px; height: 30px; flex: none; }
.kpi.click { cursor: pointer; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--good-soft); color: var(--good); } .delta.down { background: var(--bad-soft); color: var(--bad); } .delta.flat { background: var(--surface-3); color: var(--ink-3); }
.delta svg { width: 11px; height: 11px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); } .badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ev-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.ev-chip::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }

/* ---------- Controls ---------- */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 13px; background: var(--surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 -2px; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 15px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 7px; align-items: center; transition: all .2s var(--ease); }
.pill:hover { border-color: var(--line-strong); color: var(--ink); }
.pill.active { background: var(--ink); color: var(--surface); border-color: var(--ink); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .pill.active { background: #f4f4f6; color: #000; border-color: #f4f4f6; }
.pill .dot { width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--brand)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14.5px; transition: border-color .2s, box-shadow .2s;
}
.textarea { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238189a3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input::placeholder { color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 40px; }

/* ---------- Lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; border-radius: 14px; padding: 14px 12px; margin: 0 -12px; transition: background .2s; border-bottom: 0; }
.list-item.click:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { font-weight: 650; display: block; }
.list-item small { color: var(--ink-3); font-size: 12.5px; }
.date-tile { width: 54px; text-align: center; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); padding: 7px 0 6px; flex: none; }
.date-tile b { font-family: var(--font-display); font-size: 20px; line-height: 1; display: block; }
.date-tile span { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; } .t tbody tr:hover { background: var(--surface-2); }
.t td.r, .t th.r { text-align: right; }

/* ---------- Progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .9s var(--ease); }
.bar.good > i { background: linear-gradient(90deg, #10b981, #34d399); } .bar.warn > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .axis-text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px; max-width: 240px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 12px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
:root[data-theme="dark"] .chart-tip { background: #f1f3ff; color: #0d1124; }
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.chart-tip .tl { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-top: 2px; } .chart-tip .tl i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.chart-tip em { display: block; font-style: normal; opacity: .72; margin-top: 4px; font-size: 11.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.legend button { border: 0; background: none; padding: 2px 0; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.legend button i { width: 10px; height: 10px; border-radius: 3px; }
.legend button.off { opacity: .4; text-decoration: line-through; }
.chart-empty { display: grid; place-items: center; text-align: center; color: var(--ink-3); padding: 38px 16px; font-size: 14px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 150px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; } .donut-legend i { width: 10px; height: 10px; border-radius: 3px; } .donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--surface-3); display: block; min-width: 10px; }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--brand) 35%, var(--surface-3)); } .heat i[data-l="2"] { background: color-mix(in srgb, var(--brand) 62%, var(--surface-3)); } .heat i[data-l="3"] { background: var(--brand); }
.heat i.future { opacity: .35; }

/* ---------- Modal / sheet ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(8,11,28,.55); backdrop-filter: blur(6px); }
.modal-overlay.active, .modal-overlay.show { display: flex; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(560px, 100%); max-height: min(90vh, 880px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); animation: pop .35s var(--ease) both; overflow: hidden; }
.modal.wide { width: min(780px, 100%); } .modal.xwide { width: min(980px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; }
.modal-title { font-size: 18px; font-weight: 750; }
.modal-close { width: 36px; height: 36px; border-radius: 11px; border: 0; background: var(--surface-3); font-size: 22px; line-height: 1; color: var(--ink-2); }
.modal-close:hover { background: var(--line); color: var(--ink); }
.modal-body { padding: 4px 24px 20px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-footer { padding: 14px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--surface); }
.notify-panel-title { color: var(--ink) !important; } .notify-role-note { color: var(--ink-3) !important; }
.notify-mark-read-btn { color: var(--brand-ink) !important; }
.notify-panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.notify-panel-header { border-bottom-color: var(--line) !important; }
.notify-badge { background: var(--bad) !important; box-shadow: 0 0 0 2px var(--surface); top: -5px !important; right: -5px !important; }
.notify-tab:not(.active) { background: var(--surface-3) !important; color: var(--ink-2) !important; border-color: var(--line) !important; }
.notify-tab.active { background: var(--brand) !important; border-color: var(--brand) !important; }
.notify-prompt-card { background: var(--surface) !important; color: var(--ink) !important; } .notify-prompt-card p { color: var(--ink-2) !important; }
.notify-check { color: var(--ink) !important; }
.notify-status-text, .notify-role-note { color: var(--ink-3) !important; }
.student-picker-search { background: var(--surface-2) !important; color: var(--ink) !important; border-color: var(--line-strong) !important; }
.student-picker-list { background: var(--surface-2) !important; } .student-row { background: var(--surface) !important; } .student-row-name { color: var(--ink) !important; }
.student-chip { background: var(--surface-2) !important; color: var(--ink) !important; } .student-select-all { background: var(--brand-soft) !important; color: var(--ink) !important; }
.notify-modal-body input[type=text], #notify-modal-body input:not([type=checkbox]), #notify-modal-body select, #notify-modal-body textarea { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; font: inherit; }
#notify-modal-body label { color: var(--ink); }

.toast-host { position: fixed; z-index: 400; left: 50%; bottom: calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease) both; max-width: 100%; }
:root[data-theme="dark"] .toast { background: #f1f3ff; color: #0d1124; }
.toast.good svg { color: #34d399; } .toast.bad svg { color: #fb7185; } .toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (min-width: 1025px) { .toast-host { bottom: 28px; } }

/* ---------- States ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty .empty-ico { width: 60px; height: 60px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .empty-ico svg { width: 28px; height: 28px; }
.empty h3 { font-size: 17px; color: var(--ink); margin-bottom: 6px; } .empty p { max-width: 42ch; margin: 0 auto; font-size: 14px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 12px; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-card { height: 150px; border-radius: var(--radius-lg); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); } .notice.warn svg { color: var(--warn); }
.notice.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 28%, transparent); } .notice.good svg { color: var(--good); }
.notice.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 28%, transparent); } .notice.info svg { color: var(--info); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 28%, transparent); } .notice.bad svg { color: var(--bad); }

/* ---------- Competition cards ---------- */
.comp-card { padding: 0; overflow: hidden; }
.comp-head { display: flex; gap: 16px; padding: 20px 22px; align-items: flex-start; flex-wrap: wrap; }
.comp-date { width: 64px; text-align: center; border-radius: 16px; padding: 9px 0 8px; background: linear-gradient(160deg, var(--brand), var(--brand-2)); color: #fff; flex: none; box-shadow: 0 8px 20px rgba(79,70,229,.28); }
.comp-date b { font-family: var(--font-display); font-size: 24px; display: block; line-height: 1; } .comp-date span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.comp-info { flex: 1; min-width: 220px; }
.comp-info h3 { font-size: 18px; } .comp-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.comp-meta span { display: inline-flex; align-items: center; gap: 5px; } .comp-meta svg { width: 14px; height: 14px; color: var(--ink-3); }
.comp-events { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 16px; }
.comp-people { border-top: 1px solid var(--line); background: var(--surface-2); padding: 14px 22px 18px; }
.comp-people h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.person .nm { min-width: 0; flex: 1; } .person .nm b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wca-id { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 8px; border-radius: 7px; text-decoration: none !important; display: inline-block; }
.person .ev { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.ev-mini { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.countdown { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.countdown.soon { background: var(--bad-soft); color: var(--bad); } .countdown.live { background: var(--good-soft); color: var(--good); }

/* ---------- Timeline (milestones) ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand), transparent); border-radius: 2px; opacity: .5; }
.tl-item { position: relative; padding: 0 0 22px; }
.tl-item::before { content: ''; position: absolute; left: -26px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-item b { display: block; } .tl-item small { color: var(--ink-3); }

/* ---------- Calendar (booking) ---------- */
.day-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-btn { flex: none; width: 64px; padding: 11px 0; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: center; scroll-snap-align: start; transition: all .2s var(--ease); }
.day-btn span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.day-btn b { display: block; font-family: var(--font-display); font-size: 21px; margin-top: 2px; }
.day-btn small { display: block; font-size: 10.5px; color: var(--ink-3); }
.day-btn:hover { border-color: var(--brand); }
.day-btn.active { background: linear-gradient(160deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 10px 22px rgba(79,70,229,.32); }
.day-btn.active span, .day-btn.active small { color: rgba(255,255,255,.8); }
.day-btn.none { opacity: .45; }
.slot-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 16px 0 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.slot { height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; transition: all .15s var(--ease); }
.slot:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.slot.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 8px 18px rgba(79,70,229,.32); }

/* week calendar (coach) */
.cal-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); max-height: 70vh; position: relative; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(120px, 1fr)); min-width: 920px; position: relative; }
.cal-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); text-align: center; padding: 10px 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cal-head b { display: block; font-size: 18px; font-family: var(--font-display); color: var(--ink); } .cal-head.today b { color: var(--brand); }
.cal-time { font-size: 10.5px; color: var(--ink-3); text-align: right; padding: 0 8px; height: 48px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); height: calc(24 * 48px); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 48px; }
.cal-ev { position: absolute; left: 3px; right: 3px; border-radius: 9px; padding: 4px 7px; font-size: 11.5px; font-weight: 600; overflow: hidden; cursor: pointer; border: 1px solid; line-height: 1.25; }
.cal-ev.avail { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); color: var(--good); z-index: 1; }
.cal-ev.block { background: repeating-linear-gradient(135deg, var(--bad-soft), var(--bad-soft) 6px, transparent 6px, transparent 12px); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); z-index: 1; }
.cal-ev.sess { background: var(--brand); border-color: var(--brand); color: #fff; z-index: 2; box-shadow: var(--shadow-sm); }
.cal-ev.sess.done { background: var(--surface-3); color: var(--ink-2); border-color: var(--line-strong); box-shadow: none; }
.cal-ev.req { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); border-style: dashed; z-index: 3; }
.cal-ev.misc { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); z-index: 2; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 5; } .cal-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; }
.sheet-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-nav button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.sheet-nav button svg { width: 22px; height: 22px; color: var(--brand); }
.sidebar-overlay { display: none; }

/* ---------- Auth / public pages ---------- */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
  background: radial-gradient(800px 500px at 100% 0%, rgba(124,58,237,.6), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(16,185,129,.3), transparent 55%), linear-gradient(140deg, #0b0e22, #1b1f55 60%, #2a2377); }
.auth-art::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .45; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%); mask-image: radial-gradient(circle at 70% 30%, #000, transparent 72%); }
.auth-art h2 { font-size: 40px; font-weight: 800; max-width: 14ch; line-height: 1.08; } .auth-art p { color: rgba(255,255,255,.72); max-width: 44ch; margin-top: 14px; font-size: 16px; }
.auth-feat { display: grid; gap: 12px; margin-top: 30px; } .auth-feat div { display: flex; gap: 12px; align-items: center; font-size: 14px; color: rgba(255,255,255,.88); } .auth-feat svg { width: 20px; height: 20px; padding: 7px; box-sizing: content-box; border-radius: 12px; background: rgba(255,255,255,.12); }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 28px; font-weight: 800; } .auth-card > p { color: var(--ink-2); margin: 6px 0 22px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 14px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 11px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.otp-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.otp-input { height: 52px; text-align: center; font-size: 20px; font-weight: 700; padding: 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; margin: 16px 0; } .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.alert { display: none; padding: 11px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.alert.show { display: block; } .alert-error { background: var(--bad-soft); color: var(--bad); } .alert-success { background: var(--good-soft); color: var(--good); } .alert-info { background: var(--info-soft); color: var(--info); }
.pub-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; max-width: 1180px; margin: 0 auto; }
.pub-nav nav { display: flex; gap: 20px; align-items: center; } .pub-nav nav a { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.pub-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 28px 80px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1100px) { .g-main { grid-template-columns: minmax(0,1fr); } .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); background: var(--surface); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(8,11,28,.5); backdrop-filter: blur(4px); z-index: 35; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; } .content { padding: 4px 16px calc(var(--bottom-nav-h) + 34px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding: 8px 8px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(20px); border-top: 1px solid var(--line); justify-content: space-around; }
  .bottom-nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--ink-3); border-radius: 14px; position: relative; transition: color .2s; padding: 0; min-width: 0; }
  .bottom-nav button svg { width: 22px; height: 22px; transition: transform .25s var(--ease); }
  .bottom-nav button.active { color: var(--brand); } .bottom-nav button.active svg { transform: translateY(-2px) scale(1.08); }
  .bottom-nav button.active::after { content: ''; position: absolute; top: -9px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .page-head h1 { font-size: 23px; } .g-2, .g-3, .g-4 { grid-template-columns: minmax(0,1fr); } .g-4.keep2, .g-3.keep2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-4.keep2 .kpi, .g-3.keep2 .kpi { padding: 14px 14px 12px; } .g-4.keep2 .kpi-value, .g-3.keep2 .kpi-value { font-size: 25px; } .kpi-spark { width: 64px; }
  .hero { padding: 20px 18px; border-radius: 24px; } .hero h1 { font-size: 23px; } .hero-actions { margin-left: 0; width: 100%; } .hero-actions .btn { flex: 1; }
  .hero-stats { gap: 8px; } .hero-stat { padding: 11px 12px; border-radius: 15px; } .hero-stat b { font-size: 21px; }
  .card-pad { padding: 16px; } .form-grid { grid-template-columns: minmax(0,1fr); }
  .modal-overlay { padding: 0; align-items: flex-end; } .modal, .modal.wide, .modal.xwide { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 26px 26px 0 0; animation: sheetUp .38s var(--ease) both; }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .modal-header { padding: 18px 18px 10px; } .modal-body { padding: 4px 18px 16px; } .modal-footer { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); } .modal-footer .btn { flex: 1; }
  .comp-head { padding: 16px; } .comp-events { padding: 0 16px 14px; } .comp-people { padding: 14px 16px 16px; } .people-grid { grid-template-columns: minmax(0,1fr); }
  .auth-shell { grid-template-columns: minmax(0,1fr); } .auth-art { display: none; } .otp-row { gap: 4px; } .otp-input { height: 46px; font-size: 18px; }
  .t th, .t td { padding: 11px 12px; } .pub-nav, .pub-wrap { padding-left: 16px; padding-right: 16px; }
  .responsive-cards thead { display: none; } .responsive-cards tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); } .responsive-cards td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; } .responsive-cards td::before { content: attr(data-label); font-weight: 600; color: var(--ink-3); text-align: left; font-size: 12.5px; }
}
@media (hover: none) { .kpi:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media print {
  .sidebar, .topbar, .bottom-nav, .head-actions, .hero-actions, .toast-host, .no-print { display: none !important; }
  .app { display: block; } body { background: #fff; color: #000; } .card, .kpi { box-shadow: none; break-inside: avoid; } .content { padding: 0; max-width: none; }
  .hero { background: #1b1f55 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.lg { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:5px; vertical-align:-1px; }
.student-card { transition: transform .2s var(--ease), box-shadow .2s; } .student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sess-actions { display:flex; gap:6px; justify-content:flex-end; }
.comp-people h4 svg, .comp-meta svg, .person svg { width: 16px; height: 16px; flex: none; } .comp-people h4 { display:flex; align-items:center; gap:8px; }

/* ---------- compact competition list ---------- */
.comp-list { padding: 0; overflow: hidden; }
.comp-row + .comp-row { border-top: 1px solid var(--line); }
.comp-row-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: transparent; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.comp-row-head:hover { background: var(--surface-2); }
.date-chip { flex: none; width: 48px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.date-chip b { font-family: var(--font-display); font-size: 19px; display: block; } .date-chip i { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.comp-row-main { flex: 1; min-width: 0; } .comp-row-main b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .comp-row-main small { color: var(--ink-3); font-size: 12.5px; }
.chev { flex: none; width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s var(--ease); display: grid; place-items: center; } .chev svg { width: 18px; height: 18px; }
[aria-expanded="true"] > .chev { transform: rotate(180deg); }
.comp-row-body { padding: 4px 18px 18px 80px; background: var(--surface-2); border-top: 1px solid var(--line); }
.comp-row-actions { display: flex; gap: 12px; align-items: center; padding: 12px 0 8px; }
.stu-list { display: flex; flex-direction: column; gap: 6px; }
.stu-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stu-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: transparent; border: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.stu-row b { font-weight: 650; } .stu-row .stu-count { margin-left: auto; font-size: 12.5px; }
.stu-events { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 13px; }
.comp-offered { margin-top: 12px; font-size: 13px; color: var(--ink-2); } .comp-offered summary { cursor: pointer; font-weight: 600; } .comp-offered div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 720px) { .comp-row-head { padding: 12px 14px; gap: 10px; } .comp-row-head .badge { display: none; } .comp-row-body { padding: 4px 14px 16px; } .comp-row-head .countdown { display: none; } }

/* ---------- clean rows & pills ---------- */
.time-pill { flex: none; min-width: 84px; padding: 8px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 750; font-size: 14px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-link { display: flex; align-items: center; gap: 14px; padding: 12px 10px; margin: 0 -10px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.row-link:hover { background: var(--surface-2); }
.row-link .grow { flex: 1; min-width: 0; } .row-link b { display: block; font-weight: 650; } .row-link small { color: var(--ink-3); font-size: 12.5px; }
.row-link > .chev { opacity: .6; transform: rotate(-90deg); }
.kpi.alert-bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); box-shadow: 0 0 0 3px var(--bad-soft); }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.chg { font-size: 13px; color: var(--ink-2); } .chg b { color: var(--ink); }
.stat-line { display: flex; flex-wrap: wrap; gap: 18px; }
.stat-line div span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); } .stat-line div b { font-size: 17px; font-variant-numeric: tabular-nums; }
.session-board-head { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.session-board-head .when { flex: 1; min-width: 160px; } .session-board-head .when b { display: block; font-size: 17px; } .session-board-head .when small { color: var(--ink-2); }
.session-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hero-top { align-items: flex-start; }

/* ---- Phase 3: solve data ---- */
.pill-n { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--ink-2); }
.pill.active .pill-n { background: rgba(255,255,255,.25); color: inherit; }
.de-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .de-grid.de-3 { grid-template-columns: repeat(3, 1fr); }
.de-big { font-size: 20px; font-weight: 700; text-align: center; padding: 14px 8px; font-variant-numeric: tabular-nums; }
.de-base { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .de-base label { font-size: 13px; font-weight: 650; color: var(--ink-2); } .de-base .input { width: auto; flex: 1; min-width: 110px; }
@media (max-width: 560px) { .de-grid.de-3 { gap: 8px; } .de-big { font-size: 17px; padding: 12px 4px; } }
#de-evs, #an-chips { flex-wrap: wrap; overflow: visible; } .pill.active .pill-n{color:inherit}

/* ---- pure black dark theme refinements ---- */
:root[data-theme="dark"] body { background: #000; background-image: none; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .hero { box-shadow: none; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi { background: var(--surface); border-color: var(--line); }
:root[data-theme="dark"] .sidebar, :root[data-theme="dark"] .topbar, :root[data-theme="dark"] .bottom-nav { background: #000; border-color: var(--line); backdrop-filter: none; }
:root[data-theme="dark"] .kpi::after, :root[data-theme="dark"] .kpi::before { display: none; }
:root[data-theme="dark"] .btn-primary { background: #f4f4f6; color: #000; border-color: #f4f4f6; box-shadow: none; }
:root[data-theme="dark"] .btn-primary:hover { background: #fff; }
:root[data-theme="dark"] .modal, :root[data-theme="dark"] .modal-card { background: #0b0b0d; border: 1px solid var(--line-strong); }
:root[data-theme="dark"] .hero { background: #0b0b0d; border: 1px solid var(--line); }
:root[data-theme="dark"] .nav a.active, :root[data-theme="dark"] .nav-item.active { background: #17171a; color: #fff; }

/* ---- home: upcoming strip ---- */
.strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.up-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.up-chip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 128px; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.up-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.up-chip .up-day { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); } .up-chip b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; } .up-chip .up-name { font-size: 13px; color: var(--ink-2); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.grid.eq { align-items: start; }
.pills { flex-wrap: wrap; overflow: visible; }
.focus-card { border-left: 4px solid var(--brand); }
.focus-body { font-size: 16px; line-height: 1.55; white-space: pre-wrap; color: var(--ink); } .focus-sub { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }

/* ---- combobox ---- */
.combo { position: relative; } .combo .input { padding-right: 36px; }
.combo-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; display: flex; } .combo-chev svg { width: 16px; height: 16px; }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); }
.combo-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.combo-item:hover, .combo-item.active { background: var(--brand-soft); color: var(--brand-ink); }
.combo-empty { padding: 10px 12px; color: var(--ink-3); font-size: 13px; }
/* ---- solve data ---- */
.sd-bar { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 1fr) auto; gap: 12px; align-items: end; }
.sd-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sd-stats span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); } .sd-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.entry-grid { display: grid; grid-template-columns: 1.9fr repeat(8, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.entry-grid .field label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.entry-grid .input { padding: 10px 10px; text-align: center; font-variant-numeric: tabular-nums; } .entry-grid input[type=date] { text-align: left; }
.entry-grid .key .input { font-weight: 700; border-color: var(--line-strong); }
@media (max-width: 900px) { .sd-bar { grid-template-columns: 1fr; } .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .entry-grid .date, .entry-grid .go { grid-column: 1 / -1; } }
.tabs-seg { margin-bottom: 18px; }

/* ===== Notification settings + centre ===== */
.nset-card { background: var(--surface-2, var(--surface)); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.nset-head h4 { margin: 0; font-size: 15px; color: var(--ink); } .nset-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); }
.nset-body { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.nset-row.notify-check, .nset-row { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 2px; border-top: 1px solid var(--line); cursor: pointer; margin: 0 !important; flex-direction: row-reverse; }
.nset-body > .nset-row:first-child { border-top: 0; }
.nset-row span { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nset-row b { font-weight: 600; font-size: 14px; color: var(--ink); } .nset-row small { font-size: 12px; color: var(--ink-3); }
.nset-row input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3, #d9dbe3); position: relative; cursor: pointer; transition: background .2s; border: 1px solid var(--line); margin: 0; }
.nset-row input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.nset-row input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); } .nset-row input[type=checkbox]:checked::after { transform: translateX(18px); }
.nset-off { margin-top: 8px; } .nset-off .form-input { width: 100%; }
.off-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.off-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.off-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.nset-custom summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; } .nset-custom summary::-webkit-details-marker { display: none; }
.nset-custom summary b { font-size: 15px; color: var(--ink); } .nset-custom summary small { font-size: 12.5px; color: var(--ink-3); }
.nset-custom[open] summary { margin-bottom: 8px; }
#notify-modal-body .notify-status-text { text-align: center; padding: 6px 0 0; font-size: 12.5px; }
#notification-settings-modal .modal-body { background: transparent; }
.notify-panel-actions { display: flex; gap: 14px; align-items: center; } .notify-clear-btn { background: none; border: 0; font-weight: 600; cursor: pointer; font-size: 13px; color: var(--bad) !important; }
#announcements-modal .modal-footer { flex-wrap: wrap; }
@media (max-width: 720px) { .notify-panel-header { flex-direction: column; } #notification-settings-modal .notify-grid { grid-template-columns: 1fr !important; } }

/* ===== slim upcoming strip ===== */
.strip-slim { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; margin-top: 16px; }
.strip-slim .strip-label { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.strip-slim .up-strip { flex: 1; min-width: 0; padding: 0; gap: 8px; scrollbar-width: none; } .strip-slim .up-strip::-webkit-scrollbar { display: none; }
.strip-slim .up-chip { flex-direction: row; align-items: center; gap: 7px; min-width: 0; padding: 6px 12px; border-radius: 99px; white-space: nowrap; }
.strip-slim .up-chip .up-day { font-size: 10.5px; } .strip-slim .up-chip b { font-size: 13.5px; } .strip-slim .up-chip .up-name { font-size: 13px; }
@media (max-width: 720px) { .strip-slim { padding: 8px 8px 8px 12px; } .strip-slim .strip-label { display: none; } }

/* ===== improvement KPI blocks ===== */
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 10px; } .imp-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.imp-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.imp-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.imp-card.main.good { background: color-mix(in srgb, var(--good, #0f9f6e) 10%, var(--surface)); border-color: color-mix(in srgb, var(--good, #0f9f6e) 35%, var(--line)); }
.imp-l { font-size: 12px; color: var(--ink-3); font-weight: 600; } .imp-v { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -.02em; } .imp-card.main.good .imp-v { color: var(--good, #0f9f6e); }
.imp-v.sm { font-size: 18px; padding-top: 5px; } .imp-v i { font-style: normal; font-size: 12px; color: var(--ink-3); font-weight: 500; margin: 0 2px; }
.imp-s { font-size: 12px; color: var(--ink-3); }
@media (max-width: 720px) { .imp-grid { grid-template-columns: 1fr 1fr; } .imp-card.main { grid-column: 1 / -1; } .imp-v { font-size: 24px; } }

/* ===== notes ===== */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.note-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: default; }
.note-card[data-note] { cursor: pointer; transition: border-color .15s, transform .15s; } .note-card[data-note]:hover { border-color: var(--brand); transform: translateY(-1px); }
.note-card.latest { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.note-card header { display: flex; align-items: center; gap: 10px; } .note-card header small { display: block; font-size: 12px; color: var(--ink-3); }
.note-block { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; } .note-block.focus { background: var(--brand-soft); }
.note-block span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); } .note-block.focus span { color: var(--brand-ink, var(--brand)); }
.note-block p { margin: 3px 0 0; font-size: 14px; white-space: pre-wrap; color: var(--ink); line-height: 1.5; }
@media (max-width: 720px) { .notes-grid { grid-template-columns: 1fr; } }
