/* --- VARIABILI COLORI ROJAK --- */
:root {
    --bg-dark: #00023b;         
    --card-bg: #274f68;         
    --gold: #dd6726;            
    --gold-hover: #dd6726;      
    --text-light: #000000;      
    --text-muted: #888888;      
    --border-color: #d2d2d2;    
    --input-bg: #f6f6f6;        
    
    /* Variabili sovrascrittura FullCalendar per Dark Mode */
    --fc-page-bg-color: var(--card-bg);
    --fc-neutral-bg-color: var(--bg-dark);
    --fc-border-color: var(--border-color);
    --fc-button-text-color: #ffffff;
    --fc-button-bg-color: var(--gold);
    --fc-button-border-color: var(--gold);
    --fc-button-hover-bg-color: var(--gold-hover);
    --fc-button-hover-border-color: var(--gold-hover);
    --fc-button-active-bg-color: #b58d45;
    --fc-today-bg-color: rgba(197, 160, 89, 0.15); /* Oggi evidenziato in oro leggero */
}

/* --- STILI BASE --- */
body { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-light);
    margin: 0;
    padding: 0;
}

/* --- TOPBAR --- */
.topbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .logo {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.topbar .logo span {
    color: var(--text-light);
    font-weight: 300;
}

.topbar .user-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- LAYOUT DASHBOARD --- */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    padding: 20px 30px;
    height: calc(100vh - 70px);
    box-sizing: border-box;
}

/* --- CARDS GENERALI --- */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.card h2 {
    color: var(--text-light);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* --- FORM PRENOTAZIONE --- */
form { display: flex; flex-direction: column; gap: 15px; }

.input-row { display: flex; gap: 10px; }
.input-row > * { flex: 1; }

input { 
    padding: 12px; 
    background-color: var(--input-bg);
    border: 1px solid var(--border-color); 
    color: var(--text-light);
    border-radius: 6px; 
    width: 100%; 
    box-sizing: border-box; 
}
input:focus { outline: none; border-color: var(--gold); }
input::placeholder { color: var(--text-muted); }

/* Calendario bianco su nero nei date picker */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.date-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; }

.btn-gold { 
    background-color: var(--gold); 
    color: #000; 
    border: none; 
    border-radius: 6px;
    padding: 14px;
    cursor: pointer; 
    font-size: 14px; 
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 10px;
}
.btn-gold:hover { background-color: var(--gold-hover); transform: translateY(-2px); }

/* --- ULTIME PRENOTAZIONI WIDGET --- */
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.recent-list li:last-child { border-bottom: none; }
.recent-info { display: flex; justify-content: space-between; margin-bottom: 5px; }
.recent-info strong { color: var(--gold); font-size: 0.95rem; }
.recent-info span { color: var(--text-muted); font-size: 0.8rem; background: var(--bg-dark); padding: 2px 8px; border-radius: 12px; }
.recent-dates { color: var(--text-light); font-size: 0.85rem; }
.recent-list .empty { color: var(--text-muted); font-style: italic; text-align: center; }

/* --- MAIN E CALENDARIO --- */
.calendar-card { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
#calendar { flex-grow: 1; font-size: 0.9rem;}
.fc-theme-standard th { background: #111; padding: 10px 0; color: var(--gold); text-transform: uppercase;}
.fc-event { cursor: pointer; border: none; border-radius: 4px; padding: 2px 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.fc-event-title { font-weight: bold; }

/* --- MODALE DETTAGLI --- */
.modal {
    display: none; 
    position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
}
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--gold);
    border-radius: 12px; padding: 30px;
    width: 90%; max-width: 500px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}
.close-modal {
    color: var(--text-muted);
    float: right; font-size: 28px; font-weight: bold; cursor: pointer;
    line-height: 1;
}
.close-modal:hover { color: var(--gold); }
.modal-content h2 { color: var(--text-muted); border-bottom: none; margin-bottom: 5px; padding-bottom: 0; font-size: 0.9rem; }
#modal-name { color: var(--gold); font-size: 1.8rem; margin-top: 0; margin-bottom: 25px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-item { background: var(--input-bg); padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); }
.modal-item.full-width { grid-column: span 2; }
.modal-item span { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 3px; }
.modal-item strong { color: var(--text-light); font-size: 1rem; }

/* --- RESPONSIVE (Cellulari) --- */
@media (max-width: 900px) {
    .dashboard-wrapper { grid-template-columns: 1fr; height: auto; }
    .topbar { flex-direction: column; gap: 10px; }
    .fc-toolbar { flex-direction: column; gap: 10px; }
}

/* --- BOTTONE PERICOLO (RESET) --- */
.btn-danger {
    background-color: #8b0000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}
.btn-danger:hover {
    background-color: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

/* --- LEGENDA CALENDARIO --- */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--gold);
    border-radius: 3px;
}

.legend-hint {
    background-color: rgba(197, 160, 89, 0.1);
    color: var(--gold);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}


/* --- AGGIUNTE PER AGENDA ADMIN --- */

/* Stile per la tendina di selezione */
select {
    padding: 12px; 
    background-color: var(--input-bg);
    border: 1px solid var(--border-color); 
    color: var(--text-light);
    border-radius: 6px; 
    width: 100%; 
    box-sizing: border-box; 
    transition: border-color 0.3s ease;
    appearance: none; /* Rimuove lo stile di default del browser */
    cursor: pointer;
}
select:focus {
    outline: none;
    border-color: var(--gold);
}

/* Griglia degli orari (copre 2 colonne nel form) */
.slots-grid {
    grid-column: span 2;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    justify-content: center;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Bottoni orario */
.slot-btn {
    grid-column: span 1; /* Sovrascrive il span 2 globale dei button */
    background-color: var(--input-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.slot-btn:hover:not(.disabled) {
    border-color: var(--gold);
    background-color: #333;
    transform: translateY(0);
}

.slot-btn.selected {
    background-color: var(--gold);
    color: #000;
    border-color: var(--gold);
}

.slot-btn.disabled {
    background-color: #111;
    color: #444;
    text-decoration: line-through;
    cursor: not-allowed;
    border-color: #222;
}

/* --- AGGIUNTE LAYOUT DASHBOARD (Stile Foto) --- */

/* Nascondiamo il vecchio container centrale che sballava il design */
.container { display: none; } 

/* Barra superiore */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.logo {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}
.logo span { color: var(--text-light); }
.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Griglia Cruscotto */
.dashboard-layout {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Sidebar sinistra */
.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
}

/* Area principale destra */
.main-content {
    flex-grow: 1;
    min-height: 80vh;
}

/* Stile riquadri (Cards) uguali a quelli della foto */
.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-weight: bold;
}

/* Fix per i form nella sidebar */
.sidebar form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.sidebar button {
    grid-column: span 1; /* resetta il vecchio stile span 2 */
    width: 100%;
}

/* Tendina Select */
select {
    padding: 12px; 
    background-color: var(--input-bg);
    border: 1px solid var(--border-color); 
    color: var(--text-light);
    border-radius: 6px; 
    width: 100%; 
    box-sizing: border-box; 
    cursor: pointer;
}
select:focus { outline: none; border-color: var(--gold); }

/* Griglia slot orari */
.slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.placeholder-text {
    grid-column: span 2;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
}
.slot-btn {
    padding: 8px;
    font-size: 0.85rem;
    background-color: var(--input-bg);
    color: var(--text-light);
}
.slot-btn.selected { background-color: var(--gold); color: #000; }
.slot-btn.disabled { background-color: #111; color: #444; text-decoration: line-through; cursor: not-allowed; }

/* Lista recenti */
.recent-item {
    margin-bottom: 15px;
}
.recent-name { color: var(--gold); font-weight: bold; font-size: 0.9rem; }
.recent-details { color: var(--text-muted); font-size: 0.8rem; margin-top: 3px; }

/* Bottone Rosso (Svuota Database) */
.db-warning { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 15px; line-height: 1.4; }
.btn-danger { background-color: #8b0000; color: white; border: none; }
.btn-danger:hover { background-color: #a50000; transform: none; }

/* Adattamento Cellulari */
@media (max-width: 900px) {
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; }
}

/* --- BOTTONE SALVA IN AGENDA (Gigante e Dorato) --- */
#submitBtnLarge {
    background-color: var(--gold);
    color: #000;
    font-size: 1.1rem;
    padding: 18px;
    font-weight: 800;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}
#submitBtnLarge:hover:not(:disabled) {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
}
#submitBtnLarge:disabled {
    background-color: #333;
    color: #666;
    cursor: not-allowed;
}

/* --- CALENDARIO STYLES --- */
.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.nav-btn {
    background: var(--input-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}
.nav-btn:hover { background: var(--gold); color: #000; }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.calendar-day {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-height: 80px;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.calendar-day:hover:not(.empty) { background-color: #333; border-color: var(--gold); }
.calendar-day.empty { background-color: transparent; border: none; cursor: default; }
.calendar-day.today { border: 2px solid var(--gold); }
.calendar-day.today strong { color: var(--gold); }

/* Badge Appuntamenti */
.appointment-badge {
    background-color: var(--gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 10px;
}

/* --- POPUP (MODAL) STYLES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center; justify-content: center;
}
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { margin: 0; color: var(--gold); }
.close-modal { color: #aaa; font-size: 24px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: white; }
.modal-body { padding: 20px; max-height: 300px; overflow-y: auto; }
.modal-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); text-align: center; }

/* Elementi lista appuntamenti */
.modal-app-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--input-bg); padding: 10px; margin-bottom: 10px; border-radius: 6px;
}
.app-time { color: var(--gold); font-weight: bold; margin-right: 10px; }

/* Pulsanti +/- */
.delete-btn {
    background-color: #ff4d4d; color: white; border: none;
    border-radius: 50%; width: 25px; height: 25px; cursor: pointer;
    font-weight: bold; font-size: 14px; line-height: 1; padding: 0; display:flex; justify-content:center; align-items:center;
}
.delete-btn:hover { background-color: #cc0000; transform: scale(1.1); }
.btn-gold-outline {
    background: transparent; color: var(--gold); border: 1px solid var(--gold);
    padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; width: 100%;
}
.btn-gold-outline:hover { background: var(--gold); color: #000; }

/* --- AGGIORNAMENTO LISTA APPUNTAMENTI NEL POPUP (Effetto a tendina) --- */

.modal-app-container {
    background: var(--input-bg);
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.modal-app-container:hover {
    border-color: var(--border-color);
}

.modal-app-item {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 12px;
    background: transparent; 
    margin-bottom: 0; /* Rimuove il vecchio margine */
}

.app-info:hover {
    opacity: 0.8;
}

/* Stile per i dettagli extra nascosti */
.app-details-extended {
    display: none; /* Nascosto di default */
    padding: 0 12px 12px 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    margin-top: 5px;
    padding-top: 10px;
    background-color: rgba(0, 0, 0, 0.2); /* Leggero stacco di colore */
}

/* Classe che viene aggiunta da JS per mostrare i dettagli */
.app-details-extended.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.app-details-extended p {
    margin: 5px 0;
}

.app-details-extended strong {
    color: var(--text-light);
}

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

/* ==========================================
   STILI LANDING PAGE PUBBLICA (WHITE & GLOW PREMIUM)
   ========================================== */

/* Scorrimento fluido nativo per i link della navbar */
html { scroll-behavior: smooth; }

/* Ridefinizione Variabili per il Tema Chiaro */
.public-page {
    --bg-white: #ffffff;
    --bg-alt: #f8fbff;         /* Bianco con una leggerissima punta di blu */
    --text-dark: #121212;      /* Testo scuro principale */
    --text-muted: #666666;     /* Testo secondario */
    --gold: #dd6726;
    --gold-glow: rgba(197, 160, 89, 0.5);
    --blue: #274f68;           /* Blu elettrico/reale per i dettagli tech */
    --blue-glow: #274f68;
    
    font-family: 'Montserrat', sans-serif;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--bg-white);
    color: var(--text-dark);
}

/* Navbar Sticky - Effetto Vetro Chiaro */
.public-nav {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.8s ease;
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
/* Forziamo il logo a essere scuro sulla barra bianca */
.public-nav .logo { color: var(--blue); }
.public-nav .logo span { color: var(--gold); }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-dark); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: color 0.6s; }
.nav-links a:hover { color: var(--gold); }

/* Bottoni Navbar - Glow Blu e Oro */
.nav-btn-outline { 
    border: 1px solid var(--blue); padding: 10px 24px; 
    border-radius: 30px; color: var(--blue) !important; 
    transition: all 0.6s ease; 
}
.nav-btn-outline:hover { 
    background: var(--blue); color: #fff !important; 
    box-shadow: 0 4px 15px var(--blue-glow); 
}
.nav-btn-solid { 
    background: var(--gold); color: #fff !important; 
    padding: 10px 24px; border-radius: 30px; transition: all 0.6s ease; 
    box-shadow: 0 4px 15px var(--gold-glow);
}
.nav-btn-solid:hover { 
    background: #dfb86e; 
    box-shadow: 0 8px 20px var(--gold-glow); 
    transform: translateY(-2px);
}

/* Hero Section - Sfondo Bianco con sfumatura radiale */
.hero {
    padding: 180px 20px 120px; 
    text-align: center;
    background: radial-gradient(circle at 50% -20%, #eef5ff 0%, var(--bg-white) 70%);
}
.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 3.8rem; font-weight: 800; line-height: 1.15; margin-bottom: 24px; letter-spacing: -1px; color: var(--text-dark); }
.highlight-gold { color: var(--gold); text-shadow: 0 0 20px var(--gold-glow); }
.hero p { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 45px; line-height: 1.6; font-weight: 500;}

/* Bottoni Hero - Ultra Arrotondati con Glow Incredibile */
.hero-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.btn-giant-gold {
    background: var(--gold); color: #fff; padding: 20px 45px; font-size: 1.1rem; font-weight: 800;
    text-decoration: none; border-radius: 50px; transition: all 0.6s ease;
    text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 10px 30px var(--gold-glow);
}
.btn-giant-gold:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 15px 40px var(--gold-glow); 
}
.btn-giant-outline {
    background: transparent; color: var(--blue); border: 2px solid var(--blue);
    padding: 20px 45px; font-size: 1.1rem; font-weight: 800; text-decoration: none; border-radius: 50px; 
    transition: all 0.6s ease; text-transform: uppercase; letter-spacing: 1px;
}
.btn-giant-outline:hover { 
    background: var(--blue); color: #fff; 
    box-shadow: 0 15px 40px var(--blue-glow); 
    transform: translateY(-4px); 
}

/* Sezioni Narrative */
.content-section { padding: 120px 20px; }
.alternate-bg { background-color: var(--bg-alt); border-top: 1px solid rgba(0,0,255,0.03); border-bottom: 1px solid rgba(0,0,255,0.03); }
.section-container { max-width: 1200px; margin: 0 auto; text-align: center; }
.section-container h2 { font-size: 2.8rem; margin-bottom: 15px; letter-spacing: -0.5px; color: var(--text-dark); }
.section-container .subtitle { color: var(--text-muted); font-size: 1.2rem; margin-bottom: 60px; font-weight: 500;}

/* Griglia Features - Ombre morbide su sfondo bianco */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { 
    background: #ffffff; padding: 45px 35px; 
    border-radius: 24px; 
    border: 1px solid rgba(0,0,0,0.04); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); /* Ombra leggerissima di default */
    text-align: left; transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.feature-card:hover { 
    transform: translateY(-10px); 
    border-color: rgba(0, 86, 255, 0.2); 
    box-shadow: 0 20px 40px var(--blue-glow); /* Si illumina di blu al passaggio */
}
.feature-card h3 { color: var(--gold); margin-bottom: 15px; font-size: 1.4rem; }
.feature-card p { color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }

/* ==========================================
   GLOW ROTANTE ESTERNO (MASCHERA VUOTA AL CENTRO)
   ========================================== */

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.booking-wrapper { 
    max-width: 700px; 
    margin: 0 auto; 
    text-align: left; 
    padding: 50px; 
    background: #ffffff; /* Ripristiniamo il bianco puro direttamente qui */
    border-radius: 24px; 
    position: relative; 
    z-index: 1; /* Il form resta in primo piano */
    border: none; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); /* Ombra fissa e leggerissima per staccarlo dal fondo */
}

/* Puliamo eventuali vecchi residui di codice */
.booking-wrapper::after { display: none; }

/* Il nuovo ::before crea SOLO la linea esterna sfumata */
.booking-wrapper::before {
    content: "";
    position: absolute;
    inset: -6px; /* Quanto sporge in fuori l'effetto */
    padding: 6px; /* Lo spessore della linea dorata/blu */
    border-radius: 30px; /* Arrotondamento esterno morbido */
    background: conic-gradient(
        from var(--gradient-angle), 
        var(--gold), 
        var(--blue), 
        var(--gold), 
        var(--blue), 
        var(--gold)
    );
    z-index: -1; /* Lo mettiamo dietro al form */

    /* LA MAGIA: Questa maschera elimina il centro del colore, lasciando solo la cornice! */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;

    /* Sfochiamo la linea per farla diventare un'ombra luminosa (Glow) */
    filter: blur(12px); 
    opacity: 0.85;
    animation: rotationGlow 6s linear infinite;
}

@keyframes rotationGlow {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

.form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.form-row input, .booking-wrapper input[type="date"] { 
    flex: 1; border-radius: 12px; padding: 15px; 
    border: 1px solid rgba(0,0,0,0.1); 
    background: #f8f9fa; color: var(--text-dark); 
    transition: all 0.3s; width: 100%; box-sizing: border-box;
}
.form-row input:focus, .booking-wrapper input[type="date"]:focus { 
    border-color: var(--blue); outline: none; 
    box-shadow: 0 0 15px var(--blue-glow); /* Glow blu quando scrivi nel form */
    background: #ffffff;
}

/* Slot Orari (Design Light) */
.booking-wrapper .slots-grid { background-color: #f8f9fa; border-color: rgba(0,0,0,0.05); }
.booking-wrapper .slot-btn { background-color: #ffffff; border: 1px solid rgba(0,0,0,0.1); color: var(--text-dark); }
.booking-wrapper .slot-btn:hover:not(.disabled) { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 10px var(--blue-glow); background-color: #ffffff; }
.booking-wrapper .slot-btn.selected { background-color: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 4px 10px var(--blue-glow); }
.booking-wrapper .placeholder-text { color: var(--text-muted); }

/* Bottone Conferma nel Form */
#submitBtnLarge { 
    border-radius: 50px; background-color: var(--gold); color: #fff;
    box-shadow: 0 10px 20px var(--gold-glow); transition: all 0.4s ease;
}
#submitBtnLarge:hover:not(:disabled) { 
    box-shadow: 0 15px 30px var(--gold-glow); background-color: #dfb86e;
}

/* Galleria Video Aggiornata */
.video-wrapper {
    border-radius: 24px; 
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1); /* Ombra naturale per i video */
    border: 2px solid transparent;
    transition: all 0.5s ease;
}
.video-wrapper:hover {
    border-color: var(--gold);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px var(--gold-glow); /* Glow dorato quando guardi un video */
}

/* Footer Chiarissimo */
.public-footer { text-align: center; padding: 40px; border-top: 1px solid rgba(0,0,0,0.05); color: var(--text-muted); font-size: 0.9rem; }

/* ==========================================
   ANIMAZIONI PROFESSIONALI (REVEAL)
   ========================================== */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.6s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

.hero-content h1 { animation: fadeUp 1.6s ease-out forwards; }
.hero-content p { animation: fadeUp 1.6s ease-out 0.4s forwards; opacity: 0; }
.hero-content .hero-buttons { animation: fadeUp 1.6s ease-out 0.8s forwards; opacity: 0; }

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

/* Responsive Mobile */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero { padding: 140px 20px 80px; }
    .form-row { flex-direction: column; gap: 15px; }
    .nav-links a:not(.nav-btn-solid) { display: none; }
    .content-section { padding: 80px 20px; }
    .booking-wrapper { padding: 30px 20px; }
}

/* ==========================================
   STILE CALENDARIO CUSTOM (FLATPICKR) - THEMA LIGHT PREMIUM
   ========================================== */

/* Arrotondiamo la finestra, mettiamo l'ombra e forziamo il BIANCO OVUNQUE */
.flatpickr-calendar, 
.flatpickr-months, 
.flatpickr-weekdays, 
.flatpickr-weekdaycontainer {
    background: #ffffff !important;
    border-radius: 20px !important;
    font-family: 'Montserrat', sans-serif !important;
}

.flatpickr-calendar {
    box-shadow: 0 15px 40px rgba(0,0,0,0.1) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    padding: 10px;
}

/* Colore del testo nella barra del mese e anno (Scuri per essere leggibili sul bianco) */
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--text-dark) !important;
    font-weight: 800 !important;
}

/* Freccette Avanti/Indietro Mese (Blu Elettrico) */
.flatpickr-months .flatpickr-prev-month svg, 
.flatpickr-months .flatpickr-next-month svg {
    fill: var(--blue) !important;
    transition: all 0.3s ease;
}
.flatpickr-months .flatpickr-prev-month:hover svg, 
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--gold) !important;
}

/* Nomi dei giorni (Lun, Mar, Mer...) */
span.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

/* Colore dei numeri dei giorni normali */
.flatpickr-day {
    color: var(--text-dark) !important;
}

/* Colore del giorno selezionato (Blu Elettrico con Glow) */
.flatpickr-day.selected, 
.flatpickr-day.selected:focus, 
.flatpickr-day.selected:hover {
    background: var(--blue) !important;
    border-color: var(--blue) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px var(--blue-glow);
}

/* Colore al passaggio del mouse su un giorno libero */
.flatpickr-day:hover:not(.selected):not(.flatpickr-disabled) {
    background: #f0f5ff !important;
    border-color: transparent !important;
    color: var(--blue) !important;
}

/* Giorni disabilitati (Sabato, Domenica e passati) invisibili/grigi */
.flatpickr-day.flatpickr-disabled, 
.flatpickr-day.flatpickr-disabled:hover {
    color: #e0e0e0 !important;
    background: transparent !important;
}

/* --- RESET AGGRESSIVO PER FLATPICKR (LUCIDATURA FINALE) --- */

/* 1. Sbianca lo sfondo di tutto l'header e toglie ogni riga scura */
.flatpickr-calendar .flatpickr-months,
.flatpickr-calendar .flatpickr-month,
.flatpickr-calendar .flatpickr-current-month,
.flatpickr-calendar .numInputWrapper {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: var(--text-dark) !important;
    border: none !important;
}

/* 2. Fix specifico per le freccette dell'anno (quelle che vedi scure) */
.flatpickr-current-month .numInputWrapper span {
    border: none !important;
}

.flatpickr-current-month .numInputWrapper span:hover {
    background: #f0f5ff !important;
}

/* 3. Forza le freccette su/giù a essere scure (altrimenti sul bianco spariscono) */
.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-dark) !important;
}
.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-dark) !important;
}

/* 4. Rimuove l'ombra scura fastidiosa che a volte appare tra mese e anno */
.flatpickr-month {
    fill: var(--text-dark) !important;
}


/* ======================================================= */
/* 🔒 CSS ESCLUSIVO PER LOGIN E ADMIN (NESSUN CONFLITTO)   */
/* ======================================================= */

@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* Variabili unificate per Admin e Login per non toccare :root generale */
.login-page, .admin-page {
    --gold-admin: #c9922a;
    --gold-light: #e8b84b;
    --gold-glow: rgba(201, 146, 42, 0.35);
    --blue-admin: #1a4fd6;
    --blue-light: #2563eb;
    --blue-glow: rgba(26, 79, 214, 0.3);
    --black-admin: #0a0a0a;
    --white: #ffffff;
    --off-white: #f7f7f5;
    --surface: #fafaf9;
    --border-admin: rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.12);
    --text-muted-admin: #8a8a8a;
    --text-secondary-admin: #555;
    --danger: #dc2626;
    --danger-glow: rgba(220,38,38,0.2);
    --sidebar-w: 320px;
    --topbar-h: 64px;
}

/* Reset forzato solo in queste due pagine */
.login-page *, .admin-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   STILI DI BASE DELLE PAGINE
============================================ */
body.login-page {
    font-family: 'Montserrat', sans-serif !important;
    background: var(--white) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

html:has(body.admin-page), body.admin-page {
    height: 100vh;
    font-family: 'Montserrat', sans-serif !important;
    background: var(--off-white) !important;
    color: var(--black-admin) !important;
    overflow: hidden;
}

/* ============================================
   AREA LOGIN
============================================ */
.login-page .bg-canvas { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.login-page .bg-orb { position: absolute; border-radius: 50%; filter: blur(80px); animation: floatOrb 12s ease-in-out infinite; }
.login-page .bg-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(201,146,42,0.12), transparent 70%); top: -100px; left: -100px; animation-delay: 0s; }
.login-page .bg-orb-2 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(26,79,214,0.1), transparent 70%); bottom: -150px; right: -100px; animation-delay: -4s; }
@keyframes floatOrb { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-40px) scale(1.05); } }

.login-page .login-wrapper { position: relative; z-index: 10; width: 100%; max-width: 460px; padding: 20px; animation: enterScene 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
@keyframes enterScene { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-page .login-card { background: var(--white); border-radius: 28px; padding: 50px 45px; position: relative; box-shadow: 0 4px 6px rgba(0,0,0,0.03), 0 20px 60px rgba(0,0,0,0.06); }
.login-page .login-card::before, .login-page .login-card::after { content: ""; position: absolute; background: conic-gradient(from var(--gradient-angle), var(--gold-admin), var(--blue-admin), var(--gold-admin), var(--blue-admin), var(--gold-admin)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: rotationGlow 6s linear infinite; z-index: -1; }
.login-page .login-card::before { inset: -3px; padding: 3px; border-radius: 31px; filter: blur(6px); opacity: 0.7; }
.login-page .login-card::after { inset: -1px; border-radius: 29px; opacity: 1; }
@keyframes rotationGlow { 0% { --gradient-angle: 0deg; } 100% { --gradient-angle: 360deg; } }

.login-page .brand { text-align: center; margin-bottom: 40px; }
.login-page .brand-logo { font-family: 'Cormorant Garamond', serif; font-size: 2.6rem; font-weight: 700; letter-spacing: 6px; color: var(--black-admin); }
.login-page .brand-logo .gold { color: var(--gold-admin); }
.login-page .brand-subtitle { font-size: 0.6rem; font-weight: 600; letter-spacing: 5px; color: var(--text-muted-admin); text-transform: uppercase; margin-top: 8px; }

.login-page .input-group { margin-bottom: 24px; text-align: left; }
.login-page .input-group label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; color: var(--text-muted-admin); text-transform: uppercase; margin-bottom: 10px; }
.login-page .input-group input { width: 100%; padding: 16px 18px; background: var(--surface); border: 1.5px solid var(--border-admin); border-radius: 14px; font-family: 'Montserrat', sans-serif; font-size: 0.9rem; color: var(--black-admin); outline: none; }
.login-page .input-group input:focus { border-color: var(--blue-admin); background: var(--white); box-shadow: 0 0 0 4px rgba(26,79,214,0.08), 0 0 20px var(--blue-glow); }
.login-page .password-wrapper { position: relative; }
.login-page .toggle-pw { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted-admin); font-size: 1rem; }

.login-page #submitBtn { width: 100%; padding: 17px; border: none; border-radius: 14px; background: linear-gradient(135deg, var(--gold-admin), var(--gold-light), var(--gold-admin)); background-size: 200%; color: var(--white); font-weight: 800; letter-spacing: 4px; text-transform: uppercase; cursor: pointer; box-shadow: 0 8px 25px var(--gold-glow); transition: all 0.4s; }
.login-page #submitBtn:hover { transform: translateY(-2px); box-shadow: 0 15px 40px var(--gold-glow); }
.login-page .back-link { display: flex; justify-content: center; gap: 6px; margin-top: 28px; color: var(--text-muted-admin); text-decoration: none; font-size: 0.78rem; font-weight: 500; }
.login-page .security-badge { text-align: center; margin-top: 20px; font-size: 0.7rem; font-weight: 600; color: var(--text-muted-admin); opacity: 0.6; }


/* ============================================
   AREA ADMIN
============================================ */
/* Topbar */
.admin-page .topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--white); border-bottom: 1px solid var(--border-admin); display: flex; align-items: center; padding: 0 28px; gap: 20px; z-index: 100; }
.admin-page .topbar-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 700; letter-spacing: 4px; color: var(--black-admin); }
.admin-page .topbar-logo .gold { color: var(--gold-admin); }
.admin-page .topbar-divider { width: 1px; height: 28px; background: var(--border-strong); }
.admin-page .topbar-subtitle { font-size: 0.6rem; font-weight: 700; letter-spacing: 3px; color: var(--text-muted-admin); text-transform: uppercase; flex: 1; }
.admin-page .topbar-logout { padding: 9px 18px; background: none; border: 1.5px solid var(--border-strong); border-radius: 10px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; text-decoration: none; color: var(--text-secondary-admin); cursor: pointer; }
.admin-page .topbar-logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(220,38,38,0.04); }

/* Layout e Sidebar */
.admin-page .app-layout { display: flex; height: 100vh; padding-top: var(--topbar-h); }
.admin-page .sidebar { width: var(--sidebar-w); background: var(--white); border-right: 1px solid var(--border-admin); padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.admin-page .panel { background: var(--white); border: 1px solid var(--border-admin); border-radius: 18px; padding: 22px 20px; position: relative; }
.admin-page .panel-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold-admin), var(--blue-admin)); }
.admin-page .panel-title { font-size: 0.6rem; font-weight: 800; letter-spacing: 3px; color: var(--text-muted-admin); text-transform: uppercase; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.admin-page .panel-title::after { content: ""; flex: 1; height: 1px; background: var(--border-admin); }

/* Form Admin */
.admin-page .form-admin { display: flex; flex-direction: column; gap: 10px; }
.admin-page .form-admin input, .admin-page .form-admin select { width: 100%; padding: 12px 14px; background: var(--off-white); border: 1.5px solid transparent; border-radius: 11px; font-size: 0.8rem; outline: none; -webkit-appearance: none; }
.admin-page .form-admin input:focus, .admin-page .form-admin select:focus { border-color: var(--blue-admin); background: var(--white); }
.admin-page .form-admin select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9a9a'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.admin-page .slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--off-white); border-radius: 12px; padding: 10px; }
.admin-page .slot-btn { padding: 8px 4px; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--white); font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.admin-page .slot-btn.selected { background: var(--blue-admin); border-color: var(--blue-admin); color: var(--white); }
.admin-page .slot-btn.disabled { background: #f0f0f0; color: #ccc; cursor: not-allowed; text-decoration: line-through; }

.admin-page #submitBtnLarge { width: 100%; padding: 15px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--gold-admin), var(--gold-light), var(--gold-admin)); color: var(--white); font-weight: 800; text-transform: uppercase; cursor: pointer; }
.admin-page .btn-danger { width: 100%; padding: 13px; border: 1.5px solid rgba(220,38,38,0.3); border-radius: 12px; background: rgba(220,38,38,0.04); color: var(--danger); font-weight: 700; text-transform: uppercase; cursor: pointer; }

/* Calendario Admin */
.admin-page .main-content { flex: 1; padding: 24px; overflow-y: auto; }
.admin-page .calendar-card { background: var(--white); border: 1px solid var(--border-admin); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; height: 100%; }
.admin-page .calendar-header-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-page .calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.65rem; font-weight: 800; color: var(--text-muted-admin); text-transform: uppercase; margin-bottom: 12px; }
.admin-page .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; flex: 1; }
.admin-page .calendar-day { background: var(--surface); border: 1.5px solid var(--border-admin); border-radius: 14px; padding: 12px; min-height: 90px; cursor: pointer; display: flex; flex-direction: column; }
.admin-page .calendar-day:hover:not(.empty) { background: var(--white); border-color: var(--blue-admin); }
.admin-page .calendar-day.empty { background: transparent; border: none; cursor: default; }
.admin-page .calendar-day.today { border: 2px solid var(--gold-admin); }
.admin-page .appointment-badge { width: 100%; background: rgba(26,79,214,0.08); color: var(--blue-admin); font-size: 0.65rem; font-weight: 700; padding: 5px; border-radius: 6px; margin-top: auto; text-align: center; }

/* Modale Admin */
.admin-page .modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); z-index: 999; align-items: center; justify-content: center; }
.admin-page .modal-content { background: var(--white); border-radius: 24px; width: 100%; max-width: 480px; position: relative; }
.admin-page .modal-top-band { height: 6px; background: linear-gradient(90deg, var(--gold-admin), var(--blue-admin)); }
.admin-page .modal-header { padding: 24px 26px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-admin); }
.admin-page .close-modal { background: none; border: none; font-size: 1.8rem; color: var(--text-muted-admin); cursor: pointer; }
.admin-page .modal-body { padding: 20px 26px; max-height: 60vh; overflow-y: auto; }
.admin-page .modal-app-item { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1.5px solid var(--border-admin); border-radius: 14px; margin-bottom: 10px; }
.admin-page .app-details-extended { display: none; padding: 12px 16px; background: var(--surface); border: 1.5px solid var(--border-admin); border-top: none; border-radius: 0 0 14px 14px; font-size: 0.78rem; }
.admin-page .app-details-extended.show { display: block; }
.admin-page .modal-footer { padding: 0 26px 22px; }

/* ==========================================
   AGGIUNTE DOCTOR B - GESTIONALE AI
   ========================================== */
.rojak-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.rojak-table th {
    text-align: left; padding: 12px; border-bottom: 2px solid var(--gold, #c1a161);
    color: var(--gold, #c1a161); text-transform: uppercase; font-size: 12px; font-weight: 600;
}
.rojak-table td {
    padding: 15px 12px; border-bottom: 1px solid rgba(193, 161, 97, 0.2);
    font-size: 14px; vertical-align: middle;
}
.doc-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; display: inline-block; text-align: center;}
.badge-gazebo { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid #3498db; }
.badge-interna { background: rgba(155, 89, 182, 0.15); color: #9b59b6; border: 1px solid #9b59b6; }
.badge-alert { background: #e74c3c; color: white; animation: pulse-red 2s infinite; }
.badge-cash { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid #2ecc71; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.7); } 70% { box-shadow: 0 0 0 8px rgba(231,76,60,0); } 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); } }
.empty-msg { padding: 20px; text-align: center; color: #888; font-style: italic; font-size: 13px; }
.time-text { font-weight: 700; color: var(--gold, #c1a161); font-size: 16px; }
.ordine-text { font-size: 13px; color: #666; font-style: italic; max-width: 150px; display: inline-block; }

/* NUOVI STILI LAYOUT E FUNZIONI */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); /* 3 colonne uguali */
    gap: 20px; 
    align-items: start; 
}
.control-bar { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 20px; background: #fff; padding: 15px 20px; 
    border-radius: 8px; border-left: 4px solid var(--gold, #c1a161);
}
.date-picker { padding: 8px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit; font-size: 15px;}
.header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.btn-add { background: #2ecc71; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; }
.btn-delete { background: #e74c3c; color: white; border: none; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: bold;}
.add-form { display: none; background: #f9f9f9; padding: 15px; margin-bottom: 15px; border-radius: 5px; border: 1px solid #ddd; }
.add-form.active { display: block; }
.add-form input, .add-form select { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.add-form button { width: 100%; padding: 10px; background: var(--gold, #c1a161); color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* Responsive per schermi piccoli */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   MEDIA QUERIES RESPONSIVE (SMARTPHONE & TABLET)
   ========================================== */

/* 1. Tablet e schermi medi (fino a 1024px) */
@media (max-width: 1024px) {
    .app-layout {
        display: flex;
        flex-direction: column; /* Sposta la sidebar in alto */
    }
    .sidebar {
        width: 100%;
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
        min-width: 0;
    }
    .sidebar .panel {
        flex: 1; /* I pannelli laterali si affiancano orizzontalmente */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
}

/* 2. Smartphone (fino a 768px) - LAYOUT CORAZZATO E SCORREVOLE */
@media (max-width: 768px) {
    /* --- SBLOCCO SCORRIMENTO VERTICALE (IL FIX PER IL DITO) --- */
    html, body, body.admin-page {
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        position: relative !important;
    }
    
    .main-content {
        height: auto !important;
        overflow-y: visible !important;
        padding: 0 !important;
    }
    /* ----------------------------------------------------------- */

    /* Sgancia la topbar in modo che non si sovrapponga a niente */
    .topbar {
        position: relative !important; 
        height: auto !important;
        flex-direction: column !important;
        padding: 20px 15px !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .topbar-divider { display: none !important; }
    
    .status-pill {
        margin: 15px 0 !important;
        display: inline-flex !important;
    }
    
    .topbar-logout {
        margin: 0 !important;
        width: 100% !important;
        text-align: center !important;
        padding: 12px 0 !important;
        background: rgba(193, 161, 97, 0.1) !important;
    }

    /* Impagina i contenitori principali a colonna dritta */
    .app-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 15px !important;
        margin-top: 0 !important;
        overflow: visible !important;
    }

    /* Sistema la Sidebar togliendo altezze e larghezze fisse */
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        margin-bottom: 25px !important;
        padding: 0 !important;
    }

    .sidebar .panel {
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Barra del Selettore Data */
    .control-bar {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }
    
    .control-bar form {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    /* Riquadri principali e pulsanti */
    .header-flex {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .btn-add {
        width: 100% !important;
        padding: 15px !important;
        font-size: 16px !important;
    }

    /* Permetti lo scroll orizzontale delle tabelle */
    .panel {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .rojak-table {
        min-width: 600px !important; /* Mantiene la tabella leggibile forzando lo scroll laterale */
    }
}

/* 3. Schermi molto piccoli (es. iPhone SE - fino a 400px) */
@media (max-width: 400px) {
    .dashboard-grid {
        gap: 15px;
    }
    .panel {
        padding: 15px;
    }
}