:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #192941;
  --muted: #5c6c81;
  --line: #e1e7f0;
  --canvas: #f3f6fb;
  --navy: #13243d;
  --blue: #2454d8;
  --blue-dark: #173eab;
  --green: #126049;
  --amber: #825408;
  --red: #9b2a36;
  --white: #fff;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #6488fc; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 2.7vw, 2.2rem); letter-spacing: -.045em; line-height: 1.13; }
h2 { font-size: 1.1rem; letter-spacing: -.024em; line-height: 1.3; }
h3 { font-size: 1rem; line-height: 1.25; }
p { line-height: 1.55; }
small, .muted { color: var(--muted); }
small { font-size: .82rem; }
strong { font-weight: 650; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.button {
  display: inline-flex; gap: .5rem; align-items: center; justify-content: center;
  min-height: 42px; padding: .52rem .95rem; border: 1px solid transparent; border-radius: 9px;
  font-size: .89rem; font-weight: 660; text-decoration: none; text-align: center; white-space: nowrap;
}
.button > span[aria-hidden] { font-size: 1.2rem; line-height: 1; }
.primary { background: var(--blue); color: white; box-shadow: 0 1px 2px #142c4020; }
.primary:hover { background: var(--blue-dark); }
.secondary { background: white; color: var(--ink); border-color: #d9e1ed; }
.secondary:hover, .icon-button:hover { background: #eef3ff; }
.button:disabled { opacity: .58; box-shadow: none; cursor: default; }
.full-button { width: 100%; }
.text-link, .back-link { color: var(--blue-dark); font-weight: 650; text-decoration: none; }
.text-link:hover, .back-link:hover, .row-link:hover { text-decoration: underline; }
.back-link { display: inline-block; font-size: .9rem; margin-bottom: 1.05rem; }
.panel, .metric { background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 1px 2px #2f416906; }
.notice { padding: .85rem 1rem; border-radius: 9px; line-height: 1.4; }
.notice-success { background: #e9f7ef; color: var(--green); margin-bottom: 1rem; }
.notice-warning { background: #fff2d8; color: #674207; }
.notice-danger { background: #fce9ec; color: var(--red); }
.notice-neutral { background: #eaf0ff; color: #264a9a; }
.pill { display: inline-block; padding: .31rem .56rem; border-radius: 999px; font-size: .76rem; font-weight: 670; line-height: 1.18; white-space: nowrap; }
.pill.scheduled { background: #edf1f7; color: #52647b; }
.pill.in-progress { background: #e9efff; color: #2b50ad; }
.pill.ready { background: #fff1d5; color: #7b5006; }
.pill.submitted { background: #e0f3ea; color: var(--green); }
.pill.upload-unattempted { background: #edf1f7; color: #52647b; }
.pill.upload-attempted { background: #fff1d5; color: #7b5006; }
.pill.upload-submitted { background: #e0f3ea; color: var(--green); }
.pill.problem { background: #fce9ec; color: var(--red); }
.good-text { color: var(--green); }
.danger-text { color: var(--red); }
progress {
  display: block; min-width: 36px; width: 100%; height: 6px; appearance: none; border: none;
  border-radius: 9px; overflow: hidden; background: #e5ecf7; color: var(--blue);
}
progress::-webkit-progress-bar { background: #e5ecf7; border-radius: 9px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 9px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 9px; }

.workspace { display: grid; grid-template-columns: 211px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; background: var(--navy); color: #f3f7ff;
  display: flex; flex-direction: column; padding: 1.45rem .9rem 1rem;
}
.brand, .login-brand, .driver-brand { display: flex; gap: .68rem; align-items: center; color: inherit; font-weight: 720; text-decoration: none; letter-spacing: -.03em; }
.brand { margin: 0 .45rem 2.15rem; white-space: nowrap; font-size: 1.08rem; }
.brand-mark { display: inline-block; position: relative; border-radius: 9px; background: #3b67ed; flex: 0 0 33px; width: 33px; height: 33px; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; display: block; border-radius: 2px; height: 5px; transform: skewX(-19deg); background: #fff; left: 8px; }
.brand-mark::before { width: 17px; top: 10px; }
.brand-mark::after { width: 12px; top: 18px; }
.side-nav { display: grid; gap: .3rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; border-radius: 8px; padding: .71rem .77rem; text-decoration: none; font-size: .91rem; font-weight: 570; color: #c1cee3; }
.side-nav a[aria-current="page"] { background: #2c4672; color: #fff; }
.side-nav a:hover { background: #293f60; color: #fff; }
.nav-icon { display: inline-block; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 4px; position: relative; flex-shrink: 0; opacity: .85; }
.overview-icon::before, .overview-icon::after { content: ""; position: absolute; background: currentColor; }
.overview-icon::before { height: 1px; width: 100%; top: 6px; }
.overview-icon::after { height: 100%; width: 1px; left: 6px; }
.people-icon { border: 0; }
.people-icon::before, .people-icon::after { content: ""; position: absolute; border: 1.5px solid currentColor; }
.people-icon::before { width: 7px; height: 7px; border-radius: 100%; top: 0; left: 4.5px; }
.people-icon::after { width: 15px; height: 6px; border-radius: 5px 5px 2px 2px; bottom: 0; }
.van-icon { height: 11px; margin-top: -3px; }
.van-icon::before, .van-icon::after { content: ""; position: absolute; bottom: -4px; background: currentColor; width: 4px; height: 4px; border-radius: 50%; }
.van-icon::before { left: 1px; }
.van-icon::after { right: 1px; }
.audit-icon::after { content: ""; position: absolute; inset: 4px 3px; border-block: 1px solid currentColor; }
.side-footer { margin-top: auto; border-top: 1px solid #ffffff25; padding: .9rem .4rem 0; }
.account-summary { display: flex; align-items: center; gap: .55rem; font-size: .85rem; min-width: 0; }
.account-summary strong, .account-summary small { display: block; overflow-wrap: anywhere; }
.account-summary small { color: #aebeda; margin-top: .12rem; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; width: 34px; height: 34px; background: #eaf0ff; color: #3857a0; font-size: .71rem; font-weight: 750; flex-shrink: 0; }
.sidebar-avatar { background: #37517a; color: #f1f5ff; }
.sidebar-signout { color: #c6d4eb; background: none; border: 0; padding: .64rem 0 0; font-size: .83rem; }
.sidebar-signout:hover { color: #fff; text-decoration: underline; }

.main-content { width: 100%; max-width: 1660px; padding: clamp(1rem, 2.75vw, 2.65rem); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.55rem; }
.page-header p { color: var(--muted); margin-top: .35rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .87rem; margin-bottom: 1.15rem; }
.metric { display: grid; gap: .35rem; padding: 1rem 1.1rem 1.12rem; }
.metric-label { color: #475a73; font-size: .87rem; font-weight: 670; }
.metric > strong { font-size: 2rem; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1.23; }
.metric > strong span { font-size: 1rem; color: #5f6e82; letter-spacing: 0; }
.metric-review > strong { color: var(--amber); }
.metric > small { line-height: 1.38; }
.filters { padding: 1rem; margin-bottom: 1.15rem; }
.filter-top, .filter-bottom { display: grid; gap: .72rem; grid-template-columns: 1.23fr 1fr .9fr 1.04fr; }
.filter-bottom { margin-top: .8rem; }
.field, .date-field { display: grid; gap: .32rem; min-width: 0; }
.field label, .date-field label, .form-field label { font-weight: 650; font-size: .84rem; color: #41536d; }
input:not([type="checkbox"], [type="file"], [type="hidden"]), select, textarea {
  min-width: 0; width: 100%; min-height: 42px; border: 1px solid #d9e1ed; padding: .52rem .64rem;
  border-radius: 8px; background: white; color: var(--ink); font-size: .91rem;
}
input::placeholder { color: #687b93; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--blue); }
.date-picker { display: flex; gap: .3rem; }
.date-picker input { flex: 1 1 auto; }
.icon-button {
  border: 1px solid #d9e1ed; width: 30px; flex: 0 0 30px; display: grid; place-items: center;
  border-radius: 8px; color: #466392; font-weight: 650; font-size: 1.3rem; text-decoration: none;
}
.filter-actions, .inline-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.08rem; }
.panel-header p { color: var(--muted); font-size: .85rem; margin-top: .17rem; }
.panel-header a { font-size: .86rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .88rem; }
th, td { padding: .76rem .94rem; border-top: 1px solid #e7edf5; }
th { background: #f8faff; color: #485b74; font-size: .78rem; font-weight: 680; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { padding-left: 1.06rem; }
td:last-child, th:last-child { padding-right: 1.06rem; }
.row-link { color: #213b76; font-weight: 690; text-decoration: none; }
.person { display: flex; align-items: center; gap: .52rem; min-width: 113px; }
.person small { display: block; margin-top: .09rem; }
.person strong { display: block; }
.drop-number { display: block; color: #354b69; font-weight: 670; font-variant-numeric: tabular-nums; margin-bottom: .26rem; }
td progress { min-width: 40px; }
.empty-cell { text-align: center; padding: 2.55rem .8rem; color: var(--muted); }
.detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric strong.detail-status { align-self: center; font-size: 1.32rem; letter-spacing: -.03em; }
.proof-group { border-top: 1px solid #e7edf5; }
.proof-group summary, .driver-details summary { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: .84rem 1.08rem; list-style: none; }
.proof-group summary::-webkit-details-marker, .driver-details summary::-webkit-details-marker { display: none; }
.proof-group summary::after, .driver-details summary::after { content: "+"; font-weight: 600; color: var(--blue-dark); }
.proof-group[open] > summary::after, .driver-details[open] > summary::after { content: "−"; }
.proof-group summary strong { margin-right: auto; }
.proof-count { color: var(--muted); font-size: .82rem; text-align: right; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: .65rem; padding: .15rem 1.08rem .9rem; }
.photo-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photo-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.photo-caption { display: grid; justify-items: start; gap: .18rem; padding: .56rem; font-size: .86rem; }
.form-panel { max-width: 690px; padding: 1.35rem; }
.stacked-form { display: grid; gap: 1rem; }
.form-field { display: grid; gap: .35rem; }
.check-field { display: flex; align-items: center; }
.form-actions { display: flex; justify-content: flex-end; gap: .55rem; padding-top: .5rem; }
.errorlist { padding: .55rem .7rem; margin: 0; border-radius: 7px; color: var(--red); background: #fcecef; list-style: none; font-size: .87rem; }
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 1.1rem; background: radial-gradient(ellipse at 18% 12%, #e4edff, #f4f7fc 57%); }
.login-layout { width: min(100%, 405px); }
.login-brand { justify-content: center; font-size: 1.2rem; margin: 0 0 1.15rem; }
.login-card { background: white; padding: clamp(1.25rem, 4vw, 1.95rem); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 56px #223f6a12; }
.login-card h1 { font-size: 1.8rem; }
.login-card p { margin: .4rem 0 1.24rem; }
.login-card input { min-height: 46px; font-size: 1rem; }
.login-card .button { min-height: 46px; }

@media (max-width: 830px) {
  .workspace { grid-template-columns: 168px minmax(0, 1fr); }
  .sidebar { padding-inline: .58rem; }
  .brand { font-size: .94rem; gap: .45rem; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
  .filter-top, .filter-bottom, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .workspace { display: block; }
  .sidebar { position: relative; height: auto; gap: .6rem; padding: .75rem; }
  .brand { margin: 0; }
  .side-nav { grid-template-columns: repeat(4, auto); }
  .side-nav a { font-size: .79rem; gap: .28rem; padding: .48rem .26rem; justify-content: center; }
  .side-nav .nav-icon { display: none; }
  .side-footer { position: absolute; top: .55rem; right: .75rem; border: 0; padding: 0; }
  .side-footer .account-summary { display: none; }
  .page-header { flex-wrap: wrap; align-items: flex-start; }
  .detail-heading .inline-actions { justify-content: flex-start; }
  .metrics { gap: .55rem; }
  .metric { padding: .7rem; }
  .metric > strong { font-size: 1.46rem; }
  .filters { padding: .65rem; }
  .filter-actions .button { padding-inline: .55rem; }
}

.driver-body { min-height: 100dvh; }
.driver-header { color: white; background: var(--navy); padding: max(.7rem, env(safe-area-inset-top)) 1rem .7rem; }
.driver-header-inner { display: flex; justify-content: space-between; align-items: center; gap: .6rem; max-width: 666px; margin-inline: auto; }
.driver-brand { font-size: 1.05rem; }
.driver-signout { color: #dce7f8; background: transparent; border: 0; border-radius: 7px; padding: .55rem .35rem; font-size: .88rem; }
.driver-signout:hover { text-decoration: underline; }
.driver-main { max-width: 700px; margin-inline: auto; padding: .85rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
.driver-main > .notice { margin-bottom: .78rem; font-size: .9rem; }
.driver-main .inline-link { margin-left: .45rem; }
.driver-hero { background: #1c3864; border-radius: 16px; color: white; padding: 1.13rem 1.17rem .95rem; margin-bottom: 1rem; }
.driver-hero h1 { font-size: 2.05rem; font-weight: 770; }
.driver-date { margin-bottom: .22rem; font-size: .88rem; font-weight: 600; color: #d6e5ff; }
.driver-van-meta { margin-top: .24rem; color: #d6e5ff; font-size: .93rem; }
.day-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .67rem; border-top: 1px solid #ffffff35; padding-top: .77rem; margin-top: .82rem; }
.day-summary p { font-size: .86rem; color: #e9f1ff; }
.driver-assignment { display: grid; gap: .79rem; margin-bottom: 1.2rem; }
.earlier-heading { margin-top: .65rem; }
.driver-inspection, .driver-stop { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .83rem .84rem; }
.driver-inspection h2 { margin-bottom: .2rem; }
.capture-text { min-width: 0; overflow-wrap: anywhere; }
.capture-text h3 { font-weight: 700; }
.capture-text p { font-size: .84rem; }
.camera-button { position: relative; min-height: 44px; cursor: pointer; color: var(--blue-dark); }
.camera-button:focus-within { outline: 3px solid #6488fc; outline-offset: 3px; }
.camera-button.disabled { opacity: .55; cursor: default; pointer-events: none; }
.driver-route { overflow: hidden; }
.driver-route-header { display: flex; justify-content: space-between; gap: .4rem; align-items: center; padding: .8rem .84rem .34rem; }
.driver-route-header p { font-size: .87rem; margin-top: .12rem; }
.driver-instructions { color: var(--muted); font-size: .88rem; white-space: pre-wrap; padding: .3rem .84rem .68rem; }
.driver-details summary { background: #f8faff; border-block: 1px solid #e7edf5; padding: .7rem .84rem; font-size: .89rem; }
.driver-details summary strong { margin-right: auto; }
.driver-stop + .driver-stop { border-top: 1px solid #e7edf5; }
.driver-route-footer { display: grid; gap: .5rem; padding: .78rem .84rem .84rem; border-top: 1px solid #e7edf5; }
.driver-route-footer button { min-height: 44px; }
.driver-nav {
  position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: .75rem;
  padding: .52rem 1rem max(.52rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  background: #fff; box-shadow: 0 -4px 16px #263b6612;
}
.driver-nav button {
  display: flex; align-items: center; justify-content: center; gap: .42rem; min-height: 45px;
  width: min(50%, 190px); background: #fff; border: 0; border-radius: 8px; color: #455a78; font-weight: 680;
}
.driver-nav button[aria-pressed="true"] { background: #eaf0ff; color: var(--blue-dark); }
.nav-badge { background: #fff1d5; color: #674207; border-radius: 999px; min-width: 1.35rem; padding: .13rem .25rem; font-size: .75rem; }
.queue-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.queue-header p, .storage-status { font-size: .87rem; margin-top: .2rem; }
.storage-status { margin-bottom: .7rem; }
.queue-rows { display: grid; gap: .64rem; }
.queue-card, .queue-empty { padding: .86rem; }
.queue-card p { font-size: .87rem; margin-top: .2rem; }
.queue-card progress { margin-top: .52rem; height: 8px; }
.queue-empty { color: var(--muted); }
@media (max-width: 340px) {
  .driver-main { padding-inline: .55rem; }
  .driver-inspection, .driver-stop { padding-inline: .65rem; }
  .camera-button { padding-inline: .5rem; }
}
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; margin-top: .9rem; font-size: .88rem; }
