@font-face {
  font-family: "Barlow Condensed Dispatch";
  src: url("/fonts/barlow-condensed-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --void: #07070a;
  --obsidian: #0b0b10;
  --sunken: #0d0d13;
  --panel: #141420;
  --panel-high: #1d1d2a;
  --hair: #2e2e3b;
  --gold-line: #5c4d2e;
  --gold: #d4af37;
  --gold-light: #f0e0ac;
  --text: #f4f1ea;
  --dim: #bcb7ac;
  --muted: #948f86;
  --success: #6fd9ac;
  --error: #f07a84;
  --warning: #f0b45c;
  --steel: #8e99ac;
  --radius-control: 8px;
  --radius-panel: 4px;
  --shadow-panel: inset 0 0 0 3px #101018, 0 10px 28px rgba(0, 0, 0, 0.26);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { background: var(--void); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }

button, summary, select, input[type="file"] { cursor: pointer; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
.file-button:focus-within,
.table-wrap:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.login-panel h1,
.section-heading h1,
.section-heading h2,
.ledger-toolbar h2 {
  margin: 0;
  font-family: "Barlow Condensed Dispatch", "Arial Narrow", sans-serif;
  font-stretch: condensed;
  text-transform: uppercase;
  letter-spacing: 0.065em;
  line-height: 1;
}

.login-panel h1 { margin-top: 24px; font-size: 2.4rem; }
.login-panel p { color: var(--dim); }
.login-panel .button { width: 100%; margin-top: 10px; }

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  transform: skewY(-8deg);
}

.brand-mark span { background: var(--gold); border-radius: 1px; }
.brand-mark span:nth-child(2) { transform: translateY(7px); }
.brand-mark span:nth-child(3) { transform: translateY(14px); }
.brand-mark-small { width: 27px; height: 27px; gap: 3px; }
.brand-mark-small span:nth-child(2) { transform: translateY(4px); }
.brand-mark-small span:nth-child(3) { transform: translateY(8px); }

.topbar {
  min-height: 66px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--obsidian);
  border-bottom: 1px solid var(--hair);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  font-family: "Barlow Condensed Dispatch", "Arial Narrow", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.topbar-status { display: flex; align-items: center; gap: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.transport-badge { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 3px 10px rgba(111, 217, 172, 0.35); }
.transport-badge.offline .signal-dot { background: var(--error); box-shadow: none; }

.workspace {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: 8px;
}

.intake-panel,
.fleet-section,
.ledger-section {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.intake-panel { padding: 20px; align-self: start; position: sticky; top: 86px; }
.operations { min-width: 0; display: grid; align-content: start; gap: 8px; }
.dashboard-view { min-width: 0; display: grid; gap: 8px; }
.fleet-section { padding: 18px; }
.ledger-section { overflow: hidden; }

.view-tabs { min-height: 48px; display: flex; align-items: end; gap: 3px; padding: 5px 6px 0; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); }
.view-tab { min-height: 40px; padding: 8px 16px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 0.76rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.view-tab:hover { color: var(--text); background: var(--panel-high); }
.view-tab.is-active { color: var(--gold-light); border-bottom-color: var(--gold); }
.view-tab:focus-visible { outline: 3px solid var(--gold-light); outline-offset: -3px; }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--hair); margin-bottom: 18px; }
.section-heading h1, .section-heading h2, .ledger-toolbar h2 { font-size: 1.25rem; }
.section-heading-inline { align-items: center; }
.section-heading-inline > div { display: grid; gap: 5px; }
.section-index { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

label, .label-row {
  display: block;
  margin-bottom: 7px;
  color: var(--dim);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.label-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.label-row label { margin: 0; }
.label-row span { color: var(--muted); font-variant-numeric: tabular-nums; }

input, textarea, select {
  width: 100%;
  color: var(--text);
  background: var(--sunken);
  border: 1px solid var(--hair);
  border-radius: var(--radius-control);
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}

input, select { min-height: 44px; padding: 9px 12px; }
textarea { min-height: 250px; padding: 12px; resize: vertical; font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: #807b73; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); background: #101018; }
input[readonly] { color: var(--dim); }
input:disabled, textarea:disabled { cursor: not-allowed; color: #706c65; background: #0a0a0f; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 15px;
  color: var(--text);
  background: var(--panel-high);
  border: 1px solid var(--hair);
  border-radius: var(--radius-control);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

.button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button:hover:not(:disabled) { transform: translateY(-1px); background: #242433; border-color: #45455a; }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; color: #6f6b64; background: #101016; border-color: #24242d; }
.button-primary { color: var(--void); background: var(--gold); border-color: var(--gold); }
.button-primary:hover:not(:disabled) { color: #000; background: var(--gold-light); border-color: var(--gold-light); }
.button-secondary { background: var(--sunken); }
.button-danger { color: var(--error); background: var(--sunken); border-color: #71333a; }
.button-danger:hover:not(:disabled) { color: #ffd9dc; background: #27151b; border-color: var(--error); }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-wide { width: 100%; margin-top: 8px; min-height: 50px; }

.intake-actions { display: flex; gap: 8px; margin: 10px 0 16px; }
.file-button { flex: 1; margin: 0; }
.workbook-ready { min-width: 0; margin: -7px 0 10px; padding: 9px 11px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--dim); background: var(--sunken); border: 1px solid var(--gold-line); border-radius: var(--radius-control); }
.workbook-ready strong { flex: 0 0 auto; color: var(--gold-light); font-size: 0.72rem; letter-spacing: 0.055em; text-transform: uppercase; }
.workbook-ready span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.76rem; }
.file-hint { margin: -2px 0 13px; color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.validation-board { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin-bottom: 8px; }
.validation-board > div { min-height: 38px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #242430; }
.validation-board > div:last-child { border-bottom: 0; }
.validation-board span { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.055em; }
.validation-board strong { font-variant-numeric: tabular-nums; font-size: 1rem; }
.field-error { min-height: 22px; margin: 5px 0; color: var(--error) !important; font-size: 0.82rem; }

.setup-panel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hair); }
.setup-panel summary { color: var(--gold-light); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }
.setup-panel p { color: var(--dim); font-size: 0.86rem; }
.setup-panel label { margin-top: 12px; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.copy-button { min-width: 58px; color: var(--gold-light); background: var(--sunken); border: 1px solid var(--gold-line); border-radius: var(--radius-control); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.copy-button:hover { background: var(--panel-high); }
.security-note { padding: 10px; border: 1px solid var(--gold-line); border-radius: var(--radius-control); }

.fleet-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); border: 1px solid var(--hair); box-shadow: inset 0 0 0 3px #08080d; }
.device-lane { min-width: 0; min-height: 132px; padding: 13px; border-right: 1px solid var(--hair); background: var(--sunken); position: relative; overflow: hidden; }
.device-lane::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #242430; box-shadow: 0 1px 0 #08080d; pointer-events: none; }
.device-lane > * { position: relative; z-index: 1; }
.device-lane:last-child { border-right: 0; }
.device-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.device-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.device-state { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.69rem; font-weight: 800; text-transform: uppercase; }
.device-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--steel); }
.device-state.online::before { background: var(--success); }
.device-state.running::before { background: var(--gold); animation: signal-pulse 1.5s ease-in-out infinite; }
.device-state.paused { color: var(--warning); }
.device-state.paused::before { background: var(--warning); }
.device-state.offline::before { background: var(--error); }
.device-job { margin-top: 20px; min-height: 26px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 1.02rem; font-variant-numeric: tabular-nums; letter-spacing: 0.035em; }
.device-meta { margin-top: 7px; color: var(--muted); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.device-action { min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--hair); border-radius: 8px; background: var(--panel); color: var(--text); font: 750 0.72rem/1 "Segoe UI", Arial, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }
.device-action:hover { border-color: var(--gold-line); background: var(--panel-high); }
.device-action:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.device-action:disabled { cursor: wait; opacity: 0.55; }
.device-action-remove { color: var(--error); }
.fleet-empty { grid-column: 1 / -1; padding: 26px; color: var(--muted); text-align: center; }

@keyframes signal-pulse {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.35); opacity: 1; }
}

.count-strip { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); border-bottom: 1px solid var(--hair); background: var(--sunken); }
.count-strip > div { min-height: 76px; padding: 12px 15px; border-right: 1px solid var(--hair); display: grid; align-content: center; gap: 2px; position: relative; overflow: hidden; }
.count-strip > div::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #20202b; box-shadow: 0 1px 0 #08080d; pointer-events: none; }
.count-strip > div > * { position: relative; z-index: 1; }
.count-strip > div:last-child { border-right: 0; }
.count-strip span { color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.count-strip strong { font-family: "Barlow Condensed Dispatch", "Arial Narrow", sans-serif; font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: 0.035em; }
.count-normal strong { color: var(--success); }
.count-freeze strong { color: var(--error); }
.count-warning strong { color: var(--warning); }

.ledger-toolbar { min-height: 74px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--hair); }
.ledger-toolbar > div:first-child { display: grid; gap: 5px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.search-field { width: min(260px, 30vw); margin: 0; position: relative; }
.search-field svg { position: absolute; left: 11px; top: 12px; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-field input { padding-left: 38px; }
.toolbar-actions select { width: 168px; }

.table-wrap { min-height: 390px; max-height: calc(100vh - 395px); overflow: auto; background: var(--sunken); box-shadow: inset 0 0 0 3px #08080d; }
.ledger-table, .report-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.ledger-table th, .report-table th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; color: var(--muted); background: #101016; border-bottom: 1px solid var(--hair); border-right: 1px solid #242430; text-align: left; font-size: 0.68rem; letter-spacing: 0.075em; text-transform: uppercase; }
.ledger-table td, .report-table td { height: 48px; padding: 8px 12px; border-bottom: 1px solid #242430; border-right: 1px solid #20202b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-table th:last-child, .ledger-table td:last-child, .report-table th:last-child, .report-table td:last-child { border-right: 0; }
.ledger-table tbody tr, .report-table tbody tr { transition: background-color 180ms var(--ease); }
.ledger-table tbody tr:hover, .report-table tbody tr:hover { background: #171721; }
.ledger-table tbody tr.row-new { animation: row-arrive 360ms var(--ease); }
@keyframes row-arrive { from { background: rgba(212, 175, 55, 0.16); } to { background: transparent; } }
.ledger-table th:nth-child(1), .ledger-table td:nth-child(1) { width: 65px; }
.ledger-table th:nth-child(2), .ledger-table td:nth-child(2) { width: 142px; }
.ledger-table th:nth-child(3), .ledger-table td:nth-child(3) { width: 130px; }
.ledger-table th:nth-child(4), .ledger-table td:nth-child(4) { width: 138px; }
.ledger-table th:nth-child(5), .ledger-table td:nth-child(5) { width: 76px; text-align: center; }
.ledger-table th:nth-child(6), .ledger-table td:nth-child(6) { width: 90px; }
.job-phone { font-family: "Cascadia Mono", Consolas, monospace; letter-spacing: 0.02em; }
.job-id { color: var(--muted); }
.job-detail { color: var(--dim); }
.status-chip { display: inline-flex; align-items: center; min-height: 27px; padding: 3px 7px; border: 1px solid var(--hair); border-radius: 5px; font-size: 0.7rem; font-weight: 850; letter-spacing: 0.055em; text-transform: uppercase; }
.status-normal { color: var(--success); border-color: #2d7056; }
.status-freeze { color: var(--error); border-color: #71333a; }
.status-running { color: var(--gold-light); border-color: var(--gold-line); }
.status-queued { color: var(--dim); }
.status-not_registered, .status-error, .status-timeout { color: var(--warning); border-color: #74562d; }
.ledger-empty { min-height: 330px; display: grid; place-content: center; gap: 5px; text-align: center; color: var(--muted); }
.ledger-empty strong { color: var(--dim); font-size: 1.05rem; }
.ledger-actions { min-height: 66px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--hair); }
.ledger-actions #logout-button { margin-left: auto; }

.report-section { min-width: 0; overflow: hidden; padding: 18px; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); }
.section-heading-inline > .report-filter-controls { display: flex; gap: 8px; align-items: center; }
.report-filter-controls .button { min-height: 38px; padding: 8px 12px; }
.report-filter-note { margin: -8px 0 12px; color: var(--muted); font-size: 0.8rem; }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); margin-bottom: 8px; border: 1px solid var(--hair); background: var(--sunken); }
.report-kpis > div { min-height: 96px; padding: 15px; display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--hair); }
.report-kpis > div:last-child { border-right: 0; }
.report-kpis span { color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.075em; text-transform: uppercase; }
.report-kpis strong { overflow: hidden; color: var(--text); font-family: "Barlow Condensed Dispatch", "Arial Narrow", sans-serif; font-size: clamp(1.45rem, 2.5vw, 2.2rem); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.report-kpis .report-kpi-freeze strong, .report-freeze-value { color: var(--error); }
.report-table-wrap { min-height: 360px; max-height: calc(100vh - 310px); overflow: auto; background: var(--sunken); box-shadow: inset 0 0 0 3px #08080d; position: relative; }
.report-table th:nth-child(1), .report-table td:nth-child(1) { width: 64px; text-align: center; }
.report-table th:nth-child(2), .report-table td:nth-child(2) { width: 28%; text-align: left; }
.report-table th:nth-child(3), .report-table td:nth-child(3),
.report-table th:nth-child(4), .report-table td:nth-child(4),
.report-table th:nth-child(5), .report-table td:nth-child(5) { text-align: right; }
.report-table th:nth-child(6), .report-table td:nth-child(6) { width: 158px; text-align: center; }
.report-checkbox { width: 18px; min-height: 18px; margin: 0; accent-color: var(--gold); }
.report-batch-name { color: var(--text); font-weight: 750; }
.report-balance { color: var(--gold-light); font-family: "Cascadia Mono", Consolas, monospace; }
.report-actions { display: flex; justify-content: center; gap: 6px; }
.report-action { min-height: 34px; padding: 6px 9px; color: var(--gold-light); background: var(--panel); border: 1px solid var(--hair); border-radius: 6px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.report-action:hover:not(:disabled) { background: var(--panel-high); border-color: var(--gold-line); }
.report-action:disabled { cursor: wait; opacity: 0.55; }
.report-action-cancel { color: var(--error); border-color: #71333a; }
.report-action-cancel:hover:not(:disabled) { color: #ffd9dc; background: #27151b; border-color: var(--error); }
.report-empty { min-height: 300px; display: grid; place-content: center; gap: 5px; color: var(--muted); text-align: center; }
.report-empty strong { color: var(--dim); font-size: 1.05rem; }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 13px 16px; color: var(--text); background: #20202c; border: 1px solid var(--hair); border-radius: var(--radius-control); box-shadow: var(--shadow-panel); z-index: 50; }
.toast.error { border-color: #71333a; color: #ffd9dc; }
.toast.success { border-color: #2d7056; color: #c9f5e2; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr); padding: 14px; }
  .count-strip { grid-template-columns: repeat(3, 1fr); }
  .count-strip > div:nth-child(3) { border-right: 0; }
  .count-strip > div:nth-child(-n + 3) { border-bottom: 1px solid var(--hair); }
  .fleet-list { grid-template-columns: repeat(3, 1fr); }
  .device-lane:nth-child(3) { border-right: 0; }
  .device-lane:nth-child(-n + 3) { border-bottom: 1px solid var(--hair); }
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-kpis > div:nth-child(2) { border-right: 0; }
  .report-kpis > div:nth-child(-n + 2) { border-bottom: 1px solid var(--hair); }
}

@media (max-width: 820px) {
  .topbar { position: static; padding: 0 14px; }
  .transport-badge { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .intake-panel { position: static; }
  textarea { min-height: 180px; }
  .table-wrap { max-height: none; }
  .toolbar-actions { width: 100%; }
  .ledger-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .toolbar-actions select { width: 150px; }
  .report-section .section-heading-inline { align-items: stretch; flex-direction: column; }
  .section-heading-inline > .report-filter-controls { width: 100%; }
  .report-filter-controls .button { flex: 1; }
}

@media (max-width: 620px) {
  .brand { font-size: 1rem; }
  .workspace { padding: 8px; }
  .intake-panel, .fleet-section { padding: 14px; }
  .fleet-list { grid-template-columns: 1fr; }
  .device-lane { border-right: 0; border-bottom: 1px solid var(--hair); min-height: 104px; }
  .device-lane:last-child { border-bottom: 0; }
  .count-strip { grid-template-columns: repeat(2, 1fr); }
  .count-strip > div { border-bottom: 1px solid var(--hair); }
  .count-strip > div:nth-child(2n) { border-right: 0; }
  .count-strip > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr; }
  .toolbar-actions .button { width: 100%; }
  .toolbar-actions select { width: 100%; }
  .ledger-actions { align-items: stretch; flex-direction: column; }
  .ledger-actions #logout-button { margin-left: 0; }

  .ledger-table, .ledger-table thead, .ledger-table tbody, .ledger-table tr, .ledger-table th, .ledger-table td { display: block; }
  .ledger-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .ledger-table tbody { padding: 5px 8px; }
  .ledger-table tbody tr {
    display: grid;
    grid-template-columns: 34px minmax(90px, 1.1fr) minmax(62px, 0.75fr) 38px minmax(56px, 0.65fr);
    grid-template-areas:
      "job phone status status elapsed"
      "device device attempt detail detail";
    column-gap: 4px;
    margin: 0;
    padding: 3px 4px;
    border-bottom: 1px solid var(--hair);
    background: #101016;
  }
  .ledger-table tbody tr:last-child { border-bottom: 0; }
  .ledger-table td, .ledger-table td:nth-child(n) {
    width: auto;
    min-width: 0;
    min-height: 38px;
    height: auto;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    border: 0;
    white-space: nowrap;
    text-align: left;
    font-size: 0.72rem;
  }
  .ledger-table td:nth-child(1) { grid-area: job; }
  .ledger-table td:nth-child(2) { grid-area: phone; }
  .ledger-table td:nth-child(3) { grid-area: device; }
  .ledger-table td:nth-child(4) { grid-area: status; }
  .ledger-table td:nth-child(5) { grid-area: attempt; }
  .ledger-table td:nth-child(6) { grid-area: elapsed; }
  .ledger-table td:nth-child(7) { grid-area: detail; }
  .ledger-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.52rem; line-height: 1; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }
  .status-chip { min-height: 20px; padding: 1px 5px; font-size: 0.58rem; }
  .report-section { padding: 14px; }
  .report-table { min-width: 780px; }
}

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