/* ==============================================================
   RESERVAPP - INDUSTRIAL & ASEPTIC CORE CSS (FINAL OPTIMIZED)
   ============================================================== */

/* 1. RESET & GLOBALS */
:root {
    --bs-primary-main: #0d6efd;
    --industrial-border: #d1d1d1;
    --tech-bg-light: #f0f0f0;
    --tech-bg-white: #ffffff;
    
    /* Colori Stati - Asettici ma distinti */
    --status-disponibile-bg: #e9f7ef;
    --status-disponibile-text: #155724;
    --status-chiuso-bg: #f2f2f2;
    --status-chiuso-text: #444444;
}

body { 
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: #fcfcfc;
    color: #333;
}

/* Rimuove i bordi arrotondati ovunque per lo stile industriale */
.btn, .card, .form-control, .form-select, .alert, .toast, .badge, .input-group-text { 
    border-radius: 0 !important; 
}

/* 2. TABELLE SISTEMA (django-tables2) */
table.table {
    border-collapse: collapse !important;
    width: 100% !important;
    border: 1px solid var(--industrial-border) !important;
}

/* Header Tabelle - Rimosso underline e colori link blu */
table.table thead th {
    background-color: var(--tech-bg-light) !important;
    color: #444 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    border: 1px solid var(--industrial-border) !important;
    padding: 10px 12px !important;
    vertical-align: middle;
}

/* FIX: Rimozione sottolineatura link ordinamento (th.orderable) */
table.table thead th a {
    color: inherit !important;
    text-decoration: none !important;
    display: inline-block;
    width: 100%;
}

table.table thead th a:hover {
    text-decoration: none !important;
    color: var(--bs-primary-main) !important;
}

/* Celle Corpo Tabella */
table.table td {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    border: 1px solid #e0e0e0 !important;
    color: #333 !important;
    vertical-align: middle !important;
}

/* Rimuove underline dai link nelle celle (es. azioni) */
table.table td a {
    text-decoration: none !important;
}

/* 3. LOGICA COLORI SLOT (Griglia Oraria) */
/* Usiamo selettori più forti per assicurarci che i colori appaiano */

.slot-cell, .slot-cell-admin, .orario-compatto td {
    height: 55px;
    min-width: 120px;
    transition: all 0.1s ease;
    text-align: center;
    cursor: pointer;
}

/* DISPONIBILE - Verde */
td[class*="disponibile"], 
.table td.disponibile { 
    background-color: var(--status-disponibile-bg) !important; 
    color: var(--status-disponibile-text) !important;
}

/* CHIUSO - Grigio */
td[class*="chiuso"], 
.table td.chiuso { 
    background-color: var(--status-chiuso-bg) !important; 
    color: var(--status-chiuso-text) !important;
}

/* LIBERO - Bianco */
td[class*="libero"], 
.table td.libero { 
    background-color: #ffffff !important;
}

/* Feedback Hover per le celle interattive */
.slot-cell-admin:hover, 
td[id^="cella-"]:hover,
table.table thead th.orderable:hover {
    filter: brightness(0.95) !important;
    background-color: #e9ecef !important;
}

/* 4. UTILITY TECNICHE */
.text-uppercase-small { 
    font-size: 0.65rem; 
    font-weight: 700; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
    color: #6c757d; 
}

.slot-ora { 
    font-family: monospace; 
    font-size: 0.85rem; 
}

/* Reset per Bootstrap Icons in bottoni senza padding eccessivo */
.btn-sm i {
    vertical-align: middle;
    line-height: 1;
}

/* Forza Select2 a occupare tutto lo spazio disponibile nel contenitore */
.select2-container {
    width: 100% !important;
}

/* Rendi la select2-selection squadrata come il tuo design */
.select2-selection {
    border-radius: 0 !important;
    border: 1px solid #dee2e6 !important;
}

/* 5. RESPONSIVE */
@media (max-width: 768px) {
    .slot-cell, .slot-cell-admin { 
        min-width: 100px; 
        height: 50px; 
    }
    table.table thead th {
        font-size: 0.6rem;
        padding: 8px 4px !important;
    }
}