/* =============================================
           RESET & BASE
        ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --topbar-h: 80px;
    --sidebar-w: 250px;
    /* Topbar */
    --topbar-bg: #ffffff;
    --topbar-border: #d8e0e7;
    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-border: #d8e0e7;
    --sidebar-text: #18222c;
    --sidebar-text-muted: #687581;
    --sidebar-icon: #3a4a59;
    --sidebar-active-bg: #e6eff3;
    --sidebar-active-text: var(--color-primary-dark);
    --sidebar-active-icon: var(--color-primary);
    --sidebar-hover-bg: #e6eff3;
    /* Content */
    --content-bg: #eaeef2;
    --page-bg: #eaeef2;
    --text-primary: #18222c;
    --text-secondary: #3a4a59;
    --border: #d8e0e7;
    /* Colore di default */
    --color-primary: #3f7d97;
    --color-primary-light: #e6eff3;
    --color-primary-dark: #4a87a6;
    /* Campi input */
    --field-bd: #c4d0da;
    --ring: rgba(90,155,184,0.20);
    /* Alert */
    --warn-bg: #fef7e0;
    --warn-border: #f9ab00;
    --warn-text: #3e2723;
    --error-bg: #fce8e6;
    --error-border: #d93025;
    --error-text: #ff0000;
    --info-bg: #e8f0fe;
    --info-border: #1a73e8;
    --info-text: #174ea6;
    --ok-bg: #e6f4ea;
    --ok-border: #34a853;
    --ok-text: #0d652d;
    --amber: #b9772f;
    --radius: 10px;
    --radius-pill: 10px;
    --shadow-top: 0 2px 4px rgba(0,0,0,.08);
    /* Diario: blocco rialzato */
    --teal: #5a9bb8;
    --teal-50: #e6eff3;
    --teal-100: #cfe1ea;
    --r-control: 9px;
}

html, body {
    height: 100%;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--page-bg);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}


/* =============================================
           SHELL
        ============================================= */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* =============================================
           TOPBAR
        ============================================= */
.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 16px;
    z-index: 200;
}

/* Hamburger */
.btn-icon {
    width: 50px;
    height: 40px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-icon);
    transition: background .15s;
    flex-shrink: 0;
    margin-top: 5px;
}

    .btn-icon:hover {
        background: var(--sidebar-hover-bg);
    }

    .btn-icon .material-symbols-outlined {
        font-size: 22px;
    }

/* Logo */
.topbar__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 65px;
    flex-shrink: 0;
}

.logo-mark {
    width: 32px;
    height: 32px;
}

.logo-name {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    padding-top: 5px;
}

/* Alert strip */
.topbar__alerts {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}

    .chip .material-symbols-outlined {
        font-size: 14px;
    }

.chip--warn {
    background: var(--warn-bg);
    border-color: var(--warn-border);
    color: var(--warn-text);
}

.chip--error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.chip--info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

/* Notifiche */
.notif-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background: #d93025;
    border-radius: 50%;
    border: 2px solid var(--topbar-bg);
}

/* Account */
.topbar__account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    /*border: 1px solid var(--topbar-border);*/
    background: transparent;
    transition: background .15s;
    flex-shrink: 0;
}

    .topbar__account:hover {
        background: var(--sidebar-hover-bg);
    }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    /*font-weight: 500;*/
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
}

.account-role {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Tasto Esci */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 11px 16px;
    border-radius: var(--radius);
    /*border: 1px solid var(--border);*/
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}

    .btn-logout:hover {
        background: var(--error-bg);
        color: #d93025;
        border-color: var(--error-border);
    }

    .btn-logout .material-symbols-outlined {
        font-size: 17px;
    }

/* =============================================
           BODY ROW
        ============================================= */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* =============================================
           SIDEBAR — stile Google Play Console (chiara)
        ============================================= */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    /*border-right: 1px solid var(--sidebar-border);*/
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .2s, min-width .2s, transform .2s;
    z-index: 100;
    /*margin-top: 10px;*/
}

    .sidebar::-webkit-scrollbar {
    }

/* Blocca transizioni durante il setup iniziale (rimossa da JS dopo due frame) */
html.sidebar-no-transition .sidebar,
html.sidebar-no-transition .nav-label,
html.sidebar-no-transition .nav-badge {
    transition: none !important;
}

/* Pre-collapsed: applicato da <html> prima del primo paint per evitare il flash */
html.sidebar-is-collapsed .sidebar {
    width: 68px;
    min-width: 68px;
}

html.sidebar-is-collapsed .nav-label,
html.sidebar-is-collapsed .nav-badge {
    opacity: 0;
    width: 0;
}

/* Quando collapsed su desktop → solo icone */
.sidebar.collapsed {
    width: 81px;
    min-width: 81px;
}

.nav-list {
    padding: 0;
    margin-top: 5px;
}

/* Voce singola */
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 15px;
    height: 40px;
    margin: 1px 15px 5px 15px;
    /*border-radius: var(--radius-pill);*/
    border-radius: var(--radius-pill);
    outline: none;
    color: var(--sidebar-text);
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    transition: background .15s;
    cursor: pointer;
}

    .nav-item:hover {
        background: var(--sidebar-hover-bg);
    }

    .nav-item.active {
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        font-weight: 500;
    }

        .nav-item.active .nav-icon {
            color: var(--sidebar-active-icon);
        }

.nav-icon {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--sidebar-icon);
    display: flex;
    align-items: center;
    width: 24px;
    overflow: hidden;
    justify-content: center;
}

    .nav-icon.material-symbols-outlined {
        font-size: 20px;
    }

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .15s;
}

/* Badge contatore */
.nav-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--color-primary);
    color: #fff;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    line-height: 1.5;
    flex-shrink: 0;
    transition: opacity .15s;
}

/* Divider tra gruppi */
.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 16px;
}

/* Collapsed: centrato, senza label */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0;
    gap: 0;
    /*margin: 1px auto;*/
    margin: 1px 0 5px 15px;
    width: 50px;
    padding-left: 15px;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    /* sparisce subito, senza attendere la fine dell'animazione */
    transition: opacity 0s, width 0s;
}

.sidebar.collapsed .nav-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0s, width 0s;
}

/* Tooltip collapsed */
.sidebar.collapsed .nav-item {
    position: relative;
}

    .sidebar.collapsed .nav-item:hover::after {
        content: attr(data-tip);
        position: absolute;
        left: 65px;
        top: 50%;
        transform: translateY(-50%);
        background: #3c4043;
        color: #fff;
        padding: 5px 10px;
        border-radius: var(--radius);
        font-size: 12px;
        white-space: nowrap;
        z-index: 300;
        pointer-events: none;
        box-shadow: 0 2px 6px rgba(0,0,0,.2);
    }

/* =============================================
           CONTENT
        ============================================= */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--content-bg);
    border-top-left-radius: var(--radius);
}

/* Page title */
.page-title {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-title-breadcrumb {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.titoloSez {
    font-weight: 500;
}

    .titoloSez a {
    }

    .titoloSez:hover {
        text-decoration: underline;
    }

.titoloSez_min {
    font-size: 25px;
    font-weight: 500;
    line-height: 25px;
}

    .titoloSez_min a {
        color: #2d2d2d;
        text-decoration: none;
    }

        .titoloSez_min a:hover {
            text-decoration: underline;
        }

.titoloSez_small {
    font-size: 20px;
}

    .titoloSez_small:hover {
        text-decoration: underline;
    }

.page-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

    .page-desc a {
        color: var(--color-primary);
    }

        .page-desc a:hover {
            text-decoration: underline;
        }

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
/* Separatore sotto titolo */
.section-title {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 20px 0;
}
/* Alert banner */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 13.5px;
    line-height: 1.55;
}

    .alert .material-symbols-outlined {
        font-size: 18px;
        flex-shrink: 0;
        margin-top: 1px;
    }

.alert--warn {
    background: var(--warn-bg);
    border-color: var(--warn-border);
    color: var(--warn-text);
}

.alert--error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.alert--info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.alert--ok {
    background: var(--ok-bg);
    border-color: var(--ok-border);
    color: var(--ok-text);
}

.alert__close {
    margin-left: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    opacity: .6;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

    .alert__close:hover {
        opacity: 1;
    }

    .alert__close .material-symbols-outlined {
        font-size: 18px;
    }
/* Tabella info (stile Policy status) */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

    .info-table tr {
        border-bottom: 1px solid var(--border);
    }

        .info-table tr:last-child {
            border-bottom: none;
        }

    .info-table td {
        padding: 14px 0;
        vertical-align: middle;
        font-size: 13.5px;
    }

        .info-table td:first-child {
            width: 200px;
            min-width: 140px;
            color: var(--text-secondary);
            padding-right: 24px;
        }

        .info-table td:last-child {
            color: var(--text-primary);
        }
/* Status inline */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
}

    .status-tag .material-symbols-outlined {
        font-size: 16px;
    }

.status-tag--error {
    color: #d93025;
}

.status-tag--ok {
    color: #34a853;
}

.status-tag--warn {
    color: #f9ab00;
}
/* Stat cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    background: #fff;
}

    .stat-card:hover {
        background-color: #f7f9fb;
    }

.stat-card__label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card__value {
    font-size: 26px;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card__note {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
/* Pulsanti */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

    .btn .material-symbols-outlined {
        font-size: 17px;
    }

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    border-color: var(--color-primary);
    box-shadow: 0 1px 2px rgba(51,104,128,0.30);
}

    .btn--primary:hover {
        background: var(--color-primary-dark);
        border-color: var(--color-primary-dark);
        box-shadow: 0 1px 3px rgba(0,0,0,.2);
    }

.btn--secondary {
    background: transparent;
    color: var(--color-primary);
    border-color: transparent;
}

    .btn--secondary:hover {
        background: rgba(255, 255, 255, 0.5) !important;
        /*background: var(--color-primary-light);*/
    }
/* Placeholder contenuto */
.placeholder {
    border: 1px dashed #dadce0;
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    background: #fafafa;
}
/* Footer */
.content-footer {
    border-top: 1px solid var(--border);
    padding: 16px 0 0;
    margin-top: auto;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

    .content-footer a {
        color: var(--text-secondary);
    }

        .content-footer a:hover {
            color: var(--color-primary);
            text-decoration: underline;
        }
/* =============================================
           OVERLAY MOBILE
        ============================================= */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}

    .sidebar-overlay.on {
        display: block;
    }
/* =============================================
           RESPONSIVE tablet (≤ 900px)
        ============================================= */
@media (max-width: 900px) {

    .topbar {
        padding-left: 16px;
    }

    .sidebar {
        width: 68px;
        min-width: 68px;
        position: relative;
        transform: none;
    }

        .sidebar .nav-label,
        .sidebar .nav-badge {
            opacity: 0;
            width: 0;
            overflow: hidden;
            pointer-events: none;
            transition: none;
        }

        .sidebar .nav-item {
            justify-content: center;
            padding: 0;
            gap: 0;
            margin: 1px 0 5px 0;
            width: 48px;
            padding-left: 15px;
            margin-left: 10px;
        }

        /* Expanded via hamburger: full-width panel fixed over content */
        .sidebar.mobile-open {
            position: fixed;
            top: var(--topbar-h);
            left: 0;
            bottom: 0;
            z-index: 100;
            width: var(--sidebar-w);
            min-width: var(--sidebar-w);
            margin-top: 0;
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }

            .sidebar.mobile-open .nav-label,
            .sidebar.mobile-open .nav-badge {
                opacity: 1;
                width: auto;
                overflow: visible;
                pointer-events: auto;
            }


            .sidebar.mobile-open .nav-item {
                justify-content: flex-start;
                padding: 0 15px 0 15px;
                gap: 14px;
                margin: 1px 8px 5px 10px;
                width: auto;
            }

    .sidebar-overlay.on {
        display: block;
    }

    .topbar__alerts {
        display: none;
    }

    /* Senza alerts (flex:1), spingi le voci di destra al bordo */
    .topbar__logo {
        margin-right: 0;
    }

    .notif-wrap {
        margin-left: auto;
    }

    /* Nascondi testi account e logout — mostra solo icone/avatar */
    .account-name, .account-role {
        display: none;
    }

    .topbar__account {
        padding: 4px;
        gap: 0;
        margin-left: auto;
    }

    .btn-logout span.lbl {
        display: none;
    }

    .btn-logout {
        padding: 7px 10px;
    }

    .content-area {
        padding: 24px 20px;
    }

    .logo-name {
        font-size: 18px;
    }
}
/* =============================================
           RESPONSIVE mobile (≤ 540px)
        ============================================= */
@media (max-width: 540px) {
    :root {
        --topbar-h: 52px;
    }

    .logo-name {
        display: none;
    }

    .account-name, .account-role {
        display: none;
    }

    .topbar__account {
        padding: 4px;
    }

    .btn-logout span.lbl {
        display: none;
    }

    .btn-logout {
        padding: 7px 10px;
    }

    .content-area {
        padding: 16px 14px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .page-title {
        font-size: 20px;
    }

    .info-table td:first-child {
        width: 110px;
    }
}
/* =============================================
           GRIDVIEW
        ============================================= */
/* Contenitore esterno che simula due bordi distinti:
   colorato attorno all'intestazione, chiaro (#ddd) attorno ai dati.
   Usato nelle pagine che richiedono questo effetto (es. pazienti.aspx).
   Il padding: 1px crea lo spazio esatto per i bordi dei pseudo-elementi,
   il background gradiente riempie gli angoli arrotondati con il colore corretto. */
.gv-container {
    position: relative;
    display: block;
    width: 100%;
    padding: 1px;
    box-sizing: border-box;
    border-radius: var(--radius);
    background: linear-gradient(to bottom, var(--color-primary) 38px, white 38px);
}
    /* Bordo colorato: copre solo la riga di intestazione (1px padding + ~41px header) */
    .gv-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 38px;
        border: 1px solid var(--color-primary);
        border-bottom: none;
        border-radius: var(--radius) var(--radius) 0 0;
        pointer-events: none;
        z-index: 2;
    }
    /* Bordo chiaro: copre l'area dati sotto l'intestazione */
    .gv-container::after {
        content: '';
        position: absolute;
        top: 38px;
        left: 0;
        right: 0;
        bottom: 0;
        border: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 var(--radius) var(--radius);
        pointer-events: none;
        z-index: 2;
    }
    /* Il gridview-wrapper annidato: senza bordo proprio e display block per eliminare gap inline */
    .gv-container .gridview-wrapper {
        border: none;
        display: block;
    }
    /* Quando il gridview è vuoto, nasconde i pseudo-elementi e resetta il background */
    .gv-container:has(.emptyDataRow)::before,
    .gv-container:has(.emptyDataRow)::after {
        display: none;
    }

    .gv-container:has(.emptyDataRow) {
        background: white;
    }

.gridview-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.gridview-wrapper_modal {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-y: auto;
    display: block;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.emptyDataRow {
    text-align: center;
    font-weight: 400;
    font-size: 13px;
    border: none;
    line-height: 39px;
    background-color: #fff;
    color: var(--sidebar-text-muted);
}

    .emptyDataRow:hover {
        background-color: #fff;
    }

.gridViewStyle {
    background-color: white;
    border-collapse: collapse;
    width: 100%;
    border: none;
}

    .gridViewStyle TR {
        border-bottom: 1px solid var(--border);
    }

        .gridViewStyle TR:last-child {
            border-bottom: none;
        }

        .gridViewStyle TR:hover {
            background-color: var(--color-primary-light);
        }

    .gridViewStyle TH {
        background-color: var(--color-primary);
        cursor: default;
        white-space: nowrap;
    }

        .gridViewStyle TH a {
            cursor: pointer;
        }

    .gridViewStyle TR:first-child {
        border-bottom-color: var(--color-primary);
    }

    .gridViewStyle TD {
        cursor: pointer;
        border: none;
    }

.emptyData td {
    cursor: default;
}

.datarow {
    font-size: 14px;
}

    .datarow td {
        padding: 13px 11px;
        border: none;
    }

    .datarow th {
        color: #fff;
        padding: 11px;
        font-weight: normal;
        border: none;
        font-size: 12px;
    }

        .datarow th a {
            color: #fff;
            text-decoration: none;
        }

        .datarow th .gv-sort-icon {
            font-size: 8px;
            margin-left: 5px;
            opacity: 0.8;
            vertical-align: middle;
        }

        .datarow th .gv-sort-asc,
        .datarow th .gv-sort-desc {
            display: inline-block;
            position: relative;
            width: 7px;
            height: 7px;
            vertical-align: middle;
            margin-left: 5px;
            opacity: 0.8;
        }

            .datarow th .gv-sort-asc::before,
            .datarow th .gv-sort-desc::before {
                content: "";
                position: absolute;
                top: 50%;
                left: 50%;
                width: 6px;
                height: 6px;
                border-right: 1.5px solid currentColor;
                border-bottom: 1.5px solid currentColor;
            }

            .datarow th .gv-sort-asc::before {
                transform: translate(-50%, -25%) rotate(-135deg);
            }

            .datarow th .gv-sort-desc::before {
                transform: translate(-50%, -75%) rotate(45deg);
            }

    .datarow a:hover {
        text-decoration: underline;
    }

    .datarow:hover {
        background-color: var(--color-primary-light);
        cursor: default;
    }

.gridViewStyle TR:nth-child(even) td,
.gridViewStyle_notHover TR:nth-child(even) td {
    background-color: #f7f9fb;
}

.gridViewStyle TR:nth-child(even):hover td,
.gridViewStyle_notHover TR:nth-child(even):hover td {
    background-color: var(--color-primary-light);
}

.PagerCss {
    padding: 16px 0 8px 0;
    text-align: right;
}

    .PagerCss table {
        display: inline-flex;
        gap: 4px;
    }

        .PagerCss table td {
            padding: 5px 2px;
        }

    .PagerCss a, .PagerCss span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        font-weight: 500;
        text-decoration: none;
        border-radius: 5px;
        padding: 0 8px;
    }

    .PagerCss a {
        background-color: transparent;
        color: #5f6063;
        border: 1px solid #d3d3d3;
    }

        .PagerCss a:hover {
            background-color: #f5f5f5;
        }

    .PagerCss span {
        background-color: var(--color-primary);
        color: #fff;
        border: 1px solid var(--color-primary);
    }




.gridViewStyle_notHover {
    background-color: white;
    border-collapse: collapse;
    width: 100%;
    border: none;
}

    .gridViewStyle_notHover TR {
        border-bottom: 1px solid var(--border);
    }

        .gridViewStyle_notHover TR:last-child {
            border-bottom: none;
        }

    .gridViewStyle_notHover TH {
        background-color: var(--color-primary);
        cursor: default;
        white-space: nowrap;
    }

        .gridViewStyle_notHover TH a {
            cursor: pointer;
        }

    .gridViewStyle_notHover TR:hover {
        background-color: var(--color-primary-light);
    }

    .gridViewStyle_notHover TR:first-child {
        border-bottom-color: var(--color-primary);
    }

    .gridViewStyle_notHover TD {
        cursor: default;
        border: none;
    }

.datarow_notHover {
    font-size: 14px;
}

    .datarow_notHover td {
        padding: 16px 11px;
        border: none;
    }

    .datarow_notHover th {
        color: #fff;
        padding: 11px;
        font-weight: normal;
        border: none;
        font-size: 12px;
    }

        .datarow_notHover th a {
            color: #fff;
            text-decoration: none;
        }

        .datarow_notHover th .gv-sort-icon {
            font-size: 8px;
            margin-left: 5px;
            opacity: 0.8;
            vertical-align: middle;
        }

        .datarow_notHover th .gv-sort-asc,
        .datarow_notHover th .gv-sort-desc {
            display: inline-block;
            position: relative;
            width: 7px;
            height: 7px;
            vertical-align: middle;
            margin-left: 5px;
            opacity: 0.8;
        }

            .datarow_notHover th .gv-sort-asc::before,
            .datarow_notHover th .gv-sort-desc::before {
                content: "";
                position: absolute;
                top: 50%;
                left: 50%;
                width: 6px;
                height: 6px;
                border-right: 1.5px solid currentColor;
                border-bottom: 1.5px solid currentColor;
            }

            .datarow_notHover th .gv-sort-asc::before {
                transform: translate(-50%, -25%) rotate(-135deg);
            }

            .datarow_notHover th .gv-sort-desc::before {
                transform: translate(-50%, -75%) rotate(45deg);
            }

    .datarow_notHover a:hover {
        text-decoration: none;
    }

    .datarow_notHover:hover {
        background-color: var(--color-primary-light);
        cursor: default;
    }
/* =============================================
           FORM & UTILITÀ
        ============================================= */

.form_col_flex_container {
    display: flex;
}

.form_col_flex {
    flex: 1;
}

    .form_col_flex + .form_col_flex {
        margin-left: 20px;
    }

    .form_col_flex:first-child {
        margin-left: 0;
    }

.form_col_flex_container .form_col_flex:last-child {
    margin-right: 0;
}

.form_col_flex_half {
    flex: 0.3 !important;
}

.div_txt_full {
    /*padding-top: 3px;*/
    width: 100%;
}

    .div_txt_full input {
        width: 100%;
        /*font-weight: 300;*/
    }

.div_txt_center {
    text-align: center;
}

    .div_txt_center input {
        text-align: center;
    }

.txt_input textarea {
    height: auto;
}

.txt_input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    font-size: 14px;
    border: 1.5px solid var(--field-bd);
    border-radius: var(--radius);
    outline: 0;
    color: #2d2d2d;
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box; /* Firefox, other Gecko */
    font-family: 'Roboto', sans-serif;
    transition: border-color .15s, box-shadow .15s;
    field-sizing: content
}

    .txt_input:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px var(--ring);
    }

    .txt_input::placeholder {
        color: #9aa6b1;
    }

    .txt_input:disabled,
    .txt_input[readonly],
    select.txt_input:disabled {
        background-color: #f7f9fb;
        color: #6b6b6b;
        border-color: var(--border);
        cursor: default;
        opacity: 1;
    }

textarea.txt_input {
    height: auto;
    min-height: 200px;
    padding: 14px;
}

.txt_input_TA_100p {
    font-size: 15px;
    border: 1.5px solid var(--field-bd);
    border-radius: var(--radius);
    outline: 0;
    color: #2d2d2d;
    padding: 8px;
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box; /* Firefox, other Gecko */
    height: 100%;
    font-family: 'Roboto', sans-serif;
}

.txt_input_TA_100p_150px {
    font-size: 15px;
    border: 1.5px solid var(--field-bd);
    border-radius: var(--radius);
    outline: 0;
    color: #2d2d2d;
    padding: 8px;
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box; /* Firefox, other Gecko */
    height: 100%;
    min-height: 150px;
    font-family: 'Roboto', sans-serif;
}

.div_TA_full {
    padding-top: 3px;
}

    .div_TA_full textarea {
        width: 100%;
        height: 150px;
        font-family: 'Roboto', sans-serif;
    }

.div_txt_170_center {
    width: 170px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

    .div_txt_170_center input {
        width: 100%;
        text-align: center;
    }

.div_txt_200_center {
    width: 200px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

    .div_txt_200_center input {
        width: 100%;
        text-align: center;
    }

.div_txt_300 {
    width: 300px;
}

    .div_txt_300 input {
        width: 100%;
    }

.div_txt_250 {
    width: 250px;
}

    .div_txt_250 input {
        width: 100%;
    }

.div_txt_400 {
    width: 400px;
}

    .div_txt_400 input {
        width: 100%;
    }

.div_txt_600 {
    padding-top: 3px;
    width: 600px;
}

    .div_txt_600 input {
        width: 100%;
    }

.div_txt_800 {
    padding-top: 3px;
    width: 800px;
}

    .div_txt_800 input {
        width: 100%;
    }

.txt_input_TA_150 {
    font-size: 15px;
    border: 1.5px solid var(--field-bd);
    border-radius: var(--radius);
    outline: 0;
    color: #2d2d2d;
    padding: 8px;
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box; /* Firefox, other Gecko */
    height: 150px;
    font-family: 'Roboto', sans-serif;
}

.search-wrapper {
    position: relative;
}

.search-button {
    position: absolute;
    right: 6px;
    top: 54%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    text-decoration: none;
}

    .search-button:hover {
        color: #333;
    }

    .search-button a {
        text-decoration: none;
    }
/* =============================================
           LOGIN
        ============================================= */

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 40px 40px 32px;
    width: 100%;
    max-width: 400px;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo {
    width: 52px;
    height: 52px;
    background: var(--color-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -.5px;
}

.login-title {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 2px;
}

.login-footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}
/* Campi del form di login */
.field {
    margin-bottom: 15px;
}

    .field label {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        margin-bottom: 6px;
        letter-spacing: .3px;
        text-transform: uppercase;
    }

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

    .field-wrap .material-symbols-outlined {
        position: absolute;
        left: 12px;
        font-size: 18px;
        color: var(--text-secondary);
        pointer-events: none;
    }

    .field-wrap input {
        width: 100%;
        padding: 10px 12px 10px 38px;
        border: 1.5px solid var(--field-bd);
        border-radius: var(--radius);
        font-family: inherit;
        font-size: 14px;
        color: var(--text-primary);
        background: #fff;
        transition: border-color .15s, box-shadow .15s;
        outline: none;
    }

        .field-wrap input:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px var(--ring);
        }
/* Alert errore login */
.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--error-text);
    margin-bottom: 18px;
}

    .login-error .material-symbols-outlined {
        font-size: 18px;
        flex-shrink: 0;
    }
/* Bottone login */
.btn-login {
    width: 100%;
    padding: 11px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

    .btn-login:hover {
        background: var(--color-primary-dark);
        box-shadow: 0 1px 4px rgba(0,0,0,.2);
    }

    .btn-login:active {
        background: var(--color-primary-dark);
    }

.btn_small_disabled {
    background-color: grey;
    width: 100%;
    height: auto;
    text-align: center;
    padding: 11px;
    border: none;
    border-radius: var(--radius-pill);
    color: #fff;
    cursor: default;
    margin: auto;
    font-size: 15px;
}

.breadcrumb_arrow {
    font-size: 20px;
    display: inline-block;
}

.descrSezForm {
}

.left {
    float: left;
}

.right {
    float: right;
}

.clear {
    clear: both;
}

select {
    cursor: pointer;
}

.modal_container {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modalPopup {
    background-color: #fff;
    background-color: #fff;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0px 0px 14px #888;
    z-index: 20000;
    border: 2px solid #ffffff;
    font-size: 15px;
    color: #2d2d2d;
    text-align: left;
    min-width: 900px;
    max-width: 1200px;
}

.modal_close_icon {
    position: absolute;
    right: -10px;
    top: -10px;
}

.btn_close {
    font-size: 20px;
    width: auto;
    height: 40px;
    font-weight: normal;
    text-align: right;
}

    .btn_close a {
        color: #2d2d2d;
        text-decoration: none;
        border-radius: 3px;
        text-align: center;
        padding: 5px;
    }

        .btn_close a:hover {
            color: var(--color-primary);
        }

.field_filter {
    /*margin-bottom: 5px;*/
}

    .field_filter label {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        margin-bottom: 6px;
        letter-spacing: .3px;
        text-transform: uppercase;
    }

.customSelect_search {
    width: 100%;
    border: 1.5px solid var(--field-bd);
    border-radius: var(--radius);
    height: 37px;
    padding-left: 4px;
    color: #444;
    font-family: 'Roboto', sans-serif;
}

.select2-dropdown {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.09);
}

/* Pallino colorato con iniziali operatore nelle option select2 */
.operatore-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    vertical-align: middle;
}

.operatore-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .12);
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .3px;
    flex-shrink: 0;
}

/* Nel filtro operatore di gv_pazienti (widget Selectric) le iniziali della voce
   selezionata (label chiusa) risultano otticamente troppo in alto: piccola
   correzione mirata. Non tocca gli item della lista aperta (.selectric-items),
   già centrati correttamente. */
.selectric-labeled-operatore .selectric .label .operatore-dot {
    box-sizing: border-box;
    padding-top: 2px;
}

/* Chip operatore nelle celle di GridView (es. gv_pazienti, colonna "Operatori di riferimento") */
.operatore-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary-light);
    border-radius: var(--radius-pill);
    padding: 2px 10px 2px 4px;
    margin: 0 4px 0 0;
    vertical-align: middle;
}

    .operatore-chip .operatore-dot {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }

.operatore-chip__text {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.tipologia-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    vertical-align: middle;
}

.tipologia-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.selectric .button:after {
    border-color: #888 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
}

.selectric-disabled {
    opacity: 1;
    filter: none;
}

    .selectric-disabled .selectric {
        background-color: #f7f9fb;
        border-color: #ddd;
        cursor: default;
    }

        .selectric-disabled .selectric .label {
            color: #6b6b6b;
        }

        .selectric-disabled .selectric .button:after {
            border-top-color: #bbb;
        }

.selectric-open .selectric {
    border-bottom: 1px solid #dadada;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

    .selectric-open .selectric .button:after {
        border-color: transparent;
        border-width: 0;
        border-right: 1px solid #888;
        border-bottom: 1px solid #888;
        transform: translate(-50%, -35%) rotate(-135deg);
    }

.selectric-items {
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.09);
}

    .selectric-items li {
        min-height: 40px;
        display: flex;
        align-items: center;
        padding: 0 10px;
    }

        .selectric-items li.selected,
        .selectric-items li.highlighted,
        .selectric-items li:hover {
            background: var(--sidebar-hover-bg);
            color: var(--text-primary);
        }

.select2-results__option {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 6px;
}

.select2-container--default .select2-results__option--selected {
    background: var(--sidebar-hover-bg);
    color: var(--text-primary);
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--sidebar-hover-bg);
    color: var(--text-primary);
}

.alignCenter {
    text-align: center;
}

.cbl_list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    margin: 0;
}

    .cbl_list tbody,
    .cbl_list tr {
        display: contents; /* Rimuove il comportamento della tabella */
    }

    .cbl_list td {
        padding: 10px;
        background-color: #eee;
        border-radius: var(--radius);
        width: calc(25% - 12px); /* 5 colonne: 100% / 5 - gap */
        box-sizing: border-box;
    }

    .cbl_list label {
        display: inline-block;
        padding-left: 30px;
        text-indent: -30px;
        vertical-align: middle;
    }

    .cbl_list input[type="checkbox"] {
        vertical-align: top;
        /*margin-right: 10px;*/
    }

input[type="radio"], input[type="checkbox"] {
    transform: scale(1.3);
}

/* SQL Command page */
.sql-cmd-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn-text);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 20px;
}

    .sql-cmd-warning .material-symbols-outlined {
        font-size: 20px;
        flex-shrink: 0;
    }

.sql-cmd-editor {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.sql-cmd-textarea {
    width: 100%;
    min-height: 200px;
    /*font-family: 'Consolas', 'Courier New', monospace;*/
    font-size: 13px;
    resize: vertical;
    line-height: 1.6;
}

.sql-cmd-results {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.sql-cmd-results__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 14px;
}

.sql-cmd-batch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
}

    .sql-cmd-batch .material-symbols-outlined {
        font-size: 20px;
        flex-shrink: 0;
        margin-top: 1px;
    }

.sql-cmd-batch--ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.sql-cmd-batch--error {
    background: var(--error-bg);
    color: var(--error-text);
}

.sql-cmd-batch__label {
    font-weight: 500;
}

.sql-cmd-batch__detail {
    margin-top: 2px;
    font-size: 12px;
    opacity: .85;
    word-break: break-word;
}

.sql-cmd-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sql-cmd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .sql-cmd-table th {
        background: #f7f9fb;
        padding: 8px 12px;
        text-align: left;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .sql-cmd-table td {
        padding: 8px 12px;
        border-bottom: 1px solid var(--border);
        color: var(--text-primary);
        white-space: nowrap;
    }

    .sql-cmd-table tr:last-child td {
        border-bottom: none;
    }

    .sql-cmd-table tbody tr:hover td {
        background: #f7f9fb;
    }

.sql-cmd-null {
    color: var(--text-secondary);
    font-style: italic;
}

.sql-cmd-rowcount {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 10px;
}

.repeater-empty-msg {
    display: block;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.allegato_row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.allegato-ext {
    width: 42px;
    height: 52px;
    border-radius: 5px 10px 5px 5px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    background: #f1f3f4;
    color: #5f6368;
}

.ext-pdf {
    background: #fce8e6;
    color: #c5221f;
}

.ext-doc,
.ext-docx {
    background: #e8f0fe;
    color: #1a73e8;
}

.ext-xls,
.ext-xlsx {
    background: #e6f4ea;
    color: #1e8e3e;
}

.ext-jpg,
.ext-jpeg,
.ext-png,
.ext-gif {
    background: #f3e8fd;
    color: #9334e6;
}

.ext-zip,
.ext-7z {
    background: #fef7e0;
    color: #b9772f;
}

.ext-txt {
    background: #f1f3f4;
    color: #5f6368;
}

.allegato_row__info {
    flex: 1;
    min-width: 0;
}

.allegato_row__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

    .allegato_row__name:hover {
        color: var(--color-primary);
        text-decoration: underline;
    }

.allegato_row__meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.allegato_row__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.allegato_row__btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    text-decoration: none;
}

    .allegato_row__btn .material-symbols-outlined {
        font-size: 19px;
    }

    .allegato_row__btn:hover {
        background: var(--color-primary-light);
        color: var(--color-primary);
    }

.allegato_row__btn--delete:hover {
    background: var(--error-bg);
    color: var(--error-text);
}

.btn_img_red {
    background-color: red;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .btn_img_red:hover {
        background-color: darkred;
        color: #ffffff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-1px);
    }

.selectric .button:after {
    width: 7px;
    height: 7px;
    border: none;
    border-right: 1px solid #888;
    border-bottom: 1px solid #888;
    transform: translate(-50%, -65%) rotate(45deg);
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    margin: 0;
}

.selectric-labeled-operatore .selectric .label,
.selectric-labeled-stato .selectric .label,
.field_filter--sezione .select2-selection__rendered,
.field_filter--account .select2-selection__rendered {
    font-weight: 500;
}

    .selectric-labeled-operatore .selectric .label::before {
        content: "Operatore: ";
        color: var(--text-secondary);
        font-weight: 400;
    }

    .selectric-labeled-stato .selectric .label::before {
        content: "Stato: ";
        color: var(--text-secondary);
        font-weight: 400;
    }

.selectric-labeled-stato[data-stato="1"] .selectric .label::after,
.selectric-labeled-stato[data-stato="0"] .selectric .label::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.selectric-labeled-stato[data-stato="1"] .selectric .label::after {
    background: var(--ok-border);
}

.selectric-labeled-stato[data-stato="0"] .selectric .label::after {
    background: var(--error-border);
}

.field_filter--sezione .select2-selection__rendered::before {
    content: "Sezione: ";
    color: var(--text-secondary);
    font-weight: 400;
}

.field_filter--account .select2-selection__rendered::before {
    content: "Account: ";
    color: var(--text-secondary);
    font-weight: 400;
}

/* Pallino colorato nelle voci del dropdown selectric */
.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,.12);
    flex-shrink: 0;
    position: relative;
    top: -1px;
}


.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-style: none;
    border-color: transparent;
    border-width: 0;
    border-right: 1px solid #888;
    border-bottom: 1px solid #888;
    width: 7px;
    height: 7px;
    margin-left: 0;
    margin-top: 0;
    transform: translate(-50%, -65%) rotate(45deg);
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent;
    border-right: 1px solid #888;
    border-bottom: 1px solid #888;
    transform: translate(-50%, -35%) rotate(-135deg);
}

.fontBold {
    font-weight: 500;
}

/* Upload area (dropzone + preview affiancati) */
.upload-area {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

    .upload-area .upload-dropzone {
        flex: 1;
        margin-bottom: 0;
    }

/* Upload preview card */
.upload-preview {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    display: none;
    align-items: center;
    gap: 14px;
    padding: 20px;
}

.upload-preview__icon {
    width: 42px;
    height: 52px;
    border-radius: 5px 10px 5px 5px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.upload-preview__info {
    flex: 1;
    min-width: 0;
}

.upload-preview__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-preview__meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.upload-preview__remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}

    .upload-preview__remove:hover {
        background: var(--error-bg);
        color: var(--error-text);
    }

/* Upload dropzone */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    background: #f7f9fb;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 16px;
    user-select: none;
}

    .upload-dropzone:hover, .upload-dropzone.dragover {
        border-color: var(--color-primary);
        background: var(--color-primary-light);
    }

.upload-dropzone__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--color-primary-light);
    margin-bottom: 12px;
}

    .upload-dropzone__icon .material-symbols-outlined {
        font-size: 26px;
        color: var(--color-primary);
    }

.upload-dropzone__text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-dropzone__browse {
    color: var(--color-primary);
    font-weight: 600;
}

.upload-dropzone__hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-dropzone__filename {
    margin-top: 10px;
    font-size: 24px;
    font-weight: 500;
    color: var(--color-primary);
}

.upload-row {
    margin-top: 4px;
}

.upload-row__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.upload-row__inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .upload-row__inputs .txt_input {
        flex: 1;
        /*font-weight: 300;*/
    }


.uploadForm {
    background-color: white;
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tit_sezionePanel {
    font-size: 16px;
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 25px 0;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* =============================================
   DIARIO CLINICO
   ============================================= */

/* Toolbar */
.diary-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 25px;
}

.diary-actions {
    display: flex;
    gap: 8px;
}

.diary-intro .diary-title {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.diary-intro p {
    margin: 0;
    font-size: 13px;
    color: var(--sidebar-text-muted);
}

/* Lista card */
.diario-list-card { /*background: #fff; border: 1px solid var(--border);*/
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(24,40,56,0.04);
}

/* Controlli ricerca/filtro */
.diario-list-controls {
    padding: 0px 0px 14px 0px;
    border-bottom: 1px solid #e6ebf0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.diario-search {
    position: relative;
    display: flex;
    align-items: center;
}

    .diario-search .ico {
        position: absolute;
        right: 13px;
        color: #9aa6b1;
        pointer-events: none;
        display: flex;
    }

    .diario-search input {
        width: 100%;
        height: 40px;
        padding: 0 40px 0 14px;
        border-radius: 9px;
        background: #fff;
        border: 1.5px solid var(--field-bd);
        font-size: 14px;
        font-family: inherit;
        transition: border-color .12s, box-shadow .12s;
    }

        .diario-search input::placeholder {
            color: #9aa6b1;
        }

        .diario-search input:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px var(--ring);
            outline: none;
        }

/* Filtro tipologia */
.diario-filter-dd {
    position: relative;
}

.diario-filter-trigger {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 9px;
    background: #fff;
    border: 1.5px solid var(--field-bd);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color .12s, box-shadow .12s;
}

    .diario-filter-trigger:hover {
        border-color: #aebfc8;
    }

    .diario-filter-trigger.open {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px var(--ring);
    }

    .diario-filter-trigger .funnel {
        color: var(--sidebar-text-muted);
        display: inline-flex;
        flex-shrink: 0;
    }

    .diario-filter-trigger .ft-dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .diario-filter-trigger .ft-label {
        flex: 1;
        text-align: left;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .diario-filter-trigger .chev {
        color: #9aa6b1;
        display: inline-flex;
        flex-shrink: 0;
        transition: transform .15s;
    }

    .diario-filter-trigger.open .chev {
        transform: rotate(180deg);
    }

.diario-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 16px 36px rgba(16,28,40,0.18);
    padding: 6px;
    z-index: 40;
    display: none;
}

    .diario-filter-menu.open {
        display: block;
    }

.dfopt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-secondary);
}

    .dfopt:hover {
        background: var(--page-bg);
    }

    .dfopt .fdot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .dfopt .fcount {
        margin-left: auto;
        font-size: 12px;
        color: #9aa6b1;
    }

    .dfopt .fcheck {
        margin-left: auto;
        color: var(--color-primary);
        display: none;
    }

    .dfopt.sel {
        color: var(--text-primary);
        font-weight: 500;
        background: var(--color-primary-light);
    }

        .dfopt.sel .fcheck {
            display: inline-flex;
        }

        .dfopt.sel .fcount {
            display: none;
        }

/* Meta riga */
.diario-list-meta {
    padding: 10px 0 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e6ebf0;
}

    .diario-list-meta .count {
        font-size: 12px;
        color: var(--sidebar-text-muted);
    }

    .diario-list-meta .clear-filter {
        font-size: 12.5px;
        color: var(--color-primary);
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
        display: none;
        align-items: center;
        gap: 5px;
        font-weight: 500;
        font-family: inherit;
    }

        .diario-list-meta .clear-filter.show {
            display: inline-flex;
        }

/* Riga nota */
.entry {
    display: grid;
    grid-template-columns: 88px minmax(112px,200px) minmax(0,1fr) minmax(0,150px) 18px;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid #e6ebf0;
    cursor: pointer;
    position: relative;
    transition: background .12s;
}

    .entry:hover {
        background: var(--teal-50);
        box-shadow: inset 3px 0 0 var(--teal);
    }

    .entry.active {
        background: #ffffff;
        /*border-bottom: none;*/
        border-top: 1px solid #e6ebf0;
        border-left: 3px solid var(--teal);
        position: relative;
        z-index: 2;
        box-shadow: 0 -6px 14px -9px rgba(22,42,60,0.22);
    }

        .entry.active:hover {
            background: var(--teal-50);            
        }

    .entry:last-child {
        border-bottom: none;
    }

.e-when {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

    .e-when .e-date {
        /*font-family: ui-monospace, 'Courier New', monospace;*/
        font-size: 12.5px;
        color: var(--text-primary);
        font-weight: 500;
    }

    .e-when .e-time {
        /*font-family: ui-monospace, 'Courier New', monospace;*/
        font-size: 11.5px;
        color: var(--sidebar-text-muted);
    }

.e-type {
}

.e-main {
    min-width: 0;
}

    .e-main .entry-title {
        font-size: 14px;
        font-weight: 500;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 2px;
    }

    .e-main .snippet {
        font-size: 12.5px;
        color: var(--sidebar-text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.e-op {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.e-av {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 600;
}

.e-op-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.e-chev {
    color: #9aa6b1;
    display: flex;
    justify-content: flex-end;
}

    .e-chev svg {
        transition: transform .18s ease;
    }

.entry.active .e-chev {
    color: var(--color-primary);
}


    .entry.active .e-chev svg {
        transform: rotate(90deg);
    }

/* Badge tipo */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

    .badge .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }


/* Dettaglio inline */
.entry-detail {
    background: #ffffff;
    border-bottom: 1px solid #e6ebf0;
    border-left: 3px solid var(--teal);
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 16px -9px rgba(22,42,60,0.22);
    overflow: hidden;
    animation: edIn .18s ease;
}

@keyframes edIn {
    from {
        transform: translateY(-4px);
    }

    to {
        transform: none;
    }
}

.ed-inner {
    padding: 18px 22px 20px;
}

.ed-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.ed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 30px;
}

    .ed-meta .meta-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .ed-meta .k {
        font-size: 10.5px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--sidebar-text-muted);
    }

    .ed-meta .v {
        font-size: 14px;
        color: var(--text-primary);
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 7px;
    }

        .ed-meta .v.mono {
            /*font-family: ui-monospace, 'Courier New', monospace;*/
            font-size: 13.5px;
        }

.ed-title {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
}

.ed-body {
    margin-top: 15px;
    /*padding-top: 14px;*/
    /*border-top: 1px solid #e6ebf0;*/
    font-size: 14px;
    line-height: 1.65;
    color: #2d3c49;
    white-space: pre-line;
}

.ed-foot {
    margin-top: 13px;
    font-size: 12px;
    color: var(--sidebar-text-muted);
}

    .ed-foot b {
        color: var(--text-secondary);
        font-weight: 500;
    }

/* Pulsanti modifica/elimina nel dettaglio */
.ed-actions {
    display: flex;
    gap: 6px;
}

.icbtn {
    width: 34px;
    height: 34px;
    border-radius: var(--r-control);
    border: 1px solid var(--field-bd);
    background: #fff;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s, border-color .12s;
    text-decoration: none;
    padding: 0;
}

    .icbtn.edit:hover {
        background: var(--color-primary-light);
        color: var(--color-primary);
        border-color: var(--teal-100);
    }

    .icbtn.del:hover {
        background: #f7e4e1;
        color: #c0564b;
        border-color: #e7c7c1;
    }

/* Stato vuoto */
.diario-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--sidebar-text-muted);
    font-size: 13px;
}

/* Modal diario nota */
.diario-modal {
    width: 580px;
    max-width: 96vw;
}

    .diario-modal .modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 22px;
        border-bottom: 1px solid #e6ebf0;
    }

        .diario-modal .modal-head h3 {
            margin: 0;
            font-size: 17px;
            font-weight: 600;
            letter-spacing: -0.015em;
            color: var(--text-primary);
        }

        .diario-modal .modal-head .btn-close-modal {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            border: none;
            background: transparent;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--sidebar-text-muted);
            transition: background .12s;
            font-size: 18px;
            line-height: 1;
        }

            .diario-modal .modal-head .btn-close-modal:hover {
                background: var(--page-bg);
            }

    .diario-modal .modal-body {
        padding: 20px 22px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .diario-modal .modal-foot {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        padding: 16px 22px;
        border-top: 1px solid #e6ebf0;
        background: #fafbfc;
    }

.diario-op-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diario-frow {
    display: grid;
    gap: 14px;
}

    .diario-frow.c3 {
        grid-template-columns: 1fr 1fr 1fr;
    }

.diario-field {
    display: flex;
    flex-direction: column;
    /*gap: 6px;*/
    min-width: 0;
}

    .diario-field label {
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        margin-bottom: 6px;
        text-transform: uppercase;
    }

    .diario-field input,
    .diario-field select,
    .diario-field textarea {
        width: 100%;
        height: 42px;
        padding: 0 13px;
        border-radius: 9px;
        background: #fff;
        border: 1.5px solid var(--field-bd);
        font-size: 14px;
        font-family: inherit;
        color: var(--text-primary);
        transition: border-color .12s, box-shadow .12s;
        outline: none;
    }

    .diario-field textarea {
        height: auto;
        min-height: 120px;
        padding: 11px 13px;
        resize: vertical;
        line-height: 1.55;
    }

        .diario-field input:focus,
        .diario-field select:focus,
        .diario-field textarea:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px var(--ring);
        }

        .diario-field input::placeholder,
        .diario-field textarea::placeholder {
            color: #9aa6b1;
        }

    .diario-field select {
        appearance: none;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa6b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 34px;
    }

    .diario-field .label-opt {
        text-transform: none;
        font-weight: 400;
        letter-spacing: 0;
        color: #9aa6b1;
        margin-left: 5px;
        font-size: 10px;
    }

@media print {
    @page {
        margin: 16mm 15mm;
    }

    body, html {
        background: #fff !important;
    }

    .topbar, .sidebar, .app-shell, .overlay, .modalPopup, .dhx_modal_cover {
        display: none !important;
    }

    .print-header {
        margin-bottom: 16px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }

        .print-header h1 {
            margin: 0 0 4px;
            font-size: 18px;
            font-weight: 600;
        }

    .print-sub {
        font-size: 11.5px;
        color: #555;
    }

    .print-note {
        padding: 13px 0 12px;
        border-bottom: 1px solid #d4d4d4;
        page-break-inside: avoid;
    }

    .pn-head {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 5px;
    }

    .pn-date {
        font-size: 11.5px;
        color: #444;
        /*font-family: monospace;*/
    }

    .pn-title {
        font-size: 14px;
        font-weight: 600;
        margin: 3px 0 2px;
    }

    .pn-op {
        font-size: 11.5px;
        color: #555;
        margin-bottom: 7px;
    }

    .pn-body {
        font-size: 12.5px;
        line-height: 1.55;
        white-space: pre-line;
    }

    .badge {
        border: 1px solid currentColor;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.diario-entry-list {
    background-color: #fff;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    border: 1px solid var(--field-bd);
}

    .diario-entry-list .diario-empty {
        display: block;
        text-align: center;
        padding: 12px;
    }

.material-symbols-outlined {
    font-size: 22px;
}

.modal-diario-error {
    display: block;
    color: var(--error-text);
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

#diario-print-overlay { display: none; }

@media print {
    body.is-printing-diario > *:not(#diario-print-overlay) { display: none !important; }
    #diario-print-overlay {
        display: block !important;
        font-family: Arial, sans-serif;
        font-size: 12px;
        color: #111;
    }
    #diario-print-overlay h1 { font-size: 16px; margin: 0 0 4px; }
    #diario-print-overlay .dpo-meta { font-size: 11px; color: #555; margin-bottom: 20px; }
    #diario-print-overlay .dpo-entry { border-bottom: 1px solid #ddd; padding: 12px 0; page-break-inside: avoid; }
    #diario-print-overlay .dpo-header { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
    #diario-print-overlay .dpo-when { font-size: 11px; color: #555; white-space: nowrap; }
    #diario-print-overlay .dpo-tipo { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
    #diario-print-overlay .dpo-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
    #diario-print-overlay .dpo-op { font-size: 11px; color: #555; margin-left: auto; }
    #diario-print-overlay .dpo-titolo { font-weight: bold; font-size: 12px; margin-bottom: 4px; }
    #diario-print-overlay .dpo-note { white-space: pre-wrap; font-size: 12px; line-height: 1.5; }
}
