/* ==========================================================================
   Training Form System — styles
   ========================================================================== */

:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --border: #d8dfe9;
    --border-strong: #b9c4d4;
    --text: #142033;
    --muted: #5b6b82;
    --navy: #13233d;
    --navy-2: #1c3254;
    --primary: #2457d6;
    --primary-hover: #1c47b4;
    --primary-soft: #e6eeff;
    --focus: #f5a524;

    --positive: #157347;
    --positive-soft: #e3f4ea;
    --negative: #b42318;
    --negative-soft: #fde8e6;
    --neutral: #2457d6;
    --neutral-soft: #e6eeff;
    --warning-soft: #fff6dd;
    --warning-border: #f1c75a;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(16, 32, 60, .06), 0 2px 8px rgba(16, 32, 60, .05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3 { line-height: 1.25; margin: 0; }
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    background: var(--navy); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

[hidden] { display: none !important; }

/* ---------- Brand ---------- */
.brand-mark {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; flex: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #3b74ff, #1d3f9e);
    color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .5px;
}

/* ---------- Panels ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.panel-header {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.panel-header h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-2); }
.panel-hint { font-size: 13px; color: var(--muted); }
.panel-intro { color: var(--muted); margin: 0 0 16px; max-width: 70ch; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.req { color: var(--negative); }

input[type="text"], input[type="tel"], input[type="search"], input[type="date"],
input[type="password"], select {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: #8d9bb0; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 87, 214, .2); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--negative); background: #fffafa; }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .18); }
input.is-upper { text-transform: uppercase; }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

.field-error {
    margin: 2px 0 0; font-size: 13px; color: var(--negative); font-weight: 500;
}
.field-error::before { content: "⚠ "; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 8px 16px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: #8d9bb0; }
.btn-small { min-height: 32px; padding: 4px 12px; font-size: 13px; background: var(--primary-soft); color: var(--primary); }
.btn-small:hover { background: #d4e1ff; }
.btn-lg { min-height: 40px; padding: 7px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.is-loading .btn-label::after {
    content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
    border: 1px solid; font-weight: 500;
}
.alert-success { background: var(--positive-soft); border-color: #9fd5b6; color: #0f5132; }
.alert-error { background: var(--negative-soft); border-color: #f2b2ab; color: #8a1c13; }

/* ---------- Badges / tones ---------- */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
    background: var(--neutral-soft); color: var(--neutral);
}
.badge.tone-positive { background: var(--positive-soft); color: var(--positive); }
.badge.tone-negative { background: var(--negative-soft); color: var(--negative); }

/* ==========================================================================
   Training Form (trainee console)
   ========================================================================== */

.training-body { padding-bottom: 24px; }

.console-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 12px 24px;
    background: var(--navy); color: #fff;
    border-bottom: 3px solid var(--primary);
}
.console-title { display: flex; align-items: center; gap: 12px; }
.console-title h1 { font-size: 20px; }
.console-title p { margin: 0; font-size: 13px; color: #a9b8d0; }
.console-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.format-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.format-switch label { font-size: 13px; color: #a9b8d0; white-space: nowrap; }
.format-switch select {
    min-height: 36px; width: auto; max-width: 320px; padding: 6px 10px;
    background: var(--navy-2); color: #fff; border-color: rgba(255, 255, 255, .25); font-weight: 600;
}
.format-switch select:focus { border-color: #8fb0ff; }
.format-switch .btn { min-height: 36px; }
.meta-chip {
    padding: 6px 12px; border-radius: 999px; font-size: 13px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #d6e0f0;
}
.meta-chip strong { color: #fff; }
.meta-clock { font-variant-numeric: tabular-nums; }

.console { max-width: 1440px; margin: 0 auto; padding: 20px 24px; }
.training-form { display: flex; flex-direction: column; gap: 16px; }
.form-fields { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.console-top {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
    gap: 16px;
    align-items: stretch;
}
.info-column { display: flex; flex-direction: column; gap: 16px; }

/* Training Script — document-style presentation */
.script-panel { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.script-doc {
    position: relative;
    /* Fill the panel: height follows the Customer Information column, content scrolls */
    flex: 1 1 0;
    min-height: 440px;
    overflow-y: auto;
    padding: 22px 28px 18px;
    background: #fff;
    font-family: "Times New Roman", Times, Georgia, serif;
    font-size: 19px;
    line-height: 1.38;
    color: #000;
    scrollbar-gutter: stable;
}
.script-title {
    margin: 0 0 4px;
    text-align: center;
    font-size: 25px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.script-title.title-classic { font-style: italic; }
.script-title.title-highlight { font-size: 19px; margin-bottom: 14px; text-underline-offset: 2px; }
.script-title.title-highlight span { background: #ffff00; padding: 0 2px; }
.script-timer {
    margin: 0 0 2px 162px;
    font-family: var(--font);
    font-size: 13px;
    color: #e11d1d;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.script-timer.is-running { font-weight: 700; }
.script-page p { margin: 0 0 6px; text-align: justify; }
.script-para.size-large, .script-bullet.size-large { font-size: 21px; }
.script-para.size-small, .script-bullet.size-small { font-size: 16px; }
.script-bullet { position: relative; padding-left: 38px; }
.script-bullet + .script-bullet, .script-para + .script-bullet { margin-top: 10px; }
.script-bullet::before { content: "•"; position: absolute; left: 0; font-weight: 700; font-size: 1.15em; line-height: inherit; }
/* Bullet whose marker is highlighted too (Idaho format) */
.script-bullet.is-marked::before { background: #ffff00; width: 38px; padding-left: 2px; }
.script-subbullet { position: relative; padding-left: 50px; margin: 0 0 4px; }
.script-subbullet::before { content: "○"; position: absolute; left: 0; }
.script-spacer { height: 70px; }
.script-spacer.size-small { height: 22px; }
.script-heading { margin: 4px 0 10px; font-size: 22px; font-style: italic; text-decoration: underline; }
.script-doc mark { background: #ffff00; color: inherit; padding: 0 1px; }
.script-doc .script-var { font-weight: inherit; color: inherit; background: none; padding: 0; }
.script-doc .script-var.is-empty { color: #8a8a8a; font-weight: 400; font-style: italic; }
.script-doc strong .script-var.is-empty { font-weight: 700; }
/* With JS, show one page at a time (all pages stay visible without JS) */
.script-doc.is-paged .script-page:not(.is-current) { display: none; }

.script-footer {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 8px 14px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.call-type-badge {
    padding: 3px 26px;
    background: #ee1c1c; color: #5a0000;
    border: 1px solid #b30000;
    font-size: 13px; font-weight: 600;
}
.script-page-count { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.script-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.script-nav-btn {
    border: 1px solid transparent; background: none; border-radius: var(--radius-sm);
    padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.script-nav-btn:hover:not(:disabled) { background: #fff; border-color: var(--border-strong); }
.script-nav-btn:disabled { color: #a3adbb; cursor: default; }
.script-nav-btn.is-next:not(:disabled) { color: var(--primary); }
.script-nav-btn.is-stop:not(:disabled) { color: #c2410c; }

/* Customer Information */
.customer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.customer-grid .field-address { grid-column: 1 / -1; }

/* Agent Training Controls */
.controls-row { display: grid; gap: 12px; }
.controls-row + .controls-row { margin-top: 12px; }
.controls-top { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.controls-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.control-group {
    margin: 0; min-width: 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px 12px; background: var(--surface-2);
}
.control-group { position: relative; }
.control-group legend {
    float: left; padding: 0; margin-bottom: 8px; line-height: 24px;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.clear-btn {
    position: absolute; top: 9px; right: 8px;
    border: 0; background: none; padding: 2px 4px; cursor: pointer;
    font-size: 12px; color: var(--primary); text-decoration: underline;
}
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; clear: both; }
.control-group select { clear: both; min-height: 32px; padding: 4px 8px; font-size: 13px; }

/* Selectable button (radio styled as button): normal / hover / selected / disabled */
.choice { position: relative; flex: 1 1 auto; display: flex; }
.choice input {
    position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer;
}
.choice span {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 32px; padding: 4px 10px;
    text-align: center; font-weight: 600; font-size: 13px; line-height: 1.2;
    background: #fff; color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    cursor: pointer; user-select: none;
    transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.choice:hover span { border-color: var(--primary); background: #f3f6ff; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:checked + span {
    background: var(--primary); border-color: var(--primary); color: #fff;
    box-shadow: 0 0 0 2px rgba(36, 87, 214, .25), inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.choice input:checked + span::before { content: "✓"; font-weight: 800; }
.choice input:disabled:not(:checked) + span { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
/* Keep submitted selections clearly visible while the form is locked */
.choice input:checked:disabled + span { opacity: .85; cursor: not-allowed; }
.choice:has(input:disabled):hover span { border-color: var(--border-strong); }

/* Call Outcome / Final Disposition */
.outcome-panel { border-top: 4px solid var(--navy-2); }
.outcome-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.outcome-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice-outcome span { min-height: 38px; font-size: 13.5px; }
.choice-outcome.tone-positive input:checked + span { background: var(--positive); border-color: var(--positive); box-shadow: 0 0 0 3px rgba(21, 115, 71, .25); }
.choice-outcome.tone-negative input:checked + span { background: var(--negative); border-color: var(--negative); box-shadow: 0 0 0 3px rgba(180, 35, 24, .22); }
.choice-outcome.tone-positive:hover span { border-color: var(--positive); background: #f1faf5; }
.choice-outcome.tone-negative:hover span { border-color: var(--negative); background: #fff6f5; }
.outcome-group[aria-invalid="true"] .outcome-grid { outline: 2px solid var(--negative); outline-offset: 6px; border-radius: 4px; }

/* Submit bar */
.submit-bar {
    position: sticky; bottom: 0; z-index: 10;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 -4px 18px rgba(16, 32, 60, .08);
    padding: 12px 16px;
}
.submit-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.selected-outcome { margin: 0; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.outcome-pill {
    padding: 4px 14px; border-radius: 999px; font-size: 15px;
    background: var(--neutral-soft); color: var(--neutral);
}
.outcome-pill.tone-positive { background: var(--positive-soft); color: var(--positive); }
.outcome-pill.tone-negative { background: var(--negative-soft); color: var(--negative); }
.outcome-pill.is-empty { background: var(--surface-2); color: var(--muted); font-weight: 500; font-style: italic; }
.submit-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.form-alert { margin-bottom: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 500; }
.form-alert.is-success { background: var(--positive-soft); color: #0f5132; border: 1px solid #9fd5b6; }
.form-alert.is-error { background: var(--negative-soft); color: #8a1c13; border: 1px solid #f2b2ab; }
.form-alert:focus { outline: none; }

/* Confirm dialog */
.dialog {
    width: min(480px, calc(100vw - 32px));
    border: 0; border-radius: 14px; padding: 24px;
    box-shadow: 0 20px 60px rgba(10, 20, 40, .35);
    color: var(--text);
}
.dialog::backdrop { background: rgba(10, 20, 40, .5); }
.dialog h2 { font-size: 20px; margin-bottom: 6px; }
.dialog p { margin: 0 0 16px; color: var(--muted); }
.confirm-summary { margin: 0 0 20px; display: grid; gap: 8px; }
.confirm-summary div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.confirm-summary dt { color: var(--muted); font-size: 14px; }
.confirm-summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.confirm-summary .summary-outcome { border-bottom: 0; padding: 10px 12px; background: var(--primary-soft); border-radius: var(--radius-sm); }
.confirm-summary .summary-outcome dd { font-size: 17px; color: var(--primary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.admin-sidebar {
    background: var(--navy); color: #c8d3e6;
    display: flex; flex-direction: column; gap: 20px;
    padding: 20px 14px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-text { color: #fff; font-weight: 700; line-height: 1.2; display: flex; flex-direction: column; }
.brand-text small { color: #8ea0bd; font-weight: 500; font-size: 12px; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a, .nav-logout button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: #c8d3e6; text-decoration: none; font-weight: 500;
    background: none; border: 0; cursor: pointer; text-align: left;
}
.admin-nav svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.admin-nav a:hover, .nav-logout button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-nav a.is-active { background: var(--primary); color: #fff; }
.nav-logout { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); }

.admin-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid rgba(255, 255, 255, .1); color: #fff; font-size: 14px; }
.admin-user span:last-child { display: flex; flex-direction: column; min-width: 0; }
.admin-user small { color: #8ea0bd; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-2); display: grid; place-items: center; font-weight: 700; flex: none; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.admin-topbar h1 { font-size: 22px; margin-right: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; display: block; fill: var(--text); }
.admin-content { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.admin-content > .alert { margin-bottom: 0; }

/* Dashboard cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    text-decoration: none; color: var(--text);
    border-left: 4px solid var(--primary);
    transition: transform .12s, box-shadow .12s;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16, 32, 60, .1); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-total { border-left-color: var(--navy-2); }
.stat-sales { border-left-color: var(--positive); }
.stat-no_interest, .stat-dnc { border-left-color: var(--negative); }
.stat-appointments { border-left-color: #a16207; }

/* Filters */
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; }
.filter-search { grid-column: span 2; }
.filter-actions { display: flex; gap: 8px; grid-column: 1 / -1; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: 10px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
    background: var(--surface-2);
}
.data-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions { text-align: right; }
.submissions-table { font-size: 13.5px; }
.submissions-table th { letter-spacing: .02em; padding: 10px 8px; }
.submissions-table td { padding: 9px 8px; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.empty-state { margin: 0; padding: 32px 16px; text-align: center; color: var(--muted); }
.link { font-weight: 600; text-decoration: none; }

/* Pagination */
.pagination { margin-top: 16px; }
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; justify-content: center; }
.pagination a {
    display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text); font-weight: 600; background: #fff;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Submission detail */
.submission-detail { display: flex; flex-direction: column; gap: 20px; }
.detail-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.detail-id { font-size: 28px; font-family: var(--mono); }
.detail-meta { display: flex; gap: 32px; flex-wrap: wrap; margin: 0; }
.detail-meta dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.detail-meta dd { margin: 0; font-weight: 600; }

.outcome-hero { text-align: center; padding: 24px; border-width: 2px; background: var(--neutral-soft); border-color: #b9cbf7; }
.outcome-hero-value { margin: 6px 0 0; font-size: 34px; font-weight: 800; color: var(--neutral); }
.outcome-hero.tone-positive { background: var(--positive-soft); border-color: #9fd5b6; }
.outcome-hero.tone-positive .outcome-hero-value { color: var(--positive); }
.outcome-hero.tone-negative { background: var(--negative-soft); border-color: #f2b2ab; }
.outcome-hero.tone-negative .outcome-hero-value { color: var(--negative); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 14px; }
.detail-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-footnote { margin: 0; font-size: 13px; color: var(--muted); }

/* Login */
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 16px;
    background: radial-gradient(circle at 20% 10%, #24427a 0, var(--navy) 55%);
}
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 22px; letter-spacing: .02em; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { margin-top: 6px; }
.auth-footer { margin: 18px 0 0; text-align: center; font-size: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .controls-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .console-top { grid-template-columns: 1fr; }
    .script-doc { flex: none; height: 420px; min-height: 0; }
    .detail-grid { grid-template-columns: 1fr; }

    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50;
        transform: translateX(-100%); transition: transform .2s ease;
    }
    .admin-sidebar.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 20, 40, .45); }
    .nav-toggle { display: inline-block; }
}

@media (max-width: 720px) {
    .console, .console-header { padding-left: 16px; padding-right: 16px; }
    .controls-top, .controls-bottom { grid-template-columns: 1fr; }
    .customer-grid { grid-template-columns: 1fr; }
    .script-doc { padding: 16px; font-size: 17px; }
    .script-para.size-large, .script-bullet.size-large { font-size: 18px; }
    .script-title { font-size: 20px; }
    .script-timer { margin-left: 0; }
    .format-switch { margin-left: 0; width: 100%; }
    .format-switch select { flex: 1; max-width: none; }
    .script-subbullet { padding-left: 28px; }
    .script-spacer { height: 24px; }
    .script-page p { text-align: left; }
    .script-nav { margin-left: 0; }
    .outcome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .submit-bar-inner, .submit-actions { flex-direction: column; align-items: stretch; }
    .submit-actions .btn { width: 100%; }

    .admin-topbar, .admin-content { padding-left: 16px; padding-right: 16px; }
    .filters { grid-template-columns: 1fr 1fr; }
    .filter-search { grid-column: 1 / -1; }
    .detail-list div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 420px) {
    .outcome-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
