/* ---- Yango palette & base ------------------------------------------------ */

:root {
  --bg:         #0A0A0A;
  --surface:    #151515;
  --surface-2:  #1F1F1F;
  --surface-3:  #262626;
  --border:     #2A2A2A;
  --border-2:   #3A3A3A;

  --primary:      #FC3F1D;
  --primary-dim:  #C72E12;
  --primary-glow: rgba(252, 63, 29, 0.35);

  --danger:   #E11D48;
  --warn:     #FFDB4D;
  --ok:       #22C55E;

  --text:     #FFFFFF;
  --text-dim: #A0A0A0;
  --text-mid: #D4D4D4;

  --radius-s: 6px;
  --radius:   10px;
  --radius-l: 16px;

  --shadow: 0 4px 20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body[data-page="review"] { padding-bottom: 88px; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.dim  { color: var(--text-dim); }
.small { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }

button { font: inherit; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ---- topbar -------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 12px 24px;
  background: #000; border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  box-shadow: 0 0 0 3px rgba(252,63,29,0.15);
}
.brand-text { font-weight: 700; letter-spacing: 0.02em; }

.topbar-stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.stat-pill {
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-mid);
  border: 1px solid var(--border); font-size: 12px;
}
.stat-pill b { color: var(--text); }

.topbar-actions { display: flex; gap: 8px; }

.progress-track {
  height: 3px; background: var(--surface-2);
}
.progress-fill {
  height: 100%; background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  transition: width 0.4s ease;
}

/* ---- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-s);
  border: 1px solid transparent; background: transparent;
  color: var(--text); font-weight: 600; font-size: 13px;
  transition: transform 0.05s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dim); }

.btn-outline { border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: transparent; border: 1px solid #5a1a25; color: #ff8fa3; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-warn { background: transparent; border: 1px solid #6a5500; color: var(--warn); }
.btn-warn:hover { background: var(--warn); color: #000; border-color: var(--warn); }

.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); }

/* chips (filter pills) */
.chip {
  padding: 6px 12px; border-radius: 999px;
  background: transparent; color: var(--text-mid);
  border: 1px solid var(--border-2); font-size: 12px;
  text-transform: capitalize;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* icon buttons */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: var(--radius-s);
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
  font-size: 14px;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn.active { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ---- status pills -------------------------------------------------------- */

.status-pill {
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
}
.status-pill.big { padding: 6px 14px; font-size: 13px; }

.status-pending      { background: #332200; color: var(--warn); border-color: #5a3d00; }
.status-approved     { background: #0f2a1a; color: #6ee7a4; border-color: #1e4a30; }
.status-declined     { background: #3a1420; color: #ff8fa3; border-color: #5a1a25; }
.status-manual_review { background: #2a1f3a; color: #c4a3ff; border-color: #4a3a66; }
.status-no_driver_content { background: var(--surface-3); color: var(--text-dim); border-color: var(--border); }

/* manual-review modal icon */
.icon-manual-review {
  background: rgba(196, 163, 255, 0.12); color: #c4a3ff;
  border: 1px solid rgba(196, 163, 255, 0.3);
}

/* ---- confirmation modals (approve / decline) --------------------------- */

.modal {
  position: fixed; inset: 0;
  z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  animation: modal-in 160ms ease-out;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  background: var(--surface, #14171b);
  border: 1px solid var(--border, #23272d);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.03) inset;
  overflow: hidden;
  animation: modal-card-in 220ms cubic-bezier(.2,.9,.3,1.4);
}
.modal-approve  { border-top: 3px solid #228d52; }
.modal-decline  { border-top: 3px solid #a83349; }

.modal-head {
  display: flex; gap: 14px; align-items: center;
  padding: 18px 20px 14px;
}
.modal-icon-large {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  flex-shrink: 0;
}
.icon-approve { background: #0f2a1a; color: #6ee7a4; border: 1px solid #1e4a30; }
.icon-decline { background: #3a1420; color: #ff8fa3; border: 1px solid #5a1a25; }
.modal-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.modal-sub   { margin-top: 2px; }

.modal-body { padding: 8px 20px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  background: var(--surface-2, #1b1f25);
  border-top: 1px solid var(--border, #23272d);
}
.modal-confirm:disabled { opacity: 0.45; cursor: not-allowed; }

/* approve body ----------------------------------------------------------- */

.approve-summary {
  display: grid; gap: 8px;
  padding: 12px 14px;
  background: var(--surface-2, #1b1f25);
  border: 1px solid var(--border, #23272d);
  border-radius: 10px;
  margin-bottom: 14px;
}
.approve-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 13px;
}
.approve-label { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.approve-value { color: var(--text); font-weight: 600; }
.approve-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.approve-kind {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: #0f2a1a; color: #6ee7a4;
  border: 1px solid #1e4a30;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.approve-tick { font-size: 11px; }

/* stacked rows for lists (docs + rejected) — label on top, content below */
.approve-row-docs { flex-direction: column; align-items: stretch; gap: 4px; }
.approve-docs {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.approve-doc-row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 6px 10px;
  padding: 6px 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}
.approve-doc-kind {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: #0f2a1a; color: #6ee7a4; border: 1px solid #1e4a30;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.approve-doc-count { color: var(--text-dim); font-size: 11px; }
.approve-doc-files {
  flex: 1 1 100%;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
}
.approve-doc-file {
  font-size: 11px; color: var(--text-dim);
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.approve-doc-reason { color: #ff8fa3; }
.approve-phone {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; margin-right: 4px;
}
.approve-primary { color: #ffcf7a; font-size: 11px; }

.approve-confirm {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: rgba(30, 74, 48, 0.18);
  border: 1px solid #1e4a30;
  border-radius: 10px;
  font-size: 13px; line-height: 1.5; color: var(--text);
  cursor: pointer;
  transition: border-color 140ms;
}
.approve-confirm:hover { border-color: #228d52; }
.approve-confirm input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: #228d52;
  flex-shrink: 0;
}
.approve-confirm.checked { background: rgba(30, 74, 48, 0.32); border-color: #228d52; }

/* decline body ----------------------------------------------------------- */

.decline-reason-label {
  font-size: 13px; color: var(--text); font-weight: 600;
  margin-bottom: 10px;
}
.decline-reasons {
  display: grid; gap: 6px;
  margin-bottom: 14px;
}
.decline-reason {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #23272d);
  background: var(--surface-2, #1b1f25);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  font-size: 13px;
}
.decline-reason:hover { border-color: var(--border-2, #2d3238); }
.decline-reason input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.decline-reason-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-2, #2d3238);
  background: transparent;
  flex-shrink: 0;
  transition: all 120ms;
  position: relative;
}
.decline-reason.selected {
  border-color: #a83349;
  background: rgba(168, 51, 73, 0.12);
}
.decline-reason.selected .decline-reason-dot {
  border-color: #a83349;
  background: #a83349;
  box-shadow: inset 0 0 0 3px var(--surface-2, #1b1f25);
}
.decline-reason-label-text { color: var(--text); }

.decline-notes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.decline-notes-label { font-weight: 600; }
.decline-required { color: #ff8fa3; margin-left: 4px; }
.decline-required.hidden { display: none; }
.decline-notes textarea {
  width: 100%; min-height: 64px; padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2, #1b1f25); color: var(--text);
  border: 1px solid var(--border, #23272d);
  font-size: 13px; font-family: inherit; resize: vertical;
}
.decline-notes textarea:focus { outline: none; border-color: #a83349; }
.decline-warn { padding-top: 2px; }

/* ---- post-action fullscreen overlay ------------------------------------ */

.action-overlay {
  position: fixed; inset: 0;
  z-index: 1400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  animation: overlay-in 160ms ease-out;
}
.action-overlay.hidden { display: none; }
.action-overlay.kind-approve { background: radial-gradient(ellipse at center, rgba(15,90,51,0.55), rgba(0,0,0,0.82) 70%); }
.action-overlay.kind-decline { background: radial-gradient(ellipse at center, rgba(122,29,44,0.55), rgba(0,0,0,0.82) 70%); }
.action-overlay-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: overlay-pop 260ms cubic-bezier(.2,.9,.3,1.5);
}
.action-overlay-check {
  width: 140px; height: 140px;
}
.ao-circle {
  fill: none; stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 283; stroke-dashoffset: 283;
  animation: ao-circle-draw 400ms ease-out forwards;
}
.ao-mark {
  fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 80; stroke-dashoffset: 80;
  animation: ao-mark-draw 360ms 280ms ease-out forwards;
}
.action-overlay.kind-approve .ao-circle { stroke: #6ee7a4; }
.action-overlay.kind-approve .ao-mark   { stroke: #6ee7a4; }
.action-overlay.kind-decline .ao-circle { stroke: #ff8fa3; }
.action-overlay.kind-decline .ao-mark   { stroke: #ff8fa3; }

.action-overlay-title {
  font-size: 32px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: #fff;
  opacity: 0; animation: ao-text-in 260ms 420ms ease-out forwards;
}
.action-overlay-sub {
  font-size: 13px; color: rgba(255,255,255,0.7);
  opacity: 0; animation: ao-text-in 260ms 520ms ease-out forwards;
}

@keyframes modal-in        { from { opacity: 0; }          to { opacity: 1; } }
@keyframes modal-card-in   { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes overlay-in      { from { opacity: 0; }          to { opacity: 1; } }
@keyframes overlay-pop     { from { transform: scale(0.75); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ao-circle-draw  { to { stroke-dashoffset: 0; } }
@keyframes ao-mark-draw    { to { stroke-dashoffset: 0; } }
@keyframes ao-text-in      { to { opacity: 1; } }

/* ---- fleet search panel ------------------------------------------------ */

.fleet-panel .fleet-search-form {
  display: flex; gap: 8px; margin-top: 8px;
}
.fleet-search-input {
  flex: 1; min-width: 0;
  padding: 8px 12px; font-size: 13px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
.fleet-search-input:focus { outline: none; border-color: var(--primary); }
.fleet-search-btn { flex: 0 0 auto; padding: 0 14px; font-size: 13px; font-weight: 600; }
.fleet-search-spin { display: inline-block; animation: verify-pulse 0.9s ease-in-out infinite; }

.fleet-quick-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 8px;
}
.fleet-quick {
  padding: 3px 8px; font-size: 11px;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer;
}
.fleet-quick:hover { color: var(--text); border-color: var(--border-2); }

.fleet-matches-section { margin-top: 12px; }
.fleet-matches-head { margin-bottom: 6px; }
.fleet-matches { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fleet-empty { padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; }

.fleet-match-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fleet-match-row.just-added { animation: fleet-pulse 800ms ease-out; }
@keyframes fleet-pulse {
  0%   { background: rgba(110, 231, 164, 0.16); border-color: #1e4a30; }
  100% { background: var(--surface-2); border-color: var(--border); }
}
.fleet-match-main { flex: 1; min-width: 0; }
.fleet-match-name {
  font-weight: 600; color: var(--text); font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.fleet-match-meta {
  margin-top: 4px;
  display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px;
  line-height: 1.4;
}
.fleet-segment {
  padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.seg-active, .seg-new      { background: #0f2a1a; color: #6ee7a4; border: 1px solid #1e4a30; }
.seg-churn, .seg-inactive  { background: #3a1420; color: #ff8fa3; border: 1px solid #5a1a25; }
.seg-candidate             { background: #332200; color: #e2c058; border: 1px solid #5a3d00; }

.fleet-unlink { font-size: 12px; }

/* search results */
.fleet-results {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fleet-results.hidden { display: none; }
.fleet-results.error { border-color: #5a1a25; background: #3a1420; color: #ff8fa3; }
.fleet-results-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 12px;
}
.fleet-result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.fleet-result-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: 12px;
}
.fleet-result-row .fleet-match-main { font-size: 12px; }
.fleet-result-assoc {
  padding: 4px 10px; font-size: 11px; font-weight: 700;
  background: transparent; color: #6ee7a4;
  border: 1px solid #1e4a30; border-radius: 999px;
  cursor: pointer;
}
.fleet-result-assoc:hover { background: #155a33; color: #fff; border-color: #228d52; }
.fleet-result-assoc.linked {
  background: #0f2a1a; color: #6ee7a4; cursor: default;
}

/* ---- per-doc reject reason pill (on card after reject) ----------------- */

.reject-reason-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(168, 51, 73, 0.14);
  border: 1px solid #5a1a25;
  color: #ff8fa3;
  font-size: 11px; line-height: 1.3;
  max-width: 100%;
}
.reject-reason-pill .reject-reason-label {
  text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 700; font-size: 10px; opacity: 0.75;
  flex-shrink: 0;
}
.reject-reason-pill .reject-reason-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}

/* ---- TIN verify --------------------------------------------------------- */

.tin-row-with-verify {
  display: flex; gap: 8px; align-items: stretch;
}
.tin-row-with-verify .tin-input { flex: 1; min-width: 0; }

/* TIN field wrapper — flips between empty / saving / saved states so the
   reviewer sees the TIN as a confirmed item instead of an ever-editable box. */
.tin-field {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tin-field.is-saved {
  border-color: rgba(34,141,82,0.45);
  background: rgba(34,141,82,0.08);
  box-shadow: inset 3px 0 0 #228d52;
}
.tin-field.is-dirty {
  border-color: rgba(255,207,122,0.45);
  background: rgba(255,207,122,0.06);
  box-shadow: inset 3px 0 0 #e5a64a;
}
.tin-field.is-invalid {
  border-color: rgba(168, 51, 73, 0.5);
  background: rgba(168, 51, 73, 0.08);
  box-shadow: inset 3px 0 0 #a83349;
}
.tin-state-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.tin-state { display: none; }
.tin-field.is-saved   .tin-state-saved   { display: inline; color: #6ee7a4; }
.tin-field.is-dirty   .tin-state-dirty   { display: inline; color: #e5a64a; }
.tin-field.is-invalid .tin-state-invalid { display: inline; color: #ff8fa3; }
.tin-field.is-empty   .tin-state-empty   { display: inline; color: var(--text-dim); }
.tin-field.is-saved   .tin-input { color: var(--text); font-weight: 600; }
.tin-state-count { opacity: 0.8; font-weight: 600; }
.verify-tin-btn {
  flex: 0 0 auto; align-self: stretch;
  padding: 0 14px; font-size: 13px; font-weight: 600;
}
.verify-spin { display: inline-block; animation: verify-pulse 0.9s ease-in-out infinite; }
@keyframes verify-pulse { 50% { opacity: 0.35; } }

.tin-verify-result {
  margin-top: 8px; padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2, #1b1f25);
  border: 1px solid var(--border, #23272d);
  font-size: 13px; line-height: 1.4;
}
.tin-verify-result.hidden { display: none; }
.tin-verify-result.state-valid    { border-color: #1e4a30; background: #0f2a1a; }
.tin-verify-result.state-expired  { border-color: #5a1a25; background: #3a1420; }
.tin-verify-result.state-unknown,
.tin-verify-result.state-not_found { border-color: var(--border); background: var(--surface-3); }
.tin-verify-result.state-error    { border-color: #5a1a25; background: #3a1420; }

.verify-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.verify-name { font-weight: 600; color: var(--text); }
.verify-sub  { margin-top: 4px; }
.verify-lic  { margin-top: 2px; }
.verify-msg  { color: #ff8fa3; }

.verify-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.chip-valid     { background: #155a33; color: #fff; border-color: #228d52; }
.chip-expired   { background: #7a1d2c; color: #fff; border-color: #a83349; }
.chip-unknown,
.chip-not_found { background: var(--surface-3); color: var(--text-dim); border-color: var(--border); }
.chip-error     { background: #7a1d2c; color: #fff; border-color: #a83349; }

/* plate number */
.plate-input {
  width: 100%;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plate-input.plate-valid   { border-color: #228d52; box-shadow: 0 0 0 1px #228d5255; }
.plate-input.plate-invalid { border-color: #a83349; box-shadow: 0 0 0 1px #a8334955; }
.plate-hint { margin-top: 6px; font-size: 11px; }
.plate-hint .plate-ok   { color: #6ee7a4; font-weight: 600; }
.plate-hint .plate-warn { color: #ffcf7a; }
.plate-hint .plate-bad  { color: #ff8fa3; font-weight: 600; }
.plate-hint-ok { color: #6ee7a4; }
.plate-hint-bad { color: #ff8fa3; }

/* ---- approve / decline buttons ------------------------------------------ */

.btn-success {
  background: #0f2a1a; color: #6ee7a4;
  border: 1px solid #1e4a30;
}
.btn-success:hover { background: #155a33; color: #fff; border-color: #228d52; }

/* ---- user pill / logout -------------------------------------------------- */

.user-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; font-weight: 600;
}
.user-pill .user-dot { color: #6ee7a4; font-size: 10px; }
.logout-form { display: inline-flex; margin: 0; }

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

body[data-page="login"] {
  background: var(--bg, #0b0d10);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-wrap { width: 100%; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  background: var(--surface, #14171b);
  border: 1px solid var(--border, #23272d);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.login-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); margin-bottom: 4px;
}
.login-title { margin: 0 0 2px; font-size: 18px; font-weight: 700; }
.login-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); }
.login-label input {
  padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2, #1b1f25); color: var(--text);
  border: 1px solid var(--border, #23272d);
  font-size: 14px;
}
.login-label input:focus { outline: none; border-color: var(--primary); }
.login-submit { margin-top: 6px; padding: 10px 14px; font-size: 14px; }
.login-error {
  padding: 8px 12px; border-radius: 8px;
  background: #3a1420; color: #ff8fa3;
  border: 1px solid #5a1a25; font-size: 12px;
}
.login-hint { margin: 4px 0 0; }
.login-hint code { background: var(--surface-3); padding: 2px 5px; border-radius: 4px; }

/* ---- main layout --------------------------------------------------------- */

main { padding: 20px 24px; max-width: 1640px; margin: 0 auto; }

/* ---- queue stats widgets ------------------------------------------------ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  background: var(--surface, #14171b);
  border: 1px solid var(--border, #23272d);
  border-left: 3px solid var(--border-2, #2d3238);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms, transform 120ms;
}
.stat-card:hover { border-color: var(--border-2, #2d3238); transform: translateY(-1px); }
.stat-card .stat-label {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.stat-card .stat-value {
  font-size: 26px; font-weight: 800; color: var(--text);
  line-height: 1.1;
}
.stat-card .stat-sub { font-size: 11px; line-height: 1.3; }

.stat-pending  { border-left-color: var(--warn); }
.stat-approved { border-left-color: #6ee7a4; }
.stat-declined { border-left-color: #ff8fa3; }
.stat-today    { border-left-color: var(--primary); }
.stat-no-content { border-left-color: var(--text-dim); }
.stat-total    { border-left-color: #8da3c7; }

/* chip counts inline with filter buttons */
.chip .chip-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.85;
}
.chip.active .chip-count {
  background: rgba(0,0,0,0.22);
  opacity: 1;
}

/* status-coloured filter chips — subtle hint */
.chip-approved:not(.active)         { color: #6ee7a4; }
.chip-declined:not(.active)         { color: #ff8fa3; }
.chip-manual_review:not(.active)    { color: #c4a3ff; }
.chip-no_driver_content:not(.active){ color: var(--text-dim); }

/* ---- queue row inline actions ----------------------------------------- */

.queue-table .actions-col { width: 1%; white-space: nowrap; text-align: right; }
.queue-table .row-actions {
  display: flex; gap: 4px; justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}
.queue-table .row-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
}
.queue-table .row-actions .icon-btn {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.row-approve-btn:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.row-skip-btn { color: var(--text-dim); }
.row-skip-btn:hover { color: var(--primary); }

/* clicking the driver name cell navigates (separate from action buttons) */
.queue-table .cell-open:hover .driver-name { color: var(--primary); }

/* ---- queue --------------------------------------------------------------- */

.queue-filters {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px; max-width: 480px;
  padding: 10px 14px; font-size: 13px;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.queue-table th {
  text-align: left; padding: 10px 14px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 600;
  background: #000; border-bottom: 1px solid var(--border);
}
.queue-table th.num { text-align: right; }
.queue-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.queue-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.queue-table tr { transition: background 0.1s; }
.queue-table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.queue-table tbody tr:last-child td { border-bottom: none; }

.driver-name { font-weight: 600; }

/* completeness widget */
.completeness { display: inline-flex; gap: 4px; }
.comp-box {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid transparent;
}
.comp-box.ok       { background: rgba(34,197,94,0.12); color: #4ade80; border-color: rgba(34,197,94,0.25); }
.comp-box.missing  { background: rgba(252,63,29,0.08); color: #fda4af; border-color: rgba(252,63,29,0.2); }
.completeness.large .comp-box {
  width: auto; padding: 4px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}

.pagination { margin-top: 16px; display: flex; align-items: center; gap: 12px; }

/* ---- review page --------------------------------------------------------- */

.review { max-width: 1640px; margin: 0 auto; }

.review-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  margin-bottom: 16px; padding: 18px 20px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.driver-title { font-size: 26px; }
.driver-meta { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.review-head-right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.review-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1080px) {
  .review-grid { grid-template-columns: 1fr; }
}

/* panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px; gap: 12px;
}
.panel-head h3 { margin: 0; }

/* phones */
.phones { list-style: none; margin: 0; padding: 0; }
.phone-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 8px; border-radius: var(--radius-s);
  margin-bottom: 6px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.phone-row.primary { border-color: var(--primary); background: rgba(252,63,29,0.06); }
.phone-row.denylisted { opacity: 0.5; }
.phone-row.denylisted .phone-text { text-decoration: line-through; }
.star {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 18px; padding: 0; width: 22px;
}
.phone-row.primary .star { color: var(--primary); }
.phone-text {
  outline: none; padding: 2px 4px; border-radius: 4px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.phone-text:focus { background: var(--surface-3); }
.phone-source { font-size: 11px; color: var(--text-dim); }

.add-phone { display: flex; gap: 6px; margin-top: 10px; }
.add-phone input { flex: 1; }

/* TIN */
.big-input { width: 100%; font-size: 15px; padding: 10px 12px; }
.tin-input {
  font-size: 18px; letter-spacing: 0.06em; padding: 12px 14px;
  font-weight: 600;
}
.tin-panel .tin-input:not(:placeholder-shown) {
  border-color: var(--ok);
}

.tin-candidates-wrap { margin-top: 10px; }
.tin-candidates-wrap summary {
  cursor: pointer; padding: 4px 0;
  list-style: none;
}
.tin-candidates-wrap summary::-webkit-details-marker { display: none; }
.tin-candidates-wrap summary::before {
  content: "▸ "; color: var(--primary); font-size: 10px;
}
.tin-candidates-wrap[open] summary::before { content: "▾ "; }

.tin-candidates { list-style: none; margin: 8px 0 0; padding: 0; max-height: 280px; overflow-y: auto; }
.tin-row {
  padding: 8px; margin-bottom: 6px;
  background: var(--surface-2); border-radius: var(--radius-s);
}
.tin-raw { font-size: 12px; color: var(--text-mid); white-space: pre-wrap; word-break: break-word; }
.tin-digits { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.pick-tin { cursor: pointer; }

/* notes */
.notes {
  width: 100%; min-height: 80px; resize: vertical;
  font-family: inherit;
}

/* expected slots */
.expected-slots {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 8px; border-radius: var(--radius-s);
  border: 2px dashed var(--border-2);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.slot:hover { border-color: var(--primary); }
.slot-title { font-weight: 600; text-transform: capitalize; font-size: 13px; }
.slot-status { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.slot.filled { border-style: solid; border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.05); }
.slot.filled .slot-status { color: #4ade80; }
.slot.empty { border-color: rgba(252,63,29,0.3); }
.slot.empty .slot-status { color: var(--primary); }

/* docs grid */
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.doc-card {
  background: var(--surface-2); border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.15s;
}
.doc-card:hover { border-color: var(--border-2); }
.doc-card.rejected { opacity: 0.5; }
.doc-card.duplicate { border-style: dashed; }
.doc-card.missing { opacity: 0.6; }

.doc-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000; display: grid; place-items: center;
  overflow: hidden;
  cursor: zoom-in;
}
.doc-thumb[role="button"]:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.doc-thumb:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.doc-thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; transition: transform 0.2s;
}
.thumb-embed {
  width: 100%; height: 100%;
  pointer-events: none;                /* click falls through to .doc-thumb */
  background: #fff;
}
.thumb-label {
  position: absolute; left: 6px; bottom: 6px; right: 6px;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(0,0,0,0.7); color: var(--primary);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb-file, .thumb-missing {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px; text-align: center; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px;
}
.thumb-ext { color: var(--text); font-size: 20px; letter-spacing: 0; }
.thumb-missing { color: var(--danger); }

.badge {
  position: absolute; top: 6px; left: 6px;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(0,0,0,0.6); color: var(--text);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge.dup { background: rgba(255,219,77,0.2); color: var(--warn); }
.badge.manual { background: rgba(252,63,29,0.2); color: var(--primary); top: auto; bottom: 6px; left: 6px; }
.badge.rejected { background: rgba(225,29,72,0.2); color: #fda4af; right: 6px; left: auto; }

.doc-controls { padding: 10px; display: flex; flex-direction: column; gap: 6px; }

/* kind chips — one-tap tagging (compact on doc cards) */
.kind-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.kind-chip {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 2px;
  border-radius: var(--radius-s);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 9px; text-transform: lowercase; letter-spacing: 0.03em;
  transition: all 0.12s ease;
  cursor: pointer;
  min-height: 40px;
}
.kind-chip:hover {
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-1px);
}
.kind-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.kind-chip.active .chip-letter { color: #fff; }
.chip-letter {
  font-size: 14px; font-weight: 800; line-height: 1;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.chip-label { font-size: 9px; opacity: 0.85; }
.chip-num {
  position: absolute; top: 2px; right: 4px;
  font-size: 8px; opacity: 0.3;
  font-family: ui-monospace, monospace; font-weight: 700;
}
.kind-chip.active .chip-num { opacity: 0.85; }

/* viewer sidebar — big chips (more room, easier to hit) */
.viewer-chips { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.viewer-chips .kind-chip {
  min-height: 84px; padding: 14px 4px; gap: 4px;
  border-width: 2px;
  font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text);
}
.viewer-chips .kind-chip:hover {
  background: rgba(252,63,29,0.08);
  transform: translateY(-2px);
}
.viewer-chips .kind-chip.active {
  box-shadow: 0 0 0 3px var(--primary-glow), 0 4px 14px rgba(252,63,29,0.35);
  transform: translateY(-1px);
}
.viewer-chips .kind-chip .chip-letter { font-size: 28px; font-weight: 900; }
.viewer-chips .kind-chip .chip-label { font-size: 11px; font-weight: 700; opacity: 0.95; }
.viewer-chips .kind-chip .chip-num { font-size: 11px; top: 5px; right: 7px; opacity: 0.4; }
.viewer-chips .kind-chip:hover .chip-num { opacity: 0.7; }
.viewer-chips .kind-chip.active .chip-num { opacity: 0.9; }

.ghost-guess {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-s);
  background: transparent; color: var(--text-dim);
  border: 1px dashed var(--border-2);
  font-size: 11px; text-transform: capitalize;
  cursor: pointer;
  transition: all 0.12s ease;
}
.ghost-guess:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.ghost-guess .suggest-icon { font-weight: 900; }
.ghost-guess .suggest-conf { font-size: 10px; font-weight: 700; opacity: 0.65; }
.ghost-guess.suggested-mid {
  color: var(--text);
  border-style: solid;
  border-color: var(--border);
  background: rgba(252,63,29,0.06);
}
.ghost-guess.suggested-mid:hover {
  background: rgba(252,63,29,0.12);
  border-color: var(--primary);
}
.ghost-guess.suggested-strong {
  color: #fff;
  border: 1px solid var(--primary);
  background: linear-gradient(180deg, rgba(252,63,29,0.22), rgba(252,63,29,0.12));
  box-shadow: 0 0 0 2px rgba(252,63,29,0.12);
  font-weight: 700;
}
.ghost-guess.suggested-strong .suggest-conf { opacity: 0.85; }
.ghost-guess.suggested-strong:hover {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 3px 10px rgba(252,63,29,0.35);
}

/* suggestion mirrored into the fullscreen viewer sidebar */
.viewer-suggest-slot { margin: 2px 0 6px; }
.viewer-suggest-slot.hidden { display: none; }
.viewer-suggest-slot .ghost-guess { width: 100%; justify-content: center; padding: 8px 10px; font-size: 12px; }

/* fleet panel relocated into the viewer sidebar — drop the outer panel
   spacing so it sits cleanly next to the other vs-blocks */
.viewer-fleet-slot .panel { margin-bottom: 0; padding: 12px; }
.viewer-fleet-slot .panel-head { margin-bottom: 8px; }

.bulk-accept {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: none;
  letter-spacing: 0.02em;
}
.bulk-accept:disabled { opacity: 0.5; cursor: default; }

/* Next-driver button disabled look — reviewer must tag all required docs first */
#btn-next:disabled {
  opacity: 0.45; cursor: not-allowed;
  background: var(--surface-3); color: var(--text-dim);
  border-color: var(--border);
}
#btn-next:disabled:hover { background: var(--surface-3); }
.bulk-accept .small { font-weight: 500; opacity: 0.75; }
.doc-actions { display: flex; gap: 4px; }

.card-reject {
  width: 100%; padding: 8px 10px;
  background: transparent; color: #fda4af;
  border: 1px solid rgba(225,29,72,0.35);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.card-reject:hover {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.card-reject.active {
  background: var(--danger); color: #fff; border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(225,29,72,0.3);
}
.doc-caption { max-height: 40px; overflow: hidden; }

/* messages */
.messages-panel summary { list-style: none; cursor: pointer; }
.messages-panel summary::-webkit-details-marker { display: none; }
.messages { list-style: none; margin: 12px 0 0; padding: 0; max-height: 400px; overflow-y: auto; }
.msg {
  padding: 6px 10px; border-left: 3px solid var(--border);
  margin-bottom: 4px; background: var(--surface-2); border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 13px;
}
.msg-driver { border-left-color: var(--primary); }
.msg-support { border-left-color: var(--border-2); }
.msg-text { white-space: pre-wrap; word-break: break-word; margin-left: 8px; }

/* fullscreen viewer */
.viewer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.95);
  display: flex; flex-direction: column;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.viewer.hidden { display: none; }
.viewer-head {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.viewer-title {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  color: var(--text-dim);
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.viewer-zoom-group {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-s);
  background: rgba(0,0,0,0.3);
  overflow: hidden;
  margin-right: 4px;
}
.viewer-zoom-group .icon-btn {
  padding: 4px 10px; min-width: 36px;
  border: none; background: transparent;
  font-size: 14px; font-weight: 700;
  border-radius: 0;
}
.viewer-zoom-group .viewer-zoom-reset {
  min-width: 56px; font-size: 11px; font-weight: 600;
  border-left:  1px solid var(--border);
  border-right: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.viewer-zoom-group .icon-btn:hover:not(:disabled)   { background: rgba(255,255,255,0.08); }
.viewer-zoom-group .icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.viewer-driver-nav {
  display: flex; gap: 8px; justify-content: center;
  padding: 4px 10px; border-radius: var(--radius);
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
}
.viewer-driver-nav .btn { padding: 6px 14px; }
@media (max-width: 900px) {
  .viewer-head { grid-template-columns: 1fr; gap: 8px; }
  .viewer-actions, .viewer-nav { justify-content: center; }
}
.viewer-nav { display: flex; align-items: center; gap: 8px; }
.viewer-pos { min-width: 52px; text-align: center; }
.viewer-main {
  flex: 1; display: grid; grid-template-columns: 1fr 340px;
  min-height: 0;
}
@media (max-width: 900px) {
  .viewer-main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}
.viewer-body {
  display: grid; place-items: center;
  padding: 16px; overflow: auto; min-height: 0;
}
.viewer-body img {
  max-width: calc(100vw - 380px); max-height: calc(100vh - 80px);
  object-fit: contain; user-select: none;
  transform-origin: center center;
  transition: transform 80ms linear;
  cursor: zoom-in;
  touch-action: none; /* let pointermove pan even on touch */
}
.viewer-body { touch-action: none; }
.viewer-body iframe, .viewer-body embed {
  width: calc(100vw - 380px); height: calc(100vh - 80px);
  border: none; background: #fff; border-radius: var(--radius-s);
}
.viewer-body .viewer-fallback {
  color: var(--text-dim); text-align: center; padding: 40px;
}
.viewer-side {
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.vs-block { display: flex; flex-direction: column; gap: 8px; }
.vs-h {
  margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 600;
}
.vs-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); margin-top: 6px;
}
.vs-row { display: flex; gap: 6px; }
.vs-row .btn { flex: 1; }
.viewer-chips { grid-template-columns: repeat(5, 1fr); }
.viewer-phones { list-style: none; margin: 0; padding: 0; }
.viewer-phones .phone-row { margin-bottom: 6px; }
.viewer-notes { min-height: 60px; }

/* drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(252,63,29,0.08);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  pointer-events: none;
}
.drop-card {
  padding: 40px 60px; border-radius: var(--radius-l);
  background: var(--primary); color: #fff;
  font-size: 20px; font-weight: 700;
  box-shadow: var(--shadow);
}

/* action bar */
.action-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 14px 24px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.bar-left { display: flex; align-items: center; gap: 12px; }
.bar-actions { display: flex; gap: 10px; }
.bar-actions .btn { padding: 10px 22px; font-size: 14px; }
.bar-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }

/* toast */
.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
  z-index: 110;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error   { border-color: var(--danger); color: #fda4af; }
.toast .undo-btn {
  background: transparent; border: 1px solid var(--border-2);
  color: var(--primary); padding: 4px 10px; border-radius: var(--radius-s);
  font-weight: 600;
}
.toast .undo-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* save indicator */
.save-flash {
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  opacity: 0; transition: opacity 0.15s;
}
.save-flash.on { opacity: 1; }


/* ---- scrollbars ---------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- fleet suggestions --------------------------------------------------- */
.fleet-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 1px 5px; border-radius: 3px; margin-right: 4px;
}
.fleet-name-hint {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin-top: 4px;
}
.fleet-name-chip {
  font-size: 0.82rem; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 7px;
  cursor: default;
}
.fleet-tin-hint {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.fleet-conflict { border-color: var(--primary) !important; }
.fleet-conflict-note {
  font-size: 0.7rem; color: var(--primary); font-style: italic;
  align-self: center;
}
.queue-fleet-names {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin-top: 3px;
}
