/* Benthon Proctoring design system v2.
   Tokens first, then components. No build step. Colour is never the only signal: statuses and severities always carry text or an icon. */
@font-face { font-family: "Inter"; src: url("/assets/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f3f4f7; --surface-3: #e9ecf1; --overlay: rgba(12, 14, 20, .55);
  --border: #e3e6ec; --border-strong: #cfd3dc;
  --text: #12151c; --text-2: #4a5163; --text-3: #646c80;
  --brand: #4f46e5; --brand-hover: #4338ca; --brand-soft: #eef0ff; --brand-ink: #3730a3; --on-brand: #ffffff;
  --success: #0f7a56; --success-soft: #e5f6ee; --warning: #a35200; --warning-soft: #fff3df; --danger: #c6282d; --danger-soft: #fdecec; --neutral: #4a5163; --neutral-soft: #eceef3;
  --high: #c52a31; --high-soft: #fdecec; --medium: #a14609; --medium-soft: #fff0e3; --low: #8a6400; --low-soft: #fff7d6; --info: #5d6579; --info-soft: #eceef3;
  --chart-1: #4f46e5; --chart-2: #94a3b8; --chart-grid: #e8ebf0;
  --ring: 0 0 0 3px rgba(79, 70, 229, .28);
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05); --sh-2: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .06); --sh-3: 0 20px 48px rgba(16, 24, 40, .22);
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12; --surface: #11141b; --surface-2: #171b24; --surface-3: #1e2430; --overlay: rgba(0, 0, 0, .65);
  --border: #252b38; --border-strong: #343b4b;
  --text: #eceef5; --text-2: #aeb4c5; --text-3: #7d8498;
  --brand: #7c83ff; --brand-hover: #9298ff; --brand-soft: #1b1f3e; --brand-ink: #c5c8ff; --on-brand: #0b0d12;
  --success: #52d3a0; --success-soft: #11291f; --warning: #ffb454; --warning-soft: #2d2110; --danger: #ff8185; --danger-soft: #331519; --neutral: #aeb4c5; --neutral-soft: #1e2430;
  --high: #ff7075; --high-soft: #331519; --medium: #ff9a4d; --medium-soft: #2e1c0f; --low: #f2cc55; --low-soft: #2a2410; --info: #98a0b5; --info-soft: #1e2430;
  --chart-1: #8b91ff; --chart-2: #6b7489; --chart-grid: #232938;
  --ring: 0 0 0 3px rgba(124, 131, 255, .4);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 1px 3px rgba(0, 0, 0, .5), 0 8px 20px rgba(0, 0, 0, .35); --sh-3: 0 24px 56px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-feature-settings: "cv11", "ss01"; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.011em; }
h1 { font-size: 1.571rem; font-weight: 650; letter-spacing: -.02em; } h2 { font-size: 1.143rem; font-weight: 620; } h3 { font-size: 1rem; font-weight: 600; } h4 { font-size: .929rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); text-decoration: none; } p a:not(.btn), li a:not(.btn):not(.nav), .callout a { text-decoration: underline; text-underline-offset: 2px; } a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .857rem; }
.muted { color: var(--text-2); } .subtle { color: var(--text-3); } .small { font-size: .857rem; } .xs { font-size: .786rem; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: var(--ring); border-radius: var(--r-sm); }   /* a solid outline: a shadow alone is overridden by .btn.ghost and is too faint to see (WCAG 2.4.7, 1.4.11) */
main[tabindex="-1"]:focus-visible { box-shadow: none; outline: none; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--brand); color: var(--on-brand); padding: .5rem 1rem; border-radius: var(--r); z-index: 1000; }
.skip:focus { left: .5rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; } .stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; } .row.nowrap { flex-wrap: nowrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.tight { gap: .375rem; }
.grow { flex: 1 1 0; min-width: 0; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.125em; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 36px; padding: 0 .875rem; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text);
  font: 550 .929rem/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--sh-1); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); } .btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); } .btn.danger.solid:hover { filter: brightness(.95); background: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; } .btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 .625rem; font-size: .857rem; border-radius: var(--r-sm); } .btn.lg { height: 44px; padding: 0 1.25rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn.icon-only { width: 36px; padding: 0; } .btn.icon-only.sm { width: 30px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* forms */
label, .label { display: block; font-size: .857rem; font-weight: 550; color: var(--text); margin-bottom: .375rem; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; height: 36px; padding: 0 .75rem; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; box-shadow: var(--sh-1); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 96px; padding: .625rem .75rem; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder { color: var(--text-3); }
select { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8194' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; }
.field { margin-bottom: 1rem; } .hint { font-size: .786rem; color: var(--text-3); margin-top: .3rem; line-height: 1.4; }
.input-wrap { position: relative; } .input-wrap > .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; } .input-wrap input { padding-left: 2.1rem; }
.check { display: flex; gap: .625rem; align-items: flex-start; font-weight: 450; cursor: pointer; margin: 0; } .check input { width: 16px; height: 16px; margin: .17rem 0 0; flex: none; accent-color: var(--brand); box-shadow: none; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); } .switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); outline: 2px solid var(--brand); outline-offset: 2px; }
.segmented { display: inline-flex; padding: 2px; background: var(--surface-3); border-radius: var(--r); gap: 2px; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font: 550 .857rem var(--font); padding: .3rem .7rem; border-radius: 6px; cursor: pointer; }
.segmented button[aria-pressed=true], .segmented button[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs button { border: 0; background: transparent; color: var(--text-2); font: 550 .929rem var(--font); padding: .6rem .875rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); } .tabs button[aria-selected=true] { color: var(--brand); border-color: var(--brand); }
.range { appearance: none; height: 4px; padding: 0; border: 0; box-shadow: none; background: var(--surface-3); border-radius: 999px; }
.range::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--brand); cursor: pointer; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .875rem 1.125rem; border-bottom: 1px solid var(--border); min-height: 52px; }
.card-h h2, .card-h h3 { font-size: .964rem; } .card-b { padding: 1.125rem; } .card-b.flush { padding: 0; } .card-f { padding: .75rem 1.125rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.grid { display: grid; gap: 1rem; } .g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g-4, .g-2 { grid-template-columns: minmax(0, 1fr); } }

/* badges, status, severity */
.badge { display: inline-flex; align-items: center; gap: .35rem; height: 22px; padding: 0 .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success, .badge.completed { background: var(--success-soft); color: var(--success); }
.badge.live, .badge.active { background: var(--success-soft); color: var(--success); } .badge.live .dot, .badge.active .dot { animation: pulse 1.6s ease-in-out infinite; }
.badge.paused, .badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.high { background: var(--high-soft); color: var(--high); } .badge.medium { background: var(--medium-soft); color: var(--medium); } .badge.low { background: var(--low-soft); color: var(--low); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.ready, .badge.launched, .badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.created, .badge.cancelled, .badge.expired, .badge.terminated, .badge.suspended { background: var(--neutral-soft); color: var(--text-2); }
.badge.terminated { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.avatar { --h: 230; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: .75rem; font-weight: 650; flex: none;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 27%); } :root[data-theme="dark"] .avatar { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 80% 82%); }
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; } .avatar.sm { width: 24px; height: 24px; font-size: .68rem; }
.kbd { font: 600 .714rem var(--mono); padding: .1rem .4rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text-2); }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .929rem; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: .55rem 1rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; } .table tbody tr.click:hover td { background: var(--surface-2); }
.table .num, .table td.right { text-align: right; }
.empty { display: grid; place-items: center; text-align: center; gap: .5rem; padding: 3rem 1.5rem; color: var(--text-2); }
.empty svg.art { width: 120px; height: 90px; margin-bottom: .5rem; } .empty h3 { color: var(--text); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* callouts, dialogs, menus, toasts */
.callout { display: flex; gap: .75rem; padding: .75rem .875rem; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); font-size: .929rem; }
.callout > .icon { margin-top: .15rem; color: var(--brand); } .callout.warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); } .callout.warn > .icon { color: var(--warning); }
.callout.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); } .callout.error > .icon { color: var(--danger); }
.callout.ok { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); } .callout.ok > .icon { color: var(--success); }
dialog { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); color: var(--text); padding: 0; width: min(520px, 94vw); box-shadow: var(--sh-3); }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
dialog .dlg-h { padding: 1.25rem 1.5rem .25rem; } dialog .dlg-b { padding: .5rem 1.5rem 1rem; } dialog .dlg-f { padding: .875rem 1.5rem; display: flex; justify-content: flex-end; gap: .5rem; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--r-xl) var(--r-xl); }
dialog.wide { width: min(880px, 96vw); }
.menu { position: absolute; z-index: 60; min-width: 200px; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.menu button, .menu a { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .625rem; border: 0; background: transparent; border-radius: var(--r-sm); color: var(--text); font: 500 .929rem var(--font); cursor: pointer; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu [aria-selected=true] { background: var(--surface-3); text-decoration: none; } .menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 300; }
.toast { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; background: var(--text); color: var(--bg); border-radius: var(--r); box-shadow: var(--sh-2); font-weight: 500; animation: rise .2s ease-out; max-width: 360px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
