:root {
  --accent: #2F6FDB;
  --accent-600: #2459B8;
  --accent-50: #EAF1FC;
  --navy: #0F2739;
  --ink: #0F2739;
  --muted: #4A5D72;
  --line: rgba(15, 39, 57, .08);
  --line-2: rgba(15, 39, 57, .14);
  --paper: #FAF7F2;
  --card: #FFFFFF;
  --green: #1E8A55; --green-bg: #E6F4EC;
  --amber: #A9650B; --amber-bg: #FCF1DE;
  --red: #C23B32; --red-bg: #FBE9E7;
  --violet: #6B4FC4; --violet-bg: #EFEBFB;
  --blue: #2459B8; --blue-bg: #EAF1FC;
  --grey-bg: #EEF0F3;
  --shadow: 0 1px 2px rgba(15, 39, 57, .05);
  --shadow-lg: 0 24px 48px rgba(15, 39, 57, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; line-height: 24px;
  color: var(--ink); background: var(--paper); font-weight: 500; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 20px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.hide, [hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s, border-color .15s, box-shadow .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: rgba(15, 39, 57, .28); background: #FCFBF9; }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, .role-card:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #A8322A; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(15, 39, 57, .05); }
.btn.soft { background: var(--accent-50); border-color: transparent; color: var(--accent-600); }
.btn.soft:hover { background: #DCE8FA; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: #18764A; }
.btn.red-soft { background: var(--red-bg); border-color: transparent; color: var(--red); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 10px; }
.btn.xl { min-height: 56px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: rgba(15, 39, 57, .06); color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 219, .15); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A5D72' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-err { color: var(--red); background: var(--red-bg); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.pw-eye:hover { color: var(--ink); }
.search { position: relative; min-width: 140px; flex: 1 1 150px; max-width: 360px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(47, 111, 219, .14), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(15, 39, 57, .12), transparent 60%), var(--paper); }
.login-card { width: 100%; max-width: 460px; background: #fff; border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(15, 39, 57, .10); padding: 32px; }
.login-card h1 { font-size: 24px; line-height: 32px; margin-top: 24px; }
.login-card > p { margin: 4px 0 24px; }
.brand-row { display: flex; gap: 12px; align-items: center; }
.brand-name { font-weight: 700; font-size: 17px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.role-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; min-height: 64px; transition: border-color .15s, background-color .15s, transform .15s var(--ease); }
.role-card:hover { border-color: var(--accent); background: var(--accent-50); }
.role-card:active { transform: scale(.98); }
.role-card b { display: block; font-size: 14px; line-height: 20px; }
.role-card small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.role-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-50); color: var(--accent); display: grid; place-items: center; flex: none; }
.link-btn { margin: 24px auto 0; display: flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; min-height: 44px; padding: 0 8px; }
.link-btn .ic { transition: transform .2s var(--ease); }
.link-btn.open .ic { transform: rotate(180deg); }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-form p { margin: 0; }
.demo-note { margin: 24px 0 0; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--navy); color: #fff; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 24px 16px 16px 24px; }
.side-brand .logo { width: 40px; height: 40px; }
.side-brand b { display: block; font-size: 15px; line-height: 20px; }
.side-brand small { display: block; font-size: 12px; color: rgba(255, 255, 255, .6); line-height: 16px; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: rgba(255, 255, 255, .78); font-weight: 600; min-height: 44px; transition: background-color .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: var(--accent); color: #fff; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-signout { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; min-height: 44px; border: 0; background: none; color: rgba(255, 255, 255, .78); font-weight: 600; border-radius: 12px; cursor: pointer; }
.side-signout:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-credit { font-size: 12px; color: rgba(255, 255, 255, .45); padding: 4px 12px 4px; }
.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.scrim { display: none; }
.demo-strip { display: flex; align-items: center; justify-content: center; gap: 12px; background: #FFF5DD; color: #6B4B0E; font-size: 13px; line-height: 20px; padding: 4px 16px; border-bottom: 1px solid rgba(169, 101, 11, .15); }
.demo-strip .link { color: #6B4B0E; text-decoration: underline; font-size: 13px; }
.demo-strip .icon-btn { color: #6B4B0E; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 12px 32px; min-height: 72px; background: rgba(250, 247, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 24px; line-height: 32px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger { display: none; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 4px 12px 4px 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-50); color: var(--accent-600); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.uc-text b { display: block; font-size: 14px; line-height: 18px; }
.uc-text small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.content { padding: 24px 32px 48px; max-width: 1360px; width: 100%; }
.content.enter { animation: enter .35s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- cards & layout ---------- */
.card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.card.pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 17px; line-height: 24px; }
.card-head .sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.card-body { padding: 16px 24px 24px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar select { width: auto; min-width: 0; }
.page-grid { display: grid; gap: 24px; }
.cols-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 20px 24px; }
.kpi .label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 28px; line-height: 36px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value.accent { color: var(--accent); }
.kpi .value.red { color: var(--red); }
.kpi .foot { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); }
.status-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.status-tile { border-radius: 14px; padding: 12px 16px; background: var(--grey-bg); text-decoration: none; color: var(--ink); transition: transform .15s var(--ease); display: block; }
.status-tile:hover { transform: translateY(-2px); }
.status-tile .n { font-size: 24px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-tile .t { font-size: 13px; font-weight: 600; }
.status-tile.p-blue { background: var(--blue-bg); color: var(--blue); }
.status-tile.p-violet { background: var(--violet-bg); color: var(--violet); }
.status-tile.p-amber { background: var(--amber-bg); color: var(--amber); }
.status-tile.p-green { background: var(--green-bg); color: var(--green); }
.status-tile.p-red { background: var(--red-bg); color: var(--red); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; line-height: 20px; font-weight: 600; white-space: nowrap; background: var(--grey-bg); color: var(--muted); }
.p-blue { background: var(--blue-bg); color: var(--blue); }
.p-violet { background: var(--violet-bg); color: var(--violet); }
.p-amber { background: var(--amber-bg); color: var(--amber); }
.p-green { background: var(--green-bg); color: var(--green); }
.p-red { background: var(--red-bg); color: var(--red); }
.p-grey { background: var(--grey-bg); color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 640px; border-radius: 0 0 var(--r) var(--r); }
.table-wrap.tall { max-height: 72vh; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.t th { position: sticky; top: 0; z-index: 1; background: #F7F5F1; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t th.num { text-align: right; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background-color .12s; }
.t tbody tr:hover { background: #FBFAF7; }
.t tr.click { cursor: pointer; }
.t td .sub { display: block; font-size: 12px; color: var(--muted); line-height: 16px; }
.t td.actions { text-align: right; white-space: nowrap; }
.t td.actions .icon-btn { width: 36px; height: 36px; }
.t tfoot td { font-weight: 700; background: #F7F5F1; position: sticky; bottom: 0; }
.qty-low { color: var(--amber); font-weight: 700; }
.qty-out { color: var(--red); font-weight: 700; }

/* ---------- empty ---------- */
.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty p { margin: 0; }

/* ---------- chart ---------- */
.chart { position: relative; width: 100%; min-height: 240px; }
.chart.chart-sm { min-height: 180px; }
.chart svg { display: block; }
.chart .grid { stroke: rgba(15, 39, 57, .07); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: Manrope, sans-serif; font-weight: 500; }
.chart .hover-line { stroke: rgba(15, 39, 57, .2); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 12px; line-height: 18px; white-space: nowrap; box-shadow: var(--shadow-lg); }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.seg { display: inline-flex; background: var(--grey-bg); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 4px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 30px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- rows list ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); min-height: 56px; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .grow small { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
a.row { color: inherit; transition: background-color .12s; }
a.row:hover { background: #FBFAF7; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(15, 39, 57, .42); display: grid; place-items: center; padding: 24px; opacity: 0; transition: opacity .2s var(--ease); }
.modal-wrap.in { opacity: 1; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .25s var(--ease); }
.modal-wrap.in .modal { transform: none; }
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; line-height: 28px; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- toast ---------- */
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 480px; }
.toast { display: flex; gap: 8px; align-items: center; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 20px; opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast.ok .ic { color: #7CD3A4; }
.toast.err .ic { color: #FF9C93; }

/* ---------- order lines editor ---------- */
.lines-ed { display: flex; flex-direction: column; gap: 8px; }
.line-row { display: grid; grid-template-columns: 1fr 96px 120px 40px; gap: 8px; align-items: center; }
.line-row .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.lines-total { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 24px 40px; }
.timeline li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline li:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-bg); color: var(--muted); }
.tl-dot.p-blue { background: var(--blue-bg); color: var(--blue); }
.tl-dot.p-violet { background: var(--violet-bg); color: var(--violet); }
.tl-dot.p-amber { background: var(--amber-bg); color: var(--amber); }
.tl-dot.p-green { background: var(--green-bg); color: var(--green); }
.tl-dot.p-red { background: var(--red-bg); color: var(--red); }
.timeline b { display: block; }
.timeline small { color: var(--muted); font-size: 13px; }
.steps { display: flex; gap: 4px; margin: 8px 0 24px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--grey-bg); }
.steps span.on { background: var(--accent); }
.steps span.fail { background: var(--red); }
.pod { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-top: 8px; }
.pod img, .pod .sig { border-radius: 12px; border: 1px solid var(--line-2); background: #fff; }
.pod img.photo { width: 160px; height: 120px; object-fit: cover; }
.pod .sig { width: 200px; height: 60px; display: block; }
.pod-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* ---------- tracking ---------- */
.track-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; align-items: start; }
.track-list { max-height: 640px; overflow-y: auto; }
.track-list a.row.on { background: var(--accent-50); }

/* ---------- dispatch / route ---------- */
.route-card { break-inside: avoid; }
.route-card .card-head { flex-wrap: nowrap; align-items: flex-start; }
.route-card .card-head > div:first-child { flex: 1; min-width: 0; }
.route-card .card-head .btn-row { flex-wrap: nowrap; }
.route-stop { display: flex; gap: 12px; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.route-stop:last-child { border-bottom: 0; }
.stop-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.route-stop .grow { flex: 1; min-width: 0; }
.route-stop .grow small { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
.route-stop .mv { display: flex; gap: 0; }

/* ---------- rider phone view ---------- */
.rider-wrap { max-width: 560px; margin: 0 auto; }
.rider-hello { padding: 20px; background: var(--navy); color: #fff; border-radius: var(--r); }
.rider-hello small { color: rgba(255, 255, 255, .7); display: block; }
.rider-hello .big { font-size: 22px; line-height: 30px; font-weight: 700; }
.rider-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.rider-stats div { background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 8px 12px; }
.rider-stats b { display: block; font-size: 20px; line-height: 28px; }
.rider-stats span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.deliv { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.deliv-top { display: flex; gap: 12px; align-items: flex-start; }
.deliv-top .grow { flex: 1; min-width: 0; }
.deliv-top b { display: block; font-size: 16px; line-height: 22px; }
.deliv-meta { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.deliv-meta div { display: flex; gap: 8px; align-items: center; }
.deliv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deliv-actions .btn { min-height: 48px; }
.tabs { display: flex; gap: 4px; background: var(--grey-bg); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; border: 0; background: none; min-height: 40px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.sig-pad { width: 100%; height: 160px; border: 1px dashed var(--line-2); border-radius: 12px; background: #FCFBF9; touch-action: none; display: block; cursor: crosshair; }
.photo-drop { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: #FCFBF9; cursor: pointer; min-height: 72px; }
.photo-drop img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.photo-drop .ph { width: 96px; height: 72px; border-radius: 8px; background: var(--grey-bg); display: grid; place-items: center; color: var(--muted); flex: none; }
.items-mini { font-size: 13px; color: var(--muted); line-height: 20px; }
.picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.picker select { width: auto; }

/* ---------- print ---------- */
#printRoot { display: none; }
.receipt h2 { font-size: 20px; line-height: 28px; }
.receipt h3 { font-size: 16px; }
.receipt p { margin: 0; }
@media print {
  body > *:not(#printRoot) { display: none !important; }
  #printRoot { display: block !important; padding: 16px; color: #000; font-size: 13px; }
  #printRoot table { width: 100%; border-collapse: collapse; }
  #printRoot th, #printRoot td { padding: 6px 4px; border-bottom: 1px solid #ccc; text-align: left; position: static; background: none; }
  #printRoot .num { text-align: right; }
  #printRoot .pill { border: 1px solid #999; }
}

/* ---------- mobile helpers ---------- */
.show-m { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-2, .cols-even { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); width: 280px; }
  body.drawer .sidebar { transform: none; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 39, 57, .4); z-index: 35; }
  .main { margin-left: 0; }
  .hamburger { display: inline-grid; margin-left: -8px; width: 44px; height: 44px; }
  .topbar { padding: 8px 16px; min-height: 64px; gap: 8px; }
  .topbar h1 { font-size: 20px; line-height: 28px; }
  .content { padding: 16px 16px 48px; }
  .uc-text { display: none; }
  .user-chip { padding: 2px; }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 18px; line-height: 28px; overflow-wrap: anywhere; }
  .status-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .status-row .status-tile { padding: 8px 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .card.pad { padding: 16px; }
  .card-head { padding: 12px 16px; }
  .card-body { padding: 12px 16px 16px; }
  .row { padding: 12px 16px; }
  .route-stop { padding: 12px 16px; }
  .toolbar { gap: 8px; }
  .toolbar > * { flex: 1 1 140px; }
  .toolbar select { min-width: 0; width: 100%; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .toolbar .spacer { display: none; }
  .btn, .icon-btn, input, select, .seg button, .tabs button { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn.sm { min-height: 40px; }
  /* stacked card tables */
  .table-wrap { max-height: none; overflow: visible; }
  table.t.stack-m thead { display: none; }
  table.t.stack-m, .t.stack-m tbody, .t.stack-m tr, .t.stack-m td { display: block; width: 100%; }
  .t.stack-m tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .t.stack-m tbody tr:last-child { border-bottom: 0; }
  .t.stack-m td { border: 0; padding: 2px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; text-align: right; justify-items: end; align-items: center; }
  .t.stack-m td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; grid-row: 1 / span 3; align-self: start; justify-self: start; }
  .t.stack-m td.hm { display: none; }
  .t.stack-m td.lead { text-align: left; display: block; justify-items: normal; font-size: 15px; padding-bottom: 4px; }
  .t.stack-m td.lead::before { display: none; }
  .t.stack-m td.actions { display: flex; justify-content: flex-end; padding-top: 8px; }
  .t.stack-m td.actions::before { display: none; }
  .t.stack-m td.chk { display: none; }
  .t.stack-m tfoot { display: block; }
  .t.stack-m tfoot tr { display: block; padding: 12px 16px; background: #F7F5F1; }
  .t.stack-m tfoot td { position: static; background: none; }
  .t.stack-m td:empty { display: none; }
  .line-row { grid-template-columns: 1fr 72px 44px; }
  .line-row .amt { display: none; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal { max-width: none !important; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .modal-foot .btn { flex: 1; }
  .role-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 16px; }
  .demo-strip { justify-content: space-between; padding: 4px 8px 4px 16px; }
  .demo-strip span { flex: 1; }
  .route-card .card-head { flex-wrap: wrap; }
  .route-stop { flex-wrap: wrap; row-gap: 4px; }
  .route-stop .grow { flex-basis: calc(100% - 40px); }
  .route-stop .pill { margin-left: 40px; }
  .route-stop .mv { margin-left: auto; }
  .toolbar.daybar > * { flex: none; }
  .toolbar.daybar input[type=date] { flex: 1 1 140px !important; }
  .toolbar.daybar .muted { flex-basis: 100%; }
  .chart-legend-row { flex-direction: column; align-items: flex-start !important; }
  .hide-m, .hide-m-empty { display: none; }
  .track-grid { grid-template-columns: 1fr; }
  .show-m { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Shared demo strip colours: identical on every EulClavie demo */
.demo-strip { background: #FFF6E5; color: #6B4A00; border-bottom: 1px solid rgba(183, 121, 31, .22); font-size: 13px; line-height: 20px; font-weight: 500; }
.demo-strip .ic, .demo-strip > svg { color: #6B4A00; }
.demo-strip .link { color: #6B4A00; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; }
.demo-strip .link:hover { background: rgba(183, 121, 31, .12); }
.demo-strip .icon-btn { color: #6B4A00; text-decoration: none; background: none; }
.demo-strip .icon-btn:hover { background: rgba(183, 121, 31, .14); color: #6B4A00; }
