/* eSANCHIT upload portal - design system.
   CSP forbids inline styles: every visual state must be a class here.
   Component reference: see docs/WEB_UI_GUIDE.md */

:root {
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dde3ec;
  --border-strong: #c5cfdc;
  --text: #17202e;
  --text-2: #4a5568;
  --muted: #6b7686;

  --primary: #14508c;
  --primary-hover: #0f4070;
  --primary-soft: #e7f0fa;
  --primary-text: #ffffff;
  --accent: #0e8a7e;

  --ok: #1a7f45;      --ok-soft: #e6f5ec;
  --warn: #9a6200;    --warn-soft: #fdf3e0;
  --danger: #b42318;  --danger-soft: #fdecea;
  --info: #1f5fa8;    --info-soft: #e8f1fb;
  --neutral: #4a5568; --neutral-soft: #edf0f4;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --focus: 0 0 0 3px rgba(20, 80, 140, .28);
  --topbar: #0f2f52;
  --topbar-text: #e8eef6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --surface: #161d27; --surface-2: #1b2430; --border: #2a3545; --border-strong: #3a4759;
    --text: #e6ebf2; --text-2: #b8c2d0; --muted: #8b97a8;
    --primary: #4b8fd6; --primary-hover: #63a1e2; --primary-soft: #1a2c42; --primary-text: #0b1520;
    --ok: #4cc283; --ok-soft: #13291e; --warn: #e2a948; --warn-soft: #2d2412;
    --danger: #f07167; --danger-soft: #331a19; --info: #6aa8ec; --info-soft: #15263a;
    --neutral: #b8c2d0; --neutral-soft: #222b37;
    --topbar: #0b1824; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
}
main { flex: 1 0 auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-danger { color: var(--danger); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.container-narrow { max-width: 760px; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.spacer { flex: 1; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 1rem .9rem 2rem; }
}

/* ---------- top bar ---------- */
.topbar { background: var(--topbar); color: var(--topbar-text); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(255,255,255,.04); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .55rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; letter-spacing: .01em; }
.brand-sub { font-size: .75rem; opacity: .75; }
.mainnav { display: flex; gap: .25rem; }
.mainnav a { color: var(--topbar-text); opacity: .82; padding: .45rem .75rem; border-radius: var(--radius-sm); font-weight: 550; }
.mainnav a:hover { opacity: 1; background: rgba(255,255,255,.08); text-decoration: none; }
.mainnav a.active { opacity: 1; background: rgba(255,255,255,.14); }
.mainnav .count { display: inline-block; min-width: 1.3em; padding: 0 .35em; margin-left: .25rem; border-radius: 999px; background: #f5a524; color: #1b1300; font-size: .75rem; font-weight: 700; text-align: center; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.worker-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: rgba(255,255,255,.08); white-space: nowrap; }
.worker-pill .dot { width: .55rem; height: .55rem; border-radius: 50%; background: #9aa5b4; }
.worker-pill.is-online .dot { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61,220,132,.2); }
.worker-pill.is-offline .dot { background: #ff6b6b; }
.usermenu { position: relative; }
.usermenu-button { display: flex; align-items: center; gap: .5rem; background: none; border: 0; color: inherit; cursor: pointer; padding: .25rem .4rem; border-radius: var(--radius-sm); font: inherit; }
.usermenu-button:hover { background: rgba(255,255,255,.08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 240px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; }
.usermenu-head { display: flex; flex-direction: column; gap: .2rem; padding: .5rem .6rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.usermenu-head .badge { align-self: flex-start; }
.usermenu-panel a, .usermenu-panel .linklike { display: block; width: 100%; text-align: left; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--text); }
.usermenu-panel a:hover, .usermenu-panel .linklike:hover { background: var(--surface-2); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-sm); width: 38px; height: 34px; cursor: pointer; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 18px; height: 2px; background: var(--topbar-text); margin: 0 auto; position: relative; content: ""; }
.nav-toggle-bar::before { position: absolute; top: -6px; } .nav-toggle-bar::after { position: absolute; top: 6px; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; order: 2; margin-left: auto; }
  .topbar-right { order: 3; margin-left: 0; }
  .mainnav { order: 4; width: 100%; flex-direction: column; display: none; padding-bottom: .5rem; }
  .mainnav.is-open { display: flex; }
  .usermenu-name, .brand-sub { display: none; }
}

/* ---------- page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1.5rem; }
.page-header h1 { margin: 0; }
.page-subtitle { color: var(--text-2); margin: .35rem 0 0; max-width: 70ch; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--muted); margin: 0 0 .3rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.breadcrumb a { color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.25rem; }
.card-header { padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.card + .card { margin-top: 1rem; }
.grid > .card + .card { margin-top: 0; }
.card-ok { border-left: 4px solid var(--ok); }
.card-warn { border-left: 4px solid var(--warn); }
.card-danger { border-left: 4px solid var(--danger); }
.card-info { border-left: 4px solid var(--info); }
.card-muted { opacity: .7; }

.stat { padding: 1rem 1.25rem; }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.stat-value { font-size: 1.7rem; font-weight: 700; margin-top: .15rem; }
.stat-note { font-size: .85rem; color: var(--text-2); }

/* key/value list */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; word-break: break-word; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover:not(:disabled) { background: var(--primary-soft); }
.btn-sm { padding: .32rem .65rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }
.btn-group { display: inline-flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; line-height: 1.5; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral); }
.badge-ok, .status-succeeded, .status-submitted, .status-active { background: var(--ok-soft); color: var(--ok); }
.badge-warn, .status-uncertain, .status-interrupted, .status-pending, .status-draft { background: var(--warn-soft); color: var(--warn); }
.badge-danger, .status-failed, .status-disabled, .status-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-info, .status-queued, .status-running { background: var(--info-soft); color: var(--info); }
.badge-neutral, .status-cancelled, .status-not_submitted { background: var(--neutral-soft); color: var(--neutral); }
.status-running::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* ---------- alerts ---------- */
.flash-stack { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--info-soft); color: var(--text); border-left: 4px solid var(--info); }
.alert-success { background: var(--ok-soft); border-left-color: var(--ok); }
.alert-warning { background: var(--warn-soft); border-left-color: var(--warn); }
.alert-danger { background: var(--danger-soft); border-left-color: var(--danger); }
.alert-info { background: var(--info-soft); border-left-color: var(--info); }
.alert-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 .2rem; }
.alert ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.alert-title { font-weight: 700; display: block; margin-bottom: .15rem; }
.auth-card .alert, .card-body .alert { margin-bottom: 1rem; }

/* ---------- forms ---------- */
form { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.field .req { color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number],
.field input[type=url], .field input[type=search], .field input[type=date], .field input[type=file], .field select, .field textarea,
.input {
  width: 100%; padding: .55rem .7rem; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 6rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field .help { font-size: .83rem; color: var(--muted); margin: .3rem 0 0; }
.field .error { font-size: .85rem; color: var(--danger); margin: .3rem 0 0; font-weight: 550; }
.field-check label { display: flex; align-items: flex-start; gap: .55rem; font-weight: 550; cursor: pointer; }
.field-check input { margin-top: .25rem; width: 1rem; height: 1rem; accent-color: var(--primary); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.input-code, .field input.input-code { font-family: var(--mono); letter-spacing: .3em; font-size: 1.3rem; text-align: center; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin-bottom: 0; min-width: 160px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem .25rem; margin: 0 0 1rem; }
.fieldset legend { font-weight: 700; padding: 0 .4rem; }
.secret-status { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin: -.4rem 0 1rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table-compact th, .table-compact td { padding: .45rem .7rem; }
.row-link { color: inherit; font-weight: 600; }
.card > .table-wrap > .table th:first-child, .card > .table-wrap > .table td:first-child { padding-left: 1.25rem; }
.card > .table-wrap > .table th:last-child, .card > .table-wrap > .table td:last-child { padding-right: 1.25rem; }

/* ---------- dropzone (upload) ---------- */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); padding: 2.25rem 1.5rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-icon { width: 48px; height: 48px; margin: 0 auto .75rem; color: var(--primary); }
.dropzone-title { font-weight: 650; font-size: 1.05rem; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.file-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; }
.file-item .name { flex: 1; word-break: break-all; }
.file-item.is-invalid { border-color: var(--danger); background: var(--danger-soft); }

/* ---------- document set (review) ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 7rem 6rem; gap: .75rem; align-items: center; padding: .55rem 1.25rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.doc-row:last-child { border-bottom: 0; }
.doc-row .doc-label { font-weight: 700; }
.doc-row .doc-file { word-break: break-all; }
.doc-row.is-missing { color: var(--muted); background: var(--surface-2); }
@media (max-width: 620px) { .doc-row { grid-template-columns: 1fr 1fr; } }

/* ---------- progress steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 0 0 1rem 2rem; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: .35rem; top: .3rem; width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); }
.steps li::after { content: ""; position: absolute; left: .72rem; top: 1.2rem; bottom: 0; width: 2px; background: var(--border); }
.steps li:last-child::after { display: none; }
.steps li.is-done { color: var(--text); }
.steps li.is-done::before { background: var(--ok); border-color: var(--ok); }
.steps li.is-current { color: var(--text); font-weight: 650; }
.steps li.is-current::before { border-color: var(--info); background: var(--info-soft); animation: pulse 1.2s infinite; }
.steps li.is-failed { color: var(--danger); font-weight: 650; }
.steps li.is-failed::before { background: var(--danger); border-color: var(--danger); }

progress { width: 100%; height: .6rem; border-radius: 999px; overflow: hidden; border: 0; background: var(--neutral-soft); appearance: none; }
progress::-webkit-progress-bar { background: var(--neutral-soft); }
progress::-webkit-progress-value { background: var(--primary); }
progress::-moz-progress-bar { background: var(--primary); }

/* ---------- live log ---------- */
.log { background: #0e1621; color: #d7e0ea; border-radius: var(--radius-sm); padding: .75rem 1rem; max-height: 420px; overflow-y: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.55; }
.log-line { display: grid; grid-template-columns: 5.2rem 3.6rem 1fr; gap: .5rem; }
.log-time { color: #7f8ea3; }
.log-level { font-weight: 700; }
.log-ok .log-level { color: #4cc283; } .log-info .log-level { color: #7fb4ff; }
.log-warn .log-level { color: #f5c063; } .log-fail .log-level, .log-fail .log-msg { color: #ff8a80; }
.log-step { margin-top: .4rem; } .log-step .log-msg { color: #fff; font-weight: 700; }
.log-empty { color: #7f8ea3; font-style: italic; }

/* ---------- screenshots ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.shot { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); color: var(--text); }
.shot img { display: block; width: 100%; height: 130px; object-fit: cover; object-position: top; }
.shot span { display: block; padding: .4rem .6rem; font-size: .8rem; }
.shot:hover { border-color: var(--primary); text-decoration: none; }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-2); }
.empty-state h2, .empty-state h1 { color: var(--text); }
.error-page { max-width: 560px; margin: 4rem auto; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; }
.checklist .ic { flex: none; width: 1.2rem; height: 1.2rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; margin-top: .1rem; }
.ic-ok { background: var(--ok); } .ic-warn { background: var(--warn); } .ic-danger { background: var(--danger); } .ic-neutral { background: var(--muted); }
.codebox { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; word-break: break-all; }
.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1rem; font-family: var(--mono); font-size: 1rem; }
.qr { background: #fff; padding: .75rem; border-radius: var(--radius-sm); display: inline-block; border: 1px solid var(--border); }
.qr svg { display: block; width: 200px; height: 200px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: .9rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a { padding: .6rem .9rem; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.subnav { display: flex; flex-direction: column; gap: .15rem; }
.subnav a { padding: .5rem .75rem; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; }
.subnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.subnav a.active { background: var(--primary-soft); color: var(--primary); }
.layout-panel { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .layout-panel { grid-template-columns: 1fr; } .subnav { flex-direction: row; flex-wrap: wrap; } }
.footer { border-top: 1px solid var(--border); background: var(--surface); font-size: .82rem; color: var(--text-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem; }

/* ---------- auth pages ---------- */
.auth-page { background: radial-gradient(1200px 600px at 10% -10%, #1d5c9a33, transparent), radial-gradient(900px 500px at 110% 110%, #0e8a7e2b, transparent), var(--bg); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.auth-main > .flash-stack { width: 100%; max-width: 440px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 2rem; }
.auth-card.wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.auth-brand .brand-sub { color: var(--muted); opacity: 1; }
.auth-card h1 { font-size: 1.35rem; }
.auth-footer { text-align: center; padding: 0 0 1.5rem; font-size: .82rem; }
.auth-links { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .9rem; text-align: center; color: var(--text-2); }
