/* ============================================================
   LAYOUT GENERALE — stile "archivio vini"
   ============================================================ */
.gestionale-wrapper {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ============================================================
   TITOLI SEZIONE
   ============================================================ */
.gf-titolo {
    margin: 16px 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
}

.gf-sep {
    margin: 20px 0 6px;
    border: none;
    border-top: 2px solid #000;
}

.gf-sep-riga {
    margin: 6px 0;
    border: none;
    border-top: 1px dashed #999;
}

/* ============================================================
   FORM — label a sinistra, input a destra (compatto)
   ============================================================ */
.gestionale-form form {
    margin: 0;
}

.gestionale-form label {
    display: inline-block;
    box-sizing: border-box;
    padding: 2px 0;
    margin-left: 2.5%;
    width: 45%;
    font-weight: 600;
    font-size: 15px;
    vertical-align: middle;
    line-height: 1.2;
}

.gestionale-form input[type="text"],
.gestionale-form input[type="number"],
.gestionale-form input[type="date"],
.gestionale-form input[type="time"],
.gestionale-form select {
    display: inline-block;
    box-sizing: border-box;
    width: 48%;
    border: 2px solid #000;
    border-radius: 7px;
    padding: 4px 8px;
    margin: 1px 0;
    font-size: 15px;
    line-height: 1.2;
    background: #fff;
    vertical-align: middle;
}

.gestionale-form input[readonly] {
    background-color: #f0f0f0;
    cursor: not-allowed;
    font-weight: 700;
}

/* Errore su input orario */
.gestionale-form input.gf-errore {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

/* ============================================================
   BOTTONI
   ============================================================ */
.gestionale-form button,
.gestionale-form input[type="submit"] {
    width: 40%;
    box-sizing: border-box;
    background: #7a0625;
    color: #fff;
    border: none;
    border-radius: 7px;
    margin: 12px auto 6px;
    display: block;
    cursor: pointer;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 600;
}

.gestionale-form button:hover,
.gestionale-form input[type="submit"]:hover {
    background: #5a041b;
}

/* Pulsanti riga (aggiungi/rimuovi) */
.gestionale-aggiungi {
    width: auto !important;
    padding: 6px 18px !important;
    font-size: 14px !important;
    background: #7a0625 !important;
    margin: 4px auto !important;
}
.gestionale-aggiungi:hover {
    background: #5a041b !important;
}

.gestionale-rimuovi {
    width: auto !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    background: #6b7280 !important;
    margin: 4px auto !important;
}
.gestionale-rimuovi:hover {
    background: #4b5563 !important;
}

/* ============================================================
   NOTIFICHE
   ============================================================ */
.gestionale-warning,
.gestionale-success,
.gestionale-errore {
    margin: 12px 10px;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 14px;
}

.gestionale-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.gestionale-errore {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.gestionale-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.gestionale-warning h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.gf-riepilogo {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 13px;
}
.gf-riepilogo th,
.gf-riepilogo td {
    padding: 4px 8px;
    border-bottom: 1px solid #e5c97a;
    text-align: left;
}
.gf-riepilogo th { background: #fde68a; font-weight: 700; }
.gf-riepilogo tr.totale td { font-weight: 700; background: #fff8e1; }

.gf-actions {
    margin-top: 8px;
    text-align: center;
}

.gestionale-annulla {
    display: inline-block;
    padding: 7px 16px;
    background: #e5e7eb;
    border-radius: 7px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    margin-left: 8px;
}
.gestionale-annulla:hover { background: #d1d5db; }

/* ============================================================
   RIGA DIPENDENTE
   ============================================================ */
.gf-riga {
    margin: 6px 0 10px;
    padding: 6px 0;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.gestionale-dashboard table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.gestionale-dashboard th,
.gestionale-dashboard td {
    padding: 6px 10px;
    border-bottom: 1px solid #afafaf;
    text-align: left;
    font-size: 14px;
}
.gestionale-dashboard th {
    background: #f3f4f6;
    font-weight: 700;
    border-bottom: 2px solid #000;
}
.gestionale-dashboard tr:hover { background: #fafafa; }
.gestionale-dashboard .negativo { color: #dc2626; font-weight: 600; }

/* ============================================================
   LINK "AGGIUNGI DIPENDENTE"
   ============================================================ */
.gf-link-dip {
    margin: 10px 0 0;
    text-align: center;
}

/* ============================================================
   MODALE DIPENDENTE
   ============================================================ */
.gf-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.gf-modal-box {
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.gf-modal-box h4 {
    margin: 0 0 10px;
    font-size: 18px;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
}
.gf-nota {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    text-align: center;
}

/* ============================================================
   TABELLA DIPENDENTI
   ============================================================ */
.gf-tabella-dip {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.gf-tabella-dip th,
.gf-tabella-dip td {
    padding: 6px 10px;
    border-bottom: 1px solid #afafaf;
    text-align: left;
    font-size: 14px;
}
.gf-tabella-dip th {
    background: #f3f4f6;
    font-weight: 700;
    border-bottom: 2px solid #000;
}
.gf-tabella-dip form {
    display: inline;
}
.gf-tabella-dip button {
    width: auto !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    margin: 0 !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .gestionale-form label {
        width: 95%;
        margin-left: 2.5%;
    }
    .gestionale-form input[type="text"],
    .gestionale-form input[type="number"],
    .gestionale-form input[type="date"],
    .gestionale-form input[type="time"],
    .gestionale-form select {
        width: 95%;
        margin-left: 2.5%;
    }
    .gestionale-form button,
    .gestionale-form input[type="submit"] {
        width: 80%;
        margin: 10px auto;
    }
}