/* ==========================================================================
   Il Gestionale per Hotel - GestionaleView
   ========================================================================== */
:root {
    --gph-blu: #12355b;
    --gph-blu-scuro: #0b2340;
    --gph-accento: #e0a526;
    --gph-sfondo: #f3f5f9;
    --gph-bordo: #e3e8ef;
    --gph-testo-tenue: #6b7a90;
    --bs-primary: #1d5fa8;
    --bs-primary-rgb: 29, 95, 168;
    --bs-link-color: #1d5fa8;
    --bs-link-color-rgb: 29, 95, 168;
    --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--gph-sfondo); color: #1f2a37; }
.btn-primary { --bs-btn-bg: #1d5fa8; --bs-btn-border-color: #1d5fa8; --bs-btn-hover-bg: #174d89; --bs-btn-hover-border-color: #174d89; --bs-btn-active-bg: #133f70; }
.btn-outline-primary { --bs-btn-color: #1d5fa8; --bs-btn-border-color: #1d5fa8; --bs-btn-hover-bg: #1d5fa8; --bs-btn-hover-border-color: #1d5fa8; }
.text-bg-primary { background-color: #1d5fa8 !important; }
.page-item.active .page-link { background-color: #1d5fa8; border-color: #1d5fa8; }

/* --- struttura ------------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 252px; flex-shrink: 0; background: linear-gradient(180deg, var(--gph-blu) 0%, var(--gph-blu-scuro) 100%);
    color: #cbd6e6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1030;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-logo {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px;
    background: var(--gph-accento); color: var(--gph-blu-scuro); font-size: 1.25rem;
}
.brand-logo.grande { width: 58px; height: 58px; font-size: 1.8rem; border-radius: 16px; }
.brand-testo { font-weight: 700; line-height: 1.05; font-size: 1.05rem; }
.brand-testo small { display: block; font-weight: 400; font-size: .78rem; color: #9fb3cc; letter-spacing: .04em; }
.menu { padding: .5rem .75rem 1rem; display: flex; flex-direction: column; gap: 2px; }
.menu-sezione { text-transform: uppercase; font-size: .68rem; letter-spacing: .09em; color: #7f95b2; padding: 1rem .75rem .35rem; }
.menu a {
    display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 9px; color: #d5deea;
    text-decoration: none; font-size: .93rem;
}
.menu a i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu a.active { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset 3px 0 0 var(--gph-accento); }
.sidebar-footer { margin-top: auto; padding: 1rem 1.25rem; font-size: .75rem; color: #7f95b2; border-top: 1px solid rgba(255,255,255,.07); }

.contenuto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 1rem; padding: .85rem 1.75rem; background: #fff;
    border-bottom: 1px solid var(--gph-bordo); position: sticky; top: 0; z-index: 1020;
}
.titolo-pagina { font-size: 1.25rem; font-weight: 650; margin: 0; color: var(--gph-blu-scuro); }
.pagina { padding: 1.5rem 1.75rem 3rem; }
.badge-token {
    align-items: center; gap: .35rem; font-size: .78rem; color: #1f6f43; background: #e8f6ee; border: 1px solid #c7ead6;
    padding: .3rem .6rem; border-radius: 99px;
}
.btn-utente { display: flex; align-items: center; gap: .5rem; background: transparent; border: 1px solid var(--gph-bordo); border-radius: 99px; padding: .25rem .75rem .25rem .3rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gph-blu); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: -260px; transition: left .2s ease; }
    .sidebar.aperta { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .pagina { padding: 1rem; }
    .topbar { padding: .75rem 1rem; }
}

/* --- componenti -------------------------------------------------------------- */
.card-gph { border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06); }
.card-gph > .card-header { border-bottom: 1px solid var(--gph-bordo); padding: .9rem 1.15rem; border-radius: 14px 14px 0 0; }
.card-gph .table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .8rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gph-testo-tenue); font-weight: 600; background: #f8fafc; border-bottom-width: 1px; }
.table-hover tbody tr { cursor: default; }
.tabella-link tbody tr { cursor: pointer; }

.kpi { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: 1rem; }
.kpi-icona { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi-valore { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: var(--gph-blu-scuro); }
.kpi-etichetta { font-size: .8rem; color: var(--gph-testo-tenue); }
.k-blu { background: #e6effa; color: #1d5fa8; }
.k-verde { background: #e3f5ea; color: #1f8a4c; }
.k-ambra { background: #fdf2dc; color: #b7791f; }
.k-viola { background: #efe9fb; color: #6d4bc4; }
.k-rosso { background: #fde8e8; color: #c53030; }
.k-ciano { background: #e0f5f8; color: #0f7f91; }

.filtri { background: #fff; border-radius: 14px; padding: 1rem 1.15rem; border: 1px solid var(--gph-bordo); margin-bottom: 1rem; }
.filtri .form-label { font-size: .78rem; color: var(--gph-testo-tenue); margin-bottom: .2rem; }

.form-label { font-weight: 500; font-size: .88rem; }
.sezione-form { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gph-testo-tenue); margin: 1.25rem 0 .6rem; font-weight: 600; }

.pallino { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.pallino.on { background: #22a35a; box-shadow: 0 0 0 3px #d9f3e3; }
.pallino.off { background: #d64545; box-shadow: 0 0 0 3px #fbe3e3; }

.storico-note { font-size: .88rem; max-height: 360px; overflow-y: auto; }
.icona-stato { width: 70px; height: 70px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; }
.icona-stato.avviso { background: #fdf2dc; color: #b7791f; }
.icona-stato.errore { background: #fde8e8; color: #c53030; }
.icona-stato.ok { background: #e3f5ea; color: #1f8a4c; }

.ota-card { border-left: 4px solid var(--gph-accento) !important; }

/* --- autocomplete ------------------------------------------------------------ */
.ac-wrapper { position: relative; }
.ac-lista { position: absolute; top: 100%; left: 0; right: 0; z-index: 1050; max-height: 260px; overflow-y: auto; display: none; }
.ac-lista.mostra { display: block; }
.ac-lista .list-group-item { cursor: pointer; font-size: .9rem; }
.ac-lista .list-group-item:hover, .ac-lista .list-group-item.attivo { background: #eef4fb; }

/* --- planning ------------------------------------------------------------------ */
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendario .intestazione { text-align: center; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gph-testo-tenue); font-weight: 600; padding-bottom: 2px; }
.giorno {
    min-height: 96px; border-radius: 12px; padding: .5rem .6rem; border: 1px solid rgba(15, 23, 42, .08); cursor: pointer;
    display: flex; flex-direction: column; transition: transform .08s ease, box-shadow .08s ease; color: #1f2a37;
}
.giorno:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, .12); }
.giorno.vuoto { background: transparent; border: none; cursor: default; box-shadow: none; transform: none; }
.giorno.oggi { outline: 3px solid var(--bs-primary); outline-offset: 1px; }
.giorno .numero { font-weight: 700; font-size: 1.05rem; }
.giorno .info { margin-top: auto; font-size: .78rem; }
.giorno .barra { height: 5px; border-radius: 4px; background: rgba(0,0,0,.08); overflow: hidden; margin-top: 4px; }
.giorno .barra span { display: block; height: 100%; background: rgba(0,0,0,.35); }
.giorno.scuro { color: #fff; }
.giorno.scuro .barra { background: rgba(255,255,255,.3); }
.giorno.scuro .barra span { background: #fff; }
.legenda { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .82rem; }
.legenda span { display: inline-flex; align-items: center; gap: .35rem; }
.legenda i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.1); display: inline-block; }
@media (max-width: 767.98px) {
    .calendario { gap: 4px; }
    .giorno { min-height: 64px; padding: .3rem; }
    .giorno .info { font-size: .65rem; }
}

/* --- accesso --------------------------------------------------------------------- */
body.accesso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.accesso-sfondo { position: fixed; inset: 0; z-index: -1; background:
    radial-gradient(circle at 15% 20%, rgba(224, 165, 38, .25), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(29, 95, 168, .35), transparent 45%),
    linear-gradient(135deg, #0b2340 0%, #12355b 100%); }
.accesso-box { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 2.25rem; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); }
