@font-face { font-family: 'Inter'; src: url('assets/fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('assets/fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('assets/fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('assets/fonts/inter-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('assets/fonts/inter-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --ink: #0F1B33;
  --ink-2: #17233F;
  --ink-3: #202D4C;
  --canvas: #F2F5FA;
  --surface: #FFFFFF;
  --line: #E4E9F1;
  --line-2: #EDF0F6;
  --text: #1B2436;
  --muted: #69738C;
  --faint: #9BA4B8;

  --gold: #F2A93B;
  --gold-ink: #8A5A0B;
  --gold-tint: #FCEFD8;
  --gold-line: #F3DCA8;

  --success: #2F8F5B;
  --success-tint: #E3F5EC;
  --danger: #D2493C;
  --danger-tint: #FBE7E4;
  --info: #3D7FBF;
  --info-tint: #E8F1FA;
  --pending: #B8791A;
  --pending-tint: #FBEFDD;
  --neutral: #69738C;
  --neutral-tint: #ECEFF4;
  --bonus: #6E5AA8;
  --bonus-tint: #EFEBFA;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 1px 1px rgba(15,23,42,.03), 0 10px 24px -14px rgba(15,23,42,.18);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 232px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex: none; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; width: 100%; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--ink);
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px 8px; cursor: pointer; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: var(--ink); flex: none;
}
.brand-word { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .01em; }
.brand-sub { font-size: 10.5px; color: #8592B0; margin-top: 1px; letter-spacing: .04em; text-transform: uppercase; }

.role-switch { margin: 4px 4px 16px 4px; position: relative; }
.role-switch select {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 9px 30px 9px 12px; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.role-switch select:focus { outline: none; border-color: var(--gold); }
.role-switch .lbl { font-size: 10px; color: #93A0BE; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px 4px; display: block; font-weight: 700; }
.role-switch .chev { position: absolute; right: 12px; top: 34px; color: #8592B0; font-size: 13px; pointer-events: none; }
.role-switch option { background: var(--ink); color: #fff; }

.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #6E7B9C; font-weight: 700; margin: 14px 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #B7C0D6; font-size: 13.3px; font-weight: 500; position: relative; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item .ic { font-size: 16.5px; color: #8592B0; flex: none; }
.nav-item.active { background: rgba(242,169,59,.13); color: #fff; }
.nav-item.active .ic { color: var(--gold); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  background: var(--gold); border-radius: 0 3px 3px 0;
}
.nav-item .badge { margin-left: auto; background: rgba(255,255,255,.10); color: #D7DDEB; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.nav-item.active .badge { background: var(--gold); color: var(--ink); }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user-row .name { font-size: 12.5px; font-weight: 600; color: #fff; }
.user-row .role { font-size: 10.5px; color: #8592B0; }
.user-row .ic { margin-left: auto; color: #7C88A6; font-size: 15px; cursor: pointer; }

.backdrop { position: fixed; inset: 0; background: rgba(9,13,24,.5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.menu-btn { display: none; }

@media (max-width: 1023px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60; width: 264px;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 24px 0 60px rgba(0,0,0,.35);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: flex; }
}

/* ==========================================================================
   Main / Topbar
   ========================================================================== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  min-height: var(--topbar-h); flex: 0 0 auto; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 12px 24px; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 40;
}
.topbar .titles { margin-right: auto; }
.topbar .eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; }
.topbar h1 { font-size: 18px; font-weight: 700; margin: 1px 0 0; letter-spacing: -.01em; }
.topbar .right-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }

.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--canvas); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 12px; width: 220px; color: var(--faint); font-size: 12.5px;
}
.search-box input { border: none; background: none; outline: none; color: var(--text); font-size: 12.5px; width: 100%; }
.search-box input::placeholder { color: var(--faint); }
.search-box .ic { font-size: 14px; }
@media (max-width: 640px) { .search-box { width: 150px; } }
@media (max-width: 480px) { .search-box { display: none; } }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; position: relative; flex: none;
  cursor: pointer;
}
.icon-btn:hover { background: var(--canvas); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }
.topbar-avatar { width: 36px; height: 36px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }

.content { flex: 1; padding: 20px 24px 48px; min-width: 0; }
@media (max-width: 640px) { .content { padding: 16px 14px 40px; } }

/* ==========================================================================
   Buttons / chips / pills
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.8px; font-weight: 600; padding: 9px 15px;
  border-radius: 9px; border: 1px solid transparent; white-space: nowrap; cursor: pointer; transition: filter .12s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn .ic { font-size: 14px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--canvas); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-mini { padding: 6px 11px; font-size: 11px; border-radius: 7px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 6px 12px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease;
}
.chip:hover { background: var(--canvas); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.dashed { border-style: dashed; color: var(--faint); background: var(--surface); font-weight: 600; cursor: default; }
.chip .ic { font-size: 13px; }
.chip-row { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.chip-row::-webkit-scrollbar { height: 5px; }
.chip-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; letter-spacing: .01em; white-space: nowrap; border: none; }
.pill.success { background: var(--success-tint); color: var(--success); }
.pill.danger { background: var(--danger-tint); color: var(--danger); }
.pill.info { background: var(--info-tint); color: var(--info); }
.pill.pending { background: var(--pending-tint); color: var(--pending); }
.pill.neutral { background: var(--neutral-tint); color: var(--neutral); }
.pill.gold { background: var(--gold-tint); color: var(--gold-ink); }
.pill.bonus { background: var(--bonus-tint); color: var(--bonus); }
.pill.clickable { cursor: pointer; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   Cards / grid / KPI
   ========================================================================== */
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.link-more { font-size: 11.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 3px; background: none; border: none; cursor: pointer; padding: 0; }
.link-more:hover { color: var(--text); }
.link-more .ic { font-size: 12px; }

.kpirow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { padding: 15px 17px; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .lbl { font-size: 11.3px; color: var(--muted); font-weight: 600; }
.kpi .ic-badge { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.kpi .val { font-size: 23px; font-weight: 800; margin-top: 9px; letter-spacing: -.02em; }
.kpi .trend { font-size: 11px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi .trend.up { color: var(--success); }
.kpi .trend.down { color: var(--danger); }
.kpi .trend .vs { color: var(--faint); font-weight: 500; }

.wstat { padding: 14px 17px; }
.wstat .lbl { font-size: 10.8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.wstat .val { font-size: 21px; font-weight: 800; margin-top: 7px; letter-spacing: -.02em; }
.wstat.tone-dark { background: var(--ink); color: #fff; }
.wstat.tone-dark .lbl { color: #93A0BE; }
.wstat.tone-neutral { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.wstat.tone-neutral .lbl { color: var(--faint); }
.wstat.tone-danger { background: var(--danger-tint); color: var(--danger); }
.wstat.tone-gold { background: var(--gold-tint); color: var(--gold-ink); }

.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.row2b { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 980px) {
  .row2, .row2b, .row3 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Table
   ========================================================================== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.dt { width: 100%; border-collapse: collapse; min-width: 560px; }
table.dt th { text-align: left; font-size: 10.6px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 0 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.dt th[data-sort] { cursor: pointer; user-select: none; }
table.dt th[data-sort]:hover { color: var(--muted); }
table.dt th .sort-arrow { margin-left: 3px; opacity: .6; }
table.dt td { padding: 12px 14px; font-size: 12.6px; border-bottom: 1px solid var(--line-2); color: var(--text); vertical-align: middle; }
table.dt tbody tr:hover { background: #FAFBFD; }
table.dt tr:last-child td { border-bottom: none; }
table.dt td.num, table.dt th.num { text-align: right; }
table.dt .sub { color: var(--faint); font-size: 11px; margin-top: 1px; }
table.dt .cell-name { font-weight: 600; }
table.dt tr[data-clickable] { cursor: pointer; }

/* ==========================================================================
   Avatars / ranks / rings / bars
   ========================================================================== */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; }
.row-flex { display: flex; align-items: center; gap: 10px; }

.ring { border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.ring .hole { position: absolute; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .hole .pct { font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring .hole .pct-lbl { color: var(--faint); font-weight: 600; }

.bar { height: 7px; border-radius: 20px; background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 20px; background: var(--gold); transition: width .4s ease; }

.rank { width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; flex: none; }
.rank.r1 { background: #FCEFD8; color: #8A5A0B; }
.rank.r2 { background: #EDF0F6; color: #5C6784; }
.rank.r3 { background: #F6E4DC; color: #9C5A32; }
.rank.rn { background: var(--neutral-tint); color: var(--muted); }

/* ==========================================================================
   Kanban (drag & drop)
   ========================================================================== */
.kanban-scroll { overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
.kanban { display: flex; gap: 13px; align-items: flex-start; }
.kcol { width: 240px; flex: none; display: flex; flex-direction: column; background: #EBEFF6; border-radius: var(--radius); padding: 11px; transition: background .15s ease, outline .15s ease; outline: 2px dashed transparent; outline-offset: -4px; min-height: 120px; }
.kcol.drag-over { background: #E1E9F7; outline-color: var(--gold); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; }
.kcol-title { font-size: 12px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.kcol-title .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.kcol-count { font-size: 10.5px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 20px; padding: 1px 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px 12px 11px; margin-bottom: 10px; box-shadow: var(--shadow-sm); cursor: grab; transition: opacity .15s ease, box-shadow .15s ease; }
.kcard:hover { box-shadow: 0 4px 16px -6px rgba(15,23,42,.25); }
.kcard.dragging { opacity: .35; }
.kcard .kname { font-size: 12.6px; font-weight: 700; margin-bottom: 5px; }
.kcard .ktags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.kcard .mini-chip { font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: var(--canvas); color: var(--muted); }
.kcard .kfoot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kcard .kfoot .due { font-size: 10.5px; color: var(--faint); display: flex; align-items: center; gap: 4px; }
.kcard .kfoot .due.warn { color: var(--danger); font-weight: 600; }

/* ==========================================================================
   Stepper / timeline / documents
   ========================================================================== */
.stepper-scroll { overflow-x: auto; }
.stepper { display: flex; align-items: flex-start; min-width: 560px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.step .node { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; z-index: 1; }
.step .lbl { font-size: 11.5px; font-weight: 600; margin-top: 9px; max-width: 110px; }
.step .sub { font-size: 10px; color: var(--faint); margin-top: 2px; }
.step .track { position: absolute; top: 17px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:last-child .track { display: none; }
.step.done .node { background: var(--success); color: #fff; }
.step.done .track { background: var(--success); }
.step.current .node { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 5px var(--gold-tint); }
.step.todo .node { background: var(--neutral-tint); color: var(--faint); }

.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .dot { position: absolute; left: -26px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 9.5px; color: var(--gold-ink); }
.tl-item .ttl { font-size: 12.5px; font-weight: 700; }
.tl-item .meta { font-size: 11px; color: var(--faint); margin-top: 1px; }
.tl-item .body { font-size: 11.8px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

.doc-row { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: none; }
.doc-row .dic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.doc-row .dname { font-size: 12.6px; font-weight: 600; }
.doc-row .dmeta { font-size: 10.8px; color: var(--faint); margin-top: 1px; }
.doc-row .dact { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.hairline { height: 1px; background: var(--line); border: none; margin: 16px 0; }

/* ==========================================================================
   Charts
   ========================================================================== */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 148px; padding: 0 4px; overflow-x: auto; }
.chartbar { flex: 1; min-width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chartbar .val { font-size: 10.6px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.chartbar .fill { width: 24px; border-radius: 6px 6px 3px 3px; background: var(--ink-3); transition: height .4s ease; }
.chartbar.last .fill { background: var(--gold); }
.chartbar.last .val { color: var(--gold-ink); }
.chartbar .lbl { font-size: 10.5px; color: var(--faint); margin-top: 8px; font-weight: 600; }

.tgt-row { display: flex; align-items: center; gap: 10px; }
.tgt-row .tname { font-size: 11.8px; font-weight: 600; width: 78px; flex: none; }
.tgt-row .tpct { font-size: 11.5px; font-weight: 700; width: 34px; text-align: right; flex: none; }

/* ==========================================================================
   Rule builder
   ========================================================================== */
.rule-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rule-row:last-child { border-bottom: none; }
.rule-row.head { padding-top: 0; padding-bottom: 10px; }
.rule-seg { flex: 1; min-width: 100px; }
.rule-seg .k { font-size: 9.5px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.rule-seg .v { font-size: 12.3px; font-weight: 600; }
.rule-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.field-box { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--text); background: #fff; width: 64px; }
.field-box input { border: none; outline: none; width: 100%; font: inherit; font-weight: 600; color: var(--text); background: none; }
.field-box.wide { width: 100px; }

.toggle { border: none; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; color: var(--faint); font-size: 20px; transition: color .12s ease; }
.toggle.on { color: var(--gold-ink); }
.icon-action { border: none; background: none; padding: 4px; cursor: pointer; color: var(--faint); display: flex; align-items: center; border-radius: 6px; }
.icon-action:hover { color: var(--text); background: var(--canvas); }

.chk { width: 17px; height: 17px; border: 1.5px solid var(--line); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; cursor: pointer; background: #fff; }
.chk.on { background: var(--ink); border-color: var(--ink); }
.chk .ic { font-size: 11px; }

.add-row { display: flex; align-items: center; gap: 8px; padding: 12px 6px 2px; color: var(--muted); font-size: 12px; font-weight: 600; border-top: 1px dashed var(--line); margin-top: 4px; cursor: pointer; background: none; border-left: none; border-right: none; border-bottom: none; width: 100%; text-align: left; }
.add-row:hover { color: var(--text); }
.add-row .ic { color: var(--faint); }

/* ==========================================================================
   Student top-nav shell
   ========================================================================== */
.stunav { min-height: 68px; flex: 0 0 auto; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 10px 24px; gap: 22px; position: sticky; top: 0; z-index: 40; flex-wrap: wrap; }
.stunav .links { display: flex; gap: 22px; margin-left: 6px; overflow-x: auto; }
.stunav .link { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 2px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.stunav .link.active { color: var(--text); border-color: var(--gold); }

/* ==========================================================================
   Forms / modals / toasts
   ========================================================================== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.field input[type=text], .field input[type=number], .field input[type=tel], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9,13,24,.55); z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 16px; max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 70px -20px rgba(10,14,26,.45); transform: translateY(12px) scale(.99); transition: transform .18s ease;
}
.modal-backdrop.show .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; margin: 0; font-weight: 700; }
.modal-close { border: none; background: var(--canvas); width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-note { font-size: 11.5px; color: var(--faint); margin-top: -6px; margin-bottom: 14px; line-height: 1.5; }

.toast-stack { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 10px; max-width: min(340px, calc(100vw - 32px)); }
.toast {
  background: var(--ink); color: #fff; padding: 12px 15px; border-radius: 10px; font-size: 12.3px; font-weight: 600;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.45); display: flex; align-items: center; gap: 10px;
  animation: toast-in .22s ease; line-height: 1.4;
}
.toast .ic { font-size: 15px; flex: none; }
.toast.success .ic { color: #6FDBA0; }
.toast.danger .ic { color: #F0958A; }
.toast.info .ic { color: #8FC2F0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Stub screen
   ========================================================================== */
.stub-desc { font-size: 12.8px; color: var(--muted); margin: 10px 0 14px; line-height: 1.55; max-width: 46em; }
.stub-list { margin: 0 0 16px; padding-left: 18px; font-size: 12.3px; color: var(--text); line-height: 1.8; }

/* ==========================================================================
   Misc responsive tweaks
   ========================================================================== */
@media (max-width: 640px) {
  .topbar h1 { font-size: 16.5px; }
  .card-pad { padding: 15px 16px; }
  .kpi .val { font-size: 20px; }
  .wstat .val { font-size: 18px; }
}
.hidden { display: none !important; }
