﻿:root {
    --tvm-blue: #0a58ca;
    --tvm-blue-dark: #073d8f;
    --tvm-dark: #14161c;
    --tvm-dark-2: #1e212a;
}

html {
    font-size: 14.5px;
}

body {
    background-color: #f4f5f7;
}

/* ---------- Layout con sidebar ---------- */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--tvm-dark) 0%, var(--tvm-dark-2) 55%, #12203a 100%);
    color: #fff;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.6rem 1.2rem 1.2rem;
    text-align: center;
}

.brand-logo {
    font-size: 1.15rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: .4px;
    line-height: 1.25;
    color: #fff;
}

.brand-logo-dark {
    color: var(--tvm-blue);
}

.brand-sub {
    margin-top: .35rem;
    font-size: 1.02rem;
    line-height: 1.25;
    color: #e8e6e6;
}

.sidebar-nav {
    margin-top: 1rem;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .72rem 1.2rem;
    color: #ddd;
    text-decoration: none;
    font-size: .95rem;
    border: 0;
    background: transparent;
    text-align: left;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: var(--tvm-blue);
    color: #fff;
    font-weight: 600;
}

.nav-icon {
    width: 1.4rem;
    text-align: center;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .92rem;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    color: var(--tvm-dark);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
}

.main-content {
    flex-grow: 1;
    padding: 1.6rem 2rem 3rem;
    min-width: 0;
}

/* ---------- Pagine di autenticazione ---------- */

.auth-body {
    min-height: 100vh;
    background: linear-gradient(150deg, #20232a 0%, #162947 60%, #12347a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 460px;
}

.auth-card {
    background: #fff;
    border-radius: 10px;
    padding: 2rem 1.8rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

.auth-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: #222;
}

.auth-welcome {
    color: var(--tvm-blue);
    font-weight: 800;
    letter-spacing: .4px;
    text-align: center;
}

/* ---------- Pulsanti ---------- */

.btn-tvm {
    background: #fff;
    border: 2px solid var(--tvm-blue);
    color: var(--tvm-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.btn-tvm:hover {
    background: var(--tvm-blue);
    color: #fff;
}

.btn-tvm-solid {
    background: var(--tvm-blue);
    border: 2px solid var(--tvm-blue);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.btn-tvm-solid:hover {
    background: var(--tvm-blue-dark);
    border-color: var(--tvm-blue-dark);
    color: #fff;
}

.btn-outline-dark-tvm {
    background: #fff;
    border: 2px solid #222;
    color: #222;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.btn-outline-dark-tvm:hover {
    background: #222;
    color: #fff;
}

/* ---------- Intestazioni pagina ---------- */

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header .subtitle {
    color: #777;
    font-size: .92rem;
}

.btn-add-round {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tvm-blue);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    text-decoration: none;
}

.btn-add-round:hover {
    background: var(--tvm-blue-dark);
    color: #fff;
}

/* ---------- Sezioni form ---------- */

.section-bar {
    background: var(--tvm-blue);
    color: #fff;
    font-weight: 700;
    padding: .55rem .9rem;
    border-radius: 4px 4px 0 0;
    text-transform: uppercase;
    font-size: .9rem;
}

.section-body {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    padding: 1.3rem;
}

/* ---------- Calendario disponibilità ---------- */

.calendario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.calendario-table th {
    background: var(--tvm-blue);
    color: #fff;
    text-align: center;
    padding: .45rem .3rem;
    border: 1px solid #fff;
}

.calendario-table td {
    border: 1px solid #eee;
    text-align: center;
    padding: .45rem .3rem;
}

.calendario-table td.ora {
    font-weight: 600;
    color: #555;
    background: #fafafa;
    width: 64px;
}

.slot {
    cursor: default;
    user-select: none;
    font-weight: 600;
}

.slot-libero {
    color: #1c8a3c;
    background: #fff;
    cursor: pointer;
}

.slot-libero:hover {
    outline: 2px solid #1c8a3c;
    outline-offset: -2px;
}

.slot-occupato {
    color: var(--tvm-blue);
    background: #e7effd;
}

/* Slot occupato scelto come destinazione di uno spostamento (solo area admin). */
.slot-spostabile {
    cursor: pointer;
}

.slot-spostabile:hover {
    outline: 2px solid var(--tvm-blue);
    outline-offset: -2px;
}

.slot-passato {
    color: #aaa;
    background: #f5f5f5;
}

.slot-selezionato {
    background: #2eaf55 !important;
    color: #fff !important;
}

.settimana-badge {
    background: var(--tvm-blue);
    color: #fff;
    font-weight: 700;
    padding: .3rem .7rem;
    border-radius: 4px;
    font-size: .85rem;
}

/* ---------- Tabelle elenco ---------- */

.tabella-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
    padding: 1.2rem;
}

.token-badge {
    background: var(--tvm-blue);
    color: #fff;
    font-weight: 700;
    padding: .25rem .55rem;
    border-radius: 3px;
    letter-spacing: .5px;
}

@media (max-width: 860px) {
    .app-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: 0;
        position: static;
    }

    .main-content {
        padding: 1.2rem 1rem 2.5rem;
    }
}
