/* Asl Belgisi tekshiruv. Light, calm, legible under office fluorescents and on a warehouse phone. */

:root {
  --hue: 152;
  --paper: oklch(97.6% 0.007 var(--hue));
  --surface: oklch(99.6% 0.003 var(--hue));
  --sunken: oklch(95.2% 0.009 var(--hue));
  --hover: oklch(96.4% 0.012 var(--hue));
  --line: oklch(90.5% 0.011 var(--hue));
  --line-strong: oklch(82% 0.015 var(--hue));
  --ink: oklch(23% 0.02 var(--hue));
  --ink-2: oklch(40% 0.018 var(--hue));
  --ink-3: oklch(52% 0.014 var(--hue));

  --brand: oklch(50% 0.12 var(--hue));
  --brand-strong: oklch(42% 0.11 var(--hue));
  --brand-ink: oklch(99% 0.01 var(--hue));
  --brand-soft: oklch(94.5% 0.035 var(--hue));
  --brand-deep: oklch(27% 0.045 var(--hue));
  --focus: oklch(60% 0.15 245);

  --v-red: oklch(50% 0.18 27);
  --v-red-bg: oklch(95.5% 0.028 27);
  --v-red-solid: oklch(58% 0.2 27);
  --v-orange: oklch(52% 0.14 52);
  --v-orange-bg: oklch(95.8% 0.032 60);
  --v-orange-solid: oklch(70% 0.15 58);
  --v-amber: oklch(50% 0.1 80);
  --v-amber-bg: oklch(96.4% 0.045 92);
  --v-amber-solid: oklch(82% 0.14 88);
  --v-grey: oklch(46% 0.01 var(--hue));
  --v-grey-bg: oklch(94.6% 0.004 var(--hue));
  --v-grey-solid: oklch(74% 0.01 var(--hue));
  --v-green: oklch(45% 0.1 var(--hue));
  --v-green-bg: oklch(95.2% 0.032 var(--hue));
  --v-green-solid: oklch(66% 0.12 var(--hue));

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px oklch(30% 0.02 var(--hue) / 0.06);
  --shadow: 0 1px 2px oklch(30% 0.02 var(--hue) / 0.05), 0 6px 20px oklch(30% 0.02 var(--hue) / 0.05);
  --shadow-lg: 0 24px 64px oklch(20% 0.03 var(--hue) / 0.22), 0 2px 6px oklch(20% 0.03 var(--hue) / 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 10;
  --z-toast: 100;
  --z-tip: 200;

  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.55 var(--font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
}
a { color: var(--brand-strong); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 680; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 26px; height: 26px; }
[hidden] { display: none !important; }

/* ---- shell ---------------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px max(16px, calc((100vw - 1200px) / 2));
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 680; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-inline-end: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.topbar-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 9px; background: var(--sunken); }
.lang a {
  padding: 4px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 650;
  color: var(--ink-3); text-decoration: none; text-transform: uppercase;
}
.lang a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.lang .help { margin: 0 4px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-deep); color: var(--brand-ink); font-size: 12px; font-weight: 700; text-transform: uppercase;
}

main { padding: 32px max(16px, calc((100vw - 1200px) / 2)) 72px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head > div { display: grid; gap: 6px; margin-inline-end: auto; }
.page-head p { color: var(--ink-3); max-width: 62ch; }
.title-row { display: flex; align-items: center; gap: 8px; }

.section { margin-top: 40px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head .spacer { flex: 1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }

/* ---- form controls ------------------------------------------------------------------------------ */

.field { display: grid; gap: 6px; }
.field-label { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.field-label .help { margin-inline-start: 4px; }
.hint { color: var(--ink-3); font-size: 13px; }
.field-error { color: var(--v-red); font-size: 13px; font-weight: 500; }
.field-error:empty { display: none; }
input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea { font-family: var(--mono); font-size: 14px; resize: vertical; min-height: 180px; line-height: 1.5; }
input::placeholder, textarea::placeholder { font-family: var(--font); color: var(--ink-3); opacity: 0.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[aria-invalid="true"] { border-color: var(--v-red); }
.input-group { position: relative; display: flex; }
.input-group input { padding-inline-end: 110px; font-family: var(--mono); }
.input-group .btn { position: absolute; inset-block: 4px; inset-inline-end: 4px; min-height: 0; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--font); padding: 0 16px; min-height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-danger { background: var(--v-red-solid); border-color: var(--v-red-solid); color: oklch(99% 0.005 27); }
.btn-danger:hover { background: var(--v-red); border-color: var(--v-red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-ghost.is-danger { color: var(--v-red); }
.btn-ghost.is-danger:hover { background: var(--v-red-bg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 15px; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunken); }
.segmented button {
  font: 600 13px/1 var(--font); color: var(--ink-2); border: 0; background: transparent;
  min-height: 34px; padding: 0 12px; border-radius: 7px; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.alert-error { background: var(--v-red-bg); color: oklch(38% 0.14 27); }
.alert-warn { background: var(--v-amber-bg); color: oklch(38% 0.08 80); }
.alert-ok { background: var(--v-green-bg); color: oklch(34% 0.08 var(--hue)); }
.alert:empty { display: none; }

/* ---- help tooltip ---------------------------------------------------------------------------------- */

.help { position: relative; display: inline-flex; vertical-align: middle; }
.help-btn {
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
  font: 700 11.5px/1 var(--font); cursor: help; display: grid; place-items: center;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.help-btn::after { content: ""; position: absolute; inset: -12px; }
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--brand-strong); border-color: var(--brand); background: var(--brand-soft); }
.help-tip {
  position: fixed; z-index: var(--z-tip); left: 0; top: 0;
  width: max-content; max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: 9px;
  background: var(--brand-deep); color: oklch(97% 0.006 var(--hue));
  font: 400 13.5px/1.5 var(--font); text-align: left; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: 0 10px 30px oklch(20% 0.03 var(--hue) / 0.28);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease), visibility 0s linear 0.14s;
  pointer-events: none;
}
.help-tip.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* ---- modal ----------------------------------------------------------------------------------------- */

dialog.modal {
  width: min(560px, calc(100vw - 24px)); max-height: min(88dvh, 900px);
  padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: var(--surface);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal-lg { width: min(820px, calc(100vw - 24px)); }
dialog.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head, .modal-sub, .modal-foot { flex: none; }
.modal-body { flex: 1 1 auto; min-height: 0; }
dialog.modal::backdrop { background: oklch(20% 0.03 var(--hue) / 0.5); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.22s var(--ease); }
dialog.modal[open]::backdrop { animation: fade-in 0.22s var(--ease); }
dialog.modal.is-closing { animation: modal-out 0.14s ease-in forwards; }
dialog.modal.is-closing::backdrop { animation: fade-out 0.14s ease-in forwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(0.99); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 0 24px; }
.modal-head .title-row { margin-inline-end: auto; padding-top: 5px; }
.modal-head h2 { font-size: 19px; }
.modal-sub { color: var(--ink-3); font-size: 14px; padding: 6px 24px 0; }
.modal-body { padding: 20px 24px; overflow: auto; display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--line); background: var(--paper);
}
.modal-foot .spacer { flex: 1; }
.modal-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.modal-icon.is-danger { background: var(--v-red-bg); color: var(--v-red); }
.modal-icon.is-ok { background: var(--v-green-bg); color: var(--v-green); }

/* ---- toasts ------------------------------------------------------------------------------------------ */

.toasts {
  position: fixed; z-index: var(--z-toast); inset-inline: 0; bottom: 20px;
  display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 12px;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 520px;
  padding: 11px 16px; border-radius: 11px; background: var(--brand-deep); color: oklch(97% 0.006 var(--hue));
  font-size: 14px; box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: toast-in 0.25s var(--ease);
}
.toast.is-error { background: oklch(38% 0.13 27); }
.toast.is-leaving { animation: fade-out 0.18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- check page -------------------------------------------------------------------------------------- */

.scanner { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.scanner-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.scanner-input { position: relative; flex: 1 1 320px; }
.scanner-input .icon { position: absolute; left: 15px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.scanner-input input {
  min-height: 52px; padding-inline-start: 46px; font-family: var(--mono); font-size: 15.5px; border-radius: var(--radius);
}
.scanner-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.drop {
  position: relative; display: grid; justify-items: center; gap: 8px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 16px;
  background: var(--paper); transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop.is-busy { opacity: 0.7; pointer-events: none; }
.drop-badge { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.drop-title { font-weight: 650; font-size: 16px; }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 1px 10px; counter-increment: step; color: var(--ink-3); font-size: 13px; }
.steps li::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--sunken); color: var(--ink-2);
}
.steps li.is-current::before { background: var(--brand); color: var(--brand-ink); }
.steps li.is-done::before { content: "✓"; background: var(--brand-soft); color: var(--brand-strong); }
.steps strong { color: var(--ink); font-weight: 600; font-size: 14px; }

.sheet-list { display: grid; gap: 8px; }
.sheet {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.sheet:hover { background: var(--hover); }
.sheet:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.sheet input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.sheet-title { font-weight: 600; }
.sheet-role { color: var(--ink-3); font-size: 13px; }
.sheet-count { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13.5px; }

.job-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.job-file { display: flex; align-items: center; gap: 12px; margin-inline-end: auto; min-width: 0; }
.file-badge { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--v-green-bg); color: var(--v-green); flex: none; }
.job-file strong { display: block; overflow-wrap: anywhere; }
.progress { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin: 18px 0 8px; }
.progress-bar { height: 100%; width: 100%; background: var(--brand); border-radius: 99px; transform-origin: left; transform: scaleX(0); transition: transform 0.4s var(--ease); }

.stack-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--sunken); gap: 2px; }
.stack-bar span { display: block; min-width: 3px; }
.sb-sold_in_stock { background: var(--v-red-solid); }
.sb-sold_not_withdrawn { background: var(--v-orange-solid); }
.sb-not_ours { background: oklch(64% 0.13 40); }
.sb-not_introduced { background: var(--v-amber-solid); }
.sb-not_found, .sb-invalid { background: var(--v-grey-solid); }
.sb-ok { background: var(--v-green-solid); }
.summary-line { display: flex; align-items: center; gap: 6px; margin: 18px 0 10px; font-size: 14px; color: var(--ink-2); }
.summary-line b { color: var(--ink); font-variant-numeric: tabular-nums; }

.verdicts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.verdict-wrap { display: inline-flex; align-items: center; gap: 4px; }
.verdict {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 10px; min-height: 40px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  font: 500 13.5px/1.2 var(--font); color: var(--ink); cursor: pointer; text-align: left;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.verdict:hover { background: var(--hover); }
.verdict .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.verdict b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict[aria-pressed="true"] { border-color: var(--ink-2); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--ink-2); }
.verdict[data-empty="true"] { color: var(--ink-3); }
.verdict[data-empty="true"] .dot { opacity: 0.35; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.4;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.v-sold_in_stock { background: var(--v-red-bg); color: var(--v-red); }
.v-sold_not_withdrawn, .v-not_ours { background: var(--v-orange-bg); color: var(--v-orange); }
.v-not_introduced { background: var(--v-amber-bg); color: var(--v-amber); }
.v-not_found, .v-invalid { background: var(--v-grey-bg); color: var(--v-grey); }
.v-ok { background: var(--v-green-bg); color: var(--v-green); }
.s-INTRODUCED { background: var(--v-green-bg); color: var(--v-green); }
.s-WITHDRAWN, .s-WRITTEN_OFF, .s-RETIRED { background: var(--v-orange-bg); color: var(--v-orange); }
.s-APPLIED, .s-EMITTED { background: var(--v-amber-bg); color: var(--v-amber); }
.s-NOT_FOUND, .s-INVALID, .s-UNKNOWN { background: var(--v-grey-bg); color: var(--v-grey); }

/* ---- tables -------------------------------------------------------------------------------------------- */

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { background: var(--sunken); color: var(--ink-2); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
th .help { margin-inline-start: 4px; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.cell-code { font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; min-width: 200px; }
.cell-sub { color: var(--ink-3); font-size: 12.5px; }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 180px; }
.cell-chevron { width: 36px; color: var(--ink-3); }
tr.is-clickable { cursor: pointer; transition: background 0.12s var(--ease); }
tr.is-clickable:hover { background: var(--hover); }
tr.is-clickable:hover .cell-chevron { color: var(--brand); }
tr.is-clickable:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.table-note { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; margin-top: 10px; flex-wrap: wrap; }
.empty { padding: 32px 16px; text-align: center; color: var(--ink-3); display: grid; gap: 8px; justify-items: center; }
.empty .icon-lg { color: var(--line-strong); }

.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-done { color: var(--v-green); }
.state-failed { color: var(--v-red); }
.state-running, .state-queued { color: var(--v-amber); }

/* ---- detail modal ---------------------------------------------------------------------------------------- */

.detail-verdict { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); }
.detail-verdict .badge { justify-self: start; background: var(--surface); }
.detail-verdict p { font-size: 14px; color: var(--ink); }
.detail-verdict h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-code {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--radius-sm);
  background: var(--sunken); font-family: var(--mono); font-size: 14px;
}
.detail-code span { flex: 1; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.detail-block h3 { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin-bottom: 10px; }
dl.kv { margin: 0; display: grid; gap: 10px; }
dl.kv div { display: grid; gap: 1px; }
dl.kv dt { color: var(--ink-3); font-size: 12.5px; }
dl.kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

/* ---- admin & account ------------------------------------------------------------------------------------------ */

.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { display: grid; gap: 2px; padding: 12px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 150px; }
.stat b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: 13px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.pill-admin { background: var(--brand-soft); color: var(--brand-strong); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
tr.is-inactive td { color: var(--ink-3); }
tr.is-inactive .avatar { background: var(--line-strong); }

.credentials { display: grid; gap: 8px; margin: 0; }
.cred {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-radius: var(--radius-sm); background: var(--sunken);
}
.cred dt { color: var(--ink-3); font-size: 13px; }
.cred dd { margin: 0; font-family: var(--mono); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }

.profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-main { display: grid; gap: 2px; margin-inline-end: auto; }

/* ---- login ------------------------------------------------------------------------------------------------------ */

.login-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.login-aside {
  background: var(--brand-deep); color: oklch(90% 0.02 var(--hue));
  padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-aside .brand { color: oklch(98% 0.01 var(--hue)); }
.login-aside .brand-mark { background: oklch(66% 0.12 var(--hue)); color: var(--brand-deep); }
.login-aside h2 { font-size: 32px; line-height: 1.15; color: oklch(98% 0.01 var(--hue)); max-width: 15ch; font-weight: 680; }
.login-aside ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; max-width: 42ch; }
.login-aside li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.login-aside li .icon { color: oklch(76% 0.12 var(--hue)); margin-top: 3px; }
.login-aside small { color: oklch(70% 0.02 var(--hue)); }
.login-main { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 24px; }
.login-card h1 { font-size: 26px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-aside { padding: 16px; }
  .login-aside h2, .login-aside ul, .login-aside small { display: none; }
}

@media (max-width: 640px) {
  h1 { font-size: 23px; }
  input[type="text"], input[type="password"], select, textarea { font-size: 16px; }
  .topbar { position: static; gap: 6px 10px; padding-block: 8px 6px; }
  .brand { margin-inline-end: auto; }
  .topbar-end { order: 2; }
  .nav { order: 3; width: 100%; margin: 0 -9px; flex-wrap: nowrap; overflow-x: auto; }
  /* result rows become stacked cards: verdict + chevron, then code, then status */
  .result-table thead { display: none; }
  .result-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .result-table tbody tr:last-child { border-bottom: 0; }
  .result-table td { padding: 0; border: 0; }
  .result-table td.cell-code { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .result-table td.cell-chevron { grid-column: 2; grid-row: 1; width: auto; }
  .result-table .badge { white-space: normal; }
  .user-chip span { display: none; }
  .nav a { padding: 7px 9px; }
  .nav a .icon { display: none; }
  .panel { padding: 16px; border-radius: 12px; }
  main { padding-top: 22px; }
  .hide-sm { display: none; }
  dialog.modal, dialog.modal-lg { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .modal-head { padding: 18px 16px 0 18px; }
  .modal-sub { padding-inline: 18px; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  .cred { grid-template-columns: 1fr auto; }
  .cred dt { grid-column: 1 / -1; }
  .stat { flex: 1; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
