:root {
  --navy: #0f2540;
  --navy-light: #16345c;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #eef1f6;
  --card: #ffffff;
  --green: #059669;
  --amber: #b45309;
  --red: #dc2626;
  --amber-bg: #fef3c7;
  --green-bg: #d1fae5;
  --red-bg: #fee2e2;
  --blue-bg: #dbeafe;
  --gray-bg: #e5e7eb;
  --indigo-bg: #e0e7ff;
  --indigo: #4338ca;
  --purple-bg: #f3e8ff;
  --purple: #7e22ce;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

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

/* ===== App shell: sidebar + top bar ===== */
:root { --sb-w: 244px; --sb-w-collapsed: 68px; --top-h: 56px; --banner-h: 0px; }
html.sb-collapsed { --sb-w: var(--sb-w-collapsed); }
body.impersonating { --banner-h: 42px; }

.app { display: flex; min-height: 100vh; align-items: flex-start; }
.main-col { flex: 1 1 auto; min-width: 0; min-height: calc(100vh - var(--banner-h)); display: flex; flex-direction: column; }
.main { flex: 1; }

.sidebar {
  position: sticky; top: var(--banner-h); height: calc(100vh - var(--banner-h)); flex: 0 0 var(--sb-w); width: var(--sb-w);
  background: linear-gradient(180deg, #0f2540 0%, #0b1d33 100%); color: #b6c4d8;
  display: flex; flex-direction: column; z-index: 30; transition: width 0.18s ease, flex-basis 0.18s ease;
  overflow: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; height: var(--top-h); padding: 0 16px; flex: none; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.07); }
.logo-mark {
  flex: none; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.02em; display: inline-flex; align-items: center; justify-content: center;
}
.brand-text { font-weight: 700; font-size: 16.5px; letter-spacing: 0.1px; line-height: 1.15; white-space: nowrap; }
.brand-text--company { white-space: normal; font-size: 15px; line-height: 1.2; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.brand-text--company small { margin-top: 2px; }
.logo-mark--img { background: #fff; padding: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.logo-mark--img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }
.simple-top-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { display: block; font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #7f93ad; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 8px; }
/* The menu's scroll bar should be part of the navy menu, not a white strip. */
.sidebar, .sidebar-nav { color-scheme: dark; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.28) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
.nav-group { margin-bottom: 14px; }
.nav-group-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #6f84a1; padding: 8px 10px 5px; white-space: nowrap; }
.nav-item, .sidebar-collapse {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: #c3cfe0; font-size: 14px; font-weight: 500;
  white-space: nowrap; text-decoration: none; position: relative;
}
.nav-item .ic, .sidebar-collapse .ic { flex: none; opacity: 0.9; }
.nav-item:hover, .sidebar-collapse:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(56, 189, 248, 0.17); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #38bdf8; }
.nav-item.active .ic { color: #7dd3fc; opacity: 1; }
.nav-item .lock-tag { margin-left: auto; }
.lock-tag { font-size: 10px; font-weight: 700; background: rgba(255,255,255,0.13); color: #d3deec; padding: 1px 7px; border-radius: 999px; }
.sidebar-collapse { margin: 0 10px 12px; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; flex: none; color: #8ea2bd; }
.sidebar-collapse .ic { transition: transform 0.18s; }

/* Collapsed rail: icons only */
html.sb-collapsed .brand-text, html.sb-collapsed .nav-label, html.sb-collapsed .nav-item .lock-tag { display: none; }
html.sb-collapsed .sidebar-brand { padding: 0; justify-content: center; }
html.sb-collapsed .nav-item, html.sb-collapsed .sidebar-collapse { justify-content: center; padding: 11px 0; }
html.sb-collapsed .nav-group-title { height: 1px; padding: 0; margin: 8px 12px 10px; background: rgba(255,255,255,0.09); font-size: 0; }
html.sb-collapsed .nav-item.active::before { left: -10px; }
html.sb-collapsed .sidebar-collapse .ic { transform: rotate(180deg); }
html.sb-collapsed .sidebar-collapse { margin-left: 10px; margin-right: 10px; }

.sidebar-scrim { display: none; }

.topbar {
  position: sticky; top: var(--banner-h); z-index: 20; height: var(--top-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
}
.topbar .top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 9px; border: none; background: none; color: #4b5563; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit; padding: 0;
}
.icon-btn:hover, .icon-btn.active { background: #f1f4f8; color: var(--ink); text-decoration: none; }
.top-search { position: relative; flex: 0 1 380px; min-width: 0; margin: 0; }
.top-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.top-search input {
  width: 100%; padding: 8px 12px 8px 36px; border-radius: 999px; background: #f3f5f9; border: 1px solid transparent; font-size: 14px;
}
.top-search input:focus { background: #fff; border-color: var(--blue); outline: 2px solid #bfdbfe; }

.bell-count {
  position: absolute; top: 0; right: -3px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; box-sizing: border-box; line-height: 1;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.avatar--admin { background: var(--purple); }
.avatar--support { background: #b45309; }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 220px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
}
.menu-panel--right { left: auto; right: 0; }
.menu-head { padding: 9px 12px 10px; border-bottom: 1px solid #f0f1f3; margin-bottom: 4px; display: flex; flex-direction: column; line-height: 1.35; }
.menu-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 7px; border: none; background: none;
  color: var(--ink); font-size: 14px; font-family: inherit; cursor: pointer; text-align: left; text-decoration: none;
}
.menu-link:hover { background: #f3f4f6; text-decoration: none; }
.menu-link .ic { color: var(--muted); }
.menu-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.menu-panel form { margin: 0; }
.menu-sep { height: 1px; background: #f0f1f3; margin: 5px 0; }
.menu-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 12px 4px; }

.simple-top { background: var(--navy); color: #fff; font-weight: 700; padding: 0 20px; height: var(--top-h); display: flex; align-items: center; gap: 10px; }
.simple-top .logo-mark { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }

.support-banner {
  position: sticky; top: 0; z-index: 70; min-height: var(--banner-h); background: #78350f; color: #fef3c7; font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 20px;
}
.support-banner strong { color: #fff; }
.support-banner .btn { flex: none; }

@media (max-width: 900px) {
  :root { --sb-w: 0px; }
  html.sb-collapsed { --sb-w: 0px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 260px; flex-basis: 260px; transform: translateX(-100%);
    transition: transform 0.2s ease; box-shadow: none;
  }
  body.impersonating .sidebar { top: 0; height: 100vh; }
  html.sb-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,0.35); }
  html.sb-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 25; }
  /* On a phone the drawer always shows labels, whatever the desktop setting. */
  html.sb-collapsed .brand-text, html.sb-collapsed .nav-label { display: inline; }
  html.sb-collapsed .nav-item .lock-tag { display: inline; }
  html.sb-collapsed .sidebar-brand { padding: 0 16px; justify-content: flex-start; }
  html.sb-collapsed .nav-item, html.sb-collapsed .sidebar-collapse { justify-content: flex-start; padding: 9px 10px; }
  html.sb-collapsed .nav-group-title { height: auto; padding: 8px 10px 5px; margin: 0; background: none; font-size: 10.5px; }
  .sidebar-collapse { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .top-search { flex: 1 1 auto; }
  .support-banner { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 14px; }
  body.impersonating { --banner-h: 0px; }
  .support-banner { position: static; }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .topbar .top-actions { gap: 2px; }
}


.container { max-width: 1200px; margin: 0 auto; padding: 28px 28px 60px; }
.container.narrow { max-width: 640px; }
.container.wide { max-width: none; }
.container.portal { max-width: 560px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.card + .card { margin-top: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
/* Wider left column for table-heavy pages (e.g. Drivers with pay columns). */
.grid-wide { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.grid-2 > *, .grid-3 > *, .grid-wide > * { min-width: 0; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
/* The table-plus-form layout stacks sooner, so a table is never squeezed. */
@media (max-width: 1300px) {
  .grid-wide { grid-template-columns: 1fr; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn:disabled { background: #9ca3af; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.btn.secondary:hover { background: #f9fafb; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.btn.danger:hover { background: var(--red-bg); }
.btn.success { background: var(--green); }
.btn.success:hover { background: #047857; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.full { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin: 14px 0 5px; }
label:first-child { margin-top: 0; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=datetime-local], input[type=date], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #93c5fd; outline-offset: 0; border-color: var(--blue); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.error-text { font-size: 13px; color: var(--red); margin-top: 4px; }
.field-error input, .field-error textarea { border-color: var(--red); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px 10px; border-bottom: 1px solid #f0f1f3; font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.row-link { cursor: pointer; }
tr.row-link:hover { background: #fafbfc; }
.load-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: 0.02em; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--gray { background: var(--gray-bg); color: #374151; }
.badge--blue { background: var(--blue-bg); color: var(--blue-dark); }
.badge--indigo { background: var(--indigo-bg); color: var(--indigo); }
.badge--purple { background: var(--purple-bg); color: var(--purple); }
.badge--amber { background: var(--amber-bg); color: var(--amber); }
.badge--green { background: var(--green-bg); color: var(--green); }
.badge--red { background: var(--red-bg); color: var(--red); }

.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs a {
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: #fff; border: 1px solid var(--border);
}
.filter-tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); text-decoration: none; }
.filter-tabs a:hover { text-decoration: none; border-color: var(--navy); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }

.search-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.search-bar input[type=text] { flex: 2 1 220px; }
.search-bar select { flex: 1 1 150px; }
.search-bar input[type=date] { flex: 1 1 140px; }
.search-bar input, .search-bar select { width: auto; }
.search-bar .btn { flex: 0 0 auto; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.timeline li:last-child { border-bottom: none; }
.timeline .t-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin-top: 6px; flex-shrink: 0; }
.timeline .t-body { flex: 1; }
.timeline .t-status { font-weight: 600; font-size: 13.5px; }
.timeline .t-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.timeline .t-note { font-size: 13px; color: #374151; margin-top: 3px; }

.callout { border-radius: 8px; padding: 13px 15px; font-size: 13.5px; margin-bottom: 16px; }
.callout.warn { background: var(--amber-bg); color: #7c4a03; border: 1px solid #fde68a; }
.callout.info { background: var(--blue-bg); color: #1e3a8a; border: 1px solid #bfdbfe; }
.callout.ok { background: var(--green-bg); color: #065f46; border: 1px solid #a7f3d0; }
.callout.danger { background: var(--red-bg); color: #7f1d1d; border: 1px solid #fecaca; }

.link-box {
  display: flex; align-items: center; gap: 8px; background: #f3f4f6; border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 10px; font-size: 13px; font-family: ui-monospace, monospace; word-break: break-all;
}
.link-box button { flex-shrink: 0; }

.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-list li { display: flex; align-items: center; justify-content: space-between; background: #f9fafb; border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; font-size: 13.5px; }

.step-progress { display: flex; margin-bottom: 22px; }
.step-progress .seg { flex: 1; height: 5px; background: #e5e7eb; margin-right: 3px; border-radius: 3px; }
.step-progress .seg:last-child { margin-right: 0; }
.step-progress .seg.done { background: var(--blue); }
.step-progress .seg.current { background: #93c5fd; }

.portal-header { text-align: center; margin-bottom: 20px; }
.portal-header .code { font-family: ui-monospace, monospace; font-size: 13px; color: var(--muted); }
.portal-header h1 { margin-top: 4px; }

.upload-box {
  border: 2px dashed #cbd5e1; border-radius: 10px; padding: 22px; text-align: center; cursor: pointer; background: #fafbfc;
}
.upload-box:hover { border-color: var(--blue); }
.upload-box input { display: none; }
.portal-top { margin: 2px 0 10px; }
.portal-back { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 15px; font-weight: 600; color: var(--navy, #0f2a52); cursor: pointer; }
.portal-back:active { background: #eef2f7; }
.upload-alt { display: flex; justify-content: flex-end; margin-top: 8px; }
.upload-alt .btn { display: inline-flex; align-items: center; }
.upload-preview { margin-top: 12px; max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2); z-index: 50; opacity: 0; transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--navy), var(--navy-light)); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 32px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-card .brand { text-align: center; font-weight: 700; font-size: 19px; color: var(--navy); margin-bottom: 4px; }
.login-card .tag { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.stat-tile .num { font-size: 26px; font-weight: 700; }
.stat-tile .label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

/* Load creation wizard — one question per screen */
.wizard-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; font-weight: 700; color: var(--navy); font-size: 15px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.wizard-topbar .wizard-cancel { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.wizard-wrap { max-width: 480px; margin: 0 auto; padding: 40px 24px 60px; }
.wizard-wrap .step-progress { margin-bottom: 36px; }
.wizard-step { animation: wizard-in 0.18s ease; }
@keyframes wizard-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.wizard-back {
  background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0; margin-bottom: 18px; font-family: inherit;
}
.wizard-back:hover { color: var(--ink); }
.wizard-q { font-size: 22px; margin: 0 0 18px; line-height: 1.3; }
.wizard-input {
  width: 100%; padding: 14px 16px; font-size: 17px; border: 1.5px solid #d1d5db; border-radius: 10px;
  font-family: inherit; background: #fff; color: var(--ink);
}
.wizard-input:focus { outline: 2px solid #93c5fd; border-color: var(--blue); }
.wizard-suggestions { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.wizard-suggestion {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font-family: inherit;
}
.wizard-suggestion strong { font-size: 14.5px; color: var(--ink); }
.wizard-suggestion span { font-size: 12.5px; color: var(--muted); }
.wizard-suggestion:hover { border-color: var(--blue); background: #f8fafc; }
.wizard-suggestion.selected { border-color: var(--blue); background: var(--blue-bg); }
.wizard-suggestion--new strong { color: var(--blue-dark); }
.wizard-new { margin-top: 14px; padding: 14px; background: #f9fafb; border: 1px dashed #cbd5e1; border-radius: 10px; }
.wizard-new .wizard-input { margin: 8px 0 12px; }
.wizard-summary { margin-top: 22px; padding: 16px; background: #f9fafb; border-radius: 10px; }

@media (max-width: 600px) {
  .wizard-wrap { padding: 28px 18px 50px; }
  .wizard-q { font-size: 19px; }
}

/* ---- Multi-company, tiers, customers, invoices, calendar ---- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
a.stat-tile:hover { border-color: var(--navy); }
.stat-tile.stat-alert { border-color: #fca5a5; background: #fff7f7; }
.stat-tile.stat-alert .num { color: var(--red); }
.filter-tabs a.tab-alert { border-color: #fca5a5; color: var(--red); }
.filter-tabs a.tab-alert.active { color: #fff; }


.tier-current { border-color: var(--blue); }
.plain-list { margin: 0; padding-left: 4px; list-style: none; }
.plain-list li { padding: 5px 0; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; font-size: 14px; color: var(--ink); margin: 8px 0; }
.check input { width: auto; margin-top: 3px; }
.checks { display: flex; flex-direction: column; gap: 2px; }
.req { color: var(--red); }
hr.soft { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.center, th.center { text-align: center; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { flex: 1 1 220px; }
.row-off td { opacity: 0.55; }

.card-alert { border-color: #fca5a5; background: #fff7f7; }
.card-warn { border-color: #fcd34d; background: #fffbeb; }
.card-ok { border-color: #a7f3d0; background: #f0fdf9; }
.card-alert h3, .card-warn h3, .card-ok h3 { color: var(--ink); text-transform: none; font-size: 15px; letter-spacing: 0; }

.bol-fields { display: flex; flex-direction: column; gap: 2px; }
.bol-field label { margin-top: 12px; }
.grid-2 .bol-field label { margin-top: 0; }
.bol-field .req { margin-left: 2px; }

/* Notifications */
.note-list { list-style: none; margin: 0; padding: 0; }
.note-item a, .note-item > div { display: block; padding: 13px 18px; color: var(--ink); border-bottom: 1px solid #f0f1f3; }
.note-item a:hover { background: #fafbfc; text-decoration: none; }
.note-item.unread a, .note-item.unread > div { background: #eff6ff; border-left: 3px solid var(--blue); }
.note-msg { font-weight: 500; }

/* Calendar */
.cal-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; justify-content: space-between; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 17px; font-weight: 700; margin-left: 10px; }
.cal-toolbar select { width: auto; }
.cal-legend { margin-bottom: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; vertical-align: middle; }
.dot--green { background: var(--green); } .dot--amber { background: #f59e0b; } .dot--red { background: var(--red); }

.cal-grid { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-grid--week, .cal-grid--month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 8px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: #f9fafb; }
.cal-cell { border-right: 1px solid #f0f1f3; border-bottom: 1px solid #f0f1f3; padding: 6px; min-height: 110px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-grid--month .cal-cell { min-height: 120px; }
.cal-cell.outside { background: #fafafa; }
.cal-cell.outside .cal-daynum { opacity: 0.4; }
.cal-cell.today { background: #eff6ff; }
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-cell.today .cal-daynum { color: var(--blue-dark); }

.cal-chip {
  display: block; padding: 4px 6px; border-radius: 6px; font-size: 11.5px; line-height: 1.3; color: var(--ink);
  border-left: 3px solid #9ca3af; background: var(--gray-bg); overflow: hidden;
}
.cal-chip:hover { text-decoration: none; filter: brightness(0.96); }
.cal-chip--blue { background: var(--blue-bg); border-left-color: var(--blue); }
.cal-chip--indigo { background: var(--indigo-bg); border-left-color: var(--indigo); }
.cal-chip--purple { background: var(--purple-bg); border-left-color: var(--purple); }
.cal-chip--amber { background: var(--amber-bg); border-left-color: #f59e0b; }
.cal-chip--green { background: var(--green-bg); border-left-color: var(--green); }
.cal-chip--red { background: var(--red-bg); border-left-color: var(--red); }
.cal-chip--gray { background: var(--gray-bg); border-left-color: #9ca3af; }
.cal-chip--drop { border-left-style: dashed; }
.cal-time { font-weight: 700; }
.cal-code { font-family: ui-monospace, monospace; font-weight: 700; }
.cal-place, .cal-who { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #374151; }
.cal-who { font-weight: 600; }
.cal-more { font-size: 11.5px; font-weight: 600; padding: 0 4px; }

.cal-row { display: grid; grid-template-columns: 130px repeat(var(--cols, 7), minmax(0, 1fr)); }
.cal-row--head { background: #f9fafb; border-bottom: 1px solid var(--border); }
.cal-rowlabel { padding: 10px; font-weight: 600; font-size: 13px; border-right: 1px solid #f0f1f3; border-bottom: 1px solid #f0f1f3; display: flex; align-items: flex-start; }
.cal-row--head .cal-rowlabel { border-bottom: none; }
.cal-dayhead { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.cal-dayhead.today { color: var(--blue-dark); background: #eff6ff; }
.cal-grid--drivers .cal-cell { min-height: 70px; }
@media (max-width: 800px) {
  .cal-grid--week, .cal-grid--month { grid-template-columns: 1fr; }
  .cal-dow { display: none; }
  .cal-cell { min-height: 0; flex-direction: column; }
  .cal-cell:empty, .cal-grid--month .cal-cell.outside { display: none; }
  .cal-grid--drivers { overflow-x: auto; }
  .cal-grid--drivers .cal-row { min-width: 760px; }
}

/* Invoices */
.invoice-sheet { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-bottom: 18px; max-width: 820px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.inv-from { font-size: 18px; font-weight: 700; }
.inv-logo { display:block; max-height:70px; max-width:240px; margin-bottom:8px; object-fit:contain; }
.inv-meta { text-align: right; }
.inv-title { font-size: 22px; font-weight: 800; letter-spacing: 0.08em; color: var(--navy); }
.inv-billto { margin-bottom: 22px; }
.inv-lines { margin-bottom: 18px; }
.inv-lines tfoot td { border-top: 2px solid var(--ink); border-bottom: none; font-size: 15px; }
.inv-memo { margin-top: 14px; font-size: 13.5px; }

@media print {
  .topbar, .sidebar, .sidebar-scrim, .support-banner, .tour-layer, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .main-col { margin: 0 !important; }
  .invoice-sheet { border: none; padding: 0; max-width: none; }
}

/* A $ sign sitting inside the left edge of an input. */
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-prefix > input { padding-left: 26px; }

input.pct-input { width: 70px; padding: 6px 8px; text-align: right; }
.pay-card { text-align: center; }
.pay-card .pay-amount { font-size: 32px; font-weight: 700; color: var(--green); margin: 2px 0; }

/* Calendar: click a day to start a load there. */
.cal-cell[data-date] { cursor: pointer; }
.cal-cell[data-date]:hover { background: #f5f8ff; }
.cal-cell.today[data-date]:hover { background: #e3eeff; }
.cal-pop { position: fixed; z-index: 50; width: 250px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18); padding: 14px; }
.cal-pop-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.cal-pop .btn-row { margin-top: 10px; }

@media (max-width: 600px) {
  .container { padding: 18px 14px 50px; }
}

/* ===== Outlook-style time grid (Day / Week) ===== */
.cal-hours { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cal-hours label { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.cal-hours select { width: auto; padding: 6px 8px; }

.tg { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tg-scroll { max-height: calc(100vh - 290px); min-height: 380px; overflow: auto; position: relative; }
.tg-head { display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(0, 1fr)); position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--border); }
.tg-head--outside { top: 52px; z-index: 5; background: #fafbfc; }
.tg-head--allday + .tg-head--outside { position: static; } /* only the first strip sticks */
.tg-gutter { border-right: 1px solid var(--border); }
.tg-gutter--note { font-size: 10px; line-height: 1.15; color: var(--muted); text-align: right; padding: 6px 8px 0 0; text-transform: uppercase; letter-spacing: 0.04em; }
.tg-dayhead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 52px; border-left: 1px solid #f0f1f3; }
.tg-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.tg-dnum { font-size: 19px; font-weight: 600; width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 50%; }
.tg-dayhead.today .tg-dow { color: var(--blue-dark); }
.tg-dayhead.today .tg-dnum { background: var(--blue); color: #fff; }
.tg-outside { border-left: 1px solid #f0f1f3; padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 28px; min-width: 0; }
.tg-out-chip { display: block; font-size: 11px; padding: 1px 5px; border-radius: 4px; border-left: 3px solid #9ca3af; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--gray-bg); }
.tg-out-chip:hover { text-decoration: none; filter: brightness(0.95); }

.tg-body { display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(0, 1fr)); position: relative; }
.tg-gutter--hours { background: #fff; position: sticky; left: 0; z-index: 2; }
.tg-hour { position: relative; }
.tg-hour span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--muted); background: #fff; padding: 0 2px; }
.tg-hour:first-child span { top: 2px; }
.tg-col {
  position: relative; border-left: 1px solid #f0f1f3; cursor: pointer; min-width: 0;
  /* a faint line every half hour, a firmer one every hour */
  background-image:
    linear-gradient(to bottom, #e5e7eb 1px, transparent 1px),
    linear-gradient(to bottom, #f3f4f6 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 2), 100% var(--slot);
}
.tg-col.today { background-color: #f6f9ff; }
.tg-ev { position: absolute; padding: 2px 5px; z-index: 3; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,0.08); }
.tg-ev .cal-place, .tg-ev .cal-who { font-size: 11px; }
.tg-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--red); z-index: 4; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.tg-ghost { position: absolute; left: 2px; right: 2px; background: rgba(37, 99, 235, 0.09); border: 1px dashed #93c5fd; border-radius: 5px; pointer-events: none; z-index: 1; font-size: 11px; color: var(--blue-dark); padding: 2px 6px; display: none; }
@media (max-width: 800px) {
  /* Seven columns won't fit a phone: let the grid scroll sideways. */
  .tg-scroll { max-height: calc(100vh - 220px); }
  .tg-head, .tg-body { grid-template-columns: 50px repeat(var(--cols), minmax(104px, 1fr)); min-width: calc(50px + var(--cols) * 104px); }
  .tg-head--outside { min-width: calc(50px + var(--cols) * 104px); }
}

td.load-code { white-space: nowrap; }
.wizard-top-actions { display: flex; align-items: center; gap: 16px; }
.wizard-help { background: var(--blue-bg); color: var(--blue-dark); border: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; }
.wizard-help:hover { background: #bfdbfe; }

/* ===== Guided tours ===== */
.tour-layer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour-blocker { position: fixed; inset: 0; pointer-events: auto; background: transparent; cursor: default; }
.tour-spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(9, 18, 36, 0.62), 0 0 0 3px #38bdf8, 0 0 22px 4px rgba(56, 189, 248, 0.45);
  transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
}
.tour-spot--full { border-radius: 0; box-shadow: inset 0 0 0 9999px rgba(9, 18, 36, 0.62); }
.tour-bubble {
  position: fixed; width: 344px; max-width: calc(100vw - 24px); background: #fff; color: var(--ink); border-radius: 14px; padding: 16px 18px 14px;
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.45); pointer-events: auto; font-size: 14px; line-height: 1.5;
  transition: left 0.22s ease, top 0.22s ease;
}
.tour-bubble::before {
  content: ""; position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); display: none; border-radius: 2px;
}
.tour-bubble[data-side="right"]::before { display: block; left: -6px; top: var(--ay, 30px); margin-top: -7px; }
.tour-bubble[data-side="left"]::before { display: block; right: -6px; top: var(--ay, 30px); margin-top: -7px; }
.tour-bubble[data-side="bottom"]::before { display: block; top: -6px; left: var(--ax, 30px); margin-left: -7px; }
.tour-bubble[data-side="top"]::before { display: block; bottom: -6px; left: var(--ax, 30px); margin-left: -7px; }
.tour-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--blue-dark); margin-bottom: 4px; }
.tour-x { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; font-family: inherit; }
.tour-x:hover { color: var(--ink); }
.tour-bubble h4 { margin: 2px 0 6px; font-size: 17px; line-height: 1.3; }
.tour-bubble p { margin: 0 0 12px; color: #374151; }
.tour-dots { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; }
.tour-dots i.done { background: #93c5fd; }
.tour-dots i.on { background: var(--blue); transform: scale(1.25); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-actions > span { display: flex; gap: 8px; }
.tour-skip { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 2px; font-family: inherit; }
.tour-skip:hover { color: var(--ink); text-decoration: underline; }
.tour-btn { border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tour-btn:hover { background: #f3f4f6; }
.tour-btn--primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.tour-btn--primary:hover { background: var(--blue-dark); }
.tour-nudge {
  position: fixed; right: 20px; bottom: 20px; z-index: 900; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; max-width: 320px; font-size: 14px;
  animation: wizard-in 0.25s ease;
}
.tour-nudge strong { display: block; }
.tour-nudge span { color: var(--muted); font-size: 13px; }
.tour-nudge-actions { display: flex; gap: 8px; justify-content: flex-end; }
.help-pop { min-width: 260px; z-index: 80; }
@media (max-width: 600px) {
  .tour-bubble { width: calc(100vw - 24px); }
  .tour-nudge { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
.tg-ev { overflow: hidden; }
.tg-ev .tg-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.tg-ev .cal-code { font-size: 10.5px; letter-spacing: -0.01em; }

/* Tables inside cards: scroll instead of spilling over their neighbours. */
.card:has(> table), .card:has(> div > table) { overflow-x: auto; }
td.nowrap, th.nowrap { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
td .btn.small { white-space: nowrap; }
td select { max-width: 100%; }

/* ===== Round 4: driver paperwork chips + cards ===== */
.doc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.doc-chip { text-decoration: none; white-space: nowrap; }
.doc-chip:hover { filter: brightness(0.95); }
.doc-card { margin-bottom: 14px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.doc-head .badge { font-size: 13px; padding: 4px 11px; }
.doc-current { background: var(--bg, #f8fafc); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.doc-upload summary { cursor: pointer; color: var(--blue-dark, #1d4ed8); margin: 4px 0 8px; font-weight: 600; }
.doc-older { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.doc-older ul { margin: 4px 0 0; }

/* ===== Round 4: driver pay report (screen + print) ===== */
.report-sheet { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; margin-bottom: 18px; max-width: 860px; font-size: 14.5px; color: #111; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.report-sheet table.rp-table { border-collapse: collapse; width: auto; min-width: 330px; max-width: 460px; flex: 0 1 auto; margin-left: auto; }
.rp-table td { white-space: pre-line; }
.rp-company { white-space: pre-line; }
.rp-table th { background: #1f2937; color: #fff; text-align: left; padding: 6px 12px; font-size: 12.5px; letter-spacing: 0.08em; }
.rp-table td { border: 1px solid #d1d5db; padding: 5px 12px; vertical-align: top; }
.rp-table td:first-child { background: #f3f4f6; font-weight: 600; white-space: nowrap; }
.rp-company { text-align: left; margin-right: auto; font-size: 13px; line-height: 1.45; }
@media (max-width: 700px) { .report-sheet table.rp-table { margin-left: 0; } }
.rp-company-name { font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.rp-logo { max-height: 70px; max-width: 220px; object-fit: contain; display: block; margin: 0 0 8px 0; }
.rp-load { padding: 12px 0 14px; border-top: 1px solid #e5e7eb; page-break-inside: avoid; }
.rp-loadno { font-size: 16px; margin-bottom: 4px; }
.rp-loadno strong { font-weight: 800; }
.rp-row, .rp-extra { margin: 2px 0; }
.rp-label { font-weight: 600; }
.rp-deduction .rp-sign { color: var(--red); font-weight: 700; }
.rp-earning .rp-sign { color: var(--green); font-weight: 700; }
.rp-input { width: 150px; padding: 3px 8px; font-size: 14px; border: 1px solid #cbd5e1; border-radius: 6px; margin-left: 4px; }
.rp-input.rp-money { width: 100px; text-align: right; }
.rp-totals { border-top: 2px solid #111; margin-top: 10px; padding-top: 10px; max-width: 420px; margin-left: auto; }
.rp-trow { display: flex; justify-content: space-between; gap: 20px; padding: 2px 0; }
.rp-grand { font-weight: 800; font-size: 17px; border-top: 1px solid #111; margin-top: 6px; padding-top: 6px; }
.rp-note { margin-top: 26px; font-size: 12.5px; color: #4b5563; border-top: 1px solid #e5e7eb; padding-top: 10px; }

@media print {
  .report-sheet { border: none; padding: 0; max-width: none; }
  .rp-input { border: none; padding: 0; margin: 0; width: auto; background: transparent; }
  .rp-input::placeholder { color: transparent; }
  .rp-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-table td:first-child { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* A button that looks like a text link. */
.linklike { background: none; border: none; padding: 6px 4px; color: var(--blue-dark, #1d4ed8); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.linklike:hover { color: var(--navy, #0f2a52); }

/* ===== Round 4: single-screen New Load form, big letters ===== */
.wizard-wrap.bigform { max-width: 640px; padding: 24px 18px 80px; }
.bigform .bf-section { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 18px 20px; margin-bottom: 18px; }
.bigform .bf-title { font-size: 24px; margin: 0 0 12px; }
.bigform .bf-label { display: block; font-size: 20px; font-weight: 600; margin: 16px 0 6px; color: var(--ink); }
.bigform .bf-hint { font-size: 17px; color: var(--muted); margin: 6px 0 10px; line-height: 1.4; }
.bigform .wizard-input { font-size: 22px; padding: 14px 14px; min-height: 58px; width: 100%; box-sizing: border-box; }
.bigform textarea.wizard-input { min-height: 90px; }
.bigform .wizard-suggestion { min-height: 64px; padding: 12px 16px; }
.bigform .wizard-suggestion strong { font-size: 20px; }
.bigform .wizard-suggestion span { font-size: 16px; }
.bigform .wizard-suggestion .badge { font-size: 14px; padding: 3px 10px; align-self: flex-start; margin-top: 4px; }
.bigform .bf-driver em { font-style: normal; font-weight: 500; color: var(--muted); }
.bigform .bf-chosen { display: flex; flex-direction: column; gap: 2px; background: var(--green-bg); border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.bigform .bf-chosen strong { font-size: 19px; }
.bigform .bf-chosen span { font-size: 16px; color: #065f46; }
.bigform .bf-check { display: flex; align-items: center; gap: 12px; font-size: 19px; margin-top: 18px; }
.bigform .bf-check input { width: 26px; height: 26px; }
.bigform .bf-send { font-size: 24px; padding: 18px 16px; min-height: 68px; border-radius: 14px; }
.bigform .bf-error { background: var(--red-bg); color: #7f1d1d; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; font-size: 18px; margin-bottom: 12px; }
.bigform .callout { font-size: 18px; }
.bigform .opt { font-weight: 400; font-size: 16px; color: var(--muted); }
/* "Bigger text" toggle */
.bigform.bigform--xl .bf-title { font-size: 30px; }
.bigform.bigform--xl .bf-label { font-size: 25px; }
.bigform.bigform--xl .bf-hint { font-size: 21px; }
.bigform.bigform--xl .wizard-input { font-size: 28px; min-height: 70px; }
.bigform.bigform--xl .wizard-suggestion strong { font-size: 25px; }
.bigform.bigform--xl .wizard-suggestion span { font-size: 20px; }
.bigform.bigform--xl .bf-send { font-size: 28px; min-height: 80px; }
.bigform.bigform--xl .bf-check { font-size: 24px; }

/* ---- BOL photo viewer, side-by-side review, AI field tags ---- */
.pv { display: flex; flex-direction: column; background: #111827; border-radius: 10px; overflow: hidden; height: 100%; min-height: 260px; }
.pv-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: #1f2937; }
.pv-title { color: #e5e7eb; font-size: 14px; font-weight: 600; margin-right: auto; padding-left: 4px; }
.pv-btn { background: #374151; color: #fff; border: 0; border-radius: 7px; padding: 9px 13px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.pv-btn:hover { background: #4b5563; }
.pv-btn.active { background: #2563eb; }
.pv-link { color: #93c5fd; font-size: 14px; margin-left: auto; text-decoration: none; padding: 0 6px; }
.pv-stage { flex: 1; min-height: 0; overflow: auto; display: flex; background: #0b1220; }
.pv-wrap { position: relative; margin: auto; flex: none; }
.pv-img { position: absolute; left: 50%; top: 50%; max-width: none; background: #fff; cursor: zoom-in; user-select: none; }
.pv-pdf { flex: 1; border: 0; width: 100%; min-height: 400px; background: #fff; }
.pv-empty { color: #9ca3af; padding: 40px 20px; text-align: center; margin: auto; }
.pv-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.92); display: flex; padding: 10px; }
.pv-full { flex: 1; height: auto; }
.pv-full .pv-img { cursor: zoom-in; }
.pv-close { background: #b91c1c; }
.pv-close:hover { background: #dc2626; }

.bol-thumbs { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.bol-thumb { width: 100%; max-height: 420px; object-fit: contain; background: #f3f4f6; border: 1px solid var(--border); border-radius: 10px; cursor: zoom-in; display: block; }
.bol-thumb-cap { font-size: 13px; color: var(--muted, #6b7280); text-align: center; margin-top: 4px; }

.review-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr); gap: 16px; margin-bottom: 18px; height: calc(100vh - 90px); min-height: 560px; scroll-margin-top: 70px; }
.review-photo, .review-data { min-height: 0; }
.review-photo .pv { height: 100%; }
.review-data { overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.review-data h3 { margin: 0 0 4px; }
.review-data .bol-field { margin-bottom: 6px; }
.review-data .bol-field label { margin-bottom: 2px; font-size: 13px; }
.review-data .bol-field input, .review-data .bol-field select { font-size: 15.5px; padding: 6px 10px; }
.review-data .callout { padding: 8px 12px; margin-bottom: 10px; }
.review-actions { position: sticky; bottom: -16px; background: #fff; padding: 12px 0 4px; margin-top: 8px; border-top: 1px solid var(--border); }
@media (max-width: 980px) {
  .review-split { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .review-photo .pv { height: 68vh; }
  .review-data { overflow: visible; }
  .review-actions { position: static; }
}

.ai-tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 1px 9px; margin-left: 6px; vertical-align: middle; }
.ai-read { --aic: #6d28d9; }
.ai-tag.ai-read { background: #ede9fe; color: #5b21b6; }
.ai-tag.ai-check { background: #fef3c7; color: #92400e; }
.ai-tag.from-load { background: #e0f2fe; color: #075985; }
.bol-field.ai-check input, .bol-field.ai-check select { border-color: #f59e0b; background: #fffbeb; }
.bol-field.ai-read input, .bol-field.ai-read select { border-color: #c4b5fd; }
.doc-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-thumbs img { height: 110px; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; background: #f3f4f6; }

/* Electronic BOL: the signature box on the receiver's page */
.sig-canvas { display:block; width:100%; height:180px; border:2px dashed #9ca3af; border-radius:8px; background:#fff; touch-action:none; cursor:crosshair; }
.ebol-frame { width:100%; height:100%; min-height:560px; border:0; background:#fff; border-radius:8px; }
.pane-tabs { display:flex; gap:6px; margin-bottom:8px; }
.review-photo.has-tabs { display:flex; flex-direction:column; }
.review-photo.has-tabs .pane { flex:1; min-height:0; }
.review-photo.has-tabs .pane[hidden] { display:none; }
.review-photo.has-tabs .pv { height:100%; }
.review-photo.has-tabs .ebol-frame { min-height:0; }
@media (max-width: 900px) { .review-photo.has-tabs .pane { height:68vh; flex:none; } }

/* ---- Document scanner (public/scan.js) ---- */
.scan-modal { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #0b1220; color: #e5e7eb; font-family: inherit; }
.scan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #1f2937; }
.scan-title { font-weight: 700; font-size: 16px; }
.scan-stage { position: relative; flex: 1; min-height: 0; touch-action: none; }
.scan-view { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.scan-msg { position: absolute; left: 12px; right: 12px; top: 12px; background: rgba(245, 158, 11, 0.95); color: #1f2937; border-radius: 8px; padding: 9px 12px; font-size: 14px; font-weight: 600; display: none; pointer-events: none; }
.scan-loupe { position: absolute; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); pointer-events: none; background: #000; }
.scan-loupe[hidden] { display: none; }
.scan-loupe canvas { width: 120px; height: 120px; display: block; }
.scan-panel { background: #1f2937; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.scan-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.scan-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #9ca3af; flex: 1 1 130px; margin: 0; }
.scan-row select { background: #374151; color: #fff; border: 0; border-radius: 7px; padding: 9px 8px; font-size: 15px; font-family: inherit; width: 100%; }
.scan-btn { background: #374151; color: #fff; border: 0; border-radius: 8px; padding: 11px 14px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.scan-btn:hover { background: #4b5563; }
.scan-btn:disabled { opacity: 0.45; cursor: default; }
.scan-ghost { background: transparent; border: 1px solid #4b5563; }
.scan-primary { background: #16a34a; flex: 1 1 160px; font-size: 16px; padding: 13px 16px; }
.scan-primary:hover { background: #15803d; }
.scan-tools .scan-btn { flex: 1 1 auto; font-size: 14px; padding: 10px 10px; }
.scan-actions { justify-content: space-between; }
@media (max-width: 520px) { .scan-tools .scan-btn { flex: 1 1 45%; } }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pv-pdf-btn { text-decoration: none; display: inline-block; }

/* ===== Multi-stop trips (dispatcher page) ===== */
.trip-stops { list-style: none; margin: 0; padding: 0; }
.trip-stop { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.trip-stop:first-child { border-top: 0; }
.trip-stop.done { opacity: 0.7; }
.trip-num { flex: 0 0 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; background: #e5e7eb; font-weight: 700; font-size: 13px; }
.trip-what { flex: 0 0 76px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.trip-what--pickup { color: #1d4ed8; }
.trip-what--delivery { color: #7c3aed; }
.trip-place { flex: 1; min-width: 0; }
.trip-move { display: flex; gap: 4px; flex: 0 0 auto; }

/* Driver pay method cell on the Drivers list: the method on top, the figure under it. */
.pay-cell .pay-method { display: block; width: 130px; min-width: 0; padding: 6px 8px; font-size: 13px; margin-bottom: 4px; }
input.pct-input.pay-value { width: 80px; min-width: 0; }
.pay-cell .pay-pre { margin-right: 2px; }

/* Invoice document (laid out like the pilot company's invoice) */
.inv2 { max-width: 820px; }
.inv2-title { text-align: center; font-size: 15px; margin-bottom: 14px; }
.inv2-meta { border-collapse: collapse; font-size: 13px; min-width: 260px; align-self: flex-start; }
.inv2-meta th, .inv2-meta td { border: 1px solid #d4d4d4; padding: 4px 8px; text-align: left; }
.inv2-meta th { background: #f3f3f3; font-weight: 600; width: 38%; }
.inv2-bar { background: #f3f3f3; border: 1px solid #d4d4d4; font-weight: 700; font-size: 12.5px; padding: 6px 8px; margin: 18px 0 14px; }
.inv2-load { margin-bottom: 20px; page-break-inside: avoid; }
.inv2-loadhead { font-weight: 700; margin-bottom: 8px; }
.inv2-party { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #f7f7f7; margin-bottom: 6px; }
.inv2-party th { text-align: left; white-space: nowrap; padding: 3px 8px; width: 1%; }
.inv2-party td { padding: 3px 8px; }
.inv2-rates { font-weight: 700; font-size: 12px; margin: 12px 0 6px; }
.inv2-line { display: flex; justify-content: space-between; border-bottom: 1px solid #d4d4d4; padding: 4px 2px; font-size: 13px; }
.inv2-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 15px; padding: 8px 2px; }
.inv2 .inv-head { flex-wrap: nowrap; align-items: flex-start; }
.inv2 table.inv2-meta { width: auto; min-width: 270px; margin-left: auto; }
.inv2 table.inv2-meta th, .inv2 table.inv2-party th { text-transform: none; letter-spacing: normal; font-size: 12.5px; color: var(--ink); }
.inv2 table.inv2-party th { font-weight: 700; }
.inv2 table.inv2-party td:nth-child(2) { width: 22%; }

/* Driver report blocks laid out like the pilot company's report */
.rp-title { text-align: center; font-size: 15px; margin-bottom: 14px; }
.report-sheet table.rp-block { width: 100%; border-collapse: collapse; margin: 0 0 14px; page-break-inside: avoid; font-size: 13.5px; }
.rp-block th { background: #f3f4f6; text-align: left; font-weight: 400; white-space: nowrap; width: 1%; padding: 4px 10px; border: 1px solid #d1d5db; text-transform: none; letter-spacing: normal; font-size: 13px; color: #111; }
.rp-block td { border: 1px solid #d1d5db; padding: 4px 10px; }
.rp-block td.rp-amt, .rp-block td.rp-totalpay { text-align: right; white-space: nowrap; width: 1%; }
.rp-note-input { width: 100%; border: none; background: transparent; padding: 2px 0; font: inherit; }
.rp-block .rp-input { margin-left: 0; }
@media print { .rp-note-input { padding: 0; } .rp-note-input::placeholder { color: transparent; } .rp-block th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
