/* ============================================================
   FEDAIISF — Gestionale Area Riservata
   Brand Colors: Rosso #C40020 | Blu #024B8E | Verde #1C7A3C
   Font: Outfit (headings) + DM Sans (body)
   ============================================================ */

/* Font caricati via preload in header.php — @import rimosso per evitare doppio fetch */

/* ── Anti-FOUC: reveal morbido dopo che feather+font sono pronti ── */
html {
    /* visibility: hidden impostato inline in header — qui solo la transizione */
    transition: opacity 0.18s ease;
}

:root {
    /* Brand palette */
    --red:          #C40020;
    --red-dark:     #9e001a;
    --red-light:    #fce8eb;
    --blue:         #024B8E;
    --blue-dark:    #013870;
    --blue-light:   #e0ecf8;
    --green:        #1C7A3C;
    --green-light:  #e3f4ea;

    /* UI tokens — Rosso primario, Blu secondario */
    --primary:      var(--red);
    --primary-dark: var(--red-dark);
    --primary-light:var(--red-light);
    --accent:       var(--blue);
    --accent-light: var(--blue-light);

    --bg:           #f0f4f9;
    --surface:      #ffffff;
    --surface-2:    #f7f9fc;
    --border:       rgba(2, 75, 142, 0.10);
    --border-strong:rgba(2, 75, 142, 0.18);

    --text-primary: #111827;
    --text-secondary:#4b5563;
    --text-muted:   #9ca3af;

    --radius-sm:    8px;
    --radius-md:    14px;
    --radius-lg:    20px;
    --radius-xl:    28px;

    --shadow-sm:    0 1px 4px rgba(196,0,32,0.05), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 20px rgba(196,0,32,0.07), 0 1px 4px rgba(0,0,0,0.05);
    --shadow-lg:    0 12px 40px rgba(196,0,32,0.10), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-accent:0 8px 24px rgba(196,0,32,0.28);

    --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-head:    'Outfit', sans-serif;
    --font-body:    'DM Sans', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(2,75,142,0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(196,0,32,0.04) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ── Header ─────────────────────────────────────────────── */
.app-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255,255,255,0.8), var(--shadow-sm);
}

.header-left, .header-right { width: 44px; display: flex; }
.header-right { justify-content: flex-end; }

.logo-container { flex: 1; display: flex; justify-content: center; }
.logo { height: 44px; width: auto; object-fit: contain; }

/* Logo doppio: FEDAIISF + logo sezione */
.header-logos {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo--fed  { height: 38px; }
.logo--sez  { height: 38px; max-width: 80px; border-radius: 6px; }
.header-logos-sep {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,.3);
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.icon-btn:hover {
    background: var(--red-light);
    color: var(--red);
}
.icon-btn svg { width: 20px; height: 20px; }

/* ── Toast notifica (popup in basso) ────────────────────── */
.notif-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 9999;
    background: var(--blue, #024B8E);
    color: #fff;
    padding: 12px 18px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .84rem;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(2,75,142,.35);
    cursor: pointer;
    max-width: calc(100vw - 40px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: toast-in .3s cubic-bezier(.34,1.3,.64,1);
    -webkit-tap-highlight-color: transparent;
}
.notif-toast svg { flex-shrink: 0; stroke: #fff; }
.notif-toast--out {
    animation: toast-out .35s ease forwards;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toast-out {
    to   { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ── Badge notifiche sull'hamburger ─────────────────────── */
.hdr-notif-wrap {
    position: relative;
}
.hdr-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--red, #C40020);
    color: #fff;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .65rem;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--surface, #fff);
    animation: notif-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes notif-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ── Badge notifiche nella sidebar (accanto a Dashboard) ─── */
.sidebar-notif-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--red, #C40020);
    color: #fff;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .7rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Main layout ─────────────────────────────────────────── */
.app-main {
    padding: 24px 16px 60px;
    max-width: 860px;
    margin: 0 auto;
}

/* ── Page header block ───────────────────────────────────── */
.page-header {
    margin-bottom: 24px;
}
.page-header h2 {
    font-family: var(--font-head);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-top: 4px;
}

/* ── Back link ───────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 7px 14px 7px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: var(--transition);
}
.back-link:hover {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red-dark);
}
.back-link svg { width: 16px; height: 16px; }

/* ── Card base ───────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

/* ── User Card ───────────────────────────────────────────── */
.user-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.user-card-banner {
    background: linear-gradient(120deg, var(--red) 0%, var(--red-dark) 60%, #8a0016 100%);
    padding: 24px 28px 20px;
    padding-right: 110px;          /* spazio per la foto a destra */
    position: relative;
    overflow: hidden;
    min-height: 90px;
}
/* Cerchio decorativo sfondo (rimane, la foto gli va sopra) */
.user-card-banner::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 170px; height: 170px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
}
.user-card-banner::after {
    content: '';
    position: absolute;
    bottom: -20px; left: 40%;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(2,75,142,0.15);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

/* ── Foto profilo — destra del banner ────────────────────── */
.user-avatar-right {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.35);
    overflow: hidden;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex-shrink: 0;
}
.user-avatar-right img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.user-avatar-icon {
    width: 46px; height: 46px;
    stroke: rgba(255,255,255,.80);
}

/* ── Vecchio avatar (lasciato per compatibilità sidebar) ── */
.user-avatar {
    width: 54px; height: 54px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    backdrop-filter: blur(4px);
}

.user-card-header h2 {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
}
.user-badge svg { width: 11px; height: 11px; }

.user-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
@media (max-width: 480px) {
    .user-details { grid-template-columns: 1fr; }
}

.detail-item {
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    transition: background 0.2s;
}
.detail-item:hover { background: var(--surface-2); }
.detail-item:nth-child(2n) { border-right: none; }
.detail-item:last-child, .detail-item:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}

.detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 3px;
    display: flex; align-items: center; gap: 5px;
}
.detail-label svg { width: 11px; height: 11px; color: var(--red); }

.detail-value {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-head);
}
.detail-value.placeholder { color: var(--text-muted); font-weight: 400; font-style: italic; }

/* ── Menu Grid ───────────────────────────────────────────── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 480px) {
    .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 700px) {
    .menu-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

.menu-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 22px 12px 18px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.menu-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--red));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}
.menu-item:hover::after { transform: scaleX(1); }
.menu-item:hover .menu-icon-wrapper {
    background: var(--red);
    color: white;
    transform: scale(1.08);
}

.menu-icon-wrapper {
    width: 52px; height: 52px;
    background: var(--red-light);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--red);
    transition: var(--transition);
}
.menu-icon-wrapper svg { width: 22px; height: 22px; }

/* ── Menu item bloccato (modulo non abilitato per tipo_socio) ── */
.menu-item--locked {
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(1);
    pointer-events: none; /* no click, no hover */
    position: relative;
}
.menu-item--locked .menu-icon-wrapper {
    background: var(--border-light, #f0f0f0);
}
/* Lucchetto in sovrapposizione in basso a destra dell'icona */
.menu-lock-icon {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    background: var(--surface, #fff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.menu-lock-icon svg {
    width: 9px !important;
    height: 9px !important;
    stroke: var(--text-muted, #999) !important;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-secondary);
    font-family: var(--font-head);
    letter-spacing: 0.1px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: -300px;
    width: 300px; height: 100vh;
    background: var(--surface);
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    overflow-y: auto;
    box-shadow: 4px 0 32px rgba(2,75,142,0.15);
    border-right: 1px solid var(--border);
}
.sidebar.active { left: 0; }

.sidebar-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(1,25,56,0.45);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.sidebar-logo { height: 36px; }

.sidebar-header .icon-btn {
    color: var(--text-secondary);
    width: 36px; height: 36px;
}
.sidebar-header .icon-btn:hover {
    background: var(--red-light);
    color: var(--red);
}

.sidebar-user {
    padding: 20px;
    display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.sidebar-user-avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-head);
}
.sidebar-user-role {
    font-size: 0.74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sidebar-menu {
    display: flex; flex-direction: column;
    padding: 10px 0; flex: 1;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 16px 20px 6px;
    font-family: var(--font-head);
}

.sidebar-link {
    display: flex; align-items: center; gap: 13px;
    padding: 11px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-family: var(--font-body);
}
.sidebar-link svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; transition: var(--transition); }
.sidebar-link:hover {
    background: var(--red-light);
    color: var(--red);
    border-left-color: var(--red);
}
.sidebar-link:hover svg { color: var(--red); }
.sidebar-link.active {
    background: var(--red-light);
    color: var(--red);
    border-left-color: var(--red);
    font-weight: 600;
}
.sidebar-link.active svg { color: var(--red); }

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 20px;
}

.sidebar-link.danger { color: var(--red); }
.sidebar-link.danger svg { color: var(--red); }
.sidebar-link.danger:hover {
    background: var(--red-light);
    border-left-color: var(--red);
}

/* ── Sidebar link bloccato (modulo non abilitato) ─────────── */
.sidebar-link--locked {
    opacity: .4;
    filter: grayscale(1);
    cursor: not-allowed;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 20px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}
.sidebar-link--locked svg { width: 18px; height: 18px; flex-shrink: 0; }
/* Lucchetto allineato a destra */
.sidebar-lock-icon {
    margin-left: auto;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    opacity: .7;
}

/* ── Page content placeholder ────────────────────────────── */
.page-content {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    min-height: 380px;
    border: 1px solid var(--border);
}
.page-content h2 {
    font-family: var(--font-head);
    font-size: 1.4rem;
    margin-bottom: 12px;
}

/* ── List container (circolari, etc.) ────────────────────── */
.list-container { display: flex; flex-direction: column; gap: 12px; }

.list-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    border: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.list-item:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.list-item-icon {
    width: 44px; height: 44px;
    background: var(--red-light);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--red); flex-shrink: 0;
}
.list-item-icon svg { width: 20px; height: 20px; }
.list-item-icon.blue-icon { background: var(--blue-light); color: var(--blue); }

.list-item-body { flex: 1; min-width: 0; }
.list-item-title {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--text-primary);
    font-family: var(--font-head);
    margin-bottom: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-meta {
    font-size: 0.79rem;
    color: var(--text-muted);
}

.btn-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none; flex-shrink: 0;
    transition: var(--transition);
}
.btn-icon:hover { background: var(--blue); color: white; border-color: var(--blue); }
.btn-icon svg { width: 16px; height: 16px; }

/* ── News cards ──────────────────────────────────────────── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.news-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex; flex-direction: column;
}
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.news-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--blue-light);
}
.news-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.news-card-date {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--blue);
    margin-bottom: 8px;
    font-family: var(--font-head);
}
.news-card-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 10px;
}
.news-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    flex: 1;
    margin-bottom: 16px;
}
.news-card-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 600; font-size: 0.85rem;
    color: var(--red); text-decoration: none;
    font-family: var(--font-head);
}
.news-card-link svg { width: 14px; height: 14px; }


/* ── Appuntamenti ────────────────────────────────────────── */
.appuntamento-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left: 4px solid var(--red);
    display: flex; align-items: stretch; gap: 18px;
    transition: var(--transition);
    margin-bottom: 12px;
}
.appuntamento-card:hover {
    border-left-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.app-date-block {
    background: var(--red-light);
    min-width: 66px;
    border-radius: var(--radius-md);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 10px;
    color: var(--red);
    flex-shrink: 0;
}
.app-date-month { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; font-family: var(--font-head); }
.app-date-day   { font-size: 1.9rem; font-weight: 800; line-height: 1; font-family: var(--font-head); }

.app-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.app-title {
    font-family: var(--font-head);
    font-size: 1.05rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 8px;
}
.app-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.app-meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.82rem; color: var(--text-secondary);
}
.app-meta-item svg { width: 13px; height: 13px; color: var(--text-muted); }

/* ── Utilità cards ───────────────────────────────────────── */
.utilita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.utilita-card {
    background: var(--surface);
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-align: center;
    text-decoration: none;
    display: flex; flex-direction: column; align-items: center;
    transition: var(--transition);
}
.utilita-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--red);
}
.utilita-card:hover .utilita-icon {
    background: var(--red);
    color: white;
    transform: scale(1.1);
}
.utilita-icon {
    width: 58px; height: 58px;
    background: var(--red-light);
    color: var(--red);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    transition: var(--transition);
}
.utilita-icon svg { width: 26px; height: 26px; }
.utilita-name {
    font-family: var(--font-head);
    font-size: 1rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 6px;
}
.utilita-desc { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.4; }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar { position: relative; margin-bottom: 24px; }
.search-bar svg {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); width: 18px; height: 18px; pointer-events: none;
}
.search-bar input {
    width: 100%;
    padding: 13px 16px 13px 46px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    outline: none; font-family: var(--font-body);
    font-size: 0.95rem; color: var(--text-primary);
    transition: var(--transition);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(196,0,32,0.1);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: white; border: none;
    padding: 12px 22px; border-radius: var(--radius-md);
    font-family: var(--font-head);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    box-shadow: var(--shadow-accent);
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(196,0,32,0.35);
}
.btn-primary svg { width: 17px; height: 17px; }

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface); color: var(--red);
    border: 1px solid var(--border);
    padding: 11px 20px; border-radius: var(--radius-md);
    font-family: var(--font-head);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: var(--transition); text-decoration: none;
}
.btn-secondary:hover { background: var(--red-light); border-color: var(--red); }

/* ── Tags / Badges ───────────────────────────────────────── */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
    font-family: var(--font-head);
    letter-spacing: 0.2px;
}
.tag-blue  { background: var(--blue-light);  color: var(--blue); }
.tag-red   { background: var(--red-light);   color: var(--red); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-gray  { background: var(--surface-2);   color: var(--text-muted); }

/* ── Section divider ─────────────────────────────────────── */
.section-title {
    font-family: var(--font-head);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px; height: 48px;
    color: var(--border-strong);
    margin-bottom: 14px;
}
.empty-state p { font-size: 0.92rem; }

/* ── Alert / Messages ────────────────────────────────────── */
.alert {
    padding: 14px 18px; border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-error   { background: var(--red-light);   color: var(--red-dark);  border: 1px solid rgba(196,0,32,0.15); }
.alert-success { background: var(--green-light); color: var(--green);     border: 1px solid rgba(28,122,60,0.15); }
.alert-info    { background: var(--blue-light);  color: var(--blue-dark); border: 1px solid rgba(2,75,142,0.15); }

/* ── Form elements ───────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-family: var(--font-head);
}
.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 0.95rem; color: var(--text-primary);
    outline: none; transition: var(--transition);
}
.form-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(196,0,32,0.1);
}
.form-input::placeholder { color: var(--text-muted); }

.input-wrapper { position: relative; }
.input-icon {
    position: absolute; left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); width: 18px; height: 18px; pointer-events: none;
}
.input-wrapper .form-input { padding-left: 46px; }

/* ── Login page ──────────────────────────────────────────── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(196,0,32,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(2,75,142,0.06) 0%, transparent 45%),
        #f5f0f1;
    padding: 20px;
}

.login-container {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    width: 100%; max-width: 430px;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.6) inset;
    border: 1px solid rgba(255,255,255,0.7);
    text-align: center;
    transition: var(--transition);
}

.login-header { margin-bottom: 36px; }

.login-logo {
    height: 50px; margin-bottom: 22px;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.08));
}

.login-header h2 {
    font-family: var(--font-head);
    color: var(--text-primary);
    font-size: 1.65rem; font-weight: 800;
    letter-spacing: -0.5px;
}
.login-header p {
    color: var(--text-secondary);
    font-size: 0.92rem; margin-top: 8px;
}

.login-form .form-label { text-align: left; }

.btn-login {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: white; border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-head);
    font-size: 1rem; font-weight: 700;
    cursor: pointer; margin-top: 8px;
    box-shadow: var(--shadow-accent);
    transition: var(--transition);
    letter-spacing: 0.3px;
}
.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(196,0,32,0.38);
    background: linear-gradient(135deg, #d4002a 0%, var(--red-dark) 100%);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled {
    background: var(--border, #dde3ea);
    color: var(--text-secondary, #888);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

.login-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 13px 16px;
    background: var(--blue-light, #e0ecf8);
    border-radius: var(--radius-md, 14px);
    font-size: .84rem;
    color: var(--text-secondary, #555);
}
.login-register a {
    color: var(--blue, #024B8E);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.login-register a:hover { text-decoration: underline; }

.login-footer {
    margin-top: 20px;
    font-size: 0.8rem; color: var(--text-muted);
}
.login-footer a { color: var(--red); text-decoration: none; font-weight: 600; }

.login-forgot {
    text-align: right;
    margin-top: -4px;
    margin-bottom: 4px;
}
.login-forgot a {
    font-size: .8rem;
    color: var(--blue, #024B8E);
    text-decoration: none;
    font-weight: 600;
}

/* ── Recupera password — successo ───────────────────────── */
.rp-success {
    text-align: center;
    padding: 10px 0 6px;
}
.rp-success-icon {
    color: #22c55e;
    margin-bottom: 12px;
}
.rp-success-icon svg { width: 52px; height: 52px; stroke-width: 1.5; }
.rp-success-title {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary, #111);
    margin-bottom: 8px;
}
.rp-success-msg {
    font-size: .88rem;
    color: var(--text-muted, #666);
    line-height: 1.5;
}

/* ── Requisiti password ─────────────────────────────────── */
.rp-req-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rp-req {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    color: var(--text-muted, #999);
    transition: color .15s;
}
.rp-req-ico {
    font-size: .8rem;
    font-weight: 700;
    color: #e03131;
    width: 14px;
    text-align: center;
    transition: color .15s;
}
.rp-req--ok {
    color: #22c55e;
}
.rp-req--ok .rp-req-ico {
    color: #22c55e;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── Responsive helpers ──────────────────────────────────── */
@media (max-width: 480px) {
    .app-main { padding: 18px 14px 50px; }
    .card, .page-content { padding: 20px; }
    .login-container { padding: 36px 24px; }
    .user-card-banner { padding: 18px 100px 18px 18px; min-height: 80px; }
    .idx-avatar-wrap { right: 14px; }
    .idx-avatar-wrap .user-avatar-right { width: 68px; height: 68px; }
    .user-avatar-right span { font-size: 1.35rem; }
    .detail-item { padding: 12px 20px; }
}

/* ── footer.php ───────────────────────────────────────────── */
#page-loader-bar {
    position: fixed; top: 0; left: 0; z-index: 9999;
    height: 3px;
    background: var(--blue, #024B8E);
    width: 0%;
    opacity: 0;
    transition: width .35s cubic-bezier(.4,0,.2,1), opacity .2s;
    pointer-events: none;
}
#page-loader-bar.loading {
    opacity: 1;
    width: 75%;
    transition: width 2.5s cubic-bezier(.1,0,.2,1), opacity .1s;
}
#page-loader-bar.done {
    width: 100%;
    opacity: 0;
    transition: width .15s ease, opacity .3s ease .1s;
}

/* ── index.php ────────────────────────────────────────────── */

/* Wrapper assoluto che contiene il cerchio avatar + bottone Profilo */
.idx-avatar-wrap {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    z-index: 2;
}
/* Il cerchio avatar ora non è più posizionato in assoluto */
.idx-avatar-wrap .user-avatar-right {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    z-index: auto;
}
.idx-avatar-profilo-btn {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .7rem;
    font-weight: 700;
    border-radius: 20px;
    text-decoration: none;
    letter-spacing: .03em;
    backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
.idx-avatar-profilo-btn:active { background: rgba(255,255,255,.30); }

/* Riga N. Ente Albo */
.idx-albo-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px 0;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .8rem;
    color: var(--text-muted, #666);
}
.idx-albo-row strong {
    color: var(--text, #1a1a1a);
    font-weight: 700;
}
.idx-albo-row svg { stroke: var(--text-muted,#999); flex-shrink:0; }

/* Riga contatti (email + telefono, solo icone) */
.idx-contact-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px 8px;
    border-top: 1px solid var(--border, #e0e0e0);
    margin-top: 6px;
}
.idx-contact-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .84rem;
    color: var(--text, #1a1a1a);
    min-width: 0;
}
.idx-contact-item svg { stroke: var(--text-muted,#999); flex-shrink:0; }
.idx-contact-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* WhatsApp riga compatta (dentro la card) */
.idx-wa-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    text-decoration: none;
    color: #1a6b1f;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .82rem;
    font-weight: 600;
    border-top: 1px solid var(--border, #e0e0e0);
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
.idx-wa-row svg { color: #25D366; flex-shrink:0; }
.idx-wa-row:active { background: rgba(37,211,102,.06); }

/* ── Download tesserini ─────────────────────────────────────── */
.idx-tesserini-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 16px;
    border-top: 1px solid var(--border, #e0e0e0);
}
.idx-tess-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 20px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(2,75,142,.07);
    color: var(--blue, #024B8E);
    border: 1.5px solid rgba(2,75,142,.18);
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.idx-tess-btn:active { background: rgba(2,75,142,.14); }
.idx-tess-btn--albo {
    background: rgba(180,140,0,.07);
    color: #7a5d00;
    border-color: rgba(180,140,0,.25);
}
.idx-tess-btn--albo:active { background: rgba(180,140,0,.14); }


/* ── Widget row (appuntamenti + notizie) ────────────────────── */
.idx-widgets-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.idx-widget {
    background: var(--surface, #fff);
    border-radius: var(--radius-xl, 18px);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
}
.idx-widget-hdr {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 14px 10px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted, #888);
    border-bottom: 1px solid var(--border, #e0e0e0);
}
.idx-widget-hdr svg { stroke: var(--text-muted, #888); flex-shrink: 0; }

.idx-widget-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.idx-widget-row:last-of-type { border-bottom: none; }

.idx-widget-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 30px;
    flex-shrink: 0;
}
.idx-widget-day {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    color: var(--red, #C40020);
}
.idx-widget-mon {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted, #888);
}

.idx-widget-info { flex: 1; min-width: 0; }
.idx-widget-title {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.idx-widget-sub {
    font-size: .74rem;
    color: var(--text-muted, #888);
    margin-top: 1px;
}

.idx-widget-more {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    padding: 8px 14px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .76rem;
    font-weight: 700;
    color: var(--blue, #024B8E);
    text-decoration: none;
    border-top: 1px solid var(--border, #e0e0e0);
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.idx-widget-more:active { background: rgba(2,75,142,.04); }
.idx-widget-more svg { stroke: var(--blue, #024B8E); opacity: .6; flex-shrink: 0; }

/* Mobile: i widget si impilano */
@media (max-width: 480px) {
    .idx-widgets-row { grid-template-columns: 1fr; }
    .idx-widget-title { white-space: normal; }
}

/* ── Widget notifiche — badge rosso nell'header ───────────── */
.idx-notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--red, #C40020);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    margin-left: auto;
}

/* Riga non letta nel widget notifiche (home preview) */
.idx-widget-row--unread {
    background: var(--blue-light, #e0ecf8);
    border-left: 3px solid var(--blue, #024B8E);
    padding-left: 11px; /* compensa il border */
}

/* ── Firma — testo privacy (in edit mode profilo) ───────────── */
.firma-privacy-text {
    padding: 14px 16px;
    background: rgba(2,75,142,.04);
    border-left: 3px solid var(--blue, #024B8E);
    margin: 0 16px 4px;
    border-radius: 0 8px 8px 0;
}
.firma-privacy-text p {
    font-size: .82rem;
    line-height: 1.55;
    color: var(--text-muted, #666);
    margin: 0 0 8px;
}
.firma-privacy-text p:last-child { margin-bottom: 0; }

/* ── profilo.php ──────────────────────────────────────────── */
/* ── Hero ───────────────────────────────────────────────────── */
.prof-hero {
    background: linear-gradient(135deg, #111 0%, var(--red,#C40020) 100%);
    border-radius: var(--radius-lg,16px);
    padding: 20px 18px;
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.prof-avatar {
    flex-shrink: 0;
    width: 60px; height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(255,255,255,.35);
    display: flex; align-items: center; justify-content: center;
    background: var(--blue,#024B8E);
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1.4rem; font-weight: 800; color: #fff;
}
.prof-avatar img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: cover; }
/* Avatar senza foto: sfondo grigio, icona omino bianca */
.prof-avatar--no-photo {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.45);
}
.prof-avatar--no-photo svg {
    width: 34px; height: 34px;
    stroke: rgba(255,255,255,.85);
}
.prof-hero-txt { flex: 1; min-width: 0; }
.prof-hero-name {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1.1rem; font-weight: 800; color: #fff; line-height: 1.2;
}
.prof-hero-sub { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: 4px; }
.prof-hero-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.prof-edit-btn {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0 14px; height: 34px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 999px;
    color: #fff; text-decoration: none;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .76rem; font-weight: 700;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.prof-edit-btn:active { background: rgba(255,255,255,.3); }
.prof-edit-btn svg { width: 13px; height: 13px; stroke: #fff; }

/* ── Section card ───────────────────────────────────────────── */
.prof-card {
    background: var(--surface,#fff);
    border: 1px solid var(--border,#e0e0e0);
    border-radius: var(--radius-lg,16px);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    margin-bottom: 14px;
}
.prof-card-title {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border,#e0e0e0);
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .73rem; font-weight: 800;
    color: var(--text-muted,#888);
    text-transform: uppercase; letter-spacing: .5px;
}
.prof-card-title svg { width: 13px; height: 13px; flex-shrink: 0; stroke: var(--red,#C40020); }

/* ── Field rows (view mode) ─────────────────────────────────── */
.prof-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 6px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border,#e0e0e0);
    align-items: start;
}
.prof-row:last-child { border-bottom: none; }
.prof-label {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .69rem; font-weight: 700;
    color: var(--text-muted,#888);
    text-transform: uppercase; letter-spacing: .4px;
    padding-top: 2px;
}
.prof-val {
    font-size: .84rem; color: var(--text-primary,#111);
    line-height: 1.45; word-break: break-word;
}
.prof-val--dim { color: var(--text-muted,#aaa); font-style: italic; }
.prof-val--lock {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .84rem; color: var(--text-secondary,#555);
}
.prof-val--lock svg { width: 11px; height: 11px; stroke: var(--text-muted,#aaa); flex-shrink: 0; }

/* ── Form fields (edit mode) ────────────────────────────────── */
.prof-form-group { padding: 10px 16px; border-bottom: 1px solid var(--border,#e0e0e0); }
.prof-form-group:last-child { border-bottom: none; }
.prof-form-label {
    display: block; margin-bottom: 5px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .69rem; font-weight: 700;
    color: var(--text-muted,#888);
    text-transform: uppercase; letter-spacing: .4px;
}
.prof-inp, .prof-select {
    width: 100%; box-sizing: border-box;
    height: 40px; padding: 0 12px;
    border: 1.5px solid var(--border,#e0e0e0);
    border-radius: var(--radius-md,12px);
    font-size: .86rem;
    font-family: var(--font-body,'DM Sans',sans-serif);
    color: var(--text-primary,#111);
    background: var(--surface,#fff);
    outline: none;
    transition: border-color .15s;
}
.prof-inp:focus, .prof-select:focus { border-color: var(--blue,#024B8E); }
.prof-inp--readonly { background: var(--surface-2,#f5f5f5); color: var(--text-muted,#999); cursor: not-allowed; }

.prof-save-btn {
    width: 100%; height: 50px;
    background: var(--blue,#024B8E);
    border: none; border-radius: var(--radius-md,12px);
    color: #fff;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .94rem; font-weight: 800;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.prof-save-btn:active { opacity: .85; }
.prof-save-btn:disabled {
    background: var(--border, #dde3ea);
    color: var(--text-secondary, #888);
    cursor: not-allowed;
    opacity: 1;
}
.prof-save-btn:disabled svg { stroke: var(--text-secondary, #888); }
.prof-save-btn svg { width: 17px; height: 17px; stroke: #fff; }

/* ── Cambia Password (profilo) ──────────────────────────── */
.prof-pw-actions {
    padding: 4px 16px 16px;
}
.prof-pw-submit {
    width: 100%;
    padding: 13px 0;
    background: var(--blue, #024B8E);
    color: #fff;
    border: none;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .92rem; font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .15s, opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.prof-pw-submit:hover   { background: #013a70; }
.prof-pw-submit:active  { opacity: .85; }
.prof-pw-submit:disabled {
    background: var(--border, #e2e6ea);
    color: var(--text-muted, #aaa);
    cursor: not-allowed;
}
/* req list dentro prof-form-group */
.prof-form-group .rp-req-list { margin-top: 10px; }
.prof-cancel-link {
    display: block; text-align: center;
    margin-top: 12px; padding: 10px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .84rem; font-weight: 700;
    color: var(--text-muted,#888); text-decoration: none;
}

/* ── Errori form ─────────────────────────────────────────────── */
.prof-errors {
    background: #fff0f0;
    border: 1px solid rgba(196,0,32,.2);
    border-radius: var(--radius-md,12px);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: .84rem; color: var(--red,#C40020);
    display: flex; flex-direction: column; gap: 4px;
}

/* ── Allegati ────────────────────────────────────────────────── */
.prof-all-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border,#e0e0e0);
}
.prof-all-row:last-child { border-bottom: none; }
.prof-all-icon {
    flex-shrink: 0; width: 34px; height: 34px;
    border-radius: 9px; background: rgba(2,75,142,.08);
    display: flex; align-items: center; justify-content: center;
}
.prof-all-icon svg { width: 16px; height: 16px; stroke: var(--blue,#024B8E); }
.prof-all-info { flex: 1; min-width: 0; }
.prof-all-name {
    font-size: .84rem; font-weight: 600; color: var(--text-primary,#111);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prof-all-meta { font-size: .73rem; color: var(--text-muted,#aaa); margin-top: 1px; }
.prof-all-actions {
    flex-shrink: 0; display: flex; align-items: center; gap: 6px;
}
.prof-all-btn {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; border: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s;
}
.prof-all-btn:active { opacity: .75; }
.prof-all-btn svg { width: 15px; height: 15px; }
.prof-all-btn--dl  { background: var(--blue,#024B8E); }
.prof-all-btn--dl svg { stroke: #fff; }
.prof-all-btn--edit { background: rgba(2,75,142,.1); }
.prof-all-btn--edit svg { stroke: var(--blue,#024B8E); }
.prof-all-btn--del  { background: rgba(196,0,32,.1); }
.prof-all-btn--del svg { stroke: var(--red,#C40020); }
/* Riga Tesserino Personale */
.prof-all-row--tessera { background: linear-gradient(90deg,rgba(2,75,142,.04) 0%,transparent 100%); }
.prof-all-icon--tessera { background: rgba(2,75,142,.12) !important; }
.prof-all-icon--tessera svg { stroke: var(--blue,#024B8E); }
.prof-all-btn--tessera { background: var(--blue,#024B8E); }
/* Upload grid a colonna singola */
.prof-upload-grid--single { grid-template-columns: 1fr; }

/* ── Modal elimina allegato ──────────────────────────────────── */
.del-modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
    align-items: flex-end; justify-content: center;
}
.del-modal-backdrop.open { display: flex; }
.del-modal-sheet {
    background: var(--surface,#fff);
    border-radius: 20px 20px 0 0;
    padding: 12px 20px 36px;
    width: 100%; max-width: 480px;
    animation: slideUp .25s cubic-bezier(.34,1.3,.64,1);
}
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.del-modal-handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border,#ddd); margin: 0 auto 18px;
}
.del-modal-icon {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(196,0,32,.1);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.del-modal-icon svg { width: 24px; height: 24px; stroke: var(--red,#C40020); }
.del-modal-title {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1rem; font-weight: 800;
    color: var(--text-primary,#111); text-align: center; margin-bottom: 6px;
}
.del-modal-sub {
    font-size: .82rem; color: var(--text-muted,#888);
    text-align: center; margin-bottom: 22px; line-height: 1.5;
}
.del-modal-sub strong { color: var(--text-primary,#111); }
.del-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.del-modal-btn-confirm {
    height: 50px; border: none; border-radius: 12px;
    background: var(--red,#C40020); color: #fff;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .94rem; font-weight: 800; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s;
}
.del-modal-btn-confirm:active { opacity: .85; }
.del-modal-btn-cancel {
    height: 46px; border: none; border-radius: 12px;
    background: var(--surface-2,#f5f5f5); color: var(--text-secondary,#555);
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .9rem; font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── Upload form ─────────────────────────────────────────────── */
.prof-upload-wrap {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border,#e0e0e0);
}
/* Riga upload orizzontale */
.prof-upload-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border: 1.5px dashed var(--border,#dde1e7);
    border-radius: var(--radius-md,12px);
    cursor: pointer;
    background: var(--surface-2,#fafafa);
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
.prof-upload-row:hover { border-color: var(--blue,#024B8E); background: rgba(2,75,142,.03); }
.prof-upload-row:active { background: rgba(2,75,142,.06); }
.prof-upload-row--active {
    border-style: solid; border-color: var(--blue,#024B8E);
    background: rgba(2,75,142,.04);
}
.prof-upload-row-icon {
    flex-shrink: 0; width: 38px; height: 38px;
    border-radius: 10px; background: rgba(2,75,142,.1);
    display: flex; align-items: center; justify-content: center;
}
.prof-upload-row-icon svg { width: 18px; height: 18px; stroke: var(--blue,#024B8E); }
.prof-upload-row-info { flex: 1; min-width: 0; }
.prof-upload-row-lbl {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .82rem; font-weight: 700;
    color: var(--text-primary,#222); display: block; margin-bottom: 2px;
}
.prof-upload-row--active .prof-upload-row-lbl { color: var(--blue,#024B8E); }
.prof-upload-row-sub { font-size: .72rem; color: var(--text-muted,#999); }
.prof-upload-row-cta {
    flex-shrink: 0; display: flex; align-items: center; gap: 5px;
    font-size: .76rem; font-weight: 700; color: var(--blue,#024B8E);
    background: rgba(2,75,142,.1); border-radius: 8px; padding: 6px 12px;
    white-space: nowrap;
}
.prof-upload-row-cta svg { width: 13px; height: 13px; stroke: var(--blue,#024B8E); }
/* Submit */
.prof-upload-submit {
    margin-top: 10px; width: 100%; height: 42px;
    background: var(--surface-2,#f0f0f0);
    border: 1.5px solid var(--border,#e0e0e0);
    border-radius: var(--radius-md,12px);
    font-size: .82rem; font-weight: 600; color: var(--text-muted,#bbb);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    cursor: not-allowed;
    transition: background .15s, color .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
}
.prof-upload-submit.ready {
    background: var(--blue,#024B8E); border-color: var(--blue,#024B8E);
    color: #fff; cursor: pointer;
}
.prof-upload-submit svg { width: 15px; height: 15px; stroke: currentColor; }

/* ── privacy.php ──────────────────────────────────────────── */
.priv-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 32px 16px;
    text-align: center;
}
.priv-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.priv-icon--ok  { background: #d1fae5; }
.priv-icon--ko  { background: #f5f5f5; }
.priv-icon svg  { width: 30px; height: 30px; }
.priv-icon--ok svg { stroke: #065f46; }
.priv-icon--ko svg { stroke: var(--text-muted, #aaa); }
.priv-title {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1.05rem; font-weight: 800;
    color: var(--text-primary, #111);
    margin: 0;
}
.priv-sub {
    font-size: .85rem;
    color: var(--text-muted, #888);
    line-height: 1.55;
    margin: 0;
    max-width: 280px;
}
.priv-dl-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 24px; height: 50px;
    background: var(--blue, #024B8E);
    color: #fff; text-decoration: none;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .94rem; font-weight: 800;
    box-shadow: 0 4px 14px rgba(2,75,142,.25);
    transition: opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.priv-dl-btn:active { opacity: .85; }
.priv-dl-btn svg { width: 18px; height: 18px; stroke: #fff; }
.priv-meta {
    font-size: .76rem; color: var(--text-muted, #aaa);
}

/* ── prenota.php ──────────────────────────────────────────── */
/* ── Recap card ──────────────────────────────────────────── */
.pren-recap {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.pren-recap-hdr {
    background: linear-gradient(135deg, #024B8E 0%, #0262b8 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pren-recap-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pren-recap-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.pren-recap-txt {
    flex: 1;
    min-width: 0;
}

.pren-recap-nome {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .96rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.pren-recap-spec {
    font-size: .75rem;
    color: rgba(255, 255, 255, .7);
    margin-top: 2px;
}

.pren-recap-body {
    padding: 2px 0 4px;
}

.pren-recap-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    font-size: .84rem;
    color: var(--text-secondary, #444);
}

.pren-recap-row:last-child {
    border-bottom: none;
}

.pren-recap-row svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: var(--text-muted, #aaa);
}

/* ── Form card ───────────────────────────────────────────── */
.pren-form-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.pren-form-section {
    padding: 14px 16px 4px;
    border-bottom: 1px solid var(--border, #e0e0e0);
}

.pren-form-section:last-child {
    border-bottom: none;
    padding-bottom: 18px;
}

.pren-form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .72rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
}

.pren-form-label svg {
    width: 13px;
    height: 13px;
    stroke: var(--red, #C40020);
}

.pren-req {
    color: var(--red, #C40020);
    font-weight: 800;
}

.pren-form-optional {
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-muted, #bbb);
    text-transform: none;
    letter-spacing: 0;
}

/* Date input */
.pren-date-inp {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--border, #e0e0e0);
    border-radius: var(--radius-md, 12px);
    font-size: .9rem;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    color: var(--text-primary, #111);
    background: var(--surface, #fff);
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.pren-date-inp:focus {
    border-color: var(--blue, #024B8E);
}

/* Slot container */
.pren-slots-wrap {
    min-height: 48px;
}

.pren-slot-hint {
    font-size: .82rem;
    color: var(--text-muted, #aaa);
    font-style: italic;
    padding: 6px 0 10px;
}

.pren-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
}

.pren-slot {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--border, #e0e0e0);
    background: var(--surface, #fff);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .86rem;
    font-weight: 700;
    color: var(--text-secondary, #444);
    cursor: pointer;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}

.pren-slot:active {
    transform: scale(.95);
}

.pren-slot--sel {
    background: var(--blue, #024B8E);
    border-color: var(--blue, #024B8E);
    color: #fff;
}

.pren-slot--disabled {
    opacity: .38;
    cursor: not-allowed;
    background: var(--surface-2, #f5f5f5);
    border-color: var(--border, #e0e0e0);
    color: var(--text-muted, #aaa);
}

.pren-no-slots {
    font-size: .83rem;
    color: var(--text-muted, #aaa);
    font-style: italic;
    padding: 6px 0 10px;
    margin: 0;
}

/* Note textarea */
.pren-note-inp {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border, #e0e0e0);
    border-radius: var(--radius-md, 12px);
    font-size: .86rem;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    color: var(--text-primary, #111);
    background: var(--surface, #fff);
    outline: none;
    resize: none;
    transition: border-color .15s;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.pren-note-inp:focus {
    border-color: var(--blue, #024B8E);
}

/* Submit */
.pren-submit-wrap {
    padding: 16px;
}

.pren-submit-btn {
    width: 100%;
    height: 50px;
    border-radius: var(--radius-md, 12px);
    background: var(--blue, #024B8E);
    border: none;
    color: #fff;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .96rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: opacity .15s;
    -webkit-tap-highlight-color: transparent;
}

.pren-submit-btn:disabled {
    opacity: .4;
    cursor: default;
}

.pren-submit-btn:not(:disabled):active {
    opacity: .85;
}

.pren-submit-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

/* Errors */
.pren-errors {
    background: var(--red-light, #fff0f0);
    border: 1px solid rgba(196, 0, 32, .2);
    border-radius: var(--radius-md, 12px);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: .85rem;
    color: var(--red, #C40020);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── appuntamenti.php ─────────────────────────────────────── */
/* ── Sezione titolo ──────────────────────────────────────── */
.app-sec {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px;
}

.app-sec svg {
    width: 16px;
    height: 16px;
    stroke: var(--blue, #024B8E);
    flex-shrink: 0;
}

.app-sec span {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .8rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.app-sec-count {
    margin-left: auto;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted, #888);
    background: var(--surface-2, #f5f5f5);
    border: 1px solid var(--border, #e0e0e0);
    padding: 3px 9px;
    border-radius: 999px;
}

.app-sec--storico {
    margin-top: 28px;
}

.app-sec--storico svg {
    stroke: var(--text-muted, #aaa);
}

/* ── Card evento federazione ─────────────────────────────── */
.app-ev-card {
    background: var(--surface, #fff);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
    border-left: 4px solid var(--red, #C40020);
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 12px;
}

.app-ev-date {
    background: rgba(196, 0, 32, .06);
    min-width: 56px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--red, #C40020);
    flex-shrink: 0;
}

.app-ev-date-m {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.app-ev-date-d {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.app-ev-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.app-ev-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-primary, #111);
}

.app-ev-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.app-ev-meta span {
    font-size: .8rem;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-ev-meta svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ── Card prenotazione medico ────────────────────────────── */
.pren-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    overflow: hidden;
    margin-bottom: 12px;
}

.pren-card--passata {
    opacity: .7;
}

.pren-card-hdr {
    background: linear-gradient(135deg, #024B8E 0%, #0260b5 100%);
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pren-card-hdr--annullata {
    background: linear-gradient(135deg, #555 0%, #777 100%);
}

.pren-card-hdr--passata {
    background: linear-gradient(135deg, #065f46 0%, #0f766e 100%);
}

.pren-hdr-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pren-hdr-icon svg {
    width: 15px;
    height: 15px;
    stroke: #fff;
}

.pren-hdr-txt {
    flex: 1;
    min-width: 0;
}

.pren-hdr-nome {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .88rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pren-hdr-spec {
    font-size: .71rem;
    color: rgba(255, 255, 255, .75);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pren-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .68rem;
    font-weight: 700;
}

.pren-badge--attesa {
    background: #fef3c7;
    color: #92400e;
}

.pren-badge--confermato {
    background: #d1fae5;
    color: #065f46;
}

.pren-badge--annullata {
    background: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .9);
}

.pren-badge--passata {
    background: #d1fae5;
    color: #065f46;
}

/* Avviso non-annullabile */
.pren-nocancel {
    padding: 9px 14px 12px;
    border-top: 1px solid var(--border, #e0e0e0);
    font-size: .8rem;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pren-nocancel svg {
    width: 13px;
    height: 13px;
    stroke: var(--text-muted, #aaa);
    flex-shrink: 0;
}

/* ── Modal disdetta ──────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
}
.modal-backdrop.modal--open {
    opacity: 1;
    pointer-events: all;
}
.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--surface, #fff);
    border-radius: 22px 22px 0 0;
    padding: 8px 20px 28px;
    transform: translateY(60px);
    transition: transform .25s cubic-bezier(.34,1.2,.64,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}
.modal-backdrop.modal--open .modal-sheet {
    transform: translateY(0);
}
.modal-handle {
    width: 38px; height: 4px;
    background: var(--border, #ddd);
    border-radius: 99px;
    margin: 10px auto 18px;
}
.modal-icon-wrap {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: #fff0f0;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.modal-icon-wrap svg {
    width: 26px; height: 26px;
    stroke: var(--red, #C40020);
}
.modal-title {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #111);
    text-align: center;
    margin-bottom: 8px;
}
.modal-body {
    font-size: .84rem;
    color: var(--text-muted, #888);
    text-align: center;
    line-height: 1.55;
    margin-bottom: 22px;
}
.modal-body strong {
    color: var(--text-primary, #111);
    font-weight: 700;
}
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modal-btn-confirm {
    width: 100%; height: 50px;
    background: var(--red, #C40020);
    border: none;
    border-radius: var(--radius-md, 12px);
    color: #fff;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .94rem; font-weight: 800;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.modal-btn-confirm:active { opacity: .85; }
.modal-btn-confirm svg { width: 16px; height: 16px; stroke: #fff; }
.modal-btn-cancel {
    width: 100%; height: 46px;
    background: var(--surface-2, #f5f5f5);
    border: 1.5px solid var(--border, #e0e0e0);
    border-radius: var(--radius-md, 12px);
    color: var(--text-secondary, #555);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .88rem; font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.modal-btn-cancel:active { background: #ebebeb; }

.pren-rows {
    padding: 2px 0 4px;
}

.pren-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    align-items: start;
}

.pren-row:last-child {
    border-bottom: none;
}

.pren-row-label {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .4px;
    padding-top: 2px;
}

.pren-row-val {
    font-size: .83rem;
    color: var(--text-primary, #111);
    line-height: 1.5;
    word-break: break-word;
}

.pren-row-val--date {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-weight: 700;
    color: var(--blue, #024B8E);
    font-size: .86rem;
}

.pren-row-val--muted {
    color: var(--text-muted, #888);
    font-size: .85rem;
}

/* ── Ora badge ───────────────────────────────────────────── */
.pren-ora-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 9px;
    background: var(--blue, #024B8E);
    color: #fff;
    border-radius: 999px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}

.pren-ora-badge svg {
    width: 11px;
    height: 11px;
    stroke: #fff;
    flex-shrink: 0;
}

.pren-ora-badge--muted {
    background: var(--surface-2, #f0f0f0);
    color: var(--text-muted, #888);
}

.pren-ora-badge--muted svg {
    stroke: var(--text-muted, #888);
}

/* ── Azioni appuntamento (gcal + cancella) ───────────────── */
.pren-actions {
    padding: 10px 14px 13px;
    border-top: 1px solid var(--border, #e0e0e0);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Bottone Google Calendar */
.appt-gcal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    background: #fff;
    border: 1.5px solid #4285F4;
    color: #4285F4;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}
.appt-gcal-btn:active {
    background: #4285F4;
    color: #fff;
}
.appt-gcal-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Vecchio wrapper singolo — mantieni compatibilità */
.pren-cancel-wrap {
    padding: 10px 14px 13px;
    border-top: 1px solid var(--border, #e0e0e0);
}

.pren-cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 1.5px solid var(--red, #C40020);
    color: var(--red, #C40020);
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}

.pren-cancel-btn:active {
    background: var(--red, #C40020);
    color: #fff;
}

.pren-cancel-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.pren-cancel-btn--ghost {
    border-color: var(--border, #e0e0e0);
    color: var(--text-muted, #888);
    font-size: .8rem;
}

.pren-cancel-btn--ghost:active {
    background: var(--surface-2, #f0f0f0);
    color: var(--text-primary, #111);
}

.pren-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--surface, #fff);
    border: 1px dashed var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    text-align: center;
    margin-bottom: 12px;
}

.pren-empty svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-muted, #bbb);
}

.pren-empty p {
    font-size: .84rem;
    color: var(--text-muted, #888);
    margin: 0;
    line-height: 1.5;
}

.pren-empty a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 8px 18px;
    background: var(--blue, #024B8E);
    color: #fff;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.pren-empty a svg {
    width: 13px;
    height: 13px;
    stroke: #fff;
}

/* ── medico_detail.php ────────────────────────────────────── */
/* ── Hero card ───────────────────────────────────────────── */
.mdc-hero {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
    overflow: hidden;
    margin-bottom: 14px;
}

.mdc-hero-band {
    background: linear-gradient(135deg, #111 0%, var(--red, #C40020) 100%);
    padding: 20px 18px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mdc-big-avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .5px;
    border: 2.5px solid rgba(255, 255, 255, .3);
}

.mdc-hero-text {
    flex: 1;
    min-width: 0;
}

.mdc-hero-name {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 6px;
}

.mdc-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mdc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2px;
}

.mdc-badge--codice {
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: .76rem;
    letter-spacing: .5px;
}

.mdc-badge--attivo {
    background: #d1fae5;
    color: #065f46;
}

.mdc-badge--inattivo {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Info card ───────────────────────────────────────────── */
.mdc-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    overflow: hidden;
    margin-bottom: 14px;
}

.mdc-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px 10px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .75rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mdc-card-title svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: var(--red, #C40020);
    color: var(--red, #C40020);
}

/* ── Field rows ──────────────────────────────────────────── */
.mdc-rows {
    padding: 4px 0 6px;
}

.mdc-row {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    align-items: start;
}

.mdc-row:last-child {
    border-bottom: none;
}

.mdc-row-label {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .71rem;
    font-weight: 700;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .4px;
    padding-top: 2px;
}

.mdc-row-val {
    font-size: .85rem;
    color: var(--text-primary, #111);
    line-height: 1.5;
    word-break: break-word;
}

.mdc-row-val a {
    color: var(--blue, #024B8E);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mdc-row-val a svg {
    width: 12px;
    height: 12px;
}

/* ── Sedi section title ──────────────────────────────────── */
.mdc-sedi-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 12px;
}

.mdc-sedi-title svg {
    width: 16px;
    height: 16px;
    stroke: var(--blue, #024B8E);
    color: var(--blue, #024B8E);
    flex-shrink: 0;
}

.mdc-sedi-title span {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .8rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mdc-sedi-count {
    margin-left: auto;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted, #888);
    background: var(--surface-2, #f5f5f5);
    border: 1px solid var(--border, #e0e0e0);
    padding: 3px 9px;
    border-radius: 999px;
}

/* ── Sede card ───────────────────────────────────────────── */
.mdc-sede {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    overflow: hidden;
    margin-bottom: 12px;
}

.mdc-sede-hdr {
    background: linear-gradient(135deg, #024B8E 0%, #0260b5 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mdc-sede-hdr-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdc-sede-hdr-icon svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    color: #fff;
}

.mdc-sede-hdr-text {
    flex: 1;
    min-width: 0;
}

.mdc-sede-nome {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .9rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.mdc-sede-citta {
    font-size: .74rem;
    color: rgba(255, 255, 255, .7);
    margin-top: 1px;
}

/* ── Orari table ─────────────────────────────────────────── */
.mdc-orari-wrap {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border, #e0e0e0);
}

.mdc-orari-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .69rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.mdc-orari-label svg {
    width: 12px;
    height: 12px;
    stroke: var(--text-muted, #aaa);
}

.mdc-orari-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .81rem;
}

.mdc-orari-table thead th {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-muted, #aaa);
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 4px 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border, #e0e0e0);
}

.mdc-orari-table thead th:first-child {
    width: 90px;
}

.mdc-orari-table tbody tr:last-child td {
    border-bottom: none;
}

.mdc-orari-table tbody td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    vertical-align: middle;
    color: var(--text-primary, #111);
}

.mdc-orari-table tbody td:first-child {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: .78rem;
    color: var(--text-secondary, #444);
}

.mdc-orari-dash {
    color: var(--text-muted, #bbb);
}

/* ── Prenota button (nell'header sede) ───────────────────── */
.mdc-prenota-ico {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 13px;
    height: 32px;
    border-radius: 999px;
    background: #fff;
    border: none;
    text-decoration: none;
    color: var(--blue, #024B8E);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .2px;
    white-space: nowrap;
    transition: opacity .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.mdc-prenota-ico:active {
    opacity: .85;
    transform: scale(.96);
}

.mdc-prenota-ico svg {
    width: 13px;
    height: 13px;
    stroke: var(--blue, #024B8E);
    flex-shrink: 0;
}

/* ── Sede action buttons (prenota online + agenda) ────────── */
.mdc-sede-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    flex-wrap: wrap;
}

.mdc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 14px;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    border: none;
    cursor: pointer;
}

.mdc-action-btn:active {
    opacity: .85;
    transform: scale(.97);
}

.mdc-action-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}

.mdc-action-btn--book {
    background: var(--blue, #024B8E);
    color: #fff;
}

.mdc-action-btn--agenda {
    background: var(--surface-2, #f0f4fa);
    color: var(--blue, #024B8E);
    border: 1.5px solid var(--blue, #024B8E);
}

/* ── Sede no-sedi empty ──────────────────────────────────── */
.mdc-no-sedi {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    background: var(--surface, #fff);
    border: 1px dashed var(--border, #e0e0e0);
    border-radius: var(--radius-md, 12px);
    font-size: .85rem;
    color: var(--text-muted, #888);
    margin-bottom: 8px;
}

.mdc-no-sedi svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (min-width: 520px) {
    .mdc-row {
        grid-template-columns: 130px 1fr;
    }

    .mdc-big-avatar {
        width: 68px;
        height: 68px;
        font-size: 1.5rem;
    }
}

/* ── medici.php ───────────────────────────────────────────── */
/* ── Page header ─────────────────────────────────────────── */
.med-page-hdr {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.med-page-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg, 16px);
    background: linear-gradient(135deg, #024B8E 0%, #C40020 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.med-page-icon svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    color: #fff;
}

.med-page-title {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text-primary, #111);
    margin: 0 0 2px;
}

.med-page-sub {
    font-size: .82rem;
    color: var(--text-muted, #888);
    margin: 0;
}

/* ── Filters ─────────────────────────────────────────────── */
.med-filters {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    padding: 14px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.med-search-row {
    display: flex;
    gap: 8px;
}

.med-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.med-search-ico {
    position: absolute;
    left: 12px;
    pointer-events: none;
    color: var(--text-muted, #aaa);
}

.med-search-ico svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted, #aaa);
}

.med-search-inp {
    width: 100%;
    height: 42px;
    padding: 0 36px 0 38px;
    border: 1.5px solid var(--border, #e0e0e0);
    border-radius: var(--radius-md, 12px);
    font-size: .86rem;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    color: var(--text-primary, #111);
    background: var(--surface, #fff);
    outline: none;
    transition: border-color .15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.med-search-inp:focus {
    border-color: var(--blue, #024B8E);
}

.med-search-clr {
    position: absolute;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-2, #f0f0f0);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #888);
    padding: 0;
}

.med-search-clr svg {
    width: 12px;
    height: 12px;
}

.med-search-btn {
    flex-shrink: 0;
    height: 42px;
    width: 42px;
    border-radius: var(--radius-md, 12px);
    background: var(--blue, #024B8E);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: opacity .15s;
}

.med-search-btn:active {
    opacity: .8;
}

.med-search-btn svg {
    width: 17px;
    height: 17px;
    stroke: #fff;
}

.med-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.med-filter-grid .fsel-wrap:last-child:nth-child(odd) {
    grid-column: span 2;
}

.med-filter-reset {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    color: var(--red, #C40020);
    text-decoration: none;
    font-weight: 600;
    width: fit-content;
}

.med-filter-reset svg {
    width: 13px;
    height: 13px;
    stroke: var(--red, #C40020);
}

/* ── Results bar ─────────────────────────────────────────── */
.med-results-bar {
    font-size: .78rem;
    color: var(--text-muted, #888);
    font-weight: 600;
    margin-bottom: 10px;
    padding: 0 2px;
}

/* ── Cards ───────────────────────────────────────────────── */
.med-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

/* ── Sezione Notifiche (Home) ────────────────────────────── */
.notif-section {
    margin-bottom: 22px;
}

.notif-section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.notif-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .82rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.notif-section-title svg {
    width: 15px; height: 15px;
    stroke: var(--blue, #024B8E);
    flex-shrink: 0;
}

.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--red, #C40020);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
}

.notif-read-all-btn {
    background: none;
    border: none;
    color: var(--blue, #024B8E);
    font-size: .78rem;
    font-weight: 600;
    font-family: var(--font-head, 'Outfit', sans-serif);
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.notif-read-all-btn:active { opacity: .7; }

/* Lista */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Singolo item */
.notif-item {
    background: var(--surface, #fff);
    border: 1.5px solid var(--border-strong, rgba(2,75,142,.18));
    border-radius: var(--radius-md, 14px);
    overflow: hidden;
    transition: border-color .15s;
}

.notif-item--nuova {
    border-color: var(--blue, #024B8E);
    background: var(--blue-light, #e0ecf8);
}

.notif-item--open {
    border-color: var(--blue, #024B8E);
}

/* Header riga */
.notif-item-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.notif-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* Pallino stato */
.notif-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--blue, #024B8E);
    box-shadow: 0 0 0 3px rgba(2,75,142,.15);
}
.notif-dot--letta {
    background: var(--border-strong, #ccc);
    box-shadow: none;
}

/* Info testo */
.notif-item-info { min-width: 0; }

.notif-item-subject {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-primary, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item--letta .notif-item-subject {
    font-weight: 600;
    color: var(--text-secondary, #555);
}

.notif-item-date {
    font-size: .74rem;
    color: var(--text-muted, #aaa);
    margin-top: 1px;
}

/* Riga mittente + data in-line (pagina notifiche) */
.notif-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.notif-item-meta .notif-item-date { margin-top: 0; }
.notif-item-from {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .74rem;
    color: var(--blue, #024B8E);
    font-weight: 600;
}
.notif-item-from svg { stroke: var(--blue, #024B8E); flex-shrink: 0; }
/* Separatore visivo tra mittente e data */
.notif-item-meta .notif-item-date::before {
    content: '·';
    margin-right: 4px;
    color: var(--border-strong, #bbb);
}

/* Chevron */
.notif-chevron {
    flex-shrink: 0;
    width: 16px; height: 16px;
    stroke: var(--text-muted, #bbb);
    transition: transform .2s;
}

/* Body messaggio */
.notif-item-body {
    display: none;
    padding: 0 14px 14px 33px; /* allineato al testo, dopo il dot */
    border-top: 1px solid var(--border-strong, rgba(2,75,142,.12));
}
.notif-item-msg {
    font-size: .85rem;
    color: var(--text-secondary, #444);
    line-height: 1.65;
    margin: 12px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Pagina Documenti ────────────────────────────────────── */
.doc-count {
    font-size: .8rem;
    color: var(--text-muted, #999);
    margin: 0 0 12px;
}

.doc-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary, #666);
}
.doc-empty-ico {
    width: 56px; height: 56px;
    background: var(--surface-2, #f5f7f9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.doc-empty-ico svg { width: 26px; height: 26px; stroke: var(--text-muted, #bbb); }
.doc-empty h3 {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1rem; font-weight: 700;
    color: var(--text-primary, #111);
    margin: 0 0 8px;
}
.doc-empty p {
    font-size: .86rem; color: var(--text-muted, #999);
    line-height: 1.6; margin: 0;
}
.doc-empty a { color: var(--primary, #024B8E); }

/* Lista */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e8ecf0);
    border-radius: var(--radius-md, 12px);
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: border-color .15s, box-shadow .15s;
}
.doc-item:hover {
    border-color: var(--primary, #024B8E);
    box-shadow: 0 2px 8px rgba(2,75,142,.08);
}

/* Icona file */
.doc-item-icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2, #f0f4f8);
}
.doc-item-icon svg { width: 18px; height: 18px; stroke: var(--primary, #024B8E); }

/* Colori per tipo */
.doc-item-icon--pdf   { background: rgba(220,38,38,.08); }
.doc-item-icon--pdf svg { stroke: #dc2626; }
.doc-item-icon--doc,
.doc-item-icon--docx  { background: rgba(37,99,235,.08); }
.doc-item-icon--doc svg,
.doc-item-icon--docx svg { stroke: #2563eb; }
.doc-item-icon--xls,
.doc-item-icon--xlsx,
.doc-item-icon--csv   { background: rgba(22,163,74,.08); }
.doc-item-icon--xls svg,
.doc-item-icon--xlsx svg,
.doc-item-icon--csv svg { stroke: #16a34a; }
.doc-item-icon--jpg,
.doc-item-icon--jpeg,
.doc-item-icon--png,
.doc-item-icon--gif,
.doc-item-icon--webp  { background: rgba(168,85,247,.08); }
.doc-item-icon--jpg svg,
.doc-item-icon--jpeg svg,
.doc-item-icon--png svg,
.doc-item-icon--gif svg,
.doc-item-icon--webp svg { stroke: #9333ea; }
.doc-item-icon--zip,
.doc-item-icon--rar   { background: rgba(234,179,8,.08); }
.doc-item-icon--zip svg,
.doc-item-icon--rar svg  { stroke: #ca8a04; }

/* Body (nome + meta) */
.doc-item-body {
    flex: 1;
    min-width: 0;
}
.doc-item-name {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-primary, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.doc-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: .74rem;
    color: var(--text-muted, #999);
}
.doc-item-badge {
    background: var(--surface-2, #f0f4f8);
    color: var(--text-secondary, #666);
    padding: 2px 7px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    font-family: var(--font-head, 'Outfit', sans-serif);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.doc-item-sep { color: var(--border, #ccc); }
.doc-item-size,
.doc-item-date { color: var(--text-muted, #aaa); font-size: .73rem; }

/* Pulsante download */
.doc-item-dl {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--surface-2, #f0f4f8);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary, #024B8E);
    text-decoration: none;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.doc-item-dl:hover { background: rgba(2,75,142,.12); }
.doc-item-dl svg { width: 16px; height: 16px; stroke: var(--primary, #024B8E); }

/* ── Filtri comunicazioni ────────────────────────────────── */
.com-filter-bar {
    background: var(--surface-2, #f7f9fc);
    border: 1px solid var(--border-strong, rgba(2,75,142,.18));
    border-radius: var(--radius-md, 14px);
    padding: 12px 14px;
    margin-bottom: 18px;
}

.com-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ── Select ─────────────────────────────────────────────── */
.com-filter-select {
    flex: 1 1 150px;
    min-width: 0;
    height: 40px;
    padding: 0 34px 0 12px;
    border: 1.5px solid var(--border-strong, rgba(2,75,142,.18));
    border-radius: var(--radius-sm, 8px);
    background-color: var(--surface, #fff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-primary, #111);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.com-filter-select:focus {
    outline: none;
    border-color: var(--blue, #024B8E);
    box-shadow: 0 0 0 3px rgba(2,75,142,.10);
}

/* ── Search wrap (newsletter) ───────────────────────────── */
.com-filter-search-wrap {
    flex: 1 1 200px;
    min-width: 0;
    position: relative;
}

.com-filter-search-ico {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    stroke: var(--text-muted, #aaa);
    pointer-events: none;
}

.com-filter-search {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 0 12px 0 36px;
    border: 1.5px solid var(--border-strong, rgba(2,75,142,.18));
    border-radius: var(--radius-sm, 8px);
    background: var(--surface, #fff);
    color: var(--text-primary, #111);
    font-size: 0.85rem;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    transition: border-color .18s, box-shadow .18s;
}

.com-filter-search::placeholder { color: var(--text-muted, #bbb); }

.com-filter-search:focus {
    outline: none;
    border-color: var(--blue, #024B8E);
    box-shadow: 0 0 0 3px rgba(2,75,142,.10);
}

/* ── Bottone cerca ──────────────────────────────────────── */
.com-filter-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 16px;
    background: var(--blue, #024B8E);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-head, 'Outfit', sans-serif);
    letter-spacing: .2px;
    transition: background .18s;
    -webkit-tap-highlight-color: transparent;
}
.com-filter-btn:hover  { background: var(--blue-dark, #013870); }
.com-filter-btn:active { opacity: .85; }
.com-filter-btn svg    { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Rimuovi filtri ─────────────────────────────────────── */
.com-filter-reset {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 40px;
    padding: 0 13px;
    border: 1.5px solid var(--border-strong, rgba(2,75,142,.18));
    border-radius: var(--radius-sm, 8px);
    background: var(--surface, #fff);
    color: var(--text-secondary, #555);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-head, 'Outfit', sans-serif);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .18s, color .18s, background .18s;
    -webkit-tap-highlight-color: transparent;
}
.com-filter-reset:hover {
    border-color: var(--red, #C40020);
    color: var(--red, #C40020);
    background: var(--red-light, #fce8eb);
}
.com-filter-reset svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Label attivi sopra la barra ─────────────────────────── */
.com-filter-active-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.com-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 10px;
    background: var(--blue-light, #e0ecf8);
    color: var(--blue, #024B8E);
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    font-family: var(--font-head, 'Outfit', sans-serif);
}

/* ── Tab medici ──────────────────────────────────────────── */
.med-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.med-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted, #888);
    background: var(--surface, #fff);
    border: 1.5px solid var(--border, #e0e0e0);
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.med-tab--active {
    background: var(--primary, #C40020);
    color: #fff;
    border-color: var(--primary, #C40020);
}

.med-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.3);
    color: #fff;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    line-height: 1;
}

.med-tab:not(.med-tab--active) .med-tab-badge {
    background: var(--primary, #C40020);
}

/* ── Card wrap (card + bottone cuore) ────────────────────── */
.med-card-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.med-card-wrap .med-card {
    flex: 1;
    min-width: 0;
    padding-right: 44px;  /* spazio per il cuore */
}

/* ── Bottone cuore ───────────────────────────────────────── */
.med-fav-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #ccc);
    padding: 0;
    transition: color .15s, transform .15s;
    -webkit-tap-highlight-color: transparent;
}

.med-fav-btn:active {
    transform: translateY(-50%) scale(.85);
}

.med-fav-btn--active {
    color: #e03131;
}

.med-fav-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* ── Card medico compatta ─────────────────────────────────── */
.med-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-md, 12px);
    padding: 10px 12px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    transition: transform .14s ease, box-shadow .14s ease;
    -webkit-tap-highlight-color: transparent;
}

.med-card:active {
    transform: scale(.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}

.med-card-name {
    flex: 1;
    min-width: 0;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.med-card-spec {
    flex-shrink: 0;
    font-size: .74rem;
    color: var(--blue, #024B8E);
    font-weight: 600;
    white-space: nowrap;
    max-width: 38%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.med-arr {
    flex-shrink: 0;
    color: var(--text-muted, #bbb);
}

/* ── Campo CAP nel form filtri ───────────────────────────── */
.med-cap-row {
    margin-top: 6px;
}

.med-cap-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface, #fff);
    border: 1.5px solid var(--border, #ddd);
    border-radius: var(--radius-md, 12px);
    padding: 0 10px;
    height: 42px;
    gap: 7px;
    max-width: 180px;
}

.med-cap-ico {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: var(--text-muted, #999);
}

.med-cap-inp {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: .85rem;
    color: var(--text-primary, #111);
    font-family: inherit;
    min-width: 0;
}

.med-cap-inp::placeholder {
    color: var(--text-muted, #aaa);
}

.med-arr svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted, #bbb);
}

/* ── Empty ───────────────────────────────────────────────── */
.med-empty {
    background: var(--surface, #fff);
    border: 1px dashed var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    padding: 40px 24px;
    text-align: center;
}

.med-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface-2, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.med-empty-icon svg {
    width: 26px;
    height: 26px;
    stroke: #bbb;
}

.med-empty p {
    font-size: .88rem;
    color: var(--text-muted, #888);
    margin: 0;
}

/* ── Pagination ──────────────────────────────────────────── */
.med-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 0 6px;
}

.med-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: background .14s;
}

.med-page-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--blue, #024B8E);
}

.med-page-btn:active {
    background: var(--blue-light, rgba(2, 75, 142, .08));
}

.med-page-btn--off {
    opacity: .3;
    pointer-events: none;
}

.med-page-btn--off svg {
    stroke: var(--text-muted, #aaa);
}

.med-page-info {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-muted, #888);
}

/* ── mia_sezione.php ──────────────────────────────────────── */
/* ── Page header ─────────────────────────────────────────── */
.ms-page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.ms-page-header-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg, 16px);
    background: linear-gradient(135deg, #024B8E 0%, #C40020 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-page-header-icon svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    color: #fff;
}

.ms-page-title {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary, #111);
    margin: 0 0 2px;
    line-height: 1.2;
}

.ms-page-sub {
    font-size: .82rem;
    color: var(--text-muted, #888);
    margin: 0;
}

/* ── Empty state ─────────────────────────────────────────── */
.ms-empty-state {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    padding: 40px 24px;
    text-align: center;
    margin-bottom: 20px;
}

.ms-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.ms-empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: #aaa;
    color: #aaa;
}

.ms-empty-state h3 {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #111);
    margin: 0 0 10px;
}

.ms-empty-state p {
    font-size: .88rem;
    color: var(--text-muted, #888);
    line-height: 1.6;
    margin: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ms-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity .15s;
}

.ms-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.ms-btn:active {
    opacity: .75;
}

.ms-btn--primary {
    background: var(--blue, #024B8E);
    color: #fff;
}

/* ── movimenti.php ────────────────────────────────────────── */
.tag-orange {
    background: rgba(200, 100, 0, .12);
    color: #b35c00;
}

.tag-blue {
    background: rgba(2, 75, 142, .10);
    color: #024B8E;
}

.mov-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Card ────────────────────────────────────────────────── */
.mov-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ── Riga principale ─────────────────────────────────────── */
.mov-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}

.mov-card-main:active {
    background: var(--surface-2);
}

.mov-card-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mov-card-icon svg {
    width: 18px;
    height: 18px;
}

.mov-card.open .mov-card-icon {
    background: var(--red-light);
    color: var(--red);
}

.mov-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mov-card-ref {
    font-family: var(--font-head);
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mov-card-sub {
    font-size: .76rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mov-card-date {
    font-size: .73rem;
    color: var(--text-muted);
}

.mov-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.mov-card-amount {
    font-family: var(--font-head);
    font-size: .98rem;
    font-weight: 800;
    color: var(--text-primary);
}

.mov-amount--in {
    color: #1a7f4b;
}

/* verde entrate */
.mov-amount--out {
    color: var(--red);
}

/* rosso uscite  */

.mov-card-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    align-items: center;
}

.mov-card-chevron svg {
    width: 17px;
    height: 17px;
}

.mov-card.open .mov-card-chevron {
    transform: rotate(180deg);
}

/* ── Pannello dettaglio — usa class, NON hidden ──────────── */
.mov-card-detail {
    display: none;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    padding: 14px 16px;
    flex-direction: column;
    gap: 10px;
    animation: slideDown .2s ease;
}

.mov-card.open .mov-card-detail {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Griglia KPI ─────────────────────────────────────────── */
.mov-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mov-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mov-kpi--wide {
    grid-column: 1 / -1;
}

.mov-kpi-l {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    font-family: var(--font-head);
}

.mov-kpi-l svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.mov-kpi-v {
    font-family: var(--font-head);
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.mov-kpi-file {
    font-size: .78rem;
    font-weight: 500;
    word-break: break-all;
    color: var(--blue);
}

/* ── Giustificativo download button ──────────────────────── */
.mov-gjust-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding: 9px 14px;
    background: rgba(2, 75, 142, .07);
    border: 1px solid rgba(2, 75, 142, .18);
    border-radius: 10px;
    text-decoration: none;
    color: var(--blue, #024B8E);
    font-size: .82rem;
    font-weight: 600;
    font-family: var(--font-head);
    transition: background .15s, box-shadow .15s;
    max-width: 100%;
    overflow: hidden;
}

.mov-gjust-btn:active {
    background: rgba(2, 75, 142, .14);
}

.mov-gjust-btn>svg:first-child {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.mov-gjust-btn span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mov-gjust-dl {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    opacity: .6;
}

@media (min-width: 600px) {
    .mov-card-main {
        padding: 16px 20px;
    }

    .mov-card-detail {
        padding: 16px 20px;
    }

    .mov-detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── nazionale.php ────────────────────────────────────────── */
/* ── Hero link cards ─────────────────────────────────────── */
.naz-hero-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

@media (max-width: 480px) {
    .naz-hero-links {
        grid-template-columns: 1fr;
    }
}

.naz-hero-card {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 16px;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    transition: transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

.naz-hero-card:active {
    transform: scale(.97);
}

.naz-hero-card--storia {
    background: linear-gradient(135deg, #0a1628 0%, #024B8E 100%) !important;
}

.naz-hero-card--statuto {
    background: linear-gradient(135deg, #1a0005 0%, #C40020 100%) !important;
}

.naz-hero-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.naz-hero-card-icon svg {
    width: 22px;
    height: 22px;
    color: #fff !important;
    stroke: #fff !important;
}

.naz-hero-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.naz-hero-card-label {
    font-size: .68rem;
    color: rgba(255, 255, 255, .65) !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.naz-hero-card-title {
    font-size: .95rem;
    font-weight: 800;
    color: #fff !important;
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.naz-hero-card-sub {
    font-size: .68rem;
    color: rgba(255, 255, 255, .5) !important;
}

.naz-hero-card-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, .45) !important;
    stroke: rgba(255, 255, 255, .45) !important;
}

/* ── Section title ───────────────────────────────────────── */
.naz-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    margin-bottom: 12px;
}

.naz-section-title svg {
    width: 17px;
    height: 17px;
    color: #C40020 !important;
    stroke: #C40020 !important;
    flex-shrink: 0;
}

.naz-section-title span {
    font-family: 'Outfit', sans-serif;
    font-size: .8rem;
    font-weight: 800;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── circolari.php ────────────────────────────────────────── */
/* ── Section header ──────────────────────────────────────── */
.circ-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    margin-bottom: 10px;
}

.circ-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.circ-section-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.circ-section-badge--naz {
    background: rgba(2, 75, 142, .1);
    color: var(--blue);
}

.circ-section-badge--naz svg {
    stroke: var(--blue);
    color: var(--blue);
}

.circ-section-badge--sez {
    background: rgba(196, 0, 32, .1);
    color: var(--red);
}

.circ-section-badge--sez svg {
    stroke: var(--red);
    color: var(--red);
}

.circ-section-count {
    font-family: var(--font-head);
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-2, #f5f5f5);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: 999px;
}

/* ── List ────────────────────────────────────────────────── */
.circ-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.circ-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 14px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}

.circ-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.circ-item--no-dl {
    opacity: .8;
}

.circ-item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(2, 75, 142, .08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circ-item-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--blue);
    color: var(--blue);
}

.circ-item--no-dl .circ-item-icon {
    background: rgba(0, 0, 0, .04);
}

.circ-item--no-dl .circ-item-icon svg {
    stroke: var(--text-muted);
    color: var(--text-muted);
}

.circ-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.circ-item-title {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.circ-item-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .73rem;
    color: var(--text-muted);
}

.circ-item-date svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* ── Download button ─────────────────────────────────────── */
.circ-item-dl {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity .15s;
    box-shadow: 0 2px 8px rgba(2, 75, 142, .3);
}

.circ-item-dl svg {
    width: 17px;
    height: 17px;
    stroke: #fff;
    color: #fff;
}

.circ-item-dl:active {
    opacity: .75;
}

.circ-item-nodl {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-2, #f5f5f5);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circ-item-nodl svg {
    width: 17px;
    height: 17px;
    stroke: var(--text-muted);
    color: var(--text-muted);
}

/* ── Empty state ─────────────────────────────────────────── */
.circ-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.circ-empty svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.circ-empty a {
    color: var(--blue);
}

/* ── Paginazione ─────────────────────────────────────────── */
.circ-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 4px;
}

.circ-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--blue);
    text-decoration: none;
    transition: background .14s, border-color .14s;
    box-shadow: var(--shadow-sm);
}

.circ-page-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--blue);
    color: var(--blue);
}

.circ-page-btn:active {
    background: var(--blue-light);
    border-color: var(--blue);
}

.circ-page-btn--disabled {
    opacity: .35;
    pointer-events: none;
    cursor: default;
}

.circ-page-btn--disabled svg {
    stroke: var(--text-muted);
    color: var(--text-muted);
}

.circ-page-info {
    font-family: var(--font-head);
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 48px;
    text-align: center;
}


/* ── invita.php ─────────────────────────────────────────────── */
.invita-hero {
    display: flex; align-items: center; gap: 16px;
    background: linear-gradient(135deg, var(--blue,#024B8E) 0%, #0360b3 100%);
    border-radius: var(--radius-lg,16px); padding: 22px 20px; margin-bottom: 20px;
    color: #fff;
}
.invita-hero-icon {
    width: 52px; height: 52px; flex-shrink: 0;
    background: rgba(255,255,255,.15); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
}
.invita-hero-icon svg { width: 26px; height: 26px; stroke: #fff; }
.invita-hero-title { font-family: var(--font-head,'Outfit',sans-serif); font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.invita-hero-sub   { font-size: .8rem; opacity: .8; margin-top: 3px; }

/* Override icone card: su invita usa blu, non rosso; padding laterale maggiore */
.invita-card .prof-card-title svg { stroke: var(--blue,#024B8E); }
.invita-card .prof-card-title      { color: var(--blue,#024B8E); padding: 14px 20px 12px; }

.invita-card { margin-bottom: 16px; }

/* Spaziatura interna card: descrizione, form e link-row hanno padding orizzontale e bottom */
.invita-card .invita-desc  { padding: 14px 20px 0; margin: 0 0 14px; }
.invita-card form          { padding: 0 20px 22px; }
.invita-card .invita-link-row { padding: 0 20px 22px; }
.invita-card .invita-preview  { margin: 0 20px 20px; }

.invita-desc {
    font-size: .84rem; color: #6b7280; line-height: 1.55;
}
/* Input row */
.invita-input-row  { display: flex; gap: 10px; align-items: stretch; }
.invita-input-wrap { flex: 1; position: relative; }
.invita-input-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; stroke: #9ca3af; pointer-events: none;
}
.invita-input {
    width: 100%; height: 46px; border: 1.5px solid rgba(2,75,142,.18);
    border-radius: var(--radius-md,12px); padding: 0 14px 0 40px;
    font-size: .9rem; color: #111827;
    background: #fff; outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.invita-input:focus { border-color: var(--blue,#024B8E); box-shadow: 0 0 0 3px rgba(2,75,142,.1); }
.invita-send-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--blue,#024B8E); color: #fff;
    border: none; border-radius: var(--radius-md,12px);
    padding: 0 22px; height: 46px; font-size: .88rem; font-weight: 700;
    cursor: pointer; flex-shrink: 0; transition: opacity .15s, transform .1s;
    font-family: var(--font-head,'Outfit',sans-serif);
}
.invita-send-btn svg   { width: 15px; height: 15px; }
.invita-send-btn:hover { opacity: .88; }
.invita-send-btn:active{ transform: scale(.97); }

/* Link row */
.invita-link-row { display: flex; gap: 10px; align-items: stretch; }
.invita-link-box {
    flex: 1; min-height: 46px; border: 1.5px solid rgba(2,75,142,.18);
    border-radius: var(--radius-md,12px); padding: 11px 14px;
    font-size: .82rem; color: var(--blue,#024B8E); word-break: break-all;
    background: rgba(2,75,142,.03); line-height: 1.5;
}
.invita-link-empty { color: #9ca3af; font-style: italic; font-size: .8rem; }
.invita-copy-btn {
    display: flex; align-items: center; gap: 6px;
    background: #fff; color: var(--blue,#024B8E);
    border: 1.5px solid var(--blue,#024B8E);
    border-radius: var(--radius-md,12px);
    padding: 0 16px; height: 46px; font-size: .85rem; font-weight: 700;
    cursor: pointer; flex-shrink: 0; transition: background .15s, color .15s;
    font-family: var(--font-head,'Outfit',sans-serif);
}
.invita-copy-btn svg      { width: 15px; height: 15px; }
.invita-copy-btn:disabled { opacity: .38; cursor: not-allowed; border-color: #d1d5db; color: #9ca3af; }
.invita-copy-btn.copied   { background: #ecfdf5; color: #059669; border-color: #6ee7b7; }

/* Preview email */
.invita-preview {
    border: 1.5px solid rgba(2,75,142,.15); border-radius: var(--radius-md,12px);
    overflow: hidden; font-size: .84rem;
}
.invita-preview-header {
    background: #f8fafc; border-bottom: 1px solid rgba(2,75,142,.1);
    padding: 12px 16px; display: flex; flex-direction: column; gap: 5px;
}
.invita-preview-field       { font-size: .78rem; color: #6b7280; line-height: 1.4; }
.invita-preview-field strong{ color: #374151; font-weight: 600; }
.invita-preview-body {
    padding: 18px 16px; background: #fff; color: #111827;
}
/* Forza colore testo scuro — isola dal tema app */
.invita-preview-body p {
    margin: 0 0 12px; color: #1f2937 !important;
    line-height: 1.6; font-size: .84rem;
}
.invita-preview-cta {
    display: inline-block; margin: 6px 0 16px;
    background: var(--blue,#024B8E); color: #fff !important;
    border-radius: 8px; padding: 11px 24px;
    font-size: .84rem; font-weight: 700;
    font-family: var(--font-head,'Outfit',sans-serif);
    text-decoration: none;
}
.invita-preview-note {
    font-size: .75rem; color: #6b7280 !important;
    line-height: 1.55; margin-top: 12px;
    padding-top: 12px; border-top: 1px solid #f0f0f0;
}

/* ── index.php — admin bar ──────────────────────────────────── */
.idx-admin-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 24px; padding: 12px 16px;
    background: rgba(2,75,142,.06); border: 1.5px solid rgba(2,75,142,.18);
    border-radius: var(--radius-md,12px);
}
.idx-admin-bar-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .76rem; font-weight: 700; color: var(--blue,#024B8E);
    text-transform: uppercase; letter-spacing: .04em;
    font-family: var(--font-head,'Outfit',sans-serif);
}
.idx-admin-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--blue,#024B8E); color: #fff;
    border-radius: 8px; padding: 8px 16px;
    font-size: .82rem; font-weight: 700; text-decoration: none;
    font-family: var(--font-head,'Outfit',sans-serif);
    transition: opacity .15s;
}
.idx-admin-btn:hover { opacity: .88; }

/* ── sincronizza.php ─────────────────────────────────────────── */
.sinc-hero {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, #1a3a5c 0%, #024B8E 100%);
    border-radius: var(--radius-lg,16px); padding: 20px 18px; margin-bottom: 20px; color: #fff;
}
.sinc-hero-icon {
    width: 48px; height: 48px; flex-shrink: 0;
    background: rgba(255,255,255,.15); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.sinc-hero-icon svg { width: 22px; height: 22px; stroke: #fff; }
.sinc-hero-txt { flex: 1; }
.sinc-hero-title { font-family: var(--font-head,'Outfit',sans-serif); font-size: 1.1rem; font-weight: 700; }
.sinc-hero-sub   { font-size: .78rem; opacity: .8; margin-top: 2px; }
.sinc-hero-badge {
    background: rgba(255,255,255,.2); border-radius: 20px;
    padding: 3px 10px; font-size: .68rem; font-weight: 800;
    letter-spacing: .06em; text-transform: uppercase;
}
/* Card generica */
.sinc-card {
    background: var(--card,#fff); border: 1.5px solid var(--border,#e4e8ed);
    border-radius: var(--radius-lg,16px); padding: 18px 16px; margin-bottom: 16px;
}
.sinc-card-title {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .78rem; font-weight: 800; color: var(--blue,#024B8E);
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px;
}
.sinc-card-title svg { width: 15px; height: 15px; flex-shrink: 0; }
.sinc-total-time {
    margin-left: auto; font-size: .72rem; font-weight: 500;
    color: var(--text-muted,#888); text-transform: none; letter-spacing: 0;
}
/* Risultati */
.sinc-results-card { border-color: rgba(2,75,142,.25); background: rgba(2,75,142,.03); }
.sinc-result-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border,#f0f0f0);
}
.sinc-result-row:last-child { border-bottom: none; }
.sinc-result-icon {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.sinc-result-icon svg { width: 13px; height: 13px; }
.sinc-result-row--ok  .sinc-result-icon { background: #e8f5e9; }
.sinc-result-row--ok  .sinc-result-icon svg { stroke: #2e7d32; }
.sinc-result-row--err .sinc-result-icon { background: #fdecea; }
.sinc-result-row--err .sinc-result-icon svg { stroke: #c62828; }
.sinc-result-info { flex: 1; min-width: 0; }
.sinc-result-label  { display: block; font-size: .84rem; font-weight: 600; color: var(--text,#1a1a1a); }
.sinc-result-detail { display: block; font-size: .74rem; color: var(--text-muted,#888); margin-top: 2px; }
.sinc-result-time   { font-size: .72rem; color: var(--text-muted,#aaa); flex-shrink: 0; }
/* Stato cache */
.sinc-cache-list { display: flex; flex-direction: column; gap: 0; }
.sinc-cache-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--border,#f4f4f4);
}
.sinc-cache-row:last-child { border-bottom: none; }
.sinc-cache-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sinc-cache-dot--ok   { background: #4caf50; }
.sinc-cache-dot--miss { background: #bbb; }
.sinc-cache-info { flex: 1; min-width: 0; }
.sinc-cache-label { display: block; font-size: .84rem; font-weight: 600; color: var(--text,#1a1a1a); }
.sinc-cache-meta  { display: block; font-size: .72rem; color: var(--text-muted,#999); margin-top: 2px; }
.sinc-cache-meta--miss { color: #e57373; }
.sinc-cache-badge {
    border-radius: 6px; padding: 2px 8px;
    font-size: .65rem; font-weight: 800; letter-spacing: .04em; flex-shrink: 0;
}
.sinc-cache-badge--ok   { background: #e8f5e9; color: #2e7d32; }
.sinc-cache-badge--miss { background: #fafafa; color: #999; }
/* Action card */
.sinc-action-card {}
.sinc-desc { font-size: .84rem; color: var(--text-muted,#888); line-height: 1.55; margin: 0 0 14px; }
.sinc-op-list {
    list-style: none; padding: 0; margin: 0 0 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.sinc-op-list li {
    display: flex; align-items: center; gap: 8px;
    font-size: .83rem; color: var(--text,#333);
}
.sinc-op-list li i { width: 14px; height: 14px; flex-shrink: 0; }
.sinc-warn {
    display: flex; align-items: flex-start; gap: 8px;
    background: #fffbea; border: 1px solid #f0d060; border-radius: 10px;
    padding: 12px 14px; margin-bottom: 18px;
    font-size: .78rem; color: #7a5c00; line-height: 1.5;
}
.sinc-warn svg { width: 16px; height: 16px; flex-shrink: 0; stroke: #c09000; margin-top: 1px; }
.sinc-btn {
    width: 100%; height: 50px; border: none; border-radius: var(--radius-md,12px);
    background: var(--blue,#024B8E); color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .95rem; font-weight: 700; cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.sinc-btn svg { width: 18px; height: 18px; }
.sinc-btn:active  { transform: scale(.98); }
.sinc-btn:disabled { opacity: .6; cursor: wait; }
@keyframes sinc-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── assistenza.php ─────────────────────────────────────────── */
/* Hero */
.asst-hero {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, #1a3a5c 0%, #024B8E 100%);
    border-radius: var(--radius-lg,16px);
    padding: 20px 20px; margin-bottom: 20px; color: #fff;
}
.asst-hero-icon {
    width: 46px; height: 46px; flex-shrink: 0;
    background: rgba(255,255,255,.15); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.asst-hero-icon svg { width: 24px; height: 24px; stroke: #fff; }
.asst-hero-title { font-family: var(--font-head,'Outfit',sans-serif); font-size: 1.15rem; font-weight: 700; }
.asst-hero-sub   { font-size: .78rem; opacity: .8; margin-top: 2px; line-height: 1.4; }

/* Card override */
.asst-card .prof-card-title {
    color: var(--blue,#024B8E);
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border,#f0f0f0);
}
.asst-card .prof-card-title svg { stroke: var(--blue,#024B8E); }

/* Form */
.asst-form { padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 0; }
.asst-form-group { margin-bottom: 20px; }
.asst-form-group:last-of-type { margin-bottom: 18px; }
.asst-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .76rem; font-weight: 600; color: var(--text-muted,#888);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px;
}
.asst-label svg { width: 13px; height: 13px; flex-shrink: 0; }
.asst-input,
.asst-textarea {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--border,#e8ecf0);
    border-radius: var(--radius-sm,10px);
    padding: 12px 14px; font-size: .9rem;
    font-family: var(--font-body,'DM Sans',sans-serif);
    color: var(--text,#1a1a2e); background: var(--bg-card,#fff);
    outline: none; transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.asst-input:focus,
.asst-textarea:focus {
    border-color: var(--blue,#024B8E);
    box-shadow: 0 0 0 3px rgba(2,75,142,.1);
}

/* ── Comunicazioni card (nazionale, utilità, iniziative, ecc.) ── */
.com-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.com-card {
    display: flex;
    flex-direction: row;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
    min-height: 140px;
}

.com-card:active {
    transform: scale(0.985);
}

.com-card--noimg {
    border-left: 4px solid var(--red);
}

.com-img-wrap {
    flex: 0 0 120px;
    width: 120px;
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
}

.com-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.com-body {
    flex: 1;
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.com-meta {
    margin: 0;
    font-size: .72rem;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px;
}

.com-meta-city {
    font-family: var(--font-head);
    font-weight: 800;
    color: var(--red);
    letter-spacing: .4px;
    font-size: .72rem;
}

.com-meta-sep {
    color: var(--border-strong);
    font-size: .7rem;
}

.com-meta-date {
    font-style: italic;
    color: var(--text-muted);
    font-size: .72rem;
}

.com-title {
    display: block;
    font-family: var(--font-head);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(2, 75, 142, .25);
    margin: 0;
    letter-spacing: -.1px;
}

.com-title:active {
    color: var(--red);
    text-decoration-color: var(--red);
}

.com-title--plain {
    color: var(--text-primary);
    text-decoration: none;
    cursor: default;
}

.com-subtitle {
    font-size: .78rem;
    font-weight: 600;
    color: var(--blue);
    margin: 0;
    font-family: var(--font-head);
}

.com-text {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

.com-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    color: var(--text-muted);
    margin: 0;
}

.com-location svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.com-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    margin-top: 4px;
    padding: 6px 13px 6px 10px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-head);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .2px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    min-height: 30px;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .12s;
}

.com-cta svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.com-cta:active {
    background: #9a0018;
    transform: scale(0.97);
}

.com-admin-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.com-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--font-head);
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    background: transparent;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .1s;
}

.com-admin-btn svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.com-admin-btn--edit {
    color: var(--blue);
    border-color: var(--blue);
}

.com-admin-btn--edit:active {
    background: rgba(2, 75, 142, .08);
    transform: scale(0.96);
}

.com-admin-btn--delete {
    color: var(--red);
    border-color: var(--red);
}

.com-admin-btn--delete:active {
    background: rgba(196, 0, 32, .08);
    transform: scale(0.96);
}

@media (min-width: 480px) {
    .com-img-wrap {
        flex: 0 0 150px;
        width: 150px;
    }
    .com-body {
        padding: 16px 18px 14px;
        gap: 6px;
    }
    .com-meta,
    .com-meta-city { font-size: .75rem; }
    .com-title     { font-size: .95rem; }
    .com-text      { font-size: .85rem; }
    .com-cta       { font-size: .78rem; padding: 7px 15px 7px 12px; min-height: 32px; }
    .com-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }
    .com-card:hover .com-img-wrap img {
        transform: scale(1.04);
        transition: transform .35s ease;
    }
    .com-card:active { transform: none; }
}

@media (min-width: 700px) {
    .com-img-wrap { flex: 0 0 180px; width: 180px; }
    .com-body     { padding: 18px 22px 16px; }
    .com-title    { font-size: 1rem; }
}
.asst-textarea { resize: vertical; min-height: 120px; }
.asst-input-ro {
    padding: 12px 14px; font-size: .9rem;
    color: var(--text,#444); background: var(--bg,#f5f7fa);
    border: 1.5px solid var(--border,#e8ecf0);
    border-radius: var(--radius-sm,10px);
    font-family: var(--font-body,'DM Sans',sans-serif);
}

/* Priorità toggle */
.asst-priority-row { display: flex; gap: 10px; }
.asst-priority-opt {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 10px; border-radius: var(--radius-sm,10px);
    border: 1.5px solid var(--border,#e8ecf0);
    font-size: .875rem; font-weight: 600; cursor: pointer;
    color: var(--text-muted,#777); background: var(--bg-card,#fff);
    transition: border-color .15s, color .15s, background .15s;
    user-select: none; -webkit-user-select: none;
}
.asst-priority-opt input { display: none; }
.asst-priority-opt svg { width: 16px; height: 16px; flex-shrink: 0; }
.asst-priority-opt.is-active {
    border-color: var(--blue,#024B8E); color: var(--blue,#024B8E);
    background: rgba(2,75,142,.06);
}
.asst-priority-opt--high.is-active {
    border-color: #d97706; color: #d97706;
    background: #fffbeb;
}
.asst-priority-opt--high svg { stroke: currentColor; }

/* Submit */
.asst-submit-btn {
    width: 100%; height: 50px; margin-top: 6px;
    border: none; border-radius: var(--radius-md,12px);
    background: var(--blue,#024B8E); color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .95rem; font-weight: 700; cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.asst-submit-btn svg { width: 17px; height: 17px; }
.asst-submit-btn:active { transform: scale(.98); }

/* Card successo (non loggato) */
.asst-success-card { text-align: center; padding-bottom: 28px !important; }
.asst-success-icon {
    width: 60px; height: 60px; border-radius: 50%;
    background: #dcfce7; margin: 22px auto 14px;
    display: flex; align-items: center; justify-content: center;
}
.asst-success-icon svg { width: 30px; height: 30px; stroke: #16a34a; }
.asst-success-title {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1.2rem; font-weight: 700; color: var(--text,#1a1a2e);
    margin-bottom: 10px;
}
.asst-success-msg {
    font-size: .86rem; color: var(--text-muted,#777);
    line-height: 1.55; margin: 0 20px 14px;
}
.asst-track-id {
    display: inline-block; margin: 0 auto 12px;
    padding: 10px 22px; background: var(--bg,#f5f7fa);
    border: 1.5px dashed var(--blue,#024B8E);
    border-radius: 10px; font-family: monospace;
    font-size: 1.05rem; font-weight: 700; color: var(--blue,#024B8E);
    letter-spacing: .06em; word-break: break-all;
}
.asst-success-note { font-size: .78rem; color: var(--text-muted,#aaa); margin: 0; }

/* Lista ticket */
.asst-empty {
    font-size: .85rem; color: var(--text-muted,#aaa);
    text-align: center; padding: 18px 20px 22px;
    margin: 0;
}
.asst-ticket-list {
    list-style: none; padding: 0; margin: 0;
    border-top: 1px solid var(--border,#f0f0f0);
}
.asst-ticket-item {
    display: flex; align-items: stretch;
    border-bottom: 1px solid var(--border,#f0f0f0);
    min-height: 72px;
}
.asst-ticket-left {
    width: 4px; flex-shrink: 0; border-radius: 0;
}
.asst-ticket-left--asst-badge--s0 { background: #999999; }
.asst-ticket-left--asst-badge--s1 { background: #e79d2f; }
.asst-ticket-left--asst-badge--s2 { background: #4caf50; }
.asst-ticket-left--asst-badge--s3 { background: #25a580; }
.asst-ticket-left--asst-badge--s5 { background: #bc9526; }
.asst-ticket-left--asst-badge--s8 { background: #6b7280; }
.asst-ticket-left--asst-badge--s9 { background: #4b5563; }
.asst-ticket-body {
    flex: 1; padding: 12px 18px 12px 14px;
    display: flex; flex-direction: column; gap: 5px;
}
.asst-ticket-subject {
    font-size: .9rem; font-weight: 600; color: var(--text,#1a1a2e);
    line-height: 1.35;
}
.asst-ticket-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: .76rem; color: var(--text-muted,#999);
}
.asst-ticket-ref  { font-family: monospace; font-weight: 600; }
.asst-ticket-date {}
.asst-ticket-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* Ticket item cliccabile */
.asst-ticket-item { padding: 0; }
.asst-ticket-link {
    display: flex; align-items: stretch; text-decoration: none; color: inherit;
    width: 100%; min-height: 72px;
    transition: background .12s;
}
.asst-ticket-link:active { background: var(--bg,#f5f7fa); }
.asst-ticket-arrow {
    display: flex; align-items: center; padding: 0 14px 0 6px; flex-shrink: 0;
}
.asst-ticket-arrow svg { width: 16px; height: 16px; stroke: var(--text-muted,#bbb); }

/* Badge generico */
.asst-badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 20px;
    font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
/* Badge tipo comunicazione */
.asst-badge--type-tk  { color: #024B8E; background: rgba(2,75,142,.10); }
.asst-badge--type-sug { color: #7c3aed; background: rgba(124,58,237,.10); }
/* Badge per stato — testo colore pieno, sfondo stesso colore al 13% */
.asst-badge--s0 { color: #999999; background: rgba(153,153,153,.13); }
.asst-badge--s1 { color: #c47e14; background: rgba(231,157, 47,.13); }
.asst-badge--s2 { color: #3d9140; background: rgba( 76,175, 80,.13); }
.asst-badge--s3 { color: #1d8a6b; background: rgba( 37,165,128,.13); }
.asst-badge--s5 { color: #9a7a18; background: rgba(188,149, 38,.13); }
.asst-badge--s8 { color: #4b5563; background: rgba(107,114,128,.13); }
.asst-badge--s9 { color: #374151; background: rgba( 75, 85, 99,.13); }
/* Alta priorità */
.asst-badge--high { color: #c2410c; background: rgba(194, 65, 12,.12); }

/* ── ticket_detail.php ──────────────────────────────────────── */
/* Info card */
.tkd-info-card { padding: 0 0 4px !important; }
.tkd-info-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    padding: 16px 20px 10px;
}
.tkd-ref {
    font-family: monospace; font-size: .82rem; font-weight: 700;
    color: var(--text-muted,#888); letter-spacing: .04em;
}
.tkd-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tkd-subject {
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: 1.08rem; font-weight: 700;
    color: var(--text,#1a1a2e); line-height: 1.35;
    padding: 0 20px 14px;
}
.tkd-meta-row {
    display: flex; flex-direction: column; gap: 7px;
    padding: 0 20px 18px;
    border-top: 1px solid var(--border,#f0f0f0);
    padding-top: 12px; margin-top: 2px;
}
.tkd-meta-item {
    display: flex; align-items: center; gap: 7px;
    font-size: .8rem; color: var(--text-muted,#888);
}
.tkd-meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.tkd-meta-item strong { color: var(--text,#333); }

/* Thread */
.tkd-thread-wrap {
    display: flex; flex-direction: column; gap: 14px;
    margin-bottom: 16px;
}
.tkd-msg {
    display: flex; align-items: flex-start; gap: 10px;
}
/* Membro: avatar a destra, bolla a destra */
.tkd-msg--member { flex-direction: row-reverse; }
/* Supporto: avatar a sinistra, bolla a sinistra */
.tkd-msg--support { flex-direction: row; }

.tkd-msg-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.tkd-msg-avatar--member  { background: var(--blue,#024B8E); color: #fff; }
.tkd-msg-avatar--support { background: #e5e7eb; color: #374151; }

.tkd-msg-content {
    display: flex; flex-direction: column; gap: 4px;
    max-width: calc(100% - 50px);
}
.tkd-msg--member .tkd-msg-content  { align-items: flex-end; }
.tkd-msg--support .tkd-msg-content { align-items: flex-start; }

.tkd-msg-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tkd-msg--member .tkd-msg-meta  { flex-direction: row-reverse; }
.tkd-msg-author { font-size: .75rem; font-weight: 700; color: var(--text,#333); }
.tkd-msg-time   { font-size: .72rem; color: var(--text-muted,#aaa); }

.tkd-msg-bubble {
    padding: 11px 14px; border-radius: 16px;
    font-size: .875rem; line-height: 1.55;
    word-break: break-word; max-width: 100%;
}
.tkd-msg-bubble--member {
    background: var(--blue,#024B8E); color: #fff;
    border-bottom-right-radius: 4px;
}
.tkd-msg-bubble--support {
    background: #f3f4f6; color: var(--text,#1a1a2e);
    border-bottom-left-radius: 4px;
}

/* Notifica di sistema */
.tkd-sys-msg {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
    text-align: center; font-size: .72rem; color: var(--text-muted,#aaa);
    padding: 2px 0;
}
.tkd-sys-msg span { line-height: 1.4; }
.tkd-sys-date { font-size: .68rem; opacity: .7; }

.tkd-no-messages {
    text-align: center; font-size: .85rem;
    color: var(--text-muted,#aaa); padding: 8px 0 4px;
}

/* Reply card */
.tkd-reply-card .prof-card-title {
    color: var(--blue,#024B8E); padding: 14px 20px 12px;
}
.tkd-reply-card .prof-card-title svg { stroke: var(--blue,#024B8E); }
.tkd-reply-form { padding: 0 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.tkd-reply-textarea {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--border,#e8ecf0);
    border-radius: var(--radius-sm,10px);
    padding: 11px 14px; font-size: .9rem;
    font-family: var(--font-body,'DM Sans',sans-serif);
    color: var(--text,#1a1a2e); background: var(--bg-card,#fff);
    outline: none; resize: vertical; min-height: 100px;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.tkd-reply-textarea:focus {
    border-color: var(--blue,#024B8E);
    box-shadow: 0 0 0 3px rgba(2,75,142,.1);
}
.tkd-reply-btn {
    align-self: flex-end; height: 44px; padding: 0 24px;
    border: none; border-radius: var(--radius-md,12px);
    background: var(--blue,#024B8E); color: #fff;
    display: flex; align-items: center; gap: 9px;
    font-family: var(--font-head,'Outfit',sans-serif);
    font-size: .9rem; font-weight: 700; cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.tkd-reply-btn svg { width: 16px; height: 16px; }
.tkd-reply-btn:active { transform: scale(.97); }

/* Ticket chiuso */
.tkd-closed-notice {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-md,12px);
    padding: 16px 20px; margin-bottom: 20px;
    font-size: .85rem; color: #15803d; text-align: center; line-height: 1.5;
}
.tkd-closed-notice svg { width: 18px; height: 18px; stroke: #16a34a; flex-shrink: 0; }
.tkd-closed-notice a { color: var(--blue,#024B8E); font-weight: 600; }
/* Suggerimento ricevuto (viola) */
.tkd-sug-notice {
    background: rgba(124,58,237,.06); border-color: rgba(124,58,237,.22);
    color: #5b21b6;
}

/* ============================================================
   PULSANTI CREA COMUNICAZIONE (iniziative / notizie / newsletter / utilita)
   ============================================================ */
.com-create-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.com-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--blue, #024B8E);
    color: #fff;
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .2px;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .1s;
}

.com-create-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.com-create-btn:active {
    background: #013870;
    transform: scale(0.97);
}

/* ============================================================
   BARRA ADMIN MEDICO (modifica / elimina)
   ============================================================ */
.mdc-admin-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.mdc-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: var(--radius-sm, 8px);
    font-size: .8rem;
    font-weight: 700;
    font-family: var(--font-head, 'Outfit', sans-serif);
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    background: transparent;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .1s;
}

.mdc-admin-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.mdc-admin-btn--edit {
    color: var(--blue, #024B8E);
    border-color: var(--blue, #024B8E);
}

.mdc-admin-btn--edit:active {
    background: rgba(2, 75, 142, .08);
    transform: scale(0.97);
}

.mdc-admin-btn--delete {
    color: var(--red, #C40020);
    border-color: var(--red, #C40020);
}

.mdc-admin-btn--delete:active {
    background: rgba(196, 0, 32, .08);
    transform: scale(0.97);
}

/* ============================================================
   BOTTONE NUOVO MEDICO (nella testata di medici.php)
   ============================================================ */
.med-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 7px 14px;
    background: var(--blue, #024B8E);
    color: #fff;
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .1s;
}

.med-new-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.med-new-btn:active {
    background: #013870;
    transform: scale(0.97);
}
.tkd-sug-notice svg { stroke: #7c3aed; }

/* ============================================================
   COMPONENTI — CSS estratti dagli include/pagine PHP
   ============================================================ */

/* ── filter_select.php ──────────────────────────────────── */
.fsel-wrap { position: relative; }
.fsel-btn {
    width: 100%; display: flex; align-items: center; gap: 6px;
    height: 42px; padding: 0 12px;
    background: var(--surface,#fff);
    border: 1.5px solid var(--border,#e0e0e0);
    border-radius: var(--radius-md,12px);
    cursor: pointer; text-align: left;
    font-family: var(--font-body,'DM Sans',sans-serif);
    font-size: .85rem; color: var(--text-muted,#888);
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.fsel-btn--on {
    border-color: var(--blue,#024B8E);
    color: var(--text-primary,#111);
    background: rgba(2,75,142,.04);
}
.fsel-lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsel-arr {
    flex-shrink: 0; width: 16px; height: 16px;
    stroke: var(--text-muted,#aaa); transition: transform .15s;
}
.fsel-wrap.fsel--open .fsel-arr { transform: rotate(180deg); }
.fsel-x {
    flex-shrink: 0; width: 18px; height: 18px;
    background: var(--blue,#024B8E); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.fsel-x svg { width: 9px; height: 9px; }
.fsel-pop {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 300;
    background: var(--surface,#fff);
    border: 1.5px solid var(--border,#e0e0e0);
    border-radius: var(--radius-md,12px);
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
    overflow: hidden; max-height: 272px;
    display: flex; flex-direction: column;
}
.fsel-pop[hidden] { display: none !important; }
.fsel-si { padding: 8px 10px; border-bottom: 1px solid var(--border,#e0e0e0); flex-shrink: 0; }
.fsel-si-inp {
    width: 100%; padding: 7px 10px;
    border: 1px solid var(--border,#e0e0e0); border-radius: 8px;
    font-size: .83rem; font-family: inherit;
    background: var(--surface-2,#f9f9f9); color: var(--text-primary,#111);
    outline: none; box-sizing: border-box;
}
.fsel-si-inp:focus { border-color: var(--blue,#024B8E); }
.fsel-ul { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.fsel-li {
    padding: 10px 14px; font-size: .84rem;
    color: var(--text-primary,#111); cursor: pointer;
    border-bottom: 1px solid var(--border,#e0e0e0); line-height: 1.3;
}
.fsel-li:last-child { border-bottom: none; }
.fsel-li:active { background: rgba(2,75,142,.06); }
.fsel-li--on { color: var(--blue,#024B8E); font-weight: 600; background: rgba(2,75,142,.05); }
.fsel-li--reset { color: var(--text-muted,#888); font-size: .81rem; }

/* ── pagination.php ─────────────────────────────────────── */
.pag-wrap {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px; padding: 18px 0 8px;
}
.pag-info { font-size: .75rem; color: var(--text-muted); margin: 0; }
.pag-info span { color: var(--text-secondary); font-weight: 500; }
.pag-nav { display: flex; align-items: center; gap: 4px; }
.pag-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-primary); text-decoration: none;
    flex-shrink: 0; -webkit-tap-highlight-color: transparent;
    transition: background .12s, border-color .12s;
}
.pag-btn svg { width: 16px; height: 16px; }
.pag-btn:active { background: var(--blue-light); border-color: var(--blue); }
.pag-btn--off { opacity: .35; pointer-events: none; }
.pag-nums { display: flex; align-items: center; gap: 4px; }
.pag-num {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 6px;
    border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--border);
    font-family: var(--font-head); font-size: .82rem; font-weight: 600;
    color: var(--text-secondary); text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, border-color .12s, color .12s;
}
.pag-num:active { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.pag-num--active {
    background: var(--red); border-color: var(--red);
    color: #fff; font-weight: 700; pointer-events: none;
}
.pag-ellipsis {
    min-width: 24px; text-align: center;
    color: var(--text-muted); font-size: .82rem; user-select: none;
}

/* ── sezione_select.php ─────────────────────────────────── */
.sdrop { position: relative; margin-bottom: 20px; }
.sdrop-trigger {
    display: flex; align-items: center;
    background: var(--surface,#fff); border: 1px solid var(--border,#e0e0e0);
    border-radius: 12px; cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: border-color .15s; overflow: hidden;
}
.sdrop-trigger:hover,
.sdrop--open .sdrop-trigger {
    border-color: #024B8E;
    box-shadow: 0 0 0 3px rgba(2,75,142,.1);
}
.sdrop-icon-left {
    flex-shrink: 0; width: 16px; height: 16px;
    margin: 0 0 0 14px; stroke: #888; color: #888; pointer-events: none;
}
.sdrop-input {
    flex: 1; padding: 13px 8px 13px 10px;
    border: none; background: transparent;
    color: var(--text-primary,#111);
    font-size: .9rem; font-family: var(--font-body,'DM Sans',sans-serif);
    cursor: pointer; outline: none; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sdrop-input::placeholder { color: #aaa; }
.sdrop-chevron {
    flex-shrink: 0; width: 16px; height: 16px; margin: 0 12px;
    stroke: #888; color: #888; transition: transform .2s ease; pointer-events: none;
}
.sdrop--open .sdrop-chevron { transform: rotate(180deg); }
.sdrop-panel {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--surface,#fff); border: 1px solid var(--border,#e0e0e0);
    border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.14);
    z-index: 200; overflow: hidden; max-height: 320px; flex-direction: column;
}
.sdrop--open .sdrop-panel { display: flex; }
.sdrop-search-wrap {
    display: flex; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--border,#eee); flex-shrink: 0;
}
.sdrop-search-icon { flex-shrink: 0; width: 15px; height: 15px; stroke: #aaa; color: #aaa; margin-right: 8px; }
.sdrop-search-input {
    flex: 1; border: none; background: transparent;
    font-size: .88rem; font-family: var(--font-body,'DM Sans',sans-serif);
    color: var(--text-primary,#111); outline: none; padding: 0;
}
.sdrop-search-input::placeholder { color: #bbb; }
.sdrop-list { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sdrop-option {
    padding: 11px 16px; font-size: .86rem;
    color: var(--text-primary,#111); cursor: pointer; transition: background .1s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-bottom: 1px solid rgba(0,0,0,.04);
}
.sdrop-option:last-child { border-bottom: none; }
.sdrop-option:hover { background: rgba(2,75,142,.06); }
.sdrop-option--active { background: rgba(2,75,142,.09); color: #024B8E; font-weight: 600; }
.sdrop-empty,
.sdrop-no-results { padding: 12px 16px; font-size: .82rem; color: #aaa; text-align: center; }

/* ── sezione_card.php ───────────────────────────────────── */
.sz-card {
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-md);
    overflow: hidden; margin-bottom: 20px;
}
.sz-header {
    background: linear-gradient(135deg, #111 0%, var(--red) 100%);
    padding: 16px 18px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; min-height: 60px;
}
.sz-header-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.sz-header-name {
    font-family: var(--font-head); font-size: 1rem; font-weight: 800;
    color: #fff; letter-spacing: .3px; line-height: 1.25;
}
.sz-header-region { font-size: .72rem; color: rgba(255,255,255,.7); font-style: italic; }
.sz-header-photo {
    flex-shrink: 0; width: 54px; height: 54px;
    border-radius: var(--radius-md); overflow: hidden;
    border: 2px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.1);
}
.sz-header-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sz-body { padding: 0; }
.sz-body-inner { display: flex; gap: 0; }
.sz-fields { flex: 1; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.sz-side-photo { display: none; flex-shrink: 0; width: 160px; overflow: hidden; background: var(--surface-2); }
.sz-side-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sz-row {
    display: grid; grid-template-columns: 110px 1fr; gap: 8px;
    padding: 7px 0; border-bottom: 1px solid var(--border); align-items: baseline;
}
.sz-row:last-child { border-bottom: none; }
.sz-row--wide { grid-template-columns: 1fr; gap: 4px; }
.sz-label {
    font-family: var(--font-head); font-size: .72rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px;
    white-space: nowrap; padding-top: 2px;
}
.sz-val { font-size: .85rem; color: var(--text-primary); line-height: 1.55; word-break: break-word; }
.sz-val--pre { white-space: pre-line; }
.sz-contact-line { display: block; line-height: 1.6; }
.sz-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--blue); text-decoration: none; font-size: .82rem; word-break: break-all;
}
.sz-link svg { width: 11px; height: 11px; flex-shrink: 0; }
.sz-link:active { color: var(--red); }
.sz-divider { height: 1px; background: var(--border); margin: 6px 0; }
@media (min-width: 600px) {
    .sz-side-photo { display: block; }
    .sz-header-photo { display: none; }
    .sz-row { grid-template-columns: 130px 1fr; }
    .sz-fields { padding: 16px 20px 20px; }
    .sz-header-name { font-size: 1.1rem; }
}

/* ── comunicazione_detail.php ───────────────────────────── */
.cd-wrap {
    background: var(--surface); border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    overflow: hidden; margin-bottom: 24px;
}
.cd-hero { position: relative; width: 100%; height: 210px; overflow: hidden; background: var(--surface-2); }
.cd-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-body { padding: 18px 16px 22px; display: flex; flex-direction: column; gap: 13px; }
.cd-eyebrow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin: 0; }
.cd-eyebrow-sec { font-family: var(--font-head); font-size: .75rem; font-weight: 800; color: var(--red); letter-spacing: .4px; }
.cd-eyebrow-sep { color: var(--border-strong); font-size: .73rem; }
.cd-eyebrow-date { font-size: .75rem; font-style: italic; color: var(--text-muted); }
.cd-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    font-family: var(--font-head); font-size: .72rem; font-weight: 700; letter-spacing: .3px;
}
.cd-badge svg { width: 11px; height: 11px; flex-shrink: 0; }
.cd-badge--nazionale { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(2,75,142,.18); }
.cd-badge--regionale { background: var(--red-light); color: var(--red); border: 1px solid rgba(196,0,32,.15); }
.cd-badge--region { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.cd-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; color: var(--text-primary); line-height: 1.3; margin: 0; letter-spacing: -.15px; }
.cd-text { font-size: .875rem; color: var(--text-secondary); line-height: 1.72; margin: 0; }
.cd-docs { display: flex; flex-direction: column; gap: 8px; }
.cd-doc-primary {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; background: var(--blue); border-radius: var(--radius-md);
    text-decoration: none; min-height: 56px;
    -webkit-tap-highlight-color: transparent; transition: background .15s, transform .12s;
}
.cd-doc-primary:active { background: var(--red); transform: scale(0.98); }
.cd-doc-p-icon {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; color: #fff;
}
.cd-doc-p-icon svg { width: 18px; height: 18px; }
.cd-doc-p-label { flex: 1; font-family: var(--font-head); font-size: .9rem; font-weight: 700; color: #fff; }
.cd-doc-p-file { font-size: .68rem; color: rgba(255,255,255,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; text-align: right; }
.cd-doc-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-md); text-decoration: none; min-height: 50px;
    -webkit-tap-highlight-color: transparent; transition: var(--transition);
}
.cd-doc-row:active { background: var(--blue-light); border-color: var(--blue); }
.cd-doc-r-icon {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-sm);
    background: var(--red-light); color: var(--red);
    display: flex; align-items: center; justify-content: center;
}
.cd-doc-r-icon svg { width: 15px; height: 15px; }
.cd-doc-r-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-doc-r-label { font-family: var(--font-head); font-size: .82rem; font-weight: 700; color: var(--text-primary); }
.cd-doc-r-name { font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-doc-r-ext { flex-shrink: 0; font-size: .65rem; font-weight: 700; font-family: var(--font-head); color: var(--red); letter-spacing: .3px; }
.cd-doc-r-arr { flex-shrink: 0; color: var(--text-muted); }
.cd-doc-r-arr svg { width: 15px; height: 15px; }
.cd-section { display: flex; flex-direction: column; gap: 8px; }
.cd-section-label {
    display: flex; align-items: center; gap: 5px;
    font-family: var(--font-head); font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted);
    margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.cd-section-label svg { width: 11px; height: 11px; }
.cd-articles { display: flex; flex-direction: column; gap: 6px; }
.cd-article-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-md); text-decoration: none; min-height: 48px;
    -webkit-tap-highlight-color: transparent; transition: background .13s, border-color .13s;
}
.cd-article-item:not(.cd-article-item--plain):active { background: var(--blue-light); border-color: rgba(2,75,142,.25); }
.cd-article-item--plain { cursor: default; }
.cd-art-icon {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
    background: rgba(2,75,142,.08); display: flex; align-items: center; justify-content: center;
}
.cd-art-icon svg { width: 15px; height: 15px; stroke: var(--blue); color: var(--blue); }
.cd-article-item--plain .cd-art-icon { background: var(--surface-2); }
.cd-article-item--plain .cd-art-icon svg { stroke: var(--text-muted); color: var(--text-muted); }
.cd-art-label { flex: 1; font-size: .86rem; font-weight: 600; color: var(--blue); line-height: 1.35; min-width: 0; word-break: break-word; }
.cd-article-item--plain .cd-art-label { color: var(--text-secondary); font-weight: 500; }
.cd-art-arrow { flex-shrink: 0; width: 14px; height: 14px; stroke: var(--text-muted); color: var(--text-muted); opacity: .6; }
.cd-cta-ext {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 20px; background: transparent; border: 2px solid var(--blue); color: var(--blue);
    font-family: var(--font-head); font-size: .88rem; font-weight: 700;
    border-radius: var(--radius-md); text-decoration: none; min-height: 46px;
    letter-spacing: .15px; -webkit-tap-highlight-color: transparent; transition: var(--transition); margin-top: 2px;
}
.cd-cta-ext svg { width: 15px; height: 15px; }
.cd-cta-ext:active { background: var(--blue); color: #fff; }
@media (min-width: 520px) {
    .cd-hero { height: 270px; }
    .cd-body { padding: 22px 22px 26px; gap: 15px; }
    .cd-title { font-size: 1.28rem; }
    .cd-text { font-size: .9rem; }
    .cd-doc-p-file { max-width: 200px; }
}

/* ── comunicazione.php (admin bar dettaglio) ────────────── */
.com-detail-admin { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.com-detail-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 16px; border-radius: var(--radius-sm);
    font-size: .8rem; font-weight: 700; font-family: var(--font-head);
    text-decoration: none; border: 1.5px solid transparent;
    cursor: pointer; background: transparent;
    -webkit-tap-highlight-color: transparent; transition: background .15s, transform .1s;
}
.com-detail-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.com-detail-btn--edit { color: var(--blue); border-color: var(--blue); }
.com-detail-btn--edit:active { background: rgba(2,75,142,.08); transform: scale(0.97); }
.com-detail-btn--delete { color: var(--red); border-color: var(--red); }
.com-detail-btn--delete:active { background: rgba(196,0,32,.08); transform: scale(0.97); }

/* ── comunica.php — gruppi WhatsApp ─────────────────────── */
.wa-group-row {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; border-bottom: 1px solid var(--border,#e0e0e0);
    text-decoration: none; color: inherit; transition: background .13s;
    -webkit-tap-highlight-color: transparent;
}
.wa-group-row:last-child { border-bottom: none; }
.wa-group-row:active { background: rgba(37,211,102,.06); }
.wa-group-icon {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    background: #25D366; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(37,211,102,.3);
}
.wa-group-icon svg { width: 20px; height: 20px; stroke: white; }
.wa-group-info { flex: 1; min-width: 0; }
.wa-group-lbl { display: block; font-size: .88rem; font-weight: 700; color: var(--text-primary,#111); margin-bottom: 2px; }
.wa-group-sub { font-size: .72rem; color: var(--text-muted,#999); }
.wa-group-arrow { flex-shrink: 0; }
.wa-group-arrow svg { width: 16px; height: 16px; stroke: var(--text-muted,#bbb); }
.wa-no-groups { padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.wa-no-groups svg { width: 36px; height: 36px; stroke: #ccc; }
.wa-no-groups p { font-size: .84rem; color: var(--text-muted,#999); max-width: 260px; line-height: 1.5; }
.cmu-contact-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--blue,#024B8E); text-decoration: none; font-size: .85rem; font-weight: 500; word-break: break-all;
}
.cmu-contact-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.cmu-contact-link:active { opacity: .75; }
.cmu-contact-link--fb { color: #1877F2; }
/* Hero WhatsApp (icona verde) */
.asst-hero-icon--wa { background: rgba(37,211,102,.12); }
/* Card title WhatsApp */
.prof-card-title--wa { color: #128C7E; }

/* ── gestione_comunicazione.php ─────────────────────────── */
.gc-page-hdr {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-head); font-size: 1.05rem; font-weight: 800;
    color: var(--text-primary); margin-bottom: 18px;
}
.gc-page-hdr svg { width: 20px; height: 20px; color: var(--blue); flex-shrink: 0; }
.gc-table {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 0;
}
.gc-row {
    display: flex; align-items: flex-start;
    border-bottom: 1px solid var(--border); min-height: 52px;
}
.gc-row:last-child { border-bottom: none; }
.gc-row--tall .gc-val { padding-top: 10px; padding-bottom: 10px; }
.gc-lbl {
    flex: 0 0 140px; width: 140px; padding: 14px 14px 14px 16px;
    font-family: var(--font-head); font-size: .78rem; font-weight: 700;
    color: var(--text-secondary); letter-spacing: .2px; line-height: 1.3;
    border-right: 1px solid var(--border);
    display: flex; align-items: flex-start; padding-top: 16px;
}
.gc-lbl--req::after { content: ' *'; color: var(--red); }
.gc-lbl--red { color: var(--red); }
.gc-val {
    flex: 1; padding: 8px 14px;
    display: flex; flex-direction: column; gap: 6px;
    min-width: 0; justify-content: center;
}
.gc-val--row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
.gc-input {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .88rem; color: var(--text-primary); background: var(--surface);
    font-family: var(--font-body); transition: border-color .15s; outline: none; box-sizing: border-box;
}
.gc-input:focus { border-color: var(--blue); }
.gc-input--date { flex: 1; min-width: 130px; }
.gc-select {
    width: 100%; padding: 9px 32px 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .88rem; color: var(--text-primary); background: var(--surface);
    font-family: var(--font-body); appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    cursor: pointer; outline: none; transition: border-color .15s; box-sizing: border-box;
}
.gc-select:focus { border-color: var(--blue); }
.gc-select--sm { flex: 0 0 72px; width: 72px; padding-right: 28px; }
.gc-select--multi { appearance: auto; background-image: none; padding: 6px 8px; height: auto; min-height: 120px; }
.gc-btn-adesso {
    padding: 8px 14px; border: 1.5px solid var(--blue); border-radius: var(--radius-sm);
    background: transparent; color: var(--blue);
    font-family: var(--font-head); font-size: .78rem; font-weight: 700;
    cursor: pointer; white-space: nowrap; transition: background .15s;
}
.gc-btn-adesso:active { background: rgba(2,75,142,.08); }
.gc-quill-editor {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    min-height: 200px; font-family: var(--font-body); font-size: .88rem;
}
.ql-toolbar.ql-snow {
    border: none; border-bottom: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2);
}
.ql-container.ql-snow { border: none !important; font-size: .88rem; }
.ql-editor { min-height: 160px; padding: 12px; }
.gc-static { font-size: .9rem; font-weight: 600; color: var(--text-primary); padding: 6px 0; }
.gc-file-input { font-size: .82rem; color: var(--text-secondary); cursor: pointer; padding: 4px 0; }
.gc-file-curr { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--text-muted); margin: 0; }
.gc-file-curr svg { width: 12px; height: 12px; flex-shrink: 0; }
.gc-hint { font-size: .72rem; color: var(--text-muted); margin: 0; }
.gc-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text-secondary);
    font-family: var(--font-head); font-size: .78rem; font-weight: 700; letter-spacing: .5px;
    cursor: pointer; text-transform: uppercase; transition: border-color .15s, background .15s; align-self: flex-start;
}
.gc-add-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.gc-add-btn:active { border-color: var(--blue); background: rgba(2,75,142,.05); }
.gc-file-hidden { display: none; }
.gc-allegati-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.gc-allegati-list li { font-size: .78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.gc-allegati-list li::before { content: '📎'; }
.gc-articoli-wrap { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.gc-art-row { display: flex; gap: 6px; align-items: center; }
.gc-art-titolo { flex: 1; }
.gc-art-url    { flex: 1.4; }
.gc-art-del {
    flex-shrink: 0; width: 28px; height: 28px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: transparent; color: var(--red);
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.gc-art-del svg { width: 13px; height: 13px; }
.gc-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.gc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 24px; border-radius: var(--radius-md);
    font-family: var(--font-head); font-size: .88rem; font-weight: 700; letter-spacing: .4px;
    cursor: pointer; text-decoration: none; border: none; min-height: 44px; transition: background .15s, transform .1s;
}
.gc-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.gc-btn--primary { background: var(--blue,#024B8E); color: #fff; flex: 1; }
.gc-btn--primary:active { background: #013870; transform: scale(0.98); }
.gc-btn--ghost { background: var(--surface); color: var(--text-secondary); border: 1.5px solid var(--border); flex: 1; }
.gc-btn--ghost:active { border-color: var(--border-strong); }
.gc-btn-delete {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; padding: 12px 20px; margin-top: 10px;
    border-radius: var(--radius-md); font-family: var(--font-head);
    font-size: .85rem; font-weight: 700; cursor: pointer;
    background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; transition: background .15s;
}
.gc-btn-delete:active { background: #dc2626; color: white; border-color: #dc2626; }
.gc-btn-delete svg { width: 15px; height: 15px; }
@media (max-width: 480px) {
    .gc-lbl { flex: 0 0 110px; width: 110px; font-size: .72rem; padding: 12px 10px 12px 12px; }
    .gc-val  { padding: 8px 10px; }
    .gc-art-row { flex-wrap: wrap; }
    .gc-art-url  { flex: 1 0 100%; }
}

/* ── gestione_medico.php ────────────────────────────────── */
.gm-form { display: flex; flex-direction: column; gap: 16px; padding: 20px; margin-bottom: 16px; }
.gm-section-title {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-head); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
    border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.gm-section-title svg { width: 13px; height: 13px; flex-shrink: 0; }
.gm-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gm-field { display: flex; flex-direction: column; gap: 5px; }
.gm-label { font-family: var(--font-head); font-size: .76rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .35px; }
.gm-req { color: var(--red); }
.gm-static { font-size: .92rem; font-weight: 600; color: var(--text-primary); padding: 10px 0; }
.gm-input {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--border); border-radius: var(--radius-md);
    font-size: .88rem; color: var(--text-primary); background: var(--surface);
    font-family: var(--font-body); transition: border-color .15s; outline: none;
}
.gm-input:focus { border-color: var(--blue); }
.gm-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer;
}
.gm-textarea { min-height: 80px; resize: vertical; }
.gm-hint { font-size: .75rem; color: var(--text-muted); margin: 0; display: flex; align-items: center; gap: 4px; }
.gm-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-radio-opt {
    display: flex; align-items: center; gap: 6px; padding: 7px 13px;
    border: 1.5px solid var(--border); border-radius: 20px;
    font-size: .82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer;
    transition: border-color .15s, background .15s;
}
.gm-radio-opt input[type="radio"] { display: none; }
.gm-radio-opt--sel { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.gm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gm-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 12px 20px;
    border-radius: var(--radius-md); font-family: var(--font-head);
    font-size: .88rem; font-weight: 700; cursor: pointer;
    text-decoration: none; border: none; transition: var(--transition); min-height: 44px;
}
.gm-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.gm-btn--primary { background: var(--blue); color: white; flex: 1; justify-content: center; }
.gm-btn--primary:hover { background: #013f7a; }
.gm-btn--ghost { background: var(--surface-2); color: var(--text-secondary); border: 1.5px solid var(--border); }
.gm-btn--ghost:hover { border-color: var(--border-strong); }
.gm-btn--danger {
    display: flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 20px;
    border-radius: var(--radius-md); font-family: var(--font-head);
    font-size: .85rem; font-weight: 700; cursor: pointer;
    background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; transition: var(--transition);
}
.gm-btn--danger:hover { background: #dc2626; color: white; border-color: #dc2626; }
.gm-btn--danger svg { width: 16px; height: 16px; }
.gm-orari-grid { display: flex; flex-direction: column; gap: 6px; }
.gm-orari-hdr {
    display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px;
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted); padding: 0 0 4px; border-bottom: 1px solid var(--border);
}
.gm-orari-row { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px; align-items: center; }
.gm-giorno { font-size: .8rem; font-weight: 600; color: var(--text-secondary); }
.gm-orari-inp { padding: 8px 10px; font-size: .82rem; }
.gm-section-title--gap { margin-top: 8px; }
.gm-actions--gap { margin-top: 8px; }
.gm-hint--push { margin-left: auto; font-weight: 400; }
.gm-btn--full { width: 100%; }
.gm-del-form { margin-top: 12px; }
@media (max-width: 480px) {
    .gm-row-2 { grid-template-columns: 1fr; }
    .gm-orari-hdr, .gm-orari-row { grid-template-columns: 70px 1fr 1fr; gap: 5px; }
    .gm-giorno { font-size: .72rem; }
}

/* ── appuntamenti.php — link medico ─────────────────────── */
.appt-medico-link {
    color: var(--blue,#024B8E); text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px; font-size: .81rem;
}
.appt-medico-link svg { width: 11px; height: 11px; }
.appt-medico-link:active { opacity: .75; }

/* ── medico_detail.php — codice ordine ──────────────────── */
.mdc-codice-ordine { font-family: 'Courier New', monospace; letter-spacing: .4px; }

/* ══════════════════════════════════════════════════════════════
   2FA — Verifica in due passaggi
   Usato da: 2fa_verify.php, 2fa_setup.php, profilo.php
   ══════════════════════════════════════════════════════════════ */

/* ── 6 digit inputs ────────────────────────────────────────── */
.tfa-digits-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 12px 0 6px;
}
.tfa-digit {
    width: 42px;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-head);
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    caret-color: transparent;
}
.tfa-digit:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(2,75,142,.1);
}
.tfa-digit-sep {
    width: 12px;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Help text sotto i digit ───────────────────────────────── */
.tfa-help {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 8px 0 16px;
}
.tfa-help svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--blue); }

/* ── Setup container — header compatto ─────────────────────── */
.tfa-setup-container { max-width: 420px !important; }
.tfa-setup-container .login-header { margin-bottom: 12px; }
.tfa-setup-container .login-logo   { height: 52px; width: auto; }
.tfa-setup-container h2            { font-size: 1.25rem !important; margin: 6px 0 0 !important; }

/* ── Card info (prompt / stato) ────────────────────────────── */
.tfa-card {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.tfa-card--active { border-color: #22c55e; background: #f0fdf4; }
.tfa-card--warn   { border-color: #f59e0b; background: #fffbeb; }

.tfa-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tfa-card-icon svg { width: 26px; height: 26px; }
.tfa-card-icon--shield { background: rgba(2,75,142,.1); color: var(--blue); }
.tfa-card-icon--ok     { background: #dcfce7; color: #16a34a; }
.tfa-card-icon--warn   { background: #fef3c7; color: #d97706; }

.tfa-card-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.tfa-card-body {
    font-size: .86rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.tfa-date {
    font-size: .75rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── App badges ────────────────────────────────────────────── */
.tfa-badge-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.tfa-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.tfa-badge svg { width: 12px; height: 12px; }

/* ── Actions / skip ────────────────────────────────────────── */
.tfa-actions { margin-bottom: 6px; }
.tfa-skip-form { text-align: center; margin-top: 2px; }
/* Riduce gap verticale del form nella setup page */
.tfa-setup-container .login-form { gap: 6px; }
.tfa-setup-container .login-footer { margin-top: 8px; }
.tfa-btn-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .84rem;
    cursor: pointer;
    padding: 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: var(--font-body);
}
.tfa-btn-skip:hover { color: var(--text-secondary); }

.tfa-btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    font-family: var(--font-head);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
    min-height: 48px;
}
.tfa-btn-danger svg { width: 16px; height: 16px; }
.tfa-btn-danger:hover { background: #dc2626; color: white; border-color: #dc2626; }

/* ── QR code ────────────────────────────────────────────────── */
.tfa-qr-wrap { width: 100%; margin-bottom: 6px; }
.tfa-qr-intro {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 8px;
    text-align: center;
}
.tfa-qr-intro--step3 {
    margin-top: 10px;
    margin-bottom: 0;
}

/* QR + chiave manuale affiancati */
.tfa-qr-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 6px 0 2px;
}
.tfa-qr-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
}
.tfa-qr-img {
    display: block;
    border-radius: 4px;
}
.tfa-qr-fallback {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: .78rem;
    text-align: center;
    width: 140px;
    height: 140px;
    justify-content: center;
}
.tfa-qr-fallback svg { width: 26px; height: 26px; color: #f59e0b; }

.tfa-manual-key-wrap {
    flex: 1;
    min-width: 0;
    text-align: left;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tfa-manual-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 700;
    margin: 0;
}
.tfa-manual-key {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--blue);
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    cursor: pointer;
    user-select: all;
    word-break: break-all;
    line-height: 1.6;
}
.tfa-copy-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 5px 12px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: border-color .15s;
    align-self: flex-start;
}
.tfa-copy-btn svg { width: 11px; height: 11px; }
.tfa-copy-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ── Profilo — Banner "Completa il tuo Profilo" ─────────────── */
.profilo-banner-completa {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: #fffbeb;
    border: 1.5px solid #fbbf24;
    border-radius: var(--radius-lg, 16px);
    text-decoration: none;
    margin-bottom: 16px;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}

.profilo-banner-completa:active {
    background: #fef3c7;
}

.profilo-banner-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fef3c7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profilo-banner-icon svg {
    width: 17px;
    height: 17px;
    stroke: #d97706;
}

.profilo-banner-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profilo-banner-title {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .88rem;
    font-weight: 800;
    color: #92400e;
    line-height: 1.2;
}

.profilo-banner-sub {
    font-size: .76rem;
    color: #b45309;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profilo-banner-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    stroke: #d97706;
}

/* ── Profilo — Firma pads ───────────────────────────────────── */
.prof-firma-card { margin-top: 20px; }

.firma-pad { padding: 14px 16px 16px; }

.firma-divider {
    height: 1px;
    background: var(--border, #e0e0e0);
    margin: 0 16px;
}

.firma-pad-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.firma-pad-label {
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .78rem;
    font-weight: 800;
    color: var(--text-secondary, #444);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.firma-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.firma-badge--ok {
    background: #dcfce7;
    color: #16a34a;
}

.firma-badge--miss {
    background: #fee2e2;
    color: #dc2626;
}

.firma-canvas {
    display: block;
    width: 100%;
    height: 140px;
    border: 1.5px dashed var(--border, #ddd);
    border-radius: var(--radius-md, 12px);
    background: #fafafa;
    cursor: crosshair;
    touch-action: none;
    box-sizing: border-box;
}

.firma-canvas:focus { outline: none; }

.firma-pad-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.firma-btn-clear,
.firma-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-head, 'Outfit', sans-serif);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}

.firma-btn-clear {
    background: transparent;
    border-color: var(--border, #ddd);
    color: var(--text-muted, #888);
}

.firma-btn-clear:active {
    background: var(--surface-2, #f5f5f5);
}

.firma-btn-save {
    background: var(--blue, #024B8E);
    border-color: var(--blue, #024B8E);
    color: #fff;
    flex: 1;
    justify-content: center;
}

.firma-btn-save:active {
    opacity: .88;
}

/* ── Firma — testo dichiarazione privacy ────────────────────── */
.firma-privacy-text {
    padding: 14px 16px 10px;
    font-size: .82rem;
    line-height: 1.55;
    color: var(--text-secondary, #555);
}
.firma-privacy-text p { margin: 0 0 8px; }
.firma-privacy-text p:last-child { margin-bottom: 0; }

/* ── Profilo — card 2FA ─────────────────────────────────────── */
.prof-2fa-card { margin-top: 20px; }

.prof-2fa-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 16px 16px;
}
.prof-2fa-info { flex: 1; }

.prof-2fa-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .3px;
    margin-bottom: 6px;
}
.prof-2fa-badge svg { width: 11px; height: 11px; }
.prof-2fa-badge--on  { background: #dcfce7; color: #16a34a; }
.prof-2fa-badge--off { background: #fee2e2; color: #dc2626; }

.prof-2fa-desc {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.prof-2fa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}
.prof-2fa-btn svg { width: 14px; height: 14px; }
.prof-2fa-btn--enable  { background: var(--blue); color: white; }
.prof-2fa-btn--enable:hover  { background: #013f7a; }
.prof-2fa-btn--disable { background: var(--surface-2); color: var(--text-secondary); border: 1.5px solid var(--border); }
.prof-2fa-btn--disable:hover { border-color: var(--border-strong); }

@media (max-width: 480px) {
    .tfa-setup-container { max-width: 100% !important; }
    .tfa-digit { width: 38px; height: 48px; font-size: 1.3rem; }
    .tfa-digits-wrap { gap: 5px; }
    .prof-2fa-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .prof-2fa-btn { width: 100%; justify-content: center; }
}