
/* CHIMAPOS - GESTIONALE STUDIO */

:root {
    --primary: #153D39;
    --primary-light: #24665D;
    --background: #F4F7F6;
    --white: #FFFFFF;
    --text: #20312E;
    --muted: #71817D;
    --border: #DFE7E4;
    --success: #198754;
    --danger: #DC3545;
    --warning: #E5A32E;
    --whatsapp: #25D366;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* IMPOSTAZIONI GENERALI */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
    transition: background 0.2s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #68A99D;
    outline-offset: 2px;
}

/* SCHERMATA DI ACCESSO */

#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(
        135deg, #153D39, #34786C
    );
}

.login-card {
    background: var(--white);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 22px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.login-card h1 {
    text-align: center;
    color: var(--primary);
    font-size: 32px;
    letter-spacing: 3px;
}

.login-card > p {
    text-align: center;
    color: var(--muted);
    margin: 8px 0 32px;
    letter-spacing: 1px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    color: var(--text);
    margin-bottom: 18px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-light);
}

.login-card button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 9px;
    font-weight: 600;
}

.login-card button:hover {
    background: var(--primary-light);
}

#login-error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 15px;
}

/* STRUTTURA DASHBOARD */

#dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--primary);
    color: white;
    padding: 28px 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar h2 {
    text-align: center;
    letter-spacing: 2px;
    font-size: 23px;
    margin-bottom: 40px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav button {
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    border: none;
    border-radius: 9px;
    color: #E2EEEB;
    background: transparent;
    font-size: 15px;
}

.sidebar nav button:hover,
.sidebar nav button.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

#logout {
    margin-top: 35px;
    color: #FFC9C9;
}

.content {
    margin-left: 250px;
    padding: 32px;
    width: calc(100% - 250px);
    min-width: 0;
}

#page-title {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 25px;
}

/* SCHEDE E STATISTICHE */

.card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h2, .card h3 {
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit, minmax(180px, 1fr)
    );
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-light);
}

.stat-card p {
    color: var(--muted);
    font-size: 14px;
}

.stat-card h2 {
    font-size: 32px;
    color: var(--primary);
    margin-top: 10px;
}

/* PULSANTI */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 11px 17px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #103B20;
}

.btn-whatsapp:hover {
    background: #1EBE5D;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: #E8EFEC;
    color: var(--primary);
}

/* TABELLE */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: #EDF3F1;
    color: var(--primary);
    text-align: left;
    font-size: 13px;
    padding: 14px;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tr:hover td {
    background: #F8FAF9;
}

/* MODULI */

.form-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit, minmax(200px, 1fr)
    );
    gap: 15px;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* STATO APPUNTAMENTI */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.prenotato {
    background: #FFF1D6;
    color: #946200;
}

.confermato {
    background: #DCEBFF;
    color: #2457A6;
}

.completato {
    background: #DDF5E5;
    color: #197542;
}

.annullato {
    background: #FCE1E1;
    color: #A62929;
}

/* AGENDA */

.appointment {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-light);
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
}

.appointment-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.appointment-info {
    flex: 1;
    min-width: 140px;
}

/* SMARTPHONE E TABLET */

@media (max-width: 768px) {

    #dashboard {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        padding: 16px;
    }

    .sidebar h2 {
        margin-bottom: 15px;
    }

    .sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
    }

    .sidebar nav button {
        width: auto;
        white-space: nowrap;
        padding: 10px 14px;
    }

    #logout {
        margin-top: 0;
    }

    .content {
        width: 100%;
        margin-left: 0;
        padding: 18px;
    }

    #page-title {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .login-card {
        padding: 28px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
