/* Truck On · Fuel & IFTA — matches HOS logger tokens */

:root {
  --navy: #0B355C;
  --navy-2: #0A2B49;
  --sky: #3E9EE0;
  --sky-2: #5FB3EE;
  --cream: #FBFAF6;
  --cream-2: #F3EFE5;
  --line: #E4DFD1;
  --line-2: #D9D2BE;
  --ink: #16233A;
  --ink-2: #4C5A70;
  --ink-3: #7B8798;
  --white: #FFFFFF;
  --danger: #B42318;
  --warn: #B45309;
  --good: #157F3A;
  --shadow-sm: 0 1px 2px rgba(11,53,92,0.06);
  --shadow-md: 0 4px 14px rgba(11,53,92,0.10);
  --shadow-lg: 0 12px 28px rgba(11,53,92,0.16);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #F0EDDF 0%, #E7E0CB 100%);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7.woff2') format('woff2'); }

.phone-shell {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-lg);
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 12px;
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.icon-btn {
  background: transparent;
  border: none;
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 120ms;
}
.icon-btn:hover, .icon-btn:focus-visible {
  background: rgba(255,255,255,0.15);
  outline: none;
}
.icon-btn[hidden] { display: none; }
.top-bar-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.top-bar-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--sky-2);
}
.top-bar-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Screen */
.screen {
  flex: 1;
  padding: 16px 14px 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--cream);
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  box-shadow: 0 -2px 10px rgba(11,53,92,0.06);
}
.action-bar[hidden] { display: none; }
.action-bar .btn { flex: 1; }
.action-bar .btn[hidden] { display: none; }
#action-primary[hidden], #action-secondary[hidden] { display: none; }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 100ms, box-shadow 120ms, background 120ms, color 120ms;
  letter-spacing: 0.01em;
  min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--navy-2);
  box-shadow: var(--shadow-md);
  outline: none;
}
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line-2);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--cream-2);
  outline: none;
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(180,35,24,0.35);
}
.btn-danger:hover { background: rgba(180,35,24,0.06); }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 34px; border-radius: 8px; }
.btn-block { display: block; width: 100%; }

/* Hero card (quarter picker + KPIs) */
.hero-card {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}
.hero-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sky-2);
  margin-bottom: 8px;
}
.quarter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.quarter-nav-btn {
  background: rgba(255,255,255,0.10);
  border: none;
  color: var(--white);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background 120ms;
}
.quarter-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.20); }
.quarter-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.quarter-nav-label {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.quarter-nav-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--sky-2);
  margin-top: 2px;
  opacity: 0.85;
}
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
}
.kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sky-2);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}
.kpi-owed .kpi-value.negative { color: var(--sky-2); }
.kpi-owed .kpi-value.positive { color: #FFB3AB; }

/* CTA card row */
.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.cta-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  font-family: inherit;
}
.cta-card:hover, .cta-card:focus-visible {
  border-color: var(--sky);
  box-shadow: var(--shadow-md);
  outline: none;
  transform: translateY(-1px);
}
.cta-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--cream-2);
  display: grid;
  place-items: center;
  color: var(--navy);
}
.cta-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.cta-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.35;
}

.cta-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
  color: var(--ink);
  font-family: inherit;
  width: 100%;
  margin-bottom: 10px;
}
.cta-block:hover { border-color: var(--sky); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cta-block .cta-icon { flex: none; }
.cta-block .cta-body { flex: 1; }
.cta-block .cta-arrow { flex: none; color: var(--ink-3); }

/* Section headings */
.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 18px 4px 8px;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.card-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
  margin-bottom: 10px;
}
.card p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.card p:last-child { margin-bottom: 0; }
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.field-row .field { margin-bottom: 0; }
.field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.field-label .req { color: var(--danger); margin-left: 2px; }
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="tel"],
textarea,
select {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  min-height: 44px;
  min-width: 0;
  width: 100%;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
input[type="date"],
input[type="datetime-local"] {
  font-size: 14px;
  padding: 12px 10px;
}
textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.4;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(62,158,224,0.18);
}
.field-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.35;
  margin-top: 2px;
}
.field-error {
  font-size: 11.5px;
  color: var(--danger);
  margin-top: 2px;
}

/* File upload zone */
.file-drop {
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  background: var(--cream);
}
.file-drop:hover {
  border-color: var(--sky);
  background: var(--cream-2);
}
.file-drop.has-file {
  padding: 10px;
  border-style: solid;
  background: var(--white);
}
.file-drop-icon {
  color: var(--navy);
  margin-bottom: 6px;
}
.file-drop-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
}
.file-drop-hint {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}
.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: pointer;
}
.file-info { flex: 1; min-width: 0; }
.file-info-name { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info-status { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.file-remove {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--danger);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* OCR status */
.ocr-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(62,158,224,0.10);
  border: 1px solid rgba(62,158,224,0.30);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--navy);
  margin-bottom: 12px;
}
.ocr-status .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--sky);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
.ocr-status .checkmark {
  color: var(--good);
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ocr-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(62,158,224,0.06);
  border-radius: 6px;
}
.ocr-hint strong { color: var(--navy); }

/* Log list */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms;
}
.log-item:hover {
  border-color: var(--sky);
  box-shadow: var(--shadow-sm);
}
.log-item-state {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.log-item-state.non-ifta { background: var(--ink-3); }
.log-item-state.surcharge { background: var(--warn); }
.log-item-body { min-width: 0; }
.log-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.log-item-sub {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.log-item-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  font-feature-settings: 'tnum' 1;
  text-align: right;
}
.log-item-amount-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.log-item .paperclip {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
  color: var(--sky);
}

/* Empty state */
.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-3);
}
.empty-icon { color: var(--line-2); margin-bottom: 8px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.empty-sub { font-size: 12.5px; line-height: 1.45; margin-bottom: 12px; }

/* Report table */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.report-table thead {
  background: var(--cream-2);
}
.report-table th {
  text-align: left;
  padding: 8px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
.report-table th.num, .report-table td.num { text-align: right; }
.report-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.report-table tr.surcharge-row {
  background: rgba(180,83,9,0.04);
}
.report-table tr.surcharge-row td {
  font-style: italic;
  color: var(--warn);
  font-size: 11.5px;
}
.report-table tfoot td {
  padding: 10px 6px;
  font-weight: 700;
  border-top: 2px solid var(--navy);
  border-bottom: none;
  color: var(--navy);
  font-size: 13px;
}
.report-table td.pos { color: var(--danger); font-weight: 600; }
.report-table td.neg { color: var(--good); font-weight: 600; }
.report-table td.zero { color: var(--ink-3); }
.report-table .state-name { font-weight: 500; }
.report-table .state-code { color: var(--ink-3); font-size: 11px; margin-left: 2px; }

.table-wrap { overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px; }

/* Miles input modes */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--cream-2);
  border-radius: 10px;
  margin-bottom: 14px;
}
.mode-tab {
  background: transparent;
  border: none;
  padding: 9px 4px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  border-radius: 7px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  text-align: center;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.mode-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.mode-hint {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 8px;
  margin-bottom: 14px;
}

/* State miles list */
.state-miles-list {
  display: grid;
  gap: 8px;
}
.state-miles-row {
  display: grid;
  grid-template-columns: 46px 1fr 100px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.state-miles-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.state-miles-name {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.state-miles-row input {
  padding: 8px 10px;
  min-height: 36px;
  font-size: 14px;
  text-align: right;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,53,92,0.55);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 150ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--cream);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.modal-close {
  background: transparent;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--cream-2); color: var(--ink); }
.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-body pre {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  background: var(--white);
}
.modal-footer .btn { flex: 1; }

/* Image lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(11,35,58,0.95);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  text-align: center;
  animation: toast-in 200ms ease;
}
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Chips / badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--cream-2);
  color: var(--ink-2);
}
.chip.warn { background: rgba(180,83,9,0.12); color: var(--warn); }
.chip.good { background: rgba(21,127,58,0.10); color: var(--good); }
.chip.info { background: rgba(62,158,224,0.14); color: var(--navy); }

/* Callout */
.callout {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(62,158,224,0.08);
  border-left: 3px solid var(--sky);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.45;
}
.callout.warn { background: rgba(180,83,9,0.08); border-left-color: var(--warn); }
.callout.danger { background: rgba(180,35,24,0.08); border-left-color: var(--danger); }
.callout-icon { flex: none; color: var(--sky); }
.callout.warn .callout-icon { color: var(--warn); }
.callout.danger .callout-icon { color: var(--danger); }

/* Divider */
.divider {
  height: 1px;
  background: var(--line);
  margin: 14px -14px;
}

/* Print styles */
@media print {
  body { background: white; margin: 0; }
  .phone-shell { max-width: 100%; box-shadow: none; }
  .top-bar, .action-bar, #settings-btn, #back-btn, .cta-row, .card-actions, .modal-overlay { display: none !important; }
  .screen { overflow: visible; padding: 24px 32px; }
  .hero-card { background: white; color: var(--navy); border: 2px solid var(--navy); }
  .hero-card * { color: var(--navy) !important; }
  .kpi { background: white; border-color: var(--line); }
  .card { box-shadow: none; border-color: var(--line); page-break-inside: avoid; }
  .report-table { font-size: 11px; }
  .report-table thead { background: var(--cream-2); }
}

/* Filing due banner (inside hero card) */
.filing-due {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-block;
  color: white;
}
.filing-due.due-overdue { background: rgba(220, 90, 90, 0.35); border: 1px solid rgba(255,180,180,0.45); }
.filing-due.due-soon { background: rgba(240, 180, 60, 0.32); border: 1px solid rgba(255,220,140,0.5); }
.filing-due.due-upcoming { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); }
.filing-due.due-far { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.75); }

/* Cross-tool sanity card */
.cross-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 8px;
}
.cross-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.cross-row:last-child { border-bottom: none; }
.cross-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(62,158,224,0.12);
  color: var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cross-body { flex: 1; min-width: 0; }
.cross-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cross-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cross-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  flex: none;
}
.cross-badge.match { background: rgba(34,139,34,0.12); color: var(--good); }
.cross-badge.close { background: rgba(240,180,40,0.15); color: var(--warn); }
.cross-badge.diff { background: rgba(180,35,24,0.10); color: var(--danger); }

/* Additions for Rate load allocation modal */
.modal-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; margin-bottom: 4px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ==== Expenses & Receipts additions ==== */

/* Hero variant with no big metric (used by view screen) */
.hero-plain { }

/* Cross-tool sync card */
.crosstool-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 0;
  margin-bottom: 12px;
}
.crosstool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.crosstool-row:last-child { border-bottom: none; }
.crosstool-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream-2);
  border-radius: 8px;
  color: var(--ink);
}
.crosstool-body { flex: 1; min-width: 0; }
.crosstool-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.crosstool-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.sync-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.sync-badge.sync-on { background: rgba(21, 127, 58, 0.14); color: var(--good); }
.sync-badge.sync-off { background: var(--cream-2); color: var(--ink-3); }
.sync-badge.sync-partial { background: rgba(180, 83, 9, 0.14); color: var(--warn); }
.sync-badge.sync-info { background: rgba(62, 158, 224, 0.14); color: var(--sky); }

/* OCR preview */
.ocr-preview {
  background: var(--cream-2);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 14px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ocr-preview.empty { min-height: 200px; }
.ocr-preview-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink-3);
  font-size: 13px;
}
.ocr-preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}
.ocr-status {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  padding: 10px 4px 14px;
}
.ocr-text {
  background: var(--cream-2);
  padding: 12px;
  border-radius: 8px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  margin: 0 0 14px;
}

/* Form stacks */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.field { display: block; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  box-sizing: border-box;
}
.input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(62, 158, 224, 0.2);
}
.input-slim { padding: 9px 12px; font-size: 13.5px; }

/* Calc card - shows live derived values */
.calc-card {
  background: var(--cream-2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 14px;
  color: var(--ink);
}
.calc-row.calc-sub {
  font-size: 12px;
  color: var(--ink-3);
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.calc-row strong.positive { color: var(--good); }
.calc-row strong { font-weight: 700; }

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
}
.toggle-input {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  accent-color: var(--sky);
  flex-shrink: 0;
}
.toggle-body { flex: 1; }
.toggle-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.toggle-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }

/* Wide CTA variant for danger */
.wide-cta-danger {
  border-color: rgba(180, 35, 24, 0.3);
  background: rgba(180, 35, 24, 0.04);
  color: var(--danger);
}
.wide-cta-danger .wide-cta-title { color: var(--danger); }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  background: var(--cream-2);
  border: 1px solid transparent;
  color: var(--ink-3);
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.chip:hover { color: var(--ink); }
.chip.chip-on {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Summary strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--cream-2);
  border-radius: 12px;
  padding: 12px 8px;
  margin-bottom: 12px;
}
.summary-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-align: center;
}
.summary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Report table */
.report-table {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.report-row:last-child { border-bottom: none; }
.report-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.report-row-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.3;
}
.report-row-amt {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.report-row-amt-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 2px;
}
.report-row-total {
  background: var(--cream-2);
  font-weight: 800;
}
.report-row-total .report-row-title { font-weight: 800; color: var(--navy); }
.report-row-flex { display: flex; align-items: center; gap: 10px; }
.cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Detail list */
.detail-list {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-k { font-size: 13px; color: var(--ink-3); }
.detail-v { font-size: 13.5px; color: var(--ink); font-weight: 600; text-align: right; }

/* Log item amount (right rail) */
.log-item-amt {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.log-item-amt-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 2px;
}

/* Btn danger */
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn-danger:hover { background: #8B1B12; }
.btn-danger-outline {
  border-color: rgba(180, 35, 24, 0.4);
  color: var(--danger);
}

/* Link-style button */
.btn-link {
  background: transparent;
  border: none;
  color: var(--sky);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Data ops row */
.sync-ops {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

/* Expenses: two-column CTA grid (alias for cta-row) */
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.cta-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.cta-primary .cta-title, .cta-primary .cta-sub { color: var(--white); }
.cta-primary .cta-sub { color: rgba(255,255,255,0.72); }
.cta-primary .cta-icon {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}
.cta-primary:hover, .cta-primary:focus-visible {
  border-color: var(--sky);
  box-shadow: 0 4px 14px rgba(11, 27, 61, 0.35);
}

/* Empty state (alias for .empty with modern name) */
.empty-state {
  padding: 24px 12px 8px;
  text-align: center;
  color: var(--ink-3);
}
.empty-state .empty-icon {
  color: var(--line-2);
  margin: 0 auto 10px;
  display: inline-flex;
}
.empty-state .empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.empty-state .empty-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 320px;
  margin: 0 auto 14px;
}

/* ==== Per Diem Tracker additions ==== */

/* Active trip banner */
.active-trip {
  width: 100%;
  display: block;
  text-align: left;
  background: linear-gradient(135deg, rgba(21,127,58,0.10), rgba(1,105,111,0.10));
  border: 1px solid rgba(21,127,58,0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms;
}
.active-trip:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.active-trip-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--good);
  margin-bottom: 6px;
}
.active-trip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(21,127,58,0.18);
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(21,127,58,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(21,127,58,0.05); }
}
.active-trip-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.active-trip-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.4;
}

/* Trip title inside hero */
.trip-title-hero {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
  margin: 2px 0 2px;
}

/* KPI mini pair inside/below hero */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.kpi-mini {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px 12px;
}
.kpi-mini-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.7);
}
.kpi-mini-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.kpi-mini-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

/* ============================================================
   Maintenance Log — additional design tokens
   ============================================================ */

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 18px 0 8px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 8px;
}
.section-header .section-label { margin: 0; }
.section-block {
  margin-bottom: 8px;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--sky);
  font-weight: 600;
  font-size: 12.5px;
  padding: 4px 6px;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  margin-top: 8px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
}

/* Form controls */
.form-field { display: block; margin-bottom: 12px; }
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.4;
}
.form-input,
select.form-input,
textarea.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.form-input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(62,158,224,0.15); }
.form-input-inline {
  display: inline-block;
  width: 110px;
  padding: 6px 10px;
  font-size: 13.5px;
  text-align: right;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row .form-field { margin-bottom: 0; }
textarea.form-input { resize: vertical; min-height: 76px; }

/* Chip row (form) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-row .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--cream-2);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.chip-row .chip:hover { color: var(--ink); }
.chip-row .chip.chip-active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.chip-row .chip.chip-active svg { color: var(--white); }

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex: none;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: 0.2s;
}
.switch-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-slider { background: var(--sky); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* Sync card */
.sync-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}
.sync-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.sync-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  padding-left: 24px;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 999px;
  text-transform: uppercase;
}
.pill-teal { background: rgba(1,105,111,0.14); color: #016B71; }
.pill-teal-outline {
  background: transparent;
  color: #016B71;
  border: 1px solid rgba(1,105,111,0.35);
}
.pill-muted { background: var(--cream-2); color: var(--ink-3); }

/* Category badge (icon in circle) */
.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: none;
}

/* Detail row (clickable list item) */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.detail-list .detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.12s, transform 0.12s, border-color 0.12s;
}
.detail-row-clickable {
  cursor: pointer;
}
.detail-row-clickable:hover {
  border-color: var(--sky);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.detail-row-body {
  flex: 1;
  min-width: 0;
}
.detail-row-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  word-wrap: break-word;
}
.detail-row-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}
.detail-row-right {
  text-align: right;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.detail-row-amount {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}

/* KV rows (label/value pair) */
.kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.kv-label {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}
.kv-value {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  word-wrap: break-word;
  max-width: 60%;
}

/* Alert banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow 0.12s, transform 0.12s;
  margin-bottom: 4px;
}
.alert-banner:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.alert-banner-overdue {
  background: rgba(180,35,24,0.08);
  border: 1px solid rgba(180,35,24,0.25);
}
.alert-banner-warn {
  background: rgba(180,83,9,0.10);
  border: 1px solid rgba(180,83,9,0.28);
}
.alert-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  position: relative;
  animation: pulseDot 2.4s ease-in-out infinite;
}
.alert-dot-red { background: var(--danger); }
.alert-dot-amber { background: var(--warn); }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,35,24,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(180,35,24,0); }
}
.alert-text { flex: 1; min-width: 0; }
.alert-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.alert-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.alert-banner svg { color: var(--ink-3); flex: none; }

/* Progress bar */
.progress {
  height: 6px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--sky);
  border-radius: 999px;
  transition: width 0.3s;
}

/* Muted note */
.muted-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: var(--cream-2);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.muted-note svg { flex: none; color: var(--sky); margin-top: 2px; }
.muted-note strong { color: var(--ink); font-weight: 700; }
.muted-note a { color: var(--sky); text-decoration: underline; }
.muted-note + .muted-note { margin-top: 8px; }

/* Summary strip (list header) */
.summary-strip {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: var(--cream-2);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.summary-block {
  flex: 1;
  min-width: 0;
}
.summary-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.summary-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Search input */
.search-input {
  margin-bottom: 8px;
}

/* Danger outline btn */
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(180,35,24,0.25);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
}
.btn-danger-outline:hover {
  background: rgba(180,35,24,0.06);
}

/* Preview card (in service form) */
.preview-card {
  margin-top: 16px;
  padding: 14px;
  background: var(--white);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.preview-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink);
}
.preview-line strong { font-weight: 700; color: var(--navy); }
.preview-line-muted {
  color: var(--ink-3);
  font-size: 12.5px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-2);
  margin-top: 4px;
}
.preview-line-muted strong { color: var(--ink); }

/* CTA grid override to allow more items */
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cta-card {
  cursor: pointer;
}
.cta-body { flex: 1; min-width: 0; }
.cta-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.cta-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.cta-primary .cta-title,
.cta-primary .cta-sub { color: var(--white); }
.cta-primary .cta-sub { color: rgba(255,255,255,0.72); }

/* Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  background: var(--cream-2);
  border-radius: var(--radius);
}
.empty .empty-icon {
  color: var(--line-2);
  margin-bottom: 12px;
}
.empty .empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.empty .empty-sub {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  max-width: 240px;
  margin: 0 auto 16px;
}

/* ============================================================
   Sleep & Fatigue — additions
   ============================================================ */

/* Print overlay for sleep report */
.print-overlay {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 400;
  overflow-y: auto;
  padding: 32px;
  color: #111;
  font-family: 'Inter', sans-serif;
}
.print-overlay[hidden] { display: none; }
.print-overlay .print-close-bar {
  position: sticky;
  top: 0;
  margin: -32px -20px 20px;
  padding: 12px 20px;
  background: var(--navy);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 10;
  flex-wrap: wrap;
}
.print-overlay .print-close-bar h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.print-overlay .print-close-bar .btn { padding: 8px 14px; min-height: auto; font-size: 12.5px; border-radius: 8px; }
.print-overlay .print-close-bar .btn-secondary { background: rgba(255,255,255,0.14); color: white; border-color: rgba(255,255,255,0.28); }
.print-overlay .print-close-bar .btn-secondary:hover { background: rgba(255,255,255,0.22); }
.print-overlay .print-close-bar .btn-primary { background: white; color: var(--navy); }
.print-doc {
  max-width: 780px;
  margin: 0 auto;
  overflow-x: auto;
}
.print-doc h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.print-doc .print-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.print-driver-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 24px;
  padding: 14px 0;
  border-top: 2px solid var(--navy);
  border-bottom: 1px solid var(--line);
  margin: 14px 0 22px;
  font-size: 12.5px;
  color: #333;
}
.print-driver-header div { display: flex; gap: 8px; }
.print-driver-header strong { color: var(--navy); min-width: 100px; }
.print-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.print-summary-cell {
  background: var(--cream);
  border-radius: 10px;
  padding: 12px 14px;
}
.print-summary-cell .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 700; }
.print-summary-cell .v { font-size: 20px; font-weight: 800; color: var(--navy); margin-top: 2px; }
.print-summary-cell .s { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.print-doc h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 24px 0 10px;
}
.print-doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.print-doc th, .print-doc td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.print-doc th {
  background: var(--cream-2);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.print-doc .print-footer {
  font-size: 10.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 24px;
  line-height: 1.5;
}
.print-doc .print-note {
  font-size: 11px;
  color: var(--ink-2);
  background: #FFF8E6;
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0 22px;
}
.print-doc .print-risk {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 8px 0 14px;
  font-size: 13px;
  font-weight: 700;
}
.print-doc .print-risk-low    { background: rgba(21,127,58,0.08);  color: var(--good); }
.print-doc .print-risk-inter  { background: rgba(180,83,9,0.08);   color: var(--warn); }
.print-doc .print-risk-high   { background: rgba(180,35,24,0.08);  color: var(--danger); }

@media print {
  body { background: white; }
  .phone-shell { max-width: 100%; box-shadow: none; }
  .top-bar, .action-bar, .toast, #modal-root, #screen, .print-close-bar { display: none !important; }
  .print-overlay { position: static; padding: 0; overflow: visible; }
  .print-overlay[hidden] { display: none !important; }
  .print-doc { max-width: 100%; }
  .print-doc table { font-size: 10.5px; }
  .print-doc h1 { font-size: 20px; }
}
body.print-overlay-open { background: white; }
body.print-overlay-open .phone-shell {
  max-width: none;
  box-shadow: none;
  background: white;
}
body.print-overlay-open .top-bar,
body.print-overlay-open #screen,
body.print-overlay-open .action-bar,
body.print-overlay-open .toast,
body.print-overlay-open #modal-root { display: none !important; }
body.print-overlay-open .print-overlay {
  position: static;
  overflow: visible;
  padding: 32px 20px;
}

/* --- Sleep-specific components --- */

/* Hero sleep card */
.sleep-hero {
  background: linear-gradient(135deg, #0B355C 0%, #143f6a 45%, #1a4a7a 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 20px 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.sleep-hero::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle at center, rgba(95,179,238,0.28), transparent 70%);
  pointer-events: none;
}
.sleep-hero .h-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #9FCDF0;
  text-transform: uppercase;
}
.sleep-hero .h-title {
  font-size: 15px;
  color: rgba(255,255,255,0.86);
  margin-top: 6px;
  font-weight: 500;
}
.sleep-hero .h-value {
  font-size: 34px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.sleep-hero .h-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.sleep-hero .h-cta {
  margin-top: 14px;
  display: inline-flex;
  gap: 6px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.sleep-hero .h-cta:hover { background: rgba(255,255,255,0.22); }

/* Fatigue meter */
.fatigue-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.fatigue-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.fatigue-title { font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: 0.02em; }
.fatigue-value {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.fatigue-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
}
.fatigue-dot {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--cream-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: transform 100ms;
  user-select: none;
}
.fatigue-dot:hover { transform: translateY(-1px); }
.fatigue-dot.dot-fresh  { background: rgba(21,127,58,0.12); color: var(--good); border-color: rgba(21,127,58,0.28); }
.fatigue-dot.dot-tired  { background: rgba(180,83,9,0.12); color: var(--warn); border-color: rgba(180,83,9,0.28); }
.fatigue-dot.dot-danger { background: rgba(180,35,24,0.12); color: var(--danger); border-color: rgba(180,35,24,0.28); }
.fatigue-dot.dot-active {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(11,53,92,0.15);
  font-size: 12.5px;
}
.fatigue-legend {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Restfulness slider */
.rest-slider {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.rest-star {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 120ms;
}
.rest-star.on {
  background: rgba(62,158,224,0.18);
  border-color: var(--sky);
  color: var(--navy);
  transform: scale(1.04);
}

/* Chip multi-select */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.chip-toggle {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms;
}
.chip-toggle:hover { border-color: var(--line-2); }
.chip-toggle.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Sleep debt bar */
.debt-bar-wrap {
  height: 8px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.debt-bar-fill {
  height: 100%;
  background: var(--sky);
  border-radius: 999px;
  transition: width 300ms;
}
.debt-bar-fill.warn { background: var(--warn); }
.debt-bar-fill.bad { background: var(--danger); }

/* Trend chart */
.trend-chart {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 12px 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.trend-chart .tc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 4px 10px;
}
.trend-chart .tc-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.trend-chart .tc-sub { font-size: 11.5px; color: var(--ink-3); }
.trend-svg { display: block; width: 100%; height: auto; }

/* Night list row */
.night-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 100ms;
}
.night-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.night-date {
  text-align: center;
  background: var(--cream);
  border-radius: 10px;
  padding: 6px 4px;
}
.night-date .nd-m { font-size: 9.5px; font-weight: 700; color: var(--navy); letter-spacing: 0.1em; text-transform: uppercase; }
.night-date .nd-d { font-size: 18px; font-weight: 800; color: var(--navy); line-height: 1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.night-body .nb-dur { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.night-body .nb-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.night-body .nb-rest {
  display: inline-block;
  color: var(--sky);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.night-flag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(180,83,9,0.14);
  color: var(--warn);
  letter-spacing: 0.04em;
}

/* Small chip inline */
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--ink-2);
}
.mini-chip.warn { background: rgba(180,83,9,0.14); color: var(--warn); }
.mini-chip.bad  { background: rgba(180,35,24,0.14); color: var(--danger); }

/* Caffeine cumulative bar */
.caff-meter {
  background: var(--cream);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}
.caff-meter .cm-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.caff-meter .cm-val { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.caff-meter .cm-max { font-size: 11.5px; color: var(--ink-3); }

/* STOP-BANG */
.stop-question {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.stop-question .sq-num {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--sky);
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}
.stop-question .sq-text { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; margin-bottom: 10px; }
.yn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yn-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 120ms;
}
.yn-btn.on-yes { background: var(--navy); color: #fff; border-color: var(--navy); }
.yn-btn.on-no  { background: var(--cream-2); color: var(--navy); border-color: var(--line-2); }

/* STOP-BANG result */
.risk-card {
  padding: 18px;
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 14px;
}
.risk-card.risk-low    { background: linear-gradient(135deg, #157F3A 0%, #1a9945 100%); }
.risk-card.risk-inter  { background: linear-gradient(135deg, #B45309 0%, #c86414 100%); }
.risk-card.risk-high   { background: linear-gradient(135deg, #B42318 0%, #cb2c1e 100%); }
.risk-card .rc-eyebrow { font-size: 10.5px; letter-spacing: 0.14em; font-weight: 700; opacity: 0.85; text-transform: uppercase; }
.risk-card .rc-score { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.risk-card .rc-level { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.risk-card .rc-sub { font-size: 12.5px; opacity: 0.92; line-height: 1.5; }

/* Disclaimer banner */
.disclaimer {
  background: rgba(180,83,9,0.08);
  border: 1px solid rgba(180,83,9,0.24);
  color: var(--warn);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.disclaimer strong { color: #7a3805; font-weight: 700; }

/* Bedtime reminder banner */
.reminder-banner {
  background: linear-gradient(135deg, rgba(62,158,224,0.14), rgba(62,158,224,0.04));
  border: 1px solid rgba(62,158,224,0.32);
  color: var(--navy);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.reminder-banner .rb-body { flex: 1; }
.reminder-banner .rb-title { font-weight: 700; }

/* Event list */
.event-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 6px;
}
.event-sev {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--cream-2);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-2);
}
.event-sev.sev-fresh  { background: rgba(21,127,58,0.14);  color: var(--good); }
.event-sev.sev-tired  { background: rgba(180,83,9,0.14);   color: var(--warn); }
.event-sev.sev-danger { background: rgba(180,35,24,0.14);  color: var(--danger); }
.event-body { min-width: 0; }
.event-body .ev-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.event-body .ev-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.event-time { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }

/* Wizard progress */
.wizard-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.wizard-step {
  flex: 1;
  height: 4px;
  background: var(--cream-2);
  border-radius: 999px;
}
.wizard-step.on { background: var(--sky); }

/* Section header row (matches maintenance) */
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 6px; }
.section-header .section-label { margin: 0; }

/* Alert card */
.alert-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.alert-card.alert-red {
  background: rgba(180,35,24,0.06);
  border-color: rgba(180,35,24,0.28);
  color: var(--danger);
}
.alert-card.alert-amber {
  background: rgba(180,83,9,0.06);
  border-color: rgba(180,83,9,0.28);
  color: var(--warn);
}
.alert-card .ac-body { flex: 1; }
.alert-card .ac-title { font-size: 13px; font-weight: 700; }
.alert-card .ac-sub { font-size: 11.5px; opacity: 0.85; margin-top: 2px; }

/* Utility */
.stack > * + * { margin-top: 10px; }
.flex-row { display: flex; gap: 8px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Standalone KPI row (outside a dark hero) */
.screen > .kpi-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 0;
  margin-bottom: 8px;
}
.screen > .kpi-row .kpi-mini {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 12px 10px;
}
.screen > .kpi-row .kpi-mini-label { color: var(--ink-3); }
.screen > .kpi-row .kpi-mini-value { color: var(--navy); font-size: 18px; }
.screen > .kpi-row .kpi-mini-sub  { color: var(--ink-3); font-size: 11px; }

/* Modal fatigue scale — shrink to fit */
.modal .fatigue-scale { gap: 2px; }
.modal .fatigue-scale .fatigue-dot {
  font-size: 10.5px;
  min-width: 0;
  border-radius: 6px;
}
.modal .fatigue-dot.dot-active { font-size: 11.5px; }
