/* Font Inter (variabile, ospitato in locale: nessuna dipendenza da internet) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('lib/inter/inter-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('lib/inter/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root { --app-font: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; --kendo-font-family: var(--app-font); }

/* Colore principale nero: sostituisce il blu dello swatch Telerik (ocean-blue) */
:root, .k-body {
    --kendo-color-primary: #1a1a1a;
    --kendo-color-primary-hover: #333333;
    --kendo-color-primary-active: #000000;
    --kendo-color-primary-emphasis: #4d4d4d;
    --kendo-color-primary-subtle: #ececec;
    --kendo-color-primary-subtle-hover: #e0e0e0;
    --kendo-color-primary-subtle-active: #d2d2d2;
    --kendo-color-primary-on-subtle: #1a1a1a;
    --kendo-color-primary-on-surface: #1a1a1a;
    --kendo-color-primary-darker: #000000;
    --kendo-color-primary-lighter: #4d4d4d;
    --kendo-color-on-primary: #ffffff;
    --kendo-color-primary-active-hover: #000000;
}

html, body {
    font-family: var(--app-font);
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea, .k-button, .k-input, .k-input-inner { font-family: inherit; }

h1:focus {
    outline: none;
}

#blazor-error-ui {
    display: none !important;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }


/* TELERIK PROJECT TEMPLATE STYLES */

/* Overall Layout and Drawer */

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
}

div.appbar-top {
    position: relative;
    z-index: 1;
}

.mainlayout-drawer {
    flex: 1;
    align-items: stretch;
    overflow: hidden;
}

    .mainlayout-drawer > .k-drawer .k-drawer-items {
        margin-top: 1em;
    }

/* Top AppBar */

.appbar-top > div {
    line-height: 2.4;
}

#app-title {
    display: flex;
    gap: .2em;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 1.2em;
}

    #app-title strong {
        font-weight: 500;
    }

    #app-title sup {
        font-size: .4em;
    }

    #app-title a,
    #app-title a:hover {
        text-decoration: none;
        color: inherit;
    }

/* Main Content */

main {
    padding: 0 2em 1em;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.mainlayout-drawer .k-drawer-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Griglie ancorate al fondo: occupano lo spazio rimasto, il pager resta in basso e le righe scorrono. */
.fill-grid {
    flex: 1 1 auto;
    min-height: 320px;
    height: auto;
}

main > * { flex-shrink: 0; }
main > .fill-grid { flex-shrink: 1; }

a {
    color: var(--kendo-color-on-app-surface);
}

    a:hover {
        color: var(--kendo-color-primary);
        text-decoration: none;
    }

h1, h2, h3 {
    margin: .67em 0 .3em;
    font-weight: normal;
}

h1 {
    font-size: 42px;
}

h2 {
    font-size: 32px;
}

h3 {
    font-size: 24px;
}

/* Login amministrazione (SSR statico, senza Telerik) */

.static-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f5f2;
}

.login-card {
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    padding: 32px;
    background: #fff;
    border: 1px solid #d9d6ce;
    border-radius: 12px;
}

.login-card h1 {
    margin: 0 0 20px;
    font-size: 26px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label {
    margin-top: 10px;
    font-weight: 600;
}

.login-form input {
    height: 44px;
    box-sizing: border-box;
    padding: 0 12px;
    font: inherit;
    border: 1.5px solid #7d858d;
    border-radius: 8px;
}

.login-form button {
    height: 48px;
    margin-top: 20px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: #1a1a1a;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.login-error,
.login-validation {
    color: #7a1a12;
}

.login-error {
    padding: 10px 12px;
    background: #fef3f2;
    border: 1.5px solid #b42318;
    border-radius: 8px;
}

.appbar-user {
    margin-right: 8px;
}

.login-ok {
    padding: 10px 12px;
    color: #14532d;
    background: #e9f4ec;
    border: 1.5px solid #1f7a3d;
    border-radius: 8px;
}

.login-link {
    display: inline-block;
    margin-top: 16px;
}

.login-hint {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: #4a5057;
}

/* Gestione aziende */

.companies-grid {
    margin-top: 12px;
}

.company-window .k-window-content {
    padding: 20px 24px;
}

.company-window .login-error {
    margin-bottom: 12px;
}

.company-window .k-form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7178;
}

.company-window .k-form-buttons {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e2e0da;
    justify-content: flex-end;
}

.company-logo-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px;
    background: #f6f5f2;
    border: 1px dashed #b9b6ad;
    border-radius: 8px;
}

.company-logo-preview {
    flex: none;
    width: 140px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #6b7178;
    background: #fff;
    border: 1px solid #d9d6ce;
    border-radius: 6px;
}

.company-logo-preview img {
    max-width: 128px;
    max-height: 68px;
}

.company-logo-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.company-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
}

/* Finestra di errore */

.error-reference {
    color: #4a5057;
}

.error-details {
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    font-size: 12px;
    white-space: pre-wrap;
    background: #f6f5f2;
    border: 1px solid #d9d6ce;
    border-radius: 6px;
}

/* Pagina di errore */

.error-page {
    max-width: 480px;
}

.error-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.error-button {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 18px;
    font-weight: 600;
    color: #1b1f23;
    text-decoration: none;
    border: 1px solid #b9b6ad;
    border-radius: 8px;
}

.error-button-primary {
    color: #fff;
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.company-window .k-window-content {
    overflow-x: hidden;
}

.company-window .k-form,
.company-window .k-form-fieldset {
    width: 100%;
}

.company-logo-actions {
    min-width: 0;
}

.company-logo-actions input[type="file"] {
    max-width: 100%;
}

.company-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding: 4px 0;
}

.company-language {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    margin-top: 0 !important;
}

.company-language em {
    color: #6b7178;
    font-size: 12px;
}

.company-language input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a1a1a;
}

.error-info {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 6px 12px;
    margin: 12px 0;
    padding: 10px 12px;
    background: #fef3f2;
    border: 1px solid #b42318;
    border-radius: 6px;
}

.error-info dt {
    font-weight: 700;
}

.error-info dd {
    margin: 0;
    word-break: break-word;
}

.user-company-picker { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.user-company-picker label { font-weight: 600; }

.user-window .k-form .k-input, .user-window .k-form .k-textbox { width: 100%; }

.site-swatch { display: inline-block; width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); vertical-align: middle; }
.site-theme-row { display: flex; align-items: center; gap: 12px; }
.site-theme-row input[type="color"] { width: 48px; height: 34px; padding: 2px; border: 1px solid #ccc; border-radius: 4px; background: #fff; }

/* Finestre di modifica: il contenuto scorre, i pulsanti restano sempre visibili in fondo. */
.company-window .k-window-content { overflow-y: auto; overflow-x: hidden; padding-bottom: 0; }
.company-window .k-form { margin-bottom: 0; padding-bottom: 0; }
.company-window .k-form-buttons {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 !important;
    padding: 12px 0;
    background: #fff;
    border-top: 1px solid #e5e5e5;
}

.form-company { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; padding: 8px 12px; background: #f4f4f4; border-radius: 4px; }
.form-company span { color: #666; }

.pin-row { display: flex; align-items: center; gap: 12px; }
.form-company strong + span { margin-left: 24px; }

/* Inserimento PIN a 6 caselle */
.pin-input { display: inline-flex; align-items: center; gap: 8px; }
.pin-box {
    width: 46px; height: 56px; padding: 0; text-align: center;
    font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
    border: 1px solid #c9ced6; border-radius: 8px; background: #fff; color: #1f2937;
    transition: border-color .15s, box-shadow .15s, background .15s;
    caret-color: transparent;
}
.pin-box.filled { background: #f1f1f1; border-color: #1a1a1a; }
.pin-box:focus { outline: none; border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26, 26, 26, .25); }

/* Campi obbligatori */
.k-form-label.required::after { content: " *"; color: #d13438; font-weight: 700; }
.form-required-note { margin: 0 0 8px; font-size: 13px; color: #666; }
.required-mark { color: #d13438; font-weight: 700; }

.pin-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: 4px; border: 0; border-radius: 8px; background: transparent; color: #4b5563; cursor: pointer; }
.pin-toggle:hover { background: #eef2f6; color: #1a1a1a; }
.pin-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 26, 26, .25); }

.tr-lang { color: #666; font-weight: 400; }

.form-id { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; color: #666; font-size: 13px; }
.form-id strong { color: #1f2937; font-variant-numeric: tabular-nums; }

.gt-sites { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.gt-sites th { text-align: left; font-weight: 600; font-size: 13px; color: #666; padding: 4px 8px 6px 0; }
.gt-sites td { padding: 6px 8px 6px 0; vertical-align: middle; border-top: 1px solid #eee; }
.gt-sites th:nth-child(2), .gt-sites td:nth-child(2) { width: 90px; }
.gt-sites th:nth-child(3), .gt-sites td:nth-child(3) { width: 50%; }

/* Schede del form */
.form-tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid #dcdfe4; }
.form-tab {
    padding: 8px 16px; margin-bottom: -1px; border: 1px solid transparent; border-bottom: 0;
    border-radius: 6px 6px 0 0; background: transparent; color: #4b5563; font: inherit; cursor: pointer;
}
.form-tab:hover { background: #f3f5f7; }
.form-tab.active { background: #fff; color: #1a1a1a; font-weight: 600; border-color: #dcdfe4; border-bottom: 1px solid #fff; }
.form-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 26, 26, .25); }

/* Editor delle risposte */
.answers-head, .answer-row { display: flex; align-items: center; gap: 10px; }
.answers-head { font-size: 13px; color: #666; font-weight: 600; padding-bottom: 4px; }
.answer-row { padding: 4px 0; border-top: 1px solid #eee; }
.a-correct { width: 64px; text-align: center; flex: 0 0 auto; }
.a-correct input[type="radio"] { width: 18px; height: 18px; accent-color: #1a1a1a; cursor: pointer; }
.a-text { flex: 1 1 auto; min-width: 0; }
.a-active { width: 72px; flex: 0 0 auto; }
.a-actions { width: 34px; flex: 0 0 auto; display: flex; gap: 4px; justify-content: flex-end; }
.answer-btn { width: 30px; height: 30px; border: 1px solid #ccd1d9; border-radius: 6px; background: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.answer-btn:hover:not(:disabled) { background: #eef2f6; }
.answer-btn:disabled { opacity: .4; cursor: default; }
.answer-btn.danger { color: #d13438; }
.answers-add { margin: 8px 0 4px; }

/* Pulsanti azione nelle griglie: spaziatura uniforme (indipendente dagli spazi nel markup) */
.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Logo della company: pagine di accesso e barra superiore */
.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 24px;
}

.login-logo {
    display: block;
    max-width: 150px;
    max-height: 60px;
    object-fit: contain;
}

.login-brand {
    font-size: 20px;
    font-weight: 500;
    color: #4a4a4a;
}

.appbar-logo {
    max-height: 32px;
    max-width: 140px;
    margin-right: 8px;
    object-fit: contain;
}

/* Loader a tutta pagina (invio form di accesso) */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(255, 255, 255, .85);
}

.page-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #d9d9d9;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: page-loader-spin .8s linear infinite;
}

.page-loader-text {
    font-size: 15px;
    color: #4a4a4a;
}

@keyframes page-loader-spin {
    to { transform: rotate(360deg); }
}

/* Portineria e tablet */
.device-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: #1a1a1a;
    color: #fff;
}

.device-title {
    font-weight: 500;
    font-size: 1.15em;
}

.device-info {
    margin-left: auto;
    color: #d6d6d6;
}

.device-exit {
    padding: 6px 14px;
    border: 1px solid #8a8a8a;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
}

.device-exit:hover {
    background: #333;
}

.device-page {
    padding: 24px 20px;
}

.device-card {
    max-width: 640px;
    margin: 40px auto;
    padding: 32px;
    background: #fff;
    border: 1px solid #d9d6ce;
    border-radius: 12px;
}

/* Il logo sta su fondo chiaro nella barra scura di portineria e tablet */
.device-bar .appbar-logo {
    max-height: 36px;
    margin-right: 0;
    padding: 4px 10px;
    background: #fff;
    border-radius: 6px;
}

/* PIN a 6 caselle dentro i form di accesso (stili del form sovrascritti) */
.login-form .pin-input { gap: 6px; justify-content: center; margin-top: 4px; }
.login-form .pin-box { width: 40px; height: 50px; padding: 0; font-size: 24px; border: 1px solid #c9ced6; }
.login-form .pin-box.filled { border-color: #1a1a1a; }
.login-form .pin-toggle { width: 40px; height: 40px; margin: 0 0 0 2px; font-weight: 400; background: transparent; color: #4b5563; }
.login-form .pin-toggle:hover { background: #eef2f6; color: #1a1a1a; }

/* PinField: occhio mostra/nascondi */
.pin-eye-off { display: none; }
.pin-input.revealed .pin-eye { display: none; }
.pin-input.revealed .pin-eye-off { display: inline; }

/* ===== Tablet visitatori (GuestLayout / GuestHome): colore della sede in --sede ===== */
.g-shell {
    --sede: #1a1a1a;
    min-height: 100vh;
    /* il body ha height:100vh e flex: senza questo il guscio si restringe e lo sfondo finisce prima del contenuto */
    flex: none;
    display: flex;
    flex-direction: column;
    background: #f6f5f2;
    color: #1b1f23;
}

.g-header {
    min-height: 96px;
    flex: none;
    box-sizing: border-box;
    padding: 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--sede-ink, #fff);
    background: var(--sede);
}

.g-brand { display: flex; align-items: center; gap: 16px; }
.g-logo { max-height: 56px; max-width: 160px; object-fit: contain; padding: 6px 10px; background: #fff; border-radius: 8px; box-sizing: content-box; }
.g-site { font-size: 24px; font-weight: 700; }

.g-langs { display: flex; gap: 8px; }
.g-lang {
    min-width: 72px; height: 52px; font: inherit; font-size: 18px; font-weight: 700;
    color: var(--sede); background: #fff; border: 2px solid var(--sede); border-radius: 10px; cursor: pointer;
}
.g-langs .g-lang { color: var(--sede-ink, #fff); background: transparent; border-color: var(--sede-ink, #fff); }
.g-langs .g-lang.on { color: var(--sede); background: var(--sede-ink, #fff); }

.g-body { flex: 1; display: flex; flex-direction: column; }

.g-footer {
    height: 80px; flex: none; box-sizing: border-box; padding: 0 56px;
    display: flex; align-items: center; justify-content: flex-end;
}
.g-footer a { min-height: 44px; display: flex; align-items: center; font-size: 18px; font-weight: 500; color: #4a5057; }

.g-note { text-align: center; color: #4a5057; font-size: 18px; margin: 24px; }

/* Avanzamento */
.g-steps { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 28px 56px 0; }
.g-step { display: flex; align-items: center; gap: 10px; color: #6b7178; }
.g-step-dot {
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; border: 2px solid #b9bcc0; background: #fff;
}
.g-step-label { font-size: 17px; font-weight: 600; }
.g-step.active { color: #1b1f23; }
.g-step.active .g-step-dot { background: var(--sede); border-color: var(--sede); color: var(--sede-ink, #fff); }
.g-step.done .g-step-dot { background: #fff; border-color: var(--sede); color: var(--sede); }
.g-step-line { width: 48px; height: 2px; background: #cfd2d6; }
.g-step-line.done { background: var(--sede); }

.g-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 24px 56px 40px; }

/* Home */
.g-home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px; width: 100%; }
.g-title { margin: 0; font-size: 56px; line-height: 1.05; font-weight: 700; }
.g-tiles { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.g-tile {
    width: 420px; height: 260px; box-sizing: border-box; padding: 32px; display: flex; flex-direction: column;
    justify-content: space-between; align-items: flex-start; text-align: left; font: inherit; cursor: pointer;
    border-radius: 16px; border: 2px solid var(--sede);
}
.g-tile.primary { color: var(--sede-ink, #fff); background: var(--sede); }
.g-tile.outline { color: var(--sede); background: #fff; }
.g-tile-text { display: flex; flex-direction: column; gap: 6px; }
.g-tile-title { font-size: 36px; font-weight: 700; letter-spacing: .01em; }
.g-tile-sub { font-size: 19px; font-weight: 500; }

/* Pannelli e form */
.g-panel { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.g-back {
    align-self: flex-start; min-height: 44px; padding: 0; font: inherit; font-size: 18px; font-weight: 500;
    color: #4a5057; background: none; border: 0; cursor: pointer;
}
.g-form { display: flex; flex-direction: column; gap: 24px; }
.g-h1 { margin: 0 0 8px; font-size: 40px; line-height: 1.1; font-weight: 700; }
.g-lead { margin: 0; font-size: 20px; line-height: 1.4; color: #4a5057; }
.g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g-wide { grid-column: 1 / -1; }
.g-field { display: flex; flex-direction: column; gap: 8px; }
.g-field label { font-size: 18px; font-weight: 600; }
.g-opt { font-weight: 400; color: #6b7178; }
.g-field input {
    height: 60px; box-sizing: border-box; padding: 0 16px; font: inherit; font-size: 22px;
    border: 2px solid #8a9096; border-radius: 10px; background: #fff;
}
.g-field input:focus { outline: none; border-color: var(--sede); box-shadow: 0 0 0 3px rgba(0, 0, 0, .15); }
.g-field input[readonly] { background: #ecebe7; color: #4a5057; }

.g-radios { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.g-radios legend { font-size: 18px; font-weight: 600; margin-bottom: 12px; padding: 0; }
.g-radio {
    display: flex; align-items: center; gap: 16px; min-height: 64px; box-sizing: border-box; padding: 0 20px;
    font-size: 22px; font-weight: 600; background: #fff; border: 2px solid #b9bcc0; border-radius: 12px; cursor: pointer;
}
.g-radio:has(input:checked) { border-color: var(--sede); }
.g-radio input { width: 26px; height: 26px; accent-color: var(--sede); }
.g-badge { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--sede); }

.g-privacy { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.g-check-locked { opacity: .55; cursor: not-allowed; }
.g-check-locked input { cursor: not-allowed; }
.g-privacy-hint { margin: 0; }
.g-check { display: flex; align-items: flex-start; gap: 14px; font-size: 18px; line-height: 1.35; }
.g-check input { width: 28px; height: 28px; flex: none; accent-color: var(--sede); }
.g-link { min-height: 44px; padding: 0; font: inherit; font-size: 18px; font-weight: 600; color: var(--sede); background: none; border: 0; text-decoration: underline; cursor: pointer; }

.g-error { padding: 14px 18px; font-size: 19px; color: #8a1f17; background: #fdecea; border: 1.5px solid #d93025; border-radius: 10px; }

.g-actions { display: flex; flex-direction: column; gap: 12px; }
.g-btn {
    height: 68px; font: inherit; font-size: 22px; font-weight: 700; border-radius: 12px; border: 2px solid var(--sede); cursor: pointer;
}
.g-btn.primary { color: var(--sede-ink, #fff); background: var(--sede); }
.g-btn.outline { color: var(--sede); background: #fff; }
.g-btn:disabled { opacity: .6; cursor: default; }

/* Esito */
.g-result { gap: 28px; }
.g-status { display: flex; align-items: center; gap: 24px; padding: 28px 32px; border-radius: 16px; }
.g-status.ok { color: #14532d; background: #e6f4ea; border: 2px solid #1f7a3d; }
.g-status-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: #1f7a3d; flex: none; }
.g-status-text { display: flex; flex-direction: column; gap: 4px; }
.g-status-title { font-size: 40px; font-weight: 700; letter-spacing: .02em; }
.g-status-sub { font-size: 20px; font-weight: 500; }
.g-dl { display: grid; grid-template-columns: 200px 1fr; gap: 12px 24px; margin: 0; font-size: 22px; }
.g-dl dt { color: #6b7178; font-weight: 500; }
.g-dl dd { margin: 0; font-weight: 700; }
.g-chip { margin: 0; padding: 14px 18px; font-size: 20px; font-weight: 600; background: #fff; border: 2px solid #b9bcc0; border-radius: 10px; }

/* Link "Esci dalla modalità accoglienza": ora e' un pulsante (chiede il PIN portineria) */
.g-footer-link {
    min-height: 44px; padding: 0; font: inherit; font-size: 18px; font-weight: 500;
    color: #4a5057; background: none; border: 0; cursor: pointer;
}
.g-exit-label { display: block; margin: 12px 0 8px; font-weight: 600; }

/* Pagina portineria */
.rd-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.rd-head h1 { margin: 0; font-size: 28px; }
.rd-sub { color: #6b7178; font-size: 14px; }
.rd-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.rd-message { margin: 8px 0; padding: 10px 14px; color: #14532d; background: #e6f4ea; border: 1px solid #1f7a3d; border-radius: 8px; }
.rd-refresh-info { margin-left: auto; padding-bottom: 8px; }

/* Video e test */
.g-video-panel { max-width: 960px; }
.g-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.g-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.g-progress { margin: 0; font-size: 18px; font-weight: 600; color: #4a5057; }
.g-bar { height: 8px; background: #d9dbde; border-radius: 4px; overflow: hidden; }
.g-bar span { display: block; height: 100%; background: var(--sede); }
.g-question { font-size: 32px; }
.g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.g-status.fail { color: #8a1f17; background: #fdecea; border: 2px solid #d93025; }
.g-status.fail .g-status-icon { background: #d93025; }
.g-note-quiz { border-color: var(--sede); }
.device-nav { display: flex; gap: 8px; margin-left: 24px; }
.device-nav a { padding: 6px 14px; color: #fff; text-decoration: none; border-radius: 6px; opacity: .8; }
.device-nav a:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.device-nav a.active { opacity: 1; background: rgba(255, 255, 255, .22); font-weight: 600; }
.rd-page { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.rd-page .rd-grid { flex: 1 1 auto; min-height: 320px; height: auto; }
.rd-page > * { flex-shrink: 0; }
.rd-page > .rd-grid, .rd-page > .fill-grid { flex: 1 1 auto; flex-shrink: 1; min-height: 320px; height: auto; }
.rd-filters { flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.rd-filter { display: flex; flex-direction: column; gap: 4px; }
.rd-filter label { font-size: 13px; color: #6b7178; }
/* Accessi: schede, ricerca, testo e pulsante sulla stessa linea centrale */
.rd-toolbar:not(.rd-filters) { align-items: center; }
.rd-toolbar:not(.rd-filters) .rd-refresh-info { padding-bottom: 0; }
.rd-toolbar:not(.rd-filters) .rd-filter { margin-left: 16px; }
.rd-tabsearch { padding: 10px 0; }
.rd-toolbar:not(.rd-filters) .rd-filter { margin-left: 0; }
.drawer-item-tip { display: inline-flex; align-items: center; gap: 8px; }

/* Intestazione di tutte le griglie: grigio chiaro, testo scuro */
.k-grid .k-grid-header,
.k-grid .k-grid-header .k-table-th,
.k-grid .k-grid-header .k-table-th.k-sorted,
.k-grid .k-grid-header .k-table-th:hover {
    background-color: #e9ebee;
    color: #1b1f23;
    border-color: #d3d7dc;
}
.k-grid .k-grid-header .k-column-title,
.k-grid .k-grid-header .k-link,
.k-grid .k-grid-header a,
.k-grid .k-grid-header .k-sort-icon,
.k-grid .k-grid-header .k-svg-icon,
.k-grid .k-grid-header .k-icon {
    color: #1b1f23;
}
.k-grid .k-grid-header .k-grid-header-menu:hover,
.k-grid .k-grid-header .k-header-column-menu:hover {
    background-color: rgba(0, 0, 0, .08);
}

/* Riconnessione del circuito Blazor (stati impostati da Blazor sull'elemento) */
#components-reconnect-modal {
    display: none; position: fixed; inset: 0; z-index: 100000;
    align-items: center; justify-content: center; background: rgba(0, 0, 0, .6);
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: flex; }
#components-reconnect-modal .rc-box {
    max-width: 440px; padding: 28px 32px; text-align: center; color: #1b1f23; background: #fff; border-radius: 12px;
}
#components-reconnect-modal .rc-state { display: none; flex-direction: column; gap: 10px; }
#components-reconnect-modal .rc-state strong { font-size: 22px; }
#components-reconnect-modal.components-reconnect-show .rc-show,
#components-reconnect-modal.components-reconnect-failed .rc-failed,
#components-reconnect-modal.components-reconnect-rejected .rc-rejected { display: flex; }
#components-reconnect-modal button {
    align-self: center; padding: 10px 22px; font: inherit; font-weight: 600; color: #fff; background: #1a1a1a;
    border: 0; border-radius: 8px; cursor: pointer;
}

/* Home: elenco degli accessi */
.home-card { max-width: 440px; }
.home-links { display: flex; flex-direction: column; gap: 12px; }
.home-link {
    display: block; padding: 14px 18px; font-weight: 600; color: #fff; text-align: center;
    text-decoration: none; background: #1a1a1a; border-radius: 8px;
}
.home-link:hover { background: #333; }
.home-card a.home-link,
.home-card a.home-link:visited,
.home-card a.home-link:hover,
.home-card a.home-link:focus { color: #fff; text-decoration: none; }
.home-card a.home-link:hover { background: #3a3a3a; }
.login-link + .login-link { margin-left: 20px; }

/* Messaggio d'errore dentro le finestre di dialogo del tablet: distanziato da PIN e pulsanti */
.k-dialog-content .g-error { margin: 20px 0 12px; }

.rd-qa { max-height: 60vh; overflow: auto; }
.rd-q { margin-bottom: 16px; }
.rd-q-text { font-weight: 600; margin-bottom: 4px; }
.rd-q ul { margin: 0; padding-left: 20px; }
.rd-q li { padding: 2px 0; }
.rd-q li.rd-chosen { background: #eef3ff; border-radius: 4px; }
.rd-ok { color: #1f7a3d; font-weight: 600; font-size: 13px; }
.rd-ko { color: #b42318; font-weight: 600; font-size: 13px; }

/* Avviso di inattivita' sul tablet: finestra grande con conto alla rovescia (non e' una finestra Telerik) */
.g-idle-overlay { position: fixed; inset: 0; z-index: 20000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); }
.g-idle-box { width: min(560px, 100%); box-sizing: border-box; background: #fff; border: 4px solid #f59e0b; border-radius: 16px; overflow: hidden; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); padding-bottom: 28px; }
.g-idle-title { margin: 0; padding: 16px; background: #f59e0b; color: #1f1300; font-size: 28px; font-weight: 700; }
.g-idle-body { padding: 24px 24px 8px; }
.g-idle-count { margin: 0 auto 16px; width: 140px; height: 140px; line-height: 128px; border-radius: 50%; font-size: 72px; font-weight: 800; font-variant-numeric: tabular-nums; color: #1f1300; background: #fde68a; border: 6px solid #f59e0b; }
.g-idle-bar { height: 12px; margin: 0 auto 16px; max-width: 420px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.g-idle-bar > span { display: block; height: 100%; background: #f59e0b; transition: width 1s linear; }
.g-idle-text { margin: 0; font-size: 20px; min-height: 2.8em; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.g-idle-btn { margin-top: 16px; min-width: 260px; font-size: 22px; }

/* Conferma "Rivedi il video": stesso riquadro grande dell'avviso di inattivita' */
.g-warn-mark { line-height: 124px; }
.g-confirm-text { margin: 0; font-size: 24px; line-height: 1.4; font-weight: 600; }
.g-confirm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 16px 24px 0; }
.g-confirm-actions .g-idle-btn { margin-top: 0; min-width: 220px; }

/* Video: pulsante disattivato finche' il video non sta per finire */
.g-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.g-video-wait { margin: 12px 0 0; }

/* Voce del menu laterale con tooltip anche quando e' compresso */
.drawer-item-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 100%;
}

.rd-btn-group { display: flex; gap: 4px; }

/* Parametri della company */
.param-list { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 16px; max-width: 900px; }
.param-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
.param-text { display: flex; flex-direction: column; gap: 2px; }
.param-value { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* Finestra di errore dell'applicazione (HTML semplice) */
.app-error-overlay { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.5); }
.app-error-box { background: #fff; color: #212529; border-radius: 6px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35); width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; padding: 20px 24px; }
.app-error-box h2 { margin: 0 0 12px; font-size: 20px; }
.app-error-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.drawer-fa { width: 16px; text-align: center; font-size: 16px; line-height: 1; }
.site-swatch-label { margin-left: 8px; vertical-align: middle; }

/* ===== Griglie Telerik: aspetto moderno (tutte le .k-grid) ===== */
.k-grid {
    border: 1px solid #c3c8cf;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    font-size: 14px;
}
.k-grid .k-grid-header .k-table-th {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    padding-block: 12px;
    border-left-width: 0;
    border-right-width: 0;
}
.k-grid td,
.k-grid .k-table-td {
    padding-block: 11px;
    padding-inline: 12px;
    border-left-width: 0;
    border-right-width: 0;
    border-color: #eceef1;
    vertical-align: middle;
}
.k-grid .k-table-row.k-table-alt-row { background-color: #fafbfc; }
.k-grid .k-table-row:hover { background-color: #f0f3f7; }
.k-grid .k-table-row.k-selected,
.k-grid .k-table-row.k-selected:hover { background-color: #e4e9f0; }
.k-grid .k-grid-pager {
    background-color: #fff;
    border-top: 1px solid #e3e6ea;
    padding-block: 8px;
}
.k-grid .k-grid-norecords { color: #6b7280; padding: 24px; }


/* ===== Home vetrina ===== */
.sc-wrap { width: 100%; max-width: 1080px; box-sizing: border-box; padding: 40px 20px 56px; color: #1a1a1a; }
.sc-hero { max-width: 760px; }
.sc-eyebrow { display: inline-block; margin-bottom: 12px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: #6b665c; }
.sc-hero h1 { margin: 0 0 16px; font-size: 48px; line-height: 1.05; }
.sc-lead { margin: 0 0 12px; font-size: 20px; line-height: 1.45; }
.sc-sub { margin: 0; font-size: 16px; line-height: 1.55; color: #55514a; }
.sc-wrap .home-card { max-width: 520px; margin: 0 auto; }
.sc-access { text-align: center; }
.sc-cta { display: inline-block; border: 0; font-size: 16px; font-family: inherit; cursor: pointer; margin-top: 24px; padding: 12px 22px; font-weight: 600; color: #fff; text-decoration: none; background: #1a1a1a; border-radius: 8px; }
.sc-cta:hover, .sc-cta:focus { color: #fff; text-decoration: none; background: #333; }
.sc-access { scroll-margin-top: 24px; }
.sc-box-title { margin: 0 0 16px; font-size: 20px; }
.sc-section { margin-top: 56px; }
.sc-section h2 { margin: 0 0 20px; font-size: 28px; }
.sc-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.sc-steps li { padding: 20px; background: #fff; border: 1px solid #d9d6ce; border-radius: 12px; }
.sc-step-num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: 12px; font-weight: 700; color: #fff; background: #1a1a1a; border-radius: 50%; }
.sc-steps h3, .sc-card h3 { margin: 0 0 8px; font-size: 18px; }
.sc-steps p, .sc-card p { margin: 0; font-size: 15px; line-height: 1.5; color: #55514a; }
.sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sc-grid-4 { grid-template-columns: repeat(4, 1fr); }
.sc-card { padding: 22px; background: #fff; border: 1px solid #d9d6ce; border-radius: 12px; }
.sc-card-plain { background: transparent; }
.sc-icon { display: block; margin-bottom: 12px; font-size: 24px; color: #1a1a1a; }
.sc-privacy { display: flex; align-items: center; gap: 16px; padding: 20px 24px; background: #fff; border: 1px solid #d9d6ce; border-radius: 12px; }
.sc-privacy .sc-icon { margin: 0; font-size: 28px; }
.sc-privacy p { margin: 0; font-size: 15px; line-height: 1.5; color: #55514a; }
@media (max-width: 900px) {
    .sc-hero h1 { font-size: 38px; }
    .sc-steps, .sc-grid, .sc-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .sc-steps, .sc-grid, .sc-grid-4 { grid-template-columns: 1fr; }
}

/* <main> e' una colonna: la vetrina e' piu' alta dello schermo, quindi parte dall'alto e scorre (centrata, la cima verrebbe tagliata) */
.static-page:has(.sc-wrap) { justify-content: flex-start; }

/* Home: box accessi con ruolo e codice */
.ha-form { display: flex; flex-direction: column; gap: 12px; }
.ha-label { margin-top: 4px; font-weight: 600; }
.ha-input { box-sizing: border-box; width: 100%; padding: 12px 14px; font-size: 16px; border: 2px solid #b9b5ab; border-radius: 8px; }
.ha-input:focus { outline: none; border-color: #1a1a1a; }
.ha-submit { border: 0; font-size: 16px; cursor: pointer; }
.ha-hint { font-size: 13px; line-height: 1.4; color: #6b665c; }
.ha-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* Home: box accessi in finestra modale (<dialog>) */
.ha-dialog { width: calc(100% - 32px); max-width: 480px; padding: 0; border: 0; background: transparent; }
.ha-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.ha-dialog .home-card { position: relative; max-width: none; margin: 0; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.ha-close { position: absolute; top: 10px; right: 14px; width: 36px; height: 36px; font-size: 28px; line-height: 1; color: #55514a; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.ha-close:hover { background: #ececec; }

/* Titoli dei blocchi (FormGroup) negli edit form in grassetto */
.k-form-fieldset > .k-form-legend,
.k-form-fieldset > legend { font-weight: 580; }

/* Form con schede: niente riga extra sotto le schede, blocchi distanziati */
.form-tabs + .k-form .k-form-fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.form-tabs + .k-form .k-form-fieldset:last-child { margin-bottom: 0; }
.form-tabs + .k-form .k-form-fieldset > .k-form-legend,
.form-tabs + .k-form .k-form-fieldset > legend { margin: 0 0 10px; padding: 0; border: 0; }
.form-tabs + .k-form .k-form-fieldset > .k-form-legend:empty,
.form-tabs + .k-form .k-form-fieldset > legend:empty { display: none; }
.form-tabs + .k-form .k-form-hint { display: block; margin: 4px 0 0; }
.form-tabs + .k-form .answers-head + .answer-row { border-top: 0; }

/* Dashboard home admin */
.dash-head { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; }
.dash-head h2 { margin: 0; }
.dash-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 640px) { .dash-cards { grid-template-columns: 1fr; } }
.dash-card { border: 1px solid #dcdfe4; border-radius: 8px; padding: 14px 16px; background: #fff; }
.dash-num { font-size: 34px; font-weight: 600; line-height: 1.1; }
.dash-label { margin-top: 4px; font-weight: 600; }
.dash-sub { margin-top: 4px; font-size: 13px; color: #666; }
.dash-long { color: #b42318; font-weight: 600; }
.dash-sites { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid #eee; font-size: 14px; }
.dash-sites li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.dash-present { background: #e8f5ec; border-color: #c3e3cd; }
.dash-entries { background: #e8f0fb; border-color: #c4d7f2; }
.dash-waiting { background: #fbf6d9; border-color: #ebe0a3; }
.dash-filling { background: #fdebdc; border-color: #f5cfaa; }
.dash-present .dash-sites { border-top-color: #c3e3cd; }
.dash-entries .dash-sites { border-top-color: #c4d7f2; }
.dash-waiting .dash-sites { border-top-color: #ebe0a3; }
.dash-filling .dash-sites { border-top-color: #f5cfaa; }
.dash-present .dash-num { color: #1e6b3a; }
.dash-entries .dash-num { color: #1f4f9a; }
.dash-waiting .dash-num { color: #7a6a0a; }
.dash-filling .dash-num { color: #b25a0a; }

/* Home amministratore di sistema */
.sys-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
.sys-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid #dcdfe4; border-radius: 8px; background: #fff; color: #1a1a1a; text-decoration: none; }
.sys-card:hover { background: #f3f5f7; border-color: #c3c8cf; }
.sys-card strong { font-size: 16px; }
.sys-card strong:has(.sys-card-icon) { display: flex; align-items: center; gap: 10px; }
.sys-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto; font-size: 15px; color: #8a6400; background: rgba(245, 179, 1, .16); border-radius: 9px; }
html[data-theme="dark"] .sys-card-icon { color: #f5b301; background: rgba(245, 179, 1, .14); }
.sys-card span { font-size: 14px; color: #555; line-height: 1.4; }
.rd-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.rd-legend-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid transparent; border-left-width: 4px; border-radius: 8px; font-size: 13px; line-height: 1.4; color: #4b5563; }
.rd-legend-item strong { font-size: 14px; font-weight: 600; }
.rd-l-waiting { background: #fbf6d9; border-color: #ebe0a3; border-left-color: #c9b21f; }
.rd-l-waiting strong { color: #7a6a0a; }
.rd-l-filling { background: #fdebdc; border-color: #f5cfaa; border-left-color: #e8873a; }
.rd-l-filling strong { color: #b25a0a; }
.rd-l-present { background: #e8f5ec; border-color: #c3e3cd; border-left-color: #3d9a5f; }
.rd-l-present strong { color: #1e6b3a; }
@media (max-width: 800px) { .rd-legend { grid-template-columns: 1fr; } }

/* Intestazioni di pagina (amministrazione e portineria): titolo con barra d'accento */
.mainlayout-drawer main > h1,
.rd-head h1 {
    position: relative;
    margin: 4px 0 18px;
    padding-bottom: 12px;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: #1a1a1a;
}
.mainlayout-drawer main > h1::after,
.rd-head h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 250px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #1a1a1a 0%, #c3c8cf 100%);
}
.rd-head { align-items: flex-end; margin-bottom: 4px; }
.rd-head .rd-sub { padding-bottom: 14px; }

/* Barra superiore: area utente */
.appbar-user { display: flex; align-items: center; gap: 10px; margin-right: 12px; padding-right: 16px; border-right: 1px solid #d9dde2; }
.appbar-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #5b616b 100%); color: #fff;
    font-size: 14px; font-weight: 600; letter-spacing: .02em;
}
.appbar-user-text { display: flex; flex-direction: column; line-height: 1.25; }
.appbar-user-name { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.appbar-last { font-size: 12px; color: #6b7280; }
.appbar-actions { display: flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .appbar-last { display: none; } .appbar-user { padding-right: 8px; margin-right: 4px; } }

/* Menu laterale: sfondo grigio chiaro */
.mainlayout-drawer > .k-drawer,
.mainlayout-drawer > .k-drawer .k-drawer-wrapper,
.mainlayout-drawer > .k-drawer .k-drawer-items {
    background-color: #f1f3f5;
}
.mainlayout-drawer > .k-drawer { border-right: 1px solid #dfe3e8; }
.mainlayout-drawer .k-drawer-item:hover { background-color: #e6e9ed; }
.mainlayout-drawer .k-drawer-item.k-selected,
.mainlayout-drawer .k-drawer-item.k-selected:hover { background-color: #dde1e6; color: #1a1a1a; }

/* ===== Finestre di modifica: aspetto curato ===== */
.k-window.company-window {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(16, 24, 40, .28);
}
.company-window .k-window-titlebar {
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}
.company-window .k-window-title { font-size: 18px; font-weight: 600; color: #1a1a1a; letter-spacing: -.005em; }
.company-window .k-window-titlebar .k-button { border-radius: 8px; }
.company-window .k-window-content { padding: 20px 28px 0; background: #fff; }

/* Azienda / Sede in testa: etichetta discreta */
.company-window .form-company {
    padding: 10px 14px;
    background: #f4f6f8;
    border: 1px solid #e5e8ec;
    border-left: 4px solid #1a1a1a;
    border-radius: 8px;
}

/* Titoli dei blocchi: barra d'accento a sinistra, niente riga sotto */
.company-window .k-form-fieldset { margin-bottom: 8px; }
.company-window .k-form-fieldset > .k-form-legend,
.company-window .k-form-fieldset > legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    padding: 0;
    border: 0;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    color: #374151;
}
.company-window .k-form-fieldset > .k-form-legend::before,
.company-window .k-form-fieldset > legend::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, #1a1a1a 0%, #8b919a 100%);
}
.company-window .k-form-fieldset > .k-form-legend::after,
.company-window .k-form-fieldset > legend::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #e5e7eb;
}

/* Campi: angoli arrotondati e anello di focus scuro */
.company-window .k-form-label,
.company-window .k-label { font-size: 14px; font-weight: 500; color: #374151; }
.company-window .k-input,
.company-window .k-textbox,
.company-window .k-textarea,
.company-window .k-picker { border-radius: 8px; border-color: #d4d8de; }
.company-window .k-input:focus-within,
.company-window .k-textbox:focus-within,
.company-window .k-textarea:focus-within,
.company-window .k-picker:focus-within { border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26, 26, 26, .12); }
.company-window .k-form-hint { color: #6b7280; font-style: normal; }

/* Pulsanti in fondo: barra chiara con ombra leggera */
.company-window .k-form-buttons {
    gap: 10px;
    padding: 14px 0;
    margin: 0 -28px !important;
    padding-inline: 28px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}
.company-window .k-form-buttons .k-button { min-width: 96px; border-radius: 8px; font-weight: 600; }

/* Barra del titolo delle finestre di modifica: grigio scuro, testo bianco */
.company-window .k-window-titlebar {
    background: #2b2f36;
    border-bottom: 0;
    color: #fff;
}
.company-window .k-window-title { color: #fff; }
.company-window .k-window-titlebar .k-button,
.company-window .k-window-titlebar .k-svg-icon,
.company-window .k-window-titlebar .k-icon { color: #fff; }
.company-window .k-window-titlebar .k-button:hover { background: rgba(255, 255, 255, .14); }

/* Nota "Campo obbligatorio": icona in un cerchio rosso tenue */
.form-required-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; color: #6b7280; }
.required-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fdecea; color: #d13438; font-size: 9px;
}

/* Riga Id + nota "Campo obbligatorio": nota allineata a destra */
.form-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.form-meta .form-id, .form-meta .form-required-note { margin: 0; }
.form-meta .form-required-note { margin-left: auto; }

/* Asterisco dei campi obbligatori: cerchietto rosso tenue, staccato dall'etichetta */
.k-form-label .k-required,
.k-form-label.required::after {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border-radius: 50%;
    background: #fdecea;
    color: #d13438;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.k-form-label.required::after { content: "*"; padding-top: 3px; box-sizing: border-box; }
.k-form-label .k-required { padding-top: 3px; box-sizing: border-box; }

/* Cerchietto dei campi obbligatori: rosso pieno, asterisco bianco */
.k-form-label .k-required,
.k-form-label.required::after {
    background: #d13438;
    color: #fff;
}
.required-icon { background: #d13438; color: #fff; }

/* Cerchietto obbligatorio: asterisco disegnato (SVG), perfettamente centrato e piu' grande */
.k-form-label .k-required,
.k-form-label.required::after {
    width: 18px;
    height: 18px;
    margin-left: 10px;
    padding: 0;
    font-size: 0;
    background-color: #d13438;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cg stroke='white' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 1.2v9.6M1.8 3.6l8.4 4.8M1.8 8.4l8.4-4.8'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 11px;
}
.k-form-label.required::after { content: ""; }

/* Nota accanto ai pulsanti Salva/Annulla */
.company-window .k-form-buttons { align-items: center; }
.form-buttons-note { max-width: 380px; margin-right: 6px; font-size: 12px; line-height: 1.35; text-align: right; color: #6b7280; }
.form-buttons-note i { margin-right: 4px; color: #8b919a; }

/* La nota sta su una riga propria sopra i pulsanti */
.company-window .k-form-buttons { flex-wrap: wrap; }
.form-buttons-note { flex: 1 0 100%; max-width: none; margin: 0 0 4px; text-align: right; }

/* Cerchietti dei campi: stessa misura di quello nella nota "Campo obbligatorio" */
.k-form-label .k-required,
.k-form-label.required::after {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-size: 10px 10px;
}

/* Stesso cerchietto ovunque (etichette e nota "Campo obbligatorio"): stessa misura e stesso asterisco */
.required-icon,
.k-form-label .k-required,
.k-form-label.required::after {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    background-color: #d13438;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cg stroke='white' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 1.2v9.6M1.8 3.6l8.4 4.8M1.8 8.4l8.4-4.8'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px 9px;
}
.required-icon::before { content: none; }

/* ===== Dettaglio del test (finestra con domande e risposte) ===== */
.k-dialog.rd-detail-dialog {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(16, 24, 40, .28);
}
.rd-detail-dialog .k-window-titlebar { padding: 14px 24px; background: #2b2f36; border-bottom: 0; color: #fff; }
.rd-detail-dialog .k-window-title { font-size: 18px; font-weight: 600; color: #fff; }
.rd-detail-dialog .k-window-titlebar .k-button,
.rd-detail-dialog .k-window-titlebar .k-svg-icon { color: #fff; }
.rd-detail-dialog .k-window-titlebar .k-button:hover { background: rgba(255, 255, 255, .14); }
.rd-detail-dialog .k-window-content { padding: 20px 24px; background: #fff; }
.rd-detail-dialog .k-dialog-buttons { padding: 12px 24px; background: #f8f9fa; border-top: 1px solid #e5e7eb; }

.rd-survey-name { margin: 0 0 10px; font-size: 20px; font-weight: 600; color: #1a1a1a; letter-spacing: -.005em; }

/* Riepilogo esito */
.rd-summary {
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}
.rd-summary.rd-pass { background: #e8f5ec; border-color: #c3e3cd; border-left-color: #3d9a5f; }
.rd-summary.rd-fail { background: #fdecea; border-color: #f5c6c2; border-left-color: #d13438; }

/* Domande come schede */
.rd-qa { max-height: 56vh; padding-right: 4px; }
.rd-detail-dialog .rd-q {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}
.rd-detail-dialog .rd-q-text { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 15px; font-weight: 600; color: #1a1a1a; }
.rd-detail-dialog .rd-q-text .rd-ok,
.rd-detail-dialog .rd-q-text .rd-ko {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.rd-detail-dialog .rd-q-text .rd-ok { background: #e8f5ec; color: #1e6b3a; }
.rd-detail-dialog .rd-q-text .rd-ko { background: #fdecea; color: #b42318; }

/* Risposte: righe senza elenco puntato */
.rd-detail-dialog .rd-q ul { margin: 0; padding: 0; list-style: none; }
.rd-detail-dialog .rd-q li {
    margin: 0 0 4px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #374151;
}
.rd-detail-dialog .rd-q li:last-child { margin-bottom: 0; }
.rd-detail-dialog .rd-q li.rd-chosen { background: #eef3ff; border-color: #cddcfb; }
.rd-detail-dialog .rd-q li.rd-correct { background: #e8f5ec; border-color: #c3e3cd; }
.rd-detail-dialog .rd-q li.rd-chosen:not(.rd-correct) { background: #fdecea; border-color: #f5c6c2; }
.rd-detail-dialog .rd-q li .rd-ok { font-size: 12px; font-weight: 600; color: #1e6b3a; }
.rd-detail-dialog .rd-q li .rd-sub { font-size: 12px; color: #6b7280; }

/* Pagina Parametri */
.param-intro { display:flex; align-items:center; gap:8px; margin:0 0 14px; padding:10px 14px; background:#eef3ff; border-left:4px solid #0d6efd; border-radius:8px; color:#334155; max-width:900px; }
.param-intro i { color:#0d6efd; }
.param-list { gap:0; max-width:900px; background:#fff; border:1px solid #c3c8cf; border-radius:12px; overflow:hidden; box-shadow:0 1px 3px rgba(16,24,40,.06); }
.param-row { padding:14px 18px; border-bottom:1px solid #eceef1; transition:background .15s; }
.param-row:last-child { border-bottom:0; }
.param-row:hover { background:#f8f9fb; }
.param-key { font-family:Consolas,"Cascadia Mono",monospace; font-size:13px; font-weight:600; color:#2b2f36; background:#eef0f3; border-radius:6px; padding:2px 8px; align-self:flex-start; }
.param-desc { font-size:13px; color:#5b6470; line-height:1.4; margin-top:4px; white-space: pre-line; }
/* Descrizione dei parametri: gli a capo (es. prima di TRUE) restano visibili */
.param-desc-cell { white-space: pre-line; }
.param-default { font-size:12px; color:#6b7280; }
.param-default b { color:#2b2f36; font-weight:600; }
.param-actions { max-width:900px; margin-top:16px; }

/* Finestra PIN "Esci dalla modalita' accoglienza" - stile tablet */
.k-dialog.g-exit-dialog { border:0; border-radius:24px; overflow:hidden; box-shadow:0 24px 70px rgba(16,24,40,.35); }
.g-exit-dialog .k-window-titlebar { padding:20px 28px; background:#2b2f36; color:#fff; border-bottom:0; }
.g-exit-dialog .k-window-title { font-size:22px; font-weight:600; }
.g-exit-dialog .k-window-titlebar .k-button { color:#fff; width:44px; height:44px; border-radius:12px; }
.g-exit-dialog .k-window-content, .g-exit-dialog .k-dialog-content { padding:28px 32px 12px; text-align:center; }
.g-exit-dialog .k-dialog-content p { font-size:18px; line-height:1.5; color:#4b5563; margin:0 0 20px; }
.g-exit-dialog .g-exit-label { display:block; margin-bottom:14px; font-size:15px; font-weight:600; letter-spacing:.02em; color:#2b2f36; }
.g-exit-dialog .pin-input { gap:12px; justify-content:center; }
.g-exit-dialog .pin-box { width:64px; height:78px; font-size:34px; border:2px solid #c9ced6; border-radius:16px; }
.g-exit-dialog .pin-toggle { width:56px; height:56px; border-radius:16px; }
.g-exit-dialog .pin-toggle svg { width:28px; height:28px; }
.g-exit-dialog .g-error { color:#d13438; font-weight:600; margin-top:14px; }
.g-exit-dialog .k-dialog-actions { display:flex; gap:16px; padding:20px 32px 28px; border:0; background:#fff; }
.g-exit-dialog .k-dialog-actions .k-button { flex:1; min-height:60px; font-size:20px; font-weight:600; border-radius:16px; }
.g-exit-dialog .k-dialog-actions .k-button-solid-primary { background:#2b2f36; border-color:#2b2f36; color:#fff; }

/* Finestra informativa privacy - stile tablet (base: g-exit-dialog) */
.g-privacy-dialog .k-dialog-content { text-align:left; padding:28px 36px 12px; max-height:60vh; overflow:auto; }
.g-privacy-dialog .k-dialog-content p { font-size:19px; line-height:1.6; color:#374151; margin:0 0 16px; }
.g-privacy-dialog .k-dialog-actions { justify-content:center; }
.g-privacy-dialog .k-dialog-actions .k-button { flex:0 1 280px; }

/* Finestra PIN: contenuto allineato a sinistra */
.g-exit-dialog:not(.g-privacy-dialog) .k-dialog-content { text-align:left; }
.g-exit-dialog:not(.g-privacy-dialog) .pin-input { justify-content:flex-start; }

/* Finestra PIN: spazio attorno al messaggio d'errore */
.g-exit-dialog .g-error { margin:22px 0 16px; padding:14px 18px; text-align:left; }
.g-exit-dialog .k-dialog-content p.g-error { margin:24px 0 16px !important; padding:14px 18px; text-align:left; }

/* Attivazione dispositivo - stile tablet */
.login-card.device-login { max-width: 560px; padding: 44px 48px; border: 0; border-radius: 24px; box-shadow: 0 24px 70px rgba(16,24,40,.16); }
.device-login .login-header { margin-bottom: 28px; }
.device-login .login-logo { max-height: 72px; max-width: 180px; }
.device-login .login-brand { font-size: 24px; }
.device-login h1 { margin: 0 0 28px; padding-bottom: 18px; font-size: 32px; font-weight: 600; border-bottom: 1px solid #e5e7eb; }
.device-login .login-form { gap: 10px; }
.device-login .login-form label { margin-top: 14px; font-size: 16px; font-weight: 600; color: #2b2f36; }
.device-login .login-form input[type=text], .device-login .login-form input:not(.pin-box) { height: 64px; padding: 0 20px; font-size: 22px; border: 2px solid #c9ced6; border-radius: 16px; }
.device-login .login-form input:not(.pin-box):focus { outline: none; border-color: #2b2f36; box-shadow: 0 0 0 4px rgba(43,47,54,.15); }
.device-login .login-form .pin-input { justify-content: flex-start; gap: 12px; margin-top: 4px; }
.device-login .login-form .pin-box { width: 64px; height: 78px; font-size: 34px; border: 2px solid #c9ced6; border-radius: 16px; }
.device-login .login-form .pin-toggle { width: 56px; height: 56px; border-radius: 16px; }
.device-login .login-form .pin-toggle svg { width: 28px; height: 28px; }
.device-login .login-form button[type=submit] { height: 68px; margin-top: 28px; font-size: 22px; border-radius: 16px; background: #2b2f36; }
.device-login .login-link { display: inline-block; margin-top: 22px; font-size: 18px; }
.device-login .login-error { margin: 0 0 8px; padding: 14px 18px; font-size: 17px; }

/* ===== Spaziature uniformi (griglia a 4px: 4 / 8 / 12 / 16 / 24 / 32) ===== */
:root { --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; }

/* Pagina e titoli */
main { padding: 0 var(--sp-6) var(--sp-4); }
h1, h2, h3 { margin: var(--sp-5) 0 var(--sp-2); }
.mainlayout-drawer main > h1, .rd-head h1 { margin: var(--sp-4) 0 var(--sp-5); padding-bottom: var(--sp-3); }
.rd-head { gap: var(--sp-4); margin-bottom: var(--sp-2); }
:where(p.rd-sub) { margin: 0 0 var(--sp-4); }

/* Messaggi */
.login-ok, .login-error, .rd-message { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); }

/* Barre di filtri e pulsanti */
.rd-btn-group { gap: var(--sp-2); }
.rd-toolbar { gap: var(--sp-4); }
.rd-filters { gap: var(--sp-4); margin-bottom: var(--sp-3); }
.rd-filter { gap: var(--sp-1); }
.rd-tabsearch { padding: var(--sp-3) 0; }

/* Card della home e dashboard */
.dash-head { gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-4); }
.dash-cards { gap: var(--sp-4); margin-bottom: var(--sp-5); }
.dash-col { gap: var(--sp-4); }
.dash-card, .sys-card { padding: var(--sp-4) var(--sp-5); }
.dash-label, .dash-sub { margin-top: var(--sp-1); }
.dash-sites { margin: var(--sp-3) 0 0; padding: var(--sp-2) 0 0; }
.dash-sites li { gap: var(--sp-3); padding: var(--sp-1) 0; }
.sys-cards { gap: var(--sp-4); margin: var(--sp-5) 0; }
.sys-card { gap: var(--sp-2); }

/* Griglie */
.k-grid td, .k-grid .k-table-td { padding-block: var(--sp-3); padding-inline: var(--sp-3); }
.k-grid .k-grid-header .k-table-th { padding-block: var(--sp-3); }
.k-grid .k-grid-norecords { padding: var(--sp-5); }

/* Form di modifica */
.form-meta, .form-id, .form-required-note { margin: 0 0 var(--sp-4); }
.form-company { gap: var(--sp-3); margin: 0 0 var(--sp-4); padding: var(--sp-2) var(--sp-4); }
.form-tabs { gap: var(--sp-1); margin: 0 0 var(--sp-4); }
.form-tabs + .k-form .k-form-fieldset { margin: 0 0 var(--sp-5); }
.form-tabs + .k-form .k-form-fieldset:last-child { margin-bottom: 0; }
.form-tabs + .k-form .k-form-fieldset > .k-form-legend,
.form-tabs + .k-form .k-form-fieldset > legend { margin: 0 0 var(--sp-3); }

/* Parametri */
.param-list { margin: var(--sp-4) 0 var(--sp-5); }
.param-row { gap: var(--sp-5); padding: var(--sp-4) var(--sp-5); }
.param-actions { margin-top: var(--sp-4); }

/* ===== Intestazione di pagina: icona, titolo, sottotitolo e azioni a destra ===== */
.page-header { position: relative; display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); padding-bottom: var(--sp-4); flex-wrap: wrap; }
.page-header::after { content: ""; position: absolute; left: 0; bottom: 0; width: 250px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #1a1a1a 0%, #c3c8cf 100%); }
.page-header-icon { flex: none; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: #2b2f36; color: #fff; font-size: 22px; box-shadow: 0 4px 12px rgba(16,24,40,.18); }
.page-header-text { flex: 1 1 240px; min-width: 0; }
.page-header h1 { margin: 0; padding: 0; font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; color: #1a1a1a; }
.page-header h1::after { content: none; }
.page-header-sub { margin: var(--sp-1) 0 0; font-size: 14px; line-height: 1.4; color: #6b7178; }
.page-header-actions { flex: none; display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.page-header-icon .k-svg-icon { width: 26px; height: 26px; } .page-header-icon .k-svg-icon svg { width: 26px; height: 26px; }

/* ===== Pulsanti: forma unica (8px) e gerarchia principale / secondario / pericoloso ===== */
:root { --btn-radius: 8px; --btn-dark: #2b2f36; --btn-dark-hover: #1a1a1a; --btn-border: #c3c8cf; --btn-danger: #d13438; --btn-danger-dark: #b42318; }
.k-button:not(.k-input-button):not(.k-spinner-increase):not(.k-spinner-decrease):not(.k-window-action):not(.k-tabstrip-prev):not(.k-tabstrip-next) { border-radius: var(--btn-radius); font-weight: 600; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }

/* Principale: pieno scuro */
.k-button.k-button-solid-primary { background: var(--btn-dark); border-color: var(--btn-dark); color: #fff; }
.k-button.k-button-solid-primary:hover { background: var(--btn-dark-hover); border-color: var(--btn-dark-hover); }
.k-button.k-button-solid-primary:focus-visible { box-shadow: 0 0 0 3px rgba(43, 47, 54, .25); }

/* Secondario: bordo grigio su bianco */
.k-button.k-button-outline-primary, .k-button.k-button-outline-base, .k-button.k-button-solid-base { background: #fff; border-color: var(--btn-border); color: var(--btn-dark); }
.k-button.k-button-outline-primary:hover, .k-button.k-button-outline-base:hover, .k-button.k-button-solid-base:hover { background: #f1f3f5; border-color: #9aa1ab; color: var(--btn-dark-hover); }

/* Pericoloso: rosso (pieno per l'azione principale, bordo rosso per le icone di riga) */
.k-button.k-button-solid-error { background: var(--btn-danger); border-color: var(--btn-danger); color: #fff; }
.k-button.k-button-solid-error:hover { background: var(--btn-danger-dark); border-color: var(--btn-danger-dark); }
.k-button.k-button-outline-error { background: #fff; border-color: #efb3b5; color: var(--btn-danger); }
.k-button.k-button-outline-error:hover { background: #fdecea; border-color: var(--btn-danger); color: var(--btn-danger-dark); }

/* Disattivato */
.k-button.k-disabled, .k-button:disabled { opacity: .45; }

/* Icone sulle azioni di riga: quadrate, tutte della stessa misura */
.row-actions .k-button { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.row-actions .k-button.k-icon-button { width: 36px; height: 36px; padding: 0; }
.row-actions .k-button .k-svg-icon, .row-actions .k-button .k-svg-icon svg { width: 18px; height: 18px; }

/* Suggerimento al passaggio */
.k-tooltip { padding: 6px 10px; font-size: 13px; font-weight: 500; color: #fff; background: var(--btn-dark); border: 0; border-radius: 6px; box-shadow: 0 6px 16px rgba(16, 24, 40, .25); }
.k-tooltip .k-callout { color: var(--btn-dark); }
.row-actions { flex-wrap: nowrap; }

/* ===== Transizioni leggere ===== */

/* Card: ombra morbida e leggero sollevamento al passaggio */
.dash-card, .sys-card, .param-list, .g-card, .rd-q { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dash-card:hover, .sys-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16, 24, 40, .12); }
.sys-card:hover { border-color: #b8bec7; }
.rd-legend > *, .rd-legend-card { transition: transform .18s ease, box-shadow .18s ease; }
.rd-legend > *:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 24, 40, .10); }

/* Chi preferisce meno movimento non vede animazioni */
@media (prefers-reduced-motion: reduce) {
    .dash-card, .sys-card, .rd-legend > * { transition: none; }
    .dash-card:hover, .sys-card:hover, .rd-legend > *:hover { transform: none; }
}

/* Notifica di conferma (Toast): in alto al centro, sotto la barra superiore */
.k-notification-group { top: 72px !important; z-index: 20000; }
.k-notification-container .k-notification { border-radius: 10px; font-weight: 500; box-shadow: 0 10px 28px rgba(16, 24, 40, .22); }

/* Notifica di conferma più grande */
.k-notification-group { top: 80px !important; }
.k-notification-container .k-notification { min-width: 420px; max-width: 90vw; padding: 20px 28px; gap: 14px; font-size: 20px; font-weight: 600; line-height: 1.35; border-radius: 14px; box-shadow: 0 16px 40px rgba(16, 24, 40, .28); }
.k-notification-container .k-notification .k-notification-status, .k-notification-container .k-notification .k-svg-icon, .k-notification-container .k-notification .k-svg-icon svg { width: 28px; height: 28px; font-size: 28px; }
.k-notification-container .k-notification .k-notification-actions .k-button { width: 36px; height: 36px; }

/* Notifica di conferma: verde tenue */
.k-notification-container .k-notification.k-notification-success,
.k-notification-container .k-notification-success { background: #e8f5ec; color: #1e5c36; border: 1px solid #bfe0cb; }
.k-notification-container .k-notification-success .k-svg-icon, .k-notification-container .k-notification-success .k-notification-status { color: #3d9a5f; }
.k-notification-container .k-notification-success .k-button { color: #1e5c36; }

/* Notifica di conferma: verde un po' più scuro */
.k-notification-container .k-notification.k-notification-success,
.k-notification-container .k-notification-success { background: #cfe9d8; color: #14472a; border: 1px solid #93c9a8; }
.k-notification-container .k-notification-success .k-svg-icon, .k-notification-container .k-notification-success .k-notification-status { color: #2a7d4a; }
.k-notification-container .k-notification-success .k-button { color: #14472a; }

/* ===================================================================
   TEMA SCURO (solo area di amministrazione): attivo con <html data-theme="dark">.
   Il foglio scuro di Telerik (k-dark-theme) colora i componenti Telerik; qui i colori propri dell'app.
   Palette: sfondo #16181d, superficie #1f2329, superficie 2 #262b33, bordo #3a4049, testo #e6e8eb, secondario #9aa3ad.
   =================================================================== */
html[data-theme="dark"] { color-scheme: dark; --kendo-color-primary: #e6e8eb; --kendo-color-primary-darker: #ffffff; --kendo-color-primary-lighter: #c9ced6; --kendo-color-on-primary: #16181d; --kendo-color-primary-active-hover: #ffffff; }
html[data-theme="dark"] body, html[data-theme="dark"] main, html[data-theme="dark"] .mainlayout-drawer .k-drawer-content { background: #16181d; color: #e6e8eb; }
html[data-theme="dark"] a { color: #c9d1d9; }
html[data-theme="dark"] a:hover { color: #fff; }
html[data-theme="dark"] .rd-sub, html[data-theme="dark"] .rd-filter label { color: #9aa3ad; }
html[data-theme="dark"] #page-loader { background: rgba(22, 24, 29, .85); }

/* Barra superiore e menu */
html[data-theme="dark"] .appbar-logo { background: #fff; padding: 4px 10px; border-radius: 6px; }
html[data-theme="dark"] .appbar-user { border-right-color: #3a4049; }
html[data-theme="dark"] .appbar-avatar { background: linear-gradient(135deg, #e6e8eb 0%, #8b919a 100%); color: #16181d; }
html[data-theme="dark"] .appbar-user-name { color: #e6e8eb; }
html[data-theme="dark"] .appbar-last { color: #9aa3ad; }
html[data-theme="dark"] .mainlayout-drawer > .k-drawer, html[data-theme="dark"] .mainlayout-drawer > .k-drawer .k-drawer-wrapper, html[data-theme="dark"] .mainlayout-drawer > .k-drawer .k-drawer-items { background-color: #1b1e24; }
html[data-theme="dark"] .mainlayout-drawer > .k-drawer { border-right-color: #2e333b; }
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item { color: #cfd5dc; }
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item:hover { background-color: #262b33; }
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item.k-selected, html[data-theme="dark"] .mainlayout-drawer .k-drawer-item.k-selected:hover { background-color: #313741; color: #fff; }

/* Intestazione di pagina */
html[data-theme="dark"] .page-header::after, html[data-theme="dark"] .mainlayout-drawer main > h1::after, html[data-theme="dark"] .rd-head h1::after { background: linear-gradient(90deg, #e6e8eb 0%, #3a4049 100%); }
html[data-theme="dark"] .page-header-icon { background: #313741; color: #e6e8eb; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .page-header h1, html[data-theme="dark"] .mainlayout-drawer main > h1, html[data-theme="dark"] .rd-head h1 { color: #f0f2f4; }
html[data-theme="dark"] .page-header-sub { color: #9aa3ad; }

/* Griglie */
html[data-theme="dark"] .k-grid { border-color: #3a4049; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .k-grid .k-grid-header, html[data-theme="dark"] .k-grid .k-grid-header .k-table-th, html[data-theme="dark"] .k-grid .k-grid-header .k-table-th.k-sorted, html[data-theme="dark"] .k-grid .k-grid-header .k-table-th:hover { background-color: #262b33; color: #e6e8eb; border-color: #3a4049; }
html[data-theme="dark"] .k-grid .k-grid-header .k-column-title, html[data-theme="dark"] .k-grid .k-grid-header .k-link, html[data-theme="dark"] .k-grid .k-grid-header a, html[data-theme="dark"] .k-grid .k-grid-header .k-sort-icon, html[data-theme="dark"] .k-grid .k-grid-header .k-svg-icon, html[data-theme="dark"] .k-grid .k-grid-header .k-icon { color: #e6e8eb; }
html[data-theme="dark"] .k-grid .k-grid-header .k-grid-header-menu:hover, html[data-theme="dark"] .k-grid .k-grid-header .k-header-column-menu:hover { background-color: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .k-grid td, html[data-theme="dark"] .k-grid .k-table-td { border-color: #2e333b; }
html[data-theme="dark"] .k-grid .k-table-row { background-color: #1f2329; color: #e6e8eb; }
html[data-theme="dark"] .k-grid .k-table-row.k-table-alt-row { background-color: #1b1e24; }
html[data-theme="dark"] .k-grid .k-table-row:hover { background-color: #2a2f37; }
html[data-theme="dark"] .k-grid .k-table-row.k-selected, html[data-theme="dark"] .k-grid .k-table-row.k-selected:hover { background-color: #333a45; }
html[data-theme="dark"] .k-grid .k-grid-pager { background-color: #1f2329; border-top-color: #2e333b; }
html[data-theme="dark"] .k-grid .k-grid-norecords { color: #9aa3ad; }

/* Card della home e dashboard */
html[data-theme="dark"] .dash-card, html[data-theme="dark"] .sys-card { background: #1f2329; border-color: #3a4049; color: #e6e8eb; }
html[data-theme="dark"] .dash-sub, html[data-theme="dark"] .sys-card span { color: #9aa3ad; }
html[data-theme="dark"] .dash-sites { border-top-color: #3a4049; }
html[data-theme="dark"] .dash-long { color: #ff8a80; }
html[data-theme="dark"] .sys-card:hover { background: #262b33; border-color: #4a525d; }
html[data-theme="dark"] .dash-card:hover, html[data-theme="dark"] .sys-card:hover, html[data-theme="dark"] .rd-legend > *:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .dash-present, html[data-theme="dark"] .rd-l-present { background: #16301f; border-color: #25523a; }
html[data-theme="dark"] .dash-entries { background: #172a44; border-color: #27466f; }
html[data-theme="dark"] .dash-waiting, html[data-theme="dark"] .rd-l-waiting { background: #3a3410; border-color: #6b5f1c; }
html[data-theme="dark"] .dash-filling, html[data-theme="dark"] .rd-l-filling { background: #3d2410; border-color: #6e4220; }
html[data-theme="dark"] .dash-present .dash-sites { border-top-color: #25523a; }
html[data-theme="dark"] .dash-entries .dash-sites { border-top-color: #27466f; }
html[data-theme="dark"] .dash-waiting .dash-sites { border-top-color: #6b5f1c; }
html[data-theme="dark"] .dash-filling .dash-sites { border-top-color: #6e4220; }
html[data-theme="dark"] .dash-present .dash-num, html[data-theme="dark"] .rd-l-present strong { color: #6fcf97; }
html[data-theme="dark"] .dash-entries .dash-num { color: #7db4f5; }
html[data-theme="dark"] .dash-waiting .dash-num, html[data-theme="dark"] .rd-l-waiting strong { color: #e6cf55; }
html[data-theme="dark"] .dash-filling .dash-num, html[data-theme="dark"] .rd-l-filling strong { color: #f0a35e; }
html[data-theme="dark"] .rd-legend-item { color: #cfd5dc; }

/* Parametri */
html[data-theme="dark"] .param-list { background: #1f2329; border-color: #3a4049; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .param-row { border-bottom-color: #2e333b; }
html[data-theme="dark"] .param-row:hover { background: #262b33; }
html[data-theme="dark"] .param-key { background: #313741; color: #e6e8eb; }
html[data-theme="dark"] .param-desc, html[data-theme="dark"] .param-default { color: #9aa3ad; }
html[data-theme="dark"] .param-default b { color: #e6e8eb; }

/* Messaggi */
html[data-theme="dark"] .login-ok, html[data-theme="dark"] .rd-message { color: #bfe9cf; background: #16301f; border-color: #2f7a4d; }
html[data-theme="dark"] .login-error { color: #ffb4ad; background: #3d1c1a; border-color: #b42318; }
html[data-theme="dark"] .login-validation { color: #ffb4ad; }

/* Finestre di modifica */
html[data-theme="dark"] .company-window .k-window-content, html[data-theme="dark"] .rd-detail-dialog .k-window-content { background: #1f2329; color: #e6e8eb; }
html[data-theme="dark"] .k-window.company-window, html[data-theme="dark"] .k-dialog.rd-detail-dialog { box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .company-window .k-window-titlebar, html[data-theme="dark"] .rd-detail-dialog .k-window-titlebar { background: #14161a; border-bottom: 1px solid #3a4049; }
html[data-theme="dark"] .company-window .form-company { background: #262b33; border-color: #3a4049; border-left-color: #e6e8eb; }
html[data-theme="dark"] .form-company { background: #262b33; }
html[data-theme="dark"] .form-company span, html[data-theme="dark"] .form-required-note, html[data-theme="dark"] .form-id, html[data-theme="dark"] .form-buttons-note, html[data-theme="dark"] .tr-lang, html[data-theme="dark"] .answers-head, html[data-theme="dark"] .gt-sites th, html[data-theme="dark"] .company-window .k-form-hint, html[data-theme="dark"] .company-language em { color: #9aa3ad; }
html[data-theme="dark"] .form-id strong { color: #e6e8eb; }
html[data-theme="dark"] .form-buttons-note i { color: #9aa3ad; }
html[data-theme="dark"] .company-window .k-form-fieldset > .k-form-legend, html[data-theme="dark"] .company-window .k-form-fieldset > legend { color: #e6e8eb; }
html[data-theme="dark"] .company-window .k-form-fieldset > .k-form-legend::before, html[data-theme="dark"] .company-window .k-form-fieldset > legend::before { background: linear-gradient(180deg, #e6e8eb 0%, #6b7178 100%); }
html[data-theme="dark"] .company-window .k-form-fieldset > .k-form-legend::after, html[data-theme="dark"] .company-window .k-form-fieldset > legend::after { background: #3a4049; }
html[data-theme="dark"] .company-window .k-form-label, html[data-theme="dark"] .company-window .k-label { color: #cfd5dc; }
html[data-theme="dark"] .company-window .k-input, html[data-theme="dark"] .company-window .k-textbox, html[data-theme="dark"] .company-window .k-textarea { border-color: #3a4049; }
html[data-theme="dark"] .company-window .k-input:focus-within, html[data-theme="dark"] .company-window .k-textbox:focus-within, html[data-theme="dark"] .company-window .k-textarea:focus-within { border-color: #e6e8eb; box-shadow: 0 0 0 3px rgba(230, 232, 235, .15); }
html[data-theme="dark"] .company-window .k-form-buttons { background: #1b1e24; border-top-color: #3a4049; }
html[data-theme="dark"] .form-tabs { border-bottom-color: #3a4049; }
html[data-theme="dark"] .form-tab { color: #9aa3ad; }
html[data-theme="dark"] .form-tab:hover { background: #262b33; }
html[data-theme="dark"] .form-tab.active { background: #1f2329; color: #fff; border-color: #3a4049; border-bottom-color: #1f2329; }
html[data-theme="dark"] .gt-sites td, html[data-theme="dark"] .answer-row { border-top-color: #2e333b; }
html[data-theme="dark"] .answer-btn { background: #262b33; border-color: #3a4049; color: #e6e8eb; }
html[data-theme="dark"] .answer-btn:hover:not(:disabled) { background: #313741; }
html[data-theme="dark"] .answer-btn.danger { color: #ff8a80; }
html[data-theme="dark"] .company-logo-box { background: #262b33; border-color: #4a525d; }
html[data-theme="dark"] .company-logo-preview { background: #1f2329; border-color: #3a4049; color: #9aa3ad; }
html[data-theme="dark"] .site-theme-row input[type="color"] { background: #262b33; border-color: #3a4049; }

/* Dettaglio del test */
html[data-theme="dark"] .rd-detail-dialog .k-dialog-buttons { background: #1b1e24; border-top-color: #3a4049; }
html[data-theme="dark"] .rd-survey-name, html[data-theme="dark"] .rd-detail-dialog .rd-q-text { color: #f0f2f4; }
html[data-theme="dark"] .rd-summary { color: #cfd5dc; border-color: #3a4049; }
html[data-theme="dark"] .rd-summary.rd-pass { background: #16301f; border-color: #25523a; border-left-color: #3d9a5f; }
html[data-theme="dark"] .rd-summary.rd-fail { background: #3d1c1a; border-color: #6e2c28; border-left-color: #d13438; }
html[data-theme="dark"] .rd-detail-dialog .rd-q { background: #262b33; border-color: #3a4049; }
html[data-theme="dark"] .rd-detail-dialog .rd-q-text .rd-ok { background: #16301f; color: #6fcf97; }
html[data-theme="dark"] .rd-detail-dialog .rd-q-text .rd-ko { background: #3d1c1a; color: #ff8a80; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li { color: #cfd5dc; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-chosen { background: #1d2d4d; border-color: #2f4a7d; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-correct { background: #16301f; border-color: #25523a; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-chosen:not(.rd-correct) { background: #3d1c1a; border-color: #6e2c28; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li .rd-ok, html[data-theme="dark"] .rd-ok { color: #6fcf97; }
html[data-theme="dark"] .rd-ko { color: #ff8a80; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li .rd-sub { color: #9aa3ad; }

/* Pulsanti */
html[data-theme="dark"] .k-button.k-button-solid-primary { background: #e6e8eb; border-color: #e6e8eb; color: #16181d; }
html[data-theme="dark"] .k-button.k-button-solid-primary:hover { background: #fff; border-color: #fff; }
html[data-theme="dark"] .k-button.k-button-solid-primary:focus-visible { box-shadow: 0 0 0 3px rgba(230, 232, 235, .3); }
html[data-theme="dark"] .k-button.k-button-outline-primary, html[data-theme="dark"] .k-button.k-button-outline-base, html[data-theme="dark"] .k-button.k-button-solid-base { background: #262b33; border-color: #4a525d; color: #e6e8eb; }
html[data-theme="dark"] .k-button.k-button-outline-primary:hover, html[data-theme="dark"] .k-button.k-button-outline-base:hover, html[data-theme="dark"] .k-button.k-button-solid-base:hover { background: #313741; border-color: #6b7178; color: #fff; }
html[data-theme="dark"] .k-button.k-button-outline-error { background: #262b33; border-color: #7a3a3c; color: #ff8a80; }
html[data-theme="dark"] .k-button.k-button-outline-error:hover { background: #3d1c1a; border-color: #d13438; color: #ffb4ad; }

/* Suggerimento e notifica */
html[data-theme="dark"] .k-tooltip { background: #e6e8eb; color: #16181d; }
html[data-theme="dark"] .k-tooltip .k-callout { color: #e6e8eb; }
html[data-theme="dark"] .k-notification-container .k-notification.k-notification-success, html[data-theme="dark"] .k-notification-container .k-notification-success { background: #1f4f33; color: #d7f2e1; border-color: #2f7a4d; }
html[data-theme="dark"] .k-notification-container .k-notification-success .k-svg-icon, html[data-theme="dark"] .k-notification-container .k-notification-success .k-notification-status { color: #7ee0a3; }
html[data-theme="dark"] .k-notification-container .k-notification-success .k-button { color: #d7f2e1; }

/* Tema scuro: pulsante principale (Salva, Nuovo...) ben evidenziato, chiaro su sfondo scuro */
html[data-theme="dark"] .k-button.k-button-solid-primary,
html[data-theme="dark"] .k-button.k-primary,
html[data-theme="dark"] .k-form-buttons .k-button[type="submit"] { background: #e6e8eb !important; border-color: #e6e8eb !important; color: #16181d !important; }
html[data-theme="dark"] .k-button.k-button-solid-primary:hover,
html[data-theme="dark"] .k-button.k-primary:hover,
html[data-theme="dark"] .k-form-buttons .k-button[type="submit"]:hover { background: #ffffff !important; border-color: #ffffff !important; color: #000 !important; }
html[data-theme="dark"] .k-button.k-button-solid-primary .k-button-text, html[data-theme="dark"] .k-form-buttons .k-button[type="submit"] .k-button-text { color: inherit; }
html[data-theme="dark"] .k-button.k-button-solid-primary.k-disabled, html[data-theme="dark"] .k-button.k-button-solid-primary:disabled { opacity: .5; }

/* Tema scuro: pagina Cambia Password (statica) */
html[data-theme="dark"] .static-page { background: #16181d; color: #e6e8eb; }
html[data-theme="dark"] .login-card { background: #1f2329; border-color: #3a4049; color: #e6e8eb; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .login-card h1 { color: #f0f2f4; }
html[data-theme="dark"] .login-brand { color: #9aa3ad; }
html[data-theme="dark"] .login-logo { background: #fff; padding: 4px 10px; border-radius: 6px; }
html[data-theme="dark"] .login-form label { color: #cfd5dc; }
html[data-theme="dark"] .login-form input { background: #262b33; color: #e6e8eb; border-color: #4a525d; }
html[data-theme="dark"] .login-form input:focus { outline: none; border-color: #e6e8eb; box-shadow: 0 0 0 3px rgba(230, 232, 235, .15); }
html[data-theme="dark"] .login-form button[type="submit"] { background: #e6e8eb; color: #16181d; }
html[data-theme="dark"] .login-form button[type="submit"]:hover { background: #fff; }
html[data-theme="dark"] .login-link { color: #c9d1d9; }
html[data-theme="dark"] .login-hint { color: #9aa3ad; }

/* Tema scuro: interruttore (Switch) ben visibile */
html[data-theme="dark"] .k-switch .k-switch-track { background-color: #3a4049 !important; border-color: #6b7178 !important; color: #cfd5dc !important; }
html[data-theme="dark"] .k-switch .k-switch-thumb { background-color: #cfd5dc !important; border-color: #cfd5dc !important; }
html[data-theme="dark"] .k-switch.k-switch-on .k-switch-track { background-color: #2f9e5b !important; border-color: #4cc27d !important; color: #fff !important; }
html[data-theme="dark"] .k-switch.k-switch-on .k-switch-thumb { background-color: #fff !important; border-color: #fff !important; }
html[data-theme="dark"] .k-switch .k-switch-label-on, html[data-theme="dark"] .k-switch .k-switch-label-off { font-weight: 700; }
html[data-theme="dark"] .k-switch:focus-within .k-switch-track, html[data-theme="dark"] .k-switch.k-focus .k-switch-track { box-shadow: 0 0 0 3px rgba(230, 232, 235, .3); }

/* Intestazione portineria (Accessi, Storico): titolo, sottotitolo sotto e barra in fondo, senza sovrapposizioni */
.rd-head { position: relative; flex-direction: column; align-items: flex-start; gap: var(--sp-1); margin: var(--sp-4) 0 var(--sp-5); padding-bottom: var(--sp-4); }
.rd-head h1 { margin: 0; padding: 0; font-size: 28px; line-height: 1.2; }
.rd-head h1::after { content: none; }
.rd-head .rd-sub { margin: 0; font-size: 14px; }
.rd-head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 250px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #1a1a1a 0%, #c3c8cf 100%); }
html[data-theme="dark"] .rd-head::after { background: linear-gradient(90deg, #e6e8eb 0%, #3a4049 100%); }

/* Tema scuro: pulsanti ben evidenti (selettori per sottostringa: valgono qualunque sia il nome esatto delle classi Telerik) */
/* Secondario / outline / base: scheda grigia con bordo chiaro */
html[data-theme="dark"] .k-button[class*="outline"], html[data-theme="dark"] .k-button[class*="solid-base"] { background: #262b33 !important; border: 1px solid #6b7178 !important; color: #f0f2f4 !important; }
html[data-theme="dark"] .k-button[class*="outline"]:hover, html[data-theme="dark"] .k-button[class*="solid-base"]:hover { background: #343a44 !important; border-color: #9aa3ad !important; color: #fff !important; }
/* Principale: pieno chiaro con testo scuro */
html[data-theme="dark"] .k-button[class*="primary"]:not([class*="outline"]):not([class*="flat"]):not([class*="clear"]):not([class*="link"]) { background: #e6e8eb !important; border: 1px solid #e6e8eb !important; color: #16181d !important; font-weight: 700; }
html[data-theme="dark"] .k-button[class*="primary"]:not([class*="outline"]):not([class*="flat"]):not([class*="clear"]):not([class*="link"]):hover { background: #fff !important; border-color: #fff !important; color: #000 !important; }
/* Pericoloso */
html[data-theme="dark"] .k-button[class*="error"][class*="outline"] { background: #262b33 !important; border-color: #b4474a !important; color: #ff8a80 !important; }
html[data-theme="dark"] .k-button[class*="error"][class*="outline"]:hover { background: #3d1c1a !important; border-color: #d13438 !important; color: #ffb4ad !important; }
html[data-theme="dark"] .k-button[class*="error"]:not([class*="outline"]):not([class*="flat"]):not([class*="clear"]) { background: #d13438 !important; border-color: #d13438 !important; color: #fff !important; }
/* Testo e icone dentro i pulsanti ereditano il colore */
html[data-theme="dark"] .k-button .k-button-text, html[data-theme="dark"] .k-button .k-svg-icon { color: inherit !important; }

/* Pulsanti: nomi di classe reali di Telerik 15 (riempimento k-button-solid|outline|flat + colore k-button-primary|base|error) */
.k-button.k-button-solid.k-button-primary { background: var(--btn-dark); border-color: var(--btn-dark); color: #fff; }
.k-button.k-button-solid.k-button-primary:hover { background: var(--btn-dark-hover); border-color: var(--btn-dark-hover); }
.k-button.k-button-solid.k-button-primary:focus-visible { box-shadow: 0 0 0 3px rgba(43, 47, 54, .25); }
.k-button.k-button-outline.k-button-primary, .k-button.k-button-outline.k-button-base, .k-button.k-button-solid.k-button-base { background: #fff; border-color: var(--btn-border); color: var(--btn-dark); }
.k-button.k-button-outline.k-button-primary:hover, .k-button.k-button-outline.k-button-base:hover, .k-button.k-button-solid.k-button-base:hover { background: #f1f3f5; border-color: #9aa3ad; color: var(--btn-dark-hover); }
.k-button.k-button-solid.k-button-error { background: var(--btn-danger); border-color: var(--btn-danger); color: #fff; }
.k-button.k-button-solid.k-button-error:hover { background: var(--btn-danger-dark); border-color: var(--btn-danger-dark); }
.k-button.k-button-outline.k-button-error { background: #fff; border-color: #efb3b5; color: var(--btn-danger); }
.k-button.k-button-outline.k-button-error:hover { background: #fdecea; border-color: var(--btn-danger); color: var(--btn-danger-dark); }
.g-exit-dialog .k-dialog-actions .k-button.k-button-solid.k-button-primary { background: #2b2f36; border-color: #2b2f36; color: #fff; }

/* Loader (es. Esporta Excel): ben visibile in entrambi i temi */
.k-loader-container .k-loader-container-overlay { background-color: rgba(255, 255, 255, .7); }
.k-loader-container .k-loader-container-panel { gap: 14px; padding: 24px 32px; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(16, 24, 40, .22); }
.k-loader-container .k-loading-text { font-size: 16px; font-weight: 600; color: #1a1a1a; }
html[data-theme="dark"] .k-loader-container .k-loader-container-overlay { background-color: rgba(0, 0, 0, .55) !important; }
html[data-theme="dark"] .k-loader-container .k-loader-container-panel { background: #313741 !important; border: 1px solid #4a525d; box-shadow: 0 12px 32px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .k-loader-container .k-loading-text { color: #fff !important; }
html[data-theme="dark"] .k-loader-container .k-loader, html[data-theme="dark"] .k-loader-container .k-loader-segment, html[data-theme="dark"] .k-loader-container .k-loader-canvas { color: #7ee0a3 !important; }
html[data-theme="dark"] .k-loader-container .k-loader-segment::after { background-color: #7ee0a3 !important; }
.k-loader-container .k-loader { font-size: 48px; }

/* Loader nel tema scuro: scritta sempre leggibile (selettori larghi, indipendenti dai nomi interni) */
html[data-theme="dark"] .k-loader-container, html[data-theme="dark"] .k-loader-container * { color: #ffffff !important; text-shadow: none; }
html[data-theme="dark"] .k-loader-container [class*="panel"], html[data-theme="dark"] .k-loader-container [class*="inner"] { background-color: #313741 !important; }
html[data-theme="dark"] .k-loader-container .k-loader, html[data-theme="dark"] .k-loader-container .k-loader * { color: #7ee0a3 !important; }
html[data-theme="dark"] .k-loader-container [class*="text"], html[data-theme="dark"] .k-loader-container [class*="label"] { font-size: 16px; font-weight: 600; color: #ffffff !important; }

/* Informativa privacy: colori della sede (variabili --sede e --sede-ink impostate da GuestLayout) */
.k-dialog.g-privacy-dialog .k-window-titlebar { background: var(--sede, #2b2f36); color: var(--sede-ink, #fff); }
.k-dialog.g-privacy-dialog .k-window-title { color: var(--sede-ink, #fff); }
.k-dialog.g-privacy-dialog .k-window-titlebar .k-button, .k-dialog.g-privacy-dialog .k-window-titlebar .k-svg-icon { color: var(--sede-ink, #fff); }
.k-dialog.g-privacy-dialog { border-top: 4px solid var(--sede, #2b2f36); }
.k-dialog.g-privacy-dialog .k-dialog-actions .k-button { background: var(--sede, #2b2f36); border-color: var(--sede, #2b2f36); color: var(--sede-ink, #fff); }
.k-dialog.g-privacy-dialog .k-dialog-actions .k-button:hover { filter: brightness(.9); }

/* Finestra PIN "Esci dalla modalita' accoglienza": stessi colori della sede dell'informativa privacy */
.k-dialog.g-exit-dialog .k-window-titlebar { background: var(--sede, #2b2f36); color: var(--sede-ink, #fff); }
.k-dialog.g-exit-dialog .k-window-title { color: var(--sede-ink, #fff); }
.k-dialog.g-exit-dialog .k-window-titlebar .k-button, .k-dialog.g-exit-dialog .k-window-titlebar .k-svg-icon { color: var(--sede-ink, #fff); }
.k-dialog.g-exit-dialog { border-top: 4px solid var(--sede, #2b2f36); }
.k-dialog.g-exit-dialog .g-exit-label { color: var(--sede, #2b2f36); }
.k-dialog.g-exit-dialog .pin-box.filled, .k-dialog.g-exit-dialog .pin-box:focus { border-color: var(--sede, #2b2f36); }
.k-dialog.g-exit-dialog .pin-box:focus { box-shadow: 0 0 0 4px rgba(0, 0, 0, .12); }
.k-dialog.g-exit-dialog .k-dialog-actions .k-button.k-button-primary, .k-dialog.g-exit-dialog .k-dialog-actions .k-button:first-child { background: var(--sede, #2b2f36); border-color: var(--sede, #2b2f36); color: var(--sede-ink, #fff); }
.k-dialog.g-exit-dialog .k-dialog-actions .k-button:hover { filter: brightness(.92); }
.g-company { margin: 0 0 12px; font-size: 24px; font-weight: 600; color: var(--sede, #1a1a1a); }

/* Nessuna finestra di riconnessione mentre la pagina si chiude */
html.page-unloading #components-reconnect-modal { display: none !important; }

/* Box della legenda cliccabili: aprono il tab corrispondente */
.rd-legend-item { cursor: pointer; user-select: none; }
.rd-legend-item.rd-legend-active { box-shadow: 0 0 0 2px currentColor inset; }
.rd-legend-item:focus-visible { outline: 2px solid #2b2f36; outline-offset: 2px; }
html[data-theme="dark"] .rd-legend-item:focus-visible { outline-color: #cfd5dc; }

/* Finestre di conferma portineria - stile tablet */
.k-dialog.rd-confirm-dialog { border: 0; border-radius: 24px; overflow: hidden; box-shadow: 0 24px 70px rgba(16, 24, 40, .35); }
.rd-confirm-dialog .k-window-titlebar { padding: 20px 28px; background: #2b2f36; color: #fff; border-bottom: 0; }
.rd-confirm-dialog .k-window-title { font-size: 22px; font-weight: 600; color: #fff; }
.rd-confirm-dialog .k-window-titlebar .k-button { color: #fff; width: 44px; height: 44px; border-radius: 12px; }
.rd-confirm-dialog .k-dialog-content { padding: 28px 32px 12px; text-align: left; }
.rd-confirm-dialog .k-dialog-content p { font-size: 20px; line-height: 1.5; color: #4b5563; margin: 0 0 16px; }
.rd-confirm-dialog .k-dialog-content p.k-form-hint { font-size: 16px; }
.rd-confirm-dialog .k-dialog-buttons, .rd-confirm-dialog .k-dialog-actions { display: flex; gap: 16px; padding: 20px 32px 28px; border: 0; background: #fff; }
.rd-confirm-dialog .k-dialog-buttons .k-button, .rd-confirm-dialog .k-dialog-actions .k-button { flex: 1; min-height: 60px; font-size: 20px; font-weight: 600; border-radius: 16px; }
.rd-confirm-dialog .k-dialog-buttons .k-button-solid-primary, .rd-confirm-dialog .k-dialog-actions .k-button-solid-primary,
.rd-confirm-dialog .k-dialog-buttons .k-button.k-button-primary { background: #2b2f36; border-color: #2b2f36; color: #fff; }
html[data-theme="dark"] .rd-confirm-dialog .k-dialog-content p { color: #cfd5dc; }
html[data-theme="dark"] .rd-confirm-dialog .k-dialog-buttons, html[data-theme="dark"] .rd-confirm-dialog .k-dialog-actions { background: #1b1e24; }
html[data-theme="dark"] .rd-confirm-dialog .k-dialog-buttons .k-button.k-button-primary, html[data-theme="dark"] .rd-confirm-dialog .k-dialog-buttons .k-button-solid-primary { background: #e8eaee; border-color: #e8eaee; color: #1b1e24; }

/* Permanenza oltre 12 ore: riga in rosso */
.k-grid tr.row-overstay > td, .k-grid tr.row-overstay.k-alt > td { background: #fde8e8 !important; color: #8f1d1d; }
/* Portineria Solo test: righe evidenziate dalle card "Ultimi 5 minuti" (verde) e "Oggi" (giallo) */
.k-grid tr.pt-hl-recent > td, .k-grid tr.pt-hl-recent.k-alt > td { background: #c9ecd4 !important; color: #0f3d22; font-weight: 600; border-top: 1px solid #8fd1a6; border-bottom: 1px solid #8fd1a6; }
.k-grid tr.pt-hl-recent:hover > td { background: #b5e4c4 !important; }
.k-grid tr.pt-hl-recent > td:first-child { box-shadow: inset 6px 0 0 #1f7a43; }
.k-grid tr.pt-hl-today > td, .k-grid tr.pt-hl-today.k-alt > td { background: #fde7a6 !important; color: #4a3500; font-weight: 600; border-top: 1px solid #f0c64a; border-bottom: 1px solid #f0c64a; }
.k-grid tr.pt-hl-today:hover > td { background: #fbdc85 !important; }
.k-grid tr.pt-hl-today > td:first-child { box-shadow: inset 6px 0 0 #e0a800; }
html[data-theme="dark"] .k-grid tr.pt-hl-recent > td, html[data-theme="dark"] .k-grid tr.pt-hl-recent.k-alt > td { background: #1f4a2e !important; color: #d6f5e0; border-color: #2f6b45; }
html[data-theme="dark"] .k-grid tr.pt-hl-today > td, html[data-theme="dark"] .k-grid tr.pt-hl-today.k-alt > td { background: #4a3a08 !important; color: #fdf0c4; border-color: #7a5f10; }
.k-grid tr.row-overstay .rd-sub { color: #b42318; }
.k-grid tr.row-overstay:hover > td { background: #fbd5d5 !important; }
html[data-theme="dark"] .k-grid tr.row-overstay > td, html[data-theme="dark"] .k-grid tr.row-overstay.k-alt > td { background: #4a1f22 !important; color: #ffb4ab; }
html[data-theme="dark"] .k-grid tr.row-overstay .rd-sub { color: #ff8a80; }
html[data-theme="dark"] .k-grid tr.row-overstay:hover > td { background: #5a2528 !important; }
/* Rosso piu' deciso per permanenza oltre 12 ore */
.k-grid tr.row-overstay > td, .k-grid tr.row-overstay.k-alt > td { background: #f8b4b4 !important; color: #7a0c0c; font-weight: 600; }
.k-grid tr.row-overstay .rd-sub { color: #9b1c1c; }
.k-grid tr.row-overstay:hover > td { background: #f39a9a !important; }
html[data-theme="dark"] .k-grid tr.row-overstay > td, html[data-theme="dark"] .k-grid tr.row-overstay.k-alt > td { background: #7f1d1d !important; color: #ffe4e1; }
html[data-theme="dark"] .k-grid tr.row-overstay .rd-sub { color: #ffc2bb; }
html[data-theme="dark"] .k-grid tr.row-overstay:hover > td { background: #991b1b !important; }

/* Finestre di dettaglio: mai piu' larghe dello schermo */
.k-dialog.rd-detail-dialog { max-width: calc(100vw - 32px); }

/* Finestre di modifica: altezza 80% dello schermo (imposta anche dal CSS, per sicurezza) */
.k-window.company-window { height: 80vh !important; max-height: 92vh; }

/* ===== Campi obbligatori: asterisco semplice; cerchietto rosso solo a validazione fallita ===== */
.k-form-label .k-required,
.k-form-label.required::after {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    margin-left: 4px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-image: none !important;
    color: #6b7280 !important;
    font-size: inherit !important;
    font-weight: 600 !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
}
.k-form-label.required::after { content: "*" !important; }

/* Validazione fallita: cerchietto rosso con asterisco bianco */
.k-form-field:has(.k-invalid, .k-form-error, .k-validation-message) .k-form-label .k-required,
.k-form-field:has(.k-invalid, .k-form-error, .k-validation-message) .k-form-label.required::after {
    display: inline-flex !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin-left: 10px !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle !important;
    background-color: #d13438 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cg stroke='white' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 1.2v9.6M1.8 3.6l8.4 4.8M1.8 8.4l8.4-4.8'/%3E%3C/g%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 9px 9px !important;
}
.k-form-field:has(.k-invalid, .k-form-error, .k-validation-message) .k-form-label.required::after { content: "" !important; }

/* Nota "Campo obbligatorio": stesso asterisco semplice */
.required-icon {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    color: #6b7280 !important;
    font-size: 12px !important;
    line-height: 1 !important;
}
.required-icon::before { content: "\2a" !important; }

/* Riconnessione: pallini animati */
#components-reconnect-modal .rc-box { user-select: none; }
#components-reconnect-modal .rc-dots { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
#components-reconnect-modal .rc-dots i {
    width: 12px; height: 12px; border-radius: 50%; background: #2b2f36;
    animation: rc-bounce 1.2s infinite ease-in-out both;
}
#components-reconnect-modal .rc-dots i:nth-child(2) { animation-delay: .2s; }
#components-reconnect-modal .rc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes rc-bounce {
    0%, 80%, 100% { transform: scale(.55); opacity: .35; }
    40% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal .rc-dots i { animation: none; opacity: .7; }
}

/* Finestre di modifica: mai piu' larghe dello schermo */
.k-window.company-window { max-width: calc(100vw - 32px); }

/* Finestra di riconnessione: piu' grande */
#components-reconnect-modal .rc-box { width: min(620px, calc(100vw - 32px)); max-width: none; padding: 48px 56px; border-radius: 20px; }
#components-reconnect-modal .rc-state { gap: 16px; }
#components-reconnect-modal .rc-state strong { font-size: 32px; }
#components-reconnect-modal .rc-state span { font-size: 20px; }
#components-reconnect-modal .rc-state span.rc-note { font-size: 15px; color: #6b7280; }
#components-reconnect-modal .rc-dots { gap: 14px; margin-top: 12px; }
#components-reconnect-modal .rc-dots i { width: 20px; height: 20px; }
#components-reconnect-modal button { padding: 14px 32px; font-size: 20px; border-radius: 12px; }

/* Nota informativa sotto l'intestazione della pagina */
.page-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 10px 14px; font-size: 14px; line-height: 1.45; color: #4b5563; background: #f3f4f6; border-left: 4px solid #9aa1ab; border-radius: 8px; }
.page-note i { margin-top: 3px; color: #6b7280; }
html[data-theme="dark"] .page-note { color: #cfd5dc; background: #23272e; border-left-color: #5b6270; }
html[data-theme="dark"] .page-note i { color: #9aa1ab; }

/* Tablet: avviso "Presentati in Portineria" evidenziato */
.g-reception-note {
    display: inline-block;
    margin: 12px auto;
    padding: 14px 22px;
    border-radius: 12px;
    background: #fff4d6;
    border: 2px solid #f0b429;
    color: #7a4b00;
    font-weight: 700;
    font-size: 1.25em;
}
html[data-theme="dark"] .g-reception-note {
    background: #3d2f0a;
    border-color: #f0b429;
    color: #ffd778;
}

/* X per svuotare la ricerca della griglia */
.k-searchbox { position: relative; }
.k-searchbox .vx-search-clear {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0 4px;
}
.k-searchbox .vx-search-clear:hover { color: #111; }
html[data-theme="dark"] .k-searchbox .vx-search-clear:hover { color: #fff; }

/* Uscita chiusa automaticamente dal sistema */
.exit-auto { margin-left: 6px; color: #b45309; font-size: .95em; cursor: help; }
html[data-theme="dark"] .exit-auto { color: #fbbf24; }

/* Barra filtri: campi uno accanto all'altro, a sinistra, con spazio fisso */
.rd-toolbar.rd-filters { justify-content: flex-start; gap: 20px; }

/* Accesso Dispositivo/Portineria: su schermi bassi (o con messaggio di errore) la scheda resta nell'altezza */
@media (max-height: 960px) {
    .login-card.device-login { padding: 28px 40px; }
    .device-login .login-header { margin-bottom: 16px; }
    .device-login .login-logo { max-height: 56px; }
    .device-login .login-brand { font-size: 22px; }
    .device-login h1 { margin: 0 0 16px; padding-bottom: 12px; font-size: 28px; }
    .device-login .login-form { gap: 6px; }
    .device-login .login-form label { margin-top: 8px; }
    .device-login .login-form input[type=text], .device-login .login-form input:not(.pin-box) { height: 54px; font-size: 20px; }
    .device-login .login-form .pin-box { width: 56px; height: 64px; font-size: 30px; }
    .device-login .login-form .pin-toggle { width: 48px; height: 48px; }
    .device-login .login-form button[type=submit] { height: 58px; margin-top: 16px; font-size: 20px; }
    .device-login .login-link { margin-top: 12px; }
    .device-login .login-error { margin: 0 0 4px; padding: 10px 16px; font-size: 16px; }
}

/* Note in testa all'elenco risposte (form domande) */
.company-window .answers-notes { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.company-window .answers-notes .k-form-hint { display: block; margin: 0; }

/* Finestra "Validità questionari": scelta dell'operazione */
.vv-label { font-size: 13px; color: #6b7178; }
html[data-theme="dark"] .vv-label { color: #9aa3ad; }
.vv-radios { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.vv-radio { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid #c9ced6; border-radius: 12px; font-size: 18px; cursor: pointer; }
.vv-radio:has(input:checked) { border-color: #2b2f36; background: #f3f4f6; }
.vv-radio input { width: 20px; height: 20px; margin: 0; }
html[data-theme="dark"] .vv-radio { border-color: #4a525d; }
html[data-theme="dark"] .vv-radio:has(input:checked) { border-color: #e6e8eb; background: #262b33; }

/* Dialog Validità questionari: altezza fissa dell'area opzione e controlli spaziati */
.vv-form { display: flex; flex-direction: column; gap: 18px; }
.vv-form > p { margin: 0; }
.vv-form .rd-filter { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.vv-option { min-height: 72px; }

/* Icona prima di Azienda / Sede / Questionario nella riga in testa ai form */
.form-company .fc-icon { margin-right: 6px; }

/* Icona nella barra del titolo dei form di modifica */
.k-window-title .wt-icon { margin-right: 10px; }

/* Nota estrazione casuale nella pagina Domande */
.questions-note { margin: -4px 0 12px; }

/* Riga Domanda sotto Questionario nel form Domanda */
.form-company:has(+ .form-company-sub) { margin-bottom: 6px; }
.form-company-sub em { color: #8a9099; }
.form-company .fc-question { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Icona prima di Questionario nel dettaglio del test */
.rd-survey-name .fc-icon { margin-right: 8px; }

/* Materiali informativi: pulsante nella home del Dispositivo, elenco e dettaglio */
.g-info-btn {
    display: flex; align-items: center; gap: 20px; width: 100%; max-width: 872px; box-sizing: border-box;
    padding: 20px 28px; font: inherit; text-align: left; cursor: pointer; color: var(--sede);
    background: #fff; border: 2px dashed var(--sede); border-radius: 16px;
}
.g-info-btn > i:first-child { font-size: 34px; }
.g-info-btn > i:last-child { margin-left: auto; font-size: 22px; }
.g-info-btn-text { display: flex; flex-direction: column; gap: 2px; }
.g-info-btn-title { font-size: 26px; font-weight: 700; }
.g-info-btn-sub { font-size: 17px; font-weight: 500; }
.g-info-list { display: flex; flex-direction: column; gap: 12px; }
.g-info-item {
    display: flex; align-items: center; gap: 18px; width: 100%; box-sizing: border-box; min-height: 76px;
    padding: 16px 20px; font: inherit; text-align: left; cursor: pointer; color: #1f2328;
    background: #fff; border: 2px solid #c9ced6; border-radius: 12px;
}
.g-info-item:active { border-color: var(--sede); }
.g-info-icon { font-size: 30px; width: 36px; text-align: center; color: var(--sede); flex: 0 0 auto; }
.g-info-item-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g-info-item-title { font-size: 21px; font-weight: 600; }
.g-info-item-sub { font-size: 16px; color: #5c636b; }
.g-info-type { margin-left: auto; padding: 4px 12px; font-size: 14px; font-weight: 600; color: #4a5057; background: #f1f3f5; border-radius: 999px; flex: 0 0 auto; }
.g-info-text { font-size: 20px; line-height: 1.5; white-space: pre-line; padding: 20px 24px; background: #f6f7f9; border-radius: 12px; }
.g-info-link { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.g-qr { padding: 16px; background: #fff; border: 1px solid #dfe3e8; border-radius: 12px; min-width: 260px; min-height: 260px; }
.g-qr img, .g-qr canvas { display: block; }
.g-info-url { margin: 0; font-size: 16px; color: #5c636b; word-break: break-all; }
.g-pdf-viewer { border: 1px solid #dfe3e8; border-radius: 12px; overflow: hidden; }
.im-type-icon { margin-right: 8px; width: 16px; text-align: center; }
.im-sites { margin-top: 10px; }

/* Campo PDF (PdfFileField) */
.pdf-field { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; }
.pdf-card, .pdf-empty {
    display: flex; align-items: center; gap: 14px; width: 100%; box-sizing: border-box;
    padding: 12px 14px; border: 1px solid #dfe3e8; border-radius: 10px; background: #f8f9fb;
}
.pdf-card.new { border-color: #2b2f36; border-style: dashed; background: #fff; }
.pdf-card-icon { font-size: 30px; color: #d13438; flex: 0 0 auto; }
.pdf-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.pdf-card-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-card-text > span { font-size: 13px; color: #6b7178; display: flex; align-items: center; gap: 8px; }
.pdf-card-badge { padding: 1px 8px; font-size: 12px; font-weight: 600; color: #2b2f36; background: #e9ecef; border-radius: 999px; }
.pdf-card-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.pdf-card-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font: inherit; font-size: 14px;
    color: #2b2f36; background: #fff; border: 1px solid #ccd1d9; border-radius: 6px; cursor: pointer; text-decoration: none;
}
.pdf-card-btn:hover { background: #eef2f6; }
.pdf-card-btn.danger { color: #d13438; }
.pdf-empty { color: #6b7178; border-style: dashed; background: transparent; }
.pdf-empty i { font-size: 24px; }
.pdf-pick {
    position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; font-weight: 600;
    color: #2b2f36; background: #fff; border: 1px solid #2b2f36; border-radius: 6px; cursor: pointer;
}
.pdf-pick:hover { background: #f1f3f5; }
.pdf-pick:focus-within { outline: 2px solid #2b2f36; outline-offset: 2px; }
.pdf-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
html[data-theme="dark"] .pdf-card, html[data-theme="dark"] .pdf-empty { background: #262b33; border-color: #3a4049; }
html[data-theme="dark"] .pdf-card.new { background: #1f242b; border-color: #e6e8eb; }
html[data-theme="dark"] .pdf-card-text > span, html[data-theme="dark"] .pdf-empty { color: #9aa3ad; }
html[data-theme="dark"] .pdf-card-badge { color: #e6e8eb; background: #3a4049; }
html[data-theme="dark"] .pdf-card-btn, html[data-theme="dark"] .pdf-pick { color: #e6e8eb; background: #262b33; border-color: #4a525d; }
html[data-theme="dark"] .pdf-card-btn:hover, html[data-theme="dark"] .pdf-pick:hover { background: #313741; }
html[data-theme="dark"] .pdf-card-btn.danger { color: #ff8a80; }

/* Id e "Campo obbligatorio" a destra nella riga Azienda dei form di modifica */
.form-company-meta { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.form-company-meta .form-id, .form-company-meta .form-required-note { margin: 0; }

/* Anteprima video nei form Admin */
.video-preview-link {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 12px;
    font: inherit; font-size: 14px; font-weight: 600; color: #2b2f36; background: #fff; border: 1px solid #2b2f36; border-radius: 6px; cursor: pointer;
}
.video-preview-link:hover { background: #f1f3f5; }
.video-preview-invalid { margin-top: 6px; font-size: 13px; color: #b45309; }
.video-preview-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.video-preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
html[data-theme="dark"] .video-preview-link { color: #e6e8eb; background: #262b33; border-color: #4a525d; }
html[data-theme="dark"] .video-preview-link:hover { background: #313741; }
html[data-theme="dark"] .video-preview-invalid { color: #fbbf24; }

/* ===== Home page (vetrina) ===== */
.static-page:has(.hp) { display: block; padding: 0; background: #f6f5f2; }
.hp { --hp-ink: #1f2329; --hp-dark: #23272e; --hp-muted: #5c6168; --hp-line: #e2e0da; --hp-accent: #f5b301; color: var(--hp-ink); }
.hp-container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.hp h1, .hp h2, .hp h3 { letter-spacing: -.01em; }

.hp-btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; font: inherit; font-size: 16px; font-weight: 650;
    border-radius: 10px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s;
}
.hp-btn:hover { transform: translateY(-1px); text-decoration: none; }
.hp-btn-sm { padding: 8px 16px; font-size: 15px; }
.hp-btn-light { color: var(--hp-dark); background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.hp-btn-light:hover { color: var(--hp-dark); background: #f3f3f3; }
.hp-btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .45); background: transparent; }
.hp-btn-ghost:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, .08); }

/* Barra in alto */
.hp-top { position: sticky; top: 0; z-index: 20; background: rgba(28, 31, 36, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.hp-top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.hp-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 750; color: #fff; letter-spacing: .02em; }
.hp-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: var(--hp-dark); background: var(--hp-accent); border-radius: 9px; }

/* Hero */
.hp-hero {
    position: relative; overflow: hidden; color: #fff; padding: 72px 0 88px;
    background:
        radial-gradient(900px 420px at 85% 10%, rgba(245, 179, 1, .16), transparent 60%),
        radial-gradient(700px 400px at 0% 100%, rgba(120, 140, 170, .18), transparent 60%),
        linear-gradient(160deg, #1c1f24 0%, #2b2f36 60%, #343943 100%);
}
.hp-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.hp-hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hp-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 13px; font-weight: 650; color: #ffe08a; background: rgba(245, 179, 1, .12); border: 1px solid rgba(245, 179, 1, .35); border-radius: 999px; }
.hp-hero h1 { margin: 22px 0 18px; font-size: 54px; line-height: 1.05; font-weight: 800; }
.hp-hero h1 span { color: var(--hp-accent); }
.hp-lead { margin: 0; max-width: 560px; font-size: 19px; line-height: 1.55; color: #d5d8dd; }
.hp-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hp-chips { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 34px 0 0; padding: 0; list-style: none; font-size: 14px; color: #b9bec6; }
.hp-chips li { display: inline-flex; align-items: center; gap: 8px; }
.hp-chips i { color: var(--hp-accent); }

/* Tablet illustrato */
.hp-device { position: relative; justify-self: center; width: 100%; max-width: 440px; padding: 16px; background: #0f1114; border-radius: 28px; box-shadow: 0 30px 70px rgba(0, 0, 0, .5), inset 0 0 0 2px #2c3036; transform: rotate(-2deg); }
.hp-device-screen { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: #f6f5f2; border-radius: 16px; color: var(--hp-ink); }
.hp-mock-steps { display: flex; align-items: center; }
.hp-mock-steps span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 12px; font-weight: 700; color: #6b7178; background: #e4e2dc; border-radius: 50%; flex: 0 0 auto; }
.hp-mock-steps span.done { color: #fff; background: #2f8f5b; }
.hp-mock-steps span.active { color: #fff; background: var(--hp-dark); box-shadow: 0 0 0 4px rgba(35, 39, 46, .15); }
.hp-mock-steps i { flex: 1; height: 2px; margin: 0 6px; background: #d6d3cc; }
.hp-mock-video { position: relative; aspect-ratio: 16 / 8; border-radius: 10px; background: linear-gradient(135deg, #3b4350, #20242a); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hp-mock-play { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; padding-left: 4px; box-sizing: border-box; color: var(--hp-dark); background: #fff; border-radius: 50%; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.hp-mock-bar { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px; background: rgba(255, 255, 255, .25); border-radius: 4px; }
.hp-mock-bar b { display: block; width: 72%; height: 100%; background: var(--hp-accent); border-radius: 4px; }
.hp-mock-question { display: flex; flex-direction: column; gap: 7px; }
.hp-mock-question strong { font-size: 14px; margin-bottom: 2px; }
.hp-mock-question span { padding: 8px 11px; font-size: 12.5px; background: #fff; border: 1.5px solid #dcd9d2; border-radius: 8px; }
.hp-mock-question span.ok { display: flex; align-items: center; gap: 7px; font-weight: 600; border-color: #2f8f5b; background: #eaf6ef; color: #1e6b42; }
.hp-float { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px; font-weight: 650; color: var(--hp-ink); background: #fff; border-radius: 12px; box-shadow: 0 14px 30px rgba(0, 0, 0, .3); transform: rotate(2deg); }
.hp-float-ok { top: 38%; right: -34px; }
.hp-float-ok i { color: #2f8f5b; }
.hp-float-in { bottom: -18px; left: -28px; }
.hp-float-in i { color: #b07d00; }

/* Sezioni */
.hp-section { padding: 88px 0; }
.hp-section-alt { background: #fff; border-top: 1px solid var(--hp-line); border-bottom: 1px solid var(--hp-line); }
.hp-kicker { display: inline-block; font-size: 13px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #a17400; }
.hp-section h2 { margin: 8px 0 10px; font-size: 38px; line-height: 1.1; font-weight: 800; }
.hp-section-lead { margin: 0 0 40px; font-size: 18px; color: var(--hp-muted); }
.hp-section-alt h2 { margin-bottom: 40px; }

/* Passi */
.hp-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
.hp-steps::before { content: ""; position: absolute; top: 34px; left: 12%; right: 12%; height: 2px; background: repeating-linear-gradient(90deg, #cfcbc2 0 8px, transparent 8px 16px); }
.hp-steps li { position: relative; padding: 0 8px; text-align: center; }
.hp-step-icon { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; font-size: 26px; color: #fff; background: var(--hp-dark); border-radius: 20px; box-shadow: 0 10px 24px rgba(35, 39, 46, .25); }
.hp-step-num { position: absolute; top: -6px; left: calc(50% + 22px); z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; font-size: 13px; font-weight: 800; color: var(--hp-dark); background: var(--hp-accent); border: 3px solid #f6f5f2; border-radius: 50%; }
.hp-steps h3 { margin: 20px 0 8px; font-size: 19px; }
.hp-steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--hp-muted); }

/* Funzionalita' */
.hp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.hp-card { padding: 26px 22px; background: #fbfaf8; border: 1px solid var(--hp-line); border-radius: 16px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.hp-card:hover { transform: translateY(-4px); border-color: #d2cec5; box-shadow: 0 16px 34px rgba(31, 35, 41, .10); }
.hp-card h3 { margin: 16px 0 8px; font-size: 18px; }
.hp-card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--hp-muted); }
.hp-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; font-size: 21px; border-radius: 14px; flex: 0 0 auto; }
.hp-card-icon.c1 { color: #b45309; background: #fdf0dc; }
.hp-card-icon.c2 { color: #1d4ed8; background: #e3ebfd; }
.hp-card-icon.c3 { color: #047857; background: #dcf3ea; }
.hp-card-icon.c4 { color: #7c3aed; background: #ede6fd; }
.hp-card-icon.c5 { color: #be185d; background: #fbe4ef; }
.hp-card-icon.c6 { color: #0e7490; background: #dcf1f6; }
.hp-card-icon.c7 { color: #b91c1c; background: #fbe2e2; }
.hp-card-icon.c8 { color: #374151; background: #e9eaed; }
.hp-card-icon.c9 { color: #4338ca; background: #e4e6fb; }
.hp-card-icon.c10 { color: #92400e; background: #fde68a; }
.hp-card-icon.c11 { color: #0f766e; background: #ccfbf1; }
.hp-card-icon.c12 { color: #c2410c; background: #ffedd5; }

/* Ruoli e privacy */
.hp-roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 32px; }
.hp-role { display: flex; gap: 18px; padding: 22px 24px; background: #fff; border: 1px solid var(--hp-line); border-radius: 16px; }
.hp-role > i { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; font-size: 20px; color: #fff; background: var(--hp-dark); border-radius: 50%; flex: 0 0 auto; }
.hp-role h3 { margin: 2px 0 6px; font-size: 18px; }
.hp-role p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--hp-muted); }
.hp-privacy { display: flex; align-items: center; gap: 18px; margin-top: 28px; padding: 20px 24px; background: #eef7f2; border: 1px solid #cfe7da; border-radius: 16px; }
.hp-privacy p { margin: 0; font-size: 15px; line-height: 1.55; color: #2f4a3c; }

/* Invito finale e footer */
.hp-cta-band { padding: 56px 0; color: #fff; background: linear-gradient(120deg, #1c1f24, #2b2f36 70%, #3a3420); }
.hp-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hp-cta-band h2 { margin: 0 0 6px; font-size: 30px; font-weight: 800; }
.hp-cta-band p { margin: 0; color: #c9cdd3; }
.hp-footer { padding: 22px 0; font-size: 13px; color: #8a8f96; background: #16181c; text-align: center; }

@media (max-width: 1000px) {
    .hp-hero-inner { grid-template-columns: 1fr; }
    .hp-device { max-width: 400px; margin-top: 12px; }
    .hp-grid { grid-template-columns: repeat(2, 1fr); }
    .hp-steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
    .hp-steps::before { display: none; }
}
@media (max-width: 640px) {
    .hp-hero { padding: 48px 0 64px; }
    .hp-hero h1 { font-size: 38px; }
    .hp-section { padding: 64px 0; }
    .hp-section h2 { font-size: 30px; }
    .hp-grid, .hp-steps, .hp-roles { grid-template-columns: 1fr; }
    .hp-float-ok { right: -8px; }
    .hp-float-in { left: -8px; }
}

/* Tema scuro */
html[data-theme="dark"] .static-page:has(.hp) { background: #16181d; }
html[data-theme="dark"] .hp { --hp-ink: #e6e8eb; --hp-muted: #a3a9b1; --hp-line: #2c3138; }
html[data-theme="dark"] .hp-section-alt, html[data-theme="dark"] .hp-role { background: #1d2026; }
html[data-theme="dark"] .hp-card { background: #1f232a; }
html[data-theme="dark"] .hp-card:hover { border-color: #3a4049; box-shadow: 0 16px 34px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .hp-step-icon, html[data-theme="dark"] .hp-role > i { background: #3a4049; }
html[data-theme="dark"] .hp-step-num { border-color: #16181d; }
html[data-theme="dark"] .hp-steps::before { background: repeating-linear-gradient(90deg, #3a4049 0 8px, transparent 8px 16px); }
html[data-theme="dark"] .hp-kicker { color: #f5b301; }
html[data-theme="dark"] .hp-privacy { background: #18271f; border-color: #26412f; }
html[data-theme="dark"] .hp-privacy p { color: #b9d8c6; }
html[data-theme="dark"] .hp-device-screen { --hp-ink: #1f2329; }
.hp-section[id] { scroll-margin-top: 64px; }
html:has(.hp) { scroll-behavior: smooth; }

/* Campi nativi (giorni, data) del dialog Validità questionari: stile proprio, senza classi Telerik,
   cosi' in tema scuro il campo e il calendario del browser restano visibili anche con il focus. */
.vv-input {
    box-sizing: border-box; height: 38px; padding: 6px 10px; font: inherit; font-size: 15px;
    color: #1f2329; background: #fff; border: 1px solid #c9ced6; border-radius: 6px; color-scheme: light;
}
.vv-input:focus { outline: none; border-color: #2b2f36; box-shadow: 0 0 0 2px rgba(43, 47, 54, .15); }
html[data-theme="dark"] .vv-input { color: #e6e8eb; background: #1f232a; border-color: #4a525d; color-scheme: dark; }
html[data-theme="dark"] .vv-input:focus { border-color: #e6e8eb; box-shadow: 0 0 0 2px rgba(230, 232, 235, .2); }

/* ===== Pagine di accesso (AuthShell) ===== */
.static-page:has(.auth) { display: block; padding: 0; }
/* Barra in alto delle pagine di accesso: tono scuro come il pannello di sinistra, filo ambra in basso */
.auth-header {
    position: relative; z-index: 2; display: flex; align-items: center; height: 60px; padding: 0 24px; box-sizing: border-box;
    background: linear-gradient(100deg, #15171b 0%, #1c1f24 45%, #2b2f36 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
}
.auth-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none;
    background: linear-gradient(90deg, rgba(245, 179, 1, 0) 0%, #f5b301 35%, #f5b301 65%, rgba(245, 179, 1, 0) 100%);
}
.auth-header-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2em; color: #ffffff; text-decoration: none; }
.auth-header-brand:hover, .auth-header-brand:visited { color: #ffffff; text-decoration: none; }
.auth-header-brand strong { font-weight: 600; letter-spacing: .01em; }
.auth-header-brand .vi-mark { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.auth { display: grid; grid-template-columns: minmax(380px, 5fr) 6fr; min-height: calc(100vh - 60px); }
.auth-side {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; gap: 56px;
    padding: 40px 48px; color: #fff;
    background:
        radial-gradient(700px 380px at 90% 0%, rgba(245, 179, 1, .18), transparent 60%),
        radial-gradient(600px 360px at 0% 100%, rgba(120, 140, 170, .2), transparent 60%),
        linear-gradient(160deg, #1c1f24 0%, #2b2f36 65%, #343943 100%);
}
.auth-side::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 44px 44px;
}
.auth-side > * { position: relative; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 750; color: #fff; text-decoration: none; letter-spacing: .02em; }
.auth-brand:hover, .auth-brand:visited { color: #fff; text-decoration: none; }
.auth .hp-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: #23272e; background: #f5b301; border-radius: 9px; }
.auth-side-text h2 { margin: 0 0 28px; font-size: 36px; line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.auth-side-text h2 span { color: #f5b301; }
.auth-points { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 16px; color: #d5d8dd; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points i { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: #f5b301; background: rgba(245, 179, 1, .12); border-radius: 10px; flex: 0 0 auto; }
.auth-side-foot { margin-top: auto; font-size: 13px; color: #8a8f96; }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 24px; background: #f6f5f2; }
.auth .login-card { max-width: 480px; padding: 40px 40px 34px; border: 1px solid #e2e0da; border-radius: 18px; box-shadow: 0 18px 50px rgba(31, 35, 41, .08); }
.auth .login-card.device-login { max-width: 560px; }
.auth .login-header { justify-content: flex-start; margin-bottom: 22px; }
.auth-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8a6200; background: #fdf3d6; border-radius: 999px; }
.auth-kickers { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-kicker.auth-site { color: #3f4650; background: #eef0f3; }
.auth .login-card h1 { margin: 14px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.01em; border: 0; padding: 0; }
.auth-sub { margin: 0 0 14px; color: #5c6168; line-height: 1.5; }

.auth-field { position: relative; display: flex; align-items: center; }
.auth-field > i { position: absolute; left: 14px; color: #8a9099; pointer-events: none; }
.auth .login-form .auth-field input { width: 100%; padding-left: 42px; border: 1.5px solid #c9ced6; border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.auth .login-form .auth-field input:focus { outline: none; border-color: #2b2f36; box-shadow: 0 0 0 4px rgba(43, 47, 54, .12); }
.auth .login-form .auth-field:focus-within > i { color: #2b2f36; }
.auth .login-form .auth-field input[type=password], .auth .login-form .auth-field-wrap input { padding-right: 46px; }
.auth .login-form button.auth-eye {
    position: absolute; right: 6px; width: 36px; height: 36px; margin: 0; padding: 0; font-weight: 400;
    color: #6b7178; background: transparent; border-radius: 8px;
}
.auth .login-form button.auth-eye:hover { color: #1f2329; background: #eef0f3; }
.auth-field-wrap { display: flex; flex-direction: column; gap: 6px; }
.auth-caps { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #b45309; }
.auth-caps[hidden] { display: none; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; }
.auth-label-row label { margin-top: 0 !important; }
.auth-forgot { font-size: 14px; color: #5c6168; }
.auth .login-form button[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 10px; background: #23272e; transition: background .15s, transform .15s; }
.auth .login-form button[type=submit]:hover { background: #343943; }
.auth .login-form button[type=submit].busy { opacity: .75; cursor: progress; }
.auth .login-link { display: inline-block; margin-top: 20px; color: #5c6168; }
.auth-home { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #6b7178; text-decoration: none; }
.auth-home:hover { color: #1f2329; text-decoration: underline; }

/* Campi compilati dal browser: niente sfondo azzurro */
.auth input:-webkit-autofill, .auth input:-webkit-autofill:hover, .auth input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset; -webkit-text-fill-color: #1f2329; caret-color: #1f2329; transition: background-color 9999s;
}

/* Dispositivo/Portineria: campi grandi con icona */
.auth .device-login .login-form .auth-field input { padding-left: 54px; }
.auth .device-login .auth-field > i { left: 20px; font-size: 20px; }
.auth .device-login h1 { margin: 14px 0 6px; padding: 0; border: 0; font-size: 32px; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

html[data-theme="dark"] .auth-main { background: #16181d; }
html[data-theme="dark"] .auth .login-card { border-color: #2c3138; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .auth-kicker { color: #ffd66b; background: rgba(245, 179, 1, .14); }
html[data-theme="dark"] .auth-kicker.auth-site { color: #d5d9de; background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .auth-sub, html[data-theme="dark"] .auth-forgot, html[data-theme="dark"] .auth .login-link, html[data-theme="dark"] .auth-home { color: #a3a9b1; }
html[data-theme="dark"] .auth .login-form .auth-field input { background: #262b33; border-color: #4a525d; }
html[data-theme="dark"] .auth .login-form .auth-field input:focus { border-color: #e6e8eb; box-shadow: 0 0 0 4px rgba(230, 232, 235, .12); }
html[data-theme="dark"] .auth .login-form .auth-field:focus-within > i { color: #e6e8eb; }
html[data-theme="dark"] .auth .login-form button.auth-eye { color: #a3a9b1; background: transparent; }
html[data-theme="dark"] .auth .login-form button.auth-eye:hover { color: #fff; background: #313741; }
html[data-theme="dark"] .auth .login-form button[type=submit] { background: #e6e8eb; color: #16181d; }
html[data-theme="dark"] .auth .login-form button[type=submit]:hover { background: #fff; }
html[data-theme="dark"] .auth-caps { color: #fbbf24; }
html[data-theme="dark"] .auth input:-webkit-autofill, html[data-theme="dark"] .auth input:-webkit-autofill:hover, html[data-theme="dark"] .auth input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #262b33 inset; -webkit-text-fill-color: #e6e8eb; caret-color: #e6e8eb;
}

/* ===== Home del Dispositivo: grafica rinnovata (funziona con qualsiasi colore della Sede) ===== */
.g-shell {
    background:
        radial-gradient(1200px 520px at 50% -10%, color-mix(in srgb, var(--sede) 14%, transparent), transparent 70%),
        radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .05) 1px, transparent 0) 0 0 / 22px 22px,
        #f6f5f2;
}
.g-header { box-shadow: 0 6px 24px color-mix(in srgb, var(--sede) 30%, transparent); background: linear-gradient(120deg, var(--sede), color-mix(in srgb, var(--sede) 78%, #000)); }
.g-logo { padding: 8px 12px; border-radius: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.g-site-text { display: flex; flex-direction: column; line-height: 1.15; }
.g-site-sub { font-size: 15px; font-weight: 500; opacity: .8; }
.g-langs { gap: 6px; padding: 5px; background: color-mix(in srgb, var(--sede-ink, #fff) 14%, transparent); border-radius: 999px; }
.g-langs .g-lang { min-width: 64px; height: 46px; border: 0; border-radius: 999px; background: transparent; }
.g-langs .g-lang.on { box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }

.g-home { gap: 40px; padding: 8px 0 12px; }
.g-hello { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: g-rise .5s ease-out both; }
.g-clock { min-height: 22px; font-size: 18px; font-weight: 600; letter-spacing: .02em; color: #6b7178; }
.g-title span { color: var(--sede); }
.g-hello-sub { margin: 0; font-size: 22px; color: #5c6168; }

.g-tiles { align-items: stretch; }
.g-tile {
    position: relative; overflow: hidden; border: 0; border-radius: 24px;
    box-shadow: 0 14px 34px rgba(31, 35, 41, .12); transition: transform .12s ease, box-shadow .12s ease;
    animation: g-rise .5s ease-out both;
}
.g-tile:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(31, 35, 41, .14); }
.g-tile.primary {
    width: 480px; height: 290px;
    background: linear-gradient(135deg, var(--sede), color-mix(in srgb, var(--sede) 70%, #000));
    box-shadow: 0 18px 40px color-mix(in srgb, var(--sede) 35%, transparent);
}
.g-tile.primary::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: color-mix(in srgb, var(--sede-ink, #fff) 10%, transparent); pointer-events: none;
}
.g-tile.outline { width: 380px; height: 290px; animation-delay: .08s; border: 2px solid color-mix(in srgb, var(--sede) 25%, #fff); }
.g-tile > svg {
    box-sizing: content-box; padding: 14px; border-radius: 18px;
    background: color-mix(in srgb, currentColor 14%, transparent);
}
.g-tile-go {
    position: absolute; right: 28px; bottom: 28px; display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; font-size: 24px; border-radius: 50%;
    background: color-mix(in srgb, currentColor 16%, transparent);
}
.g-tile-text { padding-right: 72px; }

.g-info-btn {
    max-width: 892px; gap: 18px; padding: 18px 22px; border: 0; border-radius: 20px; color: #1f2329;
    box-shadow: 0 10px 28px rgba(31, 35, 41, .08); animation: g-rise .5s ease-out .16s both; transition: transform .12s;
}
.g-info-btn:active { transform: scale(.98); }
.g-info-btn-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; font-size: 26px; flex: 0 0 auto;
    color: var(--sede-ink, #fff); background: var(--sede); border-radius: 16px;
}
.g-info-btn-title { color: #1f2329; }
.g-info-btn-sub { color: #6b7178; }
.g-info-count { margin-left: auto; padding: 6px 14px; font-size: 15px; font-weight: 700; color: var(--sede); background: color-mix(in srgb, var(--sede) 10%, #fff); border-radius: 999px; white-space: nowrap; }
.g-info-chevron { margin-left: 0 !important; font-size: 20px; color: #9aa0a8; }

.g-help { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; color: #6b7178; animation: g-rise .5s ease-out .24s both; }
.g-help i { color: var(--sede); }

@keyframes g-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .g-hello, .g-tile, .g-info-btn, .g-help { animation: none; }
}
@media (max-width: 1000px) {
    .g-tile.primary, .g-tile.outline { width: 100%; max-width: 480px; height: 240px; }
}

/* ===== Passi del Dispositivo (identificazione, dati, video, test, esito, uscita) ===== */
.g-main > .g-panel {
    box-sizing: border-box; padding: 36px 40px; background: #fff; border-radius: 28px;
    box-shadow: 0 18px 48px rgba(31, 35, 41, .10); animation: g-rise .4s ease-out both;
}
.g-main > .g-panel.g-video-panel { max-width: 1000px; }

/* Stepper */
.g-steps { gap: 10px; padding-top: 24px; }
.g-step-dot { width: 46px; height: 46px; font-size: 18px; border: 0; background: #fff; color: #9aa0a8; box-shadow: 0 2px 8px rgba(31, 35, 41, .10); transition: background .3s, color .3s, box-shadow .3s; }
.g-step.active .g-step-dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sede) 20%, transparent), 0 6px 16px color-mix(in srgb, var(--sede) 35%, transparent); }
.g-step.done .g-step-dot { color: var(--sede-ink, #fff); background: color-mix(in srgb, var(--sede) 75%, #fff); }
.g-step-line { position: relative; width: 56px; height: 4px; border-radius: 4px; background: #dcdad4; overflow: hidden; }
.g-step-line.done { background: #dcdad4; }
.g-step-line.done::after { content: ""; position: absolute; inset: 0; background: var(--sede); animation: g-fill .5s ease-out both; transform-origin: left; }
@keyframes g-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Intestazione con icona */
.g-panel-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.g-hero-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 10px; font-size: 32px;
    color: var(--sede-ink, #fff); background: linear-gradient(135deg, var(--sede), color-mix(in srgb, var(--sede) 70%, #000));
    border-radius: 22px; box-shadow: 0 10px 24px color-mix(in srgb, var(--sede) 35%, transparent);
}

/* Campi con icona */
.g-input { position: relative; display: flex; align-items: center; }
.g-input > i { position: absolute; left: 20px; font-size: 20px; color: #9aa0a8; pointer-events: none; transition: color .15s; }
.g-input input { width: 100%; height: 64px; padding-left: 56px !important; border: 2px solid #d4d1ca !important; border-radius: 14px !important; transition: border-color .15s, box-shadow .15s; }
.g-input input:focus { border-color: var(--sede) !important; box-shadow: 0 0 0 5px color-mix(in srgb, var(--sede) 15%, transparent) !important; }
.g-input:focus-within > i { color: var(--sede); }

/* Tipologie come tessere */
.g-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.g-types legend { grid-column: 1 / -1; }
.g-types .g-radio { position: relative; min-height: 84px; padding: 0 20px; border-radius: 16px; border-color: #dcdad4; transition: border-color .15s, background .15s, transform .1s; }
.g-types .g-radio:active { transform: scale(.98); }
.g-types .g-radio input { position: absolute; opacity: 0; pointer-events: none; }
.g-type-check { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto; font-size: 16px; color: transparent; border: 2px solid #c9c6bf; border-radius: 50%; transition: all .15s; }
.g-types .g-radio:has(input:checked) { border-color: var(--sede); background: color-mix(in srgb, var(--sede) 7%, #fff); }
.g-types .g-radio:has(input:checked) .g-type-check { color: var(--sede-ink, #fff); background: var(--sede); border-color: var(--sede); }
.g-types .g-badge { padding: 4px 10px; font-size: 13px; color: var(--sede-ink, #fff); background: var(--sede); border-radius: 999px; }

/* Video */
.g-video { border-radius: 18px; box-shadow: 0 0 0 8px #1c1f24, 0 20px 50px rgba(0, 0, 0, .30); }
.g-video-state { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; padding: 14px 18px; font-size: 19px; font-weight: 600; border-radius: 14px; }
.g-video-state.wait { color: #6b5200; background: #fff6d6; }
.g-video-state.wait i { animation: g-spin 2.4s linear infinite; }
.g-video-state.done { color: #14532d; background: #e6f4ea; }
@keyframes g-spin { 50% { transform: rotate(180deg); } 100% { transform: rotate(180deg); } }
.g-btn.g-glow { animation: g-glow 1.6s ease-in-out infinite; }
@keyframes g-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sede) 45%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--sede) 0%, transparent); } }

/* Test */
.g-test-panel { animation: g-slide .35s ease-out both !important; }
@keyframes g-slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.g-segments { display: flex; gap: 6px; }
.g-segments span { flex: 1; height: 8px; border-radius: 8px; background: #e3e1db; transition: background .3s; }
.g-segments span.done { background: color-mix(in srgb, var(--sede) 55%, #fff); }
.g-segments span.now { background: var(--sede); }
.g-answers { gap: 14px; }
.g-answers .g-radio { min-height: 76px; padding: 12px 20px; border-radius: 16px; border-color: #dcdad4; transition: border-color .15s, background .15s, transform .1s; }
.g-answers .g-radio:active { transform: scale(.99); }
.g-answers .g-radio input { position: absolute; opacity: 0; pointer-events: none; }
.g-letter {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto;
    font-size: 20px; font-weight: 800; color: #5c6168; background: #f1f0ec; border-radius: 12px; transition: all .15s;
}
.g-answers .g-radio:has(input:checked) { border-color: var(--sede); background: color-mix(in srgb, var(--sede) 7%, #fff); }
.g-answers .g-radio:has(input:checked) .g-letter { color: var(--sede-ink, #fff); background: var(--sede); }

/* Pulsanti */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 16px; transition: transform .1s, box-shadow .15s, opacity .15s; }
.g-btn:not(:disabled):active { transform: scale(.98); }
.g-btn.primary:not(:disabled) { box-shadow: 0 10px 24px color-mix(in srgb, var(--sede) 30%, transparent); }

/* Esito */
.g-result { position: relative; overflow: hidden; }
.g-status { border: 0 !important; border-radius: 20px; }
.g-status-icon { width: 84px; height: 84px; }
.g-pop { animation: g-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes g-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.g-check-path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: g-draw .5s .3s ease-out forwards; }
@keyframes g-draw { to { stroke-dashoffset: 0; } }
.g-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.g-confetti i {
    position: absolute; top: -12px; left: calc(var(--i) * 7% + 3%); width: 10px; height: 14px; border-radius: 3px;
    background: var(--sede); opacity: 0; animation: g-confetti 1.8s ease-in calc(var(--i) * .07s) forwards;
}
.g-confetti i:nth-child(3n) { background: #f5b301; }
.g-confetti i:nth-child(3n+1) { background: #2f8f5b; width: 8px; height: 8px; border-radius: 50%; }
@keyframes g-confetti {
    0% { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 0; transform: translateY(420px) rotate(540deg); }
}
.g-summary { padding: 22px 26px; background: #f8f7f4; border-radius: 18px; }
.g-summary dt { display: flex; align-items: center; gap: 10px; }
.g-summary dt i { width: 22px; color: var(--sede); }
.g-reception-note { display: flex; align-items: center; gap: 12px; }

.g-score { display: flex; flex-direction: column; gap: 8px; }
.g-score-bar { position: relative; height: 16px; background: #f1e4e2; border-radius: 16px; }
.g-score-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #e8857c, #d93025); border-radius: 16px; animation: g-fill .7s ease-out both; transform-origin: left; }
.g-score-mark { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: #1f2329; border-radius: 4px; }
.g-score-legend { display: flex; justify-content: space-between; font-size: 18px; color: #5c6168; }
.g-score-legend strong { color: #8a1f17; }

.g-return { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 18px; color: #5c6168; }
.g-ring { width: 52px; height: 52px; transform: rotate(-90deg); }
.g-ring circle { fill: none; stroke-width: 4; }
.g-ring-bg { stroke: #e3e1db; }
.g-ring-fg { stroke: var(--sede); stroke-linecap: round; stroke-dasharray: 119.38; transition: stroke-dashoffset 1s linear; }
.g-ring text { transform: rotate(90deg); transform-origin: 22px 22px; font-size: 15px; font-weight: 800; fill: #1f2329; }

/* Uscita */
.g-entry-chip { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; border: 0; background: #f1f0ec; border-radius: 999px; padding: 12px 20px; }
.g-entry-chip i { color: var(--sede); }

@media (prefers-reduced-motion: reduce) {
    .g-main > .g-panel, .g-test-panel, .g-pop, .g-check-path, .g-confetti i, .g-btn.g-glow, .g-video-state.wait i, .g-step-line.done::after, .g-score-fill { animation: none !important; }
    .g-check-path { stroke-dashoffset: 0; }
    .g-confetti { display: none; }
}
@media (max-width: 900px) {
    .g-main > .g-panel { padding: 24px; border-radius: 22px; }
    .g-types { grid-template-columns: 1fr; }
}

/* ===== Menu laterale (amministrazione) ===== */
.mainlayout-drawer > .k-drawer .k-drawer-items { display: flex; flex-direction: column; min-height: calc(100% - 1em); margin-top: .5em; padding: 0 8px 8px; box-sizing: border-box; }
.mainlayout-drawer .k-drawer-item { position: relative; margin: 1px 0; padding: 7px 10px; border-radius: 10px; transition: background-color .15s, color .15s; }
.mainlayout-drawer .k-drawer-item:hover { background-color: #eceef1; }
.mainlayout-drawer .k-drawer-item.k-selected,
.mainlayout-drawer .k-drawer-item.k-selected:hover { color: #fff; background-color: #23272e; box-shadow: 0 6px 16px rgba(35, 39, 46, .18); }
.mainlayout-drawer .k-drawer-item.k-selected::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 4px; background: #f5b301; border-radius: 0 4px 4px 0; }

.drawer-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; color: #4b5563; background: #f1f2f4; transition: background-color .15s, color .15s; }
.drawer-icon .drawer-fa { width: auto; font-size: 15px; }
.mainlayout-drawer .k-drawer-item.k-selected .drawer-icon { color: #23272e; background: #f5b301; }
.drawer-item-tip { gap: 12px; }

/* Intestazioni di sezione e fondo: non cliccabili */
.mainlayout-drawer .k-drawer-item:has(.drawer-section),
.mainlayout-drawer .k-drawer-item:has(.drawer-footer) { pointer-events: none; cursor: default; background: transparent !important; box-shadow: none !important; }
.mainlayout-drawer .k-drawer-item:has(.drawer-section) { min-height: 0; margin-top: 14px; padding: 4px 10px 2px; }
.drawer-section { display: block; width: 100%; font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: #9aa0a8; }
.drawer-section:empty { height: 1px; background: #dfe3e8; }
.mainlayout-drawer .k-drawer-item:has(.drawer-footer) { margin-top: auto; padding-top: 14px; border-top: 1px solid #e5e7eb; border-radius: 0; }
.drawer-footer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drawer-footer-logo { max-width: 34px; max-height: 34px; object-fit: contain; padding: 3px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; flex: 0 0 auto; }
.drawer-footer-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.drawer-footer-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-footer-text span { font-size: 11px; color: #9aa0a8; }

/* Menu compresso: icone centrate */
.mainlayout-drawer.is-mini .k-drawer-item { justify-content: center; }

/* Tema scuro */
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item:hover { background-color: #262b33; }
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item.k-selected,
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item.k-selected:hover { color: #16181d; background-color: #e6e8eb; }
html[data-theme="dark"] .drawer-icon { color: #cfd5dc; background: #262b33; }
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item.k-selected .drawer-icon { color: #16181d; background: #f5b301; }
html[data-theme="dark"] .drawer-section { color: #6b7380; }
html[data-theme="dark"] .drawer-section:empty { background: #2e333b; }
html[data-theme="dark"] .mainlayout-drawer .k-drawer-item:has(.drawer-footer) { border-top-color: #2e333b; }
html[data-theme="dark"] .drawer-footer-logo { border-color: #3a4049; }

/* Menu compresso: larghezza sufficiente per i riquadri delle icone, niente tagli ne' scroll orizzontale */
.mainlayout-drawer.is-mini .k-drawer-wrapper { width: 64px !important; overflow-x: hidden; }
.mainlayout-drawer.is-mini .k-drawer-items { padding: 0 8px 8px; }
.mainlayout-drawer.is-mini .k-drawer-item { justify-content: center; padding: 6px 0; }
.mainlayout-drawer.is-mini .drawer-item-tip { justify-content: center; gap: 0; }
.mainlayout-drawer.is-mini .k-drawer-item.k-selected::before { left: -8px; }
.mainlayout-drawer.is-mini .k-drawer-item:has(.drawer-section) { margin: 10px 4px 6px; padding: 0; }
.mainlayout-drawer.is-mini .drawer-footer { justify-content: center; }
.mainlayout-drawer.is-mini .k-drawer-item:has(.drawer-footer) { padding: 12px 0 4px; }
.mainlayout-drawer .k-drawer-wrapper { overflow-x: hidden; }

/* Barra in alto, tema chiaro: gradiente leggero e filo d'accento in basso */
html:not([data-theme="dark"]) .k-appbar.appbar-top {
    background: linear-gradient(100deg, #ffffff 0%, #f5f6f8 45%, #e7eaee 100%);
    box-shadow: 0 4px 18px rgba(31, 35, 41, .08);
}
html:not([data-theme="dark"]) .k-appbar.appbar-top::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none;
    background: linear-gradient(90deg, #23272e 0%, #23272e 30%, #f5b301 70%, rgba(245, 179, 1, 0) 100%);
}

/* Intestazione delle pagine, tema chiaro: stesso gradiente e accento ambra della barra in alto */
html:not([data-theme="dark"]) .page-header::after,
html:not([data-theme="dark"]) .mainlayout-drawer main > h1::after,
html:not([data-theme="dark"]) .rd-head h1::after {
    width: 320px; height: 4px;
    background: linear-gradient(90deg, #23272e 0%, #23272e 30%, #f5b301 70%, rgba(245, 179, 1, 0) 100%);
}
html:not([data-theme="dark"]) .page-header-icon {
    background: linear-gradient(135deg, #3a404a 0%, #23272e 60%, #1a1d22 100%);
    box-shadow: 0 6px 16px rgba(31, 35, 41, .22), inset 0 -3px 0 #f5b301;
}

/* Home del Dispositivo: le due card della stessa larghezza */
.g-tile.primary, .g-tile.outline { width: 430px; height: 290px; }
.g-info-btn { max-width: 892px; }
@media (max-width: 1000px) {
    .g-tile.primary, .g-tile.outline { width: 100%; max-width: 480px; height: 240px; }
}

/* Dashboard: card cliccabili che scelgono l'elenco mostrato sotto */
.dash-card.dash-click { cursor: pointer; position: relative; }
.dash-card.dash-click:focus-visible { outline: 3px solid #23272e; outline-offset: 2px; }
.dash-card.dash-active { border-width: 2px; border-color: #23272e; box-shadow: 0 10px 24px rgba(16, 24, 40, .14); }
.dash-card.dash-active::after {
    content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 16px; top: 14px;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px;
    color: #fff; background: #23272e; border-radius: 50%;
}
html[data-theme="dark"] .dash-card.dash-active { border-color: #e6e8eb; }
html[data-theme="dark"] .dash-card.dash-active::after { color: #16181d; background: #e6e8eb; }

/* Pulsanti "contorno rosso" (es. Rimuovi): al passaggio si riempiono di rosso */
.k-button-outline-error:hover, .k-button-outline-error:focus-visible {
    color: #fff !important; background-color: #d13438 !important; border-color: #d13438 !important;
}
html[data-theme="dark"] .k-button-outline-error:hover, html[data-theme="dark"] .k-button-outline-error:focus-visible {
    color: #fff !important; background-color: #e5484d !important; border-color: #e5484d !important;
}

/* Finestre di modifica: Salva/Annulla sempre ancorati in fondo, anche con poco contenuto */
.company-window .k-window-content { display: flex; flex-direction: column; }
.company-window .k-window-content > * { flex: 0 0 auto; }
.company-window .k-window-content > .k-form { flex: 1 0 auto; display: flex; flex-direction: column; }
.company-window .k-window-content > .k-form > .k-form-buttons { margin: auto -28px 0 !important; }

/* Finestra "Accedi" della home */
.ha-dialog { max-width: 520px; }
.ha-dialog[open] { animation: ha-in .22s ease-out; }
.ha-dialog::backdrop { background: rgba(16, 18, 22, .6); backdrop-filter: blur(3px); }
@keyframes ha-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ha-card { padding: 30px 30px 26px !important; border: 0 !important; border-radius: 22px !important; overflow: hidden; }
.ha-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #23272e 0%, #23272e 30%, #f5b301 70%, rgba(245, 179, 1, .2) 100%); }
.ha-close { top: 14px; right: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #6b7178; border-radius: 10px; }
.ha-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.ha-mark { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; font-size: 20px; color: #23272e; background: #f5b301; border-radius: 14px; flex: 0 0 auto; box-shadow: 0 6px 16px rgba(245, 179, 1, .35); }
.ha-card .sc-box-title { margin: 0; font-size: 24px; font-weight: 800; }
.ha-sub { margin: 2px 0 0; font-size: 14px; color: #6b7178; }
.ha-field { position: relative; display: flex; align-items: center; }
.ha-field > i { position: absolute; left: 15px; color: #9aa0a8; pointer-events: none; }
.ha-field .ha-input { padding-left: 42px; border: 1.5px solid #c9ced6; border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.ha-field .ha-input:focus { border-color: #23272e; box-shadow: 0 0 0 4px rgba(35, 39, 46, .12); }
.ha-field:focus-within > i { color: #23272e; }
.ha-actions { gap: 10px; margin-top: 14px; }
.ha-role {
    display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; font: inherit; text-align: left; cursor: pointer;
    color: #1f2329; background: #fff; border: 1.5px solid #e2e0da; border-radius: 14px;
    transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
}
.ha-role:hover { border-color: #23272e; box-shadow: 0 8px 20px rgba(31, 35, 41, .10); transform: translateY(-1px); }
.ha-role:active { transform: scale(.99); }
.ha-role-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 18px; color: #fff; background: #23272e; border-radius: 12px; flex: 0 0 auto; transition: background .15s, color .15s; }
.ha-role:hover .ha-role-icon { color: #23272e; background: #f5b301; }
.ha-role-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ha-role-text strong { font-size: 16px; }
.ha-role-text span { font-size: 13px; color: #6b7178; }
.ha-role-go { margin-left: auto; color: #b0b5bc; transition: transform .15s, color .15s; }
.ha-role:hover .ha-role-go { color: #23272e; transform: translateX(3px); }

html[data-theme="dark"] .ha-card { background: #1f2329 !important; }
html[data-theme="dark"] .ha-sub, html[data-theme="dark"] .ha-role-text span { color: #a3a9b1; }
html[data-theme="dark"] .ha-field .ha-input { color: #e6e8eb; background: #262b33; border-color: #4a525d; }
html[data-theme="dark"] .ha-field .ha-input:focus { border-color: #e6e8eb; box-shadow: 0 0 0 4px rgba(230, 232, 235, .12); }
html[data-theme="dark"] .ha-role { color: #e6e8eb; background: #262b33; border-color: #3a4049; }
html[data-theme="dark"] .ha-role:hover { border-color: #e6e8eb; }
html[data-theme="dark"] .ha-role-icon { color: #16181d; background: #e6e8eb; }
html[data-theme="dark"] .ha-close { color: #a3a9b1; }
html[data-theme="dark"] .ha-close:hover { background: #313741; }

/* ===== Procedura guidata Nuovo questionario ===== */
.survey-wizard-window .sw-wizard { flex: 1 0 auto; display: flex; flex-direction: column; }
.survey-wizard-window .k-wizard { padding: 0; }
.survey-wizard-window .k-wizard-steps { flex: 1 0 auto; }
.survey-wizard-window .k-wizard-buttons {
    position: sticky; bottom: 0; z-index: 2; margin: 16px -28px 0; padding: 14px 28px;
    background: #f8f9fa; border-top: 1px solid #e5e7eb;
}
.sw-step { display: flex; flex-direction: column; gap: 16px; padding: 8px 2px 4px; }
.sw-intro { margin: 0; color: #5c6168; }
.sw-field { display: flex; flex-direction: column; gap: 6px; }
.sw-field > label { font-weight: 600; }
.sw-field > label.required::after { content: " *"; color: #6b7280; }
.sw-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sw-callout { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; color: #1f3a5f; background: #eef4fb; border-radius: 12px; line-height: 1.45; }
.sw-callout.warn { color: #6b4d00; background: #fff6d6; }
.sw-qhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sw-counter { flex: 0 0 auto; padding: 5px 12px; font-size: 13px; font-weight: 700; color: #23272e; background: #f1f0ec; border-radius: 999px; }
.sw-question { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: #fbfaf8; border: 1px solid #e2e0da; border-left: 4px solid #d4d1ca; border-radius: 12px; }
.sw-question.ready { border-left-color: #2f8f5b; }
.sw-question-head { display: flex; align-items: flex-start; gap: 10px; }
.sw-qnum { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 auto; font-weight: 800; color: #fff; background: #23272e; border-radius: 50%; }
.sw-answers { display: flex; flex-direction: column; gap: 8px; padding-left: 40px; }
.sw-answer { display: flex; align-items: center; gap: 10px; }
.sw-answer.correct .k-textbox { border-color: #2f8f5b; background: #f0faf4; }
.sw-correct input { width: 18px; height: 18px; accent-color: #2f8f5b; cursor: pointer; }
.sw-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font: inherit; font-size: 14px; font-weight: 600; color: #23272e; background: none; border: 0; cursor: pointer; }
.sw-link:hover { text-decoration: underline; }
.sw-ref { font-style: italic; }
.sw-tr-answer { display: flex; align-items: flex-start; gap: 10px; padding-left: 8px; }
.sw-letter { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 auto; margin-top: 4px; font-weight: 800; color: #5c6168; background: #f1f0ec; border-radius: 8px; }
.sw-letter.correct { color: #fff; background: #2f8f5b; }
.sw-tr-answer .sw-field { flex: 1; }
.sw-matrix-wrap { overflow-x: auto; border: 1px solid #e2e0da; border-radius: 12px; }
.sw-matrix { width: 100%; border-collapse: collapse; }
.sw-matrix th, .sw-matrix td { padding: 10px 14px; border-bottom: 1px solid #eceae5; text-align: left; white-space: nowrap; }
.sw-matrix thead th { font-size: 13px; color: #5c6168; background: #f6f5f2; }
.sw-matrix tbody th { font-weight: 600; }
.sw-cell { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.sw-cell.on { background: #eaf6ef; }
.sw-cell input { width: 18px; height: 18px; accent-color: #23272e; cursor: pointer; }
.sw-now { font-size: 12px; color: #8a6200; }
.sw-summary { display: grid; grid-template-columns: 140px 1fr; gap: 10px 20px; margin: 0; padding: 18px 20px; background: #f8f7f4; border-radius: 14px; }
.sw-summary dt { color: #6b7178; font-weight: 600; }
.sw-summary dd { margin: 0; }
.sw-break { word-break: break-all; }

html[data-theme="dark"] .survey-wizard-window .k-wizard-buttons { background: #1b1e24; border-top-color: #3a4049; }
html[data-theme="dark"] .sw-intro, html[data-theme="dark"] .sw-summary dt { color: #a3a9b1; }
html[data-theme="dark"] .sw-question, html[data-theme="dark"] .sw-summary { background: #262b33; border-color: #3a4049; }
html[data-theme="dark"] .sw-callout { color: #cfe0f5; background: #1d2a3a; }
html[data-theme="dark"] .sw-callout.warn { color: #ffe08a; background: #3a3214; }
html[data-theme="dark"] .sw-counter, html[data-theme="dark"] .sw-letter { color: #e6e8eb; background: #313741; }
html[data-theme="dark"] .sw-qnum { color: #16181d; background: #e6e8eb; }
html[data-theme="dark"] .sw-link { color: #e6e8eb; }
html[data-theme="dark"] .sw-matrix-wrap { border-color: #3a4049; }
html[data-theme="dark"] .sw-matrix thead th { color: #a3a9b1; background: #262b33; }
html[data-theme="dark"] .sw-matrix th, html[data-theme="dark"] .sw-matrix td { border-bottom-color: #2e333b; }
html[data-theme="dark"] .sw-cell.on { background: #18271f; }

/* Wizard: titolo sopra le risposte */
.sw-answers-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5b6470; margin-top: 2px; }
.sw-answers-title small { font-weight: 400; text-transform: none; letter-spacing: 0; color: #8a929c; }
html[data-theme="dark"] .sw-answers-title { color: #aab2bd; }
html[data-theme="dark"] .sw-answers-title small { color: #808893; }
.sw-avail { font-weight: 400; color: #8a929c; }
html[data-theme="dark"] .sw-avail { color: #808893; }

/* Wizard Nuova Azienda */
.cw-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.cw-title { flex: 1; align-self: center; font-size: 15px; }
.cw-title i { margin-right: 4px; color: #6b7178; }
.cw-body { display: flex; flex-direction: column; gap: 14px; padding-left: 40px; }
.cw-prefixed { display: flex; align-items: stretch; }
.cw-prefixed .cw-prefix { display: inline-flex; align-items: center; padding: 0 10px; font-weight: 600; color: #5c6168; background: #f1f0ec; border: 1px solid #d9d7d1; border-right: 0; border-radius: 8px 0 0 8px; white-space: nowrap; }
.cw-prefixed .k-textbox { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cw-toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.cw-reception { padding: 14px 16px; background: #fff; border: 1px dashed #d9d7d1; border-radius: 12px; }
.sw-link:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }
html[data-theme="dark"] .cw-prefixed .cw-prefix { color: #c3c8cf; background: #313741; border-color: #3a4049; }
html[data-theme="dark"] .cw-reception { background: #1f2329; border-color: #3a4049; }
html[data-theme="dark"] .cw-title i { color: #a3a9b1; }
@media (max-width: 760px) { .cw-grid2 { grid-template-columns: 1fr; } .cw-body { padding-left: 0; } }
.cw-reception { display: flex; flex-direction: column; gap: 16px; }
.cw-pins { display: flex; flex-direction: column; gap: 16px; }
.cw-pins .pin-row { flex-wrap: wrap; }
.cw-rhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cw-rhead strong { font-size: 14px; }
.cw-rhead i { margin-right: 4px; color: #6b7178; }
html[data-theme="dark"] .cw-rhead i { color: #a3a9b1; }

/* Filtri di colonna nelle griglie (riga filtri) */
.gf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.gf-search { position: relative; display: inline-flex; align-items: center; }
.gf-search > i { position: absolute; left: 12px; z-index: 1; font-size: 13px; color: #8a929c; pointer-events: none; }
.gf-search .k-textbox .k-input-inner { padding-left: 34px; }
.gf-toggle { display: inline-flex; align-items: center; gap: 8px; }
.gf-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; color: #fff; background: #c62828; border-radius: 999px; }
.gf-cell { display: flex; align-items: center; gap: 4px; width: 100%; }
.gf-cell > .k-input, .gf-cell > .k-picker, .gf-cell > .k-dropdownlist, .gf-cell > .k-datepicker { flex: 1 1 auto; min-width: 0; }
.gf-range { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.gf-clear.k-button { flex: 0 0 auto; padding: 4px; }
.gf-clear.k-disabled { opacity: .35; }
.gf-grid .k-filter-row td, .gf-grid .k-filter-row th { padding: 6px 6px; vertical-align: top; }
html[data-theme="dark"] .gf-search > i { color: #808893; }
.gf-clear.k-button-solid-error, .gf-clear.k-button-solid-error .k-svg-icon { color: #fff; }
.gf-clear.k-button-solid-error .k-svg-icon svg { fill: #fff; }
.gf-grid .k-filter-row, .gf-grid .k-filter-row td, .gf-grid .k-filter-row th { background: #e8eef6; }
.gf-grid .k-filter-row td, .gf-grid .k-filter-row th { border-bottom: 2px solid #c9d6e6; }
.gf-grid .k-filter-row .k-input, .gf-grid .k-filter-row .k-picker { background: #fff; }
html[data-theme="dark"] .gf-grid .k-filter-row, html[data-theme="dark"] .gf-grid .k-filter-row td, html[data-theme="dark"] .gf-grid .k-filter-row th { background: #1f2a38; }
html[data-theme="dark"] .gf-grid .k-filter-row td, html[data-theme="dark"] .gf-grid .k-filter-row th { border-bottom-color: #34465c; }
html[data-theme="dark"] .gf-grid .k-filter-row .k-input, html[data-theme="dark"] .gf-grid .k-filter-row .k-picker { background: #16181d; }
.k-grid .k-grid-header .gf-clear.k-button-solid-error,
.k-grid .k-grid-header .gf-clear.k-button-solid-error .k-svg-icon { color: #fff !important; }
.k-grid .k-grid-header .gf-clear.k-button-solid-error .k-svg-icon svg { fill: #fff !important; }
.gf-toggle .gf-badge, .k-button .gf-badge { margin-left: 8px !important; }
/* Numero dei filtri attivi su "Azzera filtri" (pulsante rosso pieno): badge bianco con il numero in rosso */
.k-button-solid-error .gf-badge, .k-button-solid.k-button-error .gf-badge, .k-button-solid.k-button-solid-error .gf-badge { color: #c62828 !important; background: #fff !important; }
.gf-toggle .k-button-text { display: inline-flex; align-items: center; gap: 8px; }
.gf-clear.gf-on, .gf-clear.gf-on *, .k-grid .k-grid-header .gf-clear.gf-on .k-svg-icon { color: #fff !important; }
.gf-clear.gf-on svg, .gf-clear.gf-on svg * { fill: #fff !important; }
.rd-legend-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rd-legend-count { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* Database non raggiungibile: avviso e accessi sospesi */
.db-down-banner { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding: 14px 18px; color: #7a1d1d; background: #fdecec; border: 1px solid #f3b8b8; border-left: 5px solid #c62828; border-radius: 12px; line-height: 1.45; }
.db-down-banner > i { margin-top: 3px; font-size: 18px; color: #c62828; }
.db-down-banner strong { display: block; margin-bottom: 2px; }
.db-down-wrap { padding-top: 16px; }
.db-down [data-open-login], .db-down form button[type="submit"] { opacity: .45; pointer-events: none; cursor: not-allowed; }
html[data-theme="dark"] .db-down-banner { color: #ffd2d2; background: #3a1d1d; border-color: #6b2b2b; border-left-color: #ef5350; }
html[data-theme="dark"] .db-down-banner > i { color: #ef5350; }
.appbar-avatar-desk { font-size: 16px; }
.appbar-last i { margin-right: 3px; font-size: 11px; }

/* Marchio VarcoSafe */
.vi-mark { display: block; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; }
.vi-mark-lg { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 6px 16px rgba(20, 22, 26, .25); }
.appbar-logo.vi-fallback { width: 34px; height: 34px; max-height: 34px; padding: 0 !important; background: none !important; border-radius: 9px; }

/* Card della dashboard admin: colori pieni */
.dash-card.dash-present, html[data-theme="dark"] .dash-card.dash-present { --dc: #1f8a4c; --dc-dark: #166b3a; }
.dash-card.dash-entries, html[data-theme="dark"] .dash-card.dash-entries { --dc: #2563c9; --dc-dark: #1b4c9e; }
.dash-card.dash-waiting, html[data-theme="dark"] .dash-card.dash-waiting { --dc: #f2b705; --dc-dark: #c99500; --dc-ink: #2a2306; }
.dash-card.dash-filling, html[data-theme="dark"] .dash-card.dash-filling { --dc: #e8701a; --dc-dark: #bf5810; }
.dash-card.dash-present, .dash-card.dash-entries, .dash-card.dash-waiting, .dash-card.dash-filling,
html[data-theme="dark"] .dash-card.dash-present, html[data-theme="dark"] .dash-card.dash-entries,
html[data-theme="dark"] .dash-card.dash-waiting, html[data-theme="dark"] .dash-card.dash-filling {
    color: var(--dc-ink, #fff);
    background: linear-gradient(135deg, var(--dc) 0%, var(--dc-dark) 100%);
    border-color: var(--dc-dark);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--dc) 30%, transparent);
}
.dash-card.dash-present .dash-num, .dash-card.dash-entries .dash-num, .dash-card.dash-waiting .dash-num, .dash-card.dash-filling .dash-num,
html[data-theme="dark"] .dash-card.dash-present .dash-num, html[data-theme="dark"] .dash-card.dash-entries .dash-num,
html[data-theme="dark"] .dash-card.dash-waiting .dash-num, html[data-theme="dark"] .dash-card.dash-filling .dash-num {
    color: var(--dc-ink, #fff); font-weight: 800;
}
.dash-card.dash-present .dash-sites, .dash-card.dash-entries .dash-sites, .dash-card.dash-waiting .dash-sites, .dash-card.dash-filling .dash-sites,
html[data-theme="dark"] .dash-card.dash-present .dash-sites, html[data-theme="dark"] .dash-card.dash-entries .dash-sites,
html[data-theme="dark"] .dash-card.dash-waiting .dash-sites, html[data-theme="dark"] .dash-card.dash-filling .dash-sites {
    border-top-color: color-mix(in srgb, var(--dc-ink, #fff) 35%, transparent);
}
.dash-card.dash-active, html[data-theme="dark"] .dash-card.dash-active {
    border-color: var(--dc-dark); outline: 3px solid color-mix(in srgb, var(--dc) 45%, transparent); outline-offset: 2px;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--dc) 40%, transparent);
}
.dash-card.dash-active::after, html[data-theme="dark"] .dash-card.dash-active::after { color: var(--dc-dark); background: #fff; }
.dash-card.dash-waiting.dash-active::after, html[data-theme="dark"] .dash-card.dash-waiting.dash-active::after { color: #2a2306; }

/* Schede della Portineria: stessi colori pieni delle card admin */
.rd-legend-item.rd-l-waiting, html[data-theme="dark"] .rd-legend-item.rd-l-waiting { --dc: #f2b705; --dc-dark: #c99500; --dc-ink: #2a2306; }
.rd-legend-item.rd-l-filling, html[data-theme="dark"] .rd-legend-item.rd-l-filling { --dc: #e8701a; --dc-dark: #bf5810; }
.rd-legend-item.rd-l-present, html[data-theme="dark"] .rd-legend-item.rd-l-present { --dc: #1f8a4c; --dc-dark: #166b3a; }
.rd-legend-item.rd-l-waiting, .rd-legend-item.rd-l-filling, .rd-legend-item.rd-l-present,
html[data-theme="dark"] .rd-legend-item.rd-l-waiting, html[data-theme="dark"] .rd-legend-item.rd-l-filling, html[data-theme="dark"] .rd-legend-item.rd-l-present {
    padding: 12px 16px; color: var(--dc-ink, #fff);
    background: linear-gradient(135deg, var(--dc) 0%, var(--dc-dark) 100%);
    border: 1px solid var(--dc-dark); border-radius: 12px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--dc) 30%, transparent);
}
.rd-legend-item.rd-l-waiting strong, .rd-legend-item.rd-l-filling strong, .rd-legend-item.rd-l-present strong,
html[data-theme="dark"] .rd-legend-item.rd-l-waiting strong, html[data-theme="dark"] .rd-legend-item.rd-l-filling strong, html[data-theme="dark"] .rd-legend-item.rd-l-present strong {
    color: var(--dc-ink, #fff);
}
.rd-legend-item.rd-l-waiting span, .rd-legend-item.rd-l-filling span, .rd-legend-item.rd-l-present span { opacity: .92; }
.rd-legend-item .rd-legend-count { font-size: 26px; opacity: 1; }
.rd-legend-item.rd-legend-active, html[data-theme="dark"] .rd-legend-item.rd-legend-active {
    outline: 3px solid color-mix(in srgb, var(--dc) 45%, transparent); outline-offset: 2px;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--dc) 40%, transparent);
}

/* Riga selezionata nelle griglie (clic sulla riga) */
.k-grid tbody tr.k-selected > td, .k-grid tbody tr.k-table-row.k-selected > td {
    background-color: #fff3c4 !important;
}
.k-grid tbody tr.k-selected > td:first-child { box-shadow: inset 4px 0 0 #f5b301; }
.k-grid tbody tr.k-selected:hover > td { background-color: #ffeba0 !important; }
html[data-theme="dark"] .k-grid tbody tr.k-selected > td { background-color: #3a3214 !important; }
html[data-theme="dark"] .k-grid tbody tr.k-selected:hover > td { background-color: #4a4018 !important; }
.rd-phone { text-decoration: none; white-space: nowrap; }
.rd-phone:hover { text-decoration: underline; }
.rd-phone i { margin-right: 3px; font-size: 11px; }
.param-key { font-size: 15px; padding: 3px 10px; }
.param-list .param-row:nth-child(even) { background: #f4f6f9; }
.param-list .param-row:hover { background: #eaf0f7; }
html[data-theme="dark"] .param-list .param-row:nth-child(even) { background: #1c2026; }
html[data-theme="dark"] .param-list .param-row:hover { background: #262b33; }

/* Cambia password */
.pwd-rules { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 6px; padding: 10px 14px; font-size: 13px; line-height: 1.45; color: #1f3a5f; background: #eef4fb; border-radius: 10px; }
.pwd-rules > i { margin-top: 2px; color: #2563c9; }
.auth-cancel { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 14px; color: #5c6168; text-decoration: none; }
.auth-cancel:hover { color: #1b1f25; text-decoration: underline; }
html[data-theme="dark"] .pwd-rules { color: #cfe0f5; background: #1d2a3a; }
html[data-theme="dark"] .pwd-rules > i { color: #7db4f5; }
html[data-theme="dark"] .auth-cancel { color: #a3a9b1; }
.auth.auth-single { grid-template-columns: 1fr; }

/* Loader globale (BusyOverlay): sopra tutto, anche sulle finestre modali */
.busy-overlay { position: fixed; inset: 0; z-index: 30000; display: flex; align-items: center; justify-content: center; background: rgba(20, 22, 26, .35); backdrop-filter: blur(1.5px); }
.busy-box { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 240px; padding: 26px 32px; font-weight: 600; color: #1b1f25; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
html[data-theme="dark"] .busy-overlay { background: rgba(0, 0, 0, .5); }
html[data-theme="dark"] .busy-box { color: #e6e8eb; background: #1f2329; }
.gf-toolbar-inline { margin: 0; }
.site-cell { white-space: nowrap; }
.site-cell i { margin-right: 4px; color: #c62828; }
html[data-theme="dark"] .site-cell i { color: #ef5350; }
.dash-site-icon { margin-right: 4px; font-size: 12px; opacity: .85; }
.vd-title { display: flex; align-items: center; gap: 10px; }
.vd-title i { font-size: .8em; color: #6b7178; }
html[data-theme="dark"] .vd-title i { color: #a3a9b1; }
.rd-q-icon { margin-right: 8px; color: #2563c9; }
html[data-theme="dark"] .rd-q-icon { color: #7db4f5; }

/* Risposta scelta dal visitatore: piu' evidente */
.rd-detail-dialog .rd-q li.rd-chosen { border-width: 2px; border-style: solid; font-weight: 600; }
.rd-detail-dialog .rd-q li.rd-chosen.rd-correct { border-color: #2f8f5b; }
.rd-detail-dialog .rd-q li.rd-chosen:not(.rd-correct) { border-color: #c62828; }
.rd-chosen-tag { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 9px; font-size: 12px; font-weight: 700; color: #fff; background: #2f8f5b; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.rd-q li.rd-chosen:not(.rd-correct) .rd-chosen-tag { background: #c62828; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-chosen.rd-correct { border-color: #4caf7a; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-chosen:not(.rd-correct) { border-color: #ef5350; }
.dash-count { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; margin-left: 10px; padding: 0 12px; font-size: 20px; font-weight: 800; vertical-align: middle; color: #fff; border-radius: 999px; }
.dash-count-present { background: #1f8a4c; }
.dash-count-today { background: #2563c9; }
.dash-count-waiting { background: #f2b705; color: #2a2306; }
.dash-count-filling { background: #e8701a; }

/* Dispositivo: lo sfondo a gradiente nel colore della sede e' in guest.css (grafica v2). */
.param-num .k-input-inner { text-align: right; }
/* Pulsante elimina (outline rosso): trasparente come gli altri, cosi' segue lo sfondo della riga (selezionata, alternata). */
.k-button.k-button-outline-error:not(:hover):not(:focus-visible),
.k-button.k-button-outline.k-button-error:not(:hover):not(:focus-visible),
html[data-theme="dark"] .k-button.k-button-outline-error:not(:hover):not(:focus-visible) { background: transparent; }

/* Risposte del test: lettera A, B, C... davanti a ogni risposta */
.rd-detail-dialog .rd-q ul { counter-reset: rd-ans; }
.rd-detail-dialog .rd-q li { counter-increment: rd-ans; position: relative; padding-left: 46px; }
.rd-detail-dialog .rd-q li::before {
    content: counter(rd-ans, upper-alpha);
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #5c6168; background: #eceef1; border-radius: 7px;
}
.rd-detail-dialog .rd-q li.rd-correct::before { color: #fff; background: #2f8f5b; }
.rd-detail-dialog .rd-q li.rd-chosen:not(.rd-correct)::before { color: #fff; background: #c62828; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li::before { color: #e6e8eb; background: #313741; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-correct::before { color: #fff; background: #2f8f5b; }
html[data-theme="dark"] .rd-detail-dialog .rd-q li.rd-chosen:not(.rd-correct)::before { color: #fff; background: #c62828; }

/* Pulsanti azione nelle griglie: stessa misura e stesso bordo per tutti (icone Telerik e Font Awesome) */
.row-actions .k-button { min-width: 36px; height: 36px; padding: 0 10px; border-width: 1px; border-radius: 8px; }
.row-actions .k-button.icon-only { width: 36px; padding: 0; }
.row-actions .k-button i { font-size: 16px; line-height: 1; }
.row-actions .k-button .k-svg-icon, .row-actions .k-button .k-svg-icon svg { width: 18px; height: 18px; }
.row-actions .k-button.k-button-outline-error:not(:hover),
.row-actions .k-button.k-button-outline.k-button-error:not(:hover) { border-color: #c62828; color: #c62828; }
html[data-theme="dark"] .row-actions .k-button.k-button-outline-error:not(:hover) { border-color: #ef5350; color: #ef5350; }
.row-actions .k-button:not(.icon-only):not(.k-icon-button) { padding: 0 14px; }
.row-actions .k-button:not(.icon-only):not(.k-icon-button) i { margin-right: 4px; }

/* Note di ingresso/uscita */
.desk-note { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.desk-note label { font-weight: 600; }
.desk-note-opt { font-weight: 400; color: #6b7178; }
.desk-note-line { display: block; margin-top: 2px; font-size: 12px; color: #5c6168; white-space: normal; }
.desk-note-line i { margin-right: 4px; color: #b08900; }
html[data-theme="dark"] .desk-note-opt, html[data-theme="dark"] .desk-note-line { color: #a3a9b1; }

/* Tablet: note all'uscita */
.g-input-area { align-items: flex-start; }
.g-input-area > i { top: 22px; }
.g-input-area textarea { width: 100%; min-height: 110px; padding: 18px 18px 18px 56px; font: inherit; font-size: 18px; border: 2px solid #d4d1ca; border-radius: 14px; resize: none; outline: none; transition: border-color .15s, box-shadow .15s; }
.g-input-area textarea:focus { border-color: var(--sede); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sede) 15%, transparent); }

/* Pagina Statistiche (admin) */
.st-filters { --st-ok: #2e8b57; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border: 1px solid #e3e5ea; border-radius: 12px; padding: 10px 14px; margin-bottom: 20px; position: sticky; top: 0; z-index: 5; }
.st-seg { display: flex; border: 1px solid #d4d6db; border-radius: 8px; overflow: hidden; }
.st-seg button { border: 0; border-right: 1px solid #e3e5ea; background: #fff; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.st-seg button:last-child { border-right: 0; }
.st-seg button:hover { background: #f3f4f6; }
.st-seg button.on { background: #1a1a1a; color: #fff; font-weight: 600; }
.st-check { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #374151; cursor: pointer; }
.st-spacer { flex: 1; }
.st-muted { color: #6b7280; font-weight: 400; }
.st-empty { color: #6b7280; font-size: 13px; font-style: italic; margin: 8px 0; }
:root { --st-ok: #2e8b57; --st-warn: #d68910; --st-ko: #c0392b; }

.st-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.st-kpi { background: #fff; border: 1px solid #e3e5ea; border-radius: 12px; padding: 14px 16px; transition: transform .18s ease, box-shadow .18s ease; }
.st-kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16, 24, 40, .12); }
.st-kpi-l { font-size: 12.5px; color: #6b7280; display: flex; gap: 6px; align-items: center; }
.st-kpi-v { font-size: 28px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.5px; white-space: nowrap; }
.st-kpi-v small { font-size: 15px; font-weight: 500; color: #6b7280; }
.st-kpi-d { font-size: 12.5px; font-weight: 600; }
.st-kpi-x { font-size: 12px; color: #6b7280; margin-top: 4px; }
.st-up { color: var(--st-ok); }
.st-down { color: var(--st-ko); }
.st-flat { color: #6b7280; }

.st-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.st-g2 { grid-template-columns: 2fr 1fr; }
.st-g11 { grid-template-columns: 1fr 1fr; }
.st-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-card { background: #fff; border: 1px solid #e3e5ea; border-radius: 12px; padding: 16px 18px; min-width: 0; }
.st-card h2 { font-size: 16px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-h2-gap { margin-top: 18px !important; }
.st-hint { font-size: 12.5px; color: #6b7280; margin: 0 0 12px; }
.st-mt { margin-top: 14px; }
.st-mb { margin-bottom: 16px; }
.st-sec { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #6b7280; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.st-sec::after { content: ""; flex: 1; height: 1px; background: #e3e5ea; }

.st-hb { display: grid; grid-template-columns: 140px 1fr 52px; gap: 8px; align-items: center; font-size: 13px; margin: 7px 0; }
.st-hb-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-hb-track { background: #f0f1f4; border-radius: 5px; height: 12px; overflow: hidden; }
.st-hb-fill { height: 100%; border-radius: 5px; }
.st-hb-n { text-align: right; font-variant-numeric: tabular-nums; color: #374151; }

.st-hm { display: grid; gap: 3px; font-size: 11px; }
.st-hm-c { height: 26px; border-radius: 4px; }
.st-hm-h { color: #6b7280; text-align: center; }
.st-hm-r { color: #6b7280; display: flex; align-items: center; }
.st-scale { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #6b7280; margin-top: 8px; }
.st-scale span { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.st-l0 { background: #eef0f3; } .st-l1 { background: #c9d6ef; } .st-l2 { background: #8eaae0; } .st-l3 { background: #4f7bd0; } .st-l4 { background: #1f4fa8; }

.st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-table th { background: #e9eaee; text-align: left; font-weight: 600; padding: 9px 10px; font-size: 12.5px; }
.st-table th:first-child { border-radius: 8px 0 0 0; }
.st-table th:last-child { border-radius: 0 8px 0 0; }
.st-table td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.st-table tbody tr:nth-child(even) td { background: #fafbfc; }
.st-scroll { max-height: 360px; overflow: auto; }
.st-scroll th { position: sticky; top: 0; }
.st-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.st-pill.ok { background: #e8f5ee; color: var(--st-ok); }
.st-pill.warn { background: #fff4e0; color: #9a5b00; }
.st-pill.ko { background: #fdecea; color: var(--st-ko); }
.st-mini { height: 7px; border-radius: 4px; background: #f0f1f4; overflow: hidden; margin-top: 5px; width: 120px; }
.st-mini div { height: 100%; background: var(--st-ko); }

@media (max-width: 1400px) { .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .st-g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .st-g2, .st-g11, .st-g3 { grid-template-columns: 1fr; } .st-kpis { grid-template-columns: 1fr 1fr; } }
.st-info { color: #9aa0a8; font-size: 13px; cursor: help; }

/* Statistiche: colori per area */
.st-c-blue { --c: #2a5fc4; } .st-c-teal { --c: #16a085; } .st-c-green { --c: #2e8b57; }
.st-c-purple { --c: #8e44ad; } .st-c-orange { --c: #e0661c; } .st-c-red { --c: #c0392b; }
.st-a-blue { --c: #2a5fc4; } .st-a-green { --c: #2e8b57; } .st-a-amber { --c: #d68910; }

.st-kpi { position: relative; overflow: hidden; border-top: 4px solid var(--c, #1a1a1a); background: linear-gradient(180deg, color-mix(in srgb, var(--c, #fff) 7%, #fff) 0%, #fff 60%); }
.st-kpi-l { color: #374151; font-weight: 600; }
.st-kpi-l i { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; background: var(--c, #1a1a1a); }
.st-kpi-v { color: var(--c, #1a1a1a); }

.st-card[class*="st-a-"] { border-left: 4px solid var(--c); }
.st-card h2 i { color: var(--c, #1a1a1a); font-size: 15px; width: 18px; text-align: center; }
.st-card[class*="st-a-"] .st-table th { background: color-mix(in srgb, var(--c) 12%, #fff); }

.st-sec[class*="st-a-"] { color: var(--c); }
.st-sec[class*="st-a-"]::after { background: linear-gradient(90deg, var(--c), transparent); height: 2px; }
.st-sec:first-of-type { margin-top: 6px; }

/* Statistiche: riepilogo e legenda dei grafici */
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.st-chip { font-size: 12.5px; background: #f3f4f6; border-radius: 20px; padding: 3px 10px; color: #374151; }
.st-chip b { color: #1a1a1a; }
.st-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #374151; margin-bottom: 4px; }
.st-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Nota sotto il modulo di attivazione Dispositivo / accesso Portineria */
.auth-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #f3f6fb; border: 1px solid #dbe4f3; color: #374151; font-size: 13.5px; line-height: 1.45; text-align: left; }
.auth-note > i { color: #2a5fc4; margin-top: 2px; }

/* Statistiche: tema scuro */
html[data-theme="dark"] .st-filters,
html[data-theme="dark"] .st-card,
html[data-theme="dark"] .st-kpi { background: #1f2329; border-color: #3a4049; color: #e6e8eb; }
html[data-theme="dark"] .st-card[class*="st-a-"] { border-left-color: var(--c); }
html[data-theme="dark"] .st-kpi { border-top-color: var(--c, #e6e8eb); background: linear-gradient(180deg, color-mix(in srgb, var(--c, #1f2329) 16%, #1f2329) 0%, #1f2329 60%); }
html[data-theme="dark"] .st-kpi:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .st-kpi-l { color: #cfd5dc; }
html[data-theme="dark"] .st-kpi-v { color: color-mix(in srgb, var(--c, #e6e8eb) 60%, #fff); }
html[data-theme="dark"] .st-kpi-v small, html[data-theme="dark"] .st-kpi-x,
html[data-theme="dark"] .st-muted, html[data-theme="dark"] .st-hint, html[data-theme="dark"] .st-empty,
html[data-theme="dark"] .st-flat, html[data-theme="dark"] .st-hm-h, html[data-theme="dark"] .st-hm-r,
html[data-theme="dark"] .st-scale, html[data-theme="dark"] .st-info { color: #9aa3ad; }
html[data-theme="dark"] .st-up { color: #5cc98a; }
html[data-theme="dark"] .st-down { color: #f07b6e; }

html[data-theme="dark"] .st-seg { border-color: #3a4049; }
html[data-theme="dark"] .st-seg button { background: #1f2329; color: #cfd5dc; border-right-color: #3a4049; }
html[data-theme="dark"] .st-seg button:hover { background: #2a2f37; }
html[data-theme="dark"] .st-seg button.on { background: #e6e8eb; color: #16181d; }
html[data-theme="dark"] .st-check { color: #cfd5dc; }

html[data-theme="dark"] .st-card h2 i,
html[data-theme="dark"] .st-sec[class*="st-a-"] { color: color-mix(in srgb, var(--c) 60%, #fff); }
html[data-theme="dark"] .st-sec { color: #9aa3ad; }
html[data-theme="dark"] .st-sec::after { background: #3a4049; }
html[data-theme="dark"] .st-sec[class*="st-a-"]::after { background: linear-gradient(90deg, var(--c), transparent); }

html[data-theme="dark"] .st-hb-track, html[data-theme="dark"] .st-mini { background: #2e333b; }
html[data-theme="dark"] .st-hb-n { color: #cfd5dc; }

html[data-theme="dark"] .st-table th { background: #262b33; color: #e6e8eb; }
html[data-theme="dark"] .st-card[class*="st-a-"] .st-table th { background: color-mix(in srgb, var(--c) 22%, #1f2329); }
html[data-theme="dark"] .st-table td { border-bottom-color: #2e333b; }
html[data-theme="dark"] .st-table tbody tr:nth-child(even) td { background: #1b1e24; }
html[data-theme="dark"] .st-pill.ok { background: rgba(46, 139, 87, .22); color: #7fd8a4; }
html[data-theme="dark"] .st-pill.warn { background: rgba(214, 137, 16, .22); color: #f2c069; }
html[data-theme="dark"] .st-pill.ko { background: rgba(192, 57, 43, .25); color: #f4978c; }

html[data-theme="dark"] .st-chip { background: #2a2f37; color: #cfd5dc; }
html[data-theme="dark"] .st-chip b { color: #fff; }
html[data-theme="dark"] .st-legend { color: #cfd5dc; }

html[data-theme="dark"] .st-l0 { background: #2a2f37; }
html[data-theme="dark"] .st-l1 { background: #23395f; }
html[data-theme="dark"] .st-l2 { background: #2f5398; }
html[data-theme="dark"] .st-l3 { background: #4a78cf; }
html[data-theme="dark"] .st-l4 { background: #8fb0ef; }

/* Grafici Telerik: testi (assi, legenda, etichette) chiari sullo sfondo scuro */
html[data-theme="dark"] .st-card .k-chart svg text { fill: #cfd5dc; }
/* Etichette bianche dentro le colonne impilate: non schiarirle nel tema scuro */
html[data-theme="dark"] .st-card .k-chart svg text[fill="#ffffff"], html[data-theme="dark"] .st-card .k-chart svg text[fill="#fff"] { fill: #fff; }

/* Statistiche: nota esplicativa e testi esito */
.st-note { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; padding: 10px 14px; border-radius: 10px; background: #f3f6fb; border: 1px solid #dbe4f3; color: #374151; font-size: 13px; line-height: 1.5; }
.st-note > i { color: #2a5fc4; margin-top: 3px; }
.st-ok-txt { color: var(--st-ok); font-weight: 600; white-space: nowrap; }
.st-ko-txt { color: var(--st-ko); font-weight: 600; white-space: nowrap; }
html[data-theme="dark"] .st-note { background: #1b2433; border-color: #2f3d55; color: #cfd5dc; }
html[data-theme="dark"] .st-note > i { color: #8fb0ef; }
html[data-theme="dark"] .st-ok-txt { color: #7fd8a4; }
html[data-theme="dark"] .st-ko-txt { color: #f4978c; }

/* Statistiche: tempo totale di accoglienza */
.st-welcome { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.st-welcome-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.st-welcome-v { font-size: 30px; font-weight: 700; color: #2a5fc4; letter-spacing: -.5px; }
.st-h3 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.st-split { display: flex; height: 28px; border-radius: 7px; overflow: hidden; font-size: 12px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.st-split > div { display: flex; align-items: center; justify-content: center; white-space: nowrap; min-width: 56px; }
.st-split-a { background: #16a085; }
.st-split-b { background: #e0661c; flex: 1; }
html[data-theme="dark"] .st-welcome-v { color: #8fb0ef; }
@media (max-width: 900px) { .st-welcome { grid-template-columns: 1fr; } }

/* Statistiche: picco di presenze */
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.st-peak { font-size: 18px; color: #2a5fc4; }
html[data-theme="dark"] .st-peak { color: #8fb0ef; }

/* Statistiche: come entrano i visitatori */
.st-stack { display: flex; height: 30px; border-radius: 8px; overflow: hidden; margin: 4px 0 12px; }
.st-stack > div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; min-width: 34px; }
.st-how > div { display: grid; grid-template-columns: 14px 1fr 50px 44px; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid #eef0f3; }
.st-how > div:last-child { border-bottom: 0; }
.st-how i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.st-how b { text-align: right; }
.st-how .st-muted { text-align: right; }
.st-saved { display: flex; gap: 14px; align-items: center; background: #eef3fc; border-radius: 12px; padding: 16px 18px; align-self: center; }
.st-saved > i { font-size: 28px; color: #2a5fc4; }
.st-saved-v { font-size: 26px; font-weight: 700; color: #2a5fc4; }
html[data-theme="dark"] .st-how > div { border-bottom-color: #2e333b; }
html[data-theme="dark"] .st-saved { background: #1b2433; }
html[data-theme="dark"] .st-saved > i, html[data-theme="dark"] .st-saved-v { color: #8fb0ef; }
.auth-note-warn { background: #fff8e8; border-color: #f2dcaa; margin-top: 10px; }
.auth-note-warn > i { color: #b7791f; }

/* Statistiche: visione del video per questionario */
.st-scroll-x { overflow-x: auto; }
.st-video td { min-width: 78px; }
.st-video td:first-child { min-width: 160px; }
.st-mini-ok { width: 64px; margin: 3px 0 2px; }
.st-mini-ok div { background: var(--st-ok); }
.st-small { font-size: 11.5px; }

/* Statistiche: media sotto la mediana */
.st-avg { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
.st-avg b { color: #374151; }
.st-avg-high { color: #b45309; }
.st-avg-high b { color: #b45309; }
html[data-theme="dark"] .st-avg { color: #9aa3ad; }
html[data-theme="dark"] .st-avg b { color: #cfd5dc; }
html[data-theme="dark"] .st-avg-high, html[data-theme="dark"] .st-avg-high b { color: #f2c069; }
.st-pill.st-top { background: #eef0f3; color: #4b5563; font-weight: 600; }
html[data-theme="dark"] .st-pill.st-top { background: #2a2f37; color: #cfd5dc; }

/* Statistiche: blocchi a card con dettaglio apribile */
.st-a-teal { --c: #16a085; }
.st-kpi-link { cursor: pointer; }
.st-kpi-link:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.st-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; font: inherit; color: #1a1a1a;
    background: #fff; border: 1px solid #e3e5ea; border-left: 4px solid var(--c); border-radius: 12px; padding: 12px 34px 12px 14px; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease; min-height: 92px; }
.st-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 24, 40, .10); }
.st-tile:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.st-tile-h { font-size: 12.5px; font-weight: 600; color: #4b5563; display: flex; align-items: center; gap: 6px; }
.st-tile-h i { color: var(--c); width: 16px; text-align: center; }
.st-tile-v { font-size: 20px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.st-tile-s { font-size: 12px; color: #6b7280; }
.st-tile-chev { position: absolute; right: 12px; top: 14px; font-size: 12px; color: #9aa0a8; transition: transform .2s ease; }
.st-tile.on { background: color-mix(in srgb, var(--c) 9%, #fff); box-shadow: 0 0 0 2px var(--c) inset; }
.st-tile.on .st-tile-chev { transform: rotate(180deg); color: var(--c); }
.st-tile-warn { border-left-color: #d68910; }
.st-tile-warn .st-tile-v { color: #b45309; }
.st-tile-alert { border-left-color: #c0392b; }
.st-tile-alert .st-tile-v { color: #c0392b; }
.st-detail { position: relative; margin: 0 0 22px; animation: st-open .18s ease-out; scroll-margin-top: 80px; }
.st-detail > .st-card { margin: 0; }
.st-detail-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: #6b7280; cursor: pointer; }
.st-detail-close:hover { background: #f1f3f5; color: #1a1a1a; }
@keyframes st-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .st-detail { animation: none; } .st-tile { transition: none; } }

html[data-theme="dark"] .st-tile { background: #1f2329; border-color: #3a4049; border-left-color: var(--c); color: #e6e8eb; }
html[data-theme="dark"] .st-tile:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .st-tile-h { color: #cfd5dc; }
html[data-theme="dark"] .st-tile-h i { color: color-mix(in srgb, var(--c) 60%, #fff); }
html[data-theme="dark"] .st-tile-s { color: #9aa3ad; }
html[data-theme="dark"] .st-tile.on { background: color-mix(in srgb, var(--c) 18%, #1f2329); }
html[data-theme="dark"] .st-tile-warn { border-left-color: #d68910; }
html[data-theme="dark"] .st-tile-warn .st-tile-v { color: #f2c069; }
html[data-theme="dark"] .st-tile-alert { border-left-color: #c0392b; }
html[data-theme="dark"] .st-tile-alert .st-tile-v { color: #f4978c; }
html[data-theme="dark"] .st-detail-close { color: #9aa3ad; }
html[data-theme="dark"] .st-detail-close:hover { background: #2a2f37; color: #fff; }

/* Portineria: orario di accesso nell'intestazione */

/* Finestra "Consenti accesso": motivo della visita */
.desk-reason { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 10px; padding: 10px 14px; border-radius: 10px; background: #f3f6fb; border: 1px solid #dbe4f3; color: #374151; }
.desk-reason > i { color: #2a5fc4; margin-top: 3px; }
html[data-theme="dark"] .desk-reason { background: #1b2433; border-color: #2f3d55; color: #cfd5dc; }
html[data-theme="dark"] .desk-reason > i { color: #8fb0ef; }

/* Email o codice fiscale del visitatore nelle griglie */
.rd-id-icon { font-size: .85em; opacity: .6; margin-right: 2px; }

/* Dialog "Invita visitatore" (Fast Check In) */
.inv-lead { margin: 0 0 16px; }
.rd-confirm-dialog .k-dialog-content p.inv-required-note { display: flex; gap: 8px; align-items: flex-start; margin-top: -6px; font-size: 16px; color: #6b7280; }
.rd-confirm-dialog .k-dialog-content p.inv-required-note > i { margin-top: 4px; flex: 0 0 auto; }
html[data-theme="dark"] .rd-confirm-dialog .k-dialog-content p.inv-required-note { color: #9aa3ad; }
.inv-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-bottom: 12px; }
.inv-form .inv-wide { grid-column: 1 / -1; }
.inv-form .rd-filter { margin: 0; }
.inv-fixed { display: flex; align-items: center; min-height: 32px; font-weight: 600; }
@media (max-width: 640px) { .inv-form { grid-template-columns: 1fr; } }
.inv-form .inv-error { font-size: 12px; color: #d13438; }
/* Dialog Invita: asterisco rosso sui campi obbligatori (sempre visibile, anche prima dell'invio) */
.inv-form .k-form-label.required::after {
    content: "*" !important; display: inline !important; margin-left: 4px !important;
    color: #d13438 !important; font-weight: 700 !important; font-size: inherit !important;
    background: none !important; width: auto !important; height: auto !important; border-radius: 0 !important;
}
.inv-form .k-invalid, .inv-form .k-invalid.k-picker { border-color: #d13438 !important; }

/* Pagina Inviti Fast Check In: stato */
.inv-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.inv-status.wait { color: #1e40af; background: #e0e7ff; }
.inv-status.pass { color: #065f46; background: #d1fae5; }
.inv-status.ok   { color: #ffffff; background: #047857; }
.inv-status.fail { color: #9a3412; background: #ffedd5; }
.inv-status.off  { color: #4b5563; background: #e5e7eb; }
.inv-yes { color: #047857; font-weight: 600; }
html[data-theme="dark"] .inv-status.wait { color: #c7d2fe; background: #312e81; }
html[data-theme="dark"] .inv-status.pass { color: #a7f3d0; background: #064e3b; }
html[data-theme="dark"] .inv-status.fail { color: #fed7aa; background: #7c2d12; }
html[data-theme="dark"] .inv-status.off  { color: #d1d5db; background: #374151; }
html[data-theme="dark"] .inv-yes { color: #34d399; }
.inv-warning { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; border-left: 4px solid #f0a500; background: #fff4d6; color: #6b4500; font-size: 13px; line-height: 1.45; }
.inv-warning i { margin-top: 2px; color: #c98400; }
html[data-theme="dark"] .inv-warning { background: #3d2e05; color: #f6d78a; }
/* Anagrafica: ricerca senza risultati ma con inviti Fast Check In in sospeso */
.inv-registry-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; border-left: 4px solid #2563eb; background: #e8effd; color: #1e3a8a; font-size: 14px; }
.inv-registry-note a { margin-left: auto; font-weight: 600; color: #1d4ed8; text-decoration: none; white-space: nowrap; }
.inv-registry-note a:hover { text-decoration: underline; }
html[data-theme="dark"] .inv-registry-note { background: #172554; color: #c7d2fe; }
html[data-theme="dark"] .inv-registry-note a { color: #93c5fd; }
/* Wizard questionario: barra della traduzione automatica */
.sw-autotr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: #eef3fd; color: #1e3a8a; font-size: 13px; }
.sw-autotr > span { flex: 1 1 260px; }
html[data-theme="dark"] .sw-autotr { background: #172554; color: #c7d2fe; }
/* Form con traduzioni: checkbox "Traduci automaticamente al salvataggio" */
.tr-auto { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.tr-auto i { color: #2563eb; }
/* Griglie: lingue ancora senza traduzione */
.tr-ok { color: #047857; font-weight: 600; white-space: nowrap; }
.tr-missing { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #9a3412; background: #ffedd5; }
html[data-theme="dark"] .tr-ok { color: #34d399; }
html[data-theme="dark"] .tr-missing { color: #fed7aa; background: #7c2d12; }
.tr-warning { align-items: center; }
.tr-warning > span { flex: 1; }
.tr-warning-close { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px 6px; opacity: .7; }
.tr-warning-close:hover { opacity: 1; }

/* Traduzioni IA: consumo del mese rispetto al limite del piano */
.tu-month { margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 8px; max-width: 640px; }
.tu-month-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 8px; }
.tu-bar { height: 10px; border-radius: 5px; background: #e5e7eb; overflow: hidden; }
.tu-fill { height: 100%; background: #2563eb; }
.tu-fill.tu-high { background: #dc2626; }
.tu-month-head .tu-high { color: #dc2626; font-weight: 600; }
html[data-theme="dark"] .tu-bar { background: #374151; }
.tu-cell { display: flex; align-items: center; gap: 8px; }
.tu-cell .tu-bar { flex: 1; height: 8px; }
.tu-cell .tu-high { color: #dc2626; font-weight: 600; }
.k-form-hint.nowrap { white-space: nowrap; }
/* Colonne numeriche delle griglie: allineate a destra (anche l'intestazione). */
.k-grid td.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.k-grid th.col-num .k-cell-inner { justify-content: flex-end; }
.k-grid th.col-num .k-link { justify-content: flex-end; }
/* Wizard: Annulla a sinistra, gli altri pulsanti a destra. */
.sw-wizard .k-wizard-buttons .sw-cancel { margin-right: auto; }
/* Inviti: note su una riga, testo completo nel tooltip. */
.inv-note-cell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tu-info { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: #6b7280; }
.tu-info i { margin-top: 2px; }
.tu-info.tu-info { margin: 0 0 14px; }

/* Richiesta di supporto */
.sup-form { max-width: 900px; }
.sup-severity { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .sup-severity { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sup-sev { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; border: 1px solid #d1d5db; border-left-width: 5px; border-radius: 8px; background: #fff; color: #1f2937; cursor: pointer; font: inherit; }
.sup-sev span { font-size: 12px; color: #6b7280; }
.sup-sev-0 { border-left-color: #9ca3af; }
.sup-sev-1 { border-left-color: #f0a500; }
.sup-sev-2 { border-left-color: #ea580c; }
.sup-sev-3 { border-left-color: #dc2626; }
.sup-sev.on { background: #111827; color: #fff; border-color: #111827; }
.sup-sev.on span { color: #d1d5db; }
html[data-theme="dark"] .sup-sev { background: #1f242c; color: #e5e7eb; border-color: #3a4049; }
html[data-theme="dark"] .sup-sev.on { background: #e5e7eb; color: #111827; }
html[data-theme="dark"] .sup-sev.on span { color: #374151; }
.sup-buttons { display: flex; gap: 10px; margin-top: 14px; }
.sup-done { display: flex; gap: 14px; align-items: flex-start; max-width: 720px; padding: 18px 20px; border-radius: 12px; background: #ecfdf3; color: #14532d; }
.sup-done > i { font-size: 28px; color: #16a34a; }
.sup-done p { margin: 6px 0 12px; }
.sup-done .k-button { margin-right: 8px; }
html[data-theme="dark"] .sup-done { background: #12301f; color: #d1fae5; }
/* Richieste di supporto: stato, criticita' e dettaglio */
.sup-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.sup-status-0 { background: #fdecea; color: #b42318; }
.sup-status-1 { background: #fff4e0; color: #9a5b00; }
.sup-status-2 { background: #e8f5ee; color: #1f7a4a; }
.sup-sevtag { display: inline-block; padding: 1px 8px; border-left: 4px solid; border-radius: 4px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.04); }
.sup-detail { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0 0 16px; }
.sup-detail dt { color: #6b7280; font-weight: 600; }
.sup-detail dd { margin: 0; }
.sup-break { overflow-wrap: anywhere; }
.sup-notsent { color: var(--kendo-color-error, #d51923); font-weight: 600; }
.sup-desc { padding: 12px 16px; background: #f3f4f6; border-left: 4px solid #111827; border-radius: 6px; }
.sup-desc p { margin: 6px 0 0; white-space: pre-line; }
html[data-theme="dark"] .sup-desc { background: #1f242c; border-left-color: #e5e7eb; }
html[data-theme="dark"] .sup-status-0 { background: rgba(180,35,24,.25); color: #fca5a5; }
html[data-theme="dark"] .sup-status-1 { background: rgba(154,91,0,.25); color: #fcd34d; }
html[data-theme="dark"] .sup-status-2 { background: rgba(31,122,74,.25); color: #86efac; }
.sup-sev.on strong { color: inherit; }
/* Supporto: screenshot allegati */
.sup-files { display: flex; flex-wrap: wrap; gap: 10px; }
.sup-file { position: relative; width: 140px; height: 96px; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; background: #f3f4f6; }
.sup-file img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sup-file-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(17,24,39,.75); color: #fff; cursor: pointer; }
.sup-file-add { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 140px; height: 96px;
    border: 2px dashed #9ca3af; border-radius: 8px; color: #4b5563; cursor: pointer; font-size: 13px; }
.sup-file-add i { font-size: 20px; }
.sup-file-add:hover { border-color: #111827; color: #111827; }
.sup-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sup-shots { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.sup-shots img { max-width: 100%; border: 1px solid #e5e7eb; border-radius: 6px; }
html[data-theme="dark"] .sup-file-add { border-color: #6b7280; color: #d1d5db; }
/* Loader dell'invio risposte: a tutta pagina (non solo il contenitore in cui si trova). */
.k-loader-container.g-loader-fixed { position: fixed !important; inset: 0 !important; width: 100vw; height: 100vh; z-index: 10000; }
/* Loader globale: testi su piu' righe (\n), seconda riga meno evidente. */
.busy-box > span { white-space: pre-line; text-align: center; max-width: 420px; line-height: 1.5; }
/* Icona con un piccolo simbolo in basso a destra (es. lingue + ritraduci). */
.ico-badged { position: relative; display: inline-block; line-height: 1; }
.ico-badged .ico-badge { position: absolute; right: -7px; bottom: -6px; font-size: .62em; padding: 2px; border-radius: 50%; background: var(--kendo-color-surface-alt, #fff); }
html[data-theme="dark"] .ico-badged .ico-badge { background: #1f242c; }

/* Elenco di evacuazione */
.ev-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 0 0 18px; }
.ev-total { display: flex; align-items: baseline; gap: 8px; padding: 10px 18px; border-radius: 12px; background: #fee2e2; color: #991b1b; font-weight: 600; }
.ev-total.ev-wait { background: #fef3c7; color: #92400e; }
.ev-num { font-size: 30px; font-weight: 800; line-height: 1; }
.ev-time { color: #4b5563; }
.ev-filter { margin-left: auto; }
.ev-site { margin: 0 0 22px; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; break-inside: avoid; }
.ev-site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.ev-site-head h2 { margin: 0; font-size: 18px; }
.ev-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e5e7eb; color: #374151; }
.ev-badge.on { background: #dc2626; color: #fff; }
.ev-badge.wait { background: #f59e0b; color: #fff; }
.ev-address { margin-left: auto; color: #6b7280; font-size: 13px; }
.ev-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ev-table th { text-align: left; padding: 8px 12px; font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e5e7eb; }
.ev-table td { padding: 9px 12px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.ev-table .ev-check { width: 70px; text-align: center; }
.ev-box { display: inline-block; width: 18px; height: 18px; border: 2px solid #6b7280; border-radius: 4px; }
.ev-group td { background: #fffbeb; color: #92400e; font-weight: 600; font-size: 13px; }
.ev-empty { margin: 0; padding: 14px 16px; color: #047857; }
.ev-note { color: #6b7280; font-size: 12.5px; }
.ev-print-title { display: none; }
/* Colonna Appello (casella per la spunta a penna): solo in stampa. */
.ev-table .ev-check { display: none; }
html[data-theme="dark"] .ev-site-head { background: #1f242c; border-color: #3a4049; }
html[data-theme="dark"] .ev-site { border-color: #3a4049; }
html[data-theme="dark"] .ev-total { background: rgba(220,38,38,.2); color: #fca5a5; }
html[data-theme="dark"] .ev-total.ev-wait { background: rgba(245,158,11,.2); color: #fcd34d; }

/* Stampa (anche "Salva come PDF"): solo l'elenco, senza menu e pulsanti. */
@media print {
    /* Solo il menu laterale (.k-drawer dentro il contenitore): il contenitore del Drawer ha anche il contenuto della pagina. */
    .appbar-top, .k-drawer-container > .k-drawer, .mainlayout-drawer > .k-drawer, .page-header, .no-print, .busy-overlay, .k-notification-group { display: none !important; }
    .mainlayout-drawer, .k-drawer-container, .k-drawer-content { display: block !important; margin: 0 !important; padding: 0 !important; transform: none !important; }
    /* Layout a tutta altezza con scorrimento interno: in stampa altezza libera, altrimenti si stampa solo la parte visibile (o niente). */
    html, body, .mainlayout-drawer, .k-drawer-container, .k-drawer-content, .rd-page, main, article { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
    body, html { background: #fff !important; color: #000 !important; }
    .ev-print-title { display: block; font-size: 20px; font-weight: 800; margin: 0 0 8px; }
    .ev-table .ev-check { display: table-cell !important; }
    .ev-site { border-color: #999; }
    .ev-table td, .ev-table th { border-color: #bbb; }
    .ev-total, .ev-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.ev-refresh { display: flex; align-items: center; gap: 10px; }
/* Stampa dell'elenco di evacuazione in orizzontale (pagina con nome: le altre stampe non cambiano). */
@page evacuation { size: A4 landscape; margin: 12mm; }
@media print { .ev-root { page: evacuation; } }
.ev-print-time { font-size: 14px; font-weight: 400; margin-left: 8px; }
.ev-table .ev-since { white-space: nowrap; }
/* Referenti: pulsante di import (InputFile dentro una label con stile di pulsante) */
.ref-import { position: relative; overflow: hidden; gap: 6px; cursor: pointer; }
.ref-import.k-disabled { pointer-events: none; opacity: .6; }
.ref-import-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* Testo normale (non flex come .k-form-hint, che spezzava grassetti e link in colonne). */
.ref-hint { display: block; max-width: none; margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: #6b7280; }
.ref-hint i { margin-right: 4px; }
.ref-import-result { position: relative; margin: 0 0 14px; max-width: none; width: 100%; box-sizing: border-box; }
.ref-import-result > div { flex: 1 1 auto; min-width: 0; }
.ref-import-result > .tr-warning-close { margin-left: auto; }
.ref-import-result ul { margin: 4px 0 0 18px; padding: 0; font-size: 13px; }
.ref-cell { display: flex; flex-direction: column; gap: 1px; }
/* Telefono nei form: prefisso + numero sulla stessa riga */
.phone-input { display: flex; gap: 8px; width: 100%; }
.phone-input .phone-prefix { flex: 0 0 260px; }
.phone-input .phone-prefix-placeholder { flex: 0 0 260px; }
.phone-input .phone-number, .phone-input > .k-textbox { flex: 1 1 auto !important; min-width: 0; width: auto !important; }
.ref-hint .ref-template { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 3px 10px; border: 1px solid #16a34a; border-radius: 999px; background: #ecfdf3; color: #15803d; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ref-hint .ref-template:hover { background: #16a34a; color: #fff; }
.ref-hint .ref-template i { margin: 0; }
html[data-theme="dark"] .ref-hint .ref-template { background: #12301f; color: #86efac; border-color: #22c55e; }
.desk-notify { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; }
.desk-notify label { font-weight: 600; }
.vd-origin { white-space: nowrap; }
.vd-origin i { margin-right: 4px; opacity: .65; }
.k-grid.gcm-fitting .k-loader-container { display: none !important; }
.ref-manual { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: #fff4d6; color: #8a5a00; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ref-manual i { font-size: 9px; }
html[data-theme="dark"] .ref-manual { background: #3d2e05; color: #f6d78a; }
.desk-ref { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.desk-ref-contacts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85em; }
.desk-ref-contacts a { text-decoration: none; white-space: nowrap; }
.desk-ref-contacts a:hover { text-decoration: underline; }
.desk-ref-contacts i { margin-right: 3px; opacity: .65; font-size: .85em; }
.desk-ref .ref-manual { font-size: 12px; }
.sup-field-error { display: block; margin-top: 4px; color: #d13438; font-size: 12px; }

/* Griglie: righe e intestazioni nascoste finche' le larghezze delle colonne non sono applicate (niente salto).
   Senza dati (larghezze mai applicate) ricompaiono comunque dopo 0,8 s. */
@keyframes gcm-reveal { to { opacity: 1; } }
.k-grid:has(+ .gcm-marker.gcm-pending) .k-grid-header,
.k-grid:has(+ .gcm-marker.gcm-pending) .k-grid-content,
.k-grid:has(+ .gcm-marker.gcm-pending) .k-grid-container {
    opacity: 0;
    animation: gcm-reveal 0s .8s forwards;
}
.k-grid .k-grid-header, .k-grid .k-grid-content { transition: opacity .12s ease-in; }

/* Interruttore Sì/No in sola lettura nelle griglie (GridSwitch) */
.grid-switch { position: relative; display: inline-flex; align-items: center; width: 52px; height: 24px; border-radius: 999px; box-sizing: border-box; vertical-align: middle; font-size: 10.5px; font-weight: 700; user-select: none; }
.grid-switch.on { background: #1f2328; color: #fff; justify-content: flex-start; padding-left: 9px; }
.grid-switch.off { background: #e5e7eb; color: #6b7280; justify-content: flex-end; padding-right: 9px; }
.grid-switch .gs-knob { position: absolute; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.grid-switch.on .gs-knob { right: 2px; }
.grid-switch.off .gs-knob { left: 2px; }
html[data-theme="dark"] .grid-switch.on { background: #f3f4f6; color: #111827; }
html[data-theme="dark"] .grid-switch.on .gs-knob { background: #111827; }
html[data-theme="dark"] .grid-switch.off { background: #374151; color: #d1d5db; }

/* Rinnovi abilitazioni */
.rn-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.rn-period label { font-weight: 600; }
.rn-period label:not(:first-child) { margin-left: 14px; }
.rn-state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rn-state.expired { background: #fdecea; color: #b42318; }
.rn-state.due { background: #fff4d6; color: #8a5a00; }
.rn-blocked { color: #b42318; font-size: 12.5px; }
.rn-pending { color: #6b7280; font-size: 12.5px; }
html[data-theme="dark"] .rn-state.expired { background: #4a1d1a; color: #fca5a5; }
html[data-theme="dark"] .rn-state.due { background: #3d2e05; color: #f6d78a; }
/* Rinnovi: righe non invitabili senza casella di selezione e attenuate */
.k-grid tr.rn-row-blocked .k-checkbox { visibility: hidden; pointer-events: none; }
.k-grid tr.rn-row-blocked > td { color: #9ca3af; }
.k-grid tr.rn-row-blocked.k-selected > td { background: inherit; }
.rn-period-note { color: #6b7280; }
.k-grid-toolbar .rn-send { margin-left: 8px; }
.st-renew-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 12px; }
.st-renew-link a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.st-renew-link a:hover { text-decoration: underline; }
.st-renew-link a i { margin-right: 4px; }
.st-tile.st-tile-static { cursor: default; }
.st-tile.st-tile-static:hover { transform: none; box-shadow: none; }

/* Test superati (modalita' Solo test) */
.pt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.pt-toolbar label { font-weight: 600; }
.pt-search { margin-right: 8px; }
.pt-fast { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: #e8f1ff; color: #1d4ed8; font-size: 12px; font-weight: 700; white-space: nowrap; }
html[data-theme="dark"] .pt-fast { background: #1e3a8a; color: #dbeafe; }
.pt-reg { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: #f3e8ff; color: #6b21a8; font-size: 12px; font-weight: 700; white-space: nowrap; }
html[data-theme="dark"] .pt-reg { background: #4c1d95; color: #ede9fe; }
.pt-reception { margin-top: 4px; font-size: 12px; color: var(--muted, #6b7280); white-space: nowrap; }
.pt-reception i { margin-right: 4px; opacity: .65; }
/* Accessi Portineria (modalita' standard): la barra della griglia e' vuota e non si mostra */
.k-grid.rd-no-toolbar .k-grid-toolbar { display: none; }
/* Accesso diretto alla Sede: scelte come nella finestra "Accedi" della home */
.login-card a.ha-role { text-decoration: none; box-sizing: border-box; }

/* Link di accesso diretto */
.al-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.al-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 10px; }
.al-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.al-url { display: block; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: #f3f4f6; color: #111827; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
html[data-theme="dark"] .al-item { border-color: #3a4049; }
html[data-theme="dark"] .al-url { background: #2a2f36; color: #e6e8eb; }

/* Dettaglio del test: tentativi prima del superamento e video visto */
.rd-test-extra { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 14px; font-size: 15px; }
.rd-test-extra > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #f1f3f5; color: #374151; }
.rd-test-extra .rd-first { background: #e8f5ec; color: #1e6b3a; }
.rd-test-extra .rd-retry { background: #fdebdc; color: #b25a0a; }
.rd-test-extra a { color: inherit; font-weight: 600; }
html[data-theme="dark"] .rd-test-extra > span { background: #262b33; color: #cfd5dc; }
html[data-theme="dark"] .rd-test-extra .rd-first { background: #16301f; color: #6fcf97; }
html[data-theme="dark"] .rd-test-extra .rd-retry { background: #3d2410; color: #f0a35e; }

/* Invito massivo Fast Check In */
.bulk-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 0; font-size: 15px; }
.bulk-summary > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; }
.bulk-ok { background: #e8f5ec; color: #1e6b3a; }
.bulk-ko { background: #fde8e8; color: #8f1d1d; }
.bulk-dup { background: #f1f3f5; color: #374151; }
.bulk-check { height: 190px; overflow-y: auto; }
.bulk-check .login-error { margin-top: 12px; }
.bulk-invalid { margin-top: 12px; padding: 10px 14px; border: 1px solid #f3c9c9; border-radius: 8px; background: #fff7f7; font-size: 14px; }
.bulk-invalid ul { margin: 6px 0 0; padding-left: 18px; }
.bulk-invite-dialog .k-dialog-content { position: relative; }
html[data-theme="dark"] .bulk-ok { background: #16301f; color: #6fcf97; }
html[data-theme="dark"] .bulk-ko { background: #4a1f22; color: #ffb4ab; }
html[data-theme="dark"] .bulk-dup { background: #262b33; color: #cfd5dc; }
html[data-theme="dark"] .bulk-invalid { background: #2a1d1f; border-color: #5a2a2e; }

/* Fast Check In di sola registrazione (Solo test, tipologia senza questionario) */
.g-notest-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 16px; border-radius: 12px;
    background: #eef4ff; border: 1px solid #c9dafc; color: #1e3a8a; font-size: 17px; line-height: 1.45; }
.g-notest-note i { margin-top: 3px; }
html[data-theme="dark"] .g-notest-note { background: #172238; border-color: #2c4170; color: #c7d7fb; }

/* Dispositivo: link all'informativa privacy con icona */
.g-privacy-link { display: inline-flex; align-items: center; gap: 8px; }
.g-privacy-link i { font-size: 1.05em; }


/* Accesso non consentito (AccessDenied) */
.access-denied { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 24px 16px; box-sizing: border-box; }
.ad-box {
    max-width: 480px; width: 100%; padding: 40px 32px 32px; box-sizing: border-box; text-align: center;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; box-shadow: 0 14px 34px rgba(31, 35, 41, .08);
}
.ad-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 18px;
    font-size: 30px; color: #c62828; background: #fdecea; border-radius: 50%;
}
.ad-title { margin: 0 0 10px; font-size: 24px; font-weight: 700; color: #1f2329; }
.ad-text { margin: 0 0 24px; font-size: 15px; line-height: 1.5; color: #5c6168; }
.ad-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ad-btn, .ad-btn:hover, .ad-btn:focus, .ad-btn:visited { color: var(--kendo-color-on-primary, #fff) !important; text-decoration: none !important; }
.ad-btn:hover { filter: brightness(1.12); }
html[data-theme="dark"] .ad-box { background: #1f2329; border-color: #343a43; box-shadow: none; }
html[data-theme="dark"] .ad-title { color: #f3f4f6; }
html[data-theme="dark"] .ad-text { color: #b6bcc5; }
html[data-theme="dark"] .ad-icon { color: #ffb4ab; background: #4a1f1c; }

/* Home Azienda (Solo test): numero di elementi nella card */
.sys-card-count {
    margin-left: auto; display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 500; color: #5c6168; background: #f1f3f5; white-space: nowrap;
}
.sys-card .sys-card-count b { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.sys-card-count.zero { opacity: .6; }
html[data-theme="dark"] .sys-card-count { color: #b6bcc5; background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .sys-card .sys-card-count b { color: #f3f4f6; }

/* Portineria: pulsante "Scollega Dispositivi" nella barra in alto (solo icona sui telefoni) */
.rec-disconnect i { margin-right: 2px; }
@media (max-width: 640px) { .rec-disconnect-text { display: none; } }

/* Finestra "Scollega": casella e descrizione sulla stessa riga */
.dc-check { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.dc-check label { margin: 0; line-height: 1.2; cursor: pointer; }
.dc-check .k-checkbox-wrap { display: inline-flex; align-items: center; }
.dc-count { color: #6b7280; font-size: .92em; }
.dc-live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-weight: 600; color: #166534; background: #dcfce7; }
.dc-live.off { color: #6b7280; background: #f1f3f5; font-weight: 500; }
html[data-theme="dark"] .dc-live { color: #bbf7d0; background: #14532d; }
html[data-theme="dark"] .dc-live.off { color: #b6bcc5; background: rgba(255, 255, 255, .08); }

/* Home standard: barra Presenze in cima (link alla pagina Presenze) */
.home-live {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 16px 0 4px; padding: 14px 18px;
    border: 1px solid #dcdfe4; border-radius: 12px; background: #fff; color: #1a1a1a; text-decoration: none;
    box-shadow: 0 4px 14px rgba(31, 35, 41, .05);
}
.home-live:hover { background: #f7f8fa; border-color: #c3c8cf; }
.home-live-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.home-live-title i { color: #8a6400; }
.home-live-item { display: inline-flex; align-items: baseline; gap: 6px; font-size: 14px; color: #5c6168; }
.home-live-item b { font-size: 22px; font-weight: 700; }
.home-live-item.present b { color: #1f7a43; }
.home-live-item.waiting b { color: #b7791f; }
.home-live-item.filling b { color: #2a5fc4; }
.home-live-go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: #5c6168; }
html[data-theme="dark"] .home-live { background: #1f2329; border-color: #343a43; color: #f3f4f6; box-shadow: none; }
html[data-theme="dark"] .home-live:hover { background: #262b32; }
html[data-theme="dark"] .home-live-item, html[data-theme="dark"] .home-live-go { color: #b6bcc5; }
.home-live-note { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin-top: -2px; font-size: 12px; color: #6b7280; }
.home-live-note i { font-size: 11px; opacity: .8; }
html[data-theme="dark"] .home-live-note { color: #9aa1ab; }

/* Home standard: riquadro Presenze in evidenza (verde) */
.home-live {
    background: linear-gradient(135deg, #1f7a43, #16613a); border-color: #145a35; color: #fff;
    box-shadow: 0 10px 24px -12px rgba(22, 97, 58, .6);
}
.home-live:hover { background: linear-gradient(135deg, #22874a, #186b40); border-color: #145a35; }
.home-live-title, .home-live-title i { color: #fff; }
.home-live-item { color: rgba(255, 255, 255, .85); padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.home-live-item b, .home-live-item.present b, .home-live-item.waiting b, .home-live-item.filling b { color: #fff; }
.home-live-item.waiting { box-shadow: inset 3px 0 0 #f5b301; }
.home-live-item.filling { box-shadow: inset 3px 0 0 #8ab4ff; }
.home-live-go { color: #fff; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.home-live:hover .home-live-go { background: rgba(255, 255, 255, .28); }
.home-live-note { color: rgba(255, 255, 255, .8); }
html[data-theme="dark"] .home-live { background: linear-gradient(135deg, #1b5e37, #134a2c); border-color: #1f6b40; color: #fff; }
html[data-theme="dark"] .home-live:hover { background: linear-gradient(135deg, #1f6a3e, #165233); }
html[data-theme="dark"] .home-live-item, html[data-theme="dark"] .home-live-go { color: #fff; }
html[data-theme="dark"] .home-live-note { color: rgba(255, 255, 255, .75); }
.home-live:hover { background: linear-gradient(135deg, #1f7a43, #16613a); border-color: #145a35; }
html[data-theme="dark"] .home-live:hover { background: linear-gradient(135deg, #1b5e37, #134a2c); }
.home-live-go { text-decoration: none; }
.home-live-go:hover, .home-live-go:focus { color: #fff; background: rgba(255, 255, 255, .3); text-decoration: none; }
.home-live:hover .home-live-go { background: rgba(255, 255, 255, .18); }
.home-live:hover .home-live-go:hover { background: rgba(255, 255, 255, .3); }

/* Parametri: selettore del colore predefinito del tema */
.setting-color { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.setting-color input[type="color"] { width: 48px; height: 32px; padding: 0; border: 1px solid #dcdfe4; border-radius: 6px; background: none; cursor: pointer; }

/* Riga provvisoria "In compilazione": visitatore ancora all'identificazione o ai dati sul Dispositivo */
.k-grid tr.row-draft > td { font-style: italic; color: #6b7280; background: repeating-linear-gradient(135deg, rgba(42, 95, 196, .04) 0 10px, transparent 10px 20px) !important; }
.draft-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #2a5fc4; }
html[data-theme="dark"] .k-grid tr.row-draft > td { color: #b6bcc5; background: repeating-linear-gradient(135deg, rgba(138, 180, 255, .07) 0 10px, transparent 10px 20px) !important; }
html[data-theme="dark"] .draft-name { color: #8ab4ff; }

/* Form Portineria: scelta della Sede obbligatoria nella barra in cima */
.fc-site-pick { display: inline-flex; flex-direction: column; gap: 4px; }
.form-company .k-form-label.required { margin: 0; font-size: inherit; font-weight: inherit; }
.fc-site-pick .k-form-error { color: #d13438; font-size: 12px; }
/* Form Portineria: asterisco rosso della Sede obbligatoria, uguale a quello dei campi del form */
.form-company .fc-label { display: inline-flex; align-items: center; }
.form-company .fc-label.k-form-label { margin: 0; padding: 0; font-size: inherit; font-weight: inherit; color: #666; }

/* Sede del form Portineria (fuori dal form): stesso comportamento dei campi, cerchietto rosso solo se manca */
.form-company .fc-label.fc-invalid .k-required {
    display: inline-flex !important; width: 18px !important; height: 18px !important; min-width: 18px !important;
    margin-left: 10px !important; border-radius: 50% !important; font-size: 0 !important; line-height: 0 !important;
    vertical-align: middle !important; background-color: #d13438 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cg stroke='white' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 1.2v9.6M1.8 3.6l8.4 4.8M1.8 8.4l8.4-4.8'/%3E%3C/g%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important; background-position: center !important; background-size: 9px 9px !important;
}

/* Barra di contesto del form con le voci una sotto l'altra (finestre strette) */
.form-company.form-company-stack { align-items: center; }
.form-company-stack .fc-rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; min-width: 0; }
.form-company-stack .fc-row { display: contents; }
.form-company-stack .fc-row > span { white-space: nowrap; }
.form-company-stack .fc-row > strong { min-width: 0; overflow-wrap: anywhere; }
.form-company-stack .form-company-meta .form-required-note { white-space: nowrap; }

/* Accessi attivi (system admin): riepilogo per Sede */
.as-sites { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.as-site { display: inline-flex; align-items: center; gap: 14px; padding: 8px 12px; font: inherit; text-align: left; cursor: pointer; color: #1f2329; background: #fff; border: 1px solid #e2e0da; border-radius: 10px; }
.as-site:hover { border-color: #23272e; }
.as-site.on { border-color: #23272e; box-shadow: inset 0 0 0 1px #23272e; background: #fdf3d6; }
.as-site-name { font-weight: 600; }
.as-site-name em { margin-left: 6px; font-style: normal; font-weight: 400; color: #6b7178; }
.as-site-counts { display: inline-flex; gap: 12px; color: #3f4650; }
.as-site-counts i, .as-site-name i { color: #8a9099; margin-right: 3px; }
.as-kind-icon { margin-right: 6px; color: #6b7178; }
html[data-theme="dark"] .as-site { color: #e6e8eb; background: #262b33; border-color: #3a4049; }
html[data-theme="dark"] .as-site.on { background: rgba(245, 179, 1, .14); border-color: #f5b301; box-shadow: inset 0 0 0 1px #f5b301; }
html[data-theme="dark"] .as-site-counts { color: #c5cad0; }
.as-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.as-link i { color: #8a9099; }
.as-link:hover { text-decoration: underline; }
.as-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.as-status i { font-size: 9px; }
.as-status.on { color: #1e7e34; }
.as-status.off { color: #8a9099; }
.as-site-counts .as-status.on i { color: #2ea44f; margin-right: 0; }
html[data-theme="dark"] .as-status.on { color: #5ccf7a; }
.dc-online { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-size: 12.5px; font-weight: 600; color: #1e7e34; }
.dc-online i { font-size: 8px; color: #2ea44f; }
.dc-online.off { color: #8a9099; }
.dc-online.off i { color: #b0b5bc; }
html[data-theme="dark"] .dc-online { color: #5ccf7a; }
.rd-shown { display: block; margin: 2px 0 0 24px; font-size: 12.5px; font-style: italic; color: #8a9099; }
li .rd-shown { margin-left: 0; }
.rd-test-lang-note { margin: -6px 0 14px; font-size: 13px; color: #6b7178; }
html[data-theme="dark"] .rd-test-lang-note { color: #9aa3ad; }
html[data-theme="dark"] .rd-shown { color: #9aa3ad; }
.pt-valid { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #1e6b3a; background: #e8f5ec; }
html[data-theme="dark"] .pt-valid { color: #6fcf97; background: #16301f; }
/* Modalita' Solo Video Induction: nome del modulo accanto a VarcoSafe nella barra in alto */
.app-title-mode { font-weight: 400; color: #6b7178; }
html[data-theme="dark"] .app-title-mode { color: #9aa3ad; }
/* Barra in alto: marchio VarcoSafe, separatore, logo dell'Azienda */
.app-brand { display: inline-flex; align-items: center; gap: 10px; }
.app-brand-mark { width: 32px; height: 32px; border-radius: 8px; flex: 0 0 auto; }
.app-brand-sep { width: 1px; height: 30px; margin: 0 14px 0 18px; background: #d4d7dc; }
.app-brand-sep:last-child { display: none; }
html[data-theme="dark"] .app-brand-sep { background: #3a4049; }
/* Pagina di accesso: pulsante dopo un'operazione riuscita (es. password cambiata) */
.auth-ok-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 18px;
    font-weight: 700; color: #fff; background: #23272e; border-radius: 12px; text-decoration: none;
}
.auth-ok-btn:hover, .auth-ok-btn:visited { color: #fff; text-decoration: none; background: #1a1d22; }
