:root {
  --ink: #17211b;
  --muted: #637069;
  --paper: #fbfcfa;
  --surface: #fff;
  --line: #dce3de;
  --accent: #176b4a;
  --accent-dark: #0f5037;
  --accent-soft: #e6f3ec;
  --warn: #8a5b00;
  --warn-soft: #fff4d6;
  --danger: #a5342d;
  --danger-soft: #fbe9e7;
  --focus: #1267a8;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, select { min-height: 44px; }
input, select, textarea { width: 100%; border: 1px solid #b9c5bd; border-radius: 7px; padding: 10px 12px; color: var(--ink); background: var(--surface); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 2px; border-color: var(--focus); }
label { display: block; font-weight: 650; font-size: .875rem; margin-bottom: 6px; }
small, .optional { color: var(--muted); font-weight: 400; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 10px 14px; background: var(--ink); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.cab-shell { min-height: 100vh; }
.cab-header { height: 68px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; align-items: center; justify-content: space-between; padding: 0 max(20px, calc((100vw - 1180px)/2)); position: sticky; top: 0; z-index: 3; }
.cab-brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; }
.cab-brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 800; }
.cab-brand span:last-child { display: grid; line-height: 1.15; }
.cab-brand small { font-size: .72rem; letter-spacing: .04em; }
.cab-user { display: flex; gap: 12px; align-items: center; }
.cab-main { max-width: 1180px; margin: 0 auto; padding: 44px 20px 80px; }
.auth-panel { max-width: 620px; margin: 8vh auto; padding: 34px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); }
h1, h2 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1; }
h2 { font-size: 1.4rem; }
.auth-panel > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; line-height: 1.6; max-width: 55ch; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 10px; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 8px; }
.button { border: 1px solid transparent; border-radius: 7px; padding: 9px 15px; font-weight: 700; cursor: pointer; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: var(--surface); color: var(--ink); border-color: #acb9b0; }
.button-secondary:hover, .button-quiet:hover { background: #f0f4f1; }
.button-quiet { background: transparent; color: var(--ink); border-color: transparent; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.workspace-head > div { min-width: 0; }
.lede { color: var(--muted); margin: 10px 0 0; font-size: 1rem; }
.filters { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(170px, .8fr) minmax(220px, 1.4fr) auto; gap: 14px; align-items: end; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.status-line { min-height: 40px; display: flex; align-items: center; color: var(--muted); }
.lead-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.lead-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(140px, .8fr) minmax(130px, .7fr) minmax(150px, .8fr) auto; gap: 18px; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 17px 18px; text-align: left; color: var(--ink); background: var(--surface); cursor: pointer; min-height: 76px; }
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { background: #f7faf8; }
.lead-name { font-weight: 750; }
.lead-meta { color: var(--muted); font-size: .82rem; display: block; margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .77rem; font-weight: 750; background: #eef1ef; color: #4f5b54; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-issued { background: var(--accent-soft); color: var(--accent-dark); }
.status-dispute_submitted, .status-review { background: var(--warn-soft); color: var(--warn); }
.status-replacement_rejected { background: var(--danger-soft); color: var(--danger); }
.lead-arrow { color: var(--muted); font-size: 1.3rem; }
.empty-state { padding: 64px 24px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 6px; }
dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 28px); border: 1px solid var(--line); border-radius: 12px; padding: 0; color: var(--ink); box-shadow: 0 24px 70px rgba(22,35,27,.24); }
dialog::backdrop { background: rgba(23,33,27,.48); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 44px; height: 44px; font-size: 1.7rem; cursor: pointer; }
#lead-detail, #dispute-form { padding: 24px; }
#dispute-form .dialog-head { margin: -24px -24px 22px; }
#dispute-form > label:not(.check-row) { margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-item { padding-bottom: 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-item dt { color: var(--muted); font-size: .78rem; margin-bottom: 5px; }
.detail-item dd { margin: 0; font-weight: 650; }
.detail-wide { grid-column: 1 / -1; }
.detail-actions, .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.check-row { display: flex; gap: 10px; align-items: start; margin-top: 18px; font-weight: 500; }
.check-row input { width: 20px; height: 20px; flex: none; }
.form-error { color: var(--danger); min-height: 22px; margin: 8px 0 0; }
@media (max-width: 760px) {
  .cab-header { padding: 0 14px; }
  .cab-user > span { display: none; }
  .cab-main { padding: 28px 14px 64px; }
  .auth-panel { padding: 24px 18px; }
  .token-row, .filters { grid-template-columns: 1fr; }
  .workspace-head { align-items: start; flex-direction: column; }
  .lead-list { border: 0; background: transparent; display: grid; gap: 10px; }
  .lead-row { grid-template-columns: 1fr auto; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
  .lead-row > :nth-child(2), .lead-row > :nth-child(3) { grid-column: 1; }
  .lead-row > :nth-child(4) { grid-column: 1; }
  .lead-arrow { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
