:root {
    --bg: #e9ece9;
    --surface: #fff;
    --raised: #dce3dc;
    --ink: #20221f;
    --secondary: #465047;
    --muted: #586454;
    --line: #bac6b9;
    --green: #245740;
    --green-light: #dfeae1;
    --amber: #795718;
    --amber-light: #f4eddf;
    --red: #9b3330;
    --red-light: #f7e9e6;
    --sidebar: 248px;
    color-scheme: light;
    font-synthesis: none;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; scrollbar-color: #bac2b6 var(--bg); scrollbar-width: thin; }
html.crm-modal-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif; -webkit-font-smoothing: antialiased; }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color: transparent; }
button,a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a { color: var(--green); }
button,a,input,select,textarea,summary { outline-offset: 3px; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible { outline: 3px solid #53765b; }
[hidden] { display: none !important; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3,strong,b { font-weight: 550; }
h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.025em; }
h2 { font-size: 25px; line-height: 1.25; letter-spacing: -.015em; }
h3 { font-size: 21px; line-height: 1.3; }
small,.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-icon { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 28px 16px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.brand { display: block; color: var(--ink); text-decoration: none; margin: 0 4px 28px; }
.brand-logo { display: block; width: 100%; height: auto; }
.brand-caption { display: block; margin-top: 16px; font-size: 14px; color: var(--secondary); }
#navigation { display: flex; flex-direction: column; gap: 4px; }
.nav-button { display: flex; align-items: center; min-height: 48px; width: 100%; padding: 10px 12px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: transparent; color: var(--secondary); text-align: left; font-size: 17px; line-height: 24px; }
.nav-button:hover { color: var(--ink); background: var(--raised); }
.nav-button.active { color: var(--surface); border-left-color: var(--green); background: var(--green); font-weight: 550; }
.workspace { margin-left: var(--sidebar); padding: 0 32px; max-width: 1800px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 80px; border-bottom: 1px solid var(--line); }
.topbar-caption { font-size: 15px; color: var(--secondary); }
.topbar-caption strong { font-weight: 400; }
.actor-menu { display: flex; align-items: center; gap: 16px; }
.actor-name { font-size: 16px; max-width: 240px; overflow-wrap: anywhere; }
.actor-menu form { margin: 0; flex: none; }
.logout-button { white-space: nowrap; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--secondary); font-size: 28px; line-height: 1; }
.icon-button:hover { background: var(--raised); color: var(--ink); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 0 24px; }
.page-heading p { font-size: 16px; color: var(--secondary); margin-top: 8px; max-width: 720px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 20px; border: 1px solid #a6b5a2; border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 500; line-height: 24px; text-decoration: none; }
.button:hover { background: var(--raised); border-color: #85957f; }
.button.primary { background: var(--green); border-color: var(--green); color: white; }
.button.primary:hover { background: #194832; border-color: #194832; }
.button.danger { background: transparent; color: var(--red); border-color: #d6afa9; }
.button.danger:hover { background: var(--red-light); }
.button.small { min-height: 44px; padding: 8px 12px; font-size: 14px; line-height: 24px; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 8px; font-size: 14px; font-weight: 500; }
.sync-bar { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 20px; padding: 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 14px; }
#data-status { min-width: 0; margin-right: auto; overflow-wrap: anywhere; }
#queue-count { display: inline-block; min-width: 20px; margin-left: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 3px; background: var(--raised); color: var(--secondary); font-size: 14px; line-height: 20px; white-space: normal; }
.badge.good { color: var(--green); background: var(--green-light); }
.badge.wait { color: var(--amber); background: var(--amber-light); }
.badge.bad { color: var(--red); background: var(--red-light); }
.metric-grid { display: flex; flex-wrap: wrap; align-items: start; gap: 24px 0; border-top: 2px solid var(--green); border-bottom: 1px solid var(--line); margin-bottom: 28px; padding: 20px 0; background: var(--surface); }
.metric { flex: 1 1 200px; min-width: min-content; max-width: 100%; padding: 4px 16px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-label { margin-bottom: 12px; font-size: 15px; color: var(--secondary); }
.metric-value { font-size: 36px; font-weight: 500; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric.emphasis .metric-value { color: var(--green); font-size: 44px; }
.metric small { display: block; margin-top: 8px; font-size: 14px; }
.panel { min-width: 0; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 16px 16px; }
.panel-head p { margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 800px; }
.panel-body { padding: 4px 16px 20px; }
.empty { padding: 16px 16px 24px; text-align: left; color: var(--secondary); font-size: 16px; }
.empty strong { display: block; margin-bottom: 4px; font-size: 19px; color: var(--ink); }
.loading { padding: 24px 16px; color: var(--secondary); }
.table-wrap { max-width: 100%; overflow: auto; border-bottom: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 960px; table-layout: fixed; text-align: left; font-size: 16px; }
table:has(th:nth-child(3):last-child) { min-width: 640px; }
table:has(th.col-note) { min-width: 1080px; }
table:has(th.col-money) { min-width: 1008px; }
table th:first-child:not(.col-date) { width: 220px; }
th { position: sticky; top: 0; z-index: 1; background: var(--raised); color: var(--secondary); font-size: 14px; font-weight: 500; line-height: 20px; }
th,td { padding: 16px 12px; vertical-align: middle; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th:first-child,td:first-child { padding-left: 16px; }
th:last-child,td:last-child { padding-right: 16px; }
tr:last-child td { border-bottom: 0; }
td .muted { display: block; margin-top: 4px; font-size: 14px; }
td.num { text-align: right; }
.col-money { width: 192px; text-align: right; }
.col-action { width: 172px; }
.col-small { width: 140px; }
.col-date { width: 156px; }
.col-note { width: 240px; }
tr[data-open] { cursor: pointer; }
tr[data-open]:hover { background: #e8eee5; }
tr[data-open]:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .search { min-width: 240px; max-width: 460px; flex: 1; }
.toolbar .result-count { margin-left: auto; color: var(--muted); font-size: 14px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px; font-size: 14px; color: var(--secondary); }
.compact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; align-items: start; }
.trip-card { min-width: 0; border: 1px solid var(--line); border-top: 2px solid var(--green); border-radius: 4px; padding: 20px 16px; margin-bottom: 24px; background: var(--surface); }
.trip-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.trip-head p { margin-top: 8px; font-size: 15px; color: var(--muted); }
.invoice-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.invoice-row:last-child { padding-bottom: 0; }
.invoice-info { min-width: 0; overflow-wrap: anywhere; }
.invoice-info p { margin-top: 6px; font-size: 16px; color: var(--secondary); }
.invoice-info .badge { margin-top: 8px; }
.driver-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 340px; }
.driver-actions .button { min-height: 48px; font-size: 16px; }
.cash-driver { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 16px; border-bottom: 1px solid var(--line); }
.cash-driver p { margin-top: 8px; font-size: 15px; color: var(--muted); }
.cash-driver .amount { margin-right: 20px; font-size: 36px; letter-spacing: -.035em; }
.notice { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; align-items: center; gap: 16px; max-width: min(560px,calc(100vw - 32px)); max-height: 200px; overflow: auto; padding: 8px 8px 8px 20px; background: var(--ink); color: white; border-radius: 4px; box-shadow: 0 8px 24px #20221f18; font-size: 16px; }
.notice.error { background: #802c2c; }
.notice button { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border: 0; background: transparent; color: white; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; padding: 0 0 24px; color: var(--muted); font-size: 14px; }
dialog { position: fixed; inset: 24px 0 auto; width: min(760px,calc(100vw - 40px)); max-height: calc(100dvh - 48px); margin: 0 auto; padding: 0; border: 1px solid #bec7b7; border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 48px #20221f26; overflow: auto; }
dialog::backdrop { background: #20221f70; }
dialog.document-editor { height: min(800px,calc(100dvh - 48px)); }
#editor-form { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); padding: 24px; }
dialog.document-editor #editor-form { height: 100%; }
.dialog-header { display: flex; flex: none; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.dialog-header h2 { padding-top: 8px; font-size: 28px; }
.dialog-header .icon-button { margin-top: -4px; margin-right: -8px; border: 0; flex: none; }
#form-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: visible; padding: 4px; margin: 0 -4px; }
.form-error { flex: none; min-height: 40px; max-height: 96px; overflow: auto; padding: 4px 0 12px; color: var(--red); font-size: 15px; line-height: 22px; }
.dialog-footer { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); background: var(--surface); }
.dialog-footer>span { max-width: 240px; margin-right: auto; font-size: 14px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 0 20px; }
.field { display: block; min-width: 0; position: relative; }
.field.full { grid-column: 1/-1; }
.field>label { display: block; min-height: 24px; margin-bottom: 8px; color: var(--secondary); font-size: 16px; font-weight: 500; }
.field-error { min-height: 32px; max-height: 52px; overflow: auto; padding-top: 4px; color: var(--red); font-size: 14px; line-height: 20px; }
.field-hint { padding-bottom: 8px; font-size: 14px; color: var(--muted); }
.staff-table table { min-width: 720px; }
.staff-editor .field-error { min-height: 24px; }
.staff-editor .dialog-footer>#draft-status:empty { display: none; }
.staff-access-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; height: 50px; padding: 8px 12px; border: 1px solid #a6b3a2; border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 17px; text-align: left; white-space: nowrap; }
.staff-access-toggle-track { display: block; flex: none; width: 40px; height: 24px; padding: 3px; border-radius: 12px; background: #778171; }
.staff-access-toggle-track>span { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.staff-access-toggle[aria-checked=true] .staff-access-toggle-track { background: var(--green); }
.staff-access-toggle[aria-checked=true] .staff-access-toggle-track>span { transform: translateX(16px); }
.staff-access-panel { min-width: 0; margin: 4px 0 0; padding: 16px 0 4px; border-top: 1px solid var(--line); }
.staff-access-content { display: grid; grid-template-columns: minmax(0,1fr) 224px; gap: 20px; align-items: center; }
.staff-access-link { min-width: 0; }
.staff-access-link>label { display: block; margin-bottom: 8px; font-size: 16px; color: var(--secondary); }
.staff-access-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.staff-access-qr { display: grid; place-items: center; width: 224px; height: 224px; background: #fff; color: var(--secondary); font-size: 16px; text-align: center; }
.staff-access-qr svg { display: block; width: 224px; height: 224px; }
.staff-access-copy-status { min-height: 24px; padding: 4px 0; font-size: 14px; line-height: 20px; color: var(--green); }
input:not([type=checkbox]):not([type=radio]),select,textarea { width: 100%; min-width: 0; height: 50px; padding: 12px; border: 1px solid #a6b3a2; border-radius: 4px; background: #edf1eb; color: var(--ink); font-size: 17px; line-height: 24px; }
select { padding: 0 36px 0 12px; line-height: 48px; }
textarea { height: 88px; resize: vertical; }
input[aria-invalid=true],select[aria-invalid=true],textarea[aria-invalid=true] { border-color: var(--red); background: #fff8f5; }
input::placeholder,textarea::placeholder { color: #606c5d; opacity: 1; }
.combo { position: relative; }
.combo-list,.combo.above .combo-list { position: static; max-height: 224px; overflow: auto; margin-top: 8px; padding: 4px; border: 1px solid #a9b9a1; border-radius: 4px; background: var(--surface); }
.combo-list button { display: block; width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: 2px; background: transparent; color: var(--ink); font-size: 16px; text-align: left; overflow-wrap: anywhere; }
.combo-list button:hover,.combo-list button:focus { background: var(--green-light); }
.combo-list .empty { padding: 12px; font-size: 14px; }
.checks { max-height: 240px; overflow: auto; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 4px; background: #edf1eb; }
.check-option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px; border-bottom: 1px solid var(--line); font-size: 16px; cursor: pointer; }
.check-option:last-child { border-bottom: 0; }
.check-option input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.check-option>span { min-width: 0; overflow-wrap: anywhere; }
.check-option small { display: block; margin-top: 4px; font-size: 14px; }
.check-option.disabled { opacity: .5; }
.invoice-picker>input { margin-bottom: 8px; }
.invoice-picker>.row-actions { padding-bottom: 16px; font-size: 14px; }
.payment-summary { padding: 16px 0; margin-bottom: 20px; border-top: 2px solid var(--green); border-bottom: 1px solid var(--line); color: var(--green); }
.payment-summary b { display: block; margin-top: 8px; font-size: 40px; line-height: 1.2; letter-spacing: -.035em; }
.help-line { margin: 0 0 20px; font-size: 15px; color: var(--secondary); }
.inline-warning { padding: 12px 16px; margin-bottom: 20px; border-left: 3px solid #b8a373; background: var(--amber-light); color: var(--amber); font-size: 15px; }
.detail-list { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 12px 20px; margin: 8px 0 24px; font-size: 16px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.history-json { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; padding: 16px; border: 1px solid var(--line); background: var(--raised); font-size: 14px; }
.audit-details { margin: 12px 0; border-top: 1px solid var(--line); }
.audit-details summary { padding: 16px 0; cursor: pointer; color: var(--secondary); font-size: 16px; }
.queue-item { padding: 20px 16px; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: 0; }
.queue-item p { margin: 8px 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.queue-item .error-text { color: var(--red); }
.notification-text { white-space: pre-line; overflow-wrap: anywhere; max-width: 600px; }
.offline-locked { max-width: 680px; padding: 24px 16px; }
.offline-locked p { margin: 16px 0 24px; }
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 32px 24px; }
.login-area { width: min(440px,100%); }
.login-brand { display: block; margin-bottom: 48px; }
.login-brand img { display: block; width: 100%; height: auto; }
.login-heading { border-top: 2px solid var(--ink); padding-top: 24px; }
.login-heading h1 { font-size: 32px; }
.login-heading p { margin-top: 12px; font-size: 17px; color: var(--secondary); }
.login-error { min-height: 48px; padding: 12px 0; color: var(--red); font-size: 15px; }
.activation-error { min-height: 60px; height: auto; overflow-wrap: anywhere; }
#activation-current-account { margin-top: 12px; }
.activation-status { min-height: 50px; }
#activation-form>p+p { margin-top: 12px; }
.login-submit { width: 100%; margin-top: 4px; }
@media (max-width:1200px) {
    :root { --sidebar: 232px; }
    .sidebar { padding: 24px 12px; }
    .workspace { padding: 0 24px; }
    .topbar-caption { display: none; }
    .topbar { justify-content: flex-end; }
    .metric { flex-basis: 50%; }
    .metric:nth-child(2n) { border-right: 0; }
    .metric.emphasis .metric-value { font-size: 40px; }
    .cash-driver { flex-wrap: wrap; }
}
@media (max-width:800px) {
    .sidebar { position: static; width: 100%; padding: 24px 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { width: min(330px,100%); margin: 0 0 20px; }
    .brand-caption { margin-top: 12px; }
    #navigation { flex-direction: row; gap: 4px; overflow: auto; padding-bottom: 12px; max-width: 100%; }
    .nav-button { width: auto; min-height: 44px; padding: 8px 12px; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; font-size: 16px; }
    .nav-button.active { border-bottom-color: var(--green); }
    .workspace { margin: 0; padding: 0 20px; }
    .topbar { min-height: 72px; }
    .actor-menu { width: 100%; gap: 12px; }
    .actor-name { min-width: 0; margin-left: auto; max-width: 230px; font-size: 16px; }
    .actor-menu .badge { flex: none; }
    .page-heading { gap: 16px; align-items: start; padding: 24px 0 20px; }
    .page-heading h1 { font-size: 30px; }
    .page-heading p { font-size: 16px; }
    .page-heading .actions { flex: none; max-width: 160px; }
    .page-heading .button { min-height: 48px; padding: 10px 12px; font-size: 16px; }
    .metric-grid { padding: 20px 0; margin-bottom: 24px; row-gap: 24px; }
    .metric { padding: 0 16px; }
    .metric-label { font-size: 15px; margin-bottom: 12px; }
    .metric-value,.metric.emphasis .metric-value { font-size: 36px; }
    .metric small { font-size: 14px; }
    .compact-grid { grid-template-columns: 1fr; }
    .panel { margin-bottom: 24px; }
    .panel-head { align-items: start; padding: 20px 16px 16px; }
    .panel-head h2 { font-size: 24px; }
    .panel-head p { font-size: 14px; }
    .sync-bar { gap: 4px; font-size: 14px; }
    .sync-bar .text-button { padding: 8px 4px; }
    .toolbar .search { max-width: none; min-width: 200px; flex-basis: 100%; }
    .toolbar .result-count { margin-left: 0; }
    .page-footer { font-size: 14px; flex-wrap: wrap; }
    .page-footer>span:last-child { display: none; }
    .invoice-row { flex-direction: column; align-items: start; gap: 16px; }
    .driver-actions { max-width: none; width: 100%; justify-content: flex-start; }
    .driver-actions .button { flex: 1; }
    .trip-head { align-items: start; }
    .trip-head .badge { max-width: 112px; }
    .cash-driver { flex-direction: column; align-items: start; }
    .cash-driver>.row-actions { width: 100%; justify-content: space-between; }
    .cash-driver .amount { margin-right: 0; font-size: 36px; }
    .notice { right: 16px; bottom: 16px; max-height: 220px; }
    dialog { inset: 12px 0 auto; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
    dialog.document-editor { height: calc(100dvh - 24px); }
    #editor-form { max-height: calc(100dvh - 26px); padding: 20px; }
    .dialog-header h2 { font-size: 25px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .field.full { grid-column: auto; }
    .staff-data-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
    .staff-data-grid [data-field=name],.staff-data-grid [data-field=phone],.staff-data-grid [data-field=login],.staff-data-grid [data-field=password] { grid-column: 1/-1; }
    .staff-access-content { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .staff-access-actions .button { width: 100%; }
    .staff-access-qr,.staff-access-qr svg { width: 192px; height: 192px; }
    .staff-access-qr { justify-self: center; }
    .dialog-footer { flex-wrap: wrap; gap: 8px; padding-top: 16px; }
    .dialog-footer>span { flex-basis: 100%; max-width: none; min-height: 20px; }
    .dialog-footer .button { flex: 1; padding-left: 12px; padding-right: 12px; }
    .detail-list { grid-template-columns: 100px minmax(0,1fr); gap: 12px; }
    .payment-summary b { font-size: 36px; }
}
@media (max-width:440px) {
    .brand { width: min(310px,100%); }
    .page-heading { flex-wrap: wrap; }
    .page-heading>div:first-child { flex: 1 1 190px; min-width: 0; }
    .page-heading .actions { max-width: none; }
    #data-status { max-width: 200px; }
    .actor-name { max-width: 180px; }
    .metric { padding: 0 12px; }
    .metric-value,.metric.emphasis .metric-value { font-size: 36px; }
    .cash-driver>.row-actions { align-items: start; flex-direction: column; }
    .cash-driver .button { width: 100%; }
    .login-brand { margin-bottom: 36px; }
    .login-heading h1 { font-size: 29px; }
}

/* Working sections and record history */
.section-tabs { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 24px; }
.section-tabs .selected { background:var(--green); color:#fff; border-color:var(--green); }
.record-history { margin-top:24px; border-top:1px solid var(--line); padding-top:16px; }
.record-history>summary { font-weight:600; cursor:pointer; padding:12px 0; }
.record-history-body { min-width:0; padding:8px 0; }
.history-entry { border-bottom:1px solid var(--line); padding:12px 0; }
.history-entry>summary { cursor:pointer; overflow-wrap:anywhere; }
.history-entry small { display:block; color:var(--muted); margin:6px 0 0 18px; }
.history-snapshots { padding:14px 0; min-width:0; }
.history-snapshots summary { cursor:pointer; padding:10px 0; }
.history-pages { margin-top:16px; }

.field label.plate-format-choice { display:flex; align-items:center; gap:10px; font-weight:400; }
.plate-format-choice input { width:20px; height:20px; min-height:20px; flex:none; margin:0; }

/* Personal workspaces: warehouse and driver */
.work-context { margin-bottom:24px; color:var(--secondary); }
.work-context strong { display:block; font-size:19px; color:var(--ink); }
.work-context p { margin-top:8px; line-height:1.6; }
.warehouse-tools { display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.warehouse-tools h2 { font-size:25px; }
.warehouse-tools p { margin-top:6px; color:var(--secondary); }
.warehouse-tools input { max-width:420px; flex:1 1 280px; }
.count-label { display:inline-block; margin-left:8px; padding:2px 10px; border-radius:4px; background:var(--green-light); color:var(--green); font-size:20px; }
.warehouse-selection { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; padding:16px; margin-bottom:16px; border:1px solid var(--line); border-left:4px solid var(--green); border-radius:4px; background:var(--raised); position:sticky; top:12px; z-index:12; }
.warehouse-selection strong { font-size:20px; }
.dispatch-list { display:flex; flex-direction:column; gap:12px; margin-bottom:20px; }
.dispatch-card { display:flex; justify-content:space-between; gap:16px; align-items:center; min-width:0; padding:18px 16px; background:var(--surface); border:1px solid var(--line); border-radius:4px; }
.dispatch-card.selected { border-color:var(--green); background:#f1f5ef; }
.dispatch-card>label { display:flex; flex:1; min-width:0; gap:14px; align-items:start; cursor:pointer; }
.dispatch-card input { width:24px; height:24px; flex:none; margin:3px 0 0; accent-color:var(--green); }
.dispatch-card label>span { min-width:0; overflow-wrap:anywhere; }
.dispatch-card label strong { display:block; font-size:21px; line-height:1.35; }
.dispatch-card label span span { display:block; margin-top:6px; color:var(--secondary); }
.invoice-number, .dispatch-card label .invoice-number, .driver-stop-title .invoice-number { display:block; font-size:28px; font-weight:600; line-height:1.35; color:var(--ink); overflow-wrap:anywhere; }
.invoice-client, .invoice-info .invoice-client, .dispatch-card label .invoice-client, .driver-stop-title .invoice-client { display:block; font-size:17px; font-weight:400; line-height:1.5; color:var(--secondary); margin-top:6px; overflow-wrap:anywhere; }
.dispatch-card>.button { flex:none; }
.driver-cash { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:24px; margin-bottom:24px; padding:22px 20px; border-top:3px solid var(--green); border-bottom:1px solid var(--line); background:var(--raised); }
.driver-cash>div { min-width:0; max-width:100%; }
.driver-cash p { color:var(--secondary); margin-bottom:8px; font-size:17px; }
.driver-cash>div>strong { display:block; font-size:clamp(36px,4vw,52px); font-weight:550; color:var(--green); line-height:1.2; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.driver-cash>div>span { display:block; margin-top:10px; color:var(--secondary); }
.driver-cash-details { display:flex; flex-direction:column; gap:14px; }
.driver-cash-details b { display:block; color:var(--ink); font-size:23px; font-weight:500; }
.driver-route { min-width:0; border:1px solid var(--line); border-radius:4px; margin-bottom:24px; background:var(--surface); }
.driver-route-head { display:flex; flex-wrap:wrap; justify-content:space-between; gap:16px; align-items:center; padding:20px 16px; background:#f3f5f1; border-bottom:1px solid var(--line); }
.driver-route-head p { color:var(--secondary); margin-bottom:6px; }
.driver-route-head h2 { font-size:24px; overflow-wrap:anywhere; }
.driver-route-head h2 span { display:block; font-size:20px; margin-top:5px; font-weight:400; }
.driver-stop { padding:22px 16px; border-bottom:1px solid var(--line); min-width:0; }
.driver-stop:last-child { border-bottom:0; }
.driver-stop-title { display:flex; flex-wrap:wrap; align-items:start; justify-content:space-between; gap:12px; }
.driver-stop-title>div { flex:1 1 200px; min-width:0; }
.driver-stop-title h3 { font-size:23px; line-height:1.35; overflow-wrap:anywhere; }
.driver-stop-title p { color:var(--secondary); margin-top:6px; overflow-wrap:anywhere; }
.driver-address { font-size:19px; line-height:1.5; margin-top:14px; overflow-wrap:anywhere; }
.driver-note { margin-top:10px; color:var(--secondary); overflow-wrap:anywhere; }
.driver-phone { display:inline-block; padding:10px 0; font-size:17px; text-decoration:underline; overflow-wrap:anywhere; }
.driver-payment-status { margin:12px 0 16px; padding:12px; border-left:3px solid var(--green); background:#edf1eb; overflow-wrap:anywhere; }
.driver-payment-status strong { display:block; font-size:23px; line-height:1.4; }
.driver-payment-status span { display:block; font-size:16px; color:var(--secondary); margin-top:4px; }
.driver-stop-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.driver-stop-actions .button { white-space:normal; min-height:56px; padding:12px; line-height:1.4; font-size:17px; }
.route-page-note { padding:16px; color:var(--secondary); }
.payment-invoices { margin:8px 0 16px; min-width:0; }
.payment-invoices>summary { padding:14px; cursor:pointer; background:var(--raised); border:1px solid var(--line); border-radius:4px; overflow-wrap:anywhere; }
.payment-invoices[open]>summary { margin-bottom:16px; }
@media(max-width:600px) {
    .warehouse-selection { position:static; }
    .warehouse-selection>.button { width:100%; }
    .warehouse-tools input { max-width:none; }
    .dispatch-card { align-items:start; flex-wrap:wrap; }
    .dispatch-card>label { flex-basis:100%; }
    .dispatch-card>.button { margin-left:38px; }
    .driver-cash { padding:20px 16px; }
    .driver-cash-details { width:100%; padding-top:16px; border-top:1px solid var(--line); }
    .driver-route-head h2 { font-size:23px; }
    .driver-stop-actions { gap:8px; }
    .driver-stop-actions .button { padding:10px 8px; }
}

.driver-payment-status.no-payment { display:none; }
@media(max-width:800px) {
    html.role-driver .sidebar,html.role-warehouse .sidebar { padding-top:14px; }
    html.role-driver .brand,html.role-warehouse .brand { width:min(240px,100%); margin-bottom:12px; }
    html.role-driver .brand-caption,html.role-warehouse .brand-caption { display:none; }
    html.role-driver .page-heading,html.role-warehouse .page-heading { padding-top:18px; padding-bottom:14px; }
    .driver-cash { margin-bottom:18px; padding:16px; }
    .driver-cash-details { gap:8px; padding-top:10px; }
    .driver-cash-details>span { margin-top:0; }
    .driver-cash-details b { display:inline; margin-left:8px; font-size:20px; }
    .driver-cash>div>span { margin-top:6px; }
}
