/* =====================================================================
   DIGIT RESTO — Identité « Crème & Anthracite » (style B)
   Chargé après digit.css et theme.css : redéfinit les couleurs, les
   en-têtes de page, la navigation, les cartes, les champs et les boutons
   de toute la plateforme. Jour : crème chaud. Nuit : anthracite chaud.
   Le rouge de la marque sert d'accent (boutons d'action, repères),
   plus jamais de grands aplats en dégradé.
   ===================================================================== */

html[data-theme] {
    --primary: #ff4757;
    --primary-dark: #e63946;
    --primary-light: rgba(255, 71, 87, 0.10);
    --accent-soft: #ffe9e6;
    --ink: #1c1c28;
    --ink-inv: #ffffff;
    --ink-soft: rgba(28, 28, 40, 0.06);

    --body-bg: #faf7f4;
    --card-bg: #ffffff;
    --surface-2: #f4efe9;
    --surface-3: #ece5dd;
    --text-color: #1c1c28;
    --text-muted: #62656f;
    --border-color: #ece5dd;
    --field-border: #e2d9ce;
    --input-bg: #ffffff;
    --nav-bg: rgba(250, 247, 244, 0.92);

    --gray-100: #f6f2ed; --gray-200: #ece5dd; --gray-300: #ddd4c9; --gray-400: #c4bbb0;
    --gray-500: #8f8a84; --gray-600: #6b6760; --gray-700: #4a4741; --gray-800: #2f2d2a; --gray-900: #1c1c28;

    --shadow-xs: 0 1px 2px rgba(28, 28, 40, 0.04);
    --shadow-sm: 0 4px 14px rgba(28, 28, 40, 0.05);
    --shadow-md: 0 10px 30px rgba(28, 28, 40, 0.07);
    --shadow-lg: 0 22px 50px rgba(28, 28, 40, 0.12);
    --shadow-primary: 0 8px 20px rgba(255, 71, 87, 0.22);
    --card-shadow: 0 10px 30px rgba(28, 28, 40, 0.06);
    --card-shadow-hover: 0 18px 44px rgba(28, 28, 40, 0.11);

    --grad: var(--primary);
    --grad-soft: var(--primary-light);
    --hero-glow: none;
    --r-card: 22px;
    --r-field: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    color-scheme: light;
}
html[data-theme="dark"] {
    --primary-light: rgba(255, 107, 120, 0.14);
    --accent-soft: rgba(255, 107, 120, 0.16);
    --ink: #f4f1ec;
    --ink-inv: #16151d;
    --ink-soft: rgba(244, 241, 236, 0.08);

    --body-bg: #16151d;
    --card-bg: #22212c;
    --surface-2: #2a2935;
    --surface-3: #33323e;
    --text-color: #f4f1ec;
    --text-muted: #aeadbb;
    --border-color: #33323e;
    --field-border: #3b3a47;
    --input-bg: #1c1b24;
    --nav-bg: rgba(22, 21, 29, 0.92);

    --gray-100: #2a2935; --gray-200: #33323e; --gray-300: #3f3e4b; --gray-400: #5a5966;
    --gray-500: #8b8a97; --gray-600: #aeadbb; --gray-700: #cfcdd6; --gray-800: #ebe8ef; --gray-900: #ffffff;

    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.5);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
    --card-shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

html body { background: var(--body-bg) !important; color: var(--text-color); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(255, 71, 87, 0.22); }

/* ---------------------------------------------------------------------
   Typographie
   --------------------------------------------------------------------- */
main h1, main .h1, main h2, main .h2 { font-weight: 900; letter-spacing: -0.03em; }
main h3, main .h3, main h4, main .h4 { font-weight: 800; letter-spacing: -0.02em; }
main .text-muted, main small.text-muted { color: var(--text-muted) !important; }
.dr-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }

/* ---------------------------------------------------------------------
   En-têtes de page : grand titre, puce d'icône, pas de bandeau coloré
   --------------------------------------------------------------------- */
html body main .dr-page-head,
html body main .page-header {
    background: transparent !important; color: var(--text-color) !important; box-shadow: none !important;
    border: 0 !important; border-radius: 0 !important;
    padding: clamp(6px, 1.4vw, 14px) 0 clamp(14px, 2vw, 22px) !important;
    margin: 0 0 clamp(12px, 2vw, 22px) !important;
    border-bottom: 1px solid var(--border-color) !important;
}
html body main .dr-page-head::after, html body main .page-header::after { display: none !important; }
html body main .dr-page-head, html body main .page-header { text-align: left !important; justify-content: space-between !important; }
html body main .dr-page-head h1, html body main .page-header h1 { justify-content: flex-start !important; }
@media (max-width: 576px) { html body main .dr-page-head, html body main .page-header { align-items: stretch !important; } }
html body main .dr-page-head h1, html body main .page-header h1,
html body main .dr-page-head h2, html body main .page-header h2 {
    color: var(--text-color) !important; font-weight: 900 !important; letter-spacing: -0.035em;
    font-size: clamp(1.55rem, 4.2vw, 2.35rem) !important; line-height: 1.08; gap: 14px;
}
html body main .dr-page-head h1 > i:first-child, html body main .page-header h1 > i:first-child,
html body main .dr-page-head h2 > i:first-child, html body main .page-header h2 > i:first-child {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: 15px; margin: 0 !important;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
    background: var(--accent-soft) !important; color: var(--primary) !important; opacity: 1 !important;
}
html body main .dr-page-head p, html body main .page-header p,
html body main .page-header .subtitle, html body main .dr-page-head .subtitle,
html body main .dr-page-head .text-muted, html body main .page-header .text-muted {
    color: var(--text-muted) !important; margin: 8px 0 0 !important; font-size: .98rem; font-weight: 500; max-width: 720px;
}
html body main .dr-page-head .dr-btn-ghost, html body main .page-header .btn,
html body main .page-header .btn-outline-secondary, html body main .page-header .btn-back,
html body main .page-header a:not(.btn-primary-custom):not(.dr-btn-primary) {
    background: var(--card-bg) !important; color: var(--text-color) !important;
    border: 1.5px solid var(--ink) !important; border-radius: 999px !important; backdrop-filter: none;
    box-shadow: none !important; font-weight: 700;
}
html body main .dr-page-head .dr-btn-ghost:hover, html body main .page-header a:not(.btn-primary-custom):not(.dr-btn-primary):hover {
    background: var(--ink) !important; color: var(--ink-inv) !important;
}
html body main .dr-page-head .dr-btn-primary, html body main .page-header .btn-primary-custom,
html body main .page-header .dr-btn-primary, html body main .page-header .btn-primary, html body main .page-header .btn-danger {
    background: var(--primary) !important; color: #fff !important; border: 0 !important;
    box-shadow: var(--shadow-primary) !important; border-radius: 999px !important; font-weight: 800 !important;
}
html body main .page-header .dr-badge, html body main .dr-page-head .dr-badge { background: var(--surface-2); color: var(--text-color); }
html body main .dr-page-head code, html body main .page-header code { background: var(--surface-2) !important; color: var(--text-color) !important; }
@media (max-width: 640px) {
    html body main .dr-page-head h1 > i:first-child, html body main .page-header h1 > i:first-child { width: 40px; height: 40px; border-radius: 13px; font-size: 1rem; }
}

/* ---------------------------------------------------------------------
   Navigation client
   --------------------------------------------------------------------- */
.dc-header { background: var(--nav-bg); border-bottom: 1px solid transparent; box-shadow: 0 1px 0 var(--border-color); }
.dc-link { font-weight: 700; color: var(--text-color); }
.dc-link:hover { background: var(--ink-soft); color: var(--text-color); }
.dc-link.active { background: var(--ink); color: var(--ink-inv); box-shadow: none; }
.dc-link.active i { color: var(--primary); }
.dc-icon, .ds-icon { border-radius: 999px; border: 1.5px solid var(--border-color); background: var(--card-bg); }
.dc-icon:hover, .ds-icon:hover { border-color: var(--ink); color: var(--text-color); }
.dc-user, .dc-lang select, .ds-lang select { border-radius: 999px; border-width: 1.5px; }
.dc-login { background: var(--ink); color: var(--ink-inv) !important; box-shadow: none; }
.dc-login:hover { background: var(--primary); color: #fff !important; box-shadow: var(--shadow-primary); }
.dc-cart .cart-count, .ds-tab-ic .cart-count { background: var(--primary); }

/* Bouton jour / nuit : visible partout, avec libellé sur ordinateur */
[data-theme-toggle].dc-icon, [data-theme-toggle].ds-icon {
    width: auto; min-width: 42px; padding: 0 12px; gap: 8px; border: 1.5px solid var(--ink); color: var(--text-color);
}
[data-theme-toggle].dc-icon:hover, [data-theme-toggle].ds-icon:hover { background: var(--ink); color: var(--ink-inv); }
.dr-theme-lbl { display: none; font-weight: 700; font-size: .84rem; white-space: nowrap; }
@media (min-width: 1024px) { .dr-theme-lbl { display: inline; } }
@media (max-width: 1023px) { [data-theme-toggle].dc-icon, [data-theme-toggle].ds-icon { padding: 0; width: 38px; min-width: 38px; } }
@media (max-width: 380px) { .ds-top-actions [data-theme-toggle] { display: inline-flex !important; } }

/* Logo lisible la nuit : pastille claire derrière l'image */
html[data-theme="dark"] .dc-logo img, html[data-theme="dark"] .ds-top-logo img, html[data-theme="dark"] .sf-brand img {
    background: #faf7f4; border-radius: 12px; padding: 3px 7px; box-sizing: content-box;
}

/* ---------------------------------------------------------------------
   Espace pro : barre latérale et barre haute
   --------------------------------------------------------------------- */
.ds-sidebar { background: var(--card-bg); border-right: 1px solid var(--border-color); }
.ds-brand { background: var(--ink) !important; color: var(--ink-inv); box-shadow: none; border-radius: 20px; }
html[data-theme="dark"] .ds-brand { background: #2c2b38 !important; color: #fff; }
.ds-brand::after { background: radial-gradient(circle, rgba(255, 71, 87, .35), transparent 70%); top: -60px; right: -60px; width: 150px; height: 150px; }
.ds-brand-role { color: #ff8a95; opacity: 1; }
.ds-link { font-weight: 650; color: var(--text-color); }
.ds-link:hover { background: var(--ink-soft); color: var(--text-color); }
.ds-link:hover i { color: var(--text-color); }
.ds-link.active { background: var(--ink); color: var(--ink-inv); box-shadow: none; }
.ds-link.active i { color: var(--primary); }
.ds-topbar { background: var(--nav-bg); border-bottom: 1px solid transparent; box-shadow: 0 1px 0 var(--border-color); }
.ds-av { background: var(--ink); color: var(--ink-inv); }
.ds-user:hover { background: var(--surface-2); }

/* Onglets du bas : barre anthracite flottante */
.ds-tabbar { background: #1c1c28; border: 0; box-shadow: 0 16px 40px rgba(28, 28, 40, .28); }
html[data-theme="dark"] .ds-tabbar { background: #2a2935; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.ds-tab { color: #a3a4b1; }
.ds-tab.active { color: #fff; }
.ds-tab.active .ds-tab-ic { background: var(--primary); color: #fff; box-shadow: none; }
.ds-dot { border-color: #1c1c28; }

/* Panneau « Plus » */
.ds-sheet-item { border: 0; background: var(--surface-2); }
.ds-sheet-item i { background: var(--card-bg); color: var(--text-color); }
.ds-sheet-item.active, .ds-sheet-item:hover { background: var(--ink); color: var(--ink-inv); }
.ds-sheet-item.active i, .ds-sheet-item:hover i { background: var(--primary); color: #fff; }

/* ---------------------------------------------------------------------
   Cartes : sans bordure, ombre douce, grands arrondis
   --------------------------------------------------------------------- */
main .card, main .dr-card, main .card-custom, main .form-section, main .stat-card, main .kpi-card {
    border: 1px solid transparent !important; border-radius: var(--r-card) !important;
    background: var(--card-bg); box-shadow: var(--card-shadow) !important;
}
html[data-theme="dark"] main .card, html[data-theme="dark"] main .dr-card, html[data-theme="dark"] main .card-custom,
html[data-theme="dark"] main .form-section, html[data-theme="dark"] main .stat-card, html[data-theme="dark"] main .kpi-card {
    border-color: rgba(255, 255, 255, .04) !important;
}
main .card:hover, main .dr-card:hover { box-shadow: var(--card-shadow-hover) !important; }
main .card-header { border-bottom: 1px solid var(--border-color); }
main .dr-section-title .ic { background: var(--accent-soft) !important; color: var(--primary) !important; box-shadow: none; }
main .product-card:hover, main .etab-card:hover, main .resto-card:hover { box-shadow: var(--card-shadow-hover) !important; }
main .empty-state > i:first-child, main .dr-empty .ic { background: var(--surface-2) !important; color: var(--text-muted) !important; }

/* ---------------------------------------------------------------------
   Champs
   --------------------------------------------------------------------- */
main .form-control, main .form-select,
main input[type="text"]:not([class]), main input[type="email"]:not([class]), main input[type="tel"]:not([class]),
main input[type="password"]:not([class]), main input[type="number"]:not([class]), main input[type="search"]:not([class]),
main input[type="url"]:not([class]), main input[type="date"]:not([class]), main input[type="time"]:not([class]),
main input[type="datetime-local"]:not([class]), main textarea:not([class]), main select:not([class]) {
    border: 1.5px solid var(--field-border) !important; background-color: var(--input-bg) !important;
}
main .form-control:focus, main .form-select:focus, main input:not([class]):focus, main textarea:not([class]):focus, main select:not([class]):focus {
    border-color: var(--ink) !important; box-shadow: 0 0 0 4px var(--ink-soft) !important;
}
main .form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
html[data-theme="dark"] main .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
main .input-group-text { border: 1.5px solid var(--field-border); background: var(--surface-2); }

/* ---------------------------------------------------------------------
   Boutons : rouge plein pour l'action, encre pour le reste
   --------------------------------------------------------------------- */
.dr-btn-primary, main .btn-primary, main .btn-danger, main .btn-primary-custom, main .dr-btn-primary, main .btn-submit, main .btn-auth, .btn-primary-custom {
    background: var(--primary) !important; color: #fff !important; border: 0 !important;
    box-shadow: var(--shadow-primary) !important; border-radius: 999px !important;
}
.dr-btn-primary:hover, main .btn-primary:hover, main .btn-danger:hover, main .btn-primary-custom:hover, main .dr-btn-primary:hover, main .btn-submit:hover {
    background: var(--primary-dark) !important; box-shadow: 0 12px 26px rgba(255, 71, 87, .3) !important; color: #fff !important;
}
main .btn-dark, .dr-btn-ink { background: var(--ink) !important; color: var(--ink-inv) !important; border: 0 !important; border-radius: 999px !important; }
main .btn-outline-secondary, main .btn-light, main .btn-secondary, main .dr-btn-ghost, main .btn-cancel {
    border: 1.5px solid var(--border-color) !important; background: var(--card-bg) !important; color: var(--text-color) !important;
}
main .btn-outline-secondary:hover, main .btn-light:hover, main .dr-btn-ghost:hover, main .btn-cancel:hover {
    border-color: var(--ink) !important; color: var(--text-color) !important; background: var(--card-bg) !important;
}
main .btn-outline-danger, main .btn-outline-primary { border-width: 1.5px !important; }
main .btn-outline-danger:hover, main .btn-outline-primary:hover { background: var(--primary) !important; }
main .btn-success { background: #1f9d55 !important; }
main .btn:focus-visible, main .dr-btn:focus-visible, main a:focus-visible, main button:focus-visible,
.ds-link:focus-visible, .ds-tab:focus-visible, .dc-link:focus-visible, [data-theme-toggle]:focus-visible {
    outline: 3px solid var(--primary) !important; outline-offset: 2px; box-shadow: none !important;
}

/* Tableaux, pagination, onglets Bootstrap */
main .table > thead th, main .table-header th, main thead th { background: var(--surface-2) !important; color: var(--text-muted) !important; }
main .table-hover > tbody > tr:hover > *, main .table > tbody > tr:hover > * { background: var(--ink-soft); }
main .pagination .active .page-link { background: var(--ink); color: var(--ink-inv); }
main .nav-pills .nav-link.active { background: var(--ink) !important; color: var(--ink-inv) !important; }
main .nav-pills .nav-link { border-radius: 999px; font-weight: 700; color: var(--text-color); }
main .alert-info { background: var(--surface-2); border-color: transparent; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--text-color); }

/* Pied de page */
.site-footer { background: var(--body-bg); border-top: 1px solid var(--border-color); }

/* ---------------------------------------------------------------------
   Anciens bandeaux rouges propres à certaines pages : blocs anthracite
   --------------------------------------------------------------------- */
main .mo-hero, main .bo-hero, main .pr-code {
    background: radial-gradient(circle at 92% 0%, rgba(255, 71, 87, .38), transparent 46%), #1c1c28 !important; color: #fff !important;
}
html[data-theme="dark"] main .mo-hero, html[data-theme="dark"] main .bo-hero, html[data-theme="dark"] main .pr-code {
    background: radial-gradient(circle at 92% 0%, rgba(255, 71, 87, .32), transparent 46%), #2c2b38 !important;
}
main .ev-hero-media, main .ev-media, main .va-media, .pz-cover { background: linear-gradient(135deg, #2c2b38, #1c1c28) !important; }
main .rp-bar .b, main .sa-bar .b, main .rp-track span, main .sa-track span, main .ev-bar-p span { background: var(--primary) !important; }

/* ---------------------------------------------------------------------
   Interfaces des boutiquiers : lisibles d'un coup d'œil, faciles à toucher
   (gérant, serveur, caisse, cuisine, livreur)
   --------------------------------------------------------------------- */
body.shell-staff { font-size: 16px; }
body.shell-staff main { --text-muted: #55585f; }
html[data-theme="dark"] body.shell-staff main { --text-muted: #bdbcc8; }
body.shell-staff main .btn, body.shell-staff main .dr-btn { min-height: 46px; padding: 10px 20px; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
body.shell-staff main .btn-sm, body.shell-staff main .dr-btn-sm { min-height: 40px; padding: 7px 14px; font-size: .88rem; }
body.shell-staff main .btn-icon, body.shell-staff main .btn-action { min-width: 42px; min-height: 42px; }
body.shell-staff main .form-control, body.shell-staff main .form-select { min-height: 52px; font-size: 1rem; }
body.shell-staff main .form-control-sm, body.shell-staff main .form-select-sm { min-height: 44px; font-size: .95rem; }
body.shell-staff main .form-label, body.shell-staff main label:not([class]) { font-size: .92rem; color: var(--text-color); }
body.shell-staff main .form-text, body.shell-staff main .help-text { font-size: .86rem; color: var(--text-muted); }
body.shell-staff main .form-check-input { width: 1.35em; height: 1.35em; }
body.shell-staff main .form-switch .form-check-input { width: 2.7em; height: 1.45em; }
body.shell-staff main .table > tbody td { padding: 14px; font-size: .95rem; }
body.shell-staff main .table > thead th { font-size: .76rem !important; }
body.shell-staff main .badge, body.shell-staff main .status-badge, body.shell-staff main .dr-badge { font-size: .8rem; padding: .45em .8em; }
body.shell-staff .ds-link { padding: 12px 14px; font-size: .95rem; }
body.shell-staff .ds-tab { font-size: .7rem; }
body.shell-staff .ds-tab-ic { width: 46px; height: 32px; font-size: 1.12rem; }
body.shell-staff .ds-sheet-item { font-size: .8rem; padding: 16px 6px; }
@media (max-width: 640px) {
    body.shell-staff main .btn:not(.btn-sm):not(.btn-icon):not(.btn-action) { min-height: 48px; }
}

/* Menu digital : titres de catégories */
main .md-cat-titre { font-size: clamp(1.35rem, 3.4vw, 1.8rem); font-weight: 900; letter-spacing: -.03em; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
main .md-cat-titre::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }

/* Flèches pour changer l'ordre (catégories, plats) */
.dr-ordre { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-left: 6px; }
.dr-ordre form { margin: 0; display: inline; }
.dr-ordre button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border-color); background: var(--card-bg); color: var(--text-color); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; padding: 0; }
.dr-ordre button:hover:not(:disabled) { border-color: var(--ink); }
.dr-ordre button:disabled { opacity: .35; }
.dr-ordre > span { min-width: 18px; text-align: center; font-weight: 800; }
