/* ================================================================
   BIBLIOTECA CALVINO
   Palette primaria — #4BB3B0 (identica a Presenze Docenti)
   Font: Poppins | Sfondo: #EBEBEB
   ================================================================ */

/* ── Variabili ─────────────────────────────────────────────────── */
:root {
    --teal:          #4BB3B0;
    --teal-dark:     #3A9D9A;
    --teal-light:    #E3F8F7;
    --teal-hover:    #5BBFBC;

    --dark:          #1A3535;
    --gray:          #5F6368;
    --gray-light:    #DADCE0;
    --bg:            #EBEBEB;
    --white:         #FFFFFF;

    --green:         #2E7D32;
    --green-light:   #E8F5E9;
    --red:           #C62828;
    --red-light:     #FFEBEE;
    --yellow:        #F9A825;
    --yellow-light:  #FFF8E1;
    --blue:          #0288D1;
    --blue-light:    #E1F5FE;

    --radius:        30px;
    --radius-card:   16px;
    --radius-sm:     10px;

    --header-h:      4.5rem;
    --sidebar-w:     230px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,.10);
    --shadow-lg:  0 8px 24px rgba(0,0,0,.14);
    --shadow-teal: 0 4px 16px rgba(75,179,176,.28);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── ACCESSIBILITÀ ──────────────────────────────────────────────── */
.skip-link {
    position: absolute; top: -100%; left: 1rem; z-index: 10000;
    background: var(--teal); color: #fff;
    padding: .55rem 1.1rem; border-radius: 0 0 10px 10px;
    font-size: .9rem; font-weight: 600; text-decoration: none;
    transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; outline: 3px solid #fff; outline-offset: 2px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.form-control:focus-visible, .form-select:focus-visible { outline: none; }
.sidebar-link:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.topbar-btn:focus-visible, .topbar .btn:focus-visible { outline: 3px solid rgba(255,255,255,.85); outline-offset: 2px; }

body {
    background: var(--bg);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
}

h1,h2,h3,h4 { color: var(--dark); font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
a  { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
p  { color: #444; }

/* ── LAYOUT ────────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-light);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 150;
    transition: transform .28s ease;
}

.sidebar-brand {
    display: flex; align-items: center; justify-content: center;
    padding: 1.35rem 1rem;
    border-bottom: 2px solid var(--teal-light);
    background: linear-gradient(160deg, var(--teal-light) 0%, #fff 100%);
}
.sidebar-brand-link {
    display: flex; align-items: center; gap: .65rem;
    text-decoration: none; flex: 1; justify-content: center;
}
.sidebar-brand-link:hover { text-decoration: none; }
.brand-icon { font-size: 1.8rem; color: var(--teal); flex-shrink: 0; }
.brand-name { display: block; font-size: 1.15rem; font-weight: 800; color: var(--dark); line-height: 1.15; letter-spacing: -.01em; }
.brand-sub  { display: block; font-size: .88rem; color: var(--teal); font-weight: 600; }

.sidebar-close-btn {
    width: 2rem; height: 2rem; border: none; background: none;
    border-radius: 8px; cursor: pointer; color: var(--gray); font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-close-btn:hover { background: var(--teal-light); color: var(--teal); }

.sidebar-profile {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--gray-light);
}
.avatar-sm {
    width: 2.4rem; height: 2.4rem; border-radius: 50%;
    background: var(--teal-light); color: var(--teal);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0; overflow: hidden;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-profile-name { font-size: .83rem; font-weight: 600; color: var(--dark); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.sidebar-profile-role { font-size: .7rem; color: var(--gray); margin: 0; }

.sidebar-nav { padding: .5rem .6rem; flex: 1; }

.nav-section-title {
    font-size: .65rem; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--gray);
    padding: .85rem .6rem .2rem; margin: 0;
}
.nav-list { list-style: none; padding: 0; margin: 0 0 .25rem; }
.nav-list li { margin: 1px 0; }

.sidebar-link {
    display: flex; align-items: center; gap: .65rem;
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    color: var(--dark);
    font-size: .92rem; font-weight: 500;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, padding-left .15s ease;
}
.sidebar-link i { font-size: 1.05rem; flex-shrink: 0; width: 1.3rem; text-align: center; }
.sidebar-link:hover { background: var(--teal-light); color: var(--teal); text-decoration: none; padding-left: 1.1rem; }
.sidebar-link.active { background: var(--teal); color: #fff; text-decoration: none; padding-left: .85rem; }
.sidebar-link.active i { color: #fff; }
.sidebar-link.active:hover { background: var(--teal-dark); color: #fff; }
.sidebar-link-danger { color: var(--red) !important; }
.sidebar-link-danger:hover { background: var(--red-light) !important; color: var(--red) !important; }

.nav-badge {
    margin-left: auto; font-size: .6rem; font-weight: 700;
    padding: .1rem .4rem; border-radius: 99px; color: #fff;
}
.nav-badge-success { background: var(--green); }
.nav-badge-danger  { background: var(--red); }
.nav-badge-gray    { background: var(--gray); }

.sidebar-footer {
    padding: .8rem 1rem;
    border-top: 1px solid var(--gray-light);
    display: flex; justify-content: space-between; align-items: center;
    font-size: .7rem; color: var(--gray);
}
.sidebar-footer-link { color: var(--gray); text-decoration: none; }
.sidebar-footer-link:hover { color: var(--teal); text-decoration: none; }

.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 149; display: none;
}
.sidebar-overlay.open { display: block; }

/* ── MAIN CONTENT ──────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

/* ── TOPBAR ────────────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.75rem;
    background: var(--teal);
    gap: 1rem;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-teal);
    flex-shrink: 0;
}
.topbar-left  { display: flex; align-items: center; gap: .9rem; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }

.page-title      { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0; line-height: 1.2; }
.page-breadcrumb { font-size: .82rem; color: rgba(255,255,255,.78); margin: 0; }

.sidebar-toggle-main {
    display: none;
    width: 2.4rem; height: 2.4rem;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    color: #fff; font-size: 1.3rem;
    cursor: pointer; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.sidebar-toggle-main:hover { background: rgba(255,255,255,.25); }

.topbar-btn {
    position: relative; width: 2.2rem; height: 2.2rem;
    border: 1px solid rgba(255,255,255,.38); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem; text-decoration: none;
    transition: background .15s, border-color .15s;
    background: rgba(255,255,255,.1);
}
.topbar-btn:hover { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.6); text-decoration: none; }
.topbar .btn, .topbar .btn-outline, .topbar .btn-sm {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.45);
    color: #fff !important;
}
.topbar .btn:hover, .topbar .btn-outline:hover, .topbar .btn-sm:hover {
    background: rgba(255,255,255,.25); color: #fff !important; transform: translateY(-1px);
}

/* ── PAGE CONTENT ──────────────────────────────────────────────── */
.page-content { flex: 1; }

/* ── CARD ──────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--gray-light);
}
.card-header {
    display: flex; align-items: center; gap: .55rem;
    padding: .95rem 1.35rem;
    border-bottom: 1px solid var(--gray-light);
    font-weight: 600; font-size: .92rem; color: var(--dark);
    background: var(--white);
}
.card-header i { color: var(--teal); font-size: 1rem; }
.card-body   { padding: 1.35rem; }
.card-body.p-0 { padding: 0; }

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    border-radius: var(--radius); border: none;
    background: var(--teal); color: #fff;
    font-family: inherit; font-size: .9rem; font-weight: 600;
    height: 2.75rem; min-width: 7rem; padding: 0 1.4rem;
    cursor: pointer; text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--teal-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-success { background: var(--green); }
.btn-success:hover { background: #1b5e20; }
.btn-danger  { background: var(--red); }
.btn-danger:hover { background: #b71c1c; }
.btn-warning { background: var(--yellow); color: var(--dark); }
.btn-warning:hover { background: #f57f17; color: var(--dark); }
.btn-secondary { background: var(--gray); }
.btn-secondary:hover { background: #444; }
.btn-outline { background: transparent; border: 2px solid var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; }

.btn-outline-primary  { color: var(--teal) !important; border-color: var(--teal) !important; }
.btn-outline-primary:hover { background: var(--teal) !important; color: #fff !important; }
.btn-primary.btn-sm, .btn-primary:not(.btn-outline) { background-color: var(--teal) !important; border-color: var(--teal) !important; }

.btn-sm  { height: 2.1rem; font-size: .8rem; min-width: 5rem; padding: 0 .9rem; }
.btn-lg  { height: 3.2rem; font-size: 1rem; min-width: 9rem; padding: 0 2rem; }
.btn-icon { min-width: 0; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 8px; }

/* ── FORM ──────────────────────────────────────────────────────── */
.form-label { font-size: .85rem; font-weight: 600; color: var(--dark); margin-bottom: .3rem; display: block; }
.form-control, .form-select {
    width: 100%; height: 2.75rem;
    border-radius: var(--radius-sm); border: 1px solid var(--gray-light);
    padding: 0 1rem; font-family: inherit; font-size: .9rem; color: #333;
    background: #fff; transition: border .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    outline: none; border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(75,179,176,.18);
}
textarea.form-control { height: auto; padding: .7rem 1rem; border-radius: var(--radius-sm); }
.form-text { font-size: .75rem; color: var(--gray); margin-top: .3rem; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }

/* ── STAT CARDS ────────────────────────────────────────────────── */
.stat-card {
    background: var(--white); border-radius: var(--radius-card);
    padding: 1.2rem 1.35rem;
    box-shadow: var(--shadow-sm); border: 1px solid var(--gray-light);
    display: flex; flex-direction: column; gap: .5rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-label { font-size: .78rem; color: var(--gray); font-weight: 500; margin: 0; }
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--dark); line-height: 1; margin: 0; }
.stat-delta { font-size: .75rem; color: var(--gray); margin: 0; }
.stat-icon  { width: 2.6rem; height: 2.6rem; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.icon-primary { background: var(--teal-light);   color: var(--teal); }
.icon-success { background: var(--green-light);   color: var(--green); }
.icon-warning { background: var(--yellow-light);  color: var(--yellow); }
.icon-danger  { background: var(--red-light);     color: var(--red); }
.icon-info    { background: var(--blue-light);    color: var(--blue); }

/* ── TABELLA ───────────────────────────────────────────────────── */
.table-custom, table.table {
    width: 100%; border-collapse: collapse; background: var(--white);
}
.table-custom th, table.table th {
    background: var(--teal);
    color: #fff; font-size: .78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    padding: .85rem 1.1rem; text-align: left;
}
.table-custom td, table.table td {
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--gray-light);
    font-size: .95rem; vertical-align: middle;
}
.table-custom tbody tr:last-child td, table.table tbody tr:last-child td { border-bottom: none; }
.table-custom tbody tr:hover td, table.table tbody tr:hover td { background: #F0FBFC; }

/* ── BADGE ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: .28rem .7rem; border-radius: 99px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-success, .bg-success { background: var(--green-light) !important; color: var(--green) !important; border: 1px solid #a5d6a7; }
.badge-warning, .bg-warning { background: var(--yellow-light) !important; color: #7a5200 !important; border: 1px solid #ffe082; }
.badge-info,    .bg-info    { background: var(--blue-light) !important; color: var(--blue) !important; border: 1px solid #90caf9; }
.badge-danger,  .bg-danger  { background: var(--red-light) !important; color: var(--red) !important; border: 1px solid #ef9a9a; }
.badge-primary, .bg-primary { background: var(--teal-light) !important; color: var(--teal) !important; border: 1px solid #80deea; }
.badge-secondary,.bg-secondary { background: #f1f3f4 !important; color: var(--gray) !important; border: 1px solid var(--gray-light); }

/* ── ALERT ─────────────────────────────────────────────────────── */
.alert {
    padding: .85rem 1.25rem; border-radius: var(--radius-card);
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: .65rem;
    font-size: .9rem; font-weight: 500; border: 1px solid transparent;
}
.alert-success { background: var(--green-light);  color: var(--green);  border-color: #a5d6a7; }
.alert-danger  { background: var(--red-light);    color: var(--red);    border-color: #ef9a9a; }
.alert-warning { background: var(--yellow-light); color: #6d3a00;       border-color: #ffe082; }
.alert-info    { background: var(--blue-light);   color: var(--blue);   border-color: #90caf9; }

/* ── PROGRESS ──────────────────────────────────────────────────── */
.progress { height: 8px; background: var(--gray-light); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width .5s ease; }
.progress-bar.bg-success { background: var(--green) !important; }
.progress-bar.bg-warning { background: var(--yellow) !important; }
.progress-bar.bg-primary { background: var(--teal) !important; }

/* ── FOOTER ────────────────────────────────────────────────────── */
.main-footer {
    background: var(--white); border-top: 1px solid var(--gray-light);
    padding: .85rem 1.75rem;
    display: flex; justify-content: space-between; align-items: center;
    font-size: .75rem; color: var(--gray);
}

/* ── LOGIN PAGE ────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--teal-dark) 0%, var(--teal) 60%, #00ACC1 100%);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.login-card {
    background: #fff; border-radius: var(--radius-card);
    padding: 2.25rem 1.85rem; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    width: 3.2rem; height: 3.2rem; background: var(--teal);
    border-radius: 12px; display: flex; align-items: center;
    justify-content: center; font-size: 1.4rem; color: #fff; margin: 0 auto 1.1rem;
}

/* ── EMPTY STATE ───────────────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: .65rem; padding: 2.5rem 1rem; color: var(--gray);
}
.empty-state i { font-size: 2.2rem; opacity: .45; }
.empty-state p { font-size: .9rem; margin: 0; }

/* ── GRID HELPERS ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.35rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.35rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.35rem; }

/* ── COPERTINA RISORSA ─────────────────────────────────────────── */
.risorsa-card {
    background: var(--white); border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm); border: 1px solid var(--gray-light);
    overflow: hidden; transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column;
}
.risorsa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.risorsa-cover {
    background: linear-gradient(145deg, var(--teal-light) 0%, #e8f5e9 100%);
    height: 140px; display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--teal);
}
.risorsa-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.risorsa-titolo { font-size: .95rem; font-weight: 700; color: var(--dark); line-height: 1.3; }
.risorsa-autore { font-size: .8rem; color: var(--gray); }
.risorsa-footer { padding: .75rem 1rem; border-top: 1px solid var(--gray-light); display: flex; justify-content: space-between; align-items: center; }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 920px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-content { padding: 1rem; }
    .topbar { padding: .75rem 1rem; flex-wrap: wrap; gap: .5rem; }
    .topbar-left { flex: 1; min-width: 0; }
    .page-title { font-size: 1.05rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .sidebar-toggle-main { display: flex; }
}
@media (min-width: 580px) and (max-width: 920px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .topbar-right { gap: .4rem; }
    .topbar-btn { width: 2rem; height: 2rem; font-size: .9rem; }
    .card-body { padding: 1rem; }
    .btn { height: 2.5rem; font-size: .88rem; }
}

/* ── UTILITY ───────────────────────────────────────────────────── */
.d-flex         { display: flex; }
.d-none         { display: none !important; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.flex-wrap      { flex-wrap: wrap; }
.gap-1 { gap: .4rem; } .gap-2 { gap: .85rem; } .gap-3 { gap: 1.35rem; }
.mt-1 { margin-top: .4rem; }  .mt-2 { margin-top: .85rem; }
.mt-3 { margin-top: 1.25rem; } .mt-4 { margin-top: 1.75rem; }
.mb-1 { margin-bottom: .4rem; } .mb-2 { margin-bottom: .85rem; }
.mb-3 { margin-bottom: 1.25rem; } .mb-4 { margin-bottom: 1.75rem; }
.ms-auto { margin-left: auto; } .me-1 { margin-right: .4rem; } .me-2 { margin-right: .85rem; }
.p-0 { padding: 0 !important; }
.px-3 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-2 { padding-top: .85rem; padding-bottom: .85rem; }
.text-center { text-align: center; } .text-end { text-align: right; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.small  { font-size: .82rem; }
.w-100  { width: 100%; } .h-100 { height: 100%; }
.text-muted   { color: var(--gray) !important; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.text-primary { color: var(--teal) !important; }
.text-warning { color: var(--yellow) !important; }
.border-bottom { border-bottom: 1px solid var(--gray-light) !important; }
.rounded-circle { border-radius: 50% !important; }
.flex-shrink-0 { flex-shrink: 0; }
.table-responsive { overflow-x: auto; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); }

/* Input-group Bootstrap compat */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; flex: 1; }
.input-group .form-control:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text {
    display: flex; align-items: center; padding: 0 .85rem;
    background: #f8f9fa; border: 1px solid var(--gray-light);
    border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: .9rem; color: var(--gray); flex-shrink: 0;
}
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; min-width: 0; height: 2.75rem; }

/* Bootstrap grid compat */
.row { display: flex; flex-wrap: wrap; margin: 0 -.65rem; }
.row.g-3 { gap: 1rem; margin: 0; }
[class^="col-"] { padding: 0 .65rem; box-sizing: border-box; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6  { flex: 0 0 50%;  max-width: 50%; }
.col-lg-6 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 992px) { .col-lg-6 { flex: 0 0 50%; max-width: 50%; } }

/* Avatar nelle tabelle */
.tbl-avatar {
    width: 2rem; height: 2rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; flex-shrink: 0;
    background: var(--teal-light); color: var(--teal);
}

/* Spinner Bootstrap compat */
.spinner-border {
    display: inline-block; width: 1rem; height: 1rem;
    border: .15em solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FADE-IN ────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .3s ease; }

/* ── NO-SCROLL APP LAYOUT ───────────────────────────────────────── */
html, body { height: 100%; overflow: hidden; }
.app-wrapper { height: 100vh; overflow: hidden; }
.main-content { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.page-content {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
    padding: 1.5rem 1.75rem;
    scrollbar-width: thin; scrollbar-color: var(--teal-light) transparent;
}
.page-content::-webkit-scrollbar { width: 5px; }
.page-content::-webkit-scrollbar-track { background: transparent; }
.page-content::-webkit-scrollbar-thumb { background: var(--teal-light); border-radius: 99px; }
.page-content::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ── MODAL LOGOUT ───────────────────────────────────────────────── */
.logout-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.52);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    animation: fadeIn .18s ease;
}
.logout-modal {
    background: var(--white); border-radius: var(--radius-card);
    padding: 2rem 2.25rem 1.75rem; max-width: 360px;
    width: calc(100% - 2rem); text-align: center;
    box-shadow: var(--shadow-lg); position: relative;
}
.logout-modal-icon {
    width: 3.4rem; height: 3.4rem; background: var(--red-light);
    color: var(--red); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin: 0 auto 1rem;
}
.logout-modal-title { font-size: 1.1rem; font-weight: 700; color: var(--dark); margin-bottom: .35rem; }
.logout-modal-text  { font-size: .86rem; color: var(--gray); margin-bottom: 1.5rem; line-height: 1.5; }
.logout-modal-actions { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.logout-modal-cancel {
    background: none; border: none; color: var(--gray);
    font-size: .82rem; font-family: 'Poppins', sans-serif; font-weight: 500;
    cursor: pointer; padding: .25rem .5rem; transition: color .15s;
}
.logout-modal-cancel:hover { color: var(--dark); }

/* ── NOTE VARIABILI compat profilo.php ──────────────────────────── */
:root { --primary: var(--teal); --primary-light: var(--teal-light); }

/* Btn portale */
.btn-portale {
    background: linear-gradient(135deg, #1a56db 0%, #1e40af 100%);
    color: #fff; border: none; transition: opacity .2s, transform .1s;
}
.btn-portale:hover:not(:disabled)  { opacity: .9; color: #fff; }
.btn-portale:active:not(:disabled) { transform: scale(.98); }
.btn-portale:disabled { opacity: .65; cursor: not-allowed; }
.btn-portale .spinner-border { width: 1rem; height: 1rem; border-width: 2px; }
.divider-text {
    display: flex; align-items: center; gap: .75rem;
    color: #9ca3af; font-size: .8rem;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-top: 1px solid #e5e7eb; }
