:root {
  --ink: #14221f;
  --muted: #6f7c78;
  --line: #dfe6e3;
  --soft: #f4f7f5;
  --paper: #ffffff;
  --green: #174c43;
  --green-2: #23695d;
  --mint: #dff2e9;
  --lime: #c9ef7b;
  --orange: #e97b41;
  --sand: #f3e6d0;
  --red: #c84d4d;
  --blue: #427a99;
  --shadow: 0 12px 38px rgba(22, 51, 44, .09);
  --radius: 18px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: #edf2ef;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(35,105,93,.22);
  outline-offset: 2px;
}
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 26px 18px 16px;
  background: #102d28;
  color: #dce9e5;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 25px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--lime); color: #102d28;
  font-weight: 900; font-size: 22px; transform: rotate(-5deg);
}
.brand strong, .brand small { display: block; letter-spacing: .13em; }
.brand strong { font-size: 16px; }
.brand small { font-size: 8px; margin-top: 2px; color: #9fb8b1; }
.main-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #b9ccc6;
  min-height: 44px; padding: 0 12px; border-radius: 11px;
  display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer;
  transition: .18s ease;
}
.nav-item > span { width: 21px; text-align: center; font-size: 18px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: #f5f8f6; color: #173c35; font-weight: 750; }
.nav-count { margin-left: auto; border-radius: 999px; background: #d8f597; color: #1e463b; font-size: 11px; padding: 2px 7px; }
.nav-divider { color: #739088; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; padding: 20px 12px 7px; }
.sidebar-card { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.06); padding: 12px; border-radius: 13px; }
.sidebar-card strong, .sidebar-card small { display: block; }
.sidebar-card strong { font-size: 12px; }
.sidebar-card small { color: #91aca4; font-size: 10px; margin-top: 2px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(201,239,123,.1); }
.sidebar-footer { text-align: center; color: #52756b; font-size: 9px; padding-top: 12px; letter-spacing: .08em; }
.main-area { min-width: 0; width: calc(100% - var(--sidebar)); margin-left: var(--sidebar); }
.topbar {
  height: 72px; position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); padding: 0 28px;
  display: flex; align-items: center; gap: 18px;
}
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: 9px; font-weight: 800; color: var(--muted); }
.branch-control button { border: 0; background: transparent; padding: 3px 0 0; font-weight: 750; cursor: pointer; }
.branch-control button span { color: var(--muted); margin-left: 5px; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search-button {
  width: min(340px, 27vw); height: 40px; border: 1px solid var(--line); background: var(--soft);
  border-radius: 11px; color: #7b8783; display: flex; align-items: center; gap: 10px; padding: 0 11px; cursor: pointer;
}
.search-button span:first-child { font-size: 21px; color: #2c5148; }
.search-button kbd { margin-left: auto; font-size: 10px; border: 1px solid #d4dcda; background: white; border-radius: 5px; padding: 2px 5px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; position: relative; }
.notification-button i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); position: absolute; top: 8px; right: 8px; border: 2px solid white; }
.user-button { height: 44px; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; cursor: pointer; border-radius: 12px; padding: 3px 6px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #e1efe9; color: var(--green); border-radius: 10px; font-size: 11px; font-weight: 850; }
.avatar.small { width: 30px; height: 30px; }
.avatar.alt { background: #e1eafa; color: #355e8a; }
.avatar.dark { background: #183e37; color: white; }
.avatar.sand { background: var(--sand); color: #815927; }
.user-copy { text-align: left; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.menu-button { display: none; }
.popover { position: fixed; z-index: 80; top: 64px; right: 22px; width: 280px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; padding: 12px; }
.popover > .eyebrow { padding: 4px 6px 9px; }
.role-popover button { width: 100%; border: 0; background: white; border-radius: 11px; padding: 8px; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.role-popover button:hover, .role-popover button.selected { background: var(--soft); }
.role-popover strong, .role-popover small { display: block; }
.role-popover small { color: var(--muted); font-size: 10px; margin-top: 2px; }

main { padding: 30px clamp(18px, 3vw, 40px) 60px; max-width: 1580px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 5px 0 5px; font-size: clamp(25px, 3vw, 35px); letter-spacing: -.04em; }
.page-head p { color: var(--muted); margin: 0; }
.head-actions { display: flex; gap: 9px; align-items: center; }
.btn { border: 1px solid var(--line); background: white; min-height: 41px; border-radius: 11px; padding: 0 15px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(20,50,43,.08); }
.btn-primary { background: var(--green); color: white; border-color: var(--green); }
.btn-lime { background: var(--lime); color: #193e36; border-color: var(--lime); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); }
.btn.small { min-height: 33px; padding: 0 11px; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card, .card { background: var(--paper); border: 1px solid rgba(205,218,213,.8); border-radius: var(--radius); box-shadow: 0 1px 1px rgba(20,45,39,.02); }
.stat-card { padding: 18px; position: relative; overflow: hidden; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-icon { width: 34px; height: 34px; background: var(--soft); border-radius: 10px; display: grid; place-items: center; color: var(--green); font-weight: 900; }
.stat-card strong { display: block; font-size: 29px; margin: 12px 0 4px; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); }
.trend-up { color: #2e7964 !important; }
.trend-warn { color: var(--orange) !important; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(290px,.75fr); gap: 18px; }
.card { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.card-head h2, .card-head h3 { margin: 0; letter-spacing: -.02em; }
.card-head h2 { font-size: 18px; }
.card-head h3 { font-size: 15px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.segment-control { display: inline-flex; background: var(--soft); padding: 3px; border-radius: 10px; }
.segment-control button { border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; font-size: 11px; color: var(--muted); cursor: pointer; }
.segment-control button.active { background: white; box-shadow: 0 1px 5px rgba(18,45,38,.08); color: var(--ink); font-weight: 750; }
.route-board { display: grid; gap: 12px; }
.route-row { padding: 14px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: minmax(170px,1fr) minmax(180px,1.5fr) 88px; gap: 16px; align-items: center; }
.route-main { display: flex; gap: 11px; align-items: center; }
.route-code { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; background: #e6f0ec; color: var(--green); font-weight: 900; font-size: 11px; }
.route-code.orange { background: #fff0e8; color: #a44c22; }
.route-code.blue { background: #e8f0f4; color: #316680; }
.route-main strong, .route-main small { display: block; }
.route-main small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.progress { height: 7px; background: #edf1ef; border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }
.route-progress small { color: var(--muted); font-size: 10px; }
.route-time { text-align: right; }
.route-time strong, .route-time small { display: block; }
.route-time strong { font-size: 12px; }
.route-time small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.quick-action { border: 1px solid var(--line); background: white; border-radius: 14px; padding: 14px; text-align: left; cursor: pointer; min-height: 112px; transition: .16s; }
.quick-action:hover { border-color: #9ebbb3; transform: translateY(-2px); }
.quick-action span { width: 32px; height: 32px; background: var(--mint); border-radius: 10px; display: grid; place-items: center; font-size: 17px; margin-bottom: 12px; }
.quick-action strong, .quick-action small { display: block; }
.quick-action small { color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.35; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.activity-item:last-child { border: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green-2); }
.activity-dot.orange { background: var(--orange); }
.activity-dot.blue { background: var(--blue); }
.activity-item p { margin: 0; font-size: 12px; line-height: 1.4; }
.activity-item small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.role-strip { display: flex; align-items: center; gap: 10px; background: #e6f1ed; color: #2b594f; border-radius: 12px; padding: 11px 14px; margin-bottom: 18px; }
.role-strip strong { font-size: 12px; }
.role-strip span:last-child { margin-left: auto; font-size: 11px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar-search { min-width: 220px; flex: 1; max-width: 420px; position: relative; }
.toolbar-search span { position: absolute; left: 13px; top: 10px; color: var(--muted); font-size: 18px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  width: 100%; min-height: 42px; border: 1px solid #d8e1de; background: white; border-radius: 10px; padding: 10px 12px; color: var(--ink);
}
.toolbar-search input { padding-left: 38px; }
.toolbar select { width: auto; min-width: 150px; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { padding: 12px 15px; text-align: left; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; background: #f6f8f7; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #e8edeb; font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f9fbfa; }
.cell-title strong, .cell-title small { display: block; }
.cell-title small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.code { font-weight: 850; letter-spacing: .02em; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; background: #edf1ef; color: #5f6e69; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.transit { background: #e4f0ec; color: #2e6c5d; }
.status.pending { background: #fff0df; color: #a35a22; }
.status.delivered { background: #e5f3de; color: #4c7534; }
.status.problem { background: #f9e5e5; color: #a43e3e; }
.status.info { background: #e4eef5; color: #3c6d89; }
.avatar-group { display: flex; }
.avatar-group .mini-person { margin-left: -5px; }
.mini-person { width: 27px; height: 27px; border-radius: 9px; border: 2px solid white; background: #dfece7; display: grid; place-items: center; font-size: 8px; font-weight: 800; }
.mini-person:first-child { margin-left: 0; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state span { display: block; font-size: 32px; margin-bottom: 10px; }

.split-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(290px,.65fr); gap: 18px; }
.dispatch-card { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.dispatch-card:last-child { border: 0; }
.truck-tile { width: 58px; height: 58px; border-radius: 14px; background: #e7f0ed; color: var(--green); display: grid; place-items: center; font-size: 24px; }
.dispatch-card h3 { margin: 0 0 5px; font-size: 14px; }
.dispatch-meta { color: var(--muted); font-size: 11px; display: flex; flex-wrap: wrap; gap: 5px 13px; }
.dispatch-side { text-align: right; }
.dispatch-side strong, .dispatch-side small { display: block; }
.dispatch-side small { color: var(--muted); margin-top: 4px; }
.metric-list { display: grid; gap: 10px; }
.metric-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.metric-row:last-child { border-bottom: 0; }
.metric-row span { color: var(--muted); }
.metric-row strong { font-size: 13px; }
.fleet-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.vehicle-card { padding: 18px; }
.vehicle-top { display: flex; justify-content: space-between; gap: 10px; }
.vehicle-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--mint); display: grid; place-items: center; font-size: 20px; }
.vehicle-card h3 { margin: 15px 0 4px; font-size: 16px; }
.vehicle-card > p { color: var(--muted); margin: 0 0 16px; font-size: 11px; }
.km-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; }
.km-row span { color: var(--muted); }
.vehicle-card .progress { margin: 8px 0 0; }

.master-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.master-tabs::-webkit-scrollbar { display: none; }
.master-tabs button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 9px 13px; white-space: nowrap; cursor: pointer; font-size: 11px; }
.master-tabs button.active { background: var(--green); color: white; border-color: var(--green); }
.master-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 16px 0; }
.master-summary .card { padding: 15px; }
.master-summary span, .master-summary strong { display: block; }
.master-summary span { color: var(--muted); font-size: 10px; }
.master-summary strong { font-size: 21px; margin-top: 7px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(6,25,21,.58); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; }
.modal { background: white; width: min(760px,100%); max-height: calc(100vh - 36px); overflow: auto; border-radius: 22px; box-shadow: 0 25px 80px rgba(5,25,20,.28); }
.modal.wide { width: min(1040px,100%); }
.modal.small { width: min(480px,100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); background: white; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.close-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); cursor: pointer; }
.modal-body { padding: 22px; }
.modal-footer { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); background: white; }
.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-bottom: 24px; }
.step { border-top: 3px solid #dfe6e3; padding-top: 8px; color: var(--muted); font-size: 10px; }
.step.active, .step.done { border-color: var(--green-2); color: var(--green); font-weight: 750; }
.step-panel[hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 15px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-weight: 700; font-size: 11px; }
.field label small { color: var(--muted); font-weight: 500; }
.field textarea { min-height: 88px; resize: vertical; }
.helper { color: var(--muted); font-size: 10px; line-height: 1.45; margin: 6px 0 0; }
.choice-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { min-height: 76px; border: 1px solid var(--line); border-radius: 12px; padding: 11px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.choice label strong { font-size: 11px; }
.choice label small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.choice input:checked + label { border-color: var(--green); box-shadow: 0 0 0 2px rgba(35,105,93,.12); background: #f1f8f5; }
.charge-box { background: #f3f7f5; border: 1px solid #dde8e4; border-radius: 14px; padding: 15px; margin-top: 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.charge-box span, .charge-box strong { display: block; }
.charge-box span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.charge-box strong { margin-top: 5px; font-size: 16px; }
.dropzone { border: 1.5px dashed #bfcfca; background: #f8faf9; border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; }
.dropzone strong, .dropzone small { display: block; }
.dropzone strong { margin: 8px 0 4px; }
.dropzone small { color: var(--muted); }
.dropzone .upload-icon { margin: auto; width: 39px; height: 39px; border-radius: 12px; background: var(--mint); display: grid; place-items: center; color: var(--green); font-size: 20px; }
.file-preview { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--soft); border-radius: 10px; margin-top: 8px; }
.file-preview span { color: var(--green); font-size: 20px; }
.file-preview small { margin-left: auto; color: var(--muted); }
.summary-sheet { border: 1px solid var(--line); border-radius: 16px; padding: 19px; }
.summary-top { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.summary-top h3 { margin: 4px 0; }
.summary-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; padding: 15px 0; }
.summary-item span, .summary-item strong { display: block; }
.summary-item span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.summary-item strong { margin-top: 4px; font-size: 12px; }
.qr-box { width: 104px; height: 104px; display: grid; grid-template-columns: repeat(21,1fr); grid-template-rows: repeat(21,1fr); border: 7px solid white; outline: 1px solid var(--line); background: white; flex-shrink: 0; }
.qr-box i { background: white; }
.qr-box i.on { background: #102d28; }
.detail-timeline { display: grid; margin-top: 18px; }
.timeline-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; position: relative; padding-bottom: 18px; }
.timeline-row:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 21px; bottom: 0; width: 1px; background: #dce5e1; }
.timeline-dot { width: 25px; height: 25px; border-radius: 50%; background: var(--mint); color: var(--green); display: grid; place-items: center; font-size: 10px; z-index: 1; }
.timeline-row p { margin: 1px 0 3px; font-weight: 700; font-size: 11px; }
.timeline-row small { color: var(--muted); }
.search-results { display: grid; gap: 7px; margin-top: 14px; }
.search-result { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 1px solid var(--line); background: white; border-radius: 11px; padding: 10px; text-align: left; cursor: pointer; }
.search-result > span:first-child { width: 35px; height: 35px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.scan-frame { width: min(300px,100%); aspect-ratio: 1; margin: auto; border-radius: 18px; background: #18322d; position: relative; overflow: hidden; display: grid; place-items: center; color: #8ba79f; }
.scan-frame::before { content: ""; position: absolute; z-index: 2; width: 70%; height: 70%; border: 2px solid var(--lime); border-radius: 13px; }
.scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scan-line { position: absolute; z-index: 3; left: 17%; right: 17%; top: 50%; height: 2px; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: scanner 2s ease-in-out infinite; }
@keyframes scanner { 0%,100% { transform: translateY(-80px); } 50% { transform: translateY(80px); } }
.scanner-status { text-align: center; color: var(--muted); line-height: 1.45; margin: 16px 0 12px; }
.manual-scan { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.flow-banner { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.flow-banner span { flex: 1; min-width: 150px; background: var(--mint); border: 1px solid #dceae5; border-radius: 11px; padding: 10px 12px; color: var(--green); font-size: 11px; font-weight: 800; }
.check-field label { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; }
.check-field input { width: auto; min-height: 0; }
.valuation-box { grid-template-columns: repeat(3,1fr); }
.valuation-box .total { border-left: 2px solid var(--lime); padding-left: 14px; }
.assignment-summary { background: var(--mint); border: 1px solid #dceae5; border-radius: 13px; padding: 15px; margin-bottom: 17px; }
.assignment-summary strong, .assignment-summary small { display: block; }
.assignment-summary small { color: var(--muted); margin-top: 5px; }
.label-sheet { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.parcel-label { border: 2px solid #143b34; border-radius: 10px; padding: 13px; break-inside: avoid; background: white; }
.parcel-label header, .parcel-label footer { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; letter-spacing: .04em; }
.parcel-route { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; padding: 8px 0; border-block: 1px solid #cbd8d4; font-size: 17px; }
.parcel-body { display: grid; grid-template-columns: 1fr 96px; align-items: center; gap: 10px; }
.parcel-body > div:first-child > span, .parcel-body small { display: block; }
.parcel-body > div:first-child > strong { display: block; font-size: 30px; margin: 3px 0 9px; }
.parcel-body small { color: #38544e; line-height: 1.4; }
.parcel-label .qr-box { width: 92px; height: 92px; border-width: 5px; }
.parcel-label footer { border-top: 1px solid #cbd8d4; margin-top: 11px; padding-top: 8px; font-family: ui-monospace, monospace; }
.formal-receipt { border: 2px solid #182d29; padding: 20px; color: #152b27; background: white; }
.formal-receipt header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 2px solid #182d29; }
.formal-receipt header strong { font-size: 24px; }
.formal-receipt header > div:last-child { text-align: right; }
.formal-receipt header small, .formal-receipt span, .formal-receipt small { display: block; }
.receipt-parties, .receipt-values { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid #182d29; border-top: 0; }
.receipt-parties > div, .receipt-values > div { padding: 11px; border-right: 1px solid #182d29; }
.receipt-parties > div:last-child, .receipt-values > div:last-child { border-right: 0; }
.receipt-parties span, .receipt-values span { font-size: 9px; text-transform: uppercase; color: #526b65; }
.receipt-checks { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid #182d29; border-top: 0; padding: 10px; font-size: 11px; }
.formal-receipt table { width: 100%; border-collapse: collapse; font-size: 11px; }
.formal-receipt th, .formal-receipt td { border: 1px solid #182d29; padding: 8px; text-align: left; }
.formal-receipt td:last-child { text-align: right; white-space: nowrap; }
.receipt-total { font-weight: 900; font-size: 13px; }
.receipt-values { grid-template-columns: 1fr 1fr 2fr; }
.formal-receipt > footer { display: flex; justify-content: space-between; padding-top: 12px; font-size: 10px; }
.scan-line { position: absolute; width: 70%; height: 2px; top: 25%; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: scan 2.3s infinite ease-in-out; }
@keyframes scan { 50% { top: 75%; } }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 160; display: grid; gap: 8px; }
.toast { background: #133a32; color: white; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 15px; display: flex; gap: 9px; align-items: center; min-width: 260px; animation: toastIn .25s ease; }
.toast span { color: var(--lime); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }
.mobile-nav { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(7,25,21,.5); z-index: 45; }
.desktop-only { display: inline-flex; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .split-layout { grid-template-columns: 1fr; }
  .fleet-grid { grid-template-columns: repeat(2,1fr); }
  .search-button { width: 42px; padding: 0; justify-content: center; }
  .search-button span:nth-child(2), .search-button kbd { display: none; }
}
@media (max-width: 860px) {
  :root { --sidebar: 262px; }
  .sidebar { transform: translateX(-105%); transition: transform .24s ease; box-shadow: 20px 0 50px rgba(7,25,21,.2); }
  .sidebar.open { transform: translateX(0); }
  .main-area { width: 100%; margin-left: 0; }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { padding: 0 15px; }
  .branch-control .eyebrow { display: none; }
  .branch-control button { font-size: 12px; }
  .user-copy, .user-button > span:last-child { display: none; }
  main { padding-bottom: 88px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5,1fr); position: fixed; z-index: 44; inset: auto 0 0; height: 70px; padding: 6px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; cursor: pointer; }
  .mobile-nav button span { font-size: 18px; }
  .mobile-nav button.active { color: var(--green); font-weight: 800; }
  .mobile-nav .mobile-create span { width: 43px; height: 43px; background: var(--green); color: white; border-radius: 14px; display: grid; place-items: center; font-size: 25px; box-shadow: 0 7px 18px rgba(23,76,67,.25); }
}
@media (max-width: 640px) {
  .topbar { height: 62px; gap: 9px; }
  .top-actions { gap: 5px; }
  .notification-button { display: none; }
  .icon-button, .search-button { width: 38px; height: 38px; }
  main { padding: 20px 13px 90px; }
  .page-head { align-items: flex-start; margin-bottom: 18px; }
  .page-head p { font-size: 12px; line-height: 1.4; }
  .head-actions .btn:not(.btn-primary):not(.btn-lime) { display: none; }
  .head-actions .btn { min-height: 39px; padding: 0 12px; font-size: 12px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-top { font-size: 10px; }
  .stat-icon { width: 29px; height: 29px; }
  .stat-card strong { font-size: 24px; margin-top: 9px; }
  .stat-card small { font-size: 9px; }
  .card { padding: 16px; border-radius: 15px; }
  .card-head { align-items: flex-start; }
  .segment-control { display: none; }
  .route-row { grid-template-columns: 1fr auto; gap: 12px; }
  .route-progress { grid-column: 1 / -1; grid-row: 2; }
  .route-time { grid-column: 2; grid-row: 1; }
  .quick-grid { grid-template-columns: repeat(2,1fr); }
  .quick-action { min-height: 105px; padding: 12px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-search { min-width: 100%; max-width: none; }
  .toolbar select { flex: 1; min-width: 0; }
  .desktop-only { display: none; }
  .table-card { margin-inline: -13px; border-radius: 0; border-left: 0; border-right: 0; }
  .data-table { min-width: 720px; }
  .dispatch-card { grid-template-columns: 48px 1fr; }
  .truck-tile { width: 46px; height: 46px; }
  .dispatch-side { grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: center; }
  .fleet-grid { grid-template-columns: 1fr; }
  .master-summary { grid-template-columns: repeat(3,1fr); }
  .master-summary .card { padding: 11px; }
  .master-summary strong { font-size: 17px; }
  .master-summary span { font-size: 8px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal, .modal.wide, .modal.small { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-head, .modal-body { padding: 17px; }
  .modal-footer { padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); }
  .steps { gap: 3px; }
  .step { font-size: 8px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field.full { grid-column: auto; }
  .choice-grid { grid-template-columns: repeat(2,1fr); }
  .charge-box { grid-template-columns: repeat(2,1fr); }
  .label-sheet { grid-template-columns: 1fr; }
  .receipt-parties, .receipt-values, .receipt-checks { grid-template-columns: 1fr; }
  .receipt-parties > div, .receipt-values > div { border-right: 0; border-bottom: 1px solid #182d29; }
  .formal-receipt header { flex-direction: column; }
  .formal-receipt header > div:last-child { text-align: left; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-top { align-items: flex-start; }
  .qr-box { width: 88px; height: 88px; }
  .toast-stack { left: 12px; right: 12px; bottom: 80px; }
  .toast { min-width: 0; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .page-head, .toolbar, .btn, .no-print { display: none !important; }
  .main-area { margin: 0; width: 100%; }
  main { max-width: none; padding: 0; }
  body { background: white; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .data-table { min-width: 0; font-size: 10px; }
  .data-table th, .data-table td { padding: 7px; }
  .print-title { display: block !important; }
  .modal-backdrop { position: static; display: block; background: white; padding: 0; }
  .modal { width: 100% !important; max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
  .modal-head, .modal-footer { display: none !important; }
  .modal-body { padding: 0; }
  .manifest .summary-top { padding-top: 0; }
  .print-modal .modal-body { padding: 0; }
  .label-sheet { grid-template-columns: repeat(2,1fr); gap: 7mm; }
  .parcel-label { min-height: 68mm; border-radius: 0; }
  .formal-receipt { margin: 0; border-color: #000; }
}
