﻿/* =========================================================================
   LaMiaFad — design system del backoffice
   Base: Bootstrap 5.3 (variabili CSS). Colori dal logo: blu "FAD" #5795cb,
   antracite "lamia" #3f4752. Font: Plus Jakarta Sans (locale, licenza OFL).
   Le classi delle pagine (filter-bar, table-grid, home-panel, ...) restano
   le stesse: qui cambia solo l'aspetto.
   ========================================================================= */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../lib/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../lib/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Token ---------- */
:root {
    --lf-brand: #5795cb;          /* blu del logo */
    --lf-brand-600: #3a74ad;
    --lf-brand-700: #2b5c8e;      /* testo/pulsanti su bianco (contrasto AA) */
    --lf-brand-800: #1f4670;
    --lf-brand-50: #f0f6fc;
    --lf-brand-100: #dfecf8;
    --lf-brand-200: #c3dbf1;

    --lf-ink: #1e2630;            /* testo principale */
    --lf-charcoal: #3f4752;       /* antracite del logo */
    --lf-muted: #66717f;
    --lf-subtle: #8a94a1;

    --lf-bg: #f3f5f8;             /* sfondo applicazione */
    --lf-surface: #ffffff;
    --lf-surface-2: #f8fafc;
    --lf-border: #e1e6ed;
    --lf-border-strong: #cfd7e1;

    --lf-success: #2f7d55;
    --lf-success-50: #e9f6ef;
    --lf-warning: #b7791f;
    --lf-warning-50: #fdf6e7;
    --lf-danger: #c0392b;
    --lf-danger-50: #fcecea;
    --lf-bordeaux: #8b1e3f;       /* voucher */
    --lf-podio-1: #8a6100; --lf-podio-1-bg: #fff4d6; --lf-podio-1-bd: #f0d38a;   /* classifiche: oro */
    --lf-podio-2: #3f4752; --lf-podio-2-bg: #e3e8ee; --lf-podio-2-bd: #a9b4c1;   /* argento */
    --lf-podio-3: #8a4b1c; --lf-podio-3-bg: #f8e9dd; --lf-podio-3-bd: #e3bf9f;   /* bronzo */

    --lf-sidebar: #18212c;
    --lf-sidebar-2: #202b38;
    --lf-sidebar-text: #b9c4d1;
    --lf-sidebar-muted: #6f7d8d;

    --lf-radius: .5rem;
    --lf-radius-lg: .8rem;
    --lf-foto-corso: 3 / 2;       /* proporzioni delle immagini dei corsi (avatars di eFront, 273×182) */
    --lf-cella-tronca: 14rem;         /* larghezza massima dei testi troncati (table-compatta) */
    --lf-cella-tronca-larga: 22rem;
    --lf-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --lf-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .05);
    --lf-shadow-panel: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .06);   /* tabelle e schede */

    --lf-table-head-bg: #e7ecf2;
    --lf-table-head-border: #c9d2dd;
    --lf-table-row-border: #e3e8ee;
    --lf-table-striped: #f5f7fa;
    --lf-table-hover: #e6f0fa;

    --lf-stato-off: #8a96a5;      /* pulsante Disattivo */
    --lf-stato-off-hover: #75828f;
    --lf-ring: 0 0 0 .22rem rgba(87, 149, 203, .28);
    --lf-sidebar-w: 268px;

    /* Bootstrap 5.3 */
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-line-height: 1.55;
    --bs-body-color: var(--lf-ink);
    --bs-body-color-rgb: 30, 38, 48;
    --bs-body-bg: var(--lf-bg);
    --bs-secondary-color: var(--lf-muted);
    --bs-emphasis-color: var(--lf-ink);
    --bs-heading-color: var(--lf-ink);
    --bs-primary: var(--lf-brand-700);
    --bs-primary-rgb: 43, 92, 142;
    --bs-info-rgb: 87, 149, 203;
    --bs-success-rgb: 47, 125, 85;
    --bs-warning-rgb: 240, 180, 41;     /* sfondi bg-warning chiari, testo scuro */
    --bs-danger-rgb: 192, 57, 43;
    --bs-link-color: var(--lf-brand-700);
    --bs-link-color-rgb: 43, 92, 142;
    --bs-link-hover-color: var(--lf-brand-800);
    --bs-link-hover-color-rgb: 31, 70, 112;
    --bs-border-color: var(--lf-border);
    --bs-border-radius: var(--lf-radius);
    --bs-border-radius-sm: .375rem;
    --bs-border-radius-lg: var(--lf-radius-lg);
    --bs-focus-ring-color: rgba(87, 149, 203, .28);
    --bs-tertiary-bg: var(--lf-surface-2);
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
    background: var(--lf-bg);
    font-feature-settings: "ss01" on, "cv11" on;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.015em; color: var(--lf-ink); }
h1, .h1 { font-size: 1.6rem; }
h2, .h2 { font-size: 1.35rem; }
h3, .h3 { font-size: 1.15rem; }
h4, .h4 { font-size: 1.05rem; }
a { text-underline-offset: .18em; }
.text-maroon { color: #9b2c2c !important; }
.text-warning { color: #9a620a !important; }       /* leggibile su bianco */
.text-info { color: var(--lf-brand-700) !important; }
.text-success { color: var(--lf-success) !important; }
.label-legend { font-weight: 600; }
.validation-summary-errors ul { margin-bottom: 0; }

/* Numeri allineati nelle tabelle e nei totali */
.table, .num, .text-end { font-variant-numeric: tabular-nums; }

/* ---------- Pulsanti ---------- */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-padding-x: .95rem;
    --bs-btn-padding-y: .45rem;
    --bs-btn-font-size: .9rem;
    --bs-btn-border-radius: var(--lf-radius);
    --bs-btn-focus-box-shadow: var(--lf-ring);
    letter-spacing: .005em;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { --bs-btn-padding-x: 1.15rem; --bs-btn-padding-y: .55rem; --bs-btn-font-size: .95rem; --bs-btn-border-radius: var(--lf-radius); }
.btn-sm { --bs-btn-padding-x: .6rem; --bs-btn-padding-y: .25rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: .4rem; }

.btn-primary {
    --bs-btn-bg: var(--lf-brand-700); --bs-btn-border-color: var(--lf-brand-700); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--lf-brand-800); --bs-btn-hover-border-color: var(--lf-brand-800); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--lf-brand-800); --bs-btn-active-border-color: var(--lf-brand-800);
    --bs-btn-disabled-bg: var(--lf-brand-600); --bs-btn-disabled-border-color: var(--lf-brand-600);
    box-shadow: var(--lf-shadow-sm);
}
.btn-info {
    --bs-btn-bg: var(--lf-brand-50); --bs-btn-border-color: var(--lf-brand-200); --bs-btn-color: var(--lf-brand-800);
    --bs-btn-hover-bg: var(--lf-brand-100); --bs-btn-hover-border-color: var(--lf-brand); --bs-btn-hover-color: var(--lf-brand-800);
    --bs-btn-active-bg: var(--lf-brand-100); --bs-btn-active-border-color: var(--lf-brand); --bs-btn-active-color: var(--lf-brand-800);
    --bs-btn-disabled-bg: var(--lf-brand-50); --bs-btn-disabled-color: var(--lf-brand-700); --bs-btn-disabled-border-color: var(--lf-brand-100);
}
.btn-success {
    --bs-btn-bg: var(--lf-success); --bs-btn-border-color: var(--lf-success); --bs-btn-color: #fff;
    --bs-btn-hover-bg: #256746; --bs-btn-hover-border-color: #256746; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1f583c; --bs-btn-active-border-color: #1f583c;
    --bs-btn-disabled-bg: var(--lf-success); --bs-btn-disabled-border-color: var(--lf-success);
    box-shadow: var(--lf-shadow-sm);
}
.btn-danger {
    --bs-btn-bg: var(--lf-danger); --bs-btn-border-color: var(--lf-danger); --bs-btn-color: #fff;
    --bs-btn-hover-bg: #a43125; --bs-btn-hover-border-color: #a43125; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #8f2a20; --bs-btn-active-border-color: #8f2a20;
    --bs-btn-disabled-bg: var(--lf-danger); --bs-btn-disabled-border-color: var(--lf-danger);
}
.btn-warning {
    --bs-btn-bg: var(--lf-warning-50); --bs-btn-border-color: #ecd193; --bs-btn-color: #7a4d0b;
    --bs-btn-hover-bg: #f9e8c2; --bs-btn-hover-border-color: #dfb75a; --bs-btn-hover-color: #6a420a;
    --bs-btn-active-bg: #f6deaa; --bs-btn-active-border-color: #dfb75a; --bs-btn-active-color: #6a420a;
    --bs-btn-disabled-bg: var(--lf-warning-50); --bs-btn-disabled-border-color: #ecd193; --bs-btn-disabled-color: #7a4d0b;
}
.btn-secondary {
    --bs-btn-bg: #556170; --bs-btn-border-color: #556170; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #45505d; --bs-btn-hover-border-color: #45505d; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #3a434e; --bs-btn-active-border-color: #3a434e;
}
.btn-light {
    --bs-btn-bg: var(--lf-surface); --bs-btn-border-color: var(--lf-border-strong); --bs-btn-color: var(--lf-charcoal);
    --bs-btn-hover-bg: var(--lf-surface-2); --bs-btn-hover-border-color: var(--lf-border-strong); --bs-btn-hover-color: var(--lf-ink);
}
.btn-outline-primary {
    --bs-btn-color: var(--lf-brand-700); --bs-btn-border-color: var(--lf-brand-200);
    --bs-btn-hover-bg: var(--lf-brand-50); --bs-btn-hover-color: var(--lf-brand-800); --bs-btn-hover-border-color: var(--lf-brand);
    --bs-btn-active-bg: var(--lf-brand-100); --bs-btn-active-color: var(--lf-brand-800); --bs-btn-active-border-color: var(--lf-brand);
}
.btn-outline-secondary {
    --bs-btn-color: var(--lf-charcoal); --bs-btn-border-color: var(--lf-border-strong); --bs-btn-bg: var(--lf-surface);
    --bs-btn-hover-bg: var(--lf-surface-2); --bs-btn-hover-color: var(--lf-ink); --bs-btn-hover-border-color: #b9c3cf;
    --bs-btn-active-bg: #eef1f5; --bs-btn-active-color: var(--lf-ink); --bs-btn-active-border-color: #b9c3cf;
}
.btn-outline-success {
    --bs-btn-color: var(--lf-success); --bs-btn-border-color: #b5dcc6;
    --bs-btn-hover-bg: var(--lf-success-50); --bs-btn-hover-color: #1f583c; --bs-btn-hover-border-color: var(--lf-success);
    --bs-btn-active-bg: #d6efe1; --bs-btn-active-color: #1f583c; --bs-btn-active-border-color: var(--lf-success);
}
.btn-outline-danger {
    --bs-btn-color: var(--lf-danger); --bs-btn-border-color: #efc2bd;
    --bs-btn-hover-bg: var(--lf-danger-50); --bs-btn-hover-color: #8f2a20; --bs-btn-hover-border-color: var(--lf-danger);
    --bs-btn-active-bg: #f8d9d5; --bs-btn-active-color: #8f2a20; --bs-btn-active-border-color: var(--lf-danger);
}
.btn-outline-info {
    --bs-btn-color: var(--lf-brand-700); --bs-btn-border-color: var(--lf-brand-200); --bs-btn-bg: var(--lf-surface);
    --bs-btn-hover-bg: var(--lf-brand-50); --bs-btn-hover-color: var(--lf-brand-800); --bs-btn-hover-border-color: var(--lf-brand);
    --bs-btn-active-bg: var(--lf-brand-100); --bs-btn-active-color: var(--lf-brand-800); --bs-btn-active-border-color: var(--lf-brand);
}
.btn-link { --bs-btn-color: var(--lf-brand-700); --bs-btn-hover-color: var(--lf-brand-800); font-weight: 600; }

/* ---------- Form ---------- */
.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--lf-charcoal);
    margin-bottom: .3rem;
    letter-spacing: .01em;
}
.form-control, .form-select {
    border-color: var(--lf-border-strong);
    border-radius: var(--lf-radius);
    padding: .45rem .7rem;
    font-size: .9rem;
    color: var(--lf-ink);
    background-color: var(--lf-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-select { padding-right: 2.1rem; }
.form-control:hover:not(:disabled):not([readonly]), .form-select:hover:not(:disabled) { border-color: #b4bfcc; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--lf-brand);
    box-shadow: var(--lf-ring);
}
.form-control::placeholder { color: var(--lf-subtle); }
.form-control[readonly], .form-control:disabled, .form-select:disabled {
    background-color: #f1f4f7;
    color: var(--lf-muted);
    border-color: var(--lf-border);
}
.form-control-sm, .form-select-sm { padding: .3rem .55rem; font-size: .82rem; border-radius: .4rem; }
.form-control-lg, .form-select-lg { font-size: 1rem; }
.form-text { color: var(--lf-subtle); font-size: .78rem; }
.form-check-input { border-color: #b4bfcc; }
.form-check-input:checked { background-color: var(--lf-brand-700); border-color: var(--lf-brand-700); }
.input-group-text { background: var(--lf-surface-2); border-color: var(--lf-border-strong); color: var(--lf-muted); }
.input-group > .btn { box-shadow: none; }
fieldset:disabled .form-label { color: var(--lf-subtle); }
.field-validation-error, .text-danger { color: var(--lf-danger) !important; }

/* ---------- Pannelli, card, filtri ---------- */
.card {
    --bs-card-border-color: var(--lf-border);
    --bs-card-border-radius: var(--lf-radius-lg);
    --bs-card-cap-bg: var(--lf-surface-2);
    box-shadow: var(--lf-shadow-sm);
}
.filter-bar {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    padding: 1rem 1.1rem 1.05rem;
    margin: 0 0 1.25rem;
    box-shadow: var(--lf-shadow-sm);
    position: relative;
}
.filter-bar::before {           /* filo di colore del marchio sul bordo sinistro */
    content: "";
    position: absolute;
    left: -1px; top: 14px; bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--lf-brand);
}
.filter-bar.row { margin-left: 0; margin-right: 0; }
/* La colonna con i pulsanti (Filtra / Azzera / Esporta) prende la larghezza che serve invece di uscire dal riquadro */
.filter-bar > [class*="col"]:has(> .btn, > button) { flex: 0 0 auto; width: auto; max-width: 100%; flex-wrap: wrap; }

/* ---------- Tabelle ---------- */
.table {
    --bs-table-color: var(--lf-ink);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--lf-border);
    --bs-table-striped-bg: rgba(87, 149, 203, .035);
    --bs-table-hover-bg: var(--lf-brand-50);
    --bs-table-active-bg: var(--lf-brand-100);
}
.table > :not(caption) > * > * { padding: .6rem .7rem; }
.table-sm > :not(caption) > * > * { padding: .35rem .5rem; }
.table > thead > tr > th, .table > thead > tr > td {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--lf-muted);
    background: var(--lf-surface-2);
    border-bottom: 1px solid var(--lf-border-strong);
    white-space: nowrap;
    vertical-align: middle;
}
.table-grid {
    --bs-table-striped-bg: var(--lf-table-striped);
    --bs-table-hover-bg: var(--lf-table-hover);
    --bs-table-border-color: var(--lf-table-row-border);
    font-size: .875rem;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border-strong);
    border-radius: var(--lf-radius-lg);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    box-shadow: var(--lf-shadow-panel);
}
/* intestazione ben separata dalle righe */
.table-grid > thead > tr > th {
    background: var(--lf-table-head-bg);
    color: var(--lf-charcoal);
    border-bottom: 1px solid var(--lf-table-head-border);
    padding-top: .7rem; padding-bottom: .7rem;
}
/* riga sotto il mouse: fondo azzurro e filetto blu a sinistra */
.table-grid.table-hover > tbody > tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--lf-brand), inset 0 0 0 9999px var(--bs-table-hover-bg); }
.table-grid > :last-child > tr:last-child > * { border-bottom-width: 0; }
.table-grid th a { color: inherit; text-decoration: none; }
.table-grid th a:hover { color: var(--lf-brand-700); }
.table-grid td.num, .table-grid th.num { text-align: right; }
.table-grid img { vertical-align: middle; }
.table-responsive > .table-grid { margin-bottom: 0; }
/* elenchi con molte colonne: una riga di testo per record, i testi lunghi troncati (valore intero nel title) */
.table-compatta > tbody > tr > td { padding-top: .3rem; padding-bottom: .3rem; white-space: nowrap; }
.cella-tronca { display: inline-block; max-width: var(--lf-cella-tronca); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.cella-tronca-larga { max-width: var(--lf-cella-tronca-larga); }
.cella-recapito { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; }
.cella-recapito > .ico { cursor: help; }
.table-responsive { margin-bottom: 1rem; border-radius: var(--lf-radius-lg); }
.table-dark { --bs-table-bg: var(--lf-sidebar); --bs-table-color: #e7edf3; }

/* ---------- Navigazione interna ---------- */
.nav-tabs {
    --bs-nav-tabs-border-color: var(--lf-border);
    --bs-nav-tabs-link-active-bg: transparent;
    --bs-nav-tabs-link-active-border-color: transparent;
    gap: .25rem;
    border-bottom-width: 1px;
}
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--lf-muted);
    font-weight: 600;
    font-size: .9rem;
    padding: .6rem .9rem;
    margin-bottom: -1px;
}
.nav-tabs .nav-link:hover { color: var(--lf-ink); border-bottom-color: var(--lf-border-strong); }
.nav-tabs .nav-link.active { color: var(--lf-brand-700); border-bottom-color: var(--lf-brand); background: transparent; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--lf-brand-700); }
.nav-pills .nav-link { font-weight: 600; }

.pagination {
    --bs-pagination-color: var(--lf-charcoal);
    --bs-pagination-border-color: var(--lf-border);
    --bs-pagination-hover-bg: var(--lf-brand-50);
    --bs-pagination-hover-color: var(--lf-brand-800);
    --bs-pagination-hover-border-color: var(--lf-brand-200);
    --bs-pagination-active-bg: var(--lf-brand-700);
    --bs-pagination-active-border-color: var(--lf-brand-700);
    --bs-pagination-focus-box-shadow: var(--lf-ring);
    gap: .25rem;
}
.pagination .page-link { border-radius: .4rem !important; min-width: 2rem; text-align: center; font-weight: 600; }

.badge { font-weight: 600; letter-spacing: .02em; }
.alert { border-radius: var(--lf-radius-lg); }
.modal { --bs-modal-border-radius: 1rem; --bs-modal-border-color: transparent; --bs-modal-header-border-color: var(--lf-border); --bs-modal-footer-border-color: var(--lf-border); }
.modal-content { box-shadow: 0 24px 60px rgba(16, 24, 40, .22); }
.modal-title { font-weight: 700; }
.dropdown-menu { --bs-dropdown-border-color: var(--lf-border); --bs-dropdown-link-active-bg: var(--lf-brand-700); box-shadow: var(--lf-shadow); border-radius: var(--lf-radius-lg); }
.progress { --bs-progress-bar-bg: var(--lf-brand-700); }

/* ---------- Home a riquadri (pannello) ---------- */
.home-panel {
    max-width: 1080px;
    margin: 0 auto;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .9rem;
}
.home-panel > .btn, .home-panel > form > .btn {
    margin: 0;
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 1rem 1.1rem;
    border-radius: var(--lf-radius-lg);
}
.home-panel > .btn-info {
    --bs-btn-bg: var(--lf-surface); --bs-btn-border-color: var(--lf-border); --bs-btn-color: var(--lf-ink);
    --bs-btn-hover-bg: var(--lf-surface); --bs-btn-hover-border-color: var(--lf-brand-200); --bs-btn-hover-color: var(--lf-brand-800);
    box-shadow: var(--lf-shadow-sm);
}
.home-panel > .btn-info:hover { box-shadow: var(--lf-shadow); transform: translateY(-1px); }
.home-panel > form { display: contents !important; }
.home-panel > div { grid-column: 1 / -1; }

/* ---------- Home di partner e affiliati (_HomeGestione) ---------- */
.dash-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.6rem 1.9rem;
    margin-bottom: 1.9rem;
    border-radius: var(--lf-radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .09) 1px, transparent 0) 0 0 / 18px 18px,
        linear-gradient(120deg, var(--lf-brand-800) 0%, var(--lf-brand-700) 55%, var(--lf-brand) 100%);
    box-shadow: var(--lf-shadow);
}
.dash-hero-text { position: relative; z-index: 1; min-width: 0; }
.dash-hero-date { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.dash-hero-title { color: #fff; font-size: 1.6rem; font-weight: 500; letter-spacing: -.02em; margin: .3rem 0 .35rem; }
.dash-hero-title span { font-weight: 800; }
.dash-hero-sub { margin: 0; color: rgba(255, 255, 255, .82); font-size: .92rem; }
.dash-hero-art {
    position: absolute;
    right: 1.5rem; top: 50%;
    transform: translateY(-50%) rotate(-8deg);
    font-size: 7.5rem; line-height: 1;
    color: rgba(255, 255, 255, .12);
    pointer-events: none;
}

.dash-group { margin-bottom: 1.75rem; }
.dash-group-title {
    display: flex; align-items: center; gap: .75rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--lf-muted);
    margin: 0 0 .8rem;
}
.dash-group-title::after { content: ""; flex: 1; height: 1px; background: var(--lf-border); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.dash-tile {
    position: relative;
    display: flex; align-items: flex-start; gap: .9rem;
    padding: 1rem 2.2rem 1rem 1rem;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-sm);
    color: var(--lf-ink);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dash-tile:hover, .dash-tile:focus-visible { border-color: var(--lf-brand-200); box-shadow: var(--lf-shadow); transform: translateY(-2px); color: var(--lf-ink); }
.dash-tile:focus-visible { outline: none; box-shadow: var(--lf-ring); }
.dash-tile-icon {
    flex: 0 0 auto;
    width: 2.6rem; height: 2.6rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: .6rem;
    background: var(--lf-brand-50);
    border: 1px solid var(--lf-brand-100);
    color: var(--lf-brand-700);
    font-size: 1.2rem;
    transition: background-color .15s ease, color .15s ease;
}
.dash-tile:hover .dash-tile-icon { background: var(--lf-brand-700); border-color: var(--lf-brand-700); color: #fff; }
.dash-tile-body { display: flex; flex-direction: column; min-width: 0; }
.dash-tile-title { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
/* attivi su totale (aziende, affiliati) accanto al titolo del riquadro */
.dash-tile-count {
    padding: .1rem .55rem; border-radius: 999px;
    background: var(--lf-brand-50); border: 1px solid var(--lf-brand-100);
    color: var(--lf-muted); font-size: .72rem; font-weight: 600; letter-spacing: 0; white-space: nowrap;
}
.dash-tile-count b { color: var(--lf-brand-700); font-weight: 700; }
.dash-tile-desc { color: var(--lf-muted); font-size: .8rem; line-height: 1.4; margin-top: .15rem; }
.dash-tile-go {
    position: absolute; right: .75rem; top: 50%;
    transform: translate(-4px, -50%);
    font-size: 1.4rem; color: var(--lf-brand-700);
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
}
.dash-tile:hover .dash-tile-go { opacity: 1; transform: translate(0, -50%); }
/* home azienda: nessuna scadenza da segnalare */
.dash-ok { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .85rem 1rem; background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); color: var(--lf-muted); font-size: .9rem; }

@media (max-width: 767.98px) {
    .dash-hero { padding: 1.25rem 1.2rem; margin-bottom: 1.4rem; }
    .dash-hero-title { font-size: 1.3rem; }
    .dash-hero-art { font-size: 5rem; right: .5rem; }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .dash-tile, .dash-tile-icon, .dash-tile-go { transition: none; } }

/* ---------- Home del discente: accesso rapido e assistenza (riquadri grandi e centrati, _HomeCard) ---------- */
/* titoli delle sezioni leggibili: niente maiuscoletto piccolo e grigio */
.dash-group-title-grande { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; text-transform: none; color: var(--lf-ink); margin-bottom: 1rem; }
/* titolo centrato sopra le righe di card centrate, con la linea da entrambi i lati */
.dash-group-title-centro { justify-content: center; }
.dash-group-title-centro::before { content: ""; flex: 1; height: 1px; background: var(--lf-border); }
/* Card di larghezza fissa su una riga centrata (3 di accesso rapido, sotto le 2 di assistenza); su schermi stretti si restringono, sotto i 768px una colonna */
.home-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 20rem); justify-content: center; gap: 1.25rem; }
.home-card {
    display: flex; flex-direction: column; align-items: center; gap: .35rem;
    padding: 1.2rem 1.5rem 1.1rem;
    text-align: center;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-sm);
    color: var(--lf-ink);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.home-card:hover, .home-card:focus-visible { border-color: var(--lf-brand-200); box-shadow: var(--lf-shadow); transform: translateY(-2px); color: var(--lf-ink); }
.home-card:focus-visible { outline: none; box-shadow: var(--lf-ring); }
.home-card-icon {
    width: 3.25rem; height: 3.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: .2rem;
    border-radius: 50%;
    background: var(--lf-brand-50);
    border: 1px solid var(--lf-brand-100);
    color: var(--lf-brand-700);
    font-size: 1.5rem;
    transition: background-color .15s ease, color .15s ease;
}
.home-card:hover .home-card-icon, .home-card:focus-visible .home-card-icon { background: var(--lf-brand-700); border-color: var(--lf-brand-700); color: #fff; }
.home-card-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.home-card-desc { font-size: 1rem; line-height: 1.5; color: var(--lf-charcoal); text-wrap: balance; }
.home-card-go { display: inline-flex; align-items: center; gap: .45rem; margin-top: auto; padding-top: .35rem; font-size: 1rem; font-weight: 700; color: var(--lf-brand-700); }
.home-card-go .bi { transition: transform .15s ease; }
.home-card:hover .home-card-go .bi { transform: translateX(3px); }
@media (max-width: 767.98px) {
    .home-cards { grid-auto-flow: row; grid-template-columns: minmax(0, 26rem); gap: 1rem; }
    .home-card { padding: 1.1rem 1.25rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { .home-card, .home-card-icon, .home-card-go .bi { transition: none; } }

/* ---------- Blocco schermo ---------- */
.lock-screen { position: fixed; inset: 0; background: rgba(24, 33, 44, .45); backdrop-filter: blur(3px); z-index: 3000; display: none; align-items: center; justify-content: center; }
.lock-screen-box { background: var(--lf-surface); padding: 1.6rem 2.2rem; border-radius: var(--lf-radius-lg); text-align: center; box-shadow: 0 24px 60px rgba(16, 24, 40, .25); max-width: 90vw; font-weight: 600; }
.lock-screen-box .spinner-border { color: var(--lf-brand); }

/* ---------- SweetAlert2 ---------- */
.swal2-popup { font-family: var(--bs-body-font-family); border-radius: 1rem; padding: 1.6rem 1.4rem 1.4rem; }
.swal2-title { color: var(--lf-ink); font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.swal2-html-container { color: var(--lf-charcoal); font-size: .95rem; line-height: 1.55; }
.swal2-html-container .table { font-size: .875rem; }
.swal2-actions .btn { min-width: 8.5rem; }

/* =========================================================================
   Shell dell'applicazione: menu laterale (gestione partner/affiliati)
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--lf-sidebar-w);
    flex: 0 0 var(--lf-sidebar-w);
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(87, 149, 203, .16), transparent 60%),
        linear-gradient(180deg, var(--lf-sidebar-2), var(--lf-sidebar) 40%);
    color: var(--lf-sidebar-text);
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: 0; height: 100vh; }
}
.app-sidebar.offcanvas-lg { --bs-offcanvas-width: var(--lf-sidebar-w); --bs-offcanvas-bg: var(--lf-sidebar); --bs-offcanvas-color: var(--lf-sidebar-text); }
@media (max-width: 991.98px) {
    .app-sidebar.offcanvas-lg { background: linear-gradient(180deg, var(--lf-sidebar-2), var(--lf-sidebar) 40%); }
}
.app-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
}
.app-brand img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: .96; }
.app-brand .btn-close { filter: invert(1) grayscale(1); opacity: .7; }

.app-nav { flex: 1 1 auto; overflow-y: auto; padding: .25rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: #3a4757 transparent; }
.app-nav-group {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lf-sidebar-muted);
    padding: 1.1rem .75rem .45rem;
}
.app-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem .75rem;
    margin: 1px 0;
    border-radius: .5rem;
    color: var(--lf-sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.3;
    position: relative;
    transition: background-color .15s ease, color .15s ease;
}
.app-nav a .bi { font-size: 1.05rem; color: var(--lf-sidebar-muted); transition: color .15s ease; flex: 0 0 auto; }
.app-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.app-nav a:hover .bi { color: #cfe2f4; }
.app-nav a.active { background: rgba(87, 149, 203, .2); color: #fff; font-weight: 600; }
.app-nav a.active .bi { color: #8fbde6; }
.app-nav a.active::before {
    content: "";
    position: absolute;
    left: -.75rem; top: .45rem; bottom: .45rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--lf-brand);
}
.app-nav a:focus-visible { outline: 2px solid var(--lf-brand); outline-offset: 1px; }

.app-sidebar-foot {
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding: .9rem 1rem 1rem;
    display: flex;
    align-items: center;
    gap: .7rem;
}
.app-avatar {
    width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(135deg, var(--lf-brand), var(--lf-brand-700));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}
.app-user { min-width: 0; flex: 1 1 auto; }
.app-user-name { color: #fff; font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user-role { color: var(--lf-sidebar-muted); font-size: .72rem; }
.app-logout {
    color: var(--lf-sidebar-text);
    border: 1px solid rgba(255, 255, 255, .12);
    background: transparent;
    border-radius: .5rem;
    width: 2.1rem; height: 2.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.app-logout:hover { background: rgba(192, 57, 43, .18); border-color: rgba(192, 57, 43, .5); color: #fff; }

.app-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    min-height: 64px;
    padding: .65rem 1.75rem;
    background: rgba(243, 245, 248, .86);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--lf-border);
}
.app-menu-toggle {
    border: 1px solid var(--lf-border-strong);
    background: var(--lf-surface);
    border-radius: .5rem;
    width: 2.4rem; height: 2.4rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: var(--lf-charcoal);
}
.app-title { min-width: 0; }
.app-eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lf-brand-700); }
.app-page-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; color: var(--lf-ink); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.app-topbar-actions .btn { white-space: nowrap; }

.app-main {
    flex: 1 1 auto;
    padding: 1.5rem 1.75rem 2rem;
    animation: lf-in .35s ease backwards;
}
.app-footer { padding: 0 1.75rem 1.25rem; color: var(--lf-subtle); font-size: .75rem; }

/* I titoli centrati delle pagine originali, dentro la shell, diventano titoli di sezione */
.app-main > h1.text-center, .app-main > h2.text-center,
.app-main > div > h1.text-center, .app-main > div > h2.text-center {
    text-align: left !important;
    font-size: 1.3rem;
    margin-bottom: 1.1rem;
}

/* Un'animazione di opacity/transform ancora applicata (fill-mode forwards/both) fa di .app-main e .auth-card un contesto
   di sovrapposizione: le modali Bootstrap al loro interno finiscono sotto lo sfondo scuro, appeso al body, e non si
   possono cliccare. Per questo: solo opacità, fill-mode backwards (nessun effetto a fine animazione) e nessuna
   animazione sui contenitori con modali, che possono aprirsi al caricamento mentre l'animazione è in corso. */
@keyframes lf-in { from { opacity: 0; } to { opacity: 1; } }
.app-main:has(.modal), .auth-card:has(.modal) { animation: none; }
@media (prefers-reduced-motion: reduce) { .app-main { animation: none; } .btn, .app-nav a { transition: none; } }

@media (max-width: 991.98px) {
    .app-topbar { padding: .6rem 1rem; }
    .app-main { padding: 1.1rem 1rem 1.5rem; }
    .app-footer { padding: 0 1rem 1rem; }
}

/* =========================================================================
   Layout senza menu laterale (login, aree azienda e discente)
   ========================================================================= */
.app-plain { max-width: 1440px; margin: 0 auto; padding: 0 1.25rem; }
.app-plain-header { padding: 1.5rem 0 1rem; }
.app-plain-header .app-logo-lg { height: 52px; width: auto; }
.app-plain-header .app-connesso { margin-top: .9rem; font-size: 1rem; font-weight: 600; }
.app-plain-header .app-connesso a { text-decoration: none; }
.app-plain-header .app-connesso a:hover { text-decoration: underline; }
.app-plain-footer { color: var(--lf-subtle); font-size: .75rem; padding: 1.5rem 0; }

/* Partner/affiliato entrato in un'azienda: fascia sotto la barra in alto */
.app-impersona {
    display: flex; align-items: flex-start; gap: .75rem;
    margin: 1rem 1.75rem 0; padding: .6rem .9rem;
    background: var(--lf-warning-50); border: 1px solid #ecd193; border-radius: var(--lf-radius-lg);
    color: #5c3b08; font-size: .875rem;
}
.app-impersona > .bi { font-size: 1.1rem; line-height: 1.3; color: var(--lf-warning); }
.app-impersona-body { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; min-width: 0; }
.app-impersona .btn { white-space: nowrap; }

/* Percorso di navigazione (<briciola> nelle viste): "Voce del menu / Schermata / Schermata corrente" */
.percorso-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-bottom: .9rem; }
.percorso { min-width: 0; font-size: .85rem; }
.percorso ol { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem 0; margin: 0; padding: 0; list-style: none; }
.percorso li { display: inline-flex; align-items: center; min-width: 0; max-width: 22rem; }
.percorso li > a, .percorso li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.percorso li + li::before { content: "/"; margin: 0 .5rem; color: var(--lf-muted); }
.percorso a { color: var(--lf-brand-700); font-weight: 500; text-decoration: none; }
.percorso a:hover, .percorso a:focus-visible { color: var(--lf-brand-800); text-decoration: underline; }
.percorso li[aria-current] { color: var(--lf-charcoal); font-weight: 600; }
@media (max-width: 991.98px) { .app-impersona { margin: .75rem 1rem 0; } }

/* Avviso di manutenzione programmata (_AvvisoManutenzione): fascia nelle aree, riquadro nelle pagine di accesso */
.avviso-manutenzione {
    display: flex; align-items: flex-start; gap: .75rem;
    margin: 0 0 1.4rem; padding: .7rem .9rem;
    background: var(--lf-warning-50); border: 1px solid #ecd193; border-radius: var(--lf-radius-lg);
    color: #5c3b08; font-size: .875rem; text-align: left;
}
.avviso-manutenzione-fascia { margin: 1rem 1.75rem 0; }
.avviso-manutenzione > .bi { font-size: 1.1rem; line-height: 1.3; color: var(--lf-warning); }
.avviso-manutenzione-corpo { flex: 1; min-width: 0; }
.avviso-manutenzione-titolo { font-weight: 700; }
.avviso-manutenzione .btn-close { font-size: .7rem; margin-top: .2rem; }
@media (max-width: 991.98px) { .avviso-manutenzione-fascia { margin: .75rem 1rem 0; } }

/* =========================================================================
   Pagine di accesso (ViewData["Variante"] = "accesso"): login, scelta area, manutenzione
   ========================================================================= */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-side { display: none; }
.auth-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem 1rem 1.25rem;
    min-width: 0;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 18px 40px rgba(16, 24, 40, .07);
    padding: 2rem 2rem 1.6rem;
    animation: lf-in .35s ease backwards;
}
.auth-logo { display: block; height: 40px; width: auto; margin: 0 auto 1.6rem; }
.auth-foot { color: var(--lf-subtle); font-size: .75rem; padding-top: 1.25rem; }
.auth-head { margin-bottom: 1.4rem; }
.auth-kicker {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--lf-brand-700); background: var(--lf-brand-50); border: 1px solid var(--lf-brand-100);
    padding: .25rem .6rem; border-radius: 999px;
}
.auth-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -.025em; margin: .75rem 0 .3rem; }
.auth-sub { color: var(--lf-muted); font-size: .9rem; margin: 0; }
.auth-icon {
    width: 3.5rem; height: 3.5rem; margin: 0 auto .5rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 1rem; background: var(--lf-warning-50); color: var(--lf-warning); font-size: 1.6rem;
}
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 1rem; font-size: .85rem; }
.auth-links a { color: var(--lf-brand-700); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-esito { text-align: center; }
.auth-esito .auth-icon.ok { background: var(--lf-success-50); color: var(--lf-success); }
.auth-esito .auth-icon.ko { background: var(--lf-danger-50); color: var(--lf-danger); }
.auth-esito .auth-pwd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.35rem; font-weight: 700;
    background: var(--lf-surface-2); border: 1px dashed var(--lf-border-strong); border-radius: var(--lf-radius);
    padding: .5rem 1rem; margin: .5rem 0 1rem; user-select: all; word-break: break-all;
}
.auth-card .btn-link { text-decoration: none; }
.auth-card .btn-link:hover { text-decoration: underline; }
.auth-badge { text-align: center; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--lf-border); }
.auth-badge img { max-width: 190px; height: auto; }

.auth-choices { display: grid; gap: .6rem; }
.auth-choices a {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem 1rem;
    border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg);
    background: var(--lf-surface);
    color: var(--lf-ink); font-weight: 600; text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}
.auth-choices a > i:first-child { color: var(--lf-brand-700); font-size: 1.2rem; }
.auth-choices a > span { flex: 1; }
.auth-choices a > i:last-child { color: var(--lf-subtle); }
.auth-choices a:hover { border-color: var(--lf-brand-200); background: var(--lf-brand-50); }

@media (min-width: 992px) {
    .auth-shell { grid-template-columns: minmax(380px, 46%) 1fr; }
    .auth-side {
        display: flex; flex-direction: column; justify-content: space-between;
        padding: 2.5rem 3rem;
        color: #fff;
        background:
            radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 0) 0 0 / 22px 22px,
            radial-gradient(120% 80% at 100% 100%, rgba(87, 149, 203, .55) 0%, transparent 60%),
            linear-gradient(160deg, var(--lf-sidebar) 0%, var(--lf-brand-800) 100%);
    }
    .auth-side-logo { height: 38px; width: auto; align-self: flex-start; filter: brightness(0) invert(1); }
    .auth-side-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lf-brand-200); margin-bottom: .8rem; }
    .auth-side-title { font-size: 2rem; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; max-width: 26ch; }
    .auth-side-foot { color: rgba(255, 255, 255, .5); font-size: .75rem; }
    .auth-logo, .auth-foot { display: none; }
    .auth-card { box-shadow: none; border: 0; background: transparent; }
}

/* Campo con icona a sinistra (ed eventuale pulsante a destra) */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--lf-subtle); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; min-height: 2.75rem; }
.input-icon > .input-icon-btn ~ .form-control, .input-icon > .form-control:has(~ .input-icon-btn) { padding-right: 2.6rem; }
.input-icon-btn {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--lf-muted);
    width: 2.1rem; height: 2.1rem; border-radius: .4rem;
}
.input-icon-btn:hover { color: var(--lf-ink); background: var(--lf-surface-2); }

/* =========================================================================
   Intestazioni e azioni delle pagine di gestione
   ========================================================================= */
/* Conteggio e "filtro attivo" accanto al titolo (Ui.Conteggio) */
.page-count {
    display: inline-flex; align-items: center;
    margin-left: .5rem; padding: .1rem .55rem;
    font-size: .8rem; font-weight: 700; letter-spacing: 0; vertical-align: middle;
    color: var(--lf-brand-800); background: var(--lf-brand-50); border: 1px solid var(--lf-brand-100);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.page-filter {
    display: inline-flex; align-items: center; gap: .3rem;
    margin-left: .35rem; padding: .1rem .55rem;
    font-size: .75rem; font-weight: 600; letter-spacing: 0; vertical-align: middle;
    color: #7a4d0b; background: var(--lf-warning-50); border: 1px solid #ecd193;
    border-radius: 999px;
}
/* Titolo a sinistra, azioni principali (Nuovo, Esporta...) a destra */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1.1rem; }
.page-head > h1, .page-head > h2, .page-head > h3 { margin: 0 !important; flex: 1 1 auto; min-width: 0; text-align: left !important; font-size: 1.3rem; }
/* Pagine dell'area azienda: contenitore senza rientro aggiuntivo e titoli di sezione allineati a sinistra */
.app-main > .container-fluid { padding-left: 0; padding-right: 0; }
.app-main h3.text-center:not(.modal h3) { text-align: left !important; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Pulsanti in fondo alla pagina (ex colonna di pulsanti grandi) */
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 .5rem; }
/* Barra "Salva modifiche" degli elenchi modificabili su più pagine (es. certificato_corso): resta in vista in fondo */
.salva-barra {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem;
    margin-top: 1rem; padding: .75rem 1rem;
    background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow);
}
.salva-barra-testo { margin-right: auto; color: var(--lf-muted); font-weight: 600; }
.salva-barra.attiva { border-color: #ecd193; background: var(--lf-warning-50); }
.salva-barra.attiva .salva-barra-testo { color: #7a4d0b; }
.table-grid tr.riga-modificata > td { --bs-table-bg-state: var(--lf-warning-50); }
/* Gestione aule, dettaglio periodi: filetto sopra la prima riga di ogni periodo */
.table-periodi > tbody > tr.riga-gruppo:not(:first-child) > td { border-top: 2px solid var(--lf-table-head-border); }

/* Pulsanti con immagine (es. Esporta con l'icona Excel): stessa altezza degli altri */
.btn:not(.p-0):not(.btn-link) > img { height: 1.15em; width: auto; vertical-align: -.2em; }
.btn > .bi { line-height: 1; }
/* Pulsanti con icona e testo: spazio costante tra i due */
.btn:has(> .bi) { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
/* Schede (nav-tabs, nav-pills) con icona: stesso spazio automatico dei pulsanti */
.nav-link:has(> .bi) { display: inline-flex; align-items: center; gap: .45rem; }
/* Pulsante con sola icona e bordo (es. "Accedi all'area azienda" nell'elenco aziende) */
.btn-icon {
    width: 2rem; height: 2rem; padding: 0;
    border: 1px solid var(--lf-brand-200); border-radius: .45rem;
    background: var(--lf-surface); color: var(--lf-brand-700);
    font-size: 1rem;
}
.btn-icon:hover, .btn-icon:focus-visible { background: var(--lf-brand-50); border-color: var(--lf-brand); color: var(--lf-brand-800); }
/* Biglietto dei voucher con il totale dei voucher dei corsi (elenchi aziende e affiliati) */
.btn-icon.btn-voucher { width: auto; min-width: 3.25rem; padding: 0 .5rem; gap: .35rem; font-size: .8rem; font-weight: 700; color: var(--lf-bordeaux); font-variant-numeric: tabular-nums; }
.btn-voucher > .bi { font-size: 1rem; }
/* Azioni sulla riga di una tabella: affiancate e distanziate */
.azioni-riga { display: flex; align-items: center; gap: .5rem; }
.azioni-riga > form { display: inline-flex; margin: 0; }
/* Pulsante Attivo/Disattivo degli elenchi (partner, affiliati, aziende): stessa larghezza in tutte le righe */
.btn-stato { min-width: 6.25rem; font-weight: 700; }
/* Numero con la sua azione nella stessa cella (es. Q.tà + Iscrivi): numero a larghezza fissa, così i pulsanti restano in colonna */
.cella-azione { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.cella-azione-num { min-width: 2.75rem; text-align: right; font-variant-numeric: tabular-nums; }
/* Badge di stato nelle tabelle */
.badge-stato { font-size: .8rem; padding: .4em .8em; min-width: 5.5rem; }
/* Campo quantità nelle righe (es. Conversione voucher) */
.input-qta { width: 5.5rem; }
/* Saldo dei voucher generici dell'azienda (Conversione voucher, Iscrizione discenti) */
.saldo-voucher {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem;
    padding: 1rem 1.25rem; margin-bottom: 1.25rem;
    background: var(--lf-surface); border: 1px solid var(--lf-border); border-left: 4px solid var(--lf-brand);
    border-radius: var(--lf-radius-lg); box-shadow: var(--lf-shadow-sm);
}
.saldo-voucher-valore { display: flex; flex-direction: column; min-width: 12rem; }
.saldo-voucher-etichetta { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lf-muted); }
.saldo-voucher-numero { font-size: 1.6rem; font-weight: 800; color: var(--lf-brand-800); font-variant-numeric: tabular-nums; }
.saldo-voucher-testo { flex: 1 1 22rem; margin: 0; font-size: .85rem; color: var(--lf-charcoal); }
/* Conversione a senso unico: generici → corso (riquadro del saldo e conferma) */
.flusso-voucher { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; font-weight: 700; font-size: .85rem; }
.flusso-voucher > .bi { font-size: 1.15rem; color: var(--lf-charcoal); }
.flusso-voucher-da, .flusso-voucher-a { padding: .25rem .65rem; border-radius: 999px; }
.flusso-voucher-da { background: var(--lf-surface-2); border: 1px solid var(--lf-border-strong); color: var(--lf-charcoal); }
.flusso-voucher-a { background: var(--lf-brand-50); border: 1px solid var(--lf-brand-200); color: var(--lf-brand-800); }
.flusso-voucher-unico { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lf-warning); }
/* Nota di attenzione (es. conversione non riconvertibile): gialla, non rossa di pericolo */
.nota-attenzione {
    display: flex; gap: .45rem; align-items: baseline;
    padding: .45rem .7rem; border-radius: var(--lf-radius); background: var(--lf-warning-50); color: #7a4d0b; border: 1px solid #ecd193;
}
.conferma-conversione p { margin-bottom: .9rem; }
.conferma-irreversibile {
    padding: .7rem .9rem; border-radius: var(--lf-radius); background: var(--lf-warning-50); color: #7a4d0b;
    border: 1px solid #ecd193;
}
.conferma-irreversibile > .bi { margin-right: .25rem; }
.btn-stato.btn-secondary {
    --bs-btn-bg: var(--lf-stato-off); --bs-btn-border-color: var(--lf-stato-off);
    --bs-btn-hover-bg: var(--lf-stato-off-hover); --bs-btn-hover-border-color: var(--lf-stato-off-hover);
    --bs-btn-active-bg: var(--lf-stato-off-hover); --bs-btn-active-border-color: var(--lf-stato-off-hover);
}

/* =========================================================================
   Schede anagrafiche: riquadro con sezioni (<sezione> = SezioneTagHelper)
   ========================================================================= */
.scheda {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-panel);
    margin-bottom: 1.5rem;
}
.scheda-sezione {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem;
    padding: 1.4rem 1.6rem;
}
/* separatore tra le sezioni; anche quando alcune sono raggruppate in un contenitore (es. una parte nascondibile) */
.scheda-sezione { border-top: 1px solid var(--lf-border); }
.scheda > .scheda-sezione:first-child, .scheda .tab-pane > .scheda-sezione:first-child { border-top: 0; }
.scheda-sezione-titolo { display: flex; gap: .65rem; align-items: flex-start; }
.scheda-sezione-titolo > i {
    flex: 0 0 auto; display: inline-grid; place-items: center; width: 2rem; height: 2rem;
    border-radius: .5rem; background: var(--lf-brand-50); color: var(--lf-brand-700); font-size: 1rem;
}
.scheda-sezione-titolo h3 { font-size: .95rem; margin: .3rem 0 .15rem; }
.scheda-sezione-titolo p { font-size: .8rem; color: var(--lf-muted); margin: 0; }
/* pulsanti del form in fondo al riquadro */
.scheda-azioni {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem;
    padding: .9rem 1.6rem; background: var(--lf-surface-2);
    border-top: 1px solid var(--lf-border); border-radius: 0 0 var(--lf-radius-lg) var(--lf-radius-lg);
}
@media (max-width: 991.98px) {
    .scheda-sezione { grid-template-columns: 1fr; gap: .9rem; padding: 1.1rem; }
    .scheda-azioni { padding: .8rem 1.1rem; }
}
/* Form di una pagina a sé (es. System log): larghezza contenuta, allineato a sinistra */
.form-card { max-width: 960px; }
/* Icone nelle tabelle (al posto delle vecchie immagini PNG): dimensione e colore per significato */
.ico { font-size: 1.15rem; line-height: 1; vertical-align: -.15em; }
.ico-brand { color: var(--lf-brand-700); }
.ico-ok { color: var(--lf-success); }
.ico-warn { color: var(--lf-warning); }
.ico-danger { color: var(--lf-danger); }
.ico-cert { color: #c8921a; }
.ico-voucher { color: var(--lf-bordeaux); }
.btn:not(.btn-link):not(.p-0) .ico { color: inherit; }
a:hover > .ico, .btn-link:hover > .ico, .btn.p-0:hover > .ico { opacity: .75; }

/* Filtri richiudibili (site.js): il pulsante compare solo sotto i 768px */
.filter-toggle { display: none; }
@media (max-width: 767.98px) {
    .filter-bar.richiudibile:not(.aperto) { padding-top: .5rem; padding-bottom: .5rem; }
    .filter-bar.richiudibile:not(.aperto) > :not(.filter-toggle) { display: none !important; }
    .filter-toggle {
        display: flex; align-items: center; gap: .5rem;
        flex: 0 0 100%; width: 100%;
        padding: .35rem 0; border: 0; background: transparent;
        font-weight: 700; color: var(--lf-ink); text-align: left;
    }
    .filter-toggle > .bi-funnel { color: var(--lf-brand-700); }
    .filter-toggle-n {
        min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
        display: inline-flex; align-items: center; justify-content: center;
        border-radius: 999px; background: var(--lf-brand-700); color: #fff; font-size: .72rem;
    }
    .filter-toggle-chev { margin-left: auto; transition: transform .2s ease; }
    .filter-bar.aperto .filter-toggle-chev { transform: rotate(180deg); }
    .filter-bar.aperto > .filter-toggle { margin-bottom: .25rem; }
    .page-head-actions { width: 100%; }
}

/* =========================================================================
   Area discente
   ========================================================================= */
/* Contatore nel menu laterale (comunicazioni non lette) */
.app-nav-badge {
    margin-left: auto; min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--lf-danger); color: #fff;
    font-size: .7rem; font-weight: 700;
}
.lf-toasts { z-index: 1080; }

/* Home: riepilogo dei corsi per stato */
.stat-panel { --stat-gap: .75rem; --stat-asse: 2rem; }
/* Il margine sinistro delle card è lo spazio dell'asse Y del grafico (larghezza forzata uguale in discente.cshtml) */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--stat-gap); margin-left: var(--stat-asse); }
/* Il grafico sporge di mezzo gap per lato: così ogni colonna (larga 1/5 dell'area) è centrata sotto la sua card */
.stat-chart { position: relative; height: 210px; margin: 1rem calc(var(--stat-gap) / -2) 0; }
.stat-card {
    position: relative; display: flex; flex-direction: column; gap: .2rem;
    padding: .9rem 1rem .9rem 1.15rem;
    background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-sm); color: var(--lf-ink); text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}
.stat-card::before { content: ""; position: absolute; left: 0; top: .8rem; bottom: .8rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--stat, var(--lf-brand)); }
.stat-card:hover { box-shadow: var(--lf-shadow); transform: translateY(-1px); color: var(--lf-ink); }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--lf-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-attesa { --stat: #f0b429; }
.stat-corso { --stat: var(--lf-brand-600); }
.stat-ok { --stat: var(--lf-success); }
.stat-ko { --stat: var(--lf-danger); }
.stat-off { --stat: #9aa5b1; }
@media (max-width: 575.98px) {
    .stat-panel { --stat-gap: .4rem; --stat-asse: 1.5rem; }
    .stat-card { padding: .6rem .45rem .6rem .7rem; }
    .stat-label { font-size: .6rem; letter-spacing: 0; }
    .stat-value { font-size: 1.2rem; }
    .stat-chart { height: 150px; }
}

/* Statistiche (partners/analisi): indicatori, grafici e classifiche */
.analisi-nota { color: var(--lf-muted); font-size: .9rem; margin-bottom: 1rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi {
    padding: .85rem 1rem; background: var(--lf-surface);
    border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); box-shadow: var(--lf-shadow-sm);
}
.kpi-label { font-size: .75rem; font-weight: 600; color: var(--lf-muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--lf-ink); font-variant-numeric: tabular-nums; }
.kpi-note { font-size: .8rem; color: var(--lf-subtle); }
/* Riquadri che aprono l'elenco corrispondente (statistiche dell'azienda): bordo a sinistra con il tono */
.kpi-link {
    display: block; color: inherit; text-decoration: none; border-left: 4px solid var(--kpi-tono, var(--lf-brand));
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.kpi-link:hover { color: inherit; box-shadow: var(--lf-shadow); transform: translateY(-1px); }
.kpi-link:focus-visible { outline: none; box-shadow: var(--lf-ring); }
.kpi-danger { --kpi-tono: var(--lf-danger); }
.kpi-danger .kpi-value { color: var(--lf-danger); }
.kpi-warn { --kpi-tono: var(--lf-warning); }
.kpi-warn .kpi-value { color: var(--lf-warning); }
.kpi-info { --kpi-tono: var(--lf-brand); }
.kpi-vai { display: flex; align-items: center; gap: .3rem; margin-top: .35rem; font-size: .8rem; font-weight: 600; color: var(--lf-brand-700); }
.kpi-vai .bi { transition: transform .15s ease; }
.kpi-link:hover .kpi-vai .bi { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .kpi-link, .kpi-vai .bi { transition: none; } }
.grafico-panel {
    padding: 1rem 1.1rem; margin-bottom: 1.25rem; background: var(--lf-surface);
    border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); box-shadow: var(--lf-shadow-panel);
}
.grafico-titolo { font-size: .95rem; font-weight: 700; margin: 0 0 .6rem; }
.grafico { position: relative; height: 260px; }
.grafico-alto { height: 340px; }
.table-grid td.num, .table-grid th.num { font-variant-numeric: tabular-nums; }
.table-grid .riga-totale > td { font-weight: 700; border-top: 2px solid var(--lf-table-head-border); background: var(--lf-surface-2); }
.table-grid .riga-nonattr > td { color: var(--lf-muted); font-style: italic; }
.quota-cella { white-space: nowrap; }
progress.quota {
    width: 72px; height: .375rem; vertical-align: middle; border: 0; border-radius: 999px;
    background: var(--lf-brand-50); appearance: none; -webkit-appearance: none; overflow: hidden;
}
progress.quota::-webkit-progress-bar { background: var(--lf-brand-50); border-radius: 999px; }
progress.quota::-webkit-progress-value { background: var(--lf-brand); border-radius: 999px; }
progress.quota::-moz-progress-bar { background: var(--lf-brand); border-radius: 999px; }
.variazione { display: inline-flex; align-items: center; font-weight: 600; font-size: .85rem; }
/* Rimandi dal dettaglio di un anno alle classifiche, con l'anno già scelto */
.analisi-vai { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.analisi-vai-card {
    display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
    background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-sm); color: var(--lf-ink); text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.analisi-vai-card:hover { border-color: var(--lf-brand-200); box-shadow: var(--lf-shadow); transform: translateY(-1px); color: var(--lf-ink); }
.analisi-vai-card:focus-visible { outline: none; box-shadow: var(--lf-ring); }
.analisi-vai-card > .bi:first-child {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.5rem; height: 2.5rem;
    border-radius: var(--lf-radius); background: var(--lf-brand-50); color: var(--lf-brand-700); font-size: 1.15rem;
}
.analisi-vai-testo { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.analisi-vai-titolo { font-weight: 700; }
.analisi-vai-nota { font-size: .85rem; color: var(--lf-muted); }
.analisi-vai-freccia { margin-left: auto; flex: none; color: var(--lf-brand-700); transition: transform .15s ease; }
.analisi-vai-card:hover .analisi-vai-freccia { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .analisi-vai-card, .analisi-vai-freccia { transition: none; } }
/* Legenda "Come si contano questi numeri": definizioni dei termini, chiusa di base */
.legenda {
    margin: 1.25rem 0 .5rem; background: var(--lf-surface);
    border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); font-size: .875rem;
}
.legenda > summary {
    display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem;
    color: var(--lf-brand-700); font-weight: 600; cursor: pointer; list-style: none;
}
.legenda > summary::-webkit-details-marker { display: none; }
.legenda > summary::after { content: "\F282"; font-family: "bootstrap-icons"; margin-left: auto; transition: transform .15s ease; }
.legenda[open] > summary::after { transform: rotate(180deg); }
.legenda > summary:focus-visible { outline: none; box-shadow: var(--lf-ring); border-radius: var(--lf-radius-lg); }
.legenda dl { display: grid; gap: .55rem; margin: 0; padding: 0 1rem 1rem; }
.legenda dl > div { display: grid; grid-template-columns: 11rem 1fr; gap: .75rem; }
.legenda dt { font-weight: 700; color: var(--lf-ink); }
.legenda dd { margin: 0; color: var(--lf-muted); }
.table-grid th[title] { cursor: help; }
/* Classifiche (partners/analisi): gruppi di colonne leggeri, posizione, nome con codice, totale in evidenza */
.table-classifica > thead > tr.riga-gruppi > th { border-bottom: 0; padding-bottom: .1rem; }
.table-classifica > thead > tr.riga-gruppi > th[rowspan] { vertical-align: bottom; padding-bottom: .6rem; border-bottom: 1px solid var(--lf-table-head-border); }
.table-classifica > thead > tr:not(.riga-gruppi) > th { padding-top: .35rem; padding-bottom: .6rem; vertical-align: bottom; }
.table-classifica > thead > tr > th.gruppo { text-align: center; padding: .65rem .5rem .1rem; }
.table-classifica > thead > tr > th.gruppo > span {
    display: block; padding-bottom: .35rem; border-bottom: 2px solid var(--lf-brand);
    color: var(--lf-brand-700); font-size: .7rem; font-weight: 700; letter-spacing: .09em;
}
.table-classifica .inizio-gruppo { border-left: 1px solid var(--lf-table-row-border); }
.table-classifica > thead .inizio-gruppo { border-left-color: var(--lf-table-head-border); }
.table-classifica > tbody > tr > td { padding-top: .6rem; padding-bottom: .6rem; }
.table-classifica td.num, .table-classifica th.num { width: 1%; white-space: nowrap; padding-left: 1rem; padding-right: 1rem; }
.table-classifica td.col-totale { --bs-table-bg: var(--lf-brand-50); font-weight: 700; color: var(--lf-ink); }
.table-classifica th.col-totale { color: var(--lf-brand-800); }
.table-classifica .riga-totale > td.col-totale { --bs-table-bg: var(--lf-brand-100); }
.table-classifica .col-primo { white-space: nowrap; color: var(--lf-charcoal); }
.table-classifica .col-vai { width: 1%; padding-right: .75rem; text-align: right; }
.btn-vai { white-space: nowrap; }
.pos {
    display: inline-flex; align-items: center; justify-content: center; min-width: 1.85rem; height: 1.85rem; padding: 0 .45rem;
    border: 1px solid var(--lf-border); border-radius: 999px; background: var(--lf-surface-2);
    color: var(--lf-muted); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pos-1 { color: var(--lf-podio-1); background: var(--lf-podio-1-bg); border-color: var(--lf-podio-1-bd); }
.pos-2 { color: var(--lf-podio-2); background: var(--lf-podio-2-bg); border-color: var(--lf-podio-2-bd); }
.pos-3 { color: var(--lf-podio-3); background: var(--lf-podio-3-bg); border-color: var(--lf-podio-3-bd); }
.cella-nome { display: flex; flex-direction: column; gap: .05rem; min-width: 14rem; line-height: 1.3; }
.cella-nome .nome-titolo { font-weight: 600; color: var(--lf-ink); text-decoration: none; }
.cella-nome a.nome-titolo:hover { color: var(--lf-brand-700); text-decoration: underline; }
.cella-nome .nome-codice { font-size: .75rem; color: var(--lf-subtle); letter-spacing: .02em; }
.table-classifica .quota-cella { width: 1%; }
.quota-wrap { display: inline-flex; align-items: center; gap: .55rem; }
.quota-perc { min-width: 3rem; text-align: right; font-size: .8rem; color: var(--lf-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
    .grafico { height: 210px; }
    .grafico-alto { height: 300px; }
    progress.quota { width: 44px; }
    .cella-nome { min-width: 10rem; }
    .legenda dl > div { grid-template-columns: 1fr; gap: .1rem; }
}

/* I tuoi corsi */
.corsi-cerca { display: flex; gap: .5rem; max-width: 640px; margin-bottom: 1.25rem; }
.corsi-barra { display: flex; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.corsi-barra .nav-tabs { margin-bottom: 0; }
.vista-scelta { margin-bottom: .35rem; }
.vista-scelta .btn.active { background: var(--lf-brand-50); border-color: var(--lf-brand); color: var(--lf-brand-800); }
.vuoto { text-align: center; padding: 3rem 1rem; color: var(--lf-subtle); }
.vuoto > .bi { font-size: 3.5rem; display: block; margin-bottom: .5rem; }
.vuoto > p { margin: 0; font-weight: 600; }
.corsi-elenco { display: grid; gap: .75rem; }
.corso-riga {
    display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; align-items: center; gap: 1.25rem;
    padding: 1rem 1.25rem; background: var(--lf-surface);
    border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); box-shadow: var(--lf-shadow-sm);
}
.corso-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .75rem; color: var(--lf-muted); font-weight: 600; }
.corso-codice { color: var(--lf-brand-700); }
.corso-nome { font-size: 1rem; font-weight: 700; margin: .2rem 0 .3rem; letter-spacing: -.01em; }
.corso-stato, .corso-scadenza { font-size: .82rem; }
.corso-scadenza { color: var(--lf-charcoal); }
.corso-progresso .progress { height: .5rem; margin-top: .3rem; background: var(--lf-brand-50); }
.corso-progresso .progress-bar { background: var(--lf-brand-600); }
.corso-azioni { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.corsi-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
/* il riquadro ha le proporzioni delle immagini dei corsi: la foto lo riempie senza bande */
.corso-card .card-img-top { width: 100%; height: auto; aspect-ratio: var(--lf-foto-corso); object-fit: cover; background: var(--lf-surface-2); }
.corso-card-vuota { display: flex; align-items: center; justify-content: center; color: var(--lf-subtle); font-size: 3rem; }
.corso-dati { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; font-size: .82rem; margin: .5rem 0; }
.corso-dati dt { color: var(--lf-muted); font-weight: 600; }
.corso-dati dd { margin: 0; }
.corso-card-azioni { display: flex; justify-content: flex-end; gap: .4rem; background: var(--lf-surface); }
@media (max-width: 767.98px) {
    .corso-riga { grid-template-columns: 1fr; gap: .75rem; }
    .corso-azioni { justify-content: flex-start; }
    .corsi-barra { flex-wrap: wrap; }
}

/* Elenchi dei corsi (azienda, partner, affiliati): elenco o schede con foto, scelta con Ui.SceltaVista.
   html[data-vista-corsi="schede"] è impostato da _Layout/site.js; senza scelta resta l'elenco. */
.vista-barra { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.vista-barra .vista-scelta { margin-bottom: 0; }
.vista-schede, .vista-barra .ordina { display: none; }
html[data-vista-corsi="schede"] .vista-elenco { display: none; }
html[data-vista-corsi="schede"] .vista-schede { display: grid; }
html[data-vista-corsi="schede"] .vista-barra .ordina { display: block; }
.ordina .dropdown-toggle { display: inline-flex; align-items: center; gap: .4rem; }
.ordina .dropdown-item.active .text-muted { color: inherit !important; }

.catalogo { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1.25rem; margin-bottom: 1rem; }
.catalogo-card {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); box-shadow: var(--lf-shadow-panel);
    transition: box-shadow .15s ease, transform .15s ease;
}
.catalogo-card:hover { box-shadow: var(--lf-shadow); transform: translateY(-2px); }
.catalogo-card.spento .catalogo-foto { filter: grayscale(1); opacity: .6; }
.catalogo-foto {
    position: relative; aspect-ratio: var(--lf-foto-corso); display: flex; align-items: center; justify-content: center;
    background: var(--lf-surface-2); border-bottom: 1px solid var(--lf-border); color: var(--lf-border-strong); font-size: 2.75rem;
}
.catalogo-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--lf-surface-2); }
.catalogo-corpo { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem .5rem; }
.catalogo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .75rem; color: var(--lf-muted); }
.catalogo-cat { padding: .2rem .65rem; border-radius: 999px; background: var(--lf-brand-50); color: var(--lf-brand-700); font-weight: 600; }
.catalogo-codice { font-weight: 600; color: var(--lf-charcoal); }
.catalogo-meta > span + span:not(.badge)::before { content: "•"; margin-right: .6rem; color: var(--lf-subtle); }
.catalogo-meta > .catalogo-cat + span:not(.badge)::before { content: none; }
.catalogo-titolo { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--lf-ink); overflow-wrap: anywhere; }
.catalogo-dati { display: flex; flex-wrap: wrap; gap: .5rem; margin: auto 0 0; padding-top: .35rem; }
.catalogo-dati > div { flex: 1 1 0; min-width: 5.5rem; padding: .4rem .6rem; background: var(--lf-surface-2); border: 1px solid var(--lf-border); border-radius: var(--lf-radius); }
.catalogo-dati dt { font-size: .66rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--lf-muted); }
.catalogo-dati dd { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--lf-ink); }
.catalogo-dati dd .btn-icon { margin-left: auto; }
.catalogo-azioni { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.1rem 1rem; }
.catalogo-azioni form { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; margin: 0; }
.catalogo-azioni .btn-principale { flex: 1; min-width: 0; }
.catalogo-azioni .form-control { flex: 0 0 4.75rem; width: 4.75rem; }
.catalogo-vuoto { grid-column: 1 / -1; }

/* LaMiaFad comunica */
.comunicazioni { overflow: hidden; }
.comunicazione-colore { flex: 0 0 auto; width: .75rem; height: 2rem; border-radius: 3px; margin-right: .85rem; }
.comunicazione-testo { display: flex; flex-direction: column; line-height: 1.3; }
.comunicazione-data { font-weight: 700; font-size: .85rem; }
.comunicazione-tipo { font-size: .8rem; color: var(--lf-muted); }
.comunicazione-corpo { display: block; width: 100%; height: 0; border: 0; }
/* Dettaglio email inviata (modale di partners/sendemail) */
.email-dati { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 1rem; }
.email-dati dt { font-weight: 600; color: var(--lf-muted); }
.email-dati dd { margin: 0; overflow-wrap: anywhere; }
.email-corpo { display: block; width: 100%; height: 60vh; border: 1px solid var(--lf-border); border-radius: .5rem; background: var(--lf-surface); }
@media (max-width: 575.98px) { .email-dati { grid-template-columns: 1fr; gap: 0; } .email-dati dd { margin-bottom: .5rem; } }
.accordion-button:not(.collapsed) { background: var(--lf-brand-50); color: var(--lf-ink); box-shadow: none; }
.accordion-button:focus { box-shadow: var(--lf-ring); }

/* Pagine pubbliche: scheda larga, esiti, elenco browser */
.auth-card-wide { max-width: 760px; }
.auth-card-wide p.fs-2 { font-size: 1.05rem !important; font-weight: 700; margin: 1.5rem 0 .5rem; }
.auth-card-wide .list-group-item { font-size: .875rem; }
.auth-links-secondari { margin-top: .5rem; padding-top: .75rem; border-top: 1px solid var(--lf-border); font-size: .8rem; }
.auth-links-secondari a { color: var(--lf-muted); }
.esito-dati { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0 0 1.25rem; }
.esito-dati dt { color: var(--lf-muted); font-weight: 600; font-size: .85rem; }
.esito-dati dd { margin: 0; font-weight: 600; }
.browser-elenco { display: grid; gap: .6rem; margin-top: 1.5rem; }
.browser-voce {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .85rem 1rem; border: 1px solid var(--lf-border); border-radius: var(--lf-radius-lg); background: var(--lf-surface);
}

/* =========================================================================
   Finestre popup (_Popup) e modali
   ========================================================================= */
.is-popup { background: var(--lf-bg); }
.popup-head {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: .9rem;
    padding: .7rem 1.25rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--lf-border);
}
.popup-logo { height: 24px; width: auto; }
.popup-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-main { padding: 1.25rem; }
.is-popup td.bg-info, .is-popup th.bg-info { background: var(--lf-brand-50) !important; color: var(--lf-brand-800) !important; }
/* Intestazioni gialle delle modali dell'originale: tinta tenue */
.modal-header.bg-warning { background: var(--lf-warning-50) !important; border-bottom-color: #ecd193; }

/* ---------- Responsive: tabelle scorrevoli sui dispositivi piccoli ---------- */
@media (max-width: 767.98px) {
    html { font-size: 14.5px; }
    .table-grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .filter-bar { padding: .85rem; }
    .btn[style*="width:150px"], .btn[style*="width: 150px"] { width: auto !important; min-width: 120px; }
    h1, .h1 { font-size: 1.35rem; }
}

/* ---------- Stampa ---------- */
@media print {
    .app-sidebar, .app-topbar, .app-footer, .filter-bar, .pagination { display: none !important; }
    .app-main { padding: 0; }
    body { background: #fff; }
}
