:root {
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #182643; background: #f1f5f9; color-scheme: light;
  --ink: #182643; --muted: #495a71; --navy: #111d35; --border: #d5dfe9;
  --blue: #2352cc; --blue-hover: #163eac; --white: #fff; --pale: #edf3ff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
button:disabled { cursor: wait; opacity: .66; }
:focus-visible { outline: 3px solid #4f7ef5; outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.95rem); line-height: 1.08; letter-spacing: -.045em; }
h2 { font-size: 1.3rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 1.1rem; }
.compact { display: grid; gap: .45rem; }
.button {
  border: 1px solid var(--border); border-radius: .6rem; padding: .62rem .95rem; min-height: 2.75rem;
  color: var(--ink); background: #fff; font-weight: 650; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; text-align: center; line-height: 1.25;
}
.button:hover { background: #edf3fa; border-color: #a9b9ce; }
.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.danger { color: #962824; background: #fff7f6; border-color: #e9bbbb; }
.danger:hover { background: #ffe8e6; border-color: #d68c87; }
.small { min-height: 2.4rem; padding: .47rem .65rem; font-size: .9rem; }
.panel {
  background: #fff; border: 1px solid var(--border); border-radius: .95rem;
  padding: clamp(1rem, 3vw, 1.6rem); min-width: 0;
}
.field { display: grid; align-content: start; gap: .3rem; min-width: 0; color: var(--ink); font-weight: 650; font-size: .9rem; }
.field input,.field select,.field textarea,.grid-input {
  border: 1px solid #bdcbdd; padding: .55rem .65rem; width: 100%;
  border-radius: .47rem; background: #fff; color: var(--ink); min-width: 0; min-height: 2.65rem; font-size: 1rem;
}
.field select {
  padding-right: 2rem; appearance: none;
  background: linear-gradient(45deg,transparent 48%,#364966 49%,#364966 67%,transparent 68%) right 1.05rem center / .35rem .45rem no-repeat,
    linear-gradient(135deg,transparent 32%,#364966 33%,#364966 51%,transparent 52%) right .7rem center / .35rem .45rem no-repeat #fff;
}
.field :disabled,.grid-input:disabled { background: #f2f5f9; color: #40516b; opacity: 1; cursor: default; }
.field textarea { resize: vertical; min-height: 5rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: .9rem; }
.fields.wide { grid-template-columns: repeat(auto-fit,minmax(min(100%,20rem),1fr)); }
.brand { display: flex; align-items: center; gap: .8rem; font-weight: 750; line-height: 1.18; }
.mark {
  display: grid; place-content: center; width: 2.55rem; height: 2.55rem; flex: 0 0 auto;
  background: #dbe8ff; color: #1843ad; border-radius: .75rem; font-size: 1.25rem; font-weight: 800;
}
.login-shell { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.login-aside {
  position: relative; overflow: hidden; color: #fff; padding: clamp(2rem, 5vw, 5rem); display: grid;
  align-content: space-between; gap: 6rem; background: radial-gradient(ellipse at 0% 90%, #224f9d, transparent 65%), #111d35;
}
.login-aside h1 { max-width: 11ch; font-size: clamp(2.65rem,5.4vw,5.6rem); }
.login-aside p { color: #d9e5ff; max-width: 34ch; font-size: 1.08rem; margin-top: 1.2rem; }
.route-art { display: flex; gap: 3.4rem; align-items: center; width: max-content; position: relative; margin: 2.1rem 0 .3rem; }
.route-art::before { content: ""; position: absolute; left: .75rem; right: .75rem; top: 50%; height: 2px; background: #779eef; }
.route-art i { display: block; position: relative; width: .75rem; height: .75rem; border: 2px solid #b9d0ff; border-radius: 50%; background: #183361; }
.route-art i:first-child,.route-art i:last-child { background: #c7daff; }
.login-main { display: grid; place-items: center; padding: 2rem clamp(1rem,4vw,4rem); }
.login-card { width: min(100%, 28rem); padding: clamp(1.1rem,4vw,2.1rem); box-shadow: 0 20px 50px #152c5410; }
.login-card .button { width: 100%; }
.error { color: #921f2e; background: #fff0f2; border: 1px solid #f1c0c7; padding: .65rem .8rem; border-radius: .55rem; }
.layout { --sidebar-width: 15rem; position: relative; min-height: 100svh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); }
.layout.sidebar-collapsed { grid-template-columns: minmax(0,1fr); }
.sidebar { display: flex; gap: 2rem; flex-direction: column; background: var(--navy); color: #fff; padding: 1.5rem 1rem; }
.sidebar .brand { padding: 0 .5rem; }
.sidebar[hidden] { display: none; }
.sidebar-toggle {
  position: absolute; z-index: 1; top: 1.5rem; left: calc(var(--sidebar-width) - 3.5rem);
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0;
  border: 1px solid #577098; border-radius: .55rem; background: #253957; color: #fff;
}
.sidebar-toggle span { font: 700 1.75rem/1 Arial,sans-serif; transform: translateY(-.06rem); }
.sidebar-toggle:hover { background: #374f74; }
.sidebar-collapsed .sidebar-toggle { top: .75rem; left: .75rem; }
.sidebar-collapsed .main { padding-top: max(4.15rem,3.4vw); }
.side-nav { display: grid; gap: .4rem; }
.nav-btn { border: 0; background: transparent; color: #dce6fa; border-radius: .55rem; text-align: left; padding: .68rem .75rem; font-weight: 650; }
.nav-btn:hover,.nav-btn[aria-current="page"] { background: #283c62; color: #fff; }
.profile { margin-top: auto; border-top: 1px solid #3a4964; padding: 1rem .5rem 0; }
.profile strong { overflow-wrap: anywhere; }
.profile span { color: #c2cfe6; font-size: .9rem; }
.main { width: min(100%, 91rem); margin: 0 auto; padding: clamp(1rem, 3.4vw, 3.2rem); min-width: 0; align-content: start; }
.hero { padding: clamp(1.3rem,4vw,2.4rem); background: #e5edff; border: 1px solid #cbdcfb; border-radius: 1.05rem; gap: 1.25rem; }
.hero p { margin-top: .55rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: .65rem; }
.stat { display: grid; gap: .15rem; background: #fff; border: 1px solid var(--border); padding: .75rem 1rem; border-radius: .65rem; font-size: .9rem; }
.stat strong { font-size: 1.55rem; line-height: 1.25; }
.listing { display: grid; gap: .55rem; }
.sheet-row { padding: .85rem 0; display: grid; align-items: center; grid-template-columns: minmax(10rem,1.35fr) minmax(7rem,1fr) minmax(6.3rem,.6fr) auto; gap: .75rem; border-top: 1px solid #e2e9f0; }
.sheet-row strong,.sheet-row span { overflow-wrap: anywhere; }
.empty { padding: 1.65rem .8rem; text-align: center; background: #f4f7fc; border: 1px dashed #c3d0e3; border-radius: .65rem; }
.pill { display: inline-block; width: fit-content; border-radius: 1rem; padding: .2rem .55rem; font-size: .88rem; font-weight: 700; background: #e9edf4; color: #445371; white-space: nowrap; }
.pill.open { background: #dfeaff; color: #173b94; }
.pill.closed { background: #d9f4e8; color: #116141; }
.pill.status-reopened { max-width: 100%; white-space: normal; line-height: 1.18; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 36rem; }
.data-table caption { text-align: left; margin-bottom: .5rem; color: var(--muted); }
.data-table th,.data-table td { border-bottom: 1px solid #e1e8f1; text-align: left; padding: .45rem .35rem; font-size: .9rem; }
.data-table thead { background: #f0f4fa; }
.data-table td,.data-table th { vertical-align: middle; }
.grid-input { min-width: 6rem; padding: .35rem .45rem; }
.cell { display: flex; align-items: center; gap: .35rem; }
.cell > span { min-width: 1.1rem; color: var(--muted); font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.tabs .current { background: #e5edff; border-color: #a6baed; color: #1b429f; }
.accordion { border: 1px solid var(--border); border-radius: .65rem; }
.accordion summary { cursor: pointer; padding: .7rem .85rem; font-weight: 700; }
.accordion > div { padding: 0 .75rem .75rem; }
.sticky { position: sticky; bottom: 0; z-index: 2; background: #fff; box-shadow: 0 -5px 24px #253d6520; }
.toast { position: fixed; z-index: 5; right: 1rem; bottom: 1rem; width: max-content; max-width: calc(100% - 2rem); padding: .8rem 1.05rem; background: #132744; color: #fff; border-radius: .65rem; box-shadow: 0 8px 30px #18264335; }
.toast.problem { background: #841f31; }
.status-note { padding: .65rem .8rem; background: #edf3ff; border-radius: .55rem; color: #294a80; }
.paper-toolbar { gap: .55rem; }
.paper-mobile-hint { display: none; }
.paper-scroll { overflow-x: auto; padding: 0 0 1rem; }
.paper {
  width: 846px; max-width: 100%; min-width: 746px; margin: 0 auto 1.4rem; color: #111;
  background: #fff; border: 1px solid #161616; font: 12px/1.18 Arial,sans-serif;
  box-shadow: 0 4px 14px #13274415;
}
.paper-row { display: grid; }
.paper-cell {
  min-width: 0; min-height: 0; padding: 3px 4px; border-inline-end: 1px solid #151515;
  border-block-end: 1px solid #151515; display: flex; flex-direction: column;
}
.paper-row > .paper-cell:last-child { border-inline-end: 0; }
.paper-label { flex: none; font-weight: 400; }
.paper small { font-size: 10px; line-height: 1.18; }
.paper-center { align-items: center; justify-content: center; text-align: center; }
.paper-header {
  display: grid; grid-template-columns: 271fr 237fr 204fr 133fr;
  grid-template-rows: 70px 53px;
}
.paper-header > .paper-cell { font-size: 14px; }
.paper-title { text-align: center; justify-content: center; font-size: 12px !important; font-weight: 700; letter-spacing: .02em; }
.paper-title strong { font-size: 15px; }
.paper-serial { display: grid; grid-template-columns: 112fr 35fr 112fr; align-items: center; }
.paper-serial > strong { font: 19px Georgia,serif; }
.paper-serial .paper-input,.paper-serial .paper-value { font: 18px Georgia,serif; }
.paper-unit { grid-column: 4; grid-row: 1 / span 2; border-inline-end: 0; }
.paper-unit img { width: 100px; height: auto; max-width: 100%; object-fit: contain; margin: 6px 0 2px; }
.paper-plate { grid-column: 2 / span 2; }
.paper-drivers,.paper-schedule,.paper-metric { grid-template-columns: 121fr 237fr 237fr 250fr; }
.paper-drivers { min-height: 110px; }
.paper-drivers .paper-label > strong { font-size: 12px; }
.paper-driver-id { display: flex; align-items: center; gap: 3px; }
.paper-driver-id > :first-child { flex: 1; }
.paper-driver-id > :last-child { flex: 2; }
.paper-lpi { display: block; }
.paper-heading {
  text-align: center; margin: 0; padding: 4px 0 2px; border-block-end: 1px solid #151515;
  font: 700 16px/1.05 Arial,sans-serif;
}
.schedule-labels,.schedule-shift { display: grid; grid-template-rows: 46px 26px 26px 20px; }
.schedule-labels { grid-template-columns: 1fr; }
.schedule-labels > .paper-cell:nth-child(n+2) { font-size: 9px; }
.schedule-shift { grid-template-columns: 50fr 54fr 46fr 87fr; }
.schedule-shift > .paper-cell { padding: 1px 3px; }
.schedule-shift > .paper-cell:nth-child(-n+3) :is(.paper-input,.paper-value) {
  padding: 0 2px; font: 600 14px/1.2 Arial,sans-serif; white-space: nowrap;
}
.schedule-shift > .paper-cell:nth-child(-n+3) .paper-value { display: flex; align-items: center; }
.schedule-shift:last-child > :is(.paper-dispatch,.schedule-end) { border-inline-end: 0; }
.schedule-span { grid-column: 1 / span 3; }
.paper-dispatch { grid-area: 1 / 4 / span 3 / 5; align-items: stretch; text-align: center; }
.paper-dispatch strong,.paper-dispatch small { font-size: 8px; }
.paper-dispatch .paper-ink { min-height: 50px; }
.schedule-end { grid-area: 4 / 4; }
.paper-metric { min-height: 21px; }
.paper-metric .paper-cell { padding-block: 0; }
.paper-metric .paper-center { font-size: 9px; }
.metric-tall { min-height: 34px; }
.paper-mileage { grid-template-columns: 121fr 104fr 133fr 117fr 120fr 117fr 133fr; min-height: 36px; text-align: center; }
.paper-mileage .paper-label { font-size: 9px; }
.paper-bottom { display: grid; grid-template-columns: 358fr 237fr 250fr; grid-template-rows: repeat(2,92px); }
.paper-bottom > .paper-cell { text-align: center; }
.paper-bottom > .paper-cell:nth-child(odd) { border-inline-end: 0; }
.paper-bottom .paper-label,.paper-bottom small { font-size: 9px; }
.paper-bottom .paper-cell .paper-ink { align-self: center; min-width: 68%; }
.paper-events { grid-row: 1 / span 2; border-inline-end: 1px solid #111; border-block-end: 1px solid #111; }
.paper-events h3 { font: 9px/1.15 Arial,sans-serif; text-align: center; padding: 3px 0; border-block-end: 1px solid #111; }
.paper table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.paper td,.paper th { padding: 0 2px; border-inline-end: 1px solid #111; border-block-end: 1px solid #111; }
.paper td:last-child,.paper th:last-child { border-inline-end: 0; }
.paper th { font-size: 8.5px; font-weight: 400; text-align: center; }
.paper-events th:first-child,.paper-events th:nth-child(2) { width: 24%; }
.paper-events td { height: 23px; }
.paper-events tbody tr:last-child td { border-block-end: 0; }
.paper-notes { min-height: 105px; border: 0; }
.paper-notes .paper-label { font-size: 9px; }
.paper-input,.paper-value {
  flex: 1 1 auto; display: block; width: 100%; min-width: 0; min-height: 17px;
  border: 0; border-radius: 0; background: transparent; padding: 1px 2px; color: #131313; font: 12px/1.16 Arial,sans-serif;
}
.paper-value { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
.paper-input::placeholder { color: #596679; opacity: 1; font-size: 10px; }
.paper-input:not(.paper-blank):not(:focus) { box-shadow: inset 0 -1px #d6e1f8; }
.paper-input:not([readonly]):is(:focus,:hover),button.paper-ink:is(:focus,:hover) { background: #edf3ff; }
.paper-input:focus,button.paper-ink:focus { outline: 2px solid #456bd0; outline-offset: -2px; }
textarea.paper-input { resize: none; overflow: auto; }
.paper td > .paper-input,.paper td > .paper-value { height: 100%; }
.paper-ink {
  min-width: 0; width: 100%; min-height: 27px; flex: 1 1 0; align-self: stretch;
  display: grid; place-items: center; color: #264884; background: transparent;
  font: 10px/1.15 Arial,sans-serif; border: 0; border-bottom: 1px dotted #9baecc;
}
.paper-ink.readonly { color: #111; border-bottom-color: transparent; }
.paper-empty-ink { border-bottom-color: transparent; }
.paper-empty-ink:not(:focus):not(:hover) > span { visibility: hidden; }
.ink-preview { display: block; max-height: 52px; width: 100%; object-fit: contain; }
.paper-ink:not(.readonly) > .ink-preview { pointer-events: none; }
.paper-ink .ink-preview { max-width: 148px; }
.paper-cap th { padding-block: 3px; }
.paper-cap td { position: relative; height: 44px; vertical-align: top; }
.paper-cap td > .cap-confirmation {
  display: block; height: 42px; min-height: 0; padding: 3px 1px;
  font: 11px/1.1 Arial,sans-serif; box-shadow: none; overflow-wrap: anywhere;
  text-align: center; white-space: pre-wrap;
}
.paper-cap td > .cap-confirmation.cap-fc {
  padding-top: 6px; text-align: center; font: 700 28px/1 Arial,sans-serif;
}
.cap-time { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; height: 43px; }
.cap-minutes {
  display: grid; grid-template-rows: minmax(0,1fr) 1px minmax(0,1fr); row-gap: 4px;
  align-items: stretch; height: 41px; padding-right: 3px;
}
.cap-minutes::before { content: ""; grid-area: 2 / 1; background: transparent; }
.cap-time.cap-has-minute .cap-minutes::before { background: #111; }
.cap-time :is(.paper-input,.paper-value) { text-align: center; padding: 0; box-shadow: none; white-space: nowrap; overflow: hidden; }
.cap-time .cap-hour { font-size: 28px; line-height: 1; letter-spacing: -.11em; padding-right: 2px; }
.cap-time .cap-minute,.cap-time .cap-second { min-height: 0; height: 100%; font-size: 14px; line-height: 1.1; }
.cap-time .cap-minute { grid-area: 1 / 1; }
.cap-time .cap-second { grid-area: 3 / 1; font-size: 13px; }
.cap-time :is(.cap-minute,.cap-second).paper-value { display: grid; align-content: center; }
.cap-other-hour .cap-second { font-size: 10px; font-weight: 700; }
.cap-legacy { position: absolute; left: 2px; bottom: 1px; font: 10px/1 Arial,sans-serif; pointer-events: none; }
.paper-cap :is(td,th):nth-child(4n):not(:last-child) { border-inline-end: 2px solid #111; }
.paper-trip { position: absolute; bottom: 1px; right: 2px; font-size: 8px; pointer-events: none; }
.paper-ciz { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); min-height: 34px; }
.paper-ciz > .paper-cell:last-child { border-inline-end: 0; }
.paper-ciz .paper-label { font-size: 9px; }
.paper-ciz-tables { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.paper-ciz-tables > table:first-child { border-inline-end: 1px solid #111; }
.paper-ciz-tables th:first-child { width: 25%; }
.paper-ciz-tables th { height: 19px; }
.paper-ciz-tables tr:last-child td { border-block-end: 0; }
.assignment-dialog,.signature-dialog { width: min(34rem,calc(100% - 1rem)); margin: auto; max-height: 90svh; }
dialog::backdrop { background: #101c36a0; }
.signature-drawing {
  display: block; width: 100%; height: auto; aspect-ratio: 8/3; touch-action: none; cursor: crosshair;
  border: 1px solid #8194b3; border-radius: .4rem; background: #fff;
}
@media (max-width: 1000px) {
  .paper-mobile-hint { display: block; font-size: .9rem; }
}
@media (max-width: 780px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: static; gap: .8rem; padding: .8rem 1rem; }
  .sidebar-toggle { top: .8rem; left: auto; right: 1rem; }
  .sidebar-collapsed .sidebar-toggle { right: auto; }
  .side-nav { display: flex; flex-wrap: wrap; }
  .profile { display: none; }
  .login-shell { grid-template-columns: minmax(0,1fr); }
  .login-aside { gap: 1.4rem; padding: 1.3rem 1rem; }
  .login-aside h1 { font-size: 2.5rem; max-width: 20ch; }
  .login-aside p { font-size: 1rem; margin-top: .65rem; }
  .route-art { display: none; }
  .login-main { padding: 1rem; }
}
@media (max-width: 545px) {
  .sheet-row { grid-template-columns: minmax(0,1fr) auto; }
  .sheet-meta { grid-row: 2; }
  .sheet-row .button { grid-column: 2; }
  .sticky .row { gap: .45rem; }
}
