/* =====================================================================
   Bakery theme — sits on top of AdminLTE 3 / Bootstrap 4.
   Mobile first: big touch targets, sticky actions, bottom tab bar.
   ===================================================================== */

:root {
    --brand: #0f766e;          /* calm teal */
    --brand-dark: #115e59;
    --brand-soft: #e6f4f2;
    --brand-ring: rgba(15, 118, 110, .25);
    --ink: #1f2328;
    --muted: #4b5058;          /* darker grey: ~7:1 contrast on white for low vision */
    --line: #dde3ea;
    --bg: #f5f6f8;             /* light grey */
    --surface: #ffffff;
    --ok: #15803d;
    --ok-soft: #e8f6ec;
    --warn: #b45309;
    --warn-soft: #fff6e0;
    --danger: #b91c1c;
    --danger-soft: #fdecec;
    --info: #1d4ed8;
    --info-soft: #e8efff;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(31, 35, 40, .06), 0 2px 10px rgba(31, 35, 40, .05);
    --bottom-nav-h: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
/* Atkinson Hyperlegible was designed for readers with low vision: letters that are
   easy to tell apart (I l 1, O 0, rn m). Larger base size + generous line height. */
body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
}
small, .small { font-size: 90%; }
.content-wrapper, .main-footer { background: var(--bg); }
.main-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
.text-muted { color: var(--muted) !important; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }

h1, .h1 { font-weight: 700; letter-spacing: -.01em; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; }
.btn-lg { padding: .7rem 1.2rem; font-size: 1.05rem; }
.btn-primary,
.btn-primary.disabled, .btn-primary:disabled {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.btn-primary:hover, .btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background: var(--brand-dark); border-color: var(--brand-dark); color: #fff;
}
.btn-primary:focus, .btn-outline-primary:focus { box-shadow: 0 0 0 .2rem var(--brand-ring); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.btn-success { background: var(--ok); border-color: var(--ok); }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { background: var(--brand-soft); border-color: var(--line); }

/* ---------- Forms ---------- */
.form-control, .custom-select {
    border-radius: var(--radius-sm);
    border-color: var(--line);
    min-height: 44px;
}
.form-control:focus, .custom-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem var(--brand-ring);
}
label { font-weight: 600; }

/* ---------- Cards ---------- */
.card {
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header { background: transparent; border-bottom: 1px solid var(--line); }
.card-primary.card-outline, .card-warning.card-outline { border-top: 0; }
.card-title { font-weight: 700; }

/* ---------- Header / sidebar ---------- */
.main-header.navbar { border-bottom: 1px solid var(--line); }
.main-header .navbar-title {
    font-weight: 700; font-size: 1.2rem; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58vw;
    margin: 0; line-height: 40px;
}
.navbar-user {
    display: flex; align-items: center; gap: 8px;
    color: var(--muted); font-size: 13px; max-width: 45vw;
}
.navbar-user .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; flex: none;
}
.navbar-user .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-sidebar { background: #1e293b; }
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active {
    background: var(--brand); color: #fff; box-shadow: none;
}
.main-sidebar .brand-link, .layout-navbar-fixed .wrapper .main-sidebar .brand-link:not([class*=navbar]) { background-color: #1e293b !important; border-bottom-color: rgba(255,255,255,.08); }
.nav-sidebar .nav-link { border-radius: var(--radius-sm); }
.nav-sidebar .nav-link p { font-size: 17px; }

/* ---------- Page header ---------- */
.content-header h1 { font-size: 1.6rem; }
.page-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; padding: 16px 8px 4px;
}
.page-head h1 { margin: 0; font-size: 1.5rem; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; }

/* ---------- Status pills ---------- */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 11px; border-radius: 999px; font-size: 14px; font-weight: 700;
    background: #eef0f2; color: #374151; white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.status-New        { background: var(--warn-soft);   color: var(--warn); }
.status-Ordered    { background: var(--info-soft);   color: var(--info); }
.status-Processing { background: #f3e8ff;            color: #7e22ce; }
.status-ReadyForDelivery,
.status-OnthewaytoDelivery { background: #e0f2fe;    color: #0369a1; }
.status-Delivered  { background: var(--ok-soft);     color: var(--ok); }
.status-Cancelled  { background: var(--danger-soft); color: var(--danger); }

/* ---------- Chips (filters, dates, days) ---------- */
.chip-row {
    display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 6px 15px;
    border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    font-weight: 700; font-size: 15.5px; line-height: 1.15;
    cursor: pointer; user-select: none;
}
.chip .count {
    font-size: 12px; font-weight: 700; color: var(--muted);
    background: #eef1f4; border-radius: 999px; padding: 1px 7px;
}
.chip:hover { border-color: var(--brand); }
.chip.active, .chip[aria-pressed="true"] {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.chip.active .count, .chip[aria-pressed="true"] .count { background: rgba(255,255,255,.22); color: #fff; }
.chip:disabled, .chip.is-taken {
    opacity: .45; cursor: not-allowed; text-decoration: line-through;
}
.chip:focus { outline: none; box-shadow: 0 0 0 .2rem var(--brand-ring); }

/* ---------- Generic list cards (orders / favourites on mobile) ---------- */
.list-cards { display: grid; gap: 10px; }
.list-card {
    display: block; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 16px; color: var(--ink);
}
.list-card:hover { color: var(--ink); text-decoration: none; }
.list-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.list-card .title { font-weight: 700; font-size: 18px; margin: 0; word-break: break-word; }
.list-card .meta { color: var(--muted); font-size: 15.5px; margin-top: 2px; }
.list-card .facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 16px; }
.list-card .facts b { font-weight: 700; }
.list-card .actions { display: flex; gap: 8px; margin-top: 12px; }
.list-card .actions .btn { flex: 1; min-height: 44px; }
.list-card.is-draft { box-shadow: inset 4px 0 0 var(--warn), var(--shadow); }

.empty-state {
    text-align: center; color: var(--muted); padding: 40px 16px;
}
.empty-state i { font-size: 34px; color: #cbd5e1; margin-bottom: 10px; display: block; }

/* ---------- Home tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 992px) { .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
    display: block; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; color: var(--ink); min-height: 108px;
}
.tile:hover { color: var(--ink); text-decoration: none; box-shadow: 0 0 0 2px var(--brand-ring), var(--shadow); }
.tile .num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.tile .lbl { color: var(--muted); font-weight: 600; margin-top: 4px; }
.tile .ic {
    width: 38px; height: 38px; border-radius: 10px; display: inline-flex;
    align-items: center; justify-content: center; margin-bottom: 10px;
    background: var(--brand-soft); color: var(--brand-dark);
}
.cta-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--brand); color: #fff; border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
}
.cta-card:hover { color: #fff; text-decoration: none; background: var(--brand-dark); }
.cta-card .ic { font-size: 26px; width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.cta-card .t { font-size: 18px; font-weight: 800; }
.cta-card .s { opacity: .9; font-size: 14px; }

/* ---------- DataTables polish ---------- */
table.dataTable { border-radius: var(--radius-sm); }
.table thead th { border-bottom-width: 1px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand-dark); }

/* ---------- Bottom tab bar (phones) ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1034;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
    display: flex; align-items: stretch;
    box-shadow: 0 -2px 12px rgba(31, 35, 40, .06);
}
.bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none;
    background: none; border: 0; padding: 0;
}
.bottom-nav i { font-size: 21px; }
.bottom-nav .active { color: var(--brand); }
.bottom-nav .primary-tab span.bubble {
    width: 46px; height: 46px; border-radius: 50%; margin-top: -18px;
    background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .35);
}
.bottom-nav .primary-tab span.bubble i { font-size: 20px; }

/* ---------- Modals as bottom sheets on phones ---------- */
.modal-content { border: 0; border-radius: 18px; }
.modal-header { border-bottom-color: var(--line); }
.modal-footer { border-top-color: var(--line); }

/* ---------- Phones ---------- */
@media (max-width: 767.98px) {
    body { font-size: 17px; }
    /* stops iOS zooming into inputs */
    input, select, textarea, .form-control { font-size: 16px !important; }

    .content-header { padding: 12px 8px 4px; }
    .content-header h1 { font-size: 1.35rem; }
    .breadcrumb { display: none; }
    .content-wrapper > .content { padding: 0 4px; }
    .container-fluid { padding-left: 10px; padding-right: 10px; }
    .card-body { padding: 14px; }
    .main-footer { display: none; }

    /* the off-screen side menu's shadow otherwise shows along the left edge */
    body:not(.sidebar-open) .main-sidebar { box-shadow: none !important; }

    body.has-bottom-nav .content-wrapper {
        padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
    }

    .modal.sheet .modal-dialog {
        margin: 0; max-width: none; position: fixed; left: 0; right: 0; bottom: 0;
        transform: translateY(100%); transition: transform .22s ease-out;
    }
    .modal.sheet.show .modal-dialog { transform: none; }
    .modal.sheet .modal-content {
        border-radius: 18px 18px 0 0; max-height: 92vh; display: flex; flex-direction: column;
        padding-bottom: var(--safe-bottom);
    }
    .modal.sheet .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* DataTables controls stack nicely */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { text-align: left !important; }
    .dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
    .dataTables_wrapper .dataTables_filter label { width: 100%; }
}

/* ---------- Login ---------- */
/* Original bakery photo, with a soft dark tint so the white logo text stays readable. */
.login-page.bakery-login {
    background-color: #1e293b;
    background-image:
        linear-gradient(180deg, rgba(15, 23, 42, .55) 0%, rgba(15, 23, 42, .25) 45%, rgba(15, 23, 42, .45) 100%),
        url(../dist/img/Custom/bg-banner.jpg);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    min-height: 100vh; padding: 16px;
}
.bakery-login .login-logo .name, .bakery-login .login-logo .tag { text-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.bakery-login .login-box { width: 100%; max-width: 400px; }
.bakery-login .login-logo { margin-bottom: 18px; }
.bakery-login .login-logo .mark {
    width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.14);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 30px;
    margin-bottom: 10px;
}
/* Dale Bakery logo on a frosted, translucent white panel (same feel as the old icon tile) */
.bakery-login .login-logo .logo-panel {
    display: inline-block; padding: 14px 22px; border-radius: 18px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.bakery-login .login-logo .logo-panel img {
    display: block; width: 100%; max-width: 280px; height: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.bakery-login .login-logo .name { color: #fff; font-weight: 800; letter-spacing: .08em; font-size: 28px; display: block; }
.bakery-login .login-logo .tag { color: rgba(255,255,255,.8); font-size: 15px; display: block; margin-top: 2px; }
.bakery-login .card { border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.bakery-login .login-card-body { border-radius: 18px; padding: 24px 20px; color: var(--ink); }
.bakery-login .form-control { min-height: 50px; }
.bakery-login .input-group-text { background: #fff; border-color: var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.bakery-login .pw-toggle { color: var(--muted); padding: 0 4px; background: none; border: 0; }


/* =====================================================================
   v1.2 — section labels, scrollable chip rows, place-order dialog,
   store home (banners + main options)
   ===================================================================== */
.section-label {
    font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); margin: 18px 0 10px;
}

/* Skeletons are used outside the order screen too */
.ob-skeleton { height: 68px; border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, #eceff3 25%, #f8fafc 37%, #eceff3 63%); background-size: 400% 100%;
    animation: obShimmer 1.2s ease infinite; }
@keyframes obShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Scrollable chip rows (arrows + wheel + drag, see site-ui.js) ---------- */
.chip-scroller { position: relative; --chip-fade: var(--bg); }
.card .chip-scroller, .modal .chip-scroller { --chip-fade: #fff; }
.chip-row { cursor: grab; }
.chip-scroller.dragging .chip-row { cursor: grabbing; }
.chip-scroller.dragging .chip { pointer-events: none; }
.chip-nav {
    position: absolute; top: 0; bottom: 6px; width: 56px; z-index: 3;
    display: none; align-items: center; border: 0; padding: 0; color: var(--ink); cursor: pointer;
}
.chip-nav.prev { left: 0; justify-content: flex-start; background: linear-gradient(90deg, var(--chip-fade) 45%, rgba(255,255,255,0)); }
.chip-nav.next { right: 0; justify-content: flex-end; background: linear-gradient(270deg, var(--chip-fade) 45%, rgba(255,255,255,0)); }
.chip-scroller.can-left .chip-nav.prev, .chip-scroller.can-right .chip-nav.next { display: flex; }
.chip-nav i {
    width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid var(--line);
    box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.chip-nav:hover i { border-color: var(--brand); color: var(--brand); }
.chip-nav:focus { outline: none; }
.chip.chip-fav .fa-heart { color: #e11d48; }
.chip.chip-fav.active .fa-heart { color: #fff; }

/* ---------- Place order dialog ---------- */
.start-option {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); margin-bottom: 10px; min-height: 64px;
}
.start-option:hover, .start-option:focus { color: var(--ink); text-decoration: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.start-option .ic {
    width: 44px; height: 44px; border-radius: 12px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-dark); font-size: 18px;
}
.start-option .ic.fav { background: #ffe4ea; color: #be123c; }
.start-option .txt { flex: 1; min-width: 0; }
.start-option .t { display: block; font-weight: 700; font-size: 18px; line-height: 1.25; }
.start-option .s { display: block; color: var(--muted); font-size: 15.5px; }
.start-option .chev { color: var(--muted); }
.start-option.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.start-option.primary .ic { background: rgba(255,255,255,.2); color: #fff; }
.start-option.primary .s, .start-option.primary .chev { color: rgba(255,255,255,.92); }
.start-option.primary:hover, .start-option.primary:focus { background: var(--brand-dark); color: #fff; }
.os-empty { color: var(--muted); padding: 12px 4px; }

/* ---------- Store home: main options ---------- */
.main-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.main-action {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px; color: var(--ink); min-height: 128px; position: relative;
}
.main-action:hover, .main-action:focus { color: var(--ink); text-decoration: none; box-shadow: 0 0 0 3px var(--brand-ring), var(--shadow); }
.main-action .ic {
    width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-dark); font-size: 20px; flex: none;
}
.main-action .t { display: block; font-weight: 700; font-size: 19px; line-height: 1.2; }
.main-action .s { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }
.main-action.primary {
    grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 92px;
    background: var(--brand); color: #fff;
}
.main-action.primary:hover, .main-action.primary:focus { background: var(--brand-dark); color: #fff; }
.main-action.primary .ic { background: rgba(255,255,255,.2); color: #fff; width: 54px; height: 54px; font-size: 24px; }
.main-action.primary .t { font-size: 22px; }
.main-action.primary .s { color: rgba(255,255,255,.92); }
.main-action.primary .chev { margin-left: auto; font-size: 18px; }
@media (min-width: 992px) {
    .main-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Store home: promo banners ---------- */
.promo { position: relative; }
.promo-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; border-radius: var(--radius);
}
.promo-track::-webkit-scrollbar { display: none; }
.promo-track:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.promo-slide {
    flex: 0 0 100%; scroll-snap-align: start; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.promo-slide img { display: block; width: 100%; aspect-ratio: 12 / 5; object-fit: cover; background: #eceff3; }
@media (min-width: 768px) { .promo-slide img { aspect-ratio: auto; height: 280px; } }
.promo-body { display: flex; align-items: center; gap: 12px; padding: 12px 16px 14px; }
.promo-text { flex: 1; min-width: 0; }
.promo-title { font-weight: 700; font-size: 19px; line-height: 1.25; }
.promo-sub { color: var(--muted); font-size: 16px; }
.promo-add { flex: none; min-height: 48px; display: inline-flex; align-items: center; }
.promo-dots { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.promo-dot { width: 28px; height: 28px; border: 0; background: none; padding: 0; position: relative; cursor: pointer; }
.promo-dot::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
    border-radius: 50%; background: #cbd5e1;
}
.promo-dot.active::after { background: var(--brand); width: 22px; margin-left: -11px; border-radius: 6px; }

/* =====================================================================
   Page hero: breadcrumbs + icon + title (Promotions, Allergens, Bake, Categories)
   ===================================================================== */
.page-hero {
    margin: 16px 0 6px; padding: 16px 20px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef4f6 100%);
    border: 1px solid #e2e8f0; border-radius: 16px;
}
.page-hero .crumbs {
    list-style: none; margin: 0 0 10px; padding: 0;
    display: flex; flex-wrap: wrap; align-items: center; font-size: 15px; color: var(--muted);
}
.page-hero .crumbs li + li::before { content: "\203A"; margin: 0 8px; color: #94a3b8; font-weight: 700; }
.page-hero .crumbs a { color: var(--brand-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.page-hero .crumbs [aria-current] { color: var(--ink); }
.page-hero .hero-row { display: flex; align-items: center; gap: 16px; }
.page-hero .hero-ic {
    flex: none; width: 56px; height: 56px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #e2e8f0; color: var(--brand-dark); font-size: 24px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
.page-hero h1 { margin: 0; font-size: 1.65rem; font-weight: 800; line-height: 1.2; }
.page-hero .hero-text p { margin: 4px 0 0; color: var(--muted); font-size: 16px; max-width: 70ch; }
.page-hero .hero-text { flex: 1; min-width: 0; }
.page-hero .hero-action { flex: none; min-height: 50px; display: inline-flex; align-items: center; white-space: nowrap; }
@media (max-width: 767.98px) {
    .page-hero .hero-row { flex-wrap: wrap; }
    .page-hero .hero-action { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 575.98px) {
    .page-hero { padding: 12px 14px 14px; margin-top: 10px; }
    .page-hero .hero-ic { width: 46px; height: 46px; font-size: 20px; }
    .page-hero h1 { font-size: 1.35rem; }
}
.section-title { font-size: 1.2rem; font-weight: 800; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-size: 14px; background: #eef1f4; color: var(--muted); border-radius: 999px; padding: 2px 9px; }

/* ---------- Categories ---------- */
.cat-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.cat-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row.is-off .cat-name { color: var(--muted); }
.cat-pos {
    flex: none; width: 40px; height: 40px; border-radius: 10px; background: #f1f4f7;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted);
}
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: 18px; font-weight: 700; word-break: break-word; }
.cat-meta { color: var(--muted); font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cat-actions .btn { min-height: 44px; }
@media (max-width: 575.98px) {
    .cat-row { flex-wrap: wrap; }
    .cat-actions { width: 100%; }
    .cat-actions > .btn, .cat-actions > form { flex: 1; }
    .cat-actions form .btn { width: 100%; }
}

/* ---------- Bake report ---------- */
.bake-controls .card-body { padding: 14px 16px 10px; }
.bake-label { font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.date-chip { flex-direction: column; align-items: flex-start; gap: 0; padding: 7px 15px; border-radius: 12px; }
.date-chip small { font-weight: 400; font-size: 14px; }
.date-chip.other { position: relative; margin: 0; }
.date-chip.other input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.bake-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 10px; }
.bake-stat {
    display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 12px 14px;
}
.bake-stat i {
    font-size: 20px; color: var(--brand-dark); background: var(--brand-soft); width: 42px; height: 42px;
    border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.bake-stat .v { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bake-stat .l { color: var(--muted); font-size: 15px; }
@media (max-width: 575.98px) {
    .bake-stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
    .bake-stat i { width: 34px; height: 34px; font-size: 16px; }
    .bake-stat .v { font-size: 22px; }
}
.bake-note {
    display: flex; gap: 10px; align-items: flex-start; background: var(--info-soft); color: #1e3a5f;
    border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 16px;
}
.bake-note i { color: var(--info); margin-top: 3px; }
.bake-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.seg { display: inline-flex; background: #e5e9ee; border-radius: 12px; padding: 4px; }
.seg-btn {
    border: 0; background: transparent; color: var(--ink); font-weight: 700; font-size: 16px;
    min-height: 44px; padding: 0 16px; border-radius: 9px;
}
.seg-btn.active { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.seg-btn:focus { outline: none; box-shadow: 0 0 0 .2rem var(--brand-ring); }
.bake-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bake-actions .btn { font-size: 16px; min-height: 48px; }
.bake-actions .btn-light { background: #fff; border: 1px solid var(--line); }
@media (max-width: 575.98px) {
    .seg { width: 100%; }
    .seg-btn { flex: 1; padding: 0 8px; }
    .bake-actions { width: 100%; }
    .bake-actions .btn { flex: 1 1 45%; }
    .bake-actions #markReady { flex-basis: 100%; }
}
.bake-grid { columns: 2 380px; column-gap: 14px; }
.bake-cat {
    break-inside: avoid; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 14px; overflow: hidden; display: inline-block; width: 100%;
}
.bake-cat-head {
    display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
    background: #334155; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.bake-cat-total { background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 2px 12px; font-variant-numeric: tabular-nums; }
.bake-line { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.bake-line:last-child { border-bottom: 0; }
.bl-name { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.25; word-break: break-word; }
.bl-name small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.bl-qty {
    flex: none; min-width: 64px; text-align: right; font-size: 28px; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums; color: var(--ink);
}
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 575.98px) { .store-grid { grid-template-columns: 1fr; } }
.store-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.store-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 2px solid var(--ink); }
.store-name { font-size: 20px; font-weight: 800; line-height: 1.2; }
.store-pc { font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.store-pc span { font-weight: 400; color: var(--muted); font-size: 15px; }
.store-note { background: #fff8e1; padding: 8px 16px; font-size: 15px; }
.store-items { flex: 1; }
.store-items .bl-name { font-size: 17px; }
.store-items .bl-qty { font-size: 24px; }
.store-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: #f8fafc; color: var(--muted); font-size: 15px; }
.store-foot .btn { min-height: 44px; background: #fff; border: 1px solid var(--line); }

/* ---------- Printing (bake sheet + driver sheets) ---------- */
#printRoot { display: none; }
@media print {
    body.printing > *:not(#printRoot) { display: none !important; }
    body.printing { background: #fff !important; padding: 0 !important; }
    body.printing #printRoot { display: block; color: #000; font-family: "Atkinson Hyperlegible", Arial, sans-serif; }
    @page { margin: 12mm; }

    /* Driver sheet: one store per page - name, postcode (big), items + quantities */
    .driver-sheet { page-break-after: always; break-after: page; }
    .driver-sheet:last-child { page-break-after: auto; break-after: auto; }
    .ds-store { font-size: 30pt; font-weight: 700; line-height: 1.15; }
    .ds-pc { font-size: 54pt; font-weight: 700; line-height: 1.1; letter-spacing: .02em; margin: 4pt 0 14pt; padding-bottom: 10pt; border-bottom: 3pt solid #000; }
    .ds-items { width: 100%; border-collapse: collapse; }
    .ds-items td { border-bottom: 1pt solid #999; padding: 8pt 4pt; vertical-align: middle; }
    .ds-name { font-size: 20pt; font-weight: 700; }
    .ds-qty { font-size: 28pt; font-weight: 700; text-align: right; width: 22%; }

    /* Bake sheet: big clear quantities + a tick box per line */
    .bs-head { border-bottom: 3pt solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
    .bs-title { font-size: 26pt; font-weight: 700; }
    .bs-date { font-size: 18pt; font-weight: 700; }
    .bs-sum { font-size: 12pt; }
    .bs-cat { width: 100%; border-collapse: collapse; margin-bottom: 12pt; }
    .bs-cat thead { display: table-header-group; }
    .bs-cat th {
        background: #000 !important; color: #fff !important; font-size: 15pt; text-align: left; padding: 5pt 6pt;
        -webkit-print-color-adjust: exact; print-color-adjust: exact; text-transform: uppercase;
    }
    .bs-cat td { font-size: 15pt; padding: 6pt; border-bottom: 1pt solid #999; }
    .bs-cat tr { break-inside: avoid; }
    .bs-cat .q { text-align: right; font-size: 20pt; font-weight: 700; width: 18%; }
    .bs-cat th.q { font-size: 15pt; }
    .bs-cat .tick { width: 12%; text-align: center; font-size: 10pt; }
    .bs-cat td.tick span { display: inline-block; width: 16pt; height: 16pt; border: 1.5pt solid #000; border-radius: 3pt; }
}

/* =====================================================================
   Deliveries: driver run + admin assign
   ===================================================================== */
.run-summary { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.run-driver { font-weight: 800; font-size: 18px; margin-bottom: 4px; }
.run-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 17px; }
.run-stats b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.run-progress { height: 8px; background: #e5e9ee; border-radius: 999px; margin: 10px 0 8px; overflow: hidden; }
.run-progress span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.run-from { color: var(--muted); font-size: 15px; margin-top: 4px; }
.run-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.run-actions .btn { min-height: 52px; font-size: 16px; }
.run-actions .btn-light { background: #fff; border: 1px solid var(--line); }
@media (max-width: 575.98px) { .run-actions { grid-template-columns: 1fr; } }

.stop-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.stop-card.is-next { box-shadow: 0 0 0 3px var(--brand), var(--shadow); }
.stop-card.is-done { opacity: .7; }
.stop-head { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px 10px; }
.stop-num {
    flex: none; width: 46px; height: 46px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink); color: #fff; font-size: 21px; font-weight: 800;
}
.is-next .stop-num { background: var(--brand); }
.is-done .stop-num { background: var(--ok); font-size: 18px; }
.stop-who { flex: 1; min-width: 0; }
.stop-name { font-size: 20px; font-weight: 800; line-height: 1.2; word-break: break-word; }
.stop-pc { font-size: 26px; font-weight: 800; letter-spacing: .02em; line-height: 1.15; margin-top: 2px; }
.stop-addr { color: var(--muted); font-size: 16px; }
.stop-warn { background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: 15px; font-weight: 700; }
.stop-items { border-top: 1px solid var(--line); }
.stop-items summary { padding: 10px 16px; font-weight: 700; font-size: 16px; cursor: pointer; color: var(--brand-dark); }
.stop-items .bl-name { font-size: 17px; }
.stop-items .bl-qty { font-size: 24px; }
.stop-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.stop-actions .btn { min-height: 52px; font-size: 16px; }
.stop-actions .btn-light { background: #fff; border: 1px solid var(--line); }
.stop-actions .js-done { grid-column: 1 / -1; min-height: 58px; font-size: 18px; }
.stop-done { padding: 8px 16px 12px; color: var(--ok); font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.stop-done .btn-link { padding: 0 6px; font-weight: 700; min-height: 44px; }

.driver-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.driver-chip {
    display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 16px; min-height: 48px;
}
a.driver-chip:hover { text-decoration: none; color: var(--ink); border-color: var(--brand); }
.driver-chip > i { color: var(--muted); }
.driver-chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.driver-chip.warn > i { color: var(--warn); }
.driver-chip .go { color: var(--brand-dark); font-weight: 700; font-size: 14px; }
.depot-group .btn { border: 1px solid var(--line); background: #fff; min-width: 80px; }

.assign-bar {
    position: sticky; top: calc(57px + 8px); z-index: 20; display: flex; align-items: center; gap: 10px;
    background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.assign-bar > span { white-space: nowrap; font-size: 16px; }
.assign-bar select { flex: 1; min-width: 0; }
.assign-bar .btn { white-space: nowrap; }
.assign-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.assign-all { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--muted); cursor: pointer; }
.assign-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.assign-row:last-child { border-bottom: 0; }
.assign-row.is-unassigned { box-shadow: inset 4px 0 0 var(--warn); }
.assign-row input[type=checkbox], .assign-all input { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.as-info { flex: 1; min-width: 0; }
.as-name { font-size: 18px; font-weight: 700; word-break: break-word; }
.as-meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.as-meta b { color: var(--ink); }
.assign-row select { width: 240px; flex: none; }
@media (max-width: 575.98px) {
    .assign-row { flex-wrap: wrap; }
    .assign-row select { width: 100%; }
    .assign-bar { flex-wrap: wrap; }
    .assign-bar select { flex-basis: 100%; order: 3; }
    .assign-bar .btn { margin-left: auto; }
}

/* ---------- Deliveries: bulk assign toolbar ---------- */
.assign-tools {
    position: sticky; top: 57px; z-index: 20;
    background: var(--surface); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(31, 35, 40, .10);
    padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line);
}
.at-search { position: relative; }
.at-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.at-search input { height: 50px; padding-left: 42px; font-size: 17px; border-radius: 12px; }
.at-filters { margin-top: 10px; }
.chip.chip-warn:not(.active) { border-color: #f3d19c; background: var(--warn-soft); color: var(--warn); }
.at-bulk {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line);
}
.at-all { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; font-size: 16px; min-height: 48px; cursor: pointer; }
.at-all input { width: 22px; height: 22px; accent-color: var(--brand); }
.at-apply { display: flex; gap: 8px; flex: 1; justify-content: flex-end; min-width: 0; }
.at-apply select { max-width: 320px; }
.at-apply .btn { white-space: nowrap; min-height: 48px; }
.at-hint { color: var(--muted); font-size: 15px; margin-top: 4px; }
.at-hint:empty { display: none; }
@media (max-width: 767.98px) {
    .assign-tools { top: 52px; }
    .at-apply { flex-basis: 100%; flex-wrap: wrap; }
    .at-apply select { max-width: none; flex: 1 1 100%; min-width: 0; }
    .at-apply .btn { flex: 1 1 100%; }
}

.assign-row { cursor: pointer; margin: 0; }
.assign-row:hover { background: #f8fafc; }
.assign-row.is-selected { background: var(--brand-soft); }
.as-driver {
    flex: none; display: inline-flex; align-items: center; font-weight: 700; font-size: 15px;
    background: #eef0f2; color: #374151; border-radius: 999px; padding: 6px 12px; max-width: 45%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.as-driver.none { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 575.98px) {
    .assign-row { flex-wrap: wrap; row-gap: 6px; }
    .assign-row .as-info { flex: 1 1 calc(100% - 40px); }
    .as-driver { max-width: none; margin-left: 36px; }
}
.route-link {
    display: inline-flex; align-items: center; font-weight: 700; margin: 0 0 10px; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 48px;
}

/* ---------- Dashboard welcome card ---------- */
.welcome-hero .welcome-kicker { margin: 0 0 2px !important; font-size: 14px !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark) !important; }
.welcome-hero h1 { word-break: break-word; }
.date-badge {
    flex: none; width: 74px; text-align: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    overflow: hidden; box-shadow: 0 2px 6px rgba(15, 23, 42, .08); line-height: 1.1;
}
.date-badge .db-day { display: block; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 0; }
.date-badge .db-num { display: block; font-size: 28px; font-weight: 800; color: var(--ink); padding-top: 4px; }
.date-badge .db-mon { display: block; font-size: 14px; color: var(--muted); padding-bottom: 6px; }
@media (max-width: 575.98px) {
    .welcome-hero .hero-row { flex-wrap: nowrap; }
    .date-badge { width: 60px; }
    .date-badge .db-num { font-size: 22px; }
}
