/* =============================================================
   accessibility-widget.css — Accessibility Widget UI
   Medic4All — Legge Stanca / WCAG 2.1 AA
   Tutte le classi usano il prefisso a11y- per evitare
   conflitti con AdminLTE e Bootstrap.
   ============================================================= */

/* ---------------------------------------------------------------
   FONT: OpenDyslexic (self-hosted in wwwroot/fonts/OpenDyslexic)
   --------------------------------------------------------------- */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('/Fonts/OpenDyslexic/OpenDyslexic-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/Fonts/OpenDyslexic/OpenDyslexic-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------------------------
   PULSANTE TRIGGER
   position: fixed — allineato a destra sulla riga del breadcrumb,
   sotto la navbar AdminLTE (altezza ~57px).
   z-index: 1020 — sotto la navbar (1030) ma sopra il contenuto.
   --------------------------------------------------------------- */
:root {
    --a11y-navbar-h: 57px;
}

.a11y-trigger {
    position: fixed;
    top: var(--a11y-navbar-h);
    right: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 10px;
    border: none;
    border-radius: 0 0 0 8px;   /* angolo inferiore sinistro arrotondato */
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, .2);
    transition: opacity .2s, box-shadow .2s;
    /* background-color e color vengono dall'inline style del ViewModel */
}

.a11y-trigger:hover {
    opacity: .9;
    box-shadow: -2px 3px 12px rgba(0, 0, 0, .3);
}

.a11y-trigger:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: -3px !important;
}

.a11y-trigger-label {
    white-space: nowrap;
}

/* Su schermi piccoli nascondi il testo, mostra solo l'icona */
@media (max-width: 576px) {
    .a11y-trigger-label {
        display: none;
    }
    .a11y-trigger {
        padding: 6px 10px;
    }
}

/* ---------------------------------------------------------------
   PANNELLO
   --------------------------------------------------------------- */
.a11y-panel {
    position: fixed;
    top: calc(var(--a11y-navbar-h) + 31px);
    right: 0;
    width: 300px;
    /* max-height gestita da JS per compatibilità con zoom */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 0 0 0 12px;
    box-shadow: -4px 4px 24px rgba(0, 0, 0, .18);
    border: 1px solid #d0dde9;
    border-top: none;
    border-right: none;
    z-index: 1019;
    transform-origin: top right;
    animation: a11y-panel-open .18s ease;
    overflow: hidden;
}

.a11y-panel[hidden] {
    display: none;
}

@keyframes a11y-panel-open {
    from { opacity: 0; transform: scaleY(.9); }
    to   { opacity: 1; transform: scaleY(1); }
}

/* Header pannello */
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    /* background-color e color: inline style dal ViewModel */
}

.a11y-panel-title {
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .2px;
}

.a11y-close-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    opacity: .85;
}

.a11y-close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, .2);
}

.a11y-close-btn:focus-visible {
    outline: 2px solid #ffffff !important;
    outline-offset: 1px !important;
}

/* Corpo pannello */
.a11y-panel-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    /* max-height impostata dinamicamente da JS in base a zoom e altezza navbar */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Scrollbar sottile nel pannello */
.a11y-panel-body::-webkit-scrollbar {
    width: 5px;
}
.a11y-panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.a11y-panel-body::-webkit-scrollbar-thumb {
    background: #c5d3df;
    border-radius: 4px;
}
.a11y-panel-body::-webkit-scrollbar-thumb:hover {
    background: #8fa8c0;
}

/* ---------------------------------------------------------------
   SEZIONI INTERNE
   --------------------------------------------------------------- */
.a11y-section {}

.a11y-section-label {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #7a8fa6;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------
   CONTROLLO DIMENSIONE TESTO
   --------------------------------------------------------------- */
.a11y-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.a11y-size-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #c5d3df;
    background: #f5f8fa;
    color: #1a3a5c;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
}

.a11y-size-btn:hover {
    background: #dceeff;
    border-color: #1a6dbe;
}

.a11y-size-btn:focus-visible {
    outline: 2px solid #0060df !important;
    outline-offset: 2px !important;
}

.a11y-size-display {
    flex: 1;
    text-align: center;
    font-size: .88rem;
    font-weight: 600;
    color: #1a3a5c;
}

/* ---------------------------------------------------------------
   CHIP TEMA COLORE
   --------------------------------------------------------------- */
.a11y-color-chips {
    display: flex;
    gap: 8px;
}

.a11y-chip {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2.5px solid transparent;
    cursor: pointer;
    font-size: .62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, border-color .15s;
}

.a11y-chip:hover {
    transform: scale(1.1);
}

.a11y-chip:focus-visible {
    outline: 2px solid #0060df !important;
    outline-offset: 2px !important;
}

.a11y-chip[aria-pressed="true"] {
    border-color: #e63946;
    transform: scale(1.08);
}

/* Varianti colore chip */
.a11y-chip--default       { background: #ffffff; border-color: #c5d3df; color: #333333; }
.a11y-chip--high-contrast { background: #000000; color: #ffffff; }
.a11y-chip--yellow        { background: #ffff00; color: #000000; }
.a11y-chip--dark          { background: #1a1a2e; color: #e0e0e0; }

/* ---------------------------------------------------------------
   TOGGLE SWITCH (dislessia)
   --------------------------------------------------------------- */
.a11y-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.a11y-toggle-label {
    font-size: .84rem;
    color: #2c3e50;
    cursor: pointer;
    margin-bottom: 0;
}

.a11y-switch {
    position: relative;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.a11y-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.a11y-switch-track {
    position: absolute;
    inset: 0;
    background: #c5d3df;
    border-radius: 22px;
    cursor: pointer;
    transition: background .25s;
}

.a11y-switch-track::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    left: 3px;
    top: 3px;
    transition: transform .25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.a11y-switch input:checked + .a11y-switch-track {
    background: #1a6dbe;
}

.a11y-switch input:checked + .a11y-switch-track::before {
    transform: translateX(20px);
}

.a11y-switch input:focus-visible + .a11y-switch-track {
    outline: 2px solid #0060df !important;
    outline-offset: 2px !important;
    border-radius: 22px;
}

/* ---------------------------------------------------------------
   PULSANTE RESET
   --------------------------------------------------------------- */
.a11y-reset-btn {
    width: 100%;
    padding: 8px;
    border: 1.5px solid #e0e6ed;
    border-radius: 8px;
    background: none;
    color: #7a8fa6;
    font-size: .78rem;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.a11y-reset-btn:hover {
    border-color: #e63946;
    color: #e63946;
    background: #fff5f5;
}

.a11y-reset-btn:focus-visible {
    outline: 2px solid #0060df !important;
    outline-offset: 2px !important;
}

/* ---------------------------------------------------------------
   DARK MODE — stile del pannello widget stesso
   --------------------------------------------------------------- */
body.a11y-dark .a11y-panel {
    background: #16213e !important;
    border-color: #2e3a5e !important;
    box-shadow: -4px 4px 24px rgba(0, 0, 0, .5) !important;
    color: #e0e0e0 !important;
}

body.a11y-dark .a11y-section-label {
    color: #a0a0b0 !important;
}

body.a11y-dark .a11y-size-btn {
    background: #0f3460 !important;
    border-color: #2e3a5e !important;
    color: #e0e0e0 !important;
}

body.a11y-dark .a11y-size-btn:hover {
    background: #1a4a80 !important;
    border-color: #90caf9 !important;
}

body.a11y-dark .a11y-size-display {
    color: #e0e0e0 !important;
}

body.a11y-dark .a11y-chip--default {
    background: #2e3a5e !important;
    border-color: #4a5a7e !important;
    color: #e0e0e0 !important;
}

body.a11y-dark .a11y-toggle-label {
    color: #e0e0e0 !important;
}

body.a11y-dark .a11y-switch-track {
    background: #2e3a5e !important;
}

body.a11y-dark .a11y-switch input:checked + .a11y-switch-track {
    background: #90caf9 !important;
}

body.a11y-dark .a11y-switch-track::before {
    background: #c8d8f0 !important;
}

body.a11y-dark .a11y-reset-btn {
    border-color: #2e3a5e !important;
    color: #a0a0b0 !important;
}

body.a11y-dark .a11y-reset-btn:hover {
    border-color: #e63946 !important;
    color: #e63946 !important;
    background: rgba(230, 57, 70, .12) !important;
}
/* Scrollbar pannello in dark mode */
body.a11y-dark .a11y-panel-body::-webkit-scrollbar-thumb {
    background: #2e3a5e;
}
body.a11y-dark .a11y-panel-body::-webkit-scrollbar-thumb:hover {
    background: #4a5a7e;
}

/* ---------------------------------------------------------------
   TEMI COLORE — applicati su <body> tramite JS
   Usano !important per sovrastare i colori sponsor inline.
   --------------------------------------------------------------- */

/* ---------------------------------------------------------------
   ALTO CONTRASTO — bianco su nero, copertura ampia
   Palette: bg #000000, testo #ffffff, link #ffff00, bordi #ffffff
   --------------------------------------------------------------- */

/* BASE */
body.a11y-high-contrast,
body.a11y-high-contrast *:not(.a11y-trigger):not(.a11y-panel):not(.a11y-panel *) {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Eccezione: mantieni stili interni al widget */
body.a11y-high-contrast .a11y-trigger,
body.a11y-high-contrast .a11y-panel,
body.a11y-high-contrast .a11y-panel * {
    background-color: revert !important;
    color: revert !important;
    border-color: revert !important;
}

/* LINK */
body.a11y-high-contrast a,
body.a11y-high-contrast a:visited {
    color: #ffff00 !important;
    text-decoration: underline !important;
}
body.a11y-high-contrast a:hover,
body.a11y-high-contrast a:focus {
    color: #00ffff !important;
}

/* NAVBAR / HEADER */
body.a11y-high-contrast .main-header,
body.a11y-high-contrast .main-header .navbar,
body.a11y-high-contrast .main-header .nav-link,
body.a11y-high-contrast .main-header .navbar-nav .nav-link {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #ffffff !important;
}

/* SIDEBAR */
body.a11y-high-contrast .main-sidebar,
body.a11y-high-contrast .sidebar,
body.a11y-high-contrast .brand-link {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-right: 1px solid #ffffff !important;
}
body.a11y-high-contrast .sidebar .nav-link,
body.a11y-high-contrast .sidebar .nav-link p {
    color: #ffffff !important;
}
body.a11y-high-contrast .sidebar .nav-link.active,
body.a11y-high-contrast .sidebar .nav-link:hover {
    background-color: #333333 !important;
    color: #ffff00 !important;
}
body.a11y-high-contrast #sidebar-logo-dark  { display: block !important; }
body.a11y-high-contrast #sidebar-logo-light { display: none  !important; }

/* CONTENT / CARD */
body.a11y-high-contrast .content-wrapper,
body.a11y-high-contrast .card,
body.a11y-high-contrast .card-body,
body.a11y-high-contrast .card-footer,
body.a11y-high-contrast .card-header,
body.a11y-high-contrast .card-header.theme-card-header,
body.a11y-high-contrast [class*="theme-card-header"],
body.a11y-high-contrast [class*="theme-personal-info"],
body.a11y-high-contrast [class*="theme-alert-info"] {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

/* INTESTAZIONI SEZIONE con bg-* */
body.a11y-high-contrast .row[class*="bg-"],
body.a11y-high-contrast div.bg-info,
body.a11y-high-contrast div.bg-primary,
body.a11y-high-contrast div.bg-success,
body.a11y-high-contrast div.bg-warning,
body.a11y-high-contrast div.bg-danger,
body.a11y-high-contrast div.bg-secondary {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

/* SMALL-BOX / INFO-BOX */
body.a11y-high-contrast .small-box,
body.a11y-high-contrast .info-box,
body.a11y-high-contrast .info-box-content {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}
body.a11y-high-contrast .small-box .icon,
body.a11y-high-contrast .info-box-icon {
    background-color: #333333 !important;
    color: #ffff00 !important;
}

/* TABELLE */
body.a11y-high-contrast .table,
body.a11y-high-contrast .table th,
body.a11y-high-contrast .table td,
body.a11y-high-contrast .table-striped tbody tr:nth-of-type(odd),
body.a11y-high-contrast .table-hover tbody tr:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.a11y-high-contrast .table thead th {
    background-color: #222222 !important;
    color: #ffff00 !important;
}

/* DATATABLES */
body.a11y-high-contrast .dataTables_wrapper,
body.a11y-high-contrast .dataTables_filter input,
body.a11y-high-contrast .dataTables_length select {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.a11y-high-contrast .page-item .page-link {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.a11y-high-contrast .page-item.active .page-link {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* FORM */
body.a11y-high-contrast .form-control,
body.a11y-high-contrast .form-control:focus,
body.a11y-high-contrast input[type="text"],
body.a11y-high-contrast input[type="email"],
body.a11y-high-contrast input[type="password"],
body.a11y-high-contrast input[type="number"],
body.a11y-high-contrast input[type="date"],
body.a11y-high-contrast textarea,
body.a11y-high-contrast select {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}
body.a11y-high-contrast label {
    color: #ffffff !important;
}

/* SELECT2 */
body.a11y-high-contrast .select2-container--default .select2-selection--single,
body.a11y-high-contrast .select2-container--default .select2-selection--multiple,
body.a11y-high-contrast .select2-dropdown,
body.a11y-high-contrast .select2-results__option {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.a11y-high-contrast .select2-results__option--highlighted {
    background-color: #333333 !important;
    color: #ffff00 !important;
}

/* MODAL */
body.a11y-high-contrast .modal-content,
body.a11y-high-contrast .modal-header,
body.a11y-high-contrast .modal-body,
body.a11y-high-contrast .modal-footer {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* DROPDOWN */
body.a11y-high-contrast .dropdown-menu,
body.a11y-high-contrast .dropdown-item {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.a11y-high-contrast .dropdown-item:hover,
body.a11y-high-contrast .dropdown-item:focus {
    background-color: #333333 !important;
    color: #ffff00 !important;
}

/* PULSANTI */
body.a11y-high-contrast .btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}
body.a11y-high-contrast .btn:hover,
body.a11y-high-contrast .btn:focus {
    background-color: #333333 !important;
    color: #ffff00 !important;
}
body.a11y-high-contrast .btn-primary,
body.a11y-high-contrast .btn-success,
body.a11y-high-contrast .btn-danger,
body.a11y-high-contrast .btn-warning,
body.a11y-high-contrast .btn-info,
body.a11y-high-contrast .btn-secondary {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

/* BADGE */
body.a11y-high-contrast .badge {
    background-color: #333333 !important;
    color: #ffff00 !important;
    border: 1px solid #ffffff !important;
}

/* ALERT */
body.a11y-high-contrast .alert {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

/* BREADCRUMB */
body.a11y-high-contrast .breadcrumb,
body.a11y-high-contrast .breadcrumb-item,
body.a11y-high-contrast .breadcrumb-item a,
body.a11y-high-contrast .breadcrumb-item.active {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* NAV PILLS / TABS */
body.a11y-high-contrast .nav-link {
    color: #ffffff !important;
}
body.a11y-high-contrast .nav-link.active,
body.a11y-high-contrast .nav-pills .nav-link.active {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* BOX / WIDGET-USER */
body.a11y-high-contrast .box,
body.a11y-high-contrast .box-widget,
body.a11y-high-contrast .widget-user-header[class*="bg-"] {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

/* FOOTER */
body.a11y-high-contrast .main-footer {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-top: 1px solid #ffffff !important;
}

/* WIDGET PANNELLO in alto contrasto — mantieni leggibilità */
body.a11y-high-contrast .a11y-panel {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}
body.a11y-high-contrast .a11y-section-label {
    color: #ffff00 !important;
}
body.a11y-high-contrast .a11y-size-btn {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}
body.a11y-high-contrast .a11y-size-display {
    color: #ffffff !important;
}
body.a11y-high-contrast .a11y-toggle-label {
    color: #ffffff !important;
}
body.a11y-high-contrast .a11y-switch-track {
    background: #444444 !important;
    border: 1px solid #ffffff !important;
}
body.a11y-high-contrast .a11y-switch input:checked + .a11y-switch-track {
    background: #ffffff !important;
}
body.a11y-high-contrast .a11y-switch-track::before {
    background: #ffff00 !important;
}
body.a11y-high-contrast .a11y-reset-btn {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}
body.a11y-high-contrast .a11y-chip--default {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

/* ---------------------------------------------------------------
   NERO SU GIALLO — per utenti con disturbi visivi (ipovisione, dislessia)
   Palette: bg #ffff00, testo #000000, link #00008b
   --------------------------------------------------------------- */

/* BASE */
body.a11y-yellow,
body.a11y-yellow *:not(.a11y-trigger):not(.a11y-panel):not(.a11y-panel *) {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

/* Eccezione: mantieni stili interni al widget */
body.a11y-yellow .a11y-trigger,
body.a11y-yellow .a11y-panel,
body.a11y-yellow .a11y-panel * {
    background-color: revert !important;
    color: revert !important;
    border-color: revert !important;
}

/* LINK */
body.a11y-yellow a,
body.a11y-yellow a:visited {
    color: #00008b !important;
    text-decoration: underline !important;
}
body.a11y-yellow a:hover,
body.a11y-yellow a:focus {
    color: #000080 !important;
    text-decoration: underline !important;
}

/* NAVBAR / HEADER */
body.a11y-yellow .main-header,
body.a11y-yellow .main-header .navbar,
body.a11y-yellow .main-header .nav-link,
body.a11y-yellow .main-header .navbar-nav .nav-link {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
}

/* SIDEBAR */
body.a11y-yellow .main-sidebar,
body.a11y-yellow .sidebar,
body.a11y-yellow .brand-link {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-right: 1px solid #000000 !important;
}
body.a11y-yellow .sidebar .nav-link,
body.a11y-yellow .sidebar .nav-link p {
    color: #000000 !important;
}
body.a11y-yellow .sidebar .nav-link.active,
body.a11y-yellow .sidebar .nav-link:hover {
    background-color: #e6e600 !important;
    color: #000000 !important;
}

/* CONTENT / CARD */
body.a11y-yellow .content-wrapper,
body.a11y-yellow .card,
body.a11y-yellow .card-body,
body.a11y-yellow .card-footer,
body.a11y-yellow .card-header,
body.a11y-yellow .card-header.theme-card-header,
body.a11y-yellow [class*="theme-card-header"],
body.a11y-yellow [class*="theme-personal-info"],
body.a11y-yellow [class*="theme-alert-info"] {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}

/* INTESTAZIONI SEZIONE con bg-* */
body.a11y-yellow .row[class*="bg-"],
body.a11y-yellow div.bg-info,
body.a11y-yellow div.bg-primary,
body.a11y-yellow div.bg-success,
body.a11y-yellow div.bg-warning,
body.a11y-yellow div.bg-danger,
body.a11y-yellow div.bg-secondary {
    background-color: #e6e600 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}

/* SMALL-BOX / INFO-BOX */
body.a11y-yellow .small-box,
body.a11y-yellow .info-box,
body.a11y-yellow .info-box-content {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}
body.a11y-yellow .small-box .icon,
body.a11y-yellow .info-box-icon {
    background-color: #e6e600 !important;
    color: #000000 !important;
}

/* TABELLE */
body.a11y-yellow .table,
body.a11y-yellow .table th,
body.a11y-yellow .table td {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}
body.a11y-yellow .table-striped tbody tr:nth-of-type(odd) {
    background-color: #e6e600 !important;
}
body.a11y-yellow .table thead th {
    background-color: #cccc00 !important;
    color: #000000 !important;
}
body.a11y-yellow .table-hover tbody tr:hover {
    background-color: #cccc00 !important;
}

/* DATATABLES */
body.a11y-yellow .dataTables_wrapper,
body.a11y-yellow .dataTables_filter input,
body.a11y-yellow .dataTables_length select {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}
body.a11y-yellow .page-item .page-link {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}
body.a11y-yellow .page-item.active .page-link {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

/* FORM */
body.a11y-yellow .form-control,
body.a11y-yellow .form-control:focus,
body.a11y-yellow input[type="text"],
body.a11y-yellow input[type="email"],
body.a11y-yellow input[type="password"],
body.a11y-yellow input[type="number"],
body.a11y-yellow input[type="date"],
body.a11y-yellow textarea,
body.a11y-yellow select {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}
body.a11y-yellow label {
    color: #000000 !important;
}

/* SELECT2 */
body.a11y-yellow .select2-container--default .select2-selection--single,
body.a11y-yellow .select2-container--default .select2-selection--multiple,
body.a11y-yellow .select2-dropdown,
body.a11y-yellow .select2-results__option {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}
body.a11y-yellow .select2-results__option--highlighted {
    background-color: #cccc00 !important;
    color: #000000 !important;
}

/* MODAL */
body.a11y-yellow .modal-content,
body.a11y-yellow .modal-header,
body.a11y-yellow .modal-body,
body.a11y-yellow .modal-footer {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

/* DROPDOWN */
body.a11y-yellow .dropdown-menu,
body.a11y-yellow .dropdown-item {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}
body.a11y-yellow .dropdown-item:hover,
body.a11y-yellow .dropdown-item:focus {
    background-color: #e6e600 !important;
    color: #000000 !important;
}

/* PULSANTI */
body.a11y-yellow .btn {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}
body.a11y-yellow .btn:hover,
body.a11y-yellow .btn:focus {
    background-color: #e6e600 !important;
    color: #000000 !important;
}
body.a11y-yellow .btn-primary,
body.a11y-yellow .btn-success,
body.a11y-yellow .btn-danger,
body.a11y-yellow .btn-warning,
body.a11y-yellow .btn-info,
body.a11y-yellow .btn-secondary {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* BADGE */
body.a11y-yellow .badge {
    background-color: #cccc00 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}

/* ALERT */
body.a11y-yellow .alert {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* BREADCRUMB */
body.a11y-yellow .breadcrumb,
body.a11y-yellow .breadcrumb-item,
body.a11y-yellow .breadcrumb-item a,
body.a11y-yellow .breadcrumb-item.active {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

/* NAV PILLS / TABS */
body.a11y-yellow .nav-link {
    color: #000000 !important;
}
body.a11y-yellow .nav-link.active,
body.a11y-yellow .nav-pills .nav-link.active {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

/* BOX / WIDGET-USER */
body.a11y-yellow .box,
body.a11y-yellow .box-widget,
body.a11y-yellow .widget-user-header[class*="bg-"] {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}

/* FOOTER */
body.a11y-yellow .main-footer {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-top: 1px solid #000000 !important;
}

/* WIDGET PANNELLO in tema giallo */
body.a11y-yellow .a11y-panel {
    background: #ffff00 !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
}
body.a11y-yellow .a11y-section-label {
    color: #555500 !important;
}
body.a11y-yellow .a11y-size-btn {
    background: #e6e600 !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
}
body.a11y-yellow .a11y-size-display {
    color: #000000 !important;
}
body.a11y-yellow .a11y-toggle-label {
    color: #000000 !important;
}
body.a11y-yellow .a11y-switch-track {
    background: #cccc00 !important;
    border: 1px solid #000000 !important;
}
body.a11y-yellow .a11y-switch input:checked + .a11y-switch-track {
    background: #000000 !important;
}
body.a11y-yellow .a11y-switch-track::before {
    background: #ffff00 !important;
}
body.a11y-yellow .a11y-reset-btn {
    background: #ffff00 !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
}
body.a11y-yellow .a11y-chip--default {
    background: #e6e600 !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
}

/* Modalità scura — copertura ampia (stile Dark Reader)
   Palette:
     bg-base:    #1a1a2e   sfondo principale
     bg-surface: #16213e   card, sidebar, navbar
     bg-raised:  #0f3460   elementi evidenziati
     text-main:  #e0e0e0   testo primario
     text-muted: #a0a0b0   testo secondario
     border:     #2e3a5e   bordi
     accent:     #90caf9   link / accenti
   --------------------------------------------------------------- */

/* BASE — body e content-wrapper */
body.a11y-dark,
body.a11y-dark .content-wrapper,
body.a11y-dark .wrapper {
    background-color: #1a1a2e !important;
    color: #e0e0e0 !important;
}

/* NAVBAR (main-header) */
body.a11y-dark .main-header,
body.a11y-dark .navbar,
body.a11y-dark .main-header .navbar {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-bottom: 1px solid #2e3a5e !important;
}
body.a11y-dark .main-header .nav-link,
body.a11y-dark .main-header .navbar-text,
body.a11y-dark .main-header .nav-item a {
    color: #e0e0e0 !important;
}

/* SIDEBAR */
body.a11y-dark .main-sidebar,
body.a11y-dark .sidebar {
    background-color: #16213e !important;
}
body.a11y-dark .brand-link {
    background-color: #0a1628 !important;
    border-bottom-color: #2e3a5e !important;
}
/* Mostra logo variante dark quando il widget dark mode è attivo */
body.a11y-dark #sidebar-logo-dark  { display: block !important; }
body.a11y-dark #sidebar-logo-light { display: none  !important; }
body.a11y-dark .sidebar .nav-link,
body.a11y-dark .sidebar .nav-link p,
body.a11y-dark .sidebar .brand-link,
body.a11y-dark .sidebar .brand-text {
    color: #e0e0e0 !important;
}
body.a11y-dark .sidebar .nav-link.active,
body.a11y-dark .sidebar .nav-link:hover {
    background-color: #0f3460 !important;
    color: #ffffff !important;
}
body.a11y-dark .sidebar .nav-treeview {
    background-color: #12192d !important;
}

/* CARD */
body.a11y-dark .card,
body.a11y-dark .card-body,
body.a11y-dark .card-footer {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .card-header,
body.a11y-dark .card-header.theme-card-header {
    background-color: #0f3460 !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}

/* SMALL-BOX (widget dashboard) */
body.a11y-dark .small-box {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .small-box .inner h3,
body.a11y-dark .small-box .inner p {
    color: #e0e0e0 !important;
}
body.a11y-dark .small-box .small-box-footer {
    background-color: rgba(0, 0, 0, .25) !important;
    color: #a0a0b0 !important;
}
body.a11y-dark .small-box .icon {
    color: rgba(255,255,255,.15) !important;
}

/* INFO-BOX */
body.a11y-dark .info-box {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .info-box-content .info-box-text,
body.a11y-dark .info-box-content .info-box-number {
    color: #e0e0e0 !important;
}

/* TABELLE */
body.a11y-dark .table,
body.a11y-dark .table th,
body.a11y-dark .table td,
body.a11y-dark .table thead th {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .table-striped tbody tr:nth-of-type(odd) td,
body.a11y-dark .table-striped tbody tr:nth-of-type(odd) {
    background-color: #1e2d4e !important;
}
body.a11y-dark .table-hover tbody tr:hover td,
body.a11y-dark .table-hover tbody tr:hover {
    background-color: #0f3460 !important;
}
/* DataTables */
body.a11y-dark .dataTables_wrapper,
body.a11y-dark .dataTables_info,
body.a11y-dark .dataTables_length,
body.a11y-dark .dataTables_filter,
body.a11y-dark .dataTables_paginate {
    color: #e0e0e0 !important;
}
body.a11y-dark .dataTables_paginate .paginate_button {
    color: #e0e0e0 !important;
}
body.a11y-dark .dataTables_paginate .paginate_button.current {
    background: #0f3460 !important;
    border-color: #2e3a5e !important;
    color: #ffffff !important;
}
body.a11y-dark .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #16213e !important;
    border-color: #2e3a5e !important;
    color: #ffffff !important;
}
body.a11y-dark .dataTables_paginate .paginate_button.disabled,
body.a11y-dark .dataTables_paginate .paginate_button.disabled:hover {
    color: #4a5a7a !important;
    background: transparent !important;
    border-color: transparent !important;
}
/* Pulsanti Bootstrap-style next/prev generati da DataTables bootstrap4 */
body.a11y-dark .dataTables_paginate .page-item .page-link {
    background-color: #16213e !important;
    border-color: #2e3a5e !important;
    color: #90caf9 !important;
}
body.a11y-dark .dataTables_paginate .page-item.active .page-link {
    background-color: #0f3460 !important;
    border-color: #2e3a5e !important;
    color: #ffffff !important;
}
body.a11y-dark .dataTables_paginate .page-item.disabled .page-link {
    background-color: #12192d !important;
    border-color: #2e3a5e !important;
    color: #4a5a7a !important;
}
body.a11y-dark .dataTables_paginate .page-item .page-link:hover {
    background-color: #0f3460 !important;
    border-color: #2e3a5e !important;
    color: #ffffff !important;
}

/* FORM */
body.a11y-dark .form-control,
body.a11y-dark .form-control:focus,
body.a11y-dark input[type="text"],
body.a11y-dark input[type="email"],
body.a11y-dark input[type="password"],
body.a11y-dark input[type="number"],
body.a11y-dark input[type="date"],
body.a11y-dark textarea,
body.a11y-dark select {
    background-color: #12192d !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .form-control::placeholder { color: #6a7a9a !important; }
body.a11y-dark label { color: #c0c0d0 !important; }

/* SELECT2 */
body.a11y-dark .select2-container--default .select2-selection--single,
body.a11y-dark .select2-container--default .select2-selection--multiple {
    background-color: #12192d !important;
    border-color: #2e3a5e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .select2-container--default .select2-selection__rendered { color: #e0e0e0 !important; }
body.a11y-dark .select2-dropdown { background-color: #16213e !important; border-color: #2e3a5e !important; }
body.a11y-dark .select2-results__option { color: #e0e0e0 !important; }
body.a11y-dark .select2-results__option--highlighted { background-color: #0f3460 !important; }

/* MODAL */
body.a11y-dark .modal-content {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .modal-header,
body.a11y-dark .modal-footer {
    background-color: #0f3460 !important;
    border-color: #2e3a5e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .modal-title,
body.a11y-dark .close { color: #e0e0e0 !important; }

/* DROPDOWN */
body.a11y-dark .dropdown-menu {
    background-color: #16213e !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .dropdown-item {
    color: #e0e0e0 !important;
}
body.a11y-dark .dropdown-item:hover,
body.a11y-dark .dropdown-item:focus {
    background-color: #0f3460 !important;
    color: #ffffff !important;
}
body.a11y-dark .dropdown-divider { border-color: #2e3a5e !important; }

/* CHART — sfondo canvas e contenitore */
body.a11y-dark .chart-container,
body.a11y-dark canvas {
    background-color: #16213e !important;
    filter: brightness(.9) invert(0);
}
/* Chart.js: forza sfondo bianco a nero via filter (non altera i colori dei dati) */
body.a11y-dark canvas {
    filter: invert(0) !important;
}

/* ALERT e BADGE */
body.a11y-dark .alert {
    background-color: #0f3460 !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .badge-secondary,
body.a11y-dark .badge-light {
    background-color: #2e3a5e !important;
    color: #e0e0e0 !important;
}

/* BREADCRUMB */
body.a11y-dark .breadcrumb {
    background-color: transparent !important;
}
body.a11y-dark .breadcrumb-item,
body.a11y-dark .breadcrumb-item a,
body.a11y-dark .breadcrumb-item.active {
    color: #a0a0b0 !important;
}

/* FOOTER */
body.a11y-dark .main-footer {
    background-color: #16213e !important;
    color: #a0a0b0 !important;
    border-top: 1px solid #2e3a5e !important;
}

/* SCROLLBAR */
body.a11y-dark ::-webkit-scrollbar { width: 8px; background: #1a1a2e; }
body.a11y-dark ::-webkit-scrollbar-thumb { background: #2e3a5e; border-radius: 4px; }

/* NAV-PILLS / NAV-TABS (tab schede — es. pagina Utente) */
body.a11y-dark .nav-pills .nav-link,
body.a11y-dark .nav-tabs .nav-link {
    color: #a0a0b0 !important;
    background-color: transparent !important;
    border-color: transparent !important;
}
body.a11y-dark .nav-pills .nav-link.active,
body.a11y-dark .nav-pills .nav-link.theme-tab-active.active,
body.a11y-dark .nav-tabs .nav-link.active {
    background-color: #0f3460 !important;
    color: #ffffff !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .nav-pills .nav-link:hover,
body.a11y-dark .nav-tabs .nav-link:hover {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .tabs-bg {
    background-color: #16213e !important;
}
body.a11y-dark .tab-content {
    background-color: #1a1a2e !important;
    color: #e0e0e0 !important;
}

/* LINK */
body.a11y-dark a { color: #90caf9 !important; }
body.a11y-dark a:hover { color: #bbdefb !important; }

/* SEZIONI TITOLO con bg-* (es. .row.bg-info in RapportoEmergenza, SchedaMedica) */
body.a11y-dark .row.bg-info,
body.a11y-dark .row.bg-primary,
body.a11y-dark .row.bg-success,
body.a11y-dark .row.bg-warning,
body.a11y-dark .row.bg-danger,
body.a11y-dark .row.bg-secondary,
body.a11y-dark .row.bg-dark,
body.a11y-dark .row[class*="bg-"] {
    background-color: #0f3460 !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .row[class*="bg-"] label,
body.a11y-dark .row[class*="bg-"] p,
body.a11y-dark .row[class*="bg-"] span,
body.a11y-dark .row[class*="bg-"] a {
    color: #e0e0e0 !important;
}
/* Copertura generica: qualsiasi elemento con bg-* usato come header di sezione.
   Esclude widget UI del tool, badge, bottoni, alert, sidebar, navbar già gestiti. */
body.a11y-dark .row[class*="bg-"],
body.a11y-dark .col[class*="bg-"],
body.a11y-dark div.bg-info:not(.info-box-icon):not(.small-box),
body.a11y-dark div.bg-primary:not(.info-box-icon):not(.small-box),
body.a11y-dark div.bg-success:not(.info-box-icon):not(.small-box),
body.a11y-dark div.bg-warning:not(.info-box-icon):not(.small-box),
body.a11y-dark div.bg-danger:not(.info-box-icon):not(.small-box),
body.a11y-dark div.bg-secondary:not(.info-box-icon):not(.small-box),
body.a11y-dark div[class*="bg-allianz-"]:not(.info-box-icon):not(.small-box),
body.a11y-dark div[class*="bg-groupama-"]:not(.info-box-icon):not(.small-box),
body.a11y-dark div[class*="bg-unicredit-"]:not(.info-box-icon):not(.small-box) {
    background-color: #0f3460 !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .row[class*="bg-"] label,
body.a11y-dark .row[class*="bg-"] p,
body.a11y-dark .row[class*="bg-"] span,
body.a11y-dark .row[class*="bg-"] a {
    color: #e0e0e0 !important;
}

/* BOX / WIDGET-USER (AdminLTE box-widget, widget-user-2) */
body.a11y-dark .box,
body.a11y-dark .box-widget {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .box-header,
body.a11y-dark .box-footer {
    background-color: #0f3460 !important;
    color: #e0e0e0 !important;
    border-color: #2e3a5e !important;
}
body.a11y-dark .box-body {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .widget-user-header,
body.a11y-dark .widget-user-header.bg-info,
body.a11y-dark .widget-user-header[class*="bg-"] {
    background-color: #0f3460 !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .widget-user-username,
body.a11y-dark .widget-user-desc {
    color: #e0e0e0 !important;
    text-shadow: none !important;
}
body.a11y-dark .box-comments,
body.a11y-dark .box-comments .box-comment {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
}
body.a11y-dark .description-block {
    border-color: #2e3a5e !important;
}
body.a11y-dark .description-block .description-text,
body.a11y-dark .description-block .description-header {
    color: #e0e0e0 !important;
}

/* ---------------------------------------------------------------
   FONT DISLESSIA
   --------------------------------------------------------------- */
body.a11y-dyslexia,
body.a11y-dyslexia p,
body.a11y-dyslexia label,
body.a11y-dyslexia input,
body.a11y-dyslexia textarea,
body.a11y-dyslexia select,
body.a11y-dyslexia button,
body.a11y-dyslexia td,
body.a11y-dyslexia th,
body.a11y-dyslexia li,
body.a11y-dyslexia span {
    font-family: 'OpenDyslexic', sans-serif !important;
    letter-spacing: .05em !important;
    line-height: 1.6 !important;
}

/* ---------------------------------------------------------------
   EVIDENZIA LINK
   Copre <a> ma anche <button> che agiscono come link/azioni interattive
   (es. telecamera videoconsulto, tre puntini azioni DataTable)
   --------------------------------------------------------------- */
body.a11y-highlight-links a,
body.a11y-highlight-links a:visited,
body.a11y-highlight-links button.btn-link,
body.a11y-highlight-links button[onclick],
body.a11y-highlight-links button.dt-action-toggle,
body.a11y-highlight-links [role="button"]:not(.a11y-trigger):not(.a11y-close-btn):not(.a11y-chip):not(.a11y-size-btn):not(.a11y-reset-btn) {
    outline: 2px solid #333333 !important;
    outline-offset: 2px !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    font-weight: bold !important;
    background-color: rgba(255, 255, 0, 0.25) !important;
    color: #1a1a1a !important;
    border-radius: 3px !important;
    padding: 0 3px !important;
}
body.a11y-highlight-links a:hover,
body.a11y-highlight-links a:focus,
body.a11y-highlight-links button.btn-link:hover,
body.a11y-highlight-links button[onclick]:hover,
body.a11y-highlight-links button.dt-action-toggle:hover {
    background-color: rgba(255, 255, 0, 0.55) !important;
    color: #000000 !important;
}
/* In dark mode: highlight adattato */
body.a11y-dark.a11y-highlight-links a,
body.a11y-dark.a11y-highlight-links a:visited,
body.a11y-dark.a11y-highlight-links button.btn-link,
body.a11y-dark.a11y-highlight-links button[onclick],
body.a11y-dark.a11y-highlight-links button.dt-action-toggle {
    background-color: rgba(144, 202, 249, 0.2) !important;
    outline-color: #90caf9 !important;
}
body.a11y-dark.a11y-highlight-links a:hover,
body.a11y-dark.a11y-highlight-links button.btn-link:hover,
body.a11y-dark.a11y-highlight-links button[onclick]:hover {
    background-color: rgba(144, 202, 249, 0.4) !important;
}

/* ---------------------------------------------------------------
   CURSORE GRANDE
   Inietta un cursore SVG personalizzato su tutta la pagina.
   Usa data-URI per non dipendere da file esterni.
   --------------------------------------------------------------- */
body.a11y-large-cursor,
body.a11y-large-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpolygon points='6,2 6,34 14,26 20,38 24,36 18,24 30,24' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 6 2, default !important;
}
body.a11y-large-cursor a,
body.a11y-large-cursor button,
body.a11y-large-cursor [role="button"],
body.a11y-large-cursor input[type="submit"],
body.a11y-large-cursor input[type="button"],
body.a11y-large-cursor label,
body.a11y-large-cursor select {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpolygon points='6,2 6,34 14,26 20,38 24,36 18,24 30,24' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 6 2, pointer !important;
}
body.a11y-large-cursor input[type="text"],
body.a11y-large-cursor input[type="email"],
body.a11y-large-cursor input[type="password"],
body.a11y-large-cursor input[type="number"],
body.a11y-large-cursor input[type="date"],
body.a11y-large-cursor textarea {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cline x1='16' y1='2' x2='16' y2='30' stroke='black' stroke-width='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='30' stroke='white' stroke-width='1.5'/%3E%3Cline x1='10' y1='4' x2='22' y2='4' stroke='black' stroke-width='2'/%3E%3Cline x1='10' y1='28' x2='22' y2='28' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 16 16, text !important;
}
