/* ==========================================================================
   STYLE.CSS - VERSIONE "LUXURY CINEMATIC" & ADMIN FIX
   ========================================================================== */

/* --- IMPORT FONT ELEGANTE --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;600&display=swap');

:root {
    /* --- COLORI LUXURY --- */
    --clr-gold-light: #F9F295;
    --clr-gold-main: #E0AA3E;
    --clr-gold-dark: #B88A44;
    --clr-gold-gradient: linear-gradient(135deg, #B88A44 0%, #E0AA3E 50%, #F9F295 100%);
    --clr-primary: #E0AA3E;
    --clr-accent: #E0AA3E;
    
    --clr-bg-dark: #050505;      /* Nero Profondo */
    --clr-bg-panel: #111111;     /* Pannelli/Card */
    --clr-border: rgba(224, 170, 62, 0.3); /* Bordo Oro Sottile */
    --border-radius: 12px;
    
    --clr-text-main: #FFFFFF;
    --clr-text-muted: #A0A0A0;

    /* --- DIMENSIONI & LAYOUT --- */
    --header-height: 80px;
    --sidebar-width: 280px;
    
    /* --- Z-INDEX LAYERS (CRUCIALE PER ADMIN) --- */
    --z-overlay: 990;
    --z-sidebar: 1000;  /* Sidebar SOPRA l'overlay */
    --z-header: 1010;
    --z-modal: 100050;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--clr-bg-dark);
    color: var(--clr-text-main);
    font-family: 'Inter', sans-serif; /* Testo leggibile */
    margin: 0;
    line-height: 1.6;
    padding-top: var(--header-height); /* Spazio per Header Fisso */
    overflow-x: hidden;
}

/* --- TITOLI DI CLASSE (Playfair Display) --- */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--clr-gold-main);
    margin-top: 0;
    letter-spacing: 0.5px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; display: block; }

/* =========================================
   COMPONENTI UI (Bottoni & Input)
   ========================================= */

/* Bottone Oro Metallico */
.btn, button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 30px; border-radius: 50px;
    font-family: 'Inter', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    border: none; cursor: pointer; transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary, button[type="submit"] {
    background: var(--clr-gold-gradient);
    color: #000; /* Testo nero su oro per contrasto */
    box-shadow: 0 4px 15px rgba(224, 170, 62, 0.3);
}


.btn-primary:hover, button[type="submit"]:hover {
    background: #FFF; /* Sfondo diventa bianco */
    color: #000 !important; /* <--- QUESTO FIXA IL PROBLEMA (Forza testo nero) */
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(224, 170, 62, 0.5);
    text-shadow: none; /* Rimuove eventuali ombre che confondono */
}

/* Input Form Stile Dark */
input, select, textarea, .form-control {
    width: 100%; padding: 12px 15px;
    background: #1a1a1a !important; /* Sfondo scuro solido per evitare trasparenze su bianco */
    border: 1px solid #333 !important; 
    color: #FFFFFF !important;
    border-radius: 6px; outline: none; transition: 0.3s;
}

.form-control:focus, input:focus, select:focus {
    background: #000 !important;
    border-color: var(--clr-gold-main) !important;
    color: #FFF !important;
    box-shadow: 0 0 10px rgba(224, 170, 62, 0.2) !important;
}

/* FIX Autofill (Chrome/Safari): campi chiari con testo scuro leggibile.
   NB: la regola "Input sempre scuro" piu' sotto forza background #fff su questi
   input e azzera box-shadow, quindi il vecchio trucco del riquadro scuro
   (inset #1a1a1a) non si applica piu'. Se il text-fill resta bianco, il testo
   autofillato diventa invisibile (bianco su bianco) su Android e iPhone. */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* FIX: Forza testo bianco nelle opzioni delle tendine (select) */
select option {
    background-color: #111; /* Sfondo scuro */
    color: #FFFFFF !important;        /* Testo Bianco */
}

/* Skeletons per CLS */
.skeleton-menu {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #111 4%, #222 25%, #111 36%);
    background-size: 1000px 100%;
}
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.skeleton-item {
    background: #1a1a1a;
    border: 1px solid #333;
    height: 120px;
    border-radius: 12px;
}

/* =========================================
   HEADER & NAVIGAZIONE
   ========================================= */
.main-header {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height);
    background: rgba(5, 5, 5, 0.9); backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: var(--z-header);
    display: flex; align-items: center; justify-content: space-between; padding: 0 5%;
}

.logo img { height: 45px; }

.desktop-nav ul {
    display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; align-items: center;
}
.nav-link {
    font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: #CCC; font-weight: 500;
}
.nav-link:hover, .nav-link.active {
    color: var(--clr-gold-main);
    text-shadow: 0 0 8px rgba(224, 170, 62, 0.6);
}

/* Nascondi desktop nav su mobile */
@media (max-width: 992px) { .desktop-nav { display: none; } }

/* =========================================
   FIX DROPDOWN MENU DESKTOP
   ========================================= */
.dropdown-menu {
    /* Stile base Luxury */
    background-color: rgba(5, 5, 5, 0.95);
    border: 1px solid var(--clr-gold-main);
    border-radius: 0;
    padding: 0;
    min-width: 200px;
}

.dropdown-item {
    color: #FFF;
    transition: 0.3s;
    padding: 6px 20px !important; /* Spaziatura ridotta ulteriormente e forzata */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'Playfair Display', serif; /* Coerenza font */
    font-size: 0.9rem !important; /* Leggermente piÃ¹ compatto */
    line-height: 1.4 !important; /* Controlla l'altezza della riga */
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--clr-gold-main);
    color: #000;
}

/* --- LOGICA HOVER DESKTOP --- */
@media (min-width: 992px) {
    /* Nascondi SEMPRE di default su desktop, ignorando la classe .show di Bootstrap */
    .dropdown-menu {
        display: none !important; 
        position: absolute; /* Ignora Popper.js positioning */
        top: 100% !important;
        left: 0;
        margin-top: 0;
        transform: none !important; /* Rimuove trasformazioni JS */
    }
    
    /* Gestione allineamento a destra per menu profilo */
    .dropdown-menu.dropdown-menu-end {
        right: 0;
        left: auto;
    }

    /* Mostra SOLO quando il mouse Ã¨ sopra il genitore .nav-item */
    .nav-item.dropdown:hover .dropdown-menu {
        display: block !important;
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   HOMEPAGE "CINEMATIC" (Nuovo Look)
   ========================================= */
.hero-section {
    position: relative;
    height: 90vh; /* Quasi tutto lo schermo */
    margin-top: calc(var(--header-height) * -1); /* Inizia DA SOTTO l'header */
    padding-top: var(--header-height);
    background-image: url('/static/uploads/pizzahome.jpeg');
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
}

/* Velo nero cinematografico */
.hero-overlay {
    position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.95) 90%);
    z-index: 1;
}

.hero-glass-box {
    position: relative; z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    /* Effetto Vetro Scuro */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0; /* Angoli vivi per eleganza */
}

.hero-glass-box h1 {
    font-size: 4rem; line-height: 1.1; margin-bottom: 1rem;
    color: #FFF; text-transform: uppercase;
}
.hero-glass-box h1 span {
    color: transparent;
    background: var(--clr-gold-gradient);
    -webkit-background-clip: text; /* Testo color Oro sfumato */
    background-clip: text;
}

.hero-glass-box p { font-size: 1.2rem; color: #DDD; font-weight: 300; }

/* Marquee Striscia */
.marquee-container {
    background: var(--clr-gold-main); color: #000;
    padding: 15px 0; overflow: hidden; white-space: nowrap;
    border-top: 2px solid #FFF; border-bottom: 2px solid #FFF;
    font-weight: 800; font-size: 1.2rem; text-transform: uppercase;
}
.marquee-content { display: inline-block; animation: scroll 20s linear infinite; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Galleria Mosaico */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 5px; background: #000; padding: 5px; }
.gallery-item { height: 300px; overflow: hidden; position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; filter: grayscale(30%); }
.gallery-item:hover img { transform: scale(1.05); filter: grayscale(0%); }

/* =========================================
   ADMIN PANEL (FIX SIDEBAR)
   ========================================= */

.admin-layout {
    display: grid;
    /* Desktop: Sidebar fissa a sinistra, contenuto a destra */
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    background: #000;
    /* Reset padding body */
    margin-top: calc(var(--header-height) * -1); 
    padding-top: var(--header-height);
}

/* Sidebar Styling */
.admin-sidebar {
    background: #080808;
    border-right: 1px solid #222;
    height: calc(100vh - var(--header-height));
    position: sticky; top: var(--header-height);
    overflow-y: auto;
    padding: 20px 0;
    z-index: var(--z-sidebar); /* FIX Z-INDEX: Deve essere alto */
}

.admin-sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 25px;
    color: #888; border-left: 3px solid transparent;
    transition: 0.2s; font-size: 0.95rem;
}
.admin-sidebar-nav a:hover, .admin-sidebar-nav a.active {
    background: rgba(224, 170, 62, 0.05);
    color: var(--clr-gold-main);
    border-left-color: var(--clr-gold-main);
}
.admin-sidebar-nav i { width: 20px; text-align: center; }

/* Contenuto Admin */
.admin-main-content {
    padding: 30px; background: #000;
}

/* Tabelle Admin */
.table-container { background: var(--clr-bg-panel); border: 1px solid #222; border-radius: 8px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; color: #DDD; }
.data-table th { background: #181818; padding: 15px; text-align: left; color: var(--clr-gold-main); font-size: 0.85rem; text-transform: uppercase; }
.data-table td { padding: 15px; border-bottom: 1px solid #222; }
.data-table tr:hover td { background: #111; }

/* --- ADMIN MOBILE FIX --- */
/* Overlay Sfondo Scuro */
.admin-sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: var(--z-overlay); /* FIX: Deve essere SOTTO la sidebar */
    backdrop-filter: blur(3px);
}

@media (max-width: 992px) {
    .admin-layout { grid-template-columns: 1fr; } /* Layout colonna singola */
    
    .admin-sidebar {
        position: fixed; top: var(--header-height); left: 0; bottom: 0;
        height: auto; width: 80%; max-width: 300px;
        transform: translateX(-100%); /* Nascosta inizialmente */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    }
    
    /* Quando la sidebar Ã¨ aperta (tramite JS) */
    .admin-layout.sidebar-open .admin-sidebar {
        transform: translateX(0); /* Entra in scena */
    }
    .admin-layout.sidebar-open .admin-sidebar-overlay {
        display: block; /* Mostra il velo scuro */
    }
    
    /* Page title sticky on mobile */
    .page-title {
        position: sticky;
        top: var(--header-height);
        background: #000;
        z-index: 100;
        padding: 10px 0;
        border-bottom: 1px solid #222;
    }
    
    /* Bottone Hamburger Admin (visibile solo su mobile) */
    .admin-menu-toggle-btn {
        display: inline-block !important;
        background: transparent; border: 1px solid #333; color: var(--clr-gold-main);
        padding: 8px 12px; border-radius: 4px; margin-right: 15px;
    }
}
@media (min-width: 993px) { .admin-menu-toggle-btn { display: none !important; } }


/* =========================================
   MENU RISTORANTE (Card & Layout)
   ========================================= */
.menu-items-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px;
    padding: 20px 0;
}
.menu-item-card {
    background: var(--clr-bg-panel); border: 1px solid #222;
    border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
}
.menu-item-image { height: 220px; overflow: hidden; }
.menu-item-image img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.menu-item-card:hover img { transform: scale(1.1); }
.menu-item-details { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.menu-item-name { font-size: 1.2rem; color: var(--clr-gold-main); font-family: 'Playfair Display', serif; }

/* =========================================
   FOOTER & ORARI (FIX COMPLETO)
   ========================================= */

.site-footer {
    background: #080808;
    border-top: 1px solid rgba(224, 170, 62, 0.2); /* Bordo oro scuro */
    padding: 60px 0 20px;
    color: #999;
    /* Il margine di 80px apriva una fascia tra contenuto e footer in cui
       si vedeva lo sfondo della pagina: sulle pagine chiare appariva una
       "striscia bianca". Il footer ha gia' l'onda di raccordo, quindi qui
       non serve spazio. */
    margin-top: 0;
    font-size: 0.95rem;
}

/* Il fondo del footer e' scuro SEMPRE, ma il colore del testo veniva
   preso dal tema della pagina tramite --text-main. Nella home e nella
   pagina prenota quella variabile resta sul valore scuro (perche' quelle
   due pagine non hanno la classe body-dark), e il risultato era nero su
   nero: indirizzo, telefono e link del menu erano illeggibili, con un
   contrasto di 1,3 contro una soglia di 4,5.

   Qui il footer dichiara i propri colori e non li eredita piu': e' la
   parte piu' in basso della pagina, deve restare leggibile qualunque
   tema abbia il resto. Non si tocca il tema delle pagine. */
.site-footer,
.site-footer p,
.site-footer span,
.site-footer li,
.site-footer div,
.site-footer strong,
.site-footer small,
.site-footer address {
    color: #b8b8b8;
}

.site-footer a,
.site-footer a:not(.btn):not(.badge):not(.alert-link) {
    color: #d9d9d9;
}

.site-footer a:hover,
.site-footer a:focus {
    color: var(--clr-gold-main, #e0aa3e);
}

/* I titoli di colonna vanno in bianco pieno: erano gia' cosi', ma la
   regola generale li riportava al colore del tema. */
.site-footer .footer-col h4,
.site-footer h4 {
    color: #ffffff;
}

.footer-content-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1.3fr 1fr; /* Colonne bilanciate */
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #222;
}

/* Titoli Footer */
.footer-col h4 {
    color: #FFF;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--clr-gold-main);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 25px;
}

/* --- LISTA ORARI MODERNA --- */
.footer-hours-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-hours-list-modern li {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Allinea in basso per i puntini */
    margin-bottom: 12px;
    padding-bottom: 0;
    position: relative;
    font-size: 0.95rem;
}

/* Nome del giorno */
.footer-hours-list-modern li .day {
    flex-shrink: 0; /* Non si restringe */
    font-weight: 500;
    padding-right: 5px;
    background: #080808; /* Copre i puntini */
    z-index: 1;
}

/* Riga puntinata decorativa */
.footer-hours-list-modern li .dots {
    flex-grow: 1;
    border-bottom: 1px dotted #444;
    margin-bottom: 6px; /* Altezza dei puntini */
    margin-left: 5px;
    margin-right: 5px;
    opacity: 0.5;
}

/* Blocco Orario */
.footer-hours-list-modern li .time {
    flex-shrink: 0;
    text-align: right;
    background: #080808;
    z-index: 1;
    padding-left: 5px;
    font-size: 0.9rem;
}

/* Stile per i turni (Pranzo/Cena) */
.footer-hours-list-modern .shift {
    display: block;
    line-height: 1.2;
}

/* --- EVIDENZIATORE GIORNO CORRENTE (OGGI) --- */
.footer-hours-list-modern li.today {
    color: var(--clr-gold-main); /* Testo ORO */
    font-weight: 700;
    transform: scale(1.02); /* Leggermente piÃ¹ grande */
    transform-origin: left;
}

.footer-hours-list-modern li.today .dots {
    border-bottom-color: var(--clr-gold-main); /* Puntini oro */
    opacity: 1;
}

/* Etichetta CHIUSO */
.closed-shift, .text-danger {
    color: #FF4444 !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- STILI PAGINA CHI SIAMO --- */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.page-header-background {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-header-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
}

.page-header-background .page-title {
    position: relative;
    z-index: 1;
}

.page-header-background h1 {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

.page-header-background .page-subtitle {
    font-size: 1.3rem;
    color: var(--clr-gold-light);
    font-style: italic;
}

.card {
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(224, 170, 62, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(224, 170, 62, 0.2);
}

.card h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--clr-gold-main);
    display: inline-block;
}

.team-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2.5rem;
    text-align: center;
}

.team-member {
    padding: 2rem;
    background: rgba(224, 170, 62, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(224, 170, 62, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-member:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(224, 170, 62, 0.25);
}

.team-member img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    border: 4px solid var(--clr-gold-main);
    box-shadow: 0 0 20px rgba(224, 170, 62, 0.3);
}

.team-member h3 {
    margin-bottom: 0.5rem;
    color: var(--clr-gold-main);
    font-size: 1.4rem;
}

.team-member p {
    margin-top: 0;
    color: #ddd;
    opacity: 0.9;
    font-style: italic;
}

.card p:first-of-type {
    white-space: pre-line;
}

.contact-info {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
}

.contact-info p {
    margin: 1rem 0;
    font-size: 1.05rem;
}

.contact-info p strong {
    color: var(--clr-gold-main);
}

.contact-info a {
    color: var(--clr-gold-light);
    transition: color 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.contact-info a:hover {
    color: var(--clr-gold-main);
    text-decoration: underline;
}

.contact-info i {
    color: var(--clr-gold-main);
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Su smartphone: contact-info centrato, icone allineate, niente testo che esce */
@media (max-width: 576px) {
    .contact-info {
        align-items: center !important;
        text-align: center;
    }
    .contact-info a,
    .contact-info span {
        justify-content: center;
        text-align: center;
        white-space: normal;
    }
    .contact-info i {
        font-size: 1.2rem;
    }
}

.contact-info iframe {
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(224, 170, 62, 0.3);
}

/* --- Responsive per la pagina Chi Siamo --- */
@media (max-width: 768px) {
    .page-header-background {
        height: 300px;
    }
    
    .page-header-background h1 {
        font-size: 2.2rem;
    }
    
    .page-header-background .page-subtitle {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 1.75rem;
    }
    
    .team-container {
        gap: 1.5rem;
    }
}

/* --- LINK & SOCIAL --- */
.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #BBB; transition: 0.3s; }
.footer-links a:hover { color: var(--clr-gold-main); padding-left: 5px; }

.footer-socials a {
    display: inline-flex; width: 40px; height: 40px;
    background: #222; color: #FFF;
    border-radius: 50%;
    align-items: center; justify-content: center;
    margin-right: 10px; transition: 0.3s;
}
.footer-socials a:hover {
    background: var(--clr-gold-gradient);
    color: #000;
    transform: translateY(-3px);
}

/* Background helper per split-image homepage */
.image-vicoli {
    background-image: url('/static/uploads/vicoli_napoli.jpg');
}
#installButton,
.installApkBtn {
    width: 100%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249,115,22,0.4);
}
#installButton:hover,
.installApkBtn:hover { filter: brightness(1.08); }
.install-tab-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    color: #111827;
    border: none;
    border-radius: 20px 0 0 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.install-tab-btn:hover {
  filter: brightness(0.95);
}
.tab-arrow {
  display: inline-block;
  transform: translateX(-2px);
}
/* --- RESPONSIVE FOOTER --- */
@media (max-width: 992px) {
    .footer-content-grid {
        grid-template-columns: 1fr 1fr; /* 2 colonne su tablet */
        gap: 2rem;
    }
}

@media (max-width: 576px) {
    .footer-content-grid {
        grid-template-columns: 1fr; /* 1 colonna su mobile */
        text-align: center;
    }
    
    .footer-col h4 {
        border-bottom: none;
        position: relative;
    }
    .footer-col h4::after { /* Linea centrale su mobile */
        content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
        width: 50px; height: 2px; background: var(--clr-gold-main);
    }

    /* Adatta la lista orari per il centro */
    .footer-hours-list-modern li {
        justify-content: center;
        border-bottom: 1px solid #222;
        padding: 8px 0;
        flex-direction: column; /* Orario sotto il giorno su mobile stretto */
        align-items: center;
    }
    .footer-hours-list-modern li .dots { display: none; } /* Niente puntini su mobile */
}
/* =========================================
   MENU MOBILE PREMIUM (Floating Bar) - FIX ALLINEAMENTO
   ========================================= */
.mobile-nav-premium { display: none; }

@media (max-width: 992px) {
    .mobile-nav-premium {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 94%;
        max-width: 450px;
        height: 70px;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(15px);
        border: 1px solid var(--clr-gold-main);
        border-radius: 40px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
        z-index: 10000;
        padding: 0 10px;
    }

    .nav-list {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .nav-item {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%; /* Forza l'altezza piena per centrare bene */
    }

    .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Centra verticalmente */
        text-decoration: none;
        color: #666;
        font-size: 0.7rem;
        transition: 0.3s;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        width: 100%;
    }

    .icon-box {
        font-size: 1.4rem;
        margin-bottom: 4px; /* Spazio standard tra icona e testo */
        transition: 0.3s;
        color: #666;
        line-height: 1; /* Previene altezze strane */
    }

    /* Le voci non attive del menu mobile devono restare leggibili sul fondo
       scuro. Prima erano grigio scuro (#666): quasi invisibili. Nelle pagine
       con body-dark order.css le schiariva per caso, ma nella home no, e li'
       la barra sembrava vuota. Qui si impone il bianco con !important, cosi'
       vince anche sulle regole "tema scuro" delle pagine (body.body-dark a)
       che altrimenti rendevano scuro/oro il link della barra. */
    .mobile-nav-premium .nav-link,
    .mobile-nav-premium .nav-link .icon-box,
    .mobile-nav-premium .nav-link .nav-text,
    .mobile-nav-premium .nav-link i {
        color: #ffffff !important;
    }

    /* Stato Attivo: piu' specifico, resta oro anche con !important. */
    .mobile-nav-premium .nav-item.active .nav-link,
    .mobile-nav-premium .nav-item.active .nav-link .icon-box,
    .mobile-nav-premium .nav-item.active .nav-link .nav-text,
    .mobile-nav-premium .nav-item.active .nav-link i {
        color: var(--clr-gold-main) !important;
    }
    .nav-item.active .icon-box {
        transform: translateY(-3px);
        text-shadow: 0 0 10px rgba(224, 170, 62, 0.4);
    }

    /* Il bottone centrale "Ordina" ha un cerchio oro: l'icona resta scura. */
    .mobile-nav-premium .nav-item.main-action .nav-link .icon-box.big-icon,
    .mobile-nav-premium .nav-item.main-action .nav-link .icon-box.big-icon i {
        color: #000000 !important;
    }

    /* --- BOTTONE CENTRALE "ORDINA" --- */
    .nav-item.main-action .icon-box.big-icon {
        background: var(--clr-gold-gradient);
        color: #000;
        width: 55px;
        height: 55px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        
        /* 1. Sposta l'icona VISIVAMENTE in alto fuori dal menu */
        transform: translateY(-25px);
        
        /* 2. FIX ALLINEAMENTO TESTO: 
           Il margine negativo riduce lo spazio occupato nel layout,
           tirando il testo "Ordina" verso l'alto per allinearlo agli altri. */
        margin-bottom: -32px; 
        
        box-shadow: 0 0 20px rgba(224, 170, 62, 0.4);
        border: 5px solid var(--clr-bg-dark);
        font-size: 1.5rem;
    }
    
    /* Effetto pulsazione attivo */
    .nav-item.main-action.active .icon-box.big-icon {
        box-shadow: 0 0 30px rgba(224, 170, 62, 0.6);
        transform: translateY(-28px) scale(1.05);
    }
    
    /* Opzionale: ritocco fine per il testo "Ordina" se serve */
    .nav-item.main-action .nav-text {
        position: relative;
        top: 2px; 
    }
}
/* Forza lo sfondo scuro su tutti i contenitori (Card) */
.card, .admin-main-content .card {
    background-color: #111 !important; /* Grigio molto scuro */
    color: #FFFFFF !important;         /* Testo Bianco */
    border: 1px solid #333 !important; /* Bordo sottile */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
}

/* Forza i titoli delle sezioni in Oro */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
    color: var(--clr-gold-main) !important;
}

/* Corregge il testo "muted" (che spesso diventa invisibile su sfondo scuro) */
.card .text-muted, .card small {
    color: #AAA !important; /* Grigio chiaro leggibile */
}

/* Corregge liste e gruppi all'interno delle card */
.list-group-item {
    background-color: #151515 !important;
    color: #FFF !important;
    border-color: #333 !important;
}

/* Corregge lo sfondo delle tabelle se diventano bianche */
.table, .data-table {
    color: #FFF !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: #FFF !important;
}

/* Corregge le righe delle tabelle al passaggio del mouse */
.table-hover > tbody > tr:hover > * {
    color: #FFF !important;
    background-color: rgba(224, 170, 62, 0.1) !important; /* Oro trasparente */
}

/* =========================================
   FIX MODAL DARK MODE (Popup Carello/Personalizza)
   ========================================= */
.modal-content {
    background-color: #111 !important;
    color: #FFF !important;
    border: 1px solid #333 !important;
}

.modal-header, .modal-footer {
    border-color: #333 !important;
}

.modal-title {
    color: var(--clr-gold-main) !important;
}

.modal-body, .modal-body p, .modal-body div {
    color: #FFF !important;
}

/* Assicura che i testi secondari nel modale siano leggibili */
.modal-body .text-muted {
    color: #AAA !important;
}

/* =========================================
   FIX SPAZIO EXTRA FONDO PAGINA (MOBILE)
   ========================================= */
@media (max-width: 992px) {
    body {
        /* Aumentiamo lo spazio in fondo cosÃ¬ il menu fluttuante 
           non copre il copyright o i link del footer */
        padding-bottom: 140px !important; 
    }
}
/* =========================================
   PAGINA PROFILO (STILE LUXURY)
   ========================================= */

/* Griglia Layout Profilo */
.profile-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr; /* Colonna singola su mobile */
    }
}

/* --- CARD LIVELLO FEDELTÃ€ (Il pezzo forte) --- */
.loyalty-level-card {
    text-align: center;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d) !important;
    border: 1px solid var(--clr-gold-dark) !important;
    position: relative;
    overflow: hidden;
}

/* Effetto bagliore dietro l'icona */
.loyalty-level-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.level-icon {
    font-size: 4rem;
    background: var(--clr-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(224, 170, 62, 0.3));
}

.level-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #FFF;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.loyalty-points-display {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.loyalty-points-display span:first-child {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.points-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--clr-gold-main);
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Barra di Progresso Dorata */
.progress-bar-container {
    background-color: #333;
    border-radius: 50px;
    height: 12px;
    width: 100%;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
    border: 1px solid #444;
}

.progress-bar {
    height: 100%;
    background: var(--clr-gold-gradient);
    border-radius: 50px;
    box-shadow: 0 0 10px var(--clr-gold-main);
    transition: width 1s ease-in-out;
}

.progress-text {
    font-size: 0.85rem;
    color: #AAA;
    font-style: italic;
}

/* --- SEZIONE "ORDINA DI NUOVO" --- */
.reorder-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 1rem;
}

.reorder-container .menu-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.reorder-container .menu-item:hover {
    border-color: var(--clr-gold-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.pizza-name-btn {
    color: var(--clr-gold-main);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 5px !important;
}

.reorder-container .ingredienti {
    font-size: 0.8rem;
    color: #999;
    line-height: 1.4;
    margin-bottom: 15px;
    flex-grow: 1; /* Spinge il bottone in fondo */
}

/* Bottone piccolo "Aggiungi" */
.add-to-cart-from-profile {
    background: transparent;
    border: 1px solid var(--clr-gold-main);
    color: var(--clr-gold-main);
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.add-to-cart-from-profile:hover {
    background: var(--clr-gold-main);
    color: #000;
    box-shadow: 0 0 15px rgba(224, 170, 62, 0.4);
}

/* --- LISTA PREMI --- */
.rewards-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rewards-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px dashed #333;
}

.rewards-list li:last-child {
    border-bottom: none;
}

.reward-info strong {
    color: #FFF;
    font-size: 1.1rem;
    display: block;
}

.reward-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #888;
}

/* Bottone Riscatta */
.button-redeem {
    background: var(--clr-gold-dark);
    color: #FFF;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.button-redeem:hover {
    background: var(--clr-gold-main);
    color: #000;
    box-shadow: 0 0 10px var(--clr-gold-main);
}

.button-redeem-disabled {
    background: #222;
    color: #555;
    border: 1px solid #333
}
/* =========================================
   PAGINA ORDINA (RESTYLE LUXURY CINEMATIC)
   ========================================= */

/* --- Header Pagina --- */
.order-header {
    text-align: center;
    padding: 3rem 0 2rem;
    background-color: var(--clr-bg-dark);
    position: relative;
}
.order-header::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100px; height: 3px; background: var(--clr-gold-gradient);
}

.order-header-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--clr-gold-main);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(224, 170, 62, 0.2);
}

.order-header-subtitle {
    color: #888;
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Tabs Categorie (Sticky & Glass) --- */
.category-tabs-container {
    background: rgba(5, 5, 5, 0.95) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding: 15px 0;
    position: sticky;
    top: var(--header-height); /* Si attacca sotto l'header */
    z-index: 900;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

#category-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 20px;
    scrollbar-width: none; /* Firefox */
}
#category-tabs::-webkit-scrollbar { display: none; } /* Chrome */

.category-tab-link {
    background: transparent;
    border: 1px solid #333;
    color: #AAA;
    padding: 10px 25px;
    border-radius: 50px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none;
}

.category-tab-link:hover {
    border-color: var(--clr-gold-main);
    color: #FFF;
    background: rgba(255, 255, 255, 0.05);
}

.category-tab-link.active {
    background: var(--clr-gold-gradient);
    border-color: transparent;
    color: #000; /* Testo nero su oro */
    font-weight: 800;
    box-shadow: 0 0 20px rgba(224, 170, 62, 0.4);
    transform: scale(1.05);
}

/* --- Sezioni Categorie --- */
.menu-category-section {
    margin-bottom: 5rem;
    scroll-margin-top: 180px; /* Offset per lo scroll */
}

.category-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--clr-text-main);
    margin-bottom: 2rem;
    position: relative;
    padding-left: 20px;
    border-left: 4px solid var(--clr-gold-main);
}

/* --- Griglia Prodotti --- */
.menu-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* --- Card Prodotto Luxury --- */
.menu-item-card {
    background: #111; /* PiÃ¹ scuro */
    border: 1px solid #222;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    border-color: rgba(255, 215, 0, 0.4);
}

/* Immagine */
.menu-item-image {
    height: 240px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.menu-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.menu-item-card:hover .menu-item-image img {
    transform: scale(1.12); /* Zoom lento */
}

/* Overlay gradiente sull'immagine per rendere leggibile il testo sopra se necessario */
.menu-item-image::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 40%;
    background: linear-gradient(to top, #111 0%, transparent 100%);
}

/* Dettagli */
.menu-item-details {
    padding: 1.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.menu-item-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #FFF;
    margin: 0 0 0.8rem 0;
    line-height: 1.2;
}

.menu-item-ingredients {
    font-size: 0.95rem;
    color: #999;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 300;
    flex-grow: 1;
}

/* Footer della Card (Prezzo e Azione) */
.menu-item-action {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.2rem;
    border-top: 1px solid #222;
}

.menu-item-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--clr-gold-main);
    text-shadow: 0 0 10px rgba(224, 170, 62, 0.2);
}

/* Bottone "Piglia chist!" */
.add-to-cart-btn {
    background: transparent !important;
    border: 1px solid var(--clr-gold-main) !important;
    color: var(--clr-gold-main) !important;
    padding: 8px 18px !important;
    border-radius: 50px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer;
    transition: 0.3s !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background: var(--clr-gold-main) !important;
    color: #000 !important;
    box-shadow: 0 0 20px rgba(224, 170, 62, 0.5) !important;
    transform: translateY(-2px);
}

.neapolitan-nudge {
    font-family: 'Playfair Display', italic;
    font-size: 0.9rem;
    color: #666;
    margin-right: 15px;
}

/* --- Cart Summary Footer (Barra Fluttuante) --- */
.cart-summary-footer {
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--clr-gold-dark);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border-radius: 100px; /* Pillola perfetta */
    padding: 12px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 350px;
    max-width: 90%;
    width: auto;
    z-index: 9000;
}

.cart-summary-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

#cart-item-count {
    font-size: 0.75rem;
    color: #AAA;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#cart-total-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFF;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-checkout {
    background: var(--clr-gold-gradient);
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(224, 170, 62, 0.3);
}

.btn-checkout:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 30px rgba(224, 170, 62, 0.6);
    background: #FFF; /* Diventa bianco al passaggio */
}

/* --- Mobile Responsive --- */
@media (max-width: 992px) {
    .cart-summary-footer {
        bottom: 110px !important; /* Sopra al menu di navigazione mobile */
        width: 94%;
        padding: 10px 20px;
    }
    
    .menu-items-grid {
        grid-template-columns: 1fr; /* Card a tutta larghezza su mobile */
    }
    
    .menu-item-image {
        height: 260px; /* Immagini grandi e impattanti */
    }
    
    .category-title {
        text-align: center;
        border-left: none;
        border-bottom: 2px solid var(--clr-gold-main);
        display: inline-block;
        padding: 0 10px 5px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .neapolitan-nudge {
        display: none; /* Nascondi frase su mobile per spazio */
    }
    
    .order-header-title {
        font-size: 2.2rem;
    }
}
/* =========================================
   PAGINA PRENOTA (LUXURY RESTYLE)
   ========================================= */

.booking-page-bg {
    /* Immagine di sfondo scura ed elegante */
    background: url('/static/uploads/sfondo_prenota.jpg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 80px; /* Spazio per header */
    position: relative;
}

/* ---- Booking form (prenota): leggibilita campi scuri ---- */
.booking-page-bg .booking-glass-card .booking-form input,
.booking-page-bg .booking-glass-card .booking-form select,
.booking-page-bg .booking-glass-card .booking-form textarea {
    background-color: rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    border-color: rgba(255, 215, 0, 0.25) !important;
}
.booking-page-bg .booking-glass-card .booking-form input::placeholder,
.booking-page-bg .booking-glass-card .booking-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}
/* l'orario selezionato resta leggibile anche "chiuso" sulla scheda scura */
.booking-page-bg .booking-glass-card .booking-form option:checked {
    color: #ffffff !important;
    background-color: #1f2937 !important;
}
/* l'elenco aperto degli orari resta scuro su fondo bianco */
.booking-page-bg .booking-glass-card .booking-form option {
    color: #212529 !important;
    background-color: #ffffff !important;
}
.booking-page-bg::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1;
}

.booking-glass-card {
    position: relative; z-index: 2;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.2); /* Bordo Oro Sottile */
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 650px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.booking-title {
    font-family: 'Playfair Display', serif;
    color: var(--clr-gold-main);
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(224, 170, 62, 0.3);
}

.gold-divider {
    width: 80px;
    height: 3px;
    background: var(--clr-gold-gradient);
    border-radius: 2px;
}

.booking-subtitle {
    color: #AAA;
    font-size: 1rem;
    font-weight: 300;
}

/* --- INPUT FIELDS DI LUSSO --- */
.input-group-luxury {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group-luxury label {
    color: var(--clr-gold-main);
    /* Etichette un po' piu' grandi e marcate: prima erano 0.8rem e poco
       leggibili sulle schede scure del form di prenotazione. */
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 5px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    /* Il form di prenotazione sta su una scheda scura: #666 era quasi
       invisibile. Un grigio chiaro resta leggibile e diventa oro al focus. */
    color: #a7adb5;
    transition: 0.3s;
    z-index: 2;
    /* L'icona non deve rubare il tocco al campo sottostante (mobile). */
    pointer-events: none;
    /* Larghezza fissa: resta allineata anche su campi stretti. */
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.textarea-icon {
    top: 20px; /* Per le textarea l'icona sta in alto */
}

/* Il campo telefono apre con il selettore del prefisso. Su smartphone
   mobile.css impila il gruppo (flex-direction:column !important) e l'icona
   finiva "a metà" tra selettore e numero. Qui prefisso e numero restano
   sulla stessa riga, con lo spazio a sinistra per l'icona. */
@media (max-width: 767.98px) {
    .booking-form .input-wrapper .input-group {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding-left: 40px !important;
    }
    .booking-form .input-wrapper .input-group > * {
        width: auto !important;
        margin-bottom: 0 !important;
    }
    .booking-form .input-wrapper .input-group > select {
        flex: 0 0 auto !important;
        max-width: 46% !important;
    }
    .booking-form .input-wrapper .input-group > input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    /* mobile.css azzera il padding dei campi ("padding: 10px 12px !important")
       e nei campi con icona (nome, email) il testo finiva SOTTO l'icona:
       e' l'"icona fuori posto" segnalata su smartphone. Si ripristina lo
       spazio a sinistra per l'icona. */
    .booking-form .input-wrapper > .form-control {
        padding-left: 44px !important;
    }
    .input-icon {
        left: 12px;
    }
}

/* Stile Input */
.booking-form .form-control {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid #333 !important;
    color: #FFF !important;
    padding: 15px 15px 15px 45px; /* Spazio a sinistra per l'icona */
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* Focus Input */
.booking-form .form-control:focus {
    background-color: #000 !important;
    border-color: var(--clr-gold-main) !important;
    box-shadow: 0 0 0 3px rgba(224, 170, 62, 0.2) !important;
}

/* --- TENDINE DEL FORM (es. "Orario") ---
   Le <option> native venivano disegnate dal browser su fondo bianco ma
   ereditavano il testo bianco del campo scuro: restavano BIANCHE su
   BIANCO, quindi l'elenco degli orari sembrava vuoto. Qui si forza
   testo scuro su fondo bianco per tutte le voci. */
.booking-form option {
    color: #111111 !important;
    background-color: #ffffff !important;
}

/* --- MESSAGGI DI AVVISO / ERRORE ---
   Il messaggio del telefono (numero mancante o sbagliato) era grigio
   scuro (colore Bootstrap .form-text) sulla scheda scura del form:
   praticamente illeggibile. Un ambra caldo lo rende ben visibile. */
#telefono-avviso,
.booking-glass-card .form-text,
.booking-glass-card .invalid-feedback {
    color: #ffd166 !important;
    font-size: 0.92rem !important;
    font-weight: 600;
}

/* Testo dei campi un po' piu' grande e leggibile su schermo. */
.booking-form .form-control {
    font-size: 1.04rem;
}

/* Colora l'icona quando l'input Ã¨ in focus */
.booking-form .form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--clr-gold-main);
    text-shadow: 0 0 5px var(--clr-gold-main);
}

/* Nel campo Telefono il gruppo inizia col selettore "+39": l'icona assoluta
   non deve sovrapporsi al testo del prefisso. Si lascia spazio a sinistra
   così l'icona resta allineata alla riga del campo, davanti al selettore. */
.booking-form .input-wrapper .input-group {
    padding-left: 44px;
}

/* --- BOTTONE --- */
.btn-booking-submit {
    background: var(--clr-gold-gradient) !important;
    color: #000 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    border: none;
    margin-top: 10px;
    box-shadow: 0 5px 20px rgba(224, 170, 62, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-booking-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(224, 170, 62, 0.4);
    background: #FFF !important; /* Diventa bianco in hover */
}

/* Responsive */
@media (max-width: 768px) {
    .booking-glass-card {
        padding: 2rem 1.5rem;
    }
    .booking-title {
        font-size: 2.2rem;
    }
}
/* =========================================
   POPUP INGREDIENTI (LUXURY STYLE)
   ========================================= */

/* --- Contenitore Modale --- */
#customizeModal .modal-content {
    background-color: #0F0F0F; /* Nero profondo */
    border: 1px solid var(--clr-gold-main); /* Bordo Oro */
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    border-radius: 16px;
}

#customizeModal .modal-header {
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding: 1.5rem;
}

#customizeModal .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--clr-gold-main);
    text-shadow: 0 0 10px rgba(224, 170, 62, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#customizeModal .modal-footer {
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    padding: 1.5rem;
    background-color: #0A0A0A;
}

/* --- Titoli Sezioni (Base / Extra) --- */
.customize-section-title {
    color: #FFF;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--clr-gold-dark);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
    margin-top: 10px;
}

/* --- Lista Ingredienti --- */
.customize-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Spinge il prezzo a destra */
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.03); /* Leggero stacco */
    border: 1px solid #222;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.customize-item:hover {
    background-color: rgba(255, 215, 0, 0.05); /* Hover dorato */
    border-color: rgba(255, 215, 0, 0.3);
}

/* --- Checkbox Personalizzata (Oro) --- */
.customize-item .form-check-input {
    background-color: #222;
    border: 1px solid #555;
    width: 1.3em;
    height: 1.3em;
    margin-right: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.customize-item .form-check-input:checked {
    background-color: var(--clr-gold-main);
    border-color: var(--clr-gold-main);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"); /* Spunta Nera */
}

.customize-item .form-check-label {
    color: #DDD;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    flex-grow: 1; /* Occupa lo spazio centrale */
}

/* --- Prezzo Ingrediente --- */
.customize-item-price {
    color: var(--clr-gold-main);
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 60px;
    text-align: right;
}

/* --- Totale nel Footer --- */
#customize-modal-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--clr-gold-main);
    text-shadow: 0 0 15px rgba(224, 170, 62, 0.4);
    margin-left: 10px;
}

.modal-footer strong {
    color: #FFF;
    font-size: 1.1rem;
    text-transform: uppercase;
}
/* =========================================
   FIX DEFINITIVO SOVRAPPOSIZIONE (Z-INDEX)
   ========================================= */

/* 1. Menu Mobile: Abbassiamo il livello */
@media (max-width: 992px) {
    .mobile-nav-premium {
        z-index: 2000 !important; /* Sopra il sito, ma sotto i modali */
    }
}

/* 2. Modali (Ingredienti, Carrello, ecc.): Alziamo il livello SOPRA ogni elemento (barra carrello Ã¨ 9000) */
.modal-backdrop {
    z-index: 90000 !important; /* Velo scuro */
}
.modal {
    z-index: 90001 !important; /* Il popup vero e proprio */
}

/* Forza la scomparsa definitiva della sezione Ingredienti Base */
#customize-base-ingredients, 
#customize-modal-body h6.customize-section-title:first-of-type {
    display: none !important;
}

/* 3. Avvisi di Conferma (SweetAlert): Sopra a tutto */
div:where(.swal2-container) {
    z-index: 100000 !important; 
}

/* =========================================
   CHECKOUT PAGE LUXURY FIX (WHITE FONTS)
   ========================================= */
.checkout-container, 
.checkout-container h1, 
.checkout-container h5, 
.checkout-container .form-label, 
.checkout-container .form-check-label,
.checkout-container .summary-list span,
.checkout-container .summary-list strong:not(.text-primary):not(.text-success),
.checkout-container .card-header h5 {
    color: #FFFFFF !important;
}

.checkout-container .form-text, 
.checkout-container .text-muted {
    color: #CCCCCC !important; /* Grigio chiaro per sottotitoli */
}
/* =========================================
   CHECKOUT SU TELEFONO: I PULSANTI ESCEVANO
   =========================================
   Bootstrap mette white-space:nowrap sui .btn. Le etichette lunghe
   ("Invia Ordine (Paga in cassa/consegna)") non andavano a capo e il
   pulsante finiva piu' largo dello schermo: a 360px era largo 403px, e il
   main lo tagliava con overflow-x:hidden, quindi una parte del pulsante
   restava fuori schermo e non si poteva premere.
   ========================================= */
@media (max-width: 520px) {
    .checkout-container .d-grid > .btn,
    .checkout-container .btn-lg {
        white-space: normal;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        line-height: 1.3;
    }
}

/* =========================================
   FIX MODAL DARK MODE (Popup Carello/Personalizza)
   ========================================= */
.modal-content {
    background-color: #111 !important;
    color: #FFF !important;
    border: 1px solid #333 !important;
}
.modal-header, .modal-footer {
    border-color: #333 !important;
}
.modal-title {
    color: var(--clr-gold-main) !important;
}
.modal-body, .modal-body p, .modal-body div {
    color: #FFF !important;
}
.modal-body .text-muted {
    color: #AAA !important;
}

/* =========================================
   TIMELINE TRACKER STYLES (For Popup & Track Page)
   ========================================= */
.tracker-container {
    position: relative;
    margin: 20px 0 30px;
    padding: 0 10px;
}
.tracker-progress-bar {
    position: absolute;
    top: 25px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--clr-border, #333);
    z-index: 0;
    border-radius: 4px;
}
.tracker-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.step {
    text-align: center;
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.step-icon {
    width: 50px; height: 50px;
    background-color: var(--clr-bg-panel, #111);
    border: 2px solid var(--clr-border, #333);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--clr-text-muted, #aaa);
    font-size: 1.2rem;
    transition: all 0.4s ease;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.step-label {
    font-size: 0.7rem;
    color: var(--clr-text-muted, #aaa);
    font-weight: 500;
    transition: color 0.3s;
}

/* Stato Attivo */
.step.active .step-icon {
    background-color: #F76B1C; /* Brand Orange */
    border-color: #F76B1C;
    color: white;
    box-shadow: 0 0 15px rgba(247, 107, 28, 0.6);
    transform: scale(1.1);
}
.step.active .step-label {
    color: var(--clr-text-main, #fff);
    font-weight: bold;
}
/* Animazione pulsante per lo stato corrente */
.step.active:last-child .step-icon {
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(247, 107, 28, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(247, 107, 28, 0); }
    100% { box-shadow: 0 0 0 0 rgba(247, 107, 28, 0); }
}

/* Nascondi label su mobile se troppo stretto, ma Swal Ã¨ largo */
@media (max-width: 400px) {
    .step-label { display: none; }
}

/* --- Admin Layout Reset --- */
body.admin-page {
    display: block !important;
    flex-direction: initial !important;
    padding-top: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* --- Admin Button Styles --- */
body.admin-page input,
body.admin-page select,
body.admin-page textarea {
    background-color: var(--clr-bg-panel);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-main);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

body.admin-page input:focus,
body.admin-page select:focus,
body.admin-page textarea:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(247, 107, 28, 0.2);
    background-color: var(--clr-bg-panel);
}

body.admin-page label {
    color: var(--clr-text-muted);
    font-size: 0.75rem;
}

.button-add-new {
    float: right;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    background-image: none;
    background-color: var(--clr-primary);
    box-shadow: 0 2px 6px rgba(247, 107, 28, 0.25);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button-add-new:hover {
    background-color: var(--clr-accent);
    box-shadow: 0 4px 10px rgba(247, 107, 28, 0.35);
    transform: translateY(-1px);
}

body.admin-page .card-header .button-add-new,
body.admin-page .card h2 .button-add-new {
    margin-top: -0.3rem;
}

.reorder-handle {
    cursor: grab;
    color: var(--clr-text-muted);
    opacity: 0.5;
    transition: all 0.15s ease-in-out;
    padding: 0 0.5rem;
}

.reorder-handle:hover {
    opacity: 1;
    color: var(--clr-text-main);
}

.sortable-ghost {
    opacity: 0.4;
    background-color: var(--clr-primary);
    border-radius: var(--border-radius);
}

.checkbox-group {
    margin: 0.5rem 0 1.5rem 0;
    padding: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    display: inline-block;
    width: auto;
    margin-right: 0.5rem;
    vertical-align: middle;
    height: 16px;
    width: 16px;
    accent-color: var(--clr-primary);
    cursor: pointer;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    vertical-align: middle;
    font-weight: normal;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.88rem;
    text-transform: none;
    letter-spacing: 0;
}

.stats-container-new { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 1.5rem; 
}

.stat-card-new {
    background-color: var(--clr-bg-panel);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--clr-border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.15s ease-in-out;
}

@keyframes slideUpFade {
  0%   { opacity: 0; transform: translate(-50%, 40px); }
  100% { opacity: 1; transform: translate(-50%, 0);    }
}


/* ================ FIX SPAZIO NERO IN ALTO POS (tutte le pagine moduli / cassa / agenda) ================ */

/* ------------------------------------------------------------------
   I DUE CONTENITORI NON DEVONO SCORRERE
   ------------------------------------------------------------------
   .pos-container e .pos-content avvolgono tutta la pagina, ma il loro
   contenuto e' di solito piu' basso di loro: si dichiaravano scorrevoli
   con ZERO pixel da scorrere.

   Il gesto che parte sopra di loro (due dite, rotellina) veniva
   consegnato a .pos-content, non poteva scorrere, e moriva li' senza
   arrivare alla pagina, che aveva spazio libero. Per questo scorrere
   funzionava dalla barra laterale, che e' un elemento fisso e non
   intercetta niente, e non funzionava dal contenuto.

   Qui si scrive overflow: visible perche' questo file e' l'ultimo
   stylesheet caricato: e' quello che vince, e quindi quello che
   deve portare la correzione. La cassa mantiene il proprio scroll
   interno grazie alle regole su #pos-interface piu' in basso. */
html body .pos-container,
html body .pos-content {
    overflow: visible !important;
}

/* 1) Elimina doppi safe-area su body/html (il safe-area va applicato SOLO alla navbar/header, MAI ai wrapper flex) */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}
/* 2) pos-container: TORNA a flex verticale semplice. NO width:100vw NO padding-top safe-area (lo fa la nav). */
.pos-container {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;   /* iPhone Safari dynamic viewport (evita spazio nero tastiera) */
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    /* Qui c'era 'none !important'. Il body tratteneva il gesto di
       scorrimento e non lo passava alla pagina: per questo dalle
       barre laterali si scorreva e dal contenuto no, e la tastiera
       (che va dritta al documento) funzionava. La protezione dal
       rimbalzo su iPhone e' gia' gestita altrove, nel blocco
       @supports dedicato ai dispositivi Apple. */
    overscroll-behavior-y: auto !important;
    box-sizing: border-box !important;
}
.pos-container::before, .pos-container::after { display: none !important; }
.pos-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
/* 3) pos-header: se display:none -> height 0 padding 0 margin 0 (non occupa spazio!) */
.pos-header {
    margin: 0 !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
}
.pos-header[style*="display: none"],
.pos-header[style*="display:none"],
body.has-global-nav .pos-header {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    visibility: collapse !important;
    overflow: hidden !important;
}
/* 4) GLOBAL NAV (.pos-nav-global) height 62px fixed top 0 -> body DEVE avere padding-top 62px has-global-nav class.
      Se la nav non c'e' (display:none) -> annulla padding. */
body.has-global-nav {
    padding-top: 62px !important;
}
body.has-global-nav .pos-nav-global[style*="display: none"],
body.has-global-nav .pos-nav-global[style*="display:none"] {
    display: none !important;
}
/* Safe-area iPhone: applicato solo a pos-nav-global e pos-header (mai a body wrapper) */
.pos-nav-global {
    padding-top: max(0px, env(safe-area-inset-top)) !important;
    height: calc(62px + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(62px + env(safe-area-inset-top, 0px)) !important;
}
body.has-global-nav {
    padding-top: calc(62px + env(safe-area-inset-top, 0px)) !important;
}
/* 5) Se pos-header E' visibile (no global nav): safe-area su di esso + padding-top body = sua height */
body:not(.has-global-nav) .pos-header {
    padding-top: max(0px, env(safe-area-inset-top)) !important;
    min-height: calc(50px + env(safe-area-inset-top, 0px)) !important;
}
/* 6) Mobile <768px: forziamo un reset di qualsiasi padding-top body/pos-container che mobile.css L56 e style.css 1499 avevano aggiunto */
@media (max-width: 991.98px) {
    html, body { padding-top: 0 !important; padding-bottom: 0 !important; padding-left: env(safe-area-inset-left, 0) !important; padding-right: env(safe-area-inset-right, 0) !important; }
    .pos-container { padding-top: 0 !important; margin-top: 0 !important; }
    .pos-content { padding-top: 0 !important; margin-top: 0 !important; }
    body.has-global-nav { padding-top: calc(62px + env(safe-area-inset-top, 0px)) !important; }
    /* RIMOSSO (fix vuoto 50px mobile): padding-top body calc(50px+env) per "pos-header visibile" spingeva pos-container in basso.
       .pos-header e' in-flow (flex:0 0 auto): non serve compensazione; gli header gestiscono safe-area internamente. */
}
/* 7) Nasconde container "in passo" (centrato non forzato) che appare se c'e' width 100vw > 100% */
.pos-container, .pos-content, .pos-header, main, section, article {
    box-sizing: border-box !important;
}
body > * { box-sizing: border-box !important; }
/* ================ /FINE FIX SPAZIO NERO ================ */

/* ================ FIX SPAZIO SOPRA POS-CONTAINER + LINEA NERA + HP-MAIN LAYOUT ================ */
/* 9) ELIMINA SPAZIO VUOTO / NERO SOPRA pos-container (cassa, agenda, tavoli, tutte le pagine):
      - nessun margin-top/padding-top stray su pos-container e pos-content
      - box-sizing: border-box OBBLIGATORIO
      - overflow-x: hidden (nessuna scrollbar orizzontale = nessuna banda nera dx) */
html, body, .pos-container, .pos-content, main {
    background-clip: padding-box !important;
}
.pos-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    background-color: var(--bg-body, #f8f9fa) !important;
}
.pos-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.pos-header, .pos-nav-global {
    margin-top: 0 !important;
    top: 0 !important;
}

/* 10) FIX HP-MAIN / SIDEBAR: le pagine "Dashboard Staff" / "Sistema" / "Agenda" hanno la sidebar in testa (orizzontale fixed top=62px), NON sinistra verticale.
       Quindi .hp-main deve avere margin-left: 0 e padding-top corretto (solo 72px per lasciare spazio alla nav orizzontale).
       MA se in futuro c'e' una sidebar LEFT VERTICALE fixed/absolute width>240px: padding-left automatico.
       Inoltre: ELIMINIAMO la linea NERA tra .sidebar e .hp-main / .pos-content. */
.hp-main, .pos-main {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background-color: inherit !important;
    border: 0 !important;
    outline: 0 !important;
}
.pos-sidebar, aside.pos-sidebar, #pos-sidebar {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: 0 2px 16px rgba(15,23,42,0.08) !important;
}
/* Nessun gap/bordo nero tra sidebar e contenuto: stesso bg */
body > .pos-sidebar + .pos-content,
body > .pos-sidebar + .hp-main,
body > .pos-sidebar + main {
    border-left: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}
/* Safe-area LEFT/RIGHT: NON aggiunto a wrapper ma solo a sidebar/header/footer per evitare bande nere laterali */
html, body, .pos-container, .pos-content, .hp-main {
    background-image: none !important;
    background-repeat: no-repeat !important;
}
/* iPhone iPad iOS: background viewport uniforme (no bande nere top/bottom) */
@supports (-webkit-touch-callout: none) {
    html, body, .pos-container {
        background-color: var(--bg-body, #ffffff) !important;
    }
}
/* ================ /FIX SPAZIO SOPRA + LINEA NERA ================ */

/* =========================================================
   CONTRAST NORMALIZE â€” previene bianco-su-bianco / nero-su-nero
   NB: il colore del testo NON usa !important.
   Con !important su selettori di taglio (p, div, h3, span...) questa regola
   vinceva su TUTTE le regole di classe dei componenti (.menu-item-name{color:#fff},
   .menu-item-price{color:var(--clr-gold-main)}, .category-tab-link, ...) e il testo
   diventava illeggibile sulle sezioni a fondo scuro (menu, footer, navbar, modali).
   Senza !important la specificita' naturale (0,0,1) fa vincere la classe del
   componente (0,1,0), mentre gli elementi senza colore esplicito continuano a
   usare il tema: la protezione richiesta resta, gli override dei componenti no.
   ========================================================= */
html, body, .pos-container, .hp-main, .pos-main { background-color: var(--bg-body,#f8f9fa) !important; }
p, span, div, h1, h2, h3, h4, h5, h6, label, li, a:not(.btn):not(.badge):not(.alert-link),
th, td, caption, dt, dd, figcaption, small, strong, em, b, i, u {
  color: var(--text-main,#212529);
}
.text-muted, .muted, small { color: var(--text-muted,#6c757d) !important; }
/* Form inputs: always readable (no transparent/inherited)
   Le caselle e i radio restano fuori: questa regola ha il !important e,
   applicandosi anche a loro, cancellava lo sfondo e lo spuntone, e la
   casella spuntata risultava identica a quella vuota. */
input:not([type="checkbox"]):not([type="radio"]),
select, textarea, option, optgroup, datalist {
  background-color: var(--input-bg,#ffffff) !important;
  color: var(--text-main,#212529) !important;
  border-color: var(--input-border,#ced4da) !important;
}
input::placeholder, textarea::placeholder { color: var(--text-muted,#6c757d) !important; opacity: 1; }
/* Tables + striped */
table, .table, .table > :not(caption) > * > * {
  color: var(--text-main,#212529) !important;
  background-color: transparent;
  border-color: var(--border-color,#dee2e6) !important;
}
.table > tbody > tr:nth-of-type(even) { background-color: var(--table-stripe,#f2f2f2) !important; }
/* Cards / panels inherit */
.card, .card-header, .card-body, .card-footer, .modal, .modal-content, .modal-header, .modal-body, .modal-footer,
.offcanvas, .list-group-item { color: var(--text-main,#212529); }
/* BUTTONS + BADGES + ALERTS excluded: Bootstrap/Tailwind handles them. */

/* ---------- DARK MODE OVERRIDE (system prefers-color-scheme) ---------- */

/* ---------- SAFARI iOS: force bg + contrast (no banda nera / testo sbiadito) ---------- */
@supports (-webkit-touch-callout: none) {
  html, body { background-color: var(--bg-body,#ffffff) !important; color: var(--text-main,#0f172a) !important; }
}
/* ---------- PRINT: reset for receipts ---------- */
@media print {
  html, body, .pos-container { background-color: #ffffff !important; color: #000000 !important; }
  table, .table, th, td, p, span, div, h1, h2, h3, h4, h5, h6 { color: #000000 !important; background-color: #ffffff !important; }
}
/* ================ /CONTRAST NORMALIZE ================ */
/* ================ MOBILE SAFE AREA + POPUP FIX ================ */
html, body { min-height: 100dvh; }
#posLockOverlay {
    padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 20px) !important;
    min-height: 100dvh !important;
}
.modal, .modal-dialog, .modal-backdrop, .offcanvas-backdrop {
    --bs-modal-zindex: 10550;
}
div:where(.swal2-container) {
    z-index: 13000 !important;
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
}
div:where(.swal2-container) .swal2-popup {
    width: min(32em, calc(100vw - 20px)) !important;
    max-height: 88dvh !important;
    overflow-y: auto !important;
}
@media (max-width: 576px) {
    .modal, .modal-dialog { max-width: calc(100vw - 16px); margin: 0.5rem auto; }
    /* Qui il popup restava bloccato e la pagina non si poteva piu' usare.
       Il motivo: mobile.css, sotto i 768px, vuole il popup a tutto
       schermo (min-height 100dvh), mentre qui sotto gli si imponeva
       anche un max-height piu' piccolo. In CSS min-height vince su
       max-height, quindi il contenuto spillava sotto il bordo schermo
       e il bottone in fondo finiva fuori: sull'iPhone non si poteva
       premere e non c'era modo di scorrere per arrivarci, perche' la
       pagina dietro resta bloccata.
       Ora il popup e' a tutto schermo come vuole mobile.css, con la
       parte centrale che scorre e il bottone sempre in vista. */
    .modal-dialog-centered { min-height: 0; }
    .modal-content {
        border-radius: 14px;
        min-height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
    }
    .modal-content > .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
        min-height: 0;
    }
    .modal-content > .modal-footer { flex: 0 0 auto; }
}
@supports (-webkit-touch-callout: none) {
    .sala-phone-view, .pos-container, .hp-main {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}
/* ================ PAGES HARDENING: Header scuri / Container scroll / Badge colori ================ */
/* Queste regole hanno selettori PIU SPECIFICI di Contrast Normalize (classi .nomi-header *) quindi vincono !important
   senza intaccare il resto. Risolve testo nero su header con sfondo scuro e pagine che non scrollano. */

/* Clienti module layout + pages */
.extras-ui .extras-ui__header *,
.extras-ui > .d-flex > .shadow-sm *,
.client-module-content .card-header *,
.client-module-content .card-title { color: #212529 !important; }

.extras-ui .extras-ui__header,
.extras-ui > .d-flex > .shadow-sm {
    background-color: var(--bg-body,#ffffff) !important;
    background-image: none !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}
.extras-ui > .d-flex > .shadow-sm h2,
.extras-ui > .d-flex > .shadow-sm h3,
.extras-ui > .d-flex > .shadow-sm p,
.extras-ui > .d-flex > .shadow-sm .fa-users { color: #212529 !important; }

.client-module-content,
.clienti-orders-root, .anag-root,
.usl-root, .udd-root, .sys-root, .agenda-container,
.pos-content {
    overflow-y: auto !important;
    min-height: calc(100dvh - 0px) !important;
    height: auto !important;
    padding-bottom: calc(48px + env(safe-area-inset-bottom)) !important;
}
.card-body.p-0, .card-body, .card, .table-responsive {
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Badge colors: garanzia contrasto sempre leggibile */
.bg-primary,.bg-success,.bg-danger,.bg-secondary,.bg-info { color: #ffffff !important; }
.bg-warning,.bg-light.text-dark,.bg-warning.text-dark,.bg-info.text-dark { color: #212529 !important; }
.badge { font-weight: 700 !important; }

/* Testo tabelle sempre scuro su light + corretto dark-mode */
table.table, table.table th, table.table td { color: #212529 !important; }
.text-main-theme { color: #212529 !important; }
.text-muted-theme, .text-muted { color: #6c757d !important; }
.text-blue { color: #0b5ed7 !important; }
.text-primary { color: #0d6efd !important; }
.text-success { color: #198754 !important; }

/* FullCalendar contrast hardening (tutte le pagine che lo usano) */
.fc .fc-toolbar-title, .fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number,
.fc .fc-list-event-title, .fc .fc-timegrid-slot-label-cushion { color: #212529 !important; }
.fc .fc-button-primary { color: #ffffff !important; }

/* ========== POPUP ALTRO / MODULI (flyout) + Icone / Fonti PIÃ™ GRANDI + retro scuro ========== */
.hp-fly-backdrop {
    background-color: rgba(0, 0, 0, 0.82) !important;
    backdrop-filter: blur(6px) !important;
    opacity: 1 !important;
}
.altro-pop, .moduli-pop {
    width: min(720px, calc(100vw - 24px)) !important;
    max-width: 96vw !important;
    padding: 0 !important;
    border-radius: 18px !important;
    background-color: #ffffff !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35) !important;
    color: #212529 !important;
}

.altro-pop.open, .moduli-pop.open {
    transform: translate(-50%, 0) scale(1) !important;
    top: calc(env(safe-area-inset-top) + 20px) !important;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px) !important;
    overflow-y: auto !important;
}
.hp-fly-head h4 {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    padding: 14px 18px !important;
    margin: 0 !important;
    color: #111827 !important;
}

.hp-fly-close {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    font-size: 18px !important;
    display: inline-flex !important;
    align-items: center; justify-content: center;
    margin-right: 12px !important;
}
.altro-grp { padding: 6px 16px 20px !important; }
.altro-grp .ag-tit {
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    letter-spacing: 1.4px !important;
    color: #6b7280 !important;
    padding: 16px 4px 10px 4px !important;
}
.altro-pop .ag-item, .moduli-pop .ag-item {
    min-height: 74px !important;
    padding: 14px 16px !important;
    font-size: 1.08rem !important;
    font-weight: 600 !important;
    border-radius: 14px !important;
    gap: 14px !important;
    color: #111827 !important;
}

.altro-pop .ag-item i, .moduli-pop .ag-item i {
    font-size: 26px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center; justify-content: center;
}
.altro-pop .ag-item span, .moduli-pop .ag-item span {
    font-size: 1rem !important;
}

/* Homepage mo-launch (moduli) icone/fonti piu grandi */
.mo-launch {
    max-width: 720px !important;
    width: min(720px, 100% - 20px) !important;
}
.mo-launch .mo-item {
    min-height: 84px !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 16px !important;
}
.mo-launch .mo-item i {
    font-size: 28px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
}
.mo-launch .mo-item .mo-lbl { font-size: 18px !important; line-height: 1.2; }

/* iOS banda nera + safe area ripetizione sicura */
@supports (-webkit-touch-callout: none) {
    html, body, .extras-ui > .d-flex,
    .usl-root, .udd-root, .sys-root, .agenda-container,
    .anag-root, .clienti-orders-root {
        background-color: #ffffff !important;
    }
    .altro-pop.open, .moduli-pop.open {
        top: calc(env(safe-area-inset-top) + 10px) !important;
    }
}

/* ==========================================================================
   V3.2: GLOBAL PAGES CONTRAST & SCROLL HARDENING (50+ pagine Moduli/Menu/Cliente/Report/Config/Extra)
   ========================================================================== */
html, body, body * {
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
}
/* NB: .pos-container / .pos-content NON devono ricevere min-height:0.
   Il contenitore POS e' un flex column che deve occupare almeno lo schermo
   (min-height:100dvh dichiarato piu' sopra in questo file). Con
   "min-height:0 !important" questa regola, essendo l'ULTIMA del file, vinceva
   per ordine di cascata e annullava il min-height: il risultato era la pagina
   cassa compressa a ~80px (solo la navbar visibile, tutto il resto dentro un
   box con scroll interno). Per i container si lascia il min-height ereditato
   dalle regole specifiche; min-height:0 resta per le card/tabelle .h-100. */
html, body, main, .extras-ui,
.card.h-100, .card.d-flex, .container-fluid > .d-flex.h-100,
.d-flex.h-100, .h-100.bg-body, body > .h-100 {
    height: auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: none !important;
}
/* Tutte le pagine / card / tabelle: COLORE SFONDO CHIARO + TESTO SCURO SEMPRE
   (non dipendiamo piÃ¹ da variabili CSS che possono essere sovrascritte) */
    .extras-ui,
    .extras-ui > .d-flex,
    .extras-ui .client-module-content,
    .extras-ui .card,
    .extras-ui .card-header,
    .extras-ui .card-body,
    .extras-ui .card-footer,
    .extras-ui .card .card-title,
    .extras-ui .card .card-subtitle,
    .extras-ui .list-group-item,
    .extras-ui .page-header,
    .extras-ui .page-header h1,
    .extras-ui .page-header h2,
    .extras-ui .page-header h3,
    .extras-ui .ph-title,
    .extras-ui .rc-title,
    .extras-ui .rc-desc,
    .extras-ui .report-card,
    .extras-ui .report-card *,
    .extras-ui .bg-panel-theme,
    .extras-ui .bg-panel-theme *,
    .extras-ui .modal-header,
    .extras-ui .modal-body,
    .extras-ui .modal-footer,
    .extras-ui .offcanvas-header,
    .extras-ui .offcanvas-body,
    .extras-ui .form-label,
    .extras-ui .form-text,
    .extras-ui .form-check-label,
    .extras-ui .breadcrumb-item,
    .extras-ui .breadcrumb-item a,
    .extras-ui .dropdown-menu,
    .extras-ui .dropdown-item,
    .extras-ui .nav-tabs .nav-link,
    .extras-ui .table > caption,
    .extras-ui .table > thead,
    .extras-ui .table > tbody,
    .extras-ui .table > tfoot,
    .extras-ui .table > :not(caption) > * > th,
    .extras-ui .table > :not(caption) > * > td {
    background-color: #ffffff !important;
    color: #0f172a !important;
}
.dropdown-divider, .dropdown-header { background-color: #e5e7eb !important; color: #374151 !important; }
.nav-tabs .nav-link.active {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
    border-bottom: 3px solid #16a34a !important;
}
/* Badge e pulsanti con sfondo colorato: testo SEMPRE bianco o scuro a seconda
   (evitiamo i text-invisible su btn-primary verde/rosso/blu) */
.btn-primary, .btn-primary *,
.btn-success, .btn-success *,
.btn-danger, .btn-danger *,
.btn-info:not(.text-dark),
.btn-warning.btn-dark,
.badge.bg-primary, .badge.bg-success, .badge.bg-danger, .badge.bg-info,
.bg-primary, .bg-success, .bg-danger,
.badge.text-bg-primary, .badge.text-bg-success, .badge.text-bg-danger,
.alert-success, .alert-danger, .alert-info, .alert-primary,
.toast:not(.bg-dark) .toast-header strong {
    color: #ffffff !important;
}
.btn-warning, .btn-warning *,
.btn-light, .btn-light *,
.btn-outline-secondary, .btn-outline-secondary *,
.bg-warning, .bg-light, .badge.bg-warning,
.badge.text-bg-warning, .badge.text-bg-light,
.alert-warning, .alert-light {
    color: #0f172a !important;
    background-color: #fde68a !important;
}
/* Bordi tabelle sempre visibili */
.table, .table > :not(caption) > * > th, .table > :not(caption) > * > td {
    border-color: #d1d5db !important;
}
.table > tbody > tr:nth-of-type(even),
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #f9fafb !important;
}
/* Input sempre scuro / sfondo chiaro / placeholder visibile */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select, textarea, option, optgroup {
    background-color: #ffffff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
    border-color: #9ca3af !important;
    box-shadow: none !important;
}
input::placeholder, textarea::placeholder {
    color: #6b7280 !important;
    opacity: 1 !important;
}
/* Dark-mode safe fallback (non rompiamo i temi scuri manuali) */
body.pos-dark-mode,
body.pos-dark-mode .extras-ui,
body.pos-dark-mode .card,
body.pos-dark-mode .card-header,
body.pos-dark-mode .card-body,
body.pos-dark-mode .table,
body.pos-dark-mode .table > :not(caption) > * > th,
body.pos-dark-mode .table > :not(caption) > * > td,
body.pos-dark-mode .modal-content,
body.pos-dark-mode .modal-header,
body.pos-dark-mode .modal-body,
body.pos-dark-mode .page-header,
body.pos-dark-mode .list-group-item,
body.pos-dark-mode input,
body.pos-dark-mode select,
body.pos-dark-mode textarea,
body.pos-dark-mode .dropdown-menu,
body.pos-dark-mode .dropdown-item {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}
body.pos-dark-mode input::placeholder,
body.pos-dark-mode textarea::placeholder { color: #94a3b8 !important; }

/* ==========================================================================
   V3.2: DASHBOARD DIRETTORE â€” contrasto forzato sempre
   ========================================================================== */
#directorModal .modal-content {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 2px solid #374151 !important;
    max-width: min(920px, calc(100vw - 24px)) !important;
    width: 100% !important;
    margin: 12px auto !important;
    top: calc(env(safe-area-inset-top) + 8px) !important;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px) !important;
    overflow-y: auto !important;
}
body.pos-dark-mode #directorModal .modal-content {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}
#directorModal .modal-header,
#directorModal .modal-body,
#directorModal .modal-footer,
#ds-shift, #ds-date, #ds-sales, #ds-paid,
#ds-open-tables, #ds-need-bill, #ds-calls, #ds-ready {
    color: inherit !important;
    background-color: transparent !important;
}
#directorModal #ds-shift { color: #15803d !important; font-weight: 900 !important; }
body.pos-dark-mode #directorModal #ds-shift { color: #4ade80 !important; }
#directorModal #ds-date,
#directorModal #ds-sales,
#directorModal #ds-paid,
#directorModal #ds-open-tables,
#directorModal #ds-need-bill,
#directorModal #ds-calls,
#directorModal #ds-ready { font-weight: 900 !important; }
#directorModal #director-stats [style*="border"] {
    border-color: #d1d5db !important;
}
body.pos-dark-mode #directorModal #director-stats [style*="border"] {
    border-color: #334155 !important;
}

/* ==========================================================================
   CONTRASTO DEL TESTO — misurato l'8 ottobre 2026 su 51 pagine renderizzate
   ==========================================================================
   Prima di queste regole il controllo trovava 413 testi illeggibili su 30
   pagine (soglia WCAG AA: 4,5:1 testo normale, 3:1 testo grande).

   La causa di quasi tutti non era il colore scelto ma il modo in cui viene
   applicato. style.css:2287 assegna il colore direttamente a ogni elemento
   di testo:

       p, span, div, h1..h6, label, li, a, th, td, small, strong, em, b, i, u
           { color: var(--text-main, #212529); }

   Una dichiarazione diretta batte sempre l'eredità, quindi il "color:
   #FFFFFF !important" delle card (style.css:907) non arrivava mai al testo:
   in tema chiaro --text-main resta scuro e le card sono nere (#111).
   Risultato: testo #212529 su #111, cioe' 1,22:1 — invisibile.

   La correzione e' un token, non un elenco di selettori: dichiarando
   --text-main sulla superficie scura, quella regola globale risolve da sola
   il valore chiaro, perche' le variabili CSS si ereditano. Ogni testo dentro
   la superficie diventa leggibile senza toccare un solo elemento.

   1. Superfici dichiarate scure nel foglio: testo chiaro tramite il token. */
.card,
.list-group-item,
.admin-main-content,
.admin-sidebar,
.gdpr-modal {
    --text-main: #e9ecef;
}

/* 2. Il pannello admin ha sfondo #000 (style.css:325) ma nessun colore
   proprio: ereditava il grigio scuro di Bootstrap. Misurato 1,07:1. */
.admin-main-content { color: #e9ecef; }

/* 3. Le etichette dei form dentro le superfici scure restavano scure:
   Bootstrap assegna un colore proprio a .form-label, quindi non ereditano
   nemmeno il token. Misurato 1,82:1 su #111. */
.admin-main-content label,
.admin-main-content .form-label,
.admin-main-content .form-check-label,
.admin-main-content .form-text,
.gdpr-modal label {
    color: #e9ecef;
}

/* 4. Voci del menu laterale admin su fondo #080808: misurato 1,30:1. */
.admin-sidebar-nav a { color: #dfe3e8; }
.admin-sidebar-nav a:hover,
.admin-sidebar-nav a:focus,
.admin-sidebar-nav a.active { color: #ffffff; }

/* 5. Testata scura (header.main-header: l'unica del sito, stile a riga 139,
   usata da tutte le pagine pubbliche e admin): le voci di navigazione
   ricevevano #212529 direttamente dalla regola globale di riga 2287,
   1,09:1 su #1d1d1d. Il token sotto si eredita, quindi la regola globale
   risolve da sola il chiaro per ogni testo della testata, comprese le
   sotto-pagine admin che non hanno il wrapper .admin-page. */
header.main-header { --text-main: #e9ecef; }

/* 5a. Colore diretto per i link di navigazione: vince su eventuali colori
   propri di Bootstrap (.nav-link, 0,1,0) e copre hover/focus/active. */
header.main-header .nav-link { color: #e9ecef; }
header.main-header .nav-link:hover,
header.main-header .nav-link:focus,
header.main-header .nav-link.active { color: #ffffff; }

/* 5b. Il chip utente nella testata è un .text-primary: Bootstrap lo forza
   blu #0d6efd con !important (riga 2436), misurato 3,73:1 sulla testata
   scura. Serve lo stesso !important per vincerlo. */
header.main-header .text-primary { color: #e9ecef !important; }

/* 5c. Badge punti fedeltà: il div ha già color:#212529 inline, ma lo span
   riceve il colore dalla regola globale via var(--text-main), che la testata
   risolve chiaro: dal 7,14:1 di prima si era tornati a 1,82:1. Il token sul
   badge lo riporta scuro sull'arancione #ff9800. */
.fidelity-badge { --text-main: #212529; }

/* 5d. Righe delle tabelle: design.css le colora con var(--ds-surface), che
   segue il tema (bianco in chiaro, #111827 in scuro automatico/manuale). La
   pagina profilo misurava il testo #e9ecef (token chiaro della card) su riga
   bianca: 1,13:1. Il testo deve seguire lo stesso tema della riga: var(--ds-ink)
   e' gia' il token dell'inchiostro del sistema di design, chiaro o scuro a
   seconda del tema. */
.table > tbody > tr,
table > tbody > tr {
    --text-main: var(--ds-ink, #212529);
}

/* 5e. La card privacy e' bianca per design (stile nel template: card-body
   chiaro, titoli #111827): il token di .card la rendeva chiara di testo e la
   regola .card h1..h6 (riga 915) faceva i titoli oro, misurato 1,99:1 su
   bianco. Anche il brand orange (#F76B1C del template, usato per strong e
   link) misura 2,95:1 su bianco: qui si usa una tonalita' piu' scura
   (#c2410c, ~5,1:1). La card resta colorata e leggibile. */
.privacy-card {
    --text-main: #212529;
    --clr-gold-main: #111827;
    --clr-primary: #c2410c;
}

/* 5f. Caselle di input dentro le card scure: il blocco "tema chiaro"
   (riga 2662) le rende bianche SEMPRE, anche nella cassa scura, perche' si
   leggono su bianco. Il token .card le rendeva chiare di testo: textarea
   misurato #e9ecef su #fff, 1,19:1. Su una casella bianca serve inchiostro
   scuro in ogni tema. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
option,
optgroup {
    --text-main: #212529;
}

/* ============================================================
   6. FAMIGLIE RESIDUE (misurate sul banco, css pubblicato, 08/10)
   ============================================================ */

/* 6a. Le card di menu-ui / grume-body / bg-panel-theme seguono il tema del
   pc (sfondo var(--ds-surface) / var(--bg-panel): bianche in tema chiaro),
   ma il token di .card le colorava di testo chiaro via var(--text-main):
   label di haccp_taglio 1,19:1, 93 span lingue di menu_translate 1,19:1.
   L'inchiostro segue il tema (var(--ds-ink)), come le righe di tabella. */
.pos-content.menu-ui .card,
.pos-content.menu-ui .card-body,
.pos-content.menu-ui .card-header,
.grume-body .card,
.grume-body .card-body,
.bg-panel-theme {
    --text-main: var(--ds-ink, #212529);
}

/* 6a-bis. Le card di extras-ui sono FORZATE bianche in ogni tema (blocco
   "tema chiaro", riga ~2581): inchiostro scuro fisso. I titoli oro
   (.card h1..h6, riga 915) sulle card chiare passano a un oro leggibile
   #8a6d00 (5,0:1 su bianco): i numeri di extra_marketing misuravano
   2,1:1. In tema scuro i titoli oro dei pannelli a tema (6a) diventano
   ink via var(--ds-ink). */
.extras-ui .card,
.extras-ui .card-body,
.extras-ui .card-header,
.extras-ui .bg-panel-theme {
    --text-main: #212529;
    --clr-gold-main: #8a6d00;
}

/* 6b. Etichette di modulo dentro le card: design.css le colora con
   var(--ds-ink-2)=#334155 e i template con colori propri, restando scure
   anche sulle card scure (lascia_recensione 1,82:1). Il colore segue il
   token della card: chiaro sulle card scure, scuro sui pannelli chiari
   (dove 6a/6a-bis l'hanno reso scuro). */
.card label,
.card .form-label,
.card .form-group label {
    color: var(--text-main, #e9ecef);
}

/* 6c. Bottoni outline sulle card scure: design.css usa le varianti scure
   (verde #15803d, 3,45:1 su ordina; rosso #B91C1C, 2,92:1 sulle pagine
   Satispay). Su sfondo scuro serve la variante chiara. */
body.body-dark .btn-outline-primary,
.card.admin-card .btn-outline-primary {
    color: #4ade80;
    border-color: #4ade80;
}
body.body-dark .btn-outline-danger,
.card.admin-card .btn-outline-danger {
    color: #f87171;
    border-color: #f87171;
}

/* 6d. Sidebar Gestione (template gestione_v2.html): brand "G" e voce
   attiva usano verde #22c55e con testo bianco, 2,28:1. Verde scuro
   #15803d -> bianco 4,8:1; hover ancora piu' scuro. */
aside.sb .brand span.lg,
aside.sb .itm.on {
    background-color: #15803d !important;
    color: #fff !important;
}
aside.sb .itm.on:hover {
    background-color: #14532d !important;
}

/* 6e. Tastierino PIN (login e app_login, pannello .pinwr sempre scuro):
   il token di default era scuro (link "Modalita' tavoli", 12px, 1,15:1). */
.pinwr { --text-main: #e9ecef; }

/* 6f. Logo GRUME sul tastierino: gradient #22C55E->#16A34A con lettera
   bianca, 2,28:1 -> gradient scuro. */
.pinwr .pb {
    background: linear-gradient(135deg, #15803d, #14532d) !important;
}

/* 6g. Badge fedelta' su body.body-dark: la regola di body-dark forza il
   bianco su ogni span (0,3,0), 2,16:1 sull'arancione del badge. Il badge
   torna scuro come il resto della pagina (7,14:1). */
body.body-dark .fidelity-badge span { color: #212529 !important; }

/* 6h. Marquee homepage: striscia oro con testo nero (riga 270), ma gli
   span di richiamo hanno .text-primary (blu #0d6efd con !important,
   2,14:1 su oro). Ereditano il nero della striscia. */
.marquee-container .text-primary { color: inherit !important; }

/* 6i. Pulsante Satispay (checkout): rosa #FF3366 del template con testo
   bianco, 3,55:1 -> rosa scuro #d92b5c (bianco ~4,9:1). */
#submit-order-satispay-btn {
    background-color: #d92b5c !important;
    border-color: #d92b5c !important;
    color: #fff !important;
}

/* 6j. Messaggi di errore dei form sulle card scure (body-dark): il rosso di
   Bootstrap #dc3545 misura 4,17:1 su #111 (es. "Per favore, seleziona..." in
   lascia_recensione). Rosso piu' chiaro #ef4444 -> 4,58:1. */
body.body-dark .invalid-feedback,
body.body-dark .text-danger {
    color: #ef4444 !important;
}

/* 6k. Grigio .text-muted di Bootstrap a 4,45:1 su base chiara (root e
   unlock: poco sotto la soglia 4,5:1). Solo i punti segnalati dalla misura,
   senza toccare il muted sugli sfondi scuri (dove scurirlo romperebbe). */
.testimonial-author.text-muted,
.cta-section p.text-muted,
.container.py-4 .text-muted.small {
    color: #5b6470 !important;
}
