:root {
    --bg: #fff8ee;
    --surface: #ffffff;
    --surface-2: #fff1dc;
    --text: #24170d;
    --muted: #74685d;
    --primary: #b35d17;
    --primary-dark: #8f4310;
    --accent: #f0b35f;
    --border: #ead6bd;
    --success: #17813d;
    --warning: #9b6400;
    --danger: #b42318;
    --shadow: 0 20px 45px rgba(59, 36, 13, .12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, #fff0d7, transparent 35%), var(--bg);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 248, 238, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; position: relative; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; flex-shrink: 0; }
.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: contain;
    box-shadow: 0 8px 18px rgba(59, 36, 13, .12);
    border: 2px solid rgba(212, 175, 55, .35);
    background: #000;
    flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.brand-mark {
    width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-weight: 900; letter-spacing: -.05em;
}
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.nav-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { color: var(--muted); font-weight: 650; font-size: 14px; white-space: nowrap; }
.nav-links a.active, .nav-links a:hover { color: var(--primary); }
.nav-logout { padding: 9px 14px !important; font-size: 13px !important; }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 650;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 2px;
}
.nav-dropdown-toggle.active, .nav-dropdown-toggle:hover, .nav-dropdown.is-open .nav-dropdown-toggle { color: var(--primary); }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    z-index: 30;
}
.nav-dropdown.is-open .nav-dropdown-menu { display: grid; gap: 2px; }
.nav-dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
}
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { background: var(--surface-2); color: var(--primary); }
.nav-toggle { display: none; border: 0; background: var(--surface); border-radius: 12px; padding: 8px 12px; font-size: 22px; flex-shrink: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 750;
    cursor: pointer;
    transition: .2s ease;
    font-size: 14px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 10px 22px rgba(179, 93, 23, .2); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-light { background: var(--surface); color: var(--text) !important; border-color: var(--border); }
.btn-large { padding: 14px 22px; }
.btn-small { padding: 7px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); border-color: var(--border); }

.hero { padding: 78px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 42px; align-items: center; }
.hero-copy h1 { font-size: clamp(40px, 7vw, 72px); line-height: .95; letter-spacing: -.05em; margin: 18px 0; }
.hero-copy p { font-size: 18px; color: var(--muted); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 999px;
    background: var(--surface-2); color: var(--primary-dark);
    font-weight: 800; font-size: 13px; border: 1px solid var(--border);
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.stats div {
    padding: 18px; border: 1px solid var(--border); border-radius: 20px;
    background: rgba(255,255,255,.74);
}
.stats strong { display: block; font-size: 22px; }
.stats span { color: var(--muted); font-size: 13px; }
.hero-card {
    padding: 32px; border-radius: 34px;
    background: linear-gradient(145deg, #fff, #ffe3b5);
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.bread-emoji { font-size: 68px; }
.hero-logo { width: min(220px, 70%); height: auto; display: block; margin: 0 auto 8px; border-radius: 50%; background: #000; object-fit: contain; box-shadow: var(--shadow); }
.hero-card h2 { margin-bottom: 2px; }
.price { font-size: 34px; font-weight: 900; color: var(--primary); margin: 18px 0; }
.hero-card ul { padding-left: 20px; color: var(--muted); }

.section { padding: 56px 0 22px; }
.section h1, .section h2 { letter-spacing: -.035em; line-height: 1.05; margin: 14px 0; }
.section h1 { font-size: clamp(32px, 5vw, 54px); }
.section h2 { font-size: clamp(28px, 4vw, 44px); }
.section-heading { max-width: 720px; }
.cards { display: grid; gap: 18px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card, .panel, .auth-card, .pricing-card {
    background: rgba(255,255,255,.82);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 12px 30px rgba(59, 36, 13, .07);
}
.card { padding: 26px; }
.icon {
    width: 38px; height: 38px; display: grid; place-items: center;
    border-radius: 12px; background: var(--primary); color: #fff; font-weight: 900;
}
.card p, .pricing-card p, .panel p, .auth-card p { color: var(--muted); }
.split-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: start; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pricing-card { padding: 22px; }
.pricing-card.featured { background: #2a180c; color: #fff; }
.pricing-card.featured p { color: #f9d4a7; }

.auth-section { padding: 54px 0; }
.auth-card { max-width: 780px; margin: 0 auto; padding: 30px; }
.auth-card.small { max-width: 480px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
label, fieldset legend { font-weight: 750; color: var(--text); }
input, select, textarea {
    width: 100%; margin-top: 7px;
    border: 1px solid var(--border); border-radius: 16px;
    padding: 13px 14px;
    font: inherit;
    background: #fffdfa;
    color: var(--text);
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(179, 93, 23, .12); }
.full { grid-column: 1 / -1; }
.checkbox-label { display: inline-flex; align-items: center; gap: 10px; margin-right: 14px; font-weight: 650; color: var(--muted); }
.checkbox-label input { width: auto; margin: 0; }
.days-field { border: 1px dashed var(--border); border-radius: 18px; padding: 16px; }
.delivery-toggle { background: var(--surface-2); padding: 16px; border-radius: 18px; color: var(--text); }
.estimate { padding: 16px 18px; border-radius: 18px; background: #2a180c; color: #fff; }

.flash-zone { margin-top: 16px; }
.flash { padding: 14px 16px; border-radius: 16px; margin: 10px 0; font-weight: 700; border: 1px solid var(--border); background: #fff; }
.flash-success { color: var(--success); border-color: rgba(23,129,61,.25); }
.flash-error { color: var(--danger); border-color: rgba(180,35,24,.25); }
.flash-warning { color: var(--warning); border-color: rgba(155,100,0,.25); }

.dashboard-top { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 26px; margin-bottom: 26px; }
.delivery-list { display: grid; gap: 12px; }
.delivery-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: #fffdfa; }
.delivery-item span { display: block; color: var(--muted); font-size: 14px; }
.status { display: inline-flex; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 900; background: var(--surface-2); color: var(--primary-dark); }
.status-delivered, .status-active { background: #e9f8ed; color: var(--success); }
.status-cancelled { background: #fde8e7; color: var(--danger); }
.status-on_the_way, .status-preparing { background: #fff2cb; color: var(--warning); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
body.ticket-print-page table { min-width: 0 !important; width: 100% !important; table-layout: fixed; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { margin: 0; padding: 8px 10px; border-radius: 12px; }
.date-filter { display: flex; gap: 10px; align-items: center; }
.date-filter input { margin: 0; }
.admin-stats { margin-bottom: 22px; }

.muted { color: var(--muted); font-size: 14px; }
.site-footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 60px; background: rgba(255,255,255,.6); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; color: var(--muted); }
.footer-grid strong { color: var(--text); }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        right: 16px;
        top: 72px;
        left: 16px;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 16px;
        box-shadow: var(--shadow);
        z-index: 25;
    }
    .nav-links.open { display: flex; }
    .brand-text strong { max-width: 140px; }
    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: 0;
        padding: 0 0 0 8px;
        background: transparent;
    }
    .nav-dropdown.is-open .nav-dropdown-menu { display: grid; }
    .nav-dropdown-toggle { width: 100%; justify-content: space-between; padding: 8px 0; }
    .nav-logout { width: 100%; }
    .hero-grid, .split-section, .dashboard-grid, .footer-grid { grid-template-columns: 1fr; }
    .cards.three, .pricing-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .dashboard-top { align-items: flex-start; flex-direction: column; }
}

.product-picker {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    background: #fffdfa;
}
.product-category { margin-top: 18px; }
.product-category h3 { margin: 0 0 10px; color: var(--primary-dark); }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}
.product-row small { display: block; color: var(--muted); font-weight: 600; margin-top: 2px; }
.product-row input { margin: 0; text-align: center; }

/* Catalogue client avec photos */
.product-grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
}
.product-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 18px;
    background: #fffdfa;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.product-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(179, 93, 23, .12);
}
.product-card-readonly { cursor: default; }
.product-card-tap {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}
.product-card-tap:active { transform: scale(.99); }
.product-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
    background: #fff8ef;
    display: block;
}
.product-card-info strong {
    display: block;
    font-size: 15px;
    line-height: 1.25;
}
.product-card-info small {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 2px;
    font-size: 13px;
}
.product-card-qty-row {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
    align-items: center;
}
.product-qty-btn {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--primary-dark);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}
.product-qty-btn:active:not(:disabled) { transform: scale(.96); background: var(--surface-2); }
.product-qty-btn:disabled { opacity: .45; cursor: not-allowed; }
.product-card-qty {
    width: 100%;
    margin: 0;
    text-align: center;
    font-weight: 800;
    font-size: 17px;
    min-height: 44px;
    border-radius: 12px;
}

.order-sticky-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 253, 250, .96);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(40, 20, 0, .16);
    backdrop-filter: blur(8px);
}
.order-sticky-bar[hidden] { display: none !important; }
.order-sticky-meta { display: grid; gap: 2px; }
.order-sticky-meta span { color: var(--muted); font-weight: 700; font-size: 13px; }
.order-sticky-meta strong { font-size: 20px; color: var(--primary-dark); letter-spacing: -.02em; }
.order-sticky-bar .btn { min-height: 48px; white-space: nowrap; }

.order-items-preview {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.order-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}
.order-item-chip img {
    width: 36px;
    height: 28px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff8ef;
}

.catalog-preview { margin-top: 16px; }
body:has(.order-sticky-bar:not([hidden])) .site-footer { padding-bottom: 88px; }

.estimate-lines { margin-top: 8px; color: #f9d4a7; font-size: 14px; }
.subscription-summary p { margin: 9px 0; }

@media (max-width: 860px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-row { grid-template-columns: 1fr 76px; }
}

.estimate-warning { background: #3a170f; }
.estimate-ok { background: #17351f; }
.order-form .delivery-fields label { display: block; }
.command-card-list { display: grid; gap: 12px; }
.command-card { padding: 16px; border: 1px solid var(--border); border-radius: 18px; background: #fffdfa; }
.command-card h3 { margin: 0 0 6px; }
.command-card p { margin: 5px 0; }
.command-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.admin-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .admin-stats { grid-template-columns: 1fr; } }

/* QR abonné / scan boutique */
.qr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-card { text-align: center; }
.qr-card canvas { background: #fff; padding: 12px; border-radius: 18px; margin: 12px auto; max-width: 100%; height: auto; }
.qr-image { display: block; background: #fff; padding: 12px; border-radius: 18px; margin: 12px auto; max-width: 100%; height: auto; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.pickup-code { display: inline-block; margin: 8px 0 10px; padding: 10px 14px; border: 1px dashed var(--accent, #D4922A); border-radius: 12px; font-size: 1.25rem; font-weight: 800; letter-spacing: .08em; }
.qr-url { word-break: break-all; font-size: .78rem; }
.scan-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.scan-result .subscription-summary { margin-bottom: 16px; }

@media (max-width: 800px) {
  .qr-layout { grid-template-columns: 1fr; }
  .scan-head { flex-direction: column; }
}

@media print {
  .site-header, .flash-zone, .command-actions, .nav-toggle, .nav-links, footer, .btn { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .panel, .qr-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .qr-layout { display: block; }
  .qr-card canvas { border: 1px solid #ddd; }
  .qr-image { border: 1px solid #ddd; box-shadow: none !important; }
}

/* Suivi commande client (PWA) */
.track-card { border: 1px solid var(--border); border-radius: 18px; padding: 14px; margin-bottom: 12px; background: rgba(255,255,255,.72); }
.track-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.track-timeline { display: grid; gap: 10px; margin-top: 10px; }
.track-step { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; opacity: .55; }
.track-step.done, .track-step.current { opacity: 1; }
.track-dot { width: 12px; height: 12px; border-radius: 50%; background: #ddd; margin-top: 4px; }
.track-step.done .track-dot { background: #5DA868; }
.track-step.current .track-dot { background: #c4651a; box-shadow: 0 0 0 4px rgba(196,101,26,.2); }
.track-step small { display: block; color: var(--muted); }

    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(135deg, #fffdfa, #fff1dc);
}
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.pack-card {
    text-align: left;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 18px;
    padding: 14px;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    transition: .2s ease;
}
.pack-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(179, 93, 23, .12); }
.pack-card strong, .pack-card span, .pack-card em { display: block; }
.pack-card span { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.pack-card em { color: var(--primary-dark); font-weight: 900; font-style: normal; }
.subscription-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.progress { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 12px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; }
.status-paused { background: #fff2cb; color: var(--warning); }
.status-ready, .status-received { background: #edf5ff; color: #175a9b; }
.status-picked_up { background: #e9f8ed; color: var(--success); }
.pickup-fields { border: 1px dashed var(--border); border-radius: 18px; padding: 16px; background: #fffdfa; }
.preparation-list { display: grid; gap: 10px; }
.preparation-row { display: grid; grid-template-columns: 1.2fr .5fr .8fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: #fffdfa; }
.preparation-row small { color: var(--muted); }
@media (max-width: 860px) {
    .pack-grid { grid-template-columns: 1fr; }
    .preparation-row { grid-template-columns: 1fr; }
}

/* Localisation client et espace livreur */
.map-picker {
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 16px;
    background: #fffdfa;
    display: grid;
    gap: 10px;
}
.map-picker .btn { justify-self: start; }
.map-status { margin: 0; }
.route-link { white-space: nowrap; }
.assignment-form { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(130px, 1fr) auto; gap: 8px; align-items: center; }
.assignment-form select { margin: 0; padding: 8px 10px; border-radius: 12px; }
.driver-card { border-left: 5px solid var(--primary); }
.driver-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.driver-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.driver-actions form { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; align-items: center; }
.driver-actions textarea { min-width: 220px; flex: 1; margin: 0; }
.status-failed { background: #fde8e7; color: var(--danger); }
.status-assigned { background: #edf5ff; color: #175a9b; }
@media (max-width: 860px) {
    .assignment-form { grid-template-columns: 1fr; }
    .driver-actions form { flex-direction: column; align-items: stretch; }
    .driver-actions textarea { min-width: 100%; }
}

/* Optimisation des tournées groupées */
.route-panel {
    background: linear-gradient(135deg, #fffdfa, #fff0d7);
    border: 1px solid rgba(179, 93, 23, .18);
}
.route-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.route-head h2 { margin-bottom: 6px; }
.route-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.route-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}
.route-summary div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.78);
    border: 1px solid var(--border);
}
.route-summary strong { display: block; color: var(--primary-dark); font-size: 20px; }
.route-summary span { color: var(--muted); font-size: 13px; }
.route-list { display: grid; gap: 12px; counter-reset: route; }
.route-stop-card { border-left-color: var(--success); align-items: flex-start; }
.route-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    margin-right: 8px;
}
.route-distance { color: var(--primary-dark) !important; font-weight: 800; margin-top: 4px; }
@media (max-width: 860px) {
    .route-head { flex-direction: column; }
    .route-actions { justify-content: flex-start; width: 100%; }
    .route-actions .btn { width: 100%; }
    .route-summary { grid-template-columns: 1fr; }
}

.module-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 30px; }
.module-card { display: block; min-height: 170px; }
.module-card h3 { margin: 12px 0 4px; }
.wide-left { grid-template-columns: 1.4fr .6fr; }
.product-form fieldset { border: 1px solid var(--border); border-radius: 20px; padding: 16px; margin: 16px 0; }
.product-form legend { padding: 0 8px; }
.product-grid.compact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.product-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: #fffdfa; }
.product-choice small { display: block; color: var(--muted); font-weight: 600; }
.product-choice input { width: 86px; margin: 0; text-align: center; }
.cart-summary { position: sticky; bottom: 10px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 16px; background: #fff7e8; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.ticket-box { border-style: dashed; }
.inline-stock-form, .inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-stock-form { margin-bottom: 14px; display: flex; }
.inline-stock-form select, .inline-stock-form input, .inline-form select, .inline-form input { width: auto; min-width: 120px; margin-top: 0; padding: 9px 10px; border-radius: 12px; }
.inventory-list { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding-right: 4px; margin: 12px 0; }
.inventory-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: #fffdfa; }
.inventory-line small { display: block; color: var(--muted); }
.inventory-line input { width: 90px; margin: 0; text-align: center; }
.bar-chart { height: 220px; display: flex; align-items: end; gap: 12px; padding: 20px 0 4px; }
.bar-item { flex: 1; display: flex; align-items: center; flex-direction: column; gap: 8px; }
.bar { width: 100%; max-width: 80px; background: linear-gradient(180deg, var(--primary), var(--accent)); border-radius: 14px 14px 6px 6px; display: flex; align-items: start; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; padding-top: 6px; writing-mode: vertical-rl; text-orientation: mixed; }
.bar-item small { color: var(--muted); font-weight: 700; }
.status-todo { background: #fff1dc; color: #9b6400; }
.status-in_progress { background: #eaf3ff; color: #155a99; }
.status-done { background: #e9f7ee; color: #17813d; }
.status-paid { background: #e9f7ee; color: #17813d; }

/* Caisse POS tactile */
.pos-sale-next {
    text-align: center;
    padding: 28px 24px 32px;
}
.pos-sale-next h2 { margin: 8px 0 4px; }
.pos-sale-next-total {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 900;
    color: var(--primary-dark);
    margin: 8px 0 4px;
    line-height: 1.1;
}
.pos-sale-next-lines {
    list-style: none;
    margin: 16px auto;
    padding: 0;
    max-width: 420px;
    text-align: left;
}
.pos-sale-next-lines li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.pos-sale-next-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 560px;
    margin: 22px auto 0;
}
.pos-sale-next-actions .btn {
    min-height: 56px;
    font-size: 18px;
    font-weight: 800;
    display: grid;
    place-items: center;
}
@media (max-width: 640px) {
    .pos-sale-next-actions { grid-template-columns: 1fr; }
}
.pos-caisse-wrap { width: min(1440px, calc(100% - 24px)); margin: 0 auto; }
.pos-caisse-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 24px 0 8px; }
.pos-caisse-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.branch-pill {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fffdfa;
    font-weight: 800;
    color: var(--primary-dark);
}
.pos-select, .pos-input {
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 16px;
    background: #fffdfa;
}
.pos-input-center { text-align: center; font-weight: 800; font-size: 18px; }
.pos-btn { min-height: 48px; padding: 12px 20px; font-size: 15px; touch-action: manipulation; user-select: none; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pos-categories::-webkit-scrollbar { display: none; }
.pos-tab {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fffdfa;
    color: var(--text);
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}
.pos-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-tab-favorites.is-active { background: #c8860a; border-color: #c8860a; }
.pos-favorites-block .pos-category-title { color: #9a6200; }
.pos-favorite-tile { position: relative; border-color: #f0c96a; background: linear-gradient(180deg, #fffdf5, #fff6df); }
.pos-favorite-tile.is-selected { border-color: #c8860a; box-shadow: 0 10px 24px rgba(200, 134, 10, .18); }
.pos-favorite-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #c8860a;
    color: #fff;
    font-size: 13px;
    line-height: 24px;
    text-align: center;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}
.pos-category-title { margin: 8px 0 12px; font-size: 22px; letter-spacing: -.02em; }
.pos-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.pos-product {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: #fffdfa;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pos-product.is-selected { border-color: var(--primary); box-shadow: 0 10px 24px rgba(179, 93, 23, .14); }
.pos-product.is-out { opacity: .55; }
.pos-product-tap {
    display: grid;
    gap: 4px;
    width: 100%;
    min-height: 96px;
    padding: 10px 10px 12px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fff4e4);
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}
.pos-product-tap:active:not(:disabled) { transform: scale(.98); background: #ffe8c7; }
.pos-product-tap:disabled { cursor: not-allowed; }
.pos-product-tap strong { font-size: 16px; line-height: 1.2; }
.pos-product-price { font-size: 18px; font-weight: 900; color: var(--primary); }
.pos-product-tap small { color: var(--muted); font-weight: 700; font-size: 12px; }
.pos-qty-controls, .pos-discount-row, .pos-amount-row { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: center; }
.pos-cash-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pos-change-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #e9f7ee;
    border: 1px solid #b8e6c8;
}
.pos-change-row span { font-weight: 800; color: var(--muted); }
.pos-change-row strong { font-size: 22px; color: #17813d; letter-spacing: -.02em; }
.pos-change-row strong.is-insufficient { color: var(--danger); }
.pos-change-row strong.is-ready { color: #17813d; }
.pos-cash-warning { margin: 8px 0 0; color: var(--danger); font-weight: 800; font-size: 14px; }
.pos-cash-fields[hidden] { display: none !important; }
.pos-subscriber-fields[hidden] { display: none !important; }
.pos-subscription-panel[hidden] { display: none !important; }
.pos-subscription-panel { display: grid; gap: 12px; }
.pos-subscriber-fields { position: relative; z-index: 2; }
.pos-qr-scan {
    position: relative;
    z-index: 3;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff4e4, #fffdfa);
    border: 1px solid rgba(196, 101, 26, .18);
}
.pos-qr-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pos-qr-input { min-height: 52px; font-size: 16px; font-weight: 700; }
.pos-qr-camera-btn { min-height: 52px; white-space: nowrap; touch-action: manipulation; }
.pos-qr-result {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
}
.pos-qr-result[hidden] { display: none !important; }
.pos-qr-result strong { font-weight: 800; line-height: 1.3; }
.pos-qr-result span { color: var(--muted); font-weight: 700; font-size: 13px; }
.pos-qr-result.is-ok { background: #e9f7ee; border: 1px solid #b8e6c8; color: #17813d; }
.pos-qr-result.is-warn { background: #fff4df; border: 1px solid #f0d39d; color: #9a5b00; }
.pos-qr-result.is-error { background: #fdecec; border: 1px solid #efb8b8; color: #b42318; }
.pos-qr-result.is-loading { background: #f5f5f5; border: 1px solid var(--border); color: var(--muted); }
.pos-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 16px;
}
.pos-qr-modal[hidden] { display: none !important; }
.pos-qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 14, 10, .72);
}
.pos-qr-modal-panel {
    position: relative;
    width: min(520px, 100%);
    padding: 16px;
    border-radius: 20px;
    background: #fffdfa;
    box-shadow: var(--shadow);
}
.pos-qr-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.pos-qr-modal-head h2 { margin: 0; font-size: 20px; }
.pos-qr-modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.pos-qr-video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    background: #111;
}
.pos-qr-modal-hint { margin: 10px 0 0; }
.pos-cash-quick .btn-small {
    min-height: 44px;
    padding: 10px 14px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.pos-qty-btn {
    min-width: 48px;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--primary-dark);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}
.pos-qty-btn:active:not(:disabled) { transform: scale(.96); background: var(--surface-2); }
.pos-qty-btn:disabled { opacity: .45; cursor: not-allowed; }
.pos-qty-value { text-align: center; font-size: 22px; font-weight: 900; }
.pos-sidebar { position: sticky; top: 88px; display: grid; gap: 14px; padding: 18px; }
.pos-cart-lines { display: grid; gap: 8px; max-height: 240px; overflow: auto; -webkit-overflow-scrolling: touch; }
.pos-cart-empty { margin: 0; color: var(--muted); font-weight: 700; }
.pos-cart-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}
.pos-cart-line:active { background: #fff0dc; }
.pos-cart-line small { display: block; color: var(--muted); font-weight: 700; }
.pos-cart-remove { font-size: 28px; line-height: 1; color: var(--danger); font-weight: 900; }
.pos-field { display: grid; gap: 8px; }
.pos-field > span, .pos-field-label { font-weight: 800; font-size: 14px; }
.pos-payment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pos-payment-tile { display: block; cursor: pointer; touch-action: manipulation; user-select: none; }
.pos-payment-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pos-payment-tile span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: #fffdfa;
    font-weight: 800;
    text-align: center;
}
.pos-payment-tile input:checked + span { border-color: var(--primary); background: #fff1dc; color: var(--primary-dark); box-shadow: inset 0 0 0 1px rgba(179, 93, 23, .12); }
.pos-checkout { display: grid; gap: 12px; margin-top: 4px; position: relative; z-index: 2; }
.pos-checkout-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.pos-cancel { min-height: 56px; touch-action: manipulation; user-select: none; }
.pos-cash-fields { position: relative; z-index: 2; }
.pos-cash-fields button,
.pos-cash-quick button { position: relative; z-index: 3; pointer-events: auto; touch-action: manipulation; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pos-total span { color: var(--muted); font-weight: 800; }
.pos-total strong { font-size: clamp(24px, 4vw, 34px); color: var(--primary-dark); letter-spacing: -.03em; }
.pos-encaisser {
    width: 100%;
    min-height: 64px;
    font-size: 20px;
    border-radius: 18px;
    touch-action: manipulation;
    user-select: none;
}
.pos-encaisser:active { transform: scale(.99); }

/* Session caisse ouverture / fermeture */
.session-status {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
}
.session-status strong { font-size: 18px; }
.session-status span { color: var(--muted); font-weight: 700; font-size: 14px; }
.session-status-open { background: #e9f7ee; border-color: #b8e6c8; }
.session-status-open strong { color: #17813d; }
.session-status-closed { background: #fff4df; border-color: #f0d39d; }
.session-status-closed strong { color: #9a5b00; }
.pos-session-bar,
.pos-session-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: 16px;
}
.pos-session-bar {
    background: #e9f7ee;
    border: 1px solid #b8e6c8;
    color: #17813d;
    font-weight: 800;
}
.pos-session-alert {
    margin-bottom: 8px;
}
body.page-caisse.pos-dark-mode .pos-session-bar {
    background: #173321;
    border-color: #2f6840;
    color: #b8f0cb;
}
body.page-caisse.pos-dark-mode .session-status-open {
    background: #173321;
    border-color: #2f6840;
}
body.page-caisse.pos-dark-mode .session-status-open strong { color: #b8f0cb; }

/* Images produits caisse */
.pos-product-image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #fff8ef;
    margin-bottom: 6px;
}
.pos-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
body:not(.pos-show-images) .pos-product-image-wrap { display: none; }
body.pos-large-tiles .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
body.pos-large-tiles .pos-product-tap { min-height: 120px; }
body.pos-hide-recent .pos-recent-sales { display: none; }
.pos-orders-list { max-height: 480px; overflow: auto; }
.pos-recent-sales { display: grid; gap: 16px; }
.pos-phone-orders .panel {
    border: 2px solid var(--primary);
    background: #fff8ef;
}
.pos-phone-orders h2 { margin-top: 0; }
.pos-phone-orders .pos-orders-list { max-height: 220px; }

/* Plein écran caisse POS */
body.pos-fullscreen .site-header,
body.pos-fullscreen .site-footer,
body.pos-fullscreen .flash-zone,
body.pos-fullscreen .pos-hide-fs { display: none !important; }
body.pos-fullscreen main { padding-bottom: 0; }
body.pos-fullscreen .pos-caisse-wrap { width: min(100%, calc(100% - 16px)); margin: 0 auto; }
body.pos-fullscreen .pos-caisse-head { padding-top: 12px; padding-bottom: 4px; }
body.pos-fullscreen .pos-caisse-head h1 { font-size: clamp(22px, 3vw, 32px); margin: 4px 0; }
body.pos-fullscreen .pos-sidebar { top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
body.pos-fullscreen .pos-layout { min-height: calc(100vh - 88px); }
body.page-caisse.pos-fullscreen { background: #fff9f2; }

@media (max-width: 980px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .wide-left { grid-template-columns: 1fr; }
  .product-grid.compact { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-sidebar { position: static; order: -1; }
  .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 680px) {
  .module-grid { grid-template-columns: 1fr; }
  .cart-summary { flex-direction: column; align-items: stretch; }
  .inline-form, .inline-stock-form { display: flex; flex-direction: column; align-items: stretch; }
  .inline-form select, .inline-form input, .inline-stock-form select, .inline-stock-form input { width: 100%; }
  .pos-checkout-actions { grid-template-columns: 1fr; }
}

/* V6 - Preuves de livraison */
.proof-form { display: grid; gap: 12px; margin-top: 12px; }
.proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.proof-box {
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: var(--surface-2);
    padding: 14px;
    display: grid;
    gap: 10px;
}
.proof-box strong { display: block; }
.proof-box small, .signature-head small { color: var(--muted); font-weight: 700; }
.proof-box .required, .signature-head .required { color: var(--danger); }
.proof-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.status-failed { background: #fde8e7; color: var(--danger); }
.signature-pad { display: grid; gap: 8px; }
.signature-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 800; }
.signature-pad canvas {
    width: 100%;
    max-width: 100%;
    height: 150px;
    background: #fffdfa;
    border: 1px solid var(--border);
    border-radius: 16px;
    touch-action: none;
}
.settings-form { display: grid; gap: 14px; }
.settings-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fffdfa;
}
.settings-card h3 { margin: 0 0 4px; }
.settings-card p { margin: 0; }
.switch-line { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; color: var(--text); }
.switch-line input { width: auto; margin: 0; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px 6px; }
@media (max-width: 860px) {
    .proof-grid, .settings-card { grid-template-columns: 1fr; }
    .switch-line { white-space: normal; }
}

/* V7 Pilote Pro */
.personnel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.personnel-password-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.personnel-password-form input {
    max-width: 140px;
    min-height: 36px;
    padding: 8px 10px;
}
tr.is-editing td {
    background: #fff6ea;
}
.payment-form input[type="text"] { min-width: 150px; }
.mini-chart { display:flex; align-items:flex-end; gap:8px; min-height:130px; padding:12px 0 4px; overflow-x:auto; }
.bar-wrap { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:34px; font-size:11px; color:var(--muted); }
.bar { width:22px; border-radius:8px 8px 2px 2px; background:linear-gradient(180deg, var(--accent-light), var(--accent)); box-shadow:0 0 16px rgba(212,146,42,.18); }
.patron-stats div:first-child { border-color: rgba(212,146,42,.55); }
@media print {
  .site-header, .date-filter, .btn, .flash-zone { display:none !important; }
  body { background:#fff !important; color:#111 !important; }
  .panel, .card, .stats div { border:1px solid #ddd !important; background:#fff !important; color:#111 !important; }
  .container { max-width:100% !important; }
}

/* Recherche & filtres catalogue */
.product-picker-tools,
.pos-search-wrap { display: grid; gap: 12px; margin-bottom: 16px; }
.product-search,
.pos-search { margin: 0; }
.product-category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.product-search-empty,
.pos-search-empty { margin-top: 8px; }

.btn-whatsapp {
    background: #25D366;
    border-color: #1da851;
    color: #fff;
}
.btn-whatsapp:hover { background: #1fb855; color: #fff; }

/* Mode sombre caisse */
body.page-caisse.pos-dark-mode {
    background: #120e0a;
    color: #fff6ec;
}
body.page-caisse.pos-dark-mode .site-header {
    background: rgba(18, 14, 10, .96);
    border-bottom-color: #3d2e22;
}
body.page-caisse.pos-dark-mode .pos-qr-scan {
    background: linear-gradient(180deg, #2a2018, #1f1711);
    border-color: #4a3728;
}
body.page-caisse.pos-dark-mode .pos-qr-modal-panel {
    background: #1f1711;
    color: #fff6ec;
}
body.page-caisse.pos-dark-mode .pos-product,
body.page-caisse.pos-dark-mode .pos-sidebar,
body.page-caisse.pos-dark-mode .panel,
body.page-caisse.pos-dark-mode .pos-tab,
body.page-caisse.pos-dark-mode .pos-input,
body.page-caisse.pos-dark-mode .pos-select,
body.page-caisse.pos-dark-mode .pos-qty-btn,
body.page-caisse.pos-dark-mode .pos-payment-tile span,
body.page-caisse.pos-dark-mode .pos-cart-line {
    background: #1f1711;
    border-color: #4a3728;
    color: #fff6ec;
}
body.page-caisse.pos-dark-mode .pos-product-tap {
    background: linear-gradient(180deg, #2a2018, #241a13);
}
body.page-caisse.pos-dark-mode .pos-product-tap:active:not(:disabled) {
    background: #3a291d;
}
body.page-caisse.pos-dark-mode .pos-tab.is-active,
body.page-caisse.pos-dark-mode .pos-payment-tile input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
body.page-caisse.pos-dark-mode .pos-product-price,
body.page-caisse.pos-dark-mode .pos-total strong,
body.page-caisse.pos-dark-mode .pos-caisse-head h1 {
    color: #ffd08a;
}
body.page-caisse.pos-dark-mode .pos-product-tap small,
body.page-caisse.pos-dark-mode .pos-total span,
body.page-caisse.pos-dark-mode .pos-caisse-head p,
body.page-caisse.pos-dark-mode .pos-field > span,
body.page-caisse.pos-dark-mode .pos-field-label {
    color: #c9b29a;
}
body.page-caisse.pos-dark-mode .pos-product-image-wrap {
    background: #2a2018;
}
body.page-caisse.pos-dark-mode .pos-change-row {
    background: #17351f;
    border-color: #2f6840;
}
body.page-caisse.pos-dark-mode.pos-fullscreen {
    background: #0e0b08;
}
body.page-caisse.pos-dark-mode .flash-success {
    background: #17351f;
    color: #b8f0c8;
}
body.page-caisse.pos-dark-mode .flash-error {
    background: #3a1710;
    color: #ffc9c4;
}

/* Forfait livraison abonné */
.billing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.billing-card {
    display: block;
    cursor: pointer;
}
.billing-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.billing-card > span {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 18px;
    background: #fffdfa;
    min-height: 100%;
}
.billing-card strong { font-size: 16px; line-height: 1.25; }
.billing-card small { color: var(--muted); font-weight: 700; line-height: 1.4; }
.billing-card.featured > span {
    border-color: rgba(196, 101, 26, .35);
    background: linear-gradient(180deg, #fff8ef, #fffdfa);
}
.billing-card input:checked + span {
    border-color: var(--primary);
    box-shadow: 0 8px 22px rgba(179, 93, 23, .14);
}
.monthly-billing-note[hidden] { display: none !important; }

.qr-order-print { display: grid; gap: 28px; padding-bottom: 40px; }
.qr-order-poster {
    background: #fff;
    color: #111;
    border: 1px solid var(--border);
    border-radius: 20px;
    text-align: center;
    padding: 24px 18px;
}
.qr-order-poster-main .qr-order-image { width: 240px; height: 240px; }
.qr-order-logo { width: 72px; height: 72px; border-radius: 50%; object-fit: contain; background: #000; }
.qr-order-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.qr-order-poster-table img { width: 140px; height: 140px; }
.qr-order-poster-table span { display: block; font-weight: 800; font-size: 20px; margin-bottom: 8px; }
@media print {
    body.page-qr-commande .site-header,
    body.page-qr-commande .site-footer,
    body.page-qr-commande .flash-zone,
    body.page-qr-commande .no-print { display: none !important; }
    body.page-qr-commande { background: #fff !important; }
    .qr-order-poster { break-inside: avoid; }
    .qr-order-poster-main { page-break-after: always; }
}

.kds-board {
    width: min(1440px, calc(100% - 24px));
    margin: 0 auto 32px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.kds-board:has(.kds-col-ready):not(:has(.kds-col-received)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.kds-col {
    background: #1b140f;
    color: #fff8ee;
    border-radius: 18px;
    min-height: 60vh;
    padding: 12px;
}
.kds-col header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.kds-col h2 { margin: 0; font-size: 18px; color: #fff; }
.kds-col header span {
    background: #c4651a;
    color: #fff;
    border-radius: 999px;
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    padding: 2px 8px;
}
.kds-col-received { background: #3a2416; }
.kds-col-preparing { background: #4a2f12; }
.kds-col-ready { background: #1d3a22; }
.kds-col-on_the_way { background: #1a2f44; }
.kds-cards { display: grid; gap: 10px; }
.kds-card {
    background: #fff8ef;
    color: #24170d;
    border-radius: 14px;
    padding: 12px;
}
.kds-card-top { display: flex; justify-content: space-between; gap: 8px; }
.kds-card-top strong { font-size: 16px; }
.kds-meta, .kds-notes { margin: 4px 0; color: #74685d; font-size: 13px; }
.kds-items { margin: 8px 0; font-weight: 700; }
.kds-total { margin: 6px 0 10px; font-weight: 800; }
.kds-actions { display: grid; gap: 8px; }
.kds-empty { color: rgba(255,248,238,.7); font-size: 14px; }
.kitchen-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 16px;
    background: #b42318;
    color: #fff;
    font-weight: 700;
    animation: kitchenPulse 1.2s ease-in-out infinite;
}
.kitchen-alert .btn { background: #fff; color: #b42318; }
.kds-card.is-overdue,
.delivery-item.is-overdue {
    border: 2px solid #b42318;
    background: #fde8e7;
    animation: kitchenPulse 1.2s ease-in-out infinite;
}
.kds-alert-tag {
    margin: 4px 0 0;
    color: #b42318;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
}
.kds-hours { display: grid; gap: 8px; }
.kds-hours div { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; }
.kds-hours span { color: #74685d; font-weight: 700; }
.kds-hours b {
    display: block;
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #c45c26;
    color: #fff;
    font-size: 13px;
}
@keyframes kitchenPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .35); }
    50% { box-shadow: 0 0 0 8px rgba(180, 35, 24, 0); }
}
@media (max-width: 980px) {
    .kds-board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .kds-board { grid-template-columns: 1fr; }
}
