/* ems-qc review app — clinical, calm, legible. Light and dark themes. */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --ink: #142033; --ink-2: #33425a; --muted: #66748a;
  --line: #e2e7ee; --line-2: #d3dae4;
  --brand: #0f4c81; --brand-2: #1d6fb8; --brand-soft: #e7f0f9;
  --good: #1a7f4b; --good-soft: #e6f4ec; --bad: #c0352b; --bad-soft: #fcebea; --warn: #b26a00; --warn-soft: #fdf2df;
  --und: #6a4bc4; --und-soft: #efeafb; --na: #8a96a8; --na-soft: #eef1f5;
  --ct: #1d6fb8; --ct-soft: #e8f1fb; --cl: #0f7d71; --cl-soft: #e4f4f1;
  --shadow: 0 1px 2px rgba(16, 32, 51, .05), 0 2px 8px rgba(16, 32, 51, .04);
  --radius: 12px;
  --on-accent: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1420; --surface: #141d2b; --surface-2: #182233; --ink: #e6ecf4; --ink-2: #c3cddb; --muted: #8b98ab;
    --line: #243045; --line-2: #2e3c54;
    --brand: #5aa2e6; --brand-2: #7cb6ee; --brand-soft: #16304b;
    --good: #43b97a; --good-soft: #12301f; --bad: #ef6b60; --bad-soft: #3a1a19; --warn: #e6a23c; --warn-soft: #36270f;
    --und: #a38af0; --und-soft: #251d40; --na: #7c889b; --na-soft: #1c2534;
    --ct: #6aaef0; --ct-soft: #15293f; --cl: #4cc2b2; --cl-soft: #12302c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --on-accent: #08111d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 20px 0 8px; color: var(--ink-2); }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sub { color: var(--muted); margin: 0; max-width: 760px; }
button { font: inherit; color: inherit; }

/* ------------------------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand svg, .login-brand svg { width: 32px; height: 32px; flex: none; }
.brand svg rect, .login-brand svg rect { fill: var(--brand); }
.brand svg path, .login-brand svg path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand b { font-size: 14px; white-space: nowrap; }
.brand small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--ink-2); }
a.ghost { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a, .seg button { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; letter-spacing: .02em; }
.seg a + a, .seg button + button { border-left: 1px solid var(--line-2); }
.seg .on { background: var(--brand-soft); color: var(--brand); }
.seg.small button { padding: 3px 12px; }

/* ------------------------------------------------------------------ layout */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 40px; }
.page.wide { max-width: 1480px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 28px; }
.empty { padding: 48px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); margin-top: 14px; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }

/* ------------------------------------------------------------------ buttons, pills, tags */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--brand-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.wide { width: 100%; justify-content: center; padding: 11px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-pending { background: var(--na-soft); color: var(--muted); }
.st-in_progress { background: var(--warn-soft); color: var(--warn); }
.st-completed { background: var(--good-soft); color: var(--good); }
.st-processing, .job-queued, .job-running { background: var(--brand-soft); color: var(--brand); }
.job-done { background: var(--good-soft); color: var(--good); }
.job-failed { background: var(--bad-soft); color: var(--bad); }
.tag { display: inline-block; padding: 1px 8px; margin: 1px 4px 1px 0; border-radius: 6px; font-size: 12.5px; font-weight: 500; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.tag.crit { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.muted { background: var(--na-soft); color: var(--ink-2); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.big { font-size: 14px; padding: 5px 12px; border-radius: 8px; }
.s-met, .v-yes { background: var(--good-soft); color: var(--good); }
.s-not_met, .v-no { background: var(--bad-soft); color: var(--bad); }
.s-refused, .v-refused { background: var(--warn-soft); color: var(--warn); }
.s-undetermined, .v-undetermined { background: var(--und-soft); color: var(--und); }
.s-not_applicable, .v-na { background: var(--na-soft); color: var(--na); }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sev-critical { color: var(--bad); }
.sev-major { color: var(--warn); }
.flag { color: var(--und); font-size: 12.5px; font-weight: 600; margin-left: 6px; }
.spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ login */
.login-body { min-height: 100vh; background: radial-gradient(1200px 600px at 20% -10%, var(--brand-soft), transparent 60%), var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px 24px; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.login-brand svg { width: 44px; height: 44px; }
.login-brand h1 { font-size: 18px; margin: 0; }
.login-brand p { margin: 0; font-size: 12.5px; color: var(--muted); }
.login-card label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.form-error { color: var(--bad); font-size: 13px; margin: -4px 0 12px; }
.login-lang { margin: 18px auto 0; display: flex; width: max-content; }

/* ------------------------------------------------------------------ call list */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.chip span { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.on span { color: inherit; opacity: .7; }
.table-card { padding: 0; overflow-x: auto; }
table.calls { width: 100%; border-collapse: collapse; min-width: 860px; }
.calls th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.calls td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.calls tr:last-child td { border-bottom: 0; }
.calls .num { text-align: right; }
.rowlink { cursor: pointer; transition: background .12s; }
.rowlink:hover { background: var(--surface-2); }
.call-id { font-weight: 600; color: var(--ink); }
.calls td:first-child { min-width: 250px; }
.issues { color: var(--bad); font-weight: 600; margin-right: 6px; }
.ok-text { color: var(--muted); }
.scorebar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.scorebar .val { font-weight: 700; width: 40px; font-variant-numeric: tabular-nums; }
.scorebar .track { flex: 1; height: 6px; border-radius: 6px; background: var(--na-soft); overflow: hidden; }
.scorebar .track i { display: block; height: 100%; border-radius: 6px; background: var(--good); }
.scorebar.mid .track i { background: var(--warn); } .scorebar.low .track i { background: var(--bad); }
.scorebar.mid .val { color: var(--warn); } .scorebar.low .val { color: var(--bad); } .scorebar.good .val { color: var(--good); }
tr.processing td { color: var(--muted); }

/* ------------------------------------------------------------------ call review */
.call-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 20px; margin-bottom: 18px; }
.back { font-size: 13.5px; color: var(--muted); grid-column: 1 / -1; }
.call-title h1 { margin-bottom: 6px; }
.call-title .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.head-score { grid-column: 3; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.head-score small { font-size: 11.5px; color: var(--muted); }
.ring { --v: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--v) * 1%), var(--na-soft) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

.review-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.listen { position: sticky; top: 76px; padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 96px); overflow: hidden; }
.player { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.play { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-accent); cursor: pointer; display: grid; place-items: center; }
.play svg { width: 20px; height: 20px; fill: currentColor; }
.play .i-pause, .play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }
.timeline-wrap { flex: 1; min-width: 0; }
.timeline { position: relative; height: 34px; cursor: pointer; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.lanes .lane { position: absolute; height: 7px; border-radius: 3px; opacity: .85; }
.lane.call_taker { top: 7px; background: var(--ct); }
.lane.caller, .lane.other, .lane.unknown { top: 18px; background: var(--cl); }
.progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); opacity: .08; pointer-events: none; }
.head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); pointer-events: none; }
.markers .mk { position: absolute; bottom: 0; width: 3px; height: 6px; margin-left: -1px; border-radius: 2px 2px 0 0; }
.mk.s-met { background: var(--good); } .mk.s-not_met { background: var(--bad); height: 10px; } .mk.s-refused { background: var(--warn); } .mk.s-undetermined { background: var(--und); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.speed { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 6px 9px; cursor: pointer; min-width: 52px; }

.tr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px 8px; flex-wrap: wrap; }
.tr-head h2 { margin: 0; }
.legend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.follow { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.follow input { width: auto; margin: 0; }
.spk { display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 5px; }
.spk.call_taker { background: var(--ct-soft); color: var(--ct); }
.spk.caller, .spk.other, .spk.unknown { background: var(--cl-soft); color: var(--cl); }
.transcript { list-style: none; margin: 0; padding: 4px 10px 18px; overflow-y: auto; flex: 1; scroll-behavior: smooth; }
.turn { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 8px 8px; border-radius: 10px; border-left: 3px solid transparent; transition: background .2s; }
.turn.caller, .turn.other { background: none; }
.turn .ts { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 0; text-align: left; font-size: 12px; align-self: start; margin-top: 2px; }
.turn .ts:hover { color: var(--brand); }
.turn .who { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.turn .text { margin: 0; color: var(--ink); }
.turn.active { background: var(--brand-soft); }
.turn.ev { border-left-color: var(--warn); }
.turn.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--warn-soft); } 100% { background: none; } }
.w.lc { text-decoration: underline dotted var(--warn); text-underline-offset: 3px; }
.w.now { background: var(--brand); color: var(--on-accent); border-radius: 3px; box-decoration-break: clone; }
.edit-btn { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; font-size: 14px; padding: 0 4px; }
.turn:hover .edit-btn { opacity: 1; }
.corr-tag { font-size: 11px; color: var(--und); font-weight: 600; }

/* stepper */
.guide { min-width: 0; }
.stepper { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; scrollbar-width: thin; }
.stepper button { flex: none; display: flex; align-items: center; gap: 7px; max-width: 220px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.stepper button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper button i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.stepper button.v-yes i { background: var(--good); } .stepper button.v-no i { background: var(--bad); }
.stepper button.v-refused i { background: var(--warn); } .stepper button.v-undetermined i { background: var(--und); }
.stepper button.v-yes, .stepper button.v-no, .stepper button.v-refused, .stepper button.v-undetermined { background: var(--surface); color: var(--ink-2); }
.stepper button.on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.stepper button.done::after { content: "✓"; color: var(--good); font-weight: 700; }
.stepper .st-ov, .stepper .st-fin { font-weight: 600; }
.step { margin-bottom: 12px; }
.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.step-head h2 { margin: 2px 0 0; font-size: 19px; }
.step-of { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.stepnav { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.progress-txt { font-size: 13px; color: var(--muted); }
.ctx-ev { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 14px; }

.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ov-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ov-item small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ov-q { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.ov-nums { display: flex; flex-direction: column; font-size: 13.5px; }
.ov-nums b { font-size: 16px; margin-right: 4px; }
.good { color: var(--good); } .bad { color: var(--bad); }
.check-list { margin-top: 16px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: var(--surface-2); }
.check-row .name { flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.v-yes { background: var(--good); } .dot.v-no { background: var(--bad); } .dot.v-refused { background: var(--warn); } .dot.v-undetermined { background: var(--und); }

/* requirement cards */
.req { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.req.na { background: var(--surface-2); opacity: .75; }
.req.agreed { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.req.changed { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); box-shadow: 0 0 0 3px var(--warn-soft); }
.req-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-text { margin: 8px 0 4px; font-weight: 600; font-size: 15px; }
.expl { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.evidence { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.quote { display: flex; gap: 8px; align-items: baseline; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 13.5px; transition: border-color .15s; }
.quote:hover { border-color: var(--brand-2); }
.quote .mono { color: var(--brand); flex: none; }
.quote .spk { flex: none; }
.quote .q { color: var(--ink-2); }
.quote.mini { font-size: 12.5px; padding: 5px 9px; color: var(--muted); }
.rationale { font-size: 13px; color: var(--ink-2); border-left: 3px solid var(--line-2); padding-left: 10px; }
.decide { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.decide .btn { padding: 6px 12px; font-size: 13.5px; }
.decide .agree.on { background: var(--good); border-color: var(--good); color: var(--on-accent); }
.decide .disagree.on { background: var(--warn); border-color: var(--warn); color: var(--on-accent); }
.saved-msg { font-size: 12.5px; color: var(--good); opacity: 0; transition: opacity .3s; }
.saved-msg.show { opacity: 1; }
.override { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-top: 12px; }
.override label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.final-note { margin-left: auto; font-size: 13px; color: var(--muted); }
.source { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* finish */
.fin-scores { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 16px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.fin-scores small { display: block; font-size: 12px; color: var(--muted); }
.fin-scores b { font-size: 28px; font-variant-numeric: tabular-nums; }
.fin-scores .arrow { color: var(--muted); font-size: 20px; }
.fin-counts { margin-left: auto; display: flex; flex-direction: column; font-size: 13.5px; }
.changes { padding-left: 0; list-style: none; margin: 0; }
.changes li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.changes .link { border: 0; background: none; color: var(--brand); cursor: pointer; text-align: left; padding: 0; width: 100%; font-weight: 500; }
.changes .c { color: var(--muted); font-style: italic; }
.na-list { display: flex; flex-wrap: wrap; gap: 4px; }
.fin-comment { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 18px; }
.done-msg { color: var(--good); font-weight: 600; font-size: 13.5px; }

.dlg { border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(10, 20, 35, .45); }
.dlg h3 { margin-top: 0; }
.dlg textarea { margin: 12px 0 6px; }

/* ------------------------------------------------------------------ dashboard */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; min-height: 2.6em; }
.kpi b { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .of { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-sub { display: block; font-size: 12px; color: var(--muted); }
.kpi.alert b { color: var(--bad); }
.stack { display: flex; height: 6px; border-radius: 6px; overflow: hidden; margin-top: 8px; background: var(--na-soft); }
.stack i.st-completed { background: var(--good); } .stack i.st-in_progress { background: var(--warn); } .stack i.st-pending { background: var(--na-soft); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: span 2; }
.chart { width: 100%; height: 260px; }
table.missed { width: 100%; border-collapse: collapse; }
.missed td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.missed tr:last-child td { border-bottom: 0; }
.missed .rate { white-space: nowrap; width: 70px; color: var(--muted); }
.missed .rate b { color: var(--bad); font-size: 16px; }
.missed .bar { width: 120px; height: 6px; background: var(--na-soft); border-radius: 6px; overflow: hidden; }
.missed .bar i { display: block; height: 100%; background: var(--bad); }

/* ------------------------------------------------------------------ upload */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.drop { border: 2px dashed var(--line-2); text-align: center; padding: 36px 24px; cursor: pointer; transition: border-color .15s, background .15s; box-shadow: none; }
.drop.over, .drop:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.drop input[type=file] { display: none; }
.drop svg { width: 40px; height: 40px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop ul { list-style: none; padding: 0; margin: 12px 0; font-size: 13.5px; color: var(--ink-2); }
.upbar { height: 6px; background: var(--na-soft); border-radius: 6px; overflow: hidden; margin-top: 14px; }
.upbar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.jobs { list-style: none; padding: 0; margin: 0; }
.job { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.job:last-child { border-bottom: 0; }
.job .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .err { width: 100%; color: var(--bad); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .review-grid { grid-template-columns: 1fr; }
  .listen { position: static; max-height: 60vh; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 16px; height: auto; flex-wrap: wrap; padding-top: 8px; }
  .brand small, .who { display: none; }
  .tabs { order: 3; width: 100%; height: 40px; overflow-x: auto; }
  .page { padding: 18px 16px 32px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .call-head { grid-template-columns: 1fr auto; }
  .head-score { grid-column: 2; }
  .ov-grid, .dash-grid, .upload-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .override { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .missed .bar { display: none; }
  .turn { grid-template-columns: 44px 1fr; }
}
