:root {
    --font: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    --bg: #f3f4f9;
    --surface: #ffffff;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --success: #16a34a;
    --success-light: #ecfdf3;
    --online: #2563eb;          /* a branch that is online / open is BLUE everywhere (never green) */
    --online-light: #eff6ff;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #b45309;
    --warning-light: #fffbeb;
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px -14px rgba(15, 23, 42, .16);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1117;
        --surface: #1a1c25;
        --primary: #818cf8;
        --primary-dark: #6366f1;
        --primary-light: #262b3d;
        --success: #4ade80;
        --success-light: #14251b;
        --online: #60a5fa;
        --online-light: #172554;
        --danger: #f87171;
        --danger-light: #2a1616;
        --warning: #fbbf24;
        --warning-light: #2a2210;
        --text: #f3f4f6;
        --text-muted: #9ca3af;
        --border: #2c2f3a;
        --shadow: 0 10px 30px -14px rgba(0, 0, 0, .5);
    }
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 32px 16px 64px;
    line-height: 1.6;
    overflow-x: hidden;
}

.page { max-width: 1080px; margin: 0 auto; }

.topbar { margin-bottom: 28px; text-align: center; }

.topbar-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.topbar-actions a {
    font-size: 13.5px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    background: var(--surface);
}

.topbar-actions a:hover { border-color: var(--primary); color: var(--primary); }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 12px;
}

h1 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    margin: 0;
}

.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

/* Grid items default to a min-width of their content's min-content size -
   without this, a long unwrapped row inside .main-col (e.g. the category
   pills bar) forces this whole column, and the page along with it, wider
   than intended instead of scrolling internally. */
.main-col, .side-col { min-width: 0; }

@media (min-width: 960px) {
    .layout { grid-template-columns: 1fr 360px; }
    .side-col { position: sticky; top: 24px; }
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.main-col .card:last-child { margin-bottom: 0; }

.card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error { background: var(--danger-light); color: var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.link-btn { background: none; border: 0; padding: 0 6px; font: inherit; color: var(--primary, #4f46e5); cursor: pointer; text-decoration: underline; }

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0 0 6px;
    color: var(--danger);
    font-size: 13px;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.form-grid p:has(textarea) { grid-column: 1 / -1; }

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-grid p { margin: 0 0 16px; }

.form-grid label,
.form-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text);
}

.form-grid input[type=text],
.form-grid input[type=number],
.form-grid input[type=password],
.form-grid input[type=tel],
.login-ext input[type=text],
.form-grid select,
.form-grid textarea,
.form-field input[type=text],
.form-field input[type=number],
.form-field select,
.form-field textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    transition: border-color .15s, box-shadow .15s;
}

.form-grid select,
.form-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.19l3.71-3.96a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 34px;
}

.form-grid textarea,
.form-field textarea { height: 90px; resize: vertical; }

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.form-field { margin-bottom: 18px; }
.form-field .errorlist {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    color: var(--danger);
    font-size: 13px;
}

/* ---------- Order wizard ---------- */
.step-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.step-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.step-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.step-tab.active { color: var(--primary); background: var(--primary-light); }
.step-tab.done { color: var(--text); }
.step-tab-icon { font-size: 15px; }
.step-arrow { color: var(--border); font-size: 18px; }

.btn-cancel {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-cancel:hover { border-color: var(--danger); color: var(--danger); }

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.wizard-phone-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}

.wizard-phone-icon {
    font-size: 22px;
    margin-top: 8px;
}

.wizard-phone-block .form-field { flex: 1; margin-bottom: 8px; }

.lookup-status {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
}

.lookup-status.lookup-found { color: #16a34a; }
.lookup-status.lookup-new { color: var(--primary); }

.order-type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.order-type-btn {
    flex: 1;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.order-type-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.visually-hidden { display: none; }

.saved-addresses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.address-chip {
    padding: 6px 12px;
    border: 1.5px dashed var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    max-width: 100%;
}

.address-chip:hover { border-color: var(--primary); color: var(--primary); }

.review-grid { margin-bottom: 18px; }

.review-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.review-row span:first-child { color: var(--text-muted); font-weight: 600; }
.review-row span:last-child { display: flex; align-items: center; gap: 10px; }

.review-change-btn {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.review-change-btn:hover { border-color: var(--primary); background: var(--primary-light); }

/* Branch picker (step 2) - shows each branch's live agent online status
   instead of a plain dropdown, per the user's request. */
.branch-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.branch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.branch-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.branch-btn .status-dot {
    padding: 0;
    background: none !important;
}

.order-summary-block {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-summary-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text);
}

/* Order summary rows (2026-11-25): an icon tile, a small label and the value large and bold - the value wraps
   (a long address must be readable in full), an empty row shows a muted dash. */
.os-icon {
    flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-light);
    display: grid; place-items: center; font-size: 20px;
}
.os-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.os-body small { font-size: 12.5px; font-weight: 700; color: var(--text-muted); line-height: 1.3; }
.os-body b { font-size: 18px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.os-body b.is-empty { color: var(--text-muted); font-weight: 600; }

/* Menu search + quick category nav */
.menu-search-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    font-family: inherit;
}

.menu-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.menu-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 10px;
    margin-bottom: 14px;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 5;
    max-height: 45vh;
    overflow-y: auto;
}

.menu-category-pill {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--primary-light);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.menu-category-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.menu-category-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.menu-empty-hint {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    font-size: 15px;
}

/* Menu categories (Simphony SLU screen groups) */
.menu-category {
    margin-bottom: 20px;
    scroll-margin-top: 60px;
}

.menu-category-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}

/* Menu grid */
.menu-grid {
    display: grid;
    /* Capped at 170px (not 1fr) so cards stay a sane touch-target size
       instead of stretching edge-to-edge into huge tiles on a wide monitor
       when a filtered category only has a handful of items. */
    grid-template-columns: repeat(auto-fill, minmax(140px, 170px));
    gap: 12px;
}

.menu-item-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: right;
    font-family: var(--font);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.menu-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.menu-item-name { font-weight: 700; font-size: 14.5px; }
.menu-item-price { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.qty-badge[hidden] { display: none; }

.qty-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Cart */
.cart-lines { min-height: 40px; }

.cart-empty { color: var(--text-muted); font-size: 14px; text-align: center; padding: 16px 0; }

.cart-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cart-line:last-child { border-bottom: none; }

.cart-line-name { font-size: 14px; font-weight: 600; }
.cart-line-price { font-size: 12.5px; color: var(--text-muted); }

.qty-controls { display: flex; align-items: center; gap: 8px; }

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s;
}

.qty-btn:hover { background: var(--primary-light); border-color: var(--primary); }

.qty-value { min-width: 18px; text-align: center; font-weight: 700; font-size: 14px; }

.remove-btn {
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1.5px dashed var(--border);
    font-weight: 700;
}

.cart-total-row span:last-child { font-size: 20px; color: var(--primary); }

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background .12s;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; margin-top: 18px; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Success page */
.success-card {
    max-width: 440px;
    margin: 60px auto;
    text-align: center;
    padding: 40px 28px;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: var(--success-light);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.success-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; }

.status-note {
    font-size: 14px;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 14px 0;
}

.status-note.ok { background: var(--success-light); color: var(--success); }
.status-note.failed { background: var(--danger-light); color: var(--danger); }

.link-btn {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.link-btn:hover { text-decoration: underline; }

/* Branch status dashboard */
.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.branch-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.branch-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.branch-name { font-weight: 700; font-size: 15px; }

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.status-dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.status-dot.online {
    background: var(--online-light);
    color: var(--online);
}
.status-dot.online::before { background: var(--online); }

.status-dot.offline {
    background: var(--danger-light);
    color: var(--danger);
}
.status-dot.offline::before { background: var(--danger); }

.status-dot.no-agent {
    background: var(--bg);
    color: var(--text-muted);
}
.status-dot.no-agent::before { background: var(--text-muted); }

.branch-meta { font-size: 12.5px; color: var(--text-muted); }

/* Driver dispatch screen */
.dispatch-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.branch-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.branch-picker label { font-weight: 600; font-size: 14px; }

.branch-picker select {
    font-family: var(--font);
    font-size: 14px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.dispatch-list { display: flex; flex-direction: column; gap: 10px; }

.dispatch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
}

.assign-form { display: flex; align-items: center; gap: 8px; }

.dispatch-row-wide { align-items: flex-start; }

.order-item-list {
    margin: 6px 0;
    padding-inline-start: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.payment-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    margin-inline-start: 8px;
}

.payment-badge.payment-cash { background: var(--success-light); color: var(--success); }
.payment-badge.payment-card { background: var(--primary-light); color: var(--primary); }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-bar .form-field { margin-bottom: 0; min-width: 160px; }

.settlement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.settlement-table th, .settlement-table td {
    padding: 10px 12px;
    text-align: start;
    border-bottom: 1px solid var(--border);
}

.settlement-table th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12.5px;
}

.settlement-totals {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
    max-width: 320px;
    margin-inline-start: auto;
}

@media print {
    .no-print { display: none !important; }
    body { background: #fff; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------- Delivery order Kanban board ---------- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
}

/* Accordion variant (driver_dispatch's 3 stages) - each stage is a full-
   width, collapsible section instead of a fixed 1/3 column, so opening one
   gives it the whole row's width to lay its cards out in instead of
   fighting the other two stages for space. */
.kanban-board.kanban-accordion {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    grid-template-columns: none;
    gap: 14px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.kanban-accordion .kanban-column-header {
    margin-bottom: 0;
    padding: 14px 4px;
    border-bottom: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.kanban-accordion .kanban-column {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 4px 18px;
}

.kanban-column-chevron {
    font-size: 13px;
    color: var(--text-muted);
    transition: transform .18s ease;
}
.kanban-column.is-open .kanban-column-chevron { transform: rotate(180deg); }

.kanban-column-icon { font-size: 20px; }

.kanban-column-title {
    font-weight: 800;
    font-size: 15px;
    flex: 1;
}

.kanban-count {
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    padding: 3px 9px;
    border-radius: 999px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* driver_dispatch's tabbed views (#dispatch-views) - one full-width panel
   shown at a time (see showDispatchView), so its cards grid gets the whole
   page width instead of splitting into fixed columns. */
#dispatch-views .kanban-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.order-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    border-inline-start: 5px solid var(--border);
    transition: transform .15s ease, box-shadow .15s ease;
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -16px rgba(15, 23, 42, .28);
}

.order-card.order-card-cash { border-inline-start-color: var(--success); }
.order-card.order-card-card { border-inline-start-color: var(--primary); }

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.order-card-name { font-weight: 800; font-size: 15.5px; }

.order-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.order-card-note {
    background: var(--warning-light);
    color: var(--warning);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 10px;
    border-inline-start: 3px solid var(--warning);
}

.order-card .order-item-list {
    margin: 0 0 10px;
    padding-inline-start: 18px;
}

.order-card-total {
    font-size: 13.5px;
    font-weight: 700;
    padding-top: 10px;
    margin-bottom: 12px;
    border-top: 1px dashed var(--border);
}

.order-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.order-print-btn {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.order-card-secondary { display: flex; align-items: center; gap: 8px; width: 100%; }
.order-print-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.order-card-actions select {
    flex: 1;
    min-width: 120px;
    padding: 9px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
}

.kanban-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 10px;
    background: var(--surface);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    font-size: 13.5px;
}

.assign-form select {
    font-family: var(--font);
    font-size: 13.5px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.dispatch-actions { display: flex; gap: 8px; }

.period-toggle { display: flex; gap: 8px; margin-bottom: 16px; }

.period-toggle a {
    font-size: 13.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
}

.period-toggle a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Modifier selection modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.modal-backdrop[hidden] { display: none; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-wide { max-width: 900px; }

/* A modal with a fixed header + sticky footer around a scrolling middle
   section - so a long options list never pushes the confirm button out of
   reach, and closing (✕) is always visible without scrolling. */
.modal.modal-with-footer {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

.modal-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex: 0 0 auto;
}

.modal-close-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
}

.modal-close-btn:hover { border-color: var(--danger); color: var(--danger); }

.modal-scroll-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

.modal-footer-bar {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: var(--surface);
}

.modal-footer-bar .btn-primary { flex: 1; }

.modal-title { margin: 0; font-size: 17px; font-weight: 700; }

.modal-group { margin-bottom: 18px; }

/* Required groups render first (JS sorts them) and get a visual callout so
   the one selection that actually blocks confirming isn't buried under a
   long optional add-ons list the agent has to scroll past first. */
.modal-group.required {
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px;
}

.modal-group-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }

.modal-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.modal-option-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    background: var(--surface);
}

/* The box itself is the toggle (border + fill on selection) - no visible
   checkbox/radio square, matching the reference design. */
.modal-option-row input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.modal-option-row:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
    color: var(--primary);
}

.modal-error {
    color: var(--danger);
    font-size: 13.5px;
    margin: 0 0 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- Order lifecycle / SLA (dispatch board + tracking) ---------- */

.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border-top: 4px solid var(--border);
}
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-success { border-top-color: var(--success); }
.stat-success .stat-value { color: var(--success); }
.stat-danger { border-top-color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }

/* driver_dispatch's stat tiles double as view tabs - reset just enough of
   the native <button> chrome to keep looking like the plain .stat tiles
   used elsewhere (order_tracking), without touching border-top so
   .stat-success/.stat-danger's color override still wins as before. */
button.stat {
    border-inline: none;
    border-bottom: none;
    font: inherit;
    text-align: center;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}
.stat.active {
    background: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary), var(--shadow);
}
.stat.active .stat-label { color: var(--primary); }

.sla-targets {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-inline-start: auto;
}

.sla-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--success-light);
    color: var(--success);
}
.sla-badge.sla-warning { background: var(--warning-light); color: var(--warning); }
.sla-badge.sla-late { background: var(--danger-light); color: var(--danger); animation: sla-pulse 1.6s ease-in-out infinite; }
.sla-badge.sla-done { background: var(--primary-light); color: var(--primary); }
@keyframes sla-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.order-card.sla-warning { box-shadow: 0 0 0 2px var(--warning-light), var(--shadow); }
.order-card.sla-late { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }

.type-badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.lifecycle {
    list-style: none;
    margin: 0 0 10px;
    padding: 8px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 4px;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
}
.lifecycle li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    position: relative;
}
.lifecycle li span { white-space: nowrap; }
.lifecycle li small {
    font-size: 9px;
    background: var(--primary);
    color: #fff;
    padding: 0 4px;
    border-radius: 4px;
    vertical-align: middle;
}
.lifecycle li time { font-weight: 800; font-size: 12.5px; color: var(--text-muted); }
.lifecycle li.done { color: var(--text); }
.lifecycle li.done time { color: var(--success); }

.order-card-delay {
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.delay-form { margin-bottom: 10px; }
.delay-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--danger);
    border-radius: var(--radius-sm);
    background: var(--danger-light);
    color: var(--danger);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
}

.assign-form { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.assign-form select { flex: 1; }

.btn-danger-outline {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    margin-inline-start: auto;
}
.btn-danger-outline:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.btn-primary.btn-danger-solid { background: var(--danger); }
.btn-primary.btn-danger-solid:hover { background: #b91c1c; }

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.status-pill.status-ready { background: var(--success-light); color: var(--success); border-color: transparent; }
.status-pill.status-assigned { background: var(--primary-light); color: var(--primary); border-color: transparent; }
.status-pill.status-completed { background: var(--success); color: #fff; border-color: transparent; }
.status-pill.status-cancelled { background: var(--danger-light); color: var(--danger); border-color: transparent; }

.table-scroll { overflow-x: auto; }
.tracking-table th, .tracking-table td { white-space: nowrap; font-size: 12.5px; }
.tracking-table .notes-cell { white-space: normal; min-width: 160px; }
.tracking-table tr.row-sla-late td { background: var(--danger-light); }
.tracking-table tr.row-sla-warning td { background: var(--warning-light); }
.tracking-table tr.row-sla-cancelled td { color: var(--text-muted); }
.src-kds, .src-manual {
    font-size: 9.5px;
    padding: 1px 5px;
    border-radius: 4px;
    margin-inline-start: 4px;
    vertical-align: middle;
}
.src-kds { background: var(--primary); color: #fff; }
.src-manual { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }

.payment-edit-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
}
.payment-edit-btn:hover { color: var(--primary); background: var(--primary-light); }

/* ---------- Analytics dashboard ---------- */
.dashboard-page { max-width: 1400px; margin: 0 auto; }

.lang-toggle {
    display: inline-flex;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface);
}
.lang-toggle button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 14px;
    cursor: pointer;
}
.lang-toggle button.active { background: var(--primary); color: #fff; }

.dash-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}
.dash-branch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    max-width: 640px;
}
.dash-branch-list label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.dash-period-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dash-period-group a, .dash-period-group button {
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.dash-period-group a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dash-custom-dates { display: flex; gap: 6px; align-items: center; }
.dash-custom-dates input {
    padding: 6px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    border-top: 4px solid var(--primary);
}
.kpi-card .kpi-icon { font-size: 20px; margin-bottom: 6px; display: block; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi-card .kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-top: 4px; }
.kpi-card.kpi-danger { border-top-color: var(--danger); }
.kpi-card.kpi-success { border-top-color: var(--success); }
.kpi-card.kpi-warning { border-top-color: var(--warning); }

.insight-panel { margin-bottom: 24px; }
.insight-list, .alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insight-item, .alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    background: var(--bg);
    border-inline-start: 4px solid var(--border);
}
.insight-item::before, .alert-item::before { font-size: 16px; line-height: 1.3; }
.insight-item.level-success, .alert-item.level-success { background: var(--success-light); color: var(--success); border-inline-start-color: var(--success); }
.insight-item.level-warning, .alert-item.level-warning { background: var(--warning-light); color: var(--warning); border-inline-start-color: var(--warning); }
.insight-item.level-danger, .alert-item.level-danger { background: var(--danger-light); color: var(--danger); border-inline-start-color: var(--danger); }
.insight-item.level-info, .alert-item.level-info { background: var(--primary-light); color: var(--primary); border-inline-start-color: var(--primary); }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.chart-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
}
.chart-card canvas { max-height: 280px; }
.chart-card.chart-wide { grid-column: 1 / -1; }

.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th, .dash-table td { padding: 9px 12px; text-align: start; white-space: nowrap; border-bottom: 1px solid var(--border); }
.dash-table th { font-weight: 700; color: var(--text-muted); font-size: 12px; }
.dash-table tbody tr:hover { background: var(--bg); }
.dash-empty { text-align: center; color: var(--text-muted); padding: 20px; font-size: 13px; }

.ai-chat-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 24px;
}
.ai-chat-input-row { display: flex; gap: 10px; margin-top: 12px; }
.ai-chat-input-row input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
}
.ai-chat-input-row button {
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-family: inherit;
    cursor: not-allowed;
}
.ai-chat-note {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

.dash-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Grid children must not be forced wider than the grid track by their
   content's intrinsic min-content size (tables, canvases) - same fix as
   .main-col/.side-col elsewhere in this file. Without this, a dashboard
   table with many columns pushes the whole mobile layout into horizontal
   scroll instead of scrolling just inside .dash-table-wrap. */
.dash-section-grid > *, .chart-grid > * { min-width: 0; }
.chart-card canvas { max-width: 100%; }

.login-logo {
    max-width: 340px;
    max-height: 190px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 18px;
    border-radius: 18px;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, .18));
}
/* A square logo (a round badge photographed on a dark backdrop, for example) is shown as a
   circle so the backdrop corners never show; the uploaded file itself is never resized or cropped. */
.logo-ring {
    display: block; width: 190px; height: 190px; margin: 0 auto 18px;
    border-radius: 50%; overflow: hidden; background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .30), 0 0 0 4px var(--surface), 0 0 0 5px var(--border);
}
.topbar .logo-ring { width: 150px; height: 150px; margin-bottom: 14px; }
/* zoom a little so the backdrop ring around a round badge falls outside the circle */
.logo-ring img { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; margin: 0 !important; border-radius: 0 !important; object-fit: cover; transform: scale(1.09); filter: none !important; }
.top-logo.has-round { padding: 2px; border-radius: 50%; }
.top-logo .logo-ring { width: 52px; height: 52px; margin: 0; box-shadow: none; }
/* the home pages sit under a header already - a little smaller than on the sign-in screen */
.topbar .login-logo { max-width: 260px; max-height: 140px; margin-bottom: 14px; }

/* small brand mark in the top corner of every screen (opposite the user / sign-out chrome) */
.top-logo {
    position: fixed;
    top: 8px;
    inset-inline-start: 14px;
    z-index: 140;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 4px 8px;
    box-shadow: var(--shadow);
}
.top-logo img { height: 46px; width: auto; max-width: 150px; object-fit: contain; display: block; }
@media (max-width: 1100px) { .top-logo { display: none; } }

/* ---------- Branch manager home hub (3 shortcuts) ---------- */
.manager-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.manager-hub-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    border: none;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.manager-hub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -16px rgba(15, 23, 42, .28);
}
.manager-hub-icon { font-size: 40px; }
.manager-hub-title { font-weight: 800; font-size: 16px; }
.manager-hub-desc { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Site-wide tile home page (2026-09-26) ---------- */
.hub-group { margin-bottom: 30px; }
.hub-group-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.hub-card-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.badge-ops { background: var(--primary-light); }
.badge-reports { background: var(--success-light); }
.badge-settings { background: var(--warning-light); }
.badge-super { background: var(--danger-light); }

/* ---------- Customer complaints (2026-09-28) ---------- */
.sev-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    vertical-align: middle;
}
.sev-p1 { background: var(--danger); color: #fff; }
.sev-p2 { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.sev-p3 { background: var(--primary-light); color: var(--primary); }
.sev-p4 { background: var(--success-light); color: var(--success); }

.status-pill.cstatus-new { background: var(--primary-light); color: var(--primary); border-color: transparent; }
.status-pill.cstatus-in_progress { background: var(--warning-light); color: var(--warning); border-color: transparent; }
.status-pill.cstatus-escalated { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
.status-pill.cstatus-resolved { background: var(--success-light); color: var(--success); border-color: transparent; }
.status-pill.cstatus-closed { background: var(--bg); color: var(--text-muted); }

h1 .sev-badge, h1 .status-pill { font-size: 13px; vertical-align: middle; }

.script-box {
    background: var(--warning-light);
    border-inline-start: 4px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 12px;
}
.script-box-success { background: var(--success-light); border-inline-start-color: var(--success); }
.script-title { font-weight: 800; font-size: 13px; margin-bottom: 4px; color: var(--text-muted); }

.wa-preview {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 8px 0 0;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
    position: relative;
    padding: 0 18px 14px 0;
    border-inline-start: 2px solid var(--border);
    margin-inline-start: 6px;
}
.timeline-item::before {
    content: "";
    position: absolute;
    inset-inline-start: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary);
}
.timeline-time { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }

.hub-count-badge {
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 999px;
}

/* ---------- Order picker (log-call + complaint screens, 2026-09-28) ---------- */
.order-pick-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-pick-table th {
    text-align: start;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.order-pick-row td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
}
.order-pick-row:hover td { background: var(--bg); }
.order-pick-row.selected td { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.order-pick-more {
    margin-top: 8px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}
.order-pick-more:hover { border-color: var(--primary); }
.order-pick-wrap { overflow-x: auto; }
.order-pick-detail {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 10px;
}
.order-pick-detail-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }

/* ---------- Language switch + print/PDF (2026-09-29) ---------- */
/* Fixed top-corner chrome on every screen: user chip, sign in/out, language */
.top-chrome {
    position: fixed;
    top: 12px;
    inset-inline-end: 14px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.lang-switch { margin: 0; }
.chrome-btn {
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow);
    text-decoration: none;
    line-height: 1.4;
}
.chrome-btn:hover { border-color: var(--primary); color: var(--primary); }
.chrome-btn-out:hover { border-color: var(--danger); color: var(--danger); }
.chrome-btn-in { background: var(--primary); color: #fff; border-color: var(--primary); }
.chrome-btn-in:hover { background: var(--primary-dark); color: #fff; }
.user-chip {
    font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
    background: var(--primary-light); color: var(--primary); box-shadow: var(--shadow);
    max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip-role { font-weight: 600; opacity: .8; }
@media (max-width: 640px) {
    .user-chip-role { display: none; }
    .top-chrome { gap: 6px; }
}

.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-actions .btn-secondary, .report-actions .btn-primary { padding: 9px 16px; font-size: 13.5px; text-decoration: none; display: inline-block; }

.print-header { display: none; }
@media print {
    .top-chrome, .lang-switch, .topbar-actions, .dash-toolbar, .widget-palette, .report-actions, .filter-bar,
    .no-print, .widget-remove, .widget-grip, .dash-filter-bar, form.branch-picker, .dash-toast { display: none !important; }
    body { background: #fff; padding: 0; color: #000; }
    .page { max-width: none; }
    .card, .grid-stack-item-content, .chart-card, .kpi-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .print-header {
        display: flex;
        align-items: center;
        gap: 16px;
        border-bottom: 2px solid #1F3864;
        padding-bottom: 10px;
        margin-bottom: 16px;
    }
    .print-logo { max-height: 56px; max-width: 140px; }
    .print-title { font-size: 20px; font-weight: 800; }
    .print-subtitle { font-size: 12px; color: #555; }
    .settlement-table, .dash-table { font-size: 11.5px; }
    .settlement-table th, .settlement-table td, .dash-table th, .dash-table td { padding: 5px 7px; }
    .table-scroll, .dash-table-wrap { overflow: visible; }
    .tracking-table th, .tracking-table td { white-space: normal; }
    a { text-decoration: none; color: inherit; }
    @page { margin: 12mm; }
}

/* ---------- Customizable drag-and-drop dashboard (2026-09-29) ---------- */
.dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 14px;
}
.dash-toolbar button {
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
}
.dash-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.dash-toolbar button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dash-save-state { font-size: 12px; color: var(--text-muted); font-weight: 600; min-width: 80px; }

.grid-stack { margin: 0 -4px; }
.grid-stack-item-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    inset: 4px !important;
}
.widget-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex: 0 0 auto;
}
.widget-head .card-title { margin: 0; font-size: 14px; flex: 1; }
.widget-grip {
    display: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: grab;
    user-select: none;
}
.widget-remove {
    display: none;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.widget-remove:hover { border-color: var(--danger); color: var(--danger); }
.widget-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.widget-body.widget-chart { position: relative; overflow: hidden; }
.widget-body.widget-chart canvas { width: 100% !important; height: 100% !important; max-height: none; }
.widget-kpi { align-items: center; text-align: center; justify-content: center; border-top: 4px solid var(--primary); }
.widget-kpi .kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.widget-kpi .kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-top: 4px; }
.widget-kpi .kpi-icon { font-size: 20px; margin-bottom: 4px; display: block; }
.widget-kpi.kpi-danger { border-top-color: var(--danger); }
.widget-kpi.kpi-success { border-top-color: var(--success); }
.widget-kpi.kpi-warning { border-top-color: var(--warning); }
.widget-kpi .widget-head { position: absolute; top: 6px; inset-inline-end: 8px; margin: 0; }
.widget-kpi .widget-head .card-title { display: none; }
.grid-stack-item[gs-id^="kpi_"] .grid-stack-item-content { position: absolute; }

body.dash-editing .widget-grip, body.dash-editing .widget-remove { display: inline-flex; align-items: center; justify-content: center; }
body.dash-editing .grid-stack-item-content { outline: 2px dashed var(--primary); outline-offset: -2px; cursor: default; }
body.dash-editing .widget-head { cursor: grab; }
.grid-stack-item.ui-draggable-dragging .grid-stack-item-content { box-shadow: 0 20px 40px -16px rgba(15, 23, 42, .4); }
.grid-stack-placeholder > .placeholder-content { background: var(--primary-light) !important; border: 2px dashed var(--primary) !important; border-radius: var(--radius-lg); inset: 4px !important; }

.widget-palette {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.widget-palette[hidden] { display: none; }
.widget-palette .card-title { margin: 0; font-size: 14px; flex-basis: 100%; }
.widget-palette button {
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px dashed var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
}
.widget-palette button:hover { border-color: var(--primary); color: var(--primary); }
.widget-palette .palette-empty { font-size: 13px; color: var(--text-muted); }

.dash-toast {
    position: fixed;
    bottom: 20px;
    inset-inline-start: 20px;
    background: var(--text);
    color: var(--surface);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    z-index: 200;
}
.dash-toast.show { opacity: 1; }

/* ---------- Delivery areas (2026-09-28) ---------- */
.inline-add-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-add-form input[type=text],
.inline-add-form select,
.area-name-input,
.area-select {
    flex: 1;
    min-width: 140px;
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
}
.inline-add-form .btn-primary { padding: 10px 18px; }
.branch-check-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.branch-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.area-row { flex-direction: column; align-items: stretch; gap: 10px; }
.area-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.area-name-input { max-width: 260px; font-weight: 700; }
.area-inactive { opacity: .55; }
.coverage-chip {
    font-size: 12.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--success-light);
    color: var(--success);
}
.coverage-chip.coverage-empty { background: var(--warning-light); color: var(--warning); }
.area-select { width: 100%; }

/* ---------- Log-call order lookup expandable rows (2026-09-26) ---------- */
.lookup-toggle-arrow { color: var(--text-muted); font-size: 12px; margin-inline-start: 6px; }
.order-lookup-detail {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: -2px 0 10px;
}


/* ---- Call desk (2026-10-01) ---- */
.call-desk { border: 2px solid var(--primary); }
.desk-phone-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.desk-phone-row label { font-weight: 700; color: var(--text-muted); }
.desk-phone-row input {
    font-family: inherit; font-size: 28px; font-weight: 800; letter-spacing: 2px; padding: 12px 16px;
    border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--bg); color: var(--text);
    direction: ltr; text-align: center;
}
.desk-phone-row input:focus { outline: none; border-color: var(--primary); }
.desk-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 12px; }
.desk-status-new { background: var(--warning-light); border: 1px solid var(--warning); }
.desk-status-known { background: var(--success-light); border: 1px solid var(--success); }
.desk-status input { flex: 1 1 220px; font-family: inherit; font-size: 16px; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.desk-badge { font-weight: 800; padding: 3px 12px; border-radius: 999px; font-size: 14px; }
.desk-badge-new { background: var(--warning); color: #fff; }
.desk-badge-known { background: var(--success); color: #fff; }
.desk-known-name { font-size: 22px; font-weight: 800; }
.desk-question { margin: 8px 0 10px; font-size: 16px; }
.desk-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.desk-action {
    font-family: inherit; font-size: 17px; font-weight: 800; padding: 18px 12px; border-radius: var(--radius-md);
    border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .08s, border-color .15s;
}
.desk-action:hover:not(:disabled) { transform: translateY(-2px); }
.desk-action:disabled { opacity: .45; cursor: not-allowed; }
.desk-action-icon { font-size: 30px; }
.desk-action-order:hover:not(:disabled) { border-color: var(--success); background: var(--success-light); }
.desk-action-complaint:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-light); }
.desk-action-followup:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }
.desk-followup-box { margin-top: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius-md); }
#desk-result[hidden], #desk-new[hidden], #desk-known[hidden], #desk-open-warning[hidden], #desk-followup-box[hidden], #desk-name-hint[hidden] { display: none; }

/* ---- Roles & permissions (2026-10-02) ---- */
.perm-matrix-wrap { overflow-x: auto; }
.perm-matrix { width: 100%; border-collapse: collapse; min-width: 560px; }
.perm-matrix th, .perm-matrix td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.perm-matrix th:first-child, .perm-matrix td.perm-label { text-align: start; }
.perm-role-name { font-weight: 800; }
.perm-group-row td { background: var(--primary-light); color: var(--primary); font-weight: 800; text-align: start; }
.perm-cell input { width: 20px; height: 20px; cursor: pointer; accent-color: var(--primary); }
.perm-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--primary-light); color: var(--primary); }
.perm-chip-warn { background: var(--warning-light); color: var(--warning); }
.perm-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.perm-field input, .perm-field select { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.perm-field[hidden] { display: none; }
.access-details { margin-top: 8px; }
.access-details summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.perm-group-title { margin: 12px 0 4px; font-weight: 800; color: var(--text-muted); font-size: 13px; }
.perm-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.perm-check { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 14px; }
.perm-check.perm-diff { background: var(--warning-light); outline: 1px solid var(--warning); }


/* ---- Employees (2026-10-10) ---- */
.emp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.emp-form-grid .perm-field .helptext, .emp-form-grid .helptext { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.emp-form-grid .errorlist { color: var(--danger); font-size: 12.5px; list-style: none; padding: 0; margin: 2px 0 0; }
.emp-table-wrap { overflow-x: auto; }
.emp-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.emp-table th { text-align: start; font-size: 12.5px; color: var(--text-muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.emp-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.emp-row-off td { opacity: .55; }
.emp-row-flash td { background: var(--success-light); }
.emp-name { font-weight: 800; }
.emp-mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; direction: ltr; text-align: start; }
.emp-status { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.emp-status-on { background: var(--success-light); color: var(--success); }
.emp-status-off { background: var(--danger-light); color: var(--danger); }
.emp-edit td { background: var(--bg); padding: 16px; }
.emp-edit-actions { margin-top: 12px; }
.emp-edit-side { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.emp-edit-side form { display: flex; gap: 8px; align-items: center; }
.emp-edit-side input[type=text] { font-family: inherit; font-size: 14px; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }


/* ---- Activity log / profile (2026-10-10) ---- */
.act-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.act-table td { font-size: 14px; }
.act-table tr.act-denied td { background: var(--danger-light); }
.act-table tr.act-sign_in_failed td { background: var(--warning-light); }
.act-table tr.act-view td, .act-table tr.act-submit td { color: var(--text-muted); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
a.user-chip { text-decoration: none; }
a.user-chip:hover { outline: 1.5px solid var(--primary); }


/* ---- extension at sign-in (2026-10-10) ---- */
.login-ext { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 14px; }
.login-ext input { font-size: 22px; font-weight: 800; letter-spacing: 3px; text-align: center; direction: ltr; max-width: 200px; }
.login-ext .errorlist { color: var(--danger); font-size: 12.5px; list-style: none; padding: 0; margin: 0; }


/* ---- complaints on the tracking table (2026-10-10) ---- */
.track-complaints { white-space: nowrap; }
.track-complaints a { display: inline-block; margin: 1px 0; text-decoration: none; font-size: 12px; }
.track-complaints a:hover { outline: 1.5px solid var(--primary); }
.track-new-complaint { display: inline-block; margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--primary); text-decoration: none; border: 1px dashed var(--primary); border-radius: 999px; padding: 1px 8px; }
.track-new-complaint:hover { background: var(--primary-light); }


/* ---- Live orders board (2026-10-10) ---- */
.live-body { padding: 10px 14px; }
.live-page { max-width: none; }
.live-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; padding-inline-end: 330px; }
.live-title { display: flex; align-items: center; gap: 10px; }
.live-title .brand { margin: 0; }
.live-sub { font-weight: 700; color: var(--text-muted); }
.live-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-filters select, .live-filters input { font-family: inherit; font-size: 13px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.live-quick { display: inline-flex; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.live-quick button { font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border: 0; background: var(--surface); color: var(--text-muted); cursor: pointer; }
.live-quick button.on { background: var(--primary); color: #fff; }
.live-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.live-kpi { background: var(--surface); border-radius: var(--radius-md); padding: 8px 10px; text-align: center; box-shadow: var(--shadow); border-top: 4px solid var(--border); }
.live-kpi-v { font-size: 22px; font-weight: 800; line-height: 1.1; }
.live-kpi-l { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.live-kpi.ok { border-top-color: var(--success); } .live-kpi.ok .live-kpi-v { color: var(--success); }
.live-kpi.bad { border-top-color: var(--danger); } .live-kpi.bad .live-kpi-v { color: var(--danger); }
.live-kpi.warn { border-top-color: var(--warning); } .live-kpi.warn .live-kpi-v { color: var(--warning); }
.live-kpi.info { border-top-color: var(--primary); } .live-kpi.info .live-kpi-v { color: var(--primary); }
.live-kpi.strong { border-top-color: var(--primary); background: var(--primary-light); }
.live-table-wrap { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 230px); }
.live-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1400px; }
.live-table th { position: sticky; top: 0; z-index: 2; background: #1f3864; color: #fff; font-size: 12px; padding: 8px 8px; text-align: start; white-space: nowrap; }
.live-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.live-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.live-table tr.sla-late td { background: var(--danger-light); }
.live-table tr.sla-warning td { background: var(--warning-light); }
.live-table tr.st-cancelled td { color: var(--text-muted); text-decoration: line-through; }
.live-table tr.st-cancelled td .status-pill, .live-table tr.st-cancelled td .small { text-decoration: none; }
.live-table .mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; text-align: start; }
.live-table .name { font-weight: 800; }
.live-table .small { font-size: 12px; white-space: normal; max-width: 180px; }
.live-table small { color: var(--text-muted); }
.pay { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--primary-light); color: var(--primary); }
.pay-cash { background: var(--success-light); color: var(--success); }
.delay { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--success-light); color: var(--success); }
.delay-late { background: var(--danger); color: #fff; }
.delay-warning { background: var(--warning); color: #fff; }
.delay-cancelled { background: var(--border); color: var(--text-muted); }
.live-footer { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: live-pulse 2s infinite; }
.live-dot.off { background: var(--danger); animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
@keyframes live-pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.5); } 70% { box-shadow: 0 0 0 8px rgba(37,99,235,0); } 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); } }
.live-fullscreen .top-chrome, .live-fullscreen .live-header, .live-fullscreen .top-logo { display: none; }
.live-fullscreen .live-table-wrap { max-height: calc(100vh - 110px); }
.live-fullscreen .live-table { font-size: 15px; }
.live-fullscreen .live-kpi-v { font-size: 28px; }


/* ---- live board: clock + stage alerts ---- */
.live-clock { font-family: ui-monospace, Consolas, monospace; font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: 1px; direction: ltr; }
.live-fullscreen .live-clock-float { display: block; }
.alert-cell { white-space: normal; max-width: 240px; }
.alert { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.alert-ok { background: var(--success-light); color: var(--success); }
.alert-warn { background: var(--warning); color: #fff; }
.alert-late { background: var(--danger); color: #fff; animation: live-blink 1.2s steps(2, start) infinite; }
.alert-pos { white-space: normal; text-align: start; margin-bottom: 2px; }
/* POS check watcher: a banner on an order card whose POS check was voided / adjusted */
.pos-flag { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius-sm); margin: 8px 0; font-size: 13px; }
.pos-flag-void { background: var(--danger-light); border: 1px solid var(--danger); color: var(--danger); }
.pos-flag-adjusted { background: var(--warning-light); border: 1px solid var(--warning); color: var(--text); }
.pos-flag span { color: var(--text-muted); }
.pos-flag-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pos-flag-actions form { margin: 0; }
.emp-table tr.row-late td { background: var(--danger-light); }
/* cancelling an order from the complaint form */
.order-cancel-box { display: grid; gap: 8px; margin: 4px 0 12px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.order-cancel-head { font-weight: 800; font-size: 15px; }
.order-cancel-summary .review-row { padding: 5px 0; font-size: 13.5px; }
.order-cancel-summary .order-item-list { margin: 0; padding-inline-start: 18px; }
.order-cancel-state { color: var(--danger); font-weight: 700; font-size: 13px; }
.order-cancel-panel { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.order-cancel-result { display: grid; gap: 8px; justify-items: start; margin: 0; }
.cancel-link { color: var(--danger); font-size: 12px; font-weight: 700; text-decoration: none; }
.cancel-link:hover { text-decoration: underline; }
.cancel-order-form { margin-top: var(--sp-3, 12px); display: grid; gap: 10px; max-width: 640px; }
/* branch board: orders the call center cancelled, waiting for the branch to void the check */
.void-requests { display: grid; gap: 8px; margin: 0 0 12px; }
.void-requests:empty { display: none; }
.void-request { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-light); border: 2px solid var(--danger); }
.void-request strong { color: var(--danger); font-size: 15px; }
.void-request span { color: var(--text-muted); font-size: 13px; }
.void-request form { margin: 0; }
.live-table tr.al-late td { background: var(--danger-light); }
.live-table tr.al-warn td { background: var(--warning-light); }
.live-kpi.blink .live-kpi-v { animation: live-blink 1.2s steps(2, start) infinite; }
@keyframes live-blink { to { opacity: .35; } }
.live-fullscreen .live-clock { position: fixed; top: 8px; inset-inline-end: 16px; font-size: 34px; z-index: 5; }

/* ---- Live orders 2: the whole table fits the width of the screen (no sideways scrolling on a wall screen) ----
   the text size follows the screen width, long cells wrap onto a second line, numbers and times never break */
.live-simple .live-table-wrap { max-height: calc(100vh - 130px); }
.live-simple .live-table { min-width: 0; font-size: clamp(10.5px, 0.74vw, 15px); }
.live-simple .live-table th { white-space: normal; font-size: clamp(10px, 0.68vw, 13px); padding: 7px 5px; line-height: 1.25; }
.live-simple .live-table td { white-space: normal; padding: 6px 5px; overflow-wrap: break-word; }
.live-simple .live-table .tel-link { white-space: normal; }
.live-simple .live-table td.mono, .live-simple .live-table .status-pill, .live-simple .live-table .pay, .live-simple .live-table .delay { white-space: nowrap; overflow-wrap: normal; }
.live-simple .live-table .alert { font-size: inherit; padding: 2px 7px; border-radius: 10px; }
.live-simple .alert-cell { max-width: none; min-width: 9em; }
.live-simple .live-table .small { max-width: none; font-size: inherit; }
.live-simple.live-fullscreen .live-table-wrap { max-height: calc(100vh - 70px); }
.live-simple.live-fullscreen .live-table { font-size: clamp(10.5px, 0.78vw, 16px); }
@media (max-width: 900px) {
    /* a phone cannot hold twenty columns: there the table scrolls sideways as before */
    .live-simple .live-table-wrap { overflow-x: auto; }
    .live-simple .live-table { min-width: 1100px; font-size: 12px; }
}


/* ---- live board: policy strip, accountability; service targets screen ---- */
.live-policy { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin: 0 0 8px; }
.live-policy span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.live-policy small { font-weight: 600; }
.alert-reason { background: var(--danger-light); color: var(--danger); border: 1px dashed var(--danger); margin-top: 2px; }
.policy-list { margin: 0 0 10px; padding-inline-start: 22px; line-height: 1.8; }
.targets-table input { width: 80px; font-family: inherit; font-size: 15px; font-weight: 700; text-align: center; padding: 6px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.targets-all { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.targets-all input { width: 90px; text-align: center; font-weight: 700; }


/* ---- Live orders: its own prominent entry on the first page (2026-10-11) ---- */
.live-hero {
    display: flex; align-items: center; gap: 18px; text-decoration: none; color: #fff;
    background: linear-gradient(120deg, #1f3864 0%, #4f46e5 100%);
    border-radius: var(--radius-lg); padding: 18px 24px; margin-bottom: 26px;
    box-shadow: 0 14px 30px -12px rgba(79, 70, 229, .55); transition: transform .12s, box-shadow .12s;
}
.live-hero:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(79, 70, 229, .7); }
.live-hero-icon { position: relative; font-size: 44px; line-height: 1; background: rgba(255,255,255,.14); border-radius: 18px; padding: 12px 16px; }
.live-hero-dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 11px; height: 11px; border-radius: 50%; background: #4ade80; animation: live-pulse 2s infinite; }
.live-hero-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.live-hero-title { font-size: 22px; font-weight: 800; }
.live-hero-desc { font-size: 14px; opacity: .85; }
.live-hero-go { font-weight: 800; background: #fff; color: #1f3864; border-radius: 999px; padding: 9px 18px; white-space: nowrap; }
@media (max-width: 640px) { .live-hero { flex-wrap: wrap; } .live-hero-go { width: 100%; text-align: center; } }


/* ---- missing extension warning (2026-10-11) ---- */
.ext-warning {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
    margin: 58px auto 22px; max-width: 980px; padding: 12px 18px;
    background: var(--warning-light); color: var(--warning); border: 1.5px solid var(--warning);
    border-radius: var(--radius-md); font-weight: 600;
}
.ext-warning-form { display: flex; gap: 6px; align-items: center; }
.ext-warning-form input { width: 110px; text-align: center; font-weight: 800; letter-spacing: 2px; font-size: 16px; padding: 6px 8px; border: 1.5px solid var(--warning); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); direction: ltr; }
.ext-warning-form button { font-family: inherit; font-weight: 800; padding: 7px 16px; border: 0; border-radius: 999px; background: var(--warning); color: #fff; cursor: pointer; }

/* ---- stage alerts: banner + sound control (Live orders, Orders board) ---- */
.alert-bar {
    position: sticky; top: 0; z-index: 300; background: var(--danger); color: #fff; font-weight: 700;
    padding: 10px 18px; text-align: center; animation: alert-flash 1.2s ease-in-out infinite;
}
.alert-bar-items { font-weight: 600; }
@keyframes alert-flash { 50% { background: #7f1d1d; } }
.alert-sound-box { position: fixed; bottom: 12px; inset-inline-start: 14px; z-index: 160; display: flex; align-items: center; gap: 8px; }
.alert-sound-btn { font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.alert-sound-btn.off { color: var(--text-muted); }
.alert-sound-hint { font-size: 12.5px; font-weight: 700; background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); border-radius: 999px; padding: 4px 12px; }
.alert-sound-hint[hidden] { display: none; }
.sla-stage { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--primary-light); color: var(--primary); }
.sla-stage-late { background: var(--danger); color: #fff; }
.sla-stage-warning { background: var(--warning); color: #fff; }

.alert-settings-link { text-decoration: none; }
/* ---- alert sound picker (My profile) ---- */
.sound-list { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.sound-row:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.sound-row-off { opacity: .6; }
.sound-label { flex: 1; font-weight: 700; }
.sound-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }

.time-input { font-family: inherit; font-size: 14px; font-weight: 700; padding: 6px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); direction: ltr; }
.open-chip { font-weight: 800; font-size: 13.5px; padding: 5px 14px; border-radius: 999px; border: 1.5px solid var(--border); white-space: nowrap; }
.open-chip-open { background: var(--online-light); color: var(--online); border-color: var(--online); }
.open-chip-closed { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
.open-chip-unknown { background: var(--bg); color: var(--text-muted); }
.hero-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 26px; }
.hero-row .live-hero { margin-bottom: 0; }
.live-hero-pickup { background: linear-gradient(120deg, #0f766e 0%, #14b8a6 100%); box-shadow: 0 14px 30px -12px rgba(20, 184, 166, .55); }
.live-hero-pickup:hover { box-shadow: 0 18px 34px -12px rgba(20, 184, 166, .7); }
.live-hero-pickup .live-hero-go { color: #0f766e; }


/* ---- Handover tablet (2026-10-11): big touch tiles with just the order numbers ---- */
.handover-body { padding: 0; background: #0f172a; color: #fff; }
.handover-page { padding: 14px 18px 60px; max-width: none; }
.handover-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 54px 0 14px; }
.handover-title { font-size: 26px; font-weight: 900; }
.handover-help { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hv-legend { font-size: 14px; font-weight: 800; padding: 4px 14px; border-radius: 999px; }
.hv-legend.hv-preparing { background: #78350f; color: #fde68a; }
.hv-legend.hv-ready { background: #14532d; color: #bbf7d0; }
.handover-branch select { font-family: inherit; font-size: 16px; padding: 8px 12px; border-radius: var(--radius-sm); }
.handover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.hv-tile {
    font-family: inherit; color: #fff; border: 0; border-radius: 22px; padding: 22px 12px 16px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 150px; justify-content: center;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .08s, opacity .15s;
}
.hv-tile:active { transform: scale(.96); }
.hv-tile.busy { opacity: .45; pointer-events: none; }
.hv-preparing { background: linear-gradient(160deg, #b45309, #d97706); }
.hv-ready { background: linear-gradient(160deg, #15803d, #22c55e); box-shadow: 0 0 0 4px rgba(34,197,94,.35); }
.hv-number { font-size: 56px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; direction: ltr; }
.hv-meta { font-size: 14px; font-weight: 700; opacity: .92; text-align: center; }
.handover-empty { text-align: center; font-size: 22px; color: #94a3b8; margin-top: 60px; }
.handover-toast { position: fixed; bottom: 28px; inset-inline: 0; margin: 0 auto; width: fit-content; max-width: 90%; background: #16a34a; color: #fff; font-size: 20px; font-weight: 800; padding: 14px 28px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 400; }
.handover-toast.bad { background: #dc2626; }
.handover-toast[hidden] { display: none; }
.handover-foot { position: fixed; bottom: 8px; inset-inline-start: 16px; font-size: 12.5px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.handover-body .chrome-btn, .handover-body .user-chip { box-shadow: none; }


/* ---- new-order screen (2026-10-11) ---- */
.btn-primary.btn-nav-back { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); }
.btn-primary.btn-nav-back:hover { background: var(--primary-light); }
.service-readd { margin: 0 0 10px; width: 100%; font-weight: 700; }
.service-readd[hidden] { display: none; }
.category-footer { justify-content: space-between; align-items: center; }
.category-footer-hint { color: var(--text-muted); font-size: 13px; }


/* ---- drivers report (2026-10-11) ---- */
.driver-bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.driver-bar-name { width: 130px; flex: none; font-weight: 600; font-size: 14px; }
.driver-bar-track { flex: 1; height: 16px; background: var(--primary-light); border-radius: 999px; overflow: hidden; }
.driver-bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.driver-bar-num { width: 36px; flex: none; text-align: end; font-weight: 700; }
.perf-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.perf-excellent { background: #dcfce7; color: #166534; }
.perf-good { background: #fef9c3; color: #854d0e; }
.perf-attention { background: #fee2e2; color: #991b1b; }
tr.total-row td { border-top: 2px solid var(--border, #cbd5e1); background: var(--primary-light); }

.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.tab-link { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--primary); color: var(--primary); font-weight: 700; text-decoration: none; }
.tab-link.active { background: var(--primary); color: #fff; }

/* ---- agent sales targets (2026-10-11) ---- */
.tgt-summary { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 760px) { .tgt-summary { grid-template-columns: 1fr; } }
.tgt-title-agent { background: #7f6000; color: #fff; padding: 8px 14px; border-radius: 6px; }
.tgt-title-team { background: #1f3864; color: #fff; padding: 8px 14px; border-radius: 6px; }
.tgt-totals { border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tgt-totals-agent { background: #fff2cc; border: 1px solid #bf9000; }
.tgt-totals-team { background: #d9e2f3; border: 1px solid #1f3864; }
.tgt-total-head { font-weight: 800; text-align: center; padding: 6px; border-radius: 4px; color: #fff; }
.tgt-totals-agent .tgt-total-head { background: #7f6000; }
.tgt-totals-team .tgt-total-head { background: #1f3864; }
.tgt-total-row { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.7); padding: 8px 12px; border-radius: 4px; }
.tgt-realization { text-align: center; font-size: 28px; font-weight: 800; padding: 10px; border-radius: 6px; color: #fff; background: #64748b; }
.tgt-realization small { display: block; font-size: 12px; letter-spacing: 1px; opacity: .9; }
.tgt-realization.tgt-good, .tgt-pill.tgt-good { background: #15803d; }
.tgt-realization.tgt-warn, .tgt-pill.tgt-warn { background: #b45309; }
.tgt-realization.tgt-bad, .tgt-pill.tgt-bad { background: #b91c1c; }
.tgt-pill { display: inline-block; color: #fff; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.tgt-chart-box { border: 1px solid var(--border, #cbd5e1); border-radius: 8px; overflow: hidden; }
.tgt-chart-title { background: #7f6000; color: #fff; font-weight: 700; text-align: center; padding: 6px; }
.tgt-totals-team + .tgt-chart-box .tgt-chart-title { background: #1f3864; }
.tgt-chart { padding: 10px 12px; }
.tgt-legend { text-align: center; font-size: 13px; margin-bottom: 6px; }
.tgt-dot { display: inline-block; width: 10px; height: 10px; margin-inline-end: 4px; }
.tgt-bars { display: flex; align-items: flex-end; gap: 4px; height: 190px; }
.tgt-month { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.tgt-pair { display: flex; align-items: flex-end; gap: 2px; height: 160px; width: 100%; justify-content: center; }
.tgt-bar { display: block; width: 38%; min-height: 1px; border-radius: 2px 2px 0 0; }
.tgt-target { background: #4472c4; }
.tgt-actual { background: #ed7d31; }
.tgt-label { font-size: 11px; margin-top: 4px; }

/* ---- agent scorecard v2 (2026-10-11) ---- */
.prio { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.prio-high { background: #fee2e2; color: #991b1b; } .prio-medium { background: #ffedd5; color: #9a3412; } .prio-normal { background: #dcfce7; color: #166534; }
.rating-excellent { background: #dcfce7; color: #166534; } .rating-very_good { background: #d1fae5; color: #065f46; }
.rating-good { background: #fef9c3; color: #854d0e; } .rating-improve { background: #ffedd5; color: #9a3412; } .rating-action { background: #fee2e2; color: #991b1b; }
.rating-none { background: #f1f5f9; color: #475569; }
.rating-bar-excellent, .rating-bar-very_good { background: #16a34a; } .rating-bar-good { background: #ca8a04; } .rating-bar-improve { background: #ea580c; } .rating-bar-action { background: #dc2626; }
.row-missed-high td { background: #fff1f2; }
.cell-low { background: #fee2e2; font-weight: 700; } .cell-full { background: #dcfce7; }
.eos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 12px; }
@media (max-width: 760px) { .eos-grid { grid-template-columns: 1fr; } }
.eos-auto, .eos-manual { border: 1px solid var(--border, #cbd5e1); border-radius: 8px; padding: 12px; }
.eos-auto { background: #f8fafc; }
.eos-auto h3, .eos-manual h3 { margin: 0 0 8px; font-size: 14px; color: var(--text-muted); }
.eos-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; }
.sheet-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; margin-bottom: 12px; }
.sheet-head small { display: block; color: var(--text-muted); font-size: 12px; } .sheet-head strong { font-size: 16px; }
.sheet-score { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 12px; padding: 12px; background: #f8fafc; border-radius: 8px; }
.sheet-score small { display: block; color: var(--text-muted); font-size: 12px; } .sheet-score strong { font-size: 24px; }
.sheet-notes { display: grid; gap: 10px; margin-top: 8px; } .sheet-notes p { margin: 4px 0 0; white-space: pre-wrap; }
.score-table input[type="text"] { width: 100%; }

/* ---- targets setup + tracking (2026-10-11) ---- */
.st-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-on_track, .st-excellent { background: #dcfce7; color: #166534; }
.st-behind { background: #fef9c3; color: #854d0e; }
.st-critical, .st-improve { background: #fee2e2; color: #991b1b; }
.st-none, .st-future { background: #f1f5f9; color: #475569; }
tr.row-today td { background: #eef2ff; }
.pace-chart { width: 100%; height: auto; max-height: 300px; display: block; }
.pace-grid { stroke: #e2e8f0; stroke-width: 1; }
.pace-axis { font-size: 11px; fill: #64748b; }
.pace-target { fill: none; stroke: #4472c4; stroke-width: 2.5; stroke-dasharray: 6 4; }
.pace-actual { fill: none; stroke: #ed7d31; stroke-width: 3; }
.pace-actual-dot { fill: #ed7d31; }

/* ---- Reports hub (2026-10-11) ---- */
.live-hero-reports { background: linear-gradient(120deg, #0f766e 0%, #0ea5e9 100%); box-shadow: 0 14px 30px -12px rgba(14, 165, 233, .55); }
.live-hero-reports:hover { box-shadow: 0 18px 34px -12px rgba(14, 165, 233, .7); }
.live-hero-reports .live-hero-go { color: #0f766e; }
.hub-intro { color: var(--text-muted); margin: 0 0 18px; font-weight: 600; }
.hub-count { display: inline-block; min-width: 22px; text-align: center; font-size: 12px; background: var(--primary-light); color: var(--primary); border-radius: 999px; padding: 1px 8px; margin-inline-start: 6px; }

/* ---- sign-in: the extension field is folded (2026-10-11) ---- */
.login-ext-fold { margin: 0 0 14px; }
.login-ext-fold summary { cursor: pointer; font-weight: 700; color: var(--primary); list-style: none; padding: 8px 0; }
.login-ext-fold summary::-webkit-details-marker { display: none; }
.login-ext-fold summary::before { content: "▸ "; }
.login-ext-fold[open] summary::before { content: "▾ "; }
.login-ext-fold .login-ext { margin-top: 8px; }

/* ---- hero row that no longer squeezes (2026-10-11) ---- */
.hero-row .live-hero { flex-wrap: wrap; }
.hero-row .live-hero-text { min-width: 160px; }
.hero-row .live-hero-title { font-size: 20px; }
.hero-row .live-hero-go { width: 100%; text-align: center; }

/* ---- Live orders: shops / agents status strips (2026-10-11) ---- */
.live-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 8px; padding: 6px 10px; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.live-strip-head { font-weight: 800; font-size: 14px; white-space: nowrap; margin-inline-end: 6px; }
.live-strip-head b { direction: ltr; display: inline-block; color: var(--primary); }
.live-strip-items { display: contents; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1.5px solid; white-space: nowrap; }
.live-chip i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.live-chip.online { color: #1e40af; background: #eff6ff; border-color: #93c5fd; } .live-chip.online i { background: #2563eb; animation: live-pulse-blue 2s infinite; }
.live-chip.offline { color: #991b1b; background: #fef2f2; border-color: #fca5a5; } .live-chip.offline i { background: #ef4444; }
.live-chip.paused { color: #92400e; background: #fffbeb; border-color: #fcd34d; } .live-chip.paused i { background: #f59e0b; }
.pause-card.is-paused { border-color: var(--danger); }
.pause-card .pause-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pause-card .pause-reason { margin-top: 6px; font-size: 14px; color: var(--danger); }
.live-chip.closed { color: #475569; background: #f1f5f9; border-color: #cbd5e1; } .live-chip.closed i { background: #94a3b8; }
.live-strip-empty { color: var(--text-muted); font-weight: 600; }
.live-fullscreen .live-chip { font-size: 15px; padding: 5px 14px; }

/* ---- closed branches on the order screen (2026-10-12) ---- */
.branch-btn.is-closed { opacity: .55; }
.branch-closed-tag { display: block; font-size: 11px; font-weight: 700; color: var(--danger); }

/* delivery charge selector (3 / 5 / 7 / 9) in the order summary */
.delivery-charge-box { margin: 0 0 10px; }
.delivery-charge-box[hidden] { display: none; }
.delivery-charge-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.delivery-charge-options { display: flex; flex-wrap: wrap; gap: 6px; }
.delivery-charge-btn { flex: 1 1 auto; min-width: 44px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.delivery-charge-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* driver settlement: one block per driver with counts and order numbers */
.settlement-driver { margin: 0 0 22px; page-break-inside: avoid; break-inside: avoid; }
.settlement-driver-title { font-size: 16px; font-weight: 800; margin: 0 0 8px; }
.settlement-driver-title small { font-weight: 600; color: var(--text-muted); }
.settlement-summary { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 6px 12px; margin: 0 0 10px; background: var(--surface); }
.settlement-summary-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: baseline; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.settlement-summary-row:last-child { border-bottom: 0; }
.settlement-numbers { color: var(--text-muted); font-size: 13px; word-break: break-word; }
.settlement-amount { font-weight: 800; direction: ltr; }
.settlement-summary-total { font-weight: 800; }
@media (max-width: 640px) { .settlement-summary-row { grid-template-columns: 1fr auto; } .settlement-numbers { grid-column: 1 / -1; } }

/* ---------- Receipt printing (80 mm roll printer, e.g. BIXOLON SRP-B300) ----------
   The "Receipt" button of a statement adds body.receipt-print only while the print dialog is open, so the
   statement prints as a narrow, readable strip instead of a desktop page shrunk onto the roll. The width comes from
   the printer's own paper (80 mm or 58 mm), the length from the content: the printer cuts where the text ends. */
/* no named @page / page: property here: Chrome starts a named page on a new sheet, so the receipt came out blank
   (first sheet empty). The small margins are added as a plain @page by printReceipt() while printing. */
body.receipt-print { width: auto; height: auto; min-height: 0; margin: 0; padding: 0; overflow: visible; font-size: 11px; line-height: 1.35; color: #000; background: #fff; }
body.receipt-print .page, body.receipt-print .container { max-width: none; width: auto; height: auto; min-height: 0; margin: 0; padding: 0; overflow: visible; animation: none; opacity: 1; }
/* the whole statement is one card: it must be allowed to flow over several sheets, never "kept together" */
body.receipt-print .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 6px; background: #fff; break-inside: auto; page-break-inside: auto; animation: none; opacity: 1; }
body.receipt-print .card-title { font-size: 12px; margin: 4px 0; }
body.receipt-print .print-header { display: block; text-align: center; border-bottom: 1px dashed #000; padding-bottom: 4px; margin-bottom: 6px; }
body.receipt-print .print-logo { max-height: 36px; max-width: 100%; }
body.receipt-print .print-title { font-size: 14px; font-weight: 800; }
body.receipt-print .print-subtitle { font-size: 10px; color: #000; }
body.receipt-print .settlement-driver { margin: 0 0 8px; padding-top: 4px; border-top: 1px dashed #000; break-inside: auto; page-break-inside: auto; }
body.receipt-print .settlement-driver-title { font-size: 12.5px; margin: 0 0 3px; }
body.receipt-print .settlement-driver-title small { color: #000; }
body.receipt-print .settlement-summary { border: 0; padding: 0; margin: 0 0 4px; background: #fff; }
/* flex, not grid: grid inside break-inside:avoid boxes can drop its content when Chrome prints (blank receipt) */
body.receipt-print .settlement-summary-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; padding: 2px 0; border-bottom: 0; }
body.receipt-print .settlement-summary-row > span:first-child { order: 1; flex: 1 1 auto; }
body.receipt-print .settlement-summary-row > span:empty { display: none; }
body.receipt-print .settlement-amount { order: 2; }
body.receipt-print .settlement-numbers { order: 3; flex: 0 0 100%; font-size: 10px; color: #000; }
body.receipt-print .settlement-summary-total { border-top: 1px solid #000; }
body.receipt-print .settlement-table, body.receipt-print .settlement-table tbody { display: block; width: 100%; font-size: 10.5px; }
body.receipt-print .settlement-table thead { display: none; }
body.receipt-print .settlement-table tr { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 2px 0; border-bottom: 1px dotted #000; }
body.receipt-print .settlement-table td { display: block; padding: 0; border: 0; background: none; }
body.receipt-print .settlement-table td:nth-child(1) { order: 1; font-weight: 800; }
body.receipt-print .settlement-table td:nth-child(5) { order: 2; flex: 1 1 auto; }
body.receipt-print .settlement-table td:nth-child(4) { order: 3; }
body.receipt-print .settlement-table td:nth-child(6) { order: 4; font-weight: 800; text-align: end; }
body.receipt-print .settlement-table td:nth-child(2) { order: 5; flex: 0 0 100%; font-size: 10px; }
body.receipt-print .settlement-table td:nth-child(3) { order: 6; flex: 0 0 100%; font-size: 10px; }
body.receipt-print .settlement-table td:nth-child(2):empty, body.receipt-print .settlement-table td:nth-child(3):empty { display: none; }
body.receipt-print .payment-badge { background: none; color: #000; padding: 0; }
body.receipt-print .settlement-totals { border-top: 2px solid #000; margin-top: 6px; padding-top: 4px; }
body.receipt-print .review-row { display: flex; justify-content: space-between; padding: 1px 0; border: 0; }
body.receipt-print .review-row span { font-size: 11px; color: #000; }

/* ---- Delivery zones (2026-11-19) ---- */
.topbar-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.zone-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.zone-filters input[type=search] { flex: 1 1 220px; min-width: 160px; }
.zone-table th a { color: inherit; text-decoration: none; white-space: nowrap; }
.zone-table th a:hover { color: var(--primary); }
.zone-free { color: var(--success); font-weight: 700; }
.zone-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.zone-inline { display: inline; margin: 0; }
.zone-act {
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px;
    font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.zone-act:hover { border-color: var(--primary); color: var(--primary); }
.zone-act-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.zone-pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 16px; }
.is-loading { opacity: .6; cursor: progress; }
.zone-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.zone-layout .card { margin-bottom: 18px; }
.zone-wide { grid-column: 1 / -1; }
.zone-status-field { display: flex; align-items: center; gap: 8px; }
.zone-status-field input { width: auto; }
.zone-coverage input[type=search] { width: 100%; margin: 8px 0; }
.area-picker { max-height: 440px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; }
.area-city { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.area-city legend { font-weight: 700; width: 100%; padding: 4px 0; }
.area-opt[hidden] { display: none; }
.area-taken { color: var(--warning); font-size: 11.5px; }
.zone-save { display: flex; gap: 10px; margin-top: 4px; }
.zone-facts th { text-align: start; width: 40%; color: var(--text-muted); font-weight: 600; }
.zone-info {
    background: var(--primary-light); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
}
.zone-info .zone-title { font-weight: 800; margin-bottom: 4px; }
.zone-info .zone-terms { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.zone-info .zone-warn { margin-top: 6px; color: var(--danger); font-weight: 700; }
@media (max-width: 900px) { .zone-layout { grid-template-columns: minmax(0, 1fr); } }
.zone-newplaces { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 12px; }
.zone-newplaces select, .zone-newplaces input[type=text], .zone-newplaces textarea { width: 100%; margin-top: 6px; }
.area-nozone { color: var(--text-muted); font-size: 11.5px; font-style: italic; }
.area-city[hidden] { display: none; }
.google-search { position: relative; margin: 8px 0 12px; }
.google-search input[type=search] { width: 100%; }
.google-results { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); max-height: 240px; overflow: auto; }
.google-results[hidden] { display: none; }
.google-results button { width: 100%; text-align: start; background: none; border: 0; padding: 8px 10px; font: inherit; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); }
.google-results button:hover { background: var(--primary-light); }

/* ---- Delivery zone form, redesigned (2026-11-20): numbered steps, fee buttons, place chips, live preview, map ---- */
.zone-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.zstep-n {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; margin-inline-end: 6px;
}
.switch { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--border); transition: background .15s; flex: none; }
.switch-track::after {
    content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + .switch-track::after { transform: translateX(-20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-text { font-weight: 600; font-size: 13.5px; }
.fee-buttons, .quick-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fee-buttons[hidden] { display: none; }
.fee-btn, .quick-picks button {
    border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px;
    padding: 7px 18px; font: inherit; font-weight: 700; cursor: pointer; min-width: 64px;
}
.quick-picks button { padding: 3px 12px; min-width: 0; font-weight: 600; font-size: 12.5px; }
.fee-btn:hover, .quick-picks button:hover { border-color: var(--primary); color: var(--primary); }
.fee-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.place-city-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.place-box { position: relative; }
.place-box input { width: 100%; font-size: 15px; padding: 12px 14px; }
.place-suggest {
    position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow);
    max-height: 320px; overflow: auto;
}
.place-suggest[hidden] { display: none; }
.place-option { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.place-option small { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.place-option.active, .place-option:hover { background: var(--primary-light); }
.place-option.kind-create { color: var(--primary); font-weight: 700; }
.place-option.kind-info { color: var(--text-muted); font-style: italic; cursor: default; background: none; }
.place-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.place-chip {
    display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light); color: var(--text);
    border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13.5px; font-weight: 600;
}
[dir="rtl"] .place-chip { padding: 5px 12px 5px 6px; }
.place-chip small { color: var(--text-muted); font-weight: 500; font-size: 11.5px; }
.place-chip em { font-style: normal; font-size: 10.5px; font-weight: 800; background: var(--success); color: #fff; border-radius: 999px; padding: 1px 7px; }
.place-chip.is-taken { background: var(--warning-light); }
.place-chip button {
    border: 0; background: rgba(0, 0, 0, .08); color: inherit; width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
    font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.place-chip button:hover { background: var(--danger); color: #fff; }
.place-more { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.place-more summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.place-more textarea, .place-more input[type=search] { width: 100%; margin-top: 8px; }
.place-more .area-picker { max-height: 300px; margin-top: 8px; }
.zone-advanced > summary { cursor: pointer; margin: 0; }
.zone-right { position: sticky; top: 12px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; }
.zone-preview .zp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; }
.zp-terms { list-style: none; margin: 12px 0; padding: 0; }
.zp-terms li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.zp-terms li span { color: var(--text-muted); }
.zp-calc { background: var(--bg); border-radius: var(--radius-md); padding: 12px; display: grid; gap: 6px; }
.zp-calc label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.zp-calc input { width: 100%; }
.zp-ok { color: var(--success); font-weight: 700; font-size: 13.5px; }
.zp-bad { color: var(--danger); font-weight: 700; font-size: 13.5px; }
#zone-map { height: 280px; border-radius: var(--radius-md); overflow: hidden; z-index: 0; }
.zone-save {
    position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: 0 -6px 18px -12px rgba(15, 23, 42, .35); padding: 12px 16px; align-items: center; flex-wrap: wrap;
}
.zone-save-msg { color: var(--danger); font-weight: 700; font-size: 13.5px; }
@media (max-width: 900px) { .zone-layout { grid-template-columns: minmax(0, 1fr); } .zone-right { position: static; max-height: none; overflow: visible; } }
.place-box input, .zp-calc input, .place-more input[type=search], .place-more textarea, .zone-advanced textarea {
    font-family: inherit; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}
.place-more textarea, .zone-advanced textarea, .zp-calc input, .place-more input[type=search] { padding: 8px 10px; font-size: 14px; }
.place-box input:focus, .perm-field input:focus, .perm-field select:focus, .zp-calc input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.perm-field textarea { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }

/* ---- Delivery zones: use the width of the screen (2026-11-20) ----
   >= 1500px  three columns: zone + pricing | places | preview + map
   900-1499   two columns:   the steps | preview + map (which follows the page)
   < 900      one column */
.page.page-wide { max-width: min(1680px, 100%); }
.zone-layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas: "a side" "b side";
    grid-template-rows: auto 1fr;
    gap: 20px;
}
.zone-a { grid-area: a; }
.zone-b { grid-area: b; }
.zone-right { grid-area: side; position: sticky; top: var(--zone-side-top, 12px); align-self: start; max-height: none; overflow: visible; }
.zone-layout .card { margin-bottom: 20px; }
.zone-col > :last-child, .zone-right > :last-child { margin-bottom: 0; }
.zone-save { margin-top: 20px; }
#zone-map { height: clamp(220px, 36vh, 420px); }
.zp-terms { margin: 10px 0; }
.zp-terms li { padding: 6px 0; }
@media (min-width: 1500px) {
    .zone-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
        grid-template-areas: "a b side";
        grid-template-rows: auto;
    }
}
@media (max-width: 900px) {
    .zone-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "side"; grid-template-rows: auto; }
    .zone-right { position: static; }
}
.zone-right .card { padding: 20px; }
.zone-right .card-title { margin-bottom: 12px; }
.zp-calc { grid-template-columns: minmax(0, 1fr) 120px; align-items: center; }
.zp-calc #zp-result { grid-column: 1 / -1; }
#zone-map { height: clamp(200px, 30vh, 380px); }

/* =====================================================================================================================
   DESIGN SYSTEM (2026-11-20) - one scale for every page. New rules use these; old rules move over page by page.

   Spacing   --sp-1 4  --sp-2 8  --sp-3 12  --sp-4 16  --sp-5 24  --sp-6 32
   Type      --fs-xs 12  --fs-sm 13  --fs-md 14  --fs-lg 16  --fs-xl 20  --fs-2xl 26
   Page      .page-narrow 760 (a single form)   .page 1080 (default)   .page-wide 1680 (tables, lists, dashboards)
   Breakpoints (media queries cannot read variables, so these three numbers are THE breakpoints):
             640  phone and below      900  tablet and below      1500  wide desktop and above
   ===================================================================================================================== */
:root {
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
    --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px;
    --w-narrow: 760px; --w-page: 1080px; --w-wide: 1680px;
}
.page.page-narrow { max-width: min(var(--w-narrow), 100%); }
.page.page-wide { max-width: min(var(--w-wide), 100%); }

/* A table never widens the page: when it needs more room than its card it scrolls INSIDE the card. */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > table { width: 100%; }

/* Fields share the row while there is room and stack when there is not - no fixed column count. */
.form-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--sp-3) var(--sp-4); align-items: start; }
.form-auto > .span-all { grid-column: 1 / -1; }

/* Cards / panels side by side while they fit: --col-min sets how narrow one may get. */
.cols-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--col-min, 320px), 100%), 1fr)); gap: var(--sp-5); align-items: start; }
.cols-auto > .card { margin-bottom: 0; }

/* A row of filters / actions that wraps instead of overflowing. */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; }
.toolbar > .grow { flex: 1 1 200px; min-width: 0; }

/* Page widths in use (2026-11-20, phase 2 - admin and report screens):
   page-mid  1320  a list of rows / settings cards (stretching a row across 1680 would pull its ends too far apart)
   page-wide 1680  tables, tile grids, dashboards
   The report family (dashboard-page) was 1400 and now follows the wide width. */
:root { --w-mid: 1320px; }
.page.page-mid { max-width: min(var(--w-mid), 100%); }
.page.dashboard-page { max-width: min(var(--w-wide), 100%); }

/* ---- Driver's mobile number (2026-11-21): a tap-to-call link beside the driver, urgent when the delivery is late ---- */
.tel-link { color: var(--primary); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.tel-link:hover { text-decoration: underline; }
.tel-link.tel-urgent { display: inline-block; margin-top: 3px; padding: 2px 10px; border-radius: 999px; background: var(--danger); color: #fff; }
.driver-phone-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.driver-phone-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.driver-phone-row.is-off { opacity: .55; }
.driver-phone-name { flex: 1 1 140px; min-width: 0; font-weight: 600; }
.driver-phone-name small { display: block; color: var(--text-muted); font-weight: 400; font-size: var(--fs-xs); }
.driver-phone-row input[type=tel], .driver-phone-cell input[type=tel] {
    flex: 1 1 130px; min-width: 0; max-width: 180px; font: inherit; padding: 6px 10px; direction: ltr;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}
.driver-phone-cell { display: flex; gap: var(--sp-1); align-items: center; margin: 0; }
.form-grid .helptext { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }

/* ---- The order box on the complaint form: `hidden` must win over its display:grid (2026-11-24 - the cancellation
   reason showed with no order number typed) ---- */
.order-cancel-box[hidden], .order-cancel-panel[hidden], .order-cancel-result[hidden] { display: none; }

/* ---- Order tracking: the Live orders columns, and a click on an order opens it (2026-11-24) ---- */
/* 21 columns have to fit the width of the screen: the text follows the screen width, the padding is tight, names and
   long texts wrap, and the times, numbers and pills stay on one line. Below 1100px the table scrolls sideways. */
.tracking-table { font-size: clamp(10.5px, 0.7vw, 13px); }
.tracking-table th, .tracking-table td { font-size: inherit; padding: 7px 5px; }
.tracking-table th { white-space: normal; line-height: 1.25; }
.tracking-table .mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; text-align: start; }
.tracking-table .name { font-weight: 800; }
.tracking-table small { color: var(--text-muted); }
.tracking-table td.wrap, .tracking-table td:first-child small { white-space: normal; overflow-wrap: break-word; }
.tracking-table .notes-cell { min-width: 0; overflow-wrap: break-word; }
.tracking-table .alert-cell { max-width: none; }
.tracking-table .alert { white-space: normal; text-align: start; border-radius: 10px; font-size: inherit; padding: 2px 7px; }
.tracking-table .pay, .tracking-table .delay, .tracking-table .status-pill, .tracking-table .tel-link,
.tracking-table .track-complaints a { font-size: inherit; }
.tracking-table .track-complaints { white-space: normal; }
.tracking-table .track-complaints a { white-space: nowrap; }
@media (max-width: 1500px) {
    .tracking-table th, .tracking-table td { padding: 6px 3px; }
}
@media (max-width: 1100px) {
    .tracking-table { min-width: 1100px; font-size: 12px; }
}
.tracking-table .track-open { font-weight: 800; color: inherit; text-decoration: none; }
.tracking-table .track-open:hover, .tracking-table .track-open:focus-visible { color: var(--primary); text-decoration: underline; }
.tracking-table tr.track-row { cursor: pointer; }
.tracking-table tr.track-row:hover td { box-shadow: inset 0 2px 0 var(--primary), inset 0 -2px 0 var(--primary); }
.tracking-table tr.row-sla-cancelled .status-pill, .tracking-table tr.row-sla-cancelled .delay { opacity: 0.85; }

/* Connection alerts (2026-11-24): this screen lost the system / a branch went silent. Loud on purpose - red,
   flashing, sticky at the top of the page; the data under a lost connection is dimmed so nobody trusts it. */
@keyframes conn-blink { from { background: #b91c1c; } to { background: #7f1d1d; } }
.conn-banner { position: sticky; top: 0; z-index: 400; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 4px 18px; padding: 14px 18px; background: #b91c1c; color: #fff; text-align: center; border-bottom: 5px solid #450a0a;
    font-size: clamp(16px, 1.5vw, 24px); animation: conn-blink 0.9s ease-in-out infinite alternate; }
.conn-banner[hidden] { display: none; }
.conn-banner-title { font-weight: 900; font-size: 1.2em; }
.conn-banner-detail { font-weight: 700; }
.conn-banner.conn-ok { background: #15803d; border-bottom-color: #14532d; animation: none; }
body.conn-down [data-conn-dim] { opacity: 0.35; filter: grayscale(0.8); }

.conn-branch-panel { display: grid; gap: 8px; margin: 0 0 10px; }
.conn-branch-panel[hidden] { display: none; }
.conn-branch, .pos-down-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 18px;
    border-radius: var(--radius-md); background: #b91c1c; color: #fff; border: 3px solid #450a0a;
    animation: conn-blink 0.9s ease-in-out infinite alternate; }
.conn-branch-text, .pos-down-banner { font-size: clamp(15px, 1.3vw, 21px); }
.conn-branch-text { flex: 1 1 340px; display: grid; gap: 2px; }
.conn-branch-text strong, .pos-down-banner strong { font-weight: 900; font-size: 1.15em; display: block; }
.pos-down-banner { display: grid; margin: 0 0 12px; }
.conn-btn { display: inline-block; background: #fff; color: #991b1b; font: inherit; font-weight: 800; border: 0; border-radius: 999px;
    padding: 7px 16px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.conn-btn:hover { background: #fee2e2; }
.conn-btn-quiet { background: transparent; color: #fff; border: 2px solid #fff; }
.conn-btn-quiet:hover { background: rgba(255, 255, 255, 0.18); }
@media (prefers-reduced-motion: reduce) {
    .conn-banner, .conn-branch, .pos-down-banner { animation: none; }
}

/* ---- New order screen, the order summary (2026-11-25): bigger and clearer so the agent can read it from the call ----
   The page is the middle width (1320) and the summary column grows with the screen (380-480px). */
@media (min-width: 960px) {
    .layout { grid-template-columns: minmax(0, 1fr) clamp(380px, 31vw, 480px); }
}
.cart-card { padding: 26px 24px; }
.cart-card .card-title { font-size: 22px; margin-bottom: 20px; }
.cart-card .order-summary-block { gap: 12px; padding-bottom: 18px; margin-bottom: 18px; }
.cart-card .delivery-charge-box { margin-bottom: 16px; }
.cart-card .delivery-charge-title { font-size: 16px; margin-bottom: 8px; }
.cart-card .delivery-charge-options { gap: 8px; }
.cart-card .delivery-charge-btn { min-height: 48px; padding: 10px 14px; font-size: 18px; border-radius: 12px; }
.cart-card .zone-info { font-size: 15px; padding: 12px 14px; margin-bottom: 14px; }
.cart-card .zone-info .zone-title { font-size: 16px; }
.cart-card .service-readd { font-size: 16px; padding: 12px; margin-bottom: 14px; }
.cart-card .cart-lines { min-height: 56px; }
.cart-card .cart-empty { font-size: 16px; padding: 24px 0; }
.cart-card .cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 14px 0; }
.cart-card .cart-line-name { font-size: 17px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.cart-card .cart-line-total { font-size: 18px; font-weight: 800; text-align: end; font-variant-numeric: tabular-nums; }
.cart-card .cart-line-unit { font-size: 14.5px; font-weight: 600; color: var(--text-muted); }
.cart-card .qty-controls { gap: 10px; justify-self: end; }
.cart-card .qty-btn { width: 40px; height: 40px; font-size: 20px; }
.cart-card .qty-value { min-width: 26px; font-size: 18px; font-weight: 800; }
.cart-card .remove-btn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 999px; background: #fef2f2; font-size: 17px; }
.cart-card .remove-btn:hover { background: #fee2e2; }
.cart-card .cart-total-row { align-items: center; margin-top: 16px; padding: 16px 18px; border: 0; border-radius: var(--radius-md); background: var(--primary-light); font-size: 20px; }
.cart-card .cart-total-row span:last-child { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) {
    /* The card fills the screen height at most: only the list of lines scrolls, so the summary, the delivery charge and
       the TOTAL always stay in view. On a very short screen the whole column scrolls instead. */
    .side-col { display: flex; flex-direction: column; max-height: calc(100vh - 48px); overflow-y: auto; margin: -4px; padding: 4px; }
    .cart-card { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; margin-bottom: 0; }
    .cart-card .cart-lines { flex: 1 1 auto; min-height: 150px; overflow-y: auto; }
    .cart-card .cart-total-row { flex: none; }
}
