/* SpeakUp Institute Portal — design system + layout */

:root {
    --bg: #f3f6f5;
    --surface: #ffffff;
    --surface-2: #f7f9f8;
    --line: #e2e8e5;
    --line-2: #cfd9d5;
    --ink: #0d1f2d;
    --ink-2: #394a56;
    --muted: #677784;
    --brand: #0f766e;
    --brand-600: #0d9488;
    --brand-700: #115e59;
    --brand-50: #e8f5f2;
    --brand-100: #cdebe4;
    --navy: #0c2233;
    --navy-2: #133247;
    --green: #15803d;
    --green-50: #e7f6ec;
    --amber: #b45309;
    --amber-50: #fef4e4;
    --red: #b91c1c;
    --red-50: #fdeded;
    --blue: #1d4ed8;
    --blue-50: #eaf0fe;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(13, 31, 45, .06);
    --shadow: 0 1px 2px rgba(13, 31, 45, .05), 0 8px 24px -12px rgba(13, 31, 45, .14);
    --shadow-lg: 0 30px 70px -24px rgba(13, 31, 45, .45);
    --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
svg { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(15, 118, 110, .35); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 56px; height: 56px; border-radius: 50%; background: #fff url('../../static/img/logo-128.png') center/cover; box-shadow: var(--shadow); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
    text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -8px rgba(15,118,110,.8); }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: #b9c6c1; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(13, 31, 45, .05); }
.btn-danger { background: var(--red-50); color: var(--red); border-color: #f5c9c9; }
.btn-danger:hover { background: #fbe0e0; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
    width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px;
    border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: rgba(13, 31, 45, .06); }
.icon-btn svg { width: 18px; height: 18px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- form controls ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.input, .select {
    height: 44px; width: 100%; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--line-2); background: #fff; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(13, 148, 136, .14); }
.input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(185, 28, 28, .1); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
    height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
    font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2);
}
.chip-btn:hover { border-color: var(--brand-600); color: var(--brand-700); }
.chip-btn.is-on { background: var(--brand-50); border-color: var(--brand-600); color: var(--brand-700); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; overflow: hidden; }
.stepper button { width: 44px; height: 48px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 20px; font-weight: 600; color: var(--ink-2); }
.stepper button:hover { background: var(--brand-50); color: var(--brand-700); }
.stepper input { width: 84px; height: 48px; border: 0; text-align: center; font-size: 20px; font-weight: 750; outline: none; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art {
    position: relative; overflow: hidden; color: #eaf6f3; padding: 48px 56px;
    background: radial-gradient(1200px 600px at -10% -10%, rgba(45, 212, 191, .28), transparent 60%),
                radial-gradient(900px 500px at 110% 110%, rgba(132, 204, 22, .22), transparent 60%),
                linear-gradient(150deg, #0b2536 0%, #0e3b4a 45%, #0f5b54 100%);
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-art::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.login-brand b { font-size: 18px; letter-spacing: -.01em; }
.login-brand span { display: block; font-size: 12.5px; color: rgba(234, 246, 243, .7); font-weight: 500; }
.login-copy { position: relative; z-index: 1; max-width: 520px; }
.login-copy h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.025em; color: #fff; }
.login-copy h1 em { font-style: normal; background: linear-gradient(90deg, #5eead4, #bef264); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-copy p { margin-top: 14px; font-size: 16px; color: rgba(234, 246, 243, .82); max-width: 460px; }
.login-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.login-points li { display: flex; gap: 14px; align-items: flex-start; }
.login-points .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.login-points .ic svg { width: 18px; height: 18px; color: #99f6e4; }
.login-points b { display: block; color: #fff; font-size: 15px; }
.login-points span { font-size: 13.5px; color: rgba(234, 246, 243, .72); }
.login-preview { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; }
.login-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 16px; min-width: 150px; backdrop-filter: blur(6px); }
.login-stat b { display: block; font-size: 22px; color: #fff; }
.login-stat span { font-size: 12.5px; color: rgba(234, 246, 243, .72); }
.login-form-side { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-card .lead { color: var(--muted); margin-top: 6px; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.login-card .input { height: 48px; font-size: 15px; }
.login-card .uid-input { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.login-help { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); display: flex; gap: 10px; }
.login-help svg { width: 18px; height: 18px; color: var(--brand); margin-top: 1px; }
.form-error { display: none; padding: 10px 14px; border-radius: 10px; background: var(--red-50); color: var(--red); font-size: 13.5px; font-weight: 600; border: 1px solid #f5caca; }
.form-error.show { display: block; }
.login-foot { margin-top: 26px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--navy) 0%, #0e2a3c 100%); color: #cfe3de; padding: 20px 14px;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.side-brand b { color: #fff; font-size: 15.5px; display: block; }
.side-brand span { font-size: 12px; color: rgba(207, 227, 222, .65); }
.side-inst { margin: 16px 6px 8px; padding: 12px 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.side-inst b { display: block; color: #fff; font-size: 14px; line-height: 1.3; }
.side-inst span { font-size: 12px; color: rgba(207, 227, 222, .7); }
.side-nav { display: grid; gap: 4px; margin-top: 10px; }
.side-nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: #cfe3de; font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.side-nav a svg { width: 19px; height: 19px; opacity: .85; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.is-active { background: linear-gradient(90deg, rgba(45, 212, 191, .22), rgba(45, 212, 191, .06)); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.side-nav .badge { margin-left: auto; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side-me { display: flex; align-items: center; gap: 10px; padding: 6px 6px; }
.side-me > div > b { color: #fff; font-size: 13.5px; display: block; line-height: 1.25; }
.side-me > div > span { font-size: 12px; color: rgba(207, 227, 222, .65); }
.side-foot .btn { background: rgba(255,255,255,.06); color: #e6f2ef; border-color: rgba(255,255,255,.1); }
.side-foot .btn:hover { background: rgba(255,255,255,.12); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
    padding: 14px 32px; background: rgba(243, 246, 245, .86); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid rgba(207, 217, 213, .6);
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs svg { width: 14px; height: 14px; }
.topbar-title { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 26px 32px 60px; width: 100%; max-width: 1280px; margin: 0 auto; }
.scrim { display: none; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }

/* ---------- hero (overview) ---------- */
.hero {
    position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; color: #eaf6f3; margin-bottom: 22px;
    background: radial-gradient(700px 300px at 100% 0%, rgba(132, 204, 22, .25), transparent 60%),
                linear-gradient(135deg, #0c2a3d 0%, #0f4a52 55%, #0f766e 100%);
    display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.hero h1 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero p { color: rgba(234, 246, 243, .8); margin-top: 6px; }
.hero .chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero .chip { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.hero .btn-primary { background: #fff; color: var(--brand-700); box-shadow: 0 10px 24px -12px rgba(0,0,0,.5); }
.hero .btn-primary:hover { background: #ecfdf8; }

/* ---------- cards / kpis ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h3 { font-size: 16px; font-weight: 750; }
.card-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 16px 22px 20px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main-side { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.kpi .kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi .kpi-ic svg { width: 20px; height: 20px; }
.kpi .kpi-ic.teal { background: var(--brand-50); color: var(--brand); }
.kpi .kpi-ic.blue { background: var(--blue-50); color: var(--blue); }
.kpi .kpi-ic.green { background: var(--green-50); color: var(--green); }
.kpi .kpi-ic.amber { background: var(--amber-50); color: var(--amber); }
.kpi .kpi-ic.violet { background: #f1ebfe; color: #6d28d9; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-meter { margin-top: 8px; }
.kpi-meter .bar-track { height: 6px; }
.kpi-val small { font-size: 14px; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.kpi .ring { margin-left: auto; }

/* ---------- chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip.teal { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.chip.green { background: var(--green-50); border-color: #c8ebd3; color: var(--green); }
.chip.amber { background: var(--amber-50); border-color: #f8dfb5; color: var(--amber); }
.chip.red { background: var(--red-50); border-color: #f5caca; color: var(--red); }
.chip.grey { background: #eef1f0; border-color: #e1e7e4; color: #5d6c77; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 28px; padding: 0 9px; border-radius: 8px; font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.score.b-ex { background: var(--green-50); color: var(--green); }
.score.b-good { background: var(--brand-50); color: var(--brand-700); }
.score.b-dev { background: var(--amber-50); color: var(--amber); }
.score.b-low { background: var(--red-50); color: var(--red); }
.score.b-none { background: #eef1f0; color: #7b8993; font-weight: 650; }
.uid { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 7px; background: #eef3f1; color: var(--ink); border: 1px solid #e0e8e4; }

/* ---------- avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0; letter-spacing: .02em; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div { min-width: 0; }
.who > div > b { display: block; font-size: 14px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who > div > span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- charts ---------- */
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; text-align: center; line-height: 1.05; }
.ring .ring-label b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring .ring-label span { font-size: 10.5px; color: var(--muted); font-weight: 650; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 170px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; }
.bar-row .bar-name { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-name small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.bar-track { height: 10px; border-radius: 999px; background: #edf1ef; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-600), #34d399); width: 0; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.bar-fill.b-ex { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bar-fill.b-good { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.bar-fill.b-dev { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar-fill.b-low { background: linear-gradient(90deg, #dc2626, #f87171); }
.bar-row .bar-val { text-align: right; font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
a.bar-row { color: inherit; text-decoration: none; border-radius: 8px; margin: -4px -6px; padding: 4px 6px; }
a.bar-row:hover { background: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { display: grid; gap: 10px; min-width: 160px; }
.donut-legend div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.donut-legend i { width: 12px; height: 12px; border-radius: 4px; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.trend-svg { width: 100%; height: auto; display: block; }
.improve { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.improve span { display: block; font-size: 12px; color: var(--muted); font-weight: 650; }
.improve b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.improve .arrow { color: var(--muted); }
.improve .arrow svg { width: 20px; height: 20px; }
.improve .chip { margin-left: auto; height: 30px; font-size: 13px; }
.improve p { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.trend-svg .axis { stroke: #e3e9e6; stroke-width: 1; }
.trend-svg text { fill: #8795a0; font-size: 11px; font-family: var(--font); }

/* ---------- lists / tables ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; min-width: 220px; flex: 0 1 320px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.search .input { height: 40px; padding-left: 38px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #e9eeec; border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 32px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button .count { margin-left: 6px; font-size: 11.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
    text-align: left; font-size: 12px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
    padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th .arrow { opacity: .5; margin-left: 4px; }
.table td { padding: 12px 14px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: #f6faf8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-right { text-align: right; }
.table .t-center { text-align: center; }
.rank { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; background: #eef2f0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank.r1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #6b3d00; }
.rank.r2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank.r3 { background: linear-gradient(135deg, #fed7aa, #ea8a4a); color: #5c2a0b; }
.mini-bar { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.mini-bar .bar-track { flex: 1; height: 8px; }
/* a long email must not push Status and the row menu out of view */
#stu-table th, #stu-table td { padding-left: 10px; padding-right: 10px; }
#stu-table .who { max-width: 260px; }
#stu-table .mini-bar { min-width: 120px; }
#stu-table .chip { white-space: nowrap; }
@media (max-width: 1360px) { #stu-table .hide-md { display: none; } }
@media (max-width: 1180px) { #stu-table .hide-lg { display: none; } #stu-table .who { max-width: 220px; } }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid #edf1ef; }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { font-size: 14px; }
.list-item p { font-size: 13px; color: var(--muted); }

/* ---------- class cards ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.class-card { position: relative; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; text-decoration: none !important; color: inherit; }
.class-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(13,31,45,.05), 0 18px 36px -18px rgba(13,31,45,.3); border-color: var(--brand-100); }
.class-card .cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.class-card .cc-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.class-card .cc-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.class-card .cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.class-card .cc-stat { background: var(--surface-2); border: 1px solid #edf1ef; border-radius: 10px; padding: 8px 10px; }
.class-card .cc-stat b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.class-card .cc-stat span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.class-card .cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.class-card .cc-progress { display: grid; gap: 6px; }
.class-card .cc-progress .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.new-card { border: 2px dashed var(--line-2); background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; min-height: 230px; color: var(--ink-2); }
.new-card:hover { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); transform: none; }
.new-card .plus { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; box-shadow: 0 10px 22px -10px rgba(15,118,110,.8); }
.new-card .plus svg { width: 24px; height: 24px; }

/* ---------- faculty cards ---------- */
.fac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fac-card { padding: 18px; display: grid; gap: 14px; }
.fac-card .classes { display: flex; flex-wrap: wrap; gap: 6px; }
.fac-card .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fac-card .meta div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; border: 1px solid #edf1ef; }
.fac-card .meta b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fac-card .meta span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fac-card .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- student report ---------- */
.profile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; }
.profile h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile .facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.profile .facts span { display: inline-flex; align-items: center; gap: 6px; }
.profile .facts svg { width: 15px; height: 15px; }
.profile .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.module { padding: 16px; display: grid; gap: 12px; }
.module.is-empty { background: var(--surface-2); box-shadow: none; }
.module .m-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.module .m-name { font-weight: 750; font-size: 14.5px; }
.module .m-sub { font-size: 12.5px; color: var(--muted); }
.module .m-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; color: var(--muted); }
.module .m-nums b { display: block; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.timeline { display: grid; }
.timeline .t-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #edf1ef; }
.timeline .t-item:first-child { border-top: 0; }
.timeline .t-item .grow { flex: 1; min-width: 0; }
.timeline .t-item b { font-size: 14px; }
.timeline .t-item span { font-size: 12.5px; color: var(--muted); }

/* ---------- empty / notices / skeleton ---------- */
.empty { text-align: center; padding: 48px 24px; display: grid; justify-items: center; gap: 10px; }
.empty .art { width: 132px; height: 104px; margin-bottom: 6px; }
.empty h3 { font-size: 18px; font-weight: 800; }
.empty p { color: var(--muted); max-width: 440px; }
.empty .btn { margin-top: 8px; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; align-items: flex-start; }
.notice svg { width: 20px; height: 20px; margin-top: 1px; }
.notice.info { background: var(--blue-50); border-color: #cfdcfb; color: #1e3a8a; }
.notice.ok { background: var(--green-50); border-color: #c8ebd3; color: #14532d; }
.notice.warn { background: var(--amber-50); border-color: #f8dfb5; color: #78350f; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { position: relative; padding: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.step .n { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; margin-bottom: 10px; }
.step.done .n { background: var(--green); }
.step b { display: block; font-size: 15px; }
.step p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.skel { background: linear-gradient(90deg, #e9eeec 0%, #f4f7f6 50%, #e9eeec 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- menus ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: none;
}
.menu.open { display: block; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); text-align: left; text-decoration: none !important; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu button svg, .menu a svg { width: 17px; height: 17px; color: var(--muted); }
.menu .danger, .menu .danger svg { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .menu-note { padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- drawer / modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(9, 23, 34, .45); backdrop-filter: blur(2px); display: flex; justify-content: flex-end; animation: fade .15s ease-out; }
.overlay.center { justify-content: center; align-items: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(560px, 100%); height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
.modal { width: min(500px, 100%); max-height: calc(100vh - 40px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .16s ease-out; }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.dlg-head p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.dlg-head .icon-btn { margin-left: auto; margin-top: -4px; }
.dlg-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 18px; align-content: start; flex: 1; }
.dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 18px 18px; }
.drawer .dlg-foot { border-radius: 0; }
.label-preview { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-50), #f2fbf4); border: 1px solid var(--brand-100); }
.label-preview .tag { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--brand-700); }
.label-preview span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.seat-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.seat-hint .bar-track { width: 120px; height: 6px; }
.fac-pick { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.fac-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; transition: border-color .12s, background .12s; }
.fac-opt:hover { border-color: var(--line-2); background: var(--surface-2); }
.fac-opt.is-on { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.fac-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fac-opt .grow { flex: 1; min-width: 0; }
.fac-opt .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; color: #fff; }
.fac-opt.is-on .tick { background: var(--brand); border-color: var(--brand); }
.fac-opt .tick svg { width: 13px; height: 13px; }
.success-panel { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 12px 0; }
.success-panel .big-check { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #34d399, #0f766e); color: #fff; box-shadow: 0 18px 40px -16px rgba(15,118,110,.9); animation: popin .4s cubic-bezier(.2,1.4,.4,1); }
.success-panel .big-check svg { width: 38px; height: 38px; }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }
.success-panel h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.success-panel p { color: var(--muted); max-width: 400px; }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: #0c2233; color: #fff; }
.secret-box .mono { font-size: 20px; font-weight: 700; letter-spacing: .12em; flex: 1; }
.secret-box .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 650; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #0c2233; color: #eaf6f3; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .2s ease-out; }
.toast svg { width: 20px; height: 20px; margin-top: 1px; color: #5eead4; }
.toast.err svg { color: #fca5a5; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }


/* ---------- plan limits ---------- */
.limits { display: grid; gap: 16px; }
.limit { display: grid; gap: 7px; color: inherit; text-decoration: none !important; padding: 4px 6px; margin: -4px -6px; border-radius: 10px; }
.limit:hover { background: var(--surface-2); }
.limit .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.limit .row .num { font-weight: 800; font-size: 15px; }
.limit .bar-track { height: 8px; }
.step .n svg { width: 16px; height: 16px; }

/* ---------- add people ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: #e9eeec; border-radius: 12px; }
.tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.ppl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ppl-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 6px 8px; font-weight: 750; }
.ppl-table td { padding: 5px 6px; border-top: 1px solid #edf1ef; vertical-align: middle; }
.ppl-table .input { height: 40px; }
.ppl-table td:last-child { width: 44px; }
.ppl-table .mono { font-family: var(--mono); font-weight: 700; letter-spacing: .04em; }
.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 30px 20px; border: 2px dashed var(--line-2); border-radius: 16px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-600); background: var(--brand-50); }
.dropzone svg { width: 34px; height: 34px; color: var(--brand); }
.dropzone b { font-size: 15px; }
.dropzone span { font-size: 13px; color: var(--muted); }
.preview-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-sum > div { padding: 14px 16px; border-radius: 14px; border: 1px solid; }
.preview-sum b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.preview-sum span { font-size: 13px; font-weight: 650; }
.preview-sum .ok-box { background: var(--green-50); border-color: #c8ebd3; color: var(--green); }
.preview-sum .err-box { background: var(--red-50); border-color: #f5caca; color: var(--red); }
.preview-sum .err-box.none { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
    .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cols-main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .side { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-105%); transition: transform .22s ease; }
    .app.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
    .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(9, 23, 34, .45); }
    .topbar { padding: 12px 16px; }
    .topbar .menu-btn { display: inline-grid; }
    .content { padding: 18px 16px 48px; }
    .login { grid-template-columns: minmax(0, 1fr); }
    .login-art { padding: 28px 22px; gap: 22px; }
    .login-points, .login-preview { display: none; }
    .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
    .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .kpis, .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpis > .kpi:last-child:nth-child(odd) { grid-column: span 2; }
    .page-head .actions { width: 100%; flex-wrap: wrap; }
    .page-head .actions > .btn-primary { flex: 1 1 100%; }
    .page-head .actions > .btn-secondary, .page-head .actions > .menu-wrap:not(:last-child) { flex: 1 1 0; min-width: 0; }
    .page-head .actions > .menu-wrap:not(:last-child) > .btn { width: 100%; }
    .page-head .actions .btn { padding: 0 10px; }
    .preview-sum { grid-template-columns: 1fr 1fr; }
    .kpi { padding: 12px; gap: 10px; }
    .kpi .kpi-ic { width: 36px; height: 36px; }
    .kpi .ring { display: none; }
    .kpi-val { font-size: 20px; }
    .page-head h1 { font-size: 22px; }
    .hero { padding: 20px; }
    .hero h1 { font-size: 22px; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .bar-row { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) 40px; gap: 8px; }
    .table .hide-sm { display: none; }
    .topbar-title { font-size: 16px; }
    .topbar-actions .btn-label { display: none; }
    .search { flex: 1 1 100%; }
    .profile .actions { margin-left: 0; width: 100%; }
    .dlg-foot { flex-wrap: wrap; }
    .dlg-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
    .side, .topbar, .toasts { display: none !important; }
    .app { display: block; }
}
