/* =====================================================================
   Persyllabus design system (from new-template) — shared by public site,
   auth, user dashboards and admin.
   ===================================================================== */
:root{
  --brand:#1E46E0; --brand-dark:#1636B0; --brand-soft:#EAF0FE;
  --ink:#171B2E; --ink-soft:#5B6478; --ink-faint:#8A93A6;
  --bg:#FFFFFF; --bg-sunken:#F4F5F8; --bg-raised:#FFFFFF; --bg-deep:#0E1526;
  --border:#E3E5EC; --border-strong:#CBCFDB;
  --accent:#0E9F6E; --accent-soft:#E3F9EE; --accent-dark:#0B7D57;
  --ok:#1C8A4B; --ok-soft:#E7F6ED;
  --warn:#B5790F; --warn-soft:#FCF1DA;
  --bad:#C43B3B; --bad-soft:#FBE7E7;
  --info:#2563EB; --info-soft:#E6EEFE;
  --shadow:0 1px 2px rgba(23,27,46,0.06), 0 8px 24px rgba(23,27,46,0.06);
  --shadow-lg:0 12px 48px rgba(23,27,46,0.18);
  --radius:12px;
  --topbar-h:64px;
  color-scheme:light;
}
/* Light is the default for everyone (the OS dark-mode setting is ignored).
   Dark is opt-in via the theme toggle, which sets data-theme="dark" on <html>. */
:root[data-theme="dark"]{
  --brand:#6E8CFF; --brand-dark:#8CA3FF; --brand-soft:#1B2544;
  --ink:#EDEFF5; --ink-soft:#AAB1C4; --ink-faint:#767E93;
  --bg:#0E1220; --bg-sunken:#151A2B; --bg-raised:#181E32; --bg-deep:#080B14;
  --border:#2A3149; --border-strong:#39415C;
  --accent:#3FCB93; --accent-soft:#0F2A20; --accent-dark:#5FE0A8;
  --ok:#4ED08A; --ok-soft:#123024; --warn:#E0AC49; --warn-soft:#3A2C10;
  --bad:#F08282; --bad-soft:#3A1616; --info:#7FA2F0; --info-soft:#17223F;
  --shadow:0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg:0 12px 48px rgba(0,0,0,0.55);
  color-scheme:dark;
}

/* ---------------------------------------------------------------- base */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{ margin:0; background:var(--bg); color:var(--ink); font-family:"Plus Jakarta Sans",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; font-size:15px; line-height:1.55; }
body.app-body{ background:var(--bg-sunken); }
a{ color:var(--brand); }
img,svg{ max-width:100%; }
button,input,select,textarea{ font-family:inherit; font-size:inherit; }
h1,h2,h3,h4{ margin:0; line-height:1.25; text-wrap:balance; }
::selection{ background:var(--brand-soft); }
:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.sr-only{ position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.muted{ color:var(--ink-soft); } .faint{ color:var(--ink-faint); } .mono{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.nowrap{ white-space:nowrap; } .right{ text-align:right; } .center{ text-align:center; }
.stack > * + *{ margin-top:16px; } .row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; } .row.end{ justify-content:flex-end; } .row.between{ justify-content:space-between; }
.mt-0{margin-top:0!important}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mb-0{margin-bottom:0!important}.mb-2{margin-bottom:16px}
[hidden]{ display:none!important; }

/* ---------------------------------------------------------------- buttons */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:700; font-size:14.5px; line-height:1.2; padding:11px 20px; border-radius:9px; cursor:pointer; text-decoration:none; border:1px solid transparent; background:var(--bg); color:var(--ink); transition:background .15s, border-color .15s, color .15s; white-space:nowrap; }
.btn svg{ width:17px; height:17px; flex-shrink:0; }
.btn-primary{ background:var(--brand); color:#fff; }
.btn-primary:hover{ background:var(--brand-dark); }
.btn-secondary{ background:var(--bg); color:var(--brand); border-color:var(--brand); }
.btn-secondary:hover{ background:var(--brand-soft); }
.btn-ghost{ background:transparent; color:var(--ink-soft); border-color:var(--border-strong); }
.btn-ghost:hover{ background:var(--bg-sunken); color:var(--ink); }
.btn-ok{ background:var(--ok); color:#fff; } .btn-ok:hover{ filter:brightness(.93); }
.btn-danger{ background:var(--bad); color:#fff; } .btn-danger:hover{ filter:brightness(.93); }
.btn-link{ background:none; border:none; color:var(--brand); padding:4px 0; font-weight:700; }
.btn-link:hover{ text-decoration:underline; }
.btn-sm{ padding:7px 12px; font-size:13px; border-radius:8px; }
.btn-lg{ padding:14px 28px; font-size:15.5px; }
.btn-block{ width:100%; }
.btn[disabled],.btn.is-loading{ opacity:.6; cursor:not-allowed; pointer-events:none; }
.btn.is-loading::after{ content:""; width:14px; height:14px; border-radius:50%; border:2px solid currentColor; border-right-color:transparent; animation:spin .7s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.icon-btn{ position:relative; width:40px; height:40px; border-radius:10px; border:1px solid var(--border); background:var(--bg); color:var(--ink); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; text-decoration:none; }
.icon-btn:hover{ background:var(--bg-sunken); }
.icon-btn svg{ width:19px; height:19px; }
/* Theme toggle: shows the icon of the theme it switches to */
.theme-toggle span{ display:inline-flex; }
.theme-toggle .i-sun{ display:none; }
:root[data-theme="dark"] .theme-toggle .i-sun{ display:inline-flex; }
:root[data-theme="dark"] .theme-toggle .i-moon{ display:none; }
.badge-dot{ position:absolute; top:-5px; right:-5px; background:var(--bad); color:#fff; font-size:10px; font-weight:700; min-width:17px; height:17px; border-radius:999px; display:flex; align-items:center; justify-content:center; padding:0 4px; border:2px solid var(--bg); }

/* ---------------------------------------------------------------- forms */
.field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.field.full{ grid-column:1/-1; }
.field > label,.label{ font-size:12.5px; font-weight:600; color:var(--ink-soft); }
.req{ color:var(--bad); }
.hint{ font-size:12px; color:var(--ink-faint); line-height:1.45; }
.field-error{ font-size:12.5px; color:var(--bad); font-weight:600; }
.field.has-error input,.field.has-error select,.field.has-error textarea,.field.has-error .combo-control{ border-color:var(--bad); }
.input,.field input:not([type=checkbox]):not([type=radio]):not([type=file]),.field select,.field textarea{
  width:100%; padding:10px 12px; border-radius:8px; border:1px solid var(--border-strong); background:var(--bg); color:var(--ink); font-size:14.5px; min-height:42px; }
.field textarea{ resize:vertical; min-height:88px; line-height:1.5; }
.field input:focus,.field select:focus,.field textarea:focus,.input:focus{ outline:2px solid var(--brand); outline-offset:1px; border-color:var(--brand); }
.field input[readonly],.field input[disabled]{ background:var(--bg-sunken); color:var(--ink-soft); }
.field-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px 16px; }
.field-grid.three{ grid-template-columns:repeat(3,1fr); }
.check-row{ display:flex; align-items:flex-start; gap:10px; font-size:13.5px; color:var(--ink-soft); line-height:1.5; cursor:pointer; }
.check-row input{ margin-top:3px; flex-shrink:0; width:16px; height:16px; accent-color:var(--brand); }
.radio-row{ display:flex; flex-wrap:wrap; gap:10px 22px; }
.radio-row label{ display:flex; align-items:center; gap:7px; font-size:14px; color:var(--ink); cursor:pointer; }
.radio-row input{ accent-color:var(--brand); width:16px; height:16px; }
/* segmented choice cards */
.choice-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
.choice{ position:relative; }
.choice input{ position:absolute; opacity:0; inset:0; cursor:pointer; }
.choice span{ display:block; padding:12px 14px; border:1px solid var(--border-strong); border-radius:10px; font-weight:600; font-size:14px; background:var(--bg); }
.choice span small{ display:block; font-weight:500; color:var(--ink-faint); font-size:12px; margin-top:2px; }
.choice input:checked + span{ border-color:var(--brand); background:var(--brand-soft); color:var(--brand); box-shadow:0 0 0 1px var(--brand) inset; }
.choice input:focus-visible + span{ outline:2px solid var(--brand); outline-offset:2px; }
.input-icon{ position:relative; } .input-icon svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--ink-faint); pointer-events:none; } .input-icon input{ padding-left:36px!important; }
.pw-toggle{ position:relative; } .pw-toggle button{ position:absolute; right:6px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--ink-faint); font-size:12px; font-weight:700; cursor:pointer; padding:6px 8px; }

/* ---------------------------------------------------------------- combobox (responsive smart dropdown) */
.combo{ position:relative; }
.combo-control{ display:flex; align-items:center; border:1px solid var(--border-strong); border-radius:8px; background:var(--bg); min-height:42px; padding-right:4px; }
.combo-control:focus-within{ outline:2px solid var(--brand); outline-offset:1px; border-color:var(--brand); }
.combo-control input{ border:none!important; outline:none!important; background:transparent!important; flex:1; min-width:0; padding:10px 12px!important; min-height:40px!important; color:var(--ink); }
.combo-toggle{ background:none; border:none; color:var(--ink-faint); width:32px; height:32px; display:flex; align-items:center; justify-content:center; cursor:pointer; border-radius:6px; flex-shrink:0; }
.combo-toggle:hover{ background:var(--bg-sunken); }
.combo-toggle svg{ width:16px; height:16px; transition:transform .15s; }
.combo.open .combo-toggle svg{ transform:rotate(180deg); }
.combo-clear{ background:none; border:none; color:var(--ink-faint); cursor:pointer; padding:4px 6px; font-size:16px; line-height:1; }
.combo-list{ position:absolute; z-index:60; left:0; right:0; top:calc(100% + 6px); background:var(--bg-raised); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow-lg); max-height:320px; overflow-y:auto; padding:6px; overscroll-behavior:contain; }
.combo-list.up{ top:auto; bottom:calc(100% + 6px); }
.combo-group{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); padding:8px 10px 4px; }
.combo-option{ display:flex; flex-direction:column; gap:1px; padding:9px 10px; border-radius:7px; cursor:pointer; font-size:14px; color:var(--ink); }
.combo-option small{ font-size:12px; color:var(--ink-faint); }
.combo-option mark{ background:transparent; color:var(--brand); font-weight:800; }
.combo-option.active,.combo-option:hover{ background:var(--brand-soft); }
.combo-option[aria-selected="true"]{ font-weight:700; }
.combo-option[aria-selected="true"]::after{ content:"✓"; position:absolute; right:14px; color:var(--brand); }
.combo-option{ position:relative; }
.combo-option.registered small::before{ content:"● "; color:var(--ok); }
.combo-empty{ padding:12px 10px; font-size:13px; color:var(--ink-faint); }
.combo-sheet-head{ display:none; }
@media (max-width:640px){
  .combo.open .combo-list{ position:fixed; left:0; right:0; bottom:0; top:auto; max-height:70vh; border-radius:16px 16px 0 0; padding:8px 8px calc(12px + env(safe-area-inset-bottom)); z-index:120; }
  .combo.open .combo-list.up{ bottom:0; }
  .combo.open::before{ content:""; position:fixed; inset:0; background:rgba(10,14,28,.45); z-index:110; }
  .combo-sheet-head{ display:flex; align-items:center; gap:8px; position:sticky; top:-8px; background:var(--bg-raised); padding:8px 4px 10px; margin:-8px 0 4px; border-bottom:1px solid var(--border); z-index:1; }
  .combo-sheet-head input{ flex:1; padding:10px 12px; border-radius:8px; border:1px solid var(--border-strong); background:var(--bg); color:var(--ink); }
  .combo-option{ padding:13px 12px; font-size:15px; }
}

/* ---------------------------------------------------------------- dropdown menu */
.dropdown{ position:relative; }
.menu{ position:absolute; right:0; top:calc(100% + 8px); min-width:220px; background:var(--bg-raised); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-lg); padding:6px; z-index:70; }
.menu.left{ left:0; right:auto; }
.menu a,.menu button{ display:flex; width:100%; align-items:center; gap:10px; padding:9px 11px; border-radius:8px; text-decoration:none; color:var(--ink); font-size:14px; background:none; border:none; cursor:pointer; text-align:left; }
.menu a:hover,.menu button:hover,.menu .active{ background:var(--bg-sunken); }
.menu svg{ width:16px; height:16px; color:var(--ink-faint); }
.menu hr{ border:none; border-top:1px solid var(--border); margin:6px 0; }
.menu .menu-head{ padding:8px 11px 10px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.menu .menu-head strong{ display:block; font-size:14px; } .menu .menu-head span{ font-size:12px; color:var(--ink-faint); }
.menu .danger{ color:var(--bad); }
@media (max-width:640px){ .menu{ position:fixed; left:12px; right:12px; top:auto; bottom:12px; min-width:0; } }

/* ---------------------------------------------------------------- chips / badges */
.chip{ display:inline-flex; align-items:center; gap:6px; padding:4px 11px; border-radius:999px; font-size:12.5px; font-weight:700; white-space:nowrap; background:var(--bg-sunken); color:var(--ink-soft); }
.chip .dot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
.chip-ok{ background:var(--ok-soft); color:var(--ok); } .chip-warn{ background:var(--warn-soft); color:var(--warn); }
.chip-bad{ background:var(--bad-soft); color:var(--bad); } .chip-info{ background:var(--info-soft); color:var(--info); }
.chip-neutral{ background:var(--bg-sunken); color:var(--ink-soft); border:1px solid var(--border); }
.tag{ font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; padding:3px 7px; border-radius:6px; background:var(--brand-soft); color:var(--brand); }
.nb{ margin-left:auto; background:var(--bad); color:#fff; font-size:10.5px; font-weight:700; padding:1px 7px; border-radius:999px; }
.nb.neutral{ background:var(--bg-sunken); color:var(--ink-soft); border:1px solid var(--border); }

/* ---------------------------------------------------------------- alerts / callouts */
.flash-stack{ display:flex; flex-direction:column; gap:10px; margin-bottom:18px; }
.alert{ display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:10px; font-size:14px; font-weight:600; border:1px solid; }
.alert svg{ width:18px; height:18px; flex-shrink:0; margin-top:1px; }
.alert .x{ margin-left:auto; background:none; border:none; color:inherit; cursor:pointer; font-size:18px; line-height:1; opacity:.7; }
.alert-success{ background:var(--ok-soft); color:var(--ok); border-color:var(--ok); }
.alert-error{ background:var(--bad-soft); color:var(--bad); border-color:var(--bad); }
.alert-warning{ background:var(--warn-soft); color:var(--warn); border-color:var(--warn); }
.alert-info{ background:var(--info-soft); color:var(--info); border-color:var(--info); }
.alert a{ color:inherit; text-decoration:underline; }
.callout{ display:flex; gap:12px; background:var(--brand-soft); border:1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius:10px; padding:13px 16px; margin:16px 0; font-size:13.5px; color:var(--ink); line-height:1.55; }
.callout svg{ width:18px; height:18px; flex-shrink:0; color:var(--brand); margin-top:1px; }
.callout p{ margin:0; }
.callout.ok{ background:var(--ok-soft); border-color:var(--ok); } .callout.ok svg{ color:var(--ok); }
.callout.warn{ background:var(--warn-soft); border-color:var(--warn); } .callout.warn svg{ color:var(--warn); }
.callout.bad{ background:var(--bad-soft); border-color:var(--bad); } .callout.bad svg{ color:var(--bad); }

/* ---------------------------------------------------------------- panels & layout blocks */
.panel{ background:var(--bg-raised); border:1px solid var(--border); border-radius:var(--radius); padding:24px; box-shadow:var(--shadow); }
.panel + .panel{ margin-top:18px; }
.panel-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.panel-title{ font-size:17px; font-weight:700; margin:0 0 4px; }
.panel-sub{ font-size:14.5px; font-weight:700; margin:22px 0 10px; }
.panel-note{ color:var(--ink-soft); font-size:13.5px; margin:0 0 18px; max-width:72ch; line-height:1.55; }
.divider{ height:1px; background:var(--border); margin:22px 0; border:0; }
.page-banner{ display:flex; align-items:center; gap:12px; background:var(--brand); color:#fff; padding:18px 22px; border-radius:var(--radius); margin-bottom:20px; }
.page-banner svg{ width:24px; height:24px; flex-shrink:0; }
.page-banner h1{ font-size:21px; font-weight:700; }
.page-banner .actions{ margin-left:auto; display:flex; gap:8px; }
.page-banner .btn-ghost{ color:#fff; border-color:rgba(255,255,255,.45); } .page-banner .btn-ghost:hover{ background:rgba(255,255,255,.12); }
.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.page-head h1{ font-size:24px; font-weight:800; letter-spacing:-.01em; }
.page-head .sub{ color:var(--ink-soft); font-size:14px; margin-top:4px; }
.back-link{ display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:13.5px; text-decoration:none; margin-bottom:14px; }
.back-link svg{ width:15px; height:15px; }
.kpi-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:14px; margin-bottom:20px; }
.kpi{ background:var(--bg-raised); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); text-decoration:none; color:inherit; display:block; }
a.kpi:hover{ border-color:var(--brand); }
.kpi .l{ font-size:12px; font-weight:700; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.04em; }
.kpi .v{ font-size:26px; font-weight:800; margin-top:6px; letter-spacing:-.01em; }
.kpi .d{ font-size:12.5px; color:var(--ink-soft); margin-top:2px; }
.kpi.alert-kpi{ border-color:var(--bad); } .kpi.alert-kpi .v{ color:var(--bad); }
.detail-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px 20px; margin-bottom:6px; }
.detail-grid .k{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); margin-bottom:3px; }
.detail-grid .v{ font-size:14.5px; font-weight:600; word-break:break-word; }
.detail-grid .full{ grid-column:1/-1; }
.two-col{ display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:18px; align-items:start; }
.empty{ text-align:center; padding:48px 20px; color:var(--ink-faint); }
.empty svg{ width:44px; height:44px; opacity:.5; margin-bottom:10px; }
.empty h3{ color:var(--ink); font-size:16px; margin-bottom:6px; }
.empty p{ margin:0 auto 16px; max-width:46ch; font-size:14px; }

/* ---------------------------------------------------------------- tables (become cards on mobile) */
.table-wrap{ overflow-x:auto; border:1px solid var(--border); border-radius:10px; background:var(--bg-raised); }
table.table{ width:100%; border-collapse:collapse; }
.table thead th{ text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); font-weight:700; padding:12px 16px; background:var(--bg-sunken); border-bottom:1px solid var(--border); white-space:nowrap; }
.table thead th a{ color:inherit; text-decoration:none; } .table thead th a:hover{ color:var(--brand); }
.table tbody td{ padding:13px 16px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
.table tbody tr:last-child td{ border-bottom:none; }
.table tbody tr:hover{ background:var(--bg-sunken); }
.table tbody tr.is-selected{ background:var(--brand-soft); }
.table .sub-cell{ display:block; font-size:12.5px; color:var(--ink-faint); margin-top:2px; }
.table .name-cell{ font-weight:700; }
.table .actions-cell{ text-align:right; white-space:nowrap; }
.table .check-cell{ width:40px; }
.table tr[data-href]{ cursor:pointer; }
@media (max-width:760px){
  .table-wrap.cards{ border:none; background:none; overflow:visible; }
  .cards table.table, .cards .table tbody, .cards .table tr, .cards .table td{ display:block; width:100%; }
  .cards .table thead{ display:none; }
  .cards .table tr{ background:var(--bg-raised); border:1px solid var(--border); border-radius:12px; padding:10px 14px; margin-bottom:10px; box-shadow:var(--shadow); }
  .cards .table td{ border:none; padding:6px 0; display:flex; justify-content:space-between; gap:12px; text-align:right; }
  .cards .table td::before{ content:attr(data-label); font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); text-align:left; flex-shrink:0; }
  .cards .table td.actions-cell{ justify-content:flex-end; padding-top:10px; }
  .cards .table td.actions-cell::before,.cards .table td.check-cell::before{ display:none; }
  .cards .table td.check-cell{ position:absolute; }
  .cards .table tr{ position:relative; }
}

/* ---------------------------------------------------------------- filter bar / pills / pagination */
.filter-bar{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:16px; }
.filter-bar .grow{ flex:1; min-width:200px; }
.filter-bar select,.filter-bar input[type=search],.filter-bar input[type=date]{ padding:9px 12px; border-radius:9px; border:1px solid var(--border-strong); background:var(--bg); color:var(--ink); min-height:40px; }
.pills{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.pill{ padding:7px 14px; border-radius:999px; border:1px solid var(--border-strong); background:var(--bg); color:var(--ink-soft); font-size:13.5px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; gap:6px; align-items:center; white-space:nowrap; }
.pill:hover{ border-color:var(--brand); color:var(--brand); }
.pill.active{ background:var(--brand); border-color:var(--brand); color:#fff; }
.pill.danger{ border-color:var(--bad); color:var(--bad); } .pill.danger.active{ background:var(--bad); color:#fff; }
.pill .count{ font-size:11.5px; opacity:.8; }
@media (max-width:640px){ .pills{ flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; } .pills::-webkit-scrollbar{ display:none; } }
.pagination{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; font-size:13.5px; color:var(--ink-soft); flex-wrap:wrap; }
.pagination .pages{ display:flex; gap:6px; }
.pagination a,.pagination span.cur{ min-width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; border:1px solid var(--border-strong); text-decoration:none; color:var(--ink); padding:0 10px; }
.pagination span.cur{ background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
.bulk-bar{ position:sticky; bottom:16px; display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--ink); color:var(--bg); border-radius:12px; padding:12px 16px; margin-top:16px; box-shadow:var(--shadow-lg); z-index:30; flex-wrap:wrap; }
.bulk-bar .btn-ghost{ color:var(--bg); border-color:color-mix(in srgb, var(--bg) 40%, transparent); }
.forward-bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--brand-soft); border:1px solid var(--brand); border-radius:10px; padding:12px 16px; margin-top:16px; flex-wrap:wrap; }
.forward-bar span{ font-weight:700; color:var(--brand); font-size:13.5px; }

/* ---------------------------------------------------------------- modal / dialog */
dialog.modal{ border:none; border-radius:16px; padding:0; width:min(560px, calc(100vw - 24px)); max-height:calc(100vh - 32px); background:var(--bg-raised); color:var(--ink); box-shadow:var(--shadow-lg); }
dialog.modal.wide{ width:min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop{ background:rgba(10,14,28,.55); backdrop-filter:blur(2px); }
.modal-body{ padding:24px; overflow-y:auto; max-height:calc(100vh - 140px); }
.modal-body h3{ font-size:18px; margin-bottom:6px; }
.modal-body .sub{ font-size:13.5px; color:var(--ink-soft); margin:0 0 18px; }
.modal-body .field{ margin-bottom:14px; }
.modal-foot{ display:flex; justify-content:flex-end; gap:10px; padding:14px 24px; border-top:1px solid var(--border); background:var(--bg-sunken); border-radius:0 0 16px 16px; flex-wrap:wrap; }
@media (max-width:640px){ dialog.modal{ margin:auto 0 0; width:100vw; max-width:100vw; border-radius:16px 16px 0 0; } .modal-foot{ border-radius:0; } .modal-foot .btn{ flex:1; } }

/* ---------------------------------------------------------------- toasts */
.toasts{ position:fixed; z-index:200; right:16px; bottom:16px; display:flex; flex-direction:column; gap:10px; max-width:min(380px, calc(100vw - 32px)); }
.toast{ background:var(--ink); color:var(--bg); padding:12px 16px; border-radius:10px; box-shadow:var(--shadow-lg); font-size:14px; font-weight:600; animation:toastin .2s ease; }
.toast.error{ background:var(--bad); color:#fff; } .toast.success{ background:var(--ok); color:#fff; }
@keyframes toastin{ from{ transform:translateY(8px); opacity:0; } }

/* ---------------------------------------------------------------- uploader / dropzone */
.dropzone{ position:relative; border:1.5px dashed var(--border-strong); border-radius:12px; padding:18px; background:var(--bg); text-align:center; transition:border-color .15s, background .15s; }
.dropzone.drag{ border-color:var(--brand); background:var(--brand-soft); }
.dropzone input[type=file]{ position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; }
.dropzone .dz-icon{ width:34px; height:34px; color:var(--brand); margin:0 auto 6px; display:block; }
.dropzone .dz-title{ font-weight:700; font-size:14px; }
.dropzone .dz-title u{ color:var(--brand); text-decoration:none; }
.dropzone .dz-hint{ font-size:12px; color:var(--ink-faint); margin-top:2px; }
.dz-files{ list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; text-align:left; }
.dz-file{ display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--border); border-radius:9px; background:var(--bg-raised); font-size:13.5px; position:relative; z-index:2; }
.dz-file .ic{ width:32px; height:32px; border-radius:7px; background:var(--brand-soft); color:var(--brand); display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; flex-shrink:0; overflow:hidden; }
.dz-file .ic img{ width:100%; height:100%; object-fit:cover; }
.dz-file .nm{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.dz-file .sz{ color:var(--ink-faint); font-size:12px; }
.dz-file .rm{ background:none; border:none; color:var(--bad); cursor:pointer; font-weight:700; font-size:12.5px; }
.dz-file.bad{ border-color:var(--bad); background:var(--bad-soft); } .dz-file.bad .sz{ color:var(--bad); }
.doc-list{ display:flex; flex-direction:column; gap:8px; }
.doc{ display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--bg); }
.doc .ic{ width:36px; height:36px; border-radius:8px; background:var(--brand-soft); color:var(--brand); display:flex; align-items:center; justify-content:center; font-size:10.5px; font-weight:800; flex-shrink:0; text-transform:uppercase; }
.doc .meta{ flex:1; min-width:0; } .doc .meta strong{ display:block; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .doc .meta span{ font-size:12px; color:var(--ink-faint); }

/* ---------------------------------------------------------------- credential builder cards */
.cred-card{ border:1px solid var(--border); border-radius:12px; padding:18px; margin-bottom:14px; background:var(--bg-sunken); }
.cred-card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.cred-card-head .idx{ font-family:ui-monospace,monospace; font-size:11.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.06em; font-weight:700; }
.cred-remove{ background:none; border:none; color:var(--bad); font-size:13px; font-weight:700; cursor:pointer; padding:4px 6px; }
.cand-card{ border:1px solid var(--border-strong); border-radius:14px; padding:20px; margin-bottom:18px; background:var(--bg-raised); box-shadow:var(--shadow); }
.cand-card > .cred-card-head .idx{ color:var(--brand); }
.price-pill{ display:inline-flex; align-items:baseline; gap:6px; background:var(--brand-soft); color:var(--brand); font-weight:800; font-size:14px; padding:7px 12px; border-radius:8px; margin-top:14px; }
.price-pill .lbl{ font-size:11px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.04em; }
.total-bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--bg-sunken); border:1px solid var(--border); border-radius:12px; padding:16px 20px; margin:22px 0; position:sticky; bottom:12px; z-index:5; box-shadow:var(--shadow); }
.total-bar .label{ font-size:13.5px; color:var(--ink-soft); font-weight:700; }
.total-bar .amount{ font-size:24px; font-weight:800; color:var(--brand); }
.total-bar .breakdown{ font-size:12px; color:var(--ink-faint); margin-top:2px; }

/* ---------------------------------------------------------------- timeline / guide */
.timeline{ list-style:none; margin:0; padding:0 0 0 18px; border-left:2px solid var(--border); }
.timeline li{ position:relative; padding:0 0 16px 14px; font-size:13.5px; }
.timeline li::before{ content:""; position:absolute; left:-25px; top:4px; width:12px; height:12px; border-radius:50%; background:var(--bg-raised); border:2px solid var(--brand); }
.timeline li:last-child{ padding-bottom:0; } .timeline li:last-child::before{ background:var(--brand); }
.timeline time{ display:block; font-size:12px; color:var(--ink-faint); }
.guide-step{ display:flex; gap:16px; padding:16px 0; border-bottom:1px solid var(--border); }
.guide-step:last-of-type{ border-bottom:none; }
.guide-step .num{ width:34px; height:34px; border-radius:50%; background:var(--brand-soft); color:var(--brand); font-weight:800; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.guide-step h4{ font-size:15px; margin:4px 0 6px; } .guide-step p{ margin:0; color:var(--ink-soft); font-size:14px; line-height:1.6; }

/* =====================================================================
   App shell (dashboards + admin)
   ===================================================================== */
.topbar{ position:sticky; top:0; z-index:40; height:var(--topbar-h); display:flex; align-items:center; gap:14px; padding:0 20px; background:var(--bg); border-bottom:1px solid var(--border); }
.brand{ display:flex; align-items:center; gap:9px; flex-shrink:0; text-decoration:none; }
.brand svg{ width:30px; height:30px; } .brand span{ font-weight:800; font-size:19px; color:var(--brand); letter-spacing:-.01em; }
.nav-toggle{ display:none; }
.search-trigger{ flex:1; max-width:520px; display:flex; align-items:center; gap:10px; padding:9px 14px; border-radius:999px; border:1px solid var(--border-strong); background:var(--bg-sunken); color:var(--ink-faint); font-size:14px; cursor:text; text-align:left; }
.search-trigger svg{ width:16px; height:16px; flex-shrink:0; }
.search-trigger span{ flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.search-trigger kbd{ font-family:inherit; font-size:11px; font-weight:700; border:1px solid var(--border-strong); border-radius:6px; padding:2px 6px; background:var(--bg); }
.top-actions{ display:flex; gap:8px; margin-left:auto; align-items:center; }
.user-chip{ display:flex; align-items:center; gap:10px; padding:4px 10px 4px 4px; border-radius:999px; border:1px solid var(--border); background:var(--bg); cursor:pointer; color:var(--ink); }
.user-chip:hover{ background:var(--bg-sunken); }
.av{ width:32px; height:32px; border-radius:50%; background:var(--brand); color:#fff; font-weight:800; font-size:12.5px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.user-chip .name{ font-weight:700; font-size:13.5px; max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.user-chip .role{ font-size:11.5px; color:var(--ink-faint); text-align:left; }
.layout{ display:flex; align-items:flex-start; max-width:1440px; margin:0 auto; }
.sidebar{ width:256px; flex-shrink:0; padding:18px 12px 24px; position:sticky; top:var(--topbar-h); height:calc(100vh - var(--topbar-h)); overflow-y:auto; }
.user-card{ padding:8px 12px 16px; margin-bottom:6px; border-bottom:1px solid var(--border); }
.user-card .user-name{ font-weight:700; font-size:15px; } .user-card .user-id{ font-size:12px; color:var(--ink-faint); margin-top:2px; font-family:ui-monospace,monospace; }
.user-card .tag{ margin-top:8px; display:inline-block; }
.side-nav{ display:flex; flex-direction:column; gap:2px; margin-top:10px; }
.side-nav .nav-label{ font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint); padding:14px 12px 6px; }
.nav-item{ display:flex; align-items:center; gap:11px; width:100%; text-align:left; padding:10px 12px; border-radius:9px; border:none; background:transparent; color:var(--ink-soft); font-size:14.5px; font-weight:500; cursor:pointer; text-decoration:none; }
.nav-item svg{ width:18px; height:18px; flex-shrink:0; }
.nav-item:hover{ background:var(--bg-raised); color:var(--ink); }
.nav-item.active{ background:var(--brand-soft); color:var(--brand); font-weight:700; }
.nav-item.logout{ margin-top:10px; border-top:1px solid var(--border); border-radius:0 0 9px 9px; padding-top:14px; }
.content{ flex:1; min-width:0; padding:22px 24px 64px; }
.app-footer{ font-size:12.5px; color:var(--ink-faint); padding:24px 0 0; text-align:center; }
.sidebar-backdrop{ display:none; }
@media (max-width:980px){
  .nav-toggle{ display:inline-flex; }
  .sidebar{ position:fixed; left:0; top:0; bottom:0; height:100vh; z-index:90; background:var(--bg); transform:translateX(-100%); transition:transform .2s ease; box-shadow:var(--shadow-lg); width:min(290px, 86vw); padding-top:16px; }
  body.nav-open .sidebar{ transform:none; }
  body.nav-open .sidebar-backdrop{ display:block; position:fixed; inset:0; background:rgba(10,14,28,.45); z-index:80; }
  body.nav-open{ overflow:hidden; }
  .two-col{ grid-template-columns:1fr; }
}
@media (max-width:760px){
  :root{ --topbar-h:58px; }
  .topbar{ padding:0 12px; gap:8px; }
  .brand span{ display:none; }
  .search-trigger{ padding:9px 12px; } .search-trigger kbd{ display:none; }
  .user-chip .name,.user-chip .role,.user-chip > div:not(.av){ display:none; } .user-chip{ padding:3px; }
  .content{ padding:16px 14px 56px; }
  .panel{ padding:18px; }
  .field-grid,.field-grid.three{ grid-template-columns:1fr; }
  .page-banner{ padding:14px 16px; } .page-banner h1{ font-size:18px; } .page-banner .actions{ display:none; }
  .total-bar{ padding:12px 14px; } .total-bar .amount{ font-size:20px; }
  .kpi .v{ font-size:22px; }
}

/* ---------------------------------------------------------------- command palette */
.cmdk{ border:none; padding:0; border-radius:16px; width:min(640px, calc(100vw - 24px)); margin:10vh auto auto; background:var(--bg-raised); color:var(--ink); box-shadow:var(--shadow-lg); }
.cmdk::backdrop{ background:rgba(10,14,28,.55); backdrop-filter:blur(2px); }
.cmdk-head{ display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--border); }
.cmdk-head svg{ width:18px; height:18px; color:var(--ink-faint); flex-shrink:0; }
.cmdk-head input{ flex:1; border:none; outline:none; background:transparent; font-size:16px; color:var(--ink); min-width:0; }
.cmdk-head kbd{ font-family:inherit; font-size:11px; font-weight:700; border:1px solid var(--border-strong); border-radius:6px; padding:2px 6px; color:var(--ink-faint); }
.cmdk-body{ max-height:min(60vh, 460px); overflow-y:auto; padding:8px; }
.cmdk-group{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-faint); padding:10px 10px 6px; }
.cmdk-item{ display:flex; align-items:center; gap:12px; padding:10px; border-radius:9px; text-decoration:none; color:var(--ink); }
.cmdk-item .t{ font-weight:700; font-size:14px; } .cmdk-item .s{ font-size:12.5px; color:var(--ink-faint); }
.cmdk-item .tone{ width:8px; height:8px; border-radius:50%; flex-shrink:0; background:var(--border-strong); }
.cmdk-item .tone.ok{ background:var(--ok); } .cmdk-item .tone.warn{ background:var(--warn); } .cmdk-item .tone.bad{ background:var(--bad); } .cmdk-item .tone.info{ background:var(--info); }
.cmdk-item.active,.cmdk-item:hover{ background:var(--brand-soft); }
.cmdk-item mark{ background:none; color:var(--brand); }
.cmdk-foot{ display:flex; gap:14px; padding:10px 16px; border-top:1px solid var(--border); font-size:12px; color:var(--ink-faint); flex-wrap:wrap; }
.cmdk-foot code{ background:var(--bg-sunken); padding:1px 6px; border-radius:5px; font-size:11.5px; }
.cmdk-hint{ padding:18px 12px; color:var(--ink-faint); font-size:13.5px; }
@media (max-width:640px){ .cmdk{ margin:0; width:100vw; max-width:100vw; height:100vh; max-height:100vh; border-radius:0; } .cmdk-body{ max-height:calc(100vh - 120px); } }

/* ---------------------------------------------------------------- auth pages */
.auth-wrap{ min-height:calc(100vh - 140px); display:flex; align-items:center; justify-content:center; padding:40px 16px; background:var(--bg-sunken); }
.auth-card{ width:100%; max-width:480px; background:var(--bg-raised); border:1px solid var(--border); border-radius:18px; box-shadow:var(--shadow); padding:32px; }
.auth-card.wide{ max-width:760px; }
.auth-card h1{ font-size:25px; font-weight:800; letter-spacing:-.01em; margin-bottom:6px; }
.auth-card .sub{ color:var(--ink-soft); margin:0 0 24px; font-size:14.5px; }
.auth-card .field{ margin-bottom:14px; }
.auth-foot{ text-align:center; margin-top:18px; font-size:14px; color:var(--ink-soft); }
.type-pick{ display:grid; gap:12px; }
.type-pick a{ display:flex; gap:14px; align-items:center; padding:16px 18px; border:1px solid var(--border-strong); border-radius:12px; text-decoration:none; color:var(--ink); background:var(--bg); transition:border-color .15s, background .15s; }
.type-pick a:hover{ border-color:var(--brand); background:var(--brand-soft); }
.type-pick .ic{ width:44px; height:44px; border-radius:11px; background:var(--brand-soft); color:var(--brand); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.type-pick .ic svg{ width:22px; height:22px; }
.type-pick strong{ display:block; font-size:15px; } .type-pick span{ font-size:13px; color:var(--ink-soft); }
.type-pick .arrow{ margin-left:auto; color:var(--ink-faint); }
.steps-indicator{ display:flex; gap:6px; margin-bottom:22px; }
.steps-indicator .seg{ flex:1; height:4px; border-radius:2px; background:var(--border); }
.steps-indicator .seg.on{ background:var(--brand); }
.consent-box{ display:flex; gap:12px; align-items:flex-start; padding:14px 16px; border:1px solid var(--border-strong); border-radius:10px; background:var(--bg-sunken); font-size:14px; line-height:1.55; }
.consent-box input{ margin-top:4px; width:17px; height:17px; accent-color:var(--brand); flex-shrink:0; }
.done-icon{ width:62px; height:62px; border-radius:50%; background:var(--ok-soft); color:var(--ok); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; }
.done-icon svg{ width:30px; height:30px; }
@media (max-width:640px){ .auth-card{ padding:22px 18px; border-radius:14px; } }

/* ---------------------------------------------------------------- admin charts (CSS only) */
.bars{ display:flex; align-items:flex-end; gap:6px; height:150px; padding-top:10px; }
.bars .bar{ flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; justify-content:flex-end; min-width:0; }
.bars .bar i{ display:block; width:100%; max-width:34px; background:var(--brand); border-radius:6px 6px 2px 2px; min-height:2px; }
.bars .bar.alt i{ background:var(--accent); }
.bars .bar span{ font-size:10.5px; color:var(--ink-faint); white-space:nowrap; }
.bars .bar b{ font-size:11px; color:var(--ink-soft); }
.meter{ height:8px; border-radius:999px; background:var(--bg-sunken); overflow:hidden; }
.meter i{ display:block; height:100%; background:var(--brand); border-radius:inherit; }
.list-stat{ display:flex; flex-direction:column; gap:12px; }
.list-stat .ls{ display:grid; grid-template-columns:1fr auto; gap:4px 12px; font-size:13.5px; }
.list-stat .ls .meter{ grid-column:1/-1; }

@media print{ .topbar,.sidebar,.no-print{ display:none!important; } .content{ padding:0; } body{ background:#fff; } }
