
/* ===========================================
   FALMED CUSTOMIZER - OVERRIDE COLORI COMPLETO
   Generato automaticamente - NON MODIFICARE
   Analisi completa di styles.css
   Primary: #000000
   Icon Normal BG: #ffffff
   Icon Normal Color: #ffffff
   Icon Active BG: #ff0000
   Icon Active Color: #ffffff
   =========================================== */

/* ===========================================
   NAVBAR E SIDEBAR
   =========================================== */
#layout-menu,
#taskmenu,
html body #layout-menu,
body:not(.task-login):not(.task-error) #layout-menu {
    background-color: #000000 !important;
    background: #000000 !important;
}

/* ===========================================
   LINK BASE (styles.css:138)
   =========================================== */
a {
    color: #000000 !important;
}
a:hover {
    color: #000000 !important;
    filter: brightness(0.85);
}

/* ===========================================
   SPLIT BUTTON - NUOVO MESSAGGIO (ECCEZIONE - testo BIANCO)
   =========================================== */
a.split-button-main,
a.split-button-main:link,
a.split-button-main:visited,
a.split-button-main:hover,
a.split-button-main:active,
.split-button a.split-button-main,
.compose-button-wrapper a.split-button-main,
#layout-sidebar a.split-button-main,
#folderlist-content a.split-button-main,
html body a.split-button-main {
    color: #ffffff !important;
    background: #000000 !important;
    background-color: #000000 !important;
}

/* ===========================================
   BTN-LINK (styles.css:1210)
   =========================================== */
.btn-link {
    color: #000000 !important;
}

/* ===========================================
   BTN-PRIMARY (styles.css:1242-1329)
   =========================================== */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:disabled,
.btn-primary.disabled {
    background: #000000 !important;
    background-color: #000000 !important;
    border-color: #000000 !important;
}

/* Bootstrap btn-primary override */
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
    background-color: #000000 !important;
    border-color: #000000 !important;
}

/* ===========================================
   UI SLIDER (styles.css:1526)
   =========================================== */
.ui-slider .ui-slider-handle.ui-state-active {
    background: #000000 !important;
}

/* ===========================================
   UI DATEPICKER (styles.css:1595-1598)
   =========================================== */
.ui-datepicker .ui-state-highlight {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #000000 !important;
}
.ui-datepicker a.ui-state-active,
.ui-datepicker .ui-state-active {
    background: #000000 !important;
    color: #fff !important;
}

/* ===========================================
   POPOVER MENU
   =========================================== */
.popover .menu li a:hover,
.popover .menu .dropbutton a.dropdown:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
    color: #2c363a !important;
}
.popover .menu li a:hover:before,
.popover .menu .dropbutton a.dropdown:hover:before {
    color: #000000 !important;
}

/* ===========================================
   TASKMENU ACTION BUTTONS (styles.css:2620-2624)
   =========================================== */
#taskmenu .action-buttons a,
#taskmenu .action-buttons a:hover {
    color: #000000 !important;
}

/* ===========================================
   UI ALERT (styles.css:2767)
   =========================================== */
.ui.alert a:not(.btn) {
    color: #000000 !important;
}

/* ===========================================
   MESSAGESTACK - Notifiche in basso
   =========================================== */
#messagestack .alert-info.information,
#messagestack .alert-success,
#messagestack .alert-info {
    background-color: #000000 !important;
    color: #fff !important;
}
#messagestack .alert-info.information > i.icon:before,
#messagestack .alert-success > i.icon:before,
#messagestack .alert-info > i.icon:before {
    color: #fff !important;
}

/* ===========================================
   UNREADCOUNT / BADGE (styles.css:3176-3285)
   =========================================== */
/* Badge generico - usa colore primario */
.badge {
    background: var(--primary-color, #000000) !important;
    background-color: var(--primary-color, #000000) !important;
}

/* Unreadcount nelle cartelle - nessuno sfondo (solo testo) */
.unreadcount,
.folderlist li.mailbox > a > .unreadcount,
.folderlist li.mailbox.recent > a > .unreadcount {
    background: transparent !important;
    background-color: transparent !important;
}

/* ===========================================
   FORM FOCUS STATES (styles.css:4174-4566)
   =========================================== */
.formcontent.raweditor .CodeMirror-focused,
.multi-input > .content.focused,
.recipient-input.focus,
.tagedit-list[tabindex="-1"],
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: #000000 !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15) !important;
}

/* ===========================================
   CUSTOM CHECKBOX/SWITCH (styles.css:4724-4776)
   =========================================== */
.custom-control-input:focus ~ .custom-control-label::before {
    border-color: #000000 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
}
.custom-switch .custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: #000000 !important;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    border-color: #000000 !important;
    background-color: #000000 !important;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #000000 !important;
    border-color: #000000 !important;
}

/* ===========================================
   CUSTOM FILE INPUT (styles.css:4846)
   =========================================== */
.custom-file-input:focus ~ .custom-file-label {
    border-color: #000000 !important;
}

/* ===========================================
   TINYMCE / TOX EDITOR (styles.css:4872-5083)
   =========================================== */
div.tox.focused {
    border-color: #000000 !important;
}
div.tox .tox-dialog .tox-dialog__body-nav-item--active {
    color: #000000 !important;
}
div.tox .tox-dialog__footer .tox-button,
div.tox .tox-dialog__footer .tox-button:disabled,
div.tox .tox-dialog__footer .tox-button:focus:not(:disabled) {
    background: #000000 !important;
    border-color: #000000 !important;
}
div.tox .tox-textfield:focus {
    border-color: #000000 !important;
}

/* ===========================================
   LISTING SELECTED (styles.css:5330)
   =========================================== */
.listing li.selected > a,
.listing tr.selected td,
ul.treelist li.selected > a {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

/* ===========================================
   QUICK ACTIONS - ICONE NORMALI (mail, calendar, tasks)
   Default: sfondo uguale navbar, icone bianche
   =========================================== */
.quick-actions a,
#layout-menu .quick-actions a,
body:not(.task-login):not(.task-error) #layout-menu .quick-actions a {
    background: #000000 !important;
    background-color: #000000 !important;
    border-radius: 8px !important;
}
.quick-actions a:before,
#layout-menu .quick-actions a:before,
body:not(.task-login):not(.task-error) #layout-menu .quick-actions a:before {
    color: #ffffff !important;
}

/* QUICK ACTIONS - ICONE ATTIVE */
body:not(.task-login):not(.task-error) #layout-menu .quick-actions a.active,
html.dark-mode body:not(.task-login) #layout-menu .quick-actions a.active,
.quick-actions a.active {
    background: #ff0000 !important;
    background-color: #ff0000 !important;
}
body:not(.task-login):not(.task-error) #layout-menu .quick-actions a.active:before,
html.dark-mode body:not(.task-login) #layout-menu .quick-actions a.active:before,
.quick-actions a.active:before {
    color: #ffffff !important;
}

/* QUICK ACTIONS - HOVER */
.quick-actions a:hover,
#layout-menu .quick-actions a:hover,
body:not(.task-login):not(.task-error) #layout-menu .quick-actions a:hover {
    background: #ff0000 !important;
    opacity: 0.85;
}
.quick-actions a:hover:before,
#layout-menu .quick-actions a:hover:before,
body:not(.task-login):not(.task-error) #layout-menu .quick-actions a:hover:before {
    color: #ffffff !important;
}

/* ===========================================
   TASKMENU ICONE NORMALI (NON SELEZIONATE)
   Default: sfondo uguale navbar, icone bianche
   =========================================== */
#taskmenu a,
#layout-menu #taskmenu a,
body:not(.task-login):not(.task-error) #layout-menu #taskmenu a {
    background: #000000 !important;
    background-color: #000000 !important;
    border-radius: 8px !important;
}
#taskmenu a:before,
#layout-menu #taskmenu a:before,
body:not(.task-login):not(.task-error) #layout-menu #taskmenu a:before {
    color: #ffffff !important;
}

/* ===========================================
   TASKMENU ICONE ATTIVE NAVBAR
   =========================================== */
#taskmenu a.selected,
#layout-menu #taskmenu a.selected,
body:not(.task-login):not(.task-error) #layout-menu #taskmenu a.selected,
html body #layout-menu #taskmenu a.selected {
    background: #ff0000 !important;
    background-color: #ff0000 !important;
    border-radius: 8px !important;
}
#taskmenu a.selected:before,
#layout-menu #taskmenu a.selected:before,
body:not(.task-login):not(.task-error) #layout-menu #taskmenu a.selected:before,
html body #layout-menu #taskmenu a.selected:before {
    color: #ffffff !important;
}

/* Hover sulle icone navbar */
#taskmenu a:hover,
#layout-menu #taskmenu a:hover,
body:not(.task-login):not(.task-error) #layout-menu #taskmenu a:hover {
    background: #ff0000 !important;
    opacity: 0.85;
    border-radius: 8px !important;
}
#taskmenu a:hover:before,
#layout-menu #taskmenu a:hover:before,
body:not(.task-login):not(.task-error) #layout-menu #taskmenu a:hover:before {
    color: #ffffff !important;
}

/* ===========================================
   TASK-MENU-BUTTON (Hamburger icon in header)
   NOTE: .menu-toggle styles are now generated
   dynamically by agla_customizer plugin
   =========================================== */
a.task-menu-button,
.header a.task-menu-button,
#layout-list .header a.task-menu-button {
    background: #02587e !important;
    background-color: #02587e !important;
    border-radius: 8px !important;
}
a.task-menu-button:before,
.header a.task-menu-button:before,
#layout-list .header a.task-menu-button:before {
    color: #ffffff !important;
}
a.task-menu-button:hover,
.header a.task-menu-button:hover {
    background: #0087db !important;
    background-color: #0087db !important;
}
a.task-menu-button:hover:before,
.header a.task-menu-button:hover:before {
    color: #ffffff !important;
}

/* Dark mode task-menu-button */
html.dark-mode a.task-menu-button,
html.dark-mode .header a.task-menu-button {
    background: #2a2a2a !important;
    background-color: #2a2a2a !important;
}
html.dark-mode a.task-menu-button:before,
html.dark-mode .header a.task-menu-button:before {
    color: #ffffff !important;
}
html.dark-mode a.task-menu-button:hover,
html.dark-mode .header a.task-menu-button:hover {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
html.dark-mode a.task-menu-button:hover:before,
html.dark-mode .header a.task-menu-button:hover:before {
    color: #000000 !important;
}

/* ===========================================
   MODERN CHECKBOX (styles.css:5631)
   =========================================== */
.modern-checkbox input:checked + label:before {
    color: #000000 !important;
}

/* ===========================================
   FOLDERLIST ICONS (styles.css:5673-5695)
   =========================================== */
/* Unreadcount - sfondo trasparente (solo testo) */
body:not(.task-login):not(.task-error) #layout-sidebar .folderlist li a .unreadcount {
    background: transparent !important;
}
body:not(.task-login):not(.task-error) #layout-sidebar .folderlist li a:hover:before,
body:not(.task-login):not(.task-error) #layout-sidebar .folderlist li a.selected:before {
    color: #000000 !important;
}

/* ===========================================
   FOLDERLIST - Testo nero, selezionato con sfondo delicato
   =========================================== */
.folderlist li a,
#mailboxlist li a,
.treelist li a,
#layout-sidebar .folderlist li a {
    color: #2c363a !important;
}

/* Cartella selezionata con sfondo colore primario molto delicato */
.folderlist li.selected > a,
#mailboxlist li.selected > a,
.treelist li.selected > a,
#layout-sidebar .folderlist li.selected > a {
    color: #2c363a !important;
    background-color: rgba(0, 0, 0, 0.08) !important;
    border-radius: 4px;
}

/* ===========================================
   MESSAGELIST - Layout ORIGINALE Roundcube
   Solo override colori, niente modifiche al layout
   =========================================== */

/* Sfondo righe */
.messagelist tbody tr {
    background: #fff !important;
}

.messagelist tbody tr:hover {
    background: #f5f5f5 !important;
}

.messagelist tbody tr.selected {
    background: rgba(0, 0, 0, 0.08) !important;
}

/* Email non lette - mittente in grassetto e nero (non l'oggetto) */
.messagelist tbody tr.unread td.subject span.fromto {
    font-weight: 700 !important;
    color: #000000 !important;
}

/* Oggetto normale anche per email non lette */
.messagelist tbody tr.unread td.subject span.subject {
    font-weight: 400 !important;
}

/* Mittente sempre ben visibile */
.messagelist tbody tr td.subject span.fromto {
    color: #333333 !important;
}

/* ===========================================
   EMAIL CONTRASSEGNATE (FLAGGED) - Sfondo giallo/oro
   =========================================== */
.messagelist tbody tr.flagged {
    background: #FFF8E1 !important;
    border-left: 3px solid #FFC107 !important;
}
.messagelist tbody tr.flagged:hover {
    background: #FFECB3 !important;
}
.messagelist tbody tr.flagged.selected {
    background: #FFE082 !important;
}
.messagelist tbody tr.flagged td.subject span.msgicon.flagged:before {
    color: #FFC107 !important;
}

/* Dark mode flagged */
html.dark-mode .messagelist tbody tr.flagged {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left: 3px solid #FFC107 !important;
}
html.dark-mode .messagelist tbody tr.flagged:hover {
    background: rgba(255, 193, 7, 0.25) !important;
}


/* ===========================================
   MODERN UI BTN-PRIMARY GRADIENT (styles.css:5751, 6015)
   =========================================== */
body:not(.task-login):not(.task-error) .btn-primary {
    background: linear-gradient(135deg, #000000 0%, #000000 100%) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* ===========================================
   SEARCHBAR FOCUS (styles.css:5777)
   =========================================== */
body:not(.task-login):not(.task-error) .searchbar:focus-within {
    border-color: #000000 !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1) !important;
}

/* ===========================================
   LOGIN PAGE - Non sovrascrivere lo sfondo
   =========================================== */
/* Lo sfondo della pagina di login usa l'immagine/colore originale del tema */

/* ===========================================
   LOGIN FORM (styles.css:5988, 6015)
   =========================================== */
/* Usa gli stili originali di Elastic per il login form */

/* ===========================================
   DARK MODE (styles.css:6500-7068)
   =========================================== */
html.dark-mode #taskmenu .action-buttons a {
    color: #000000 !important;
}
html.dark-mode .listing tr.selected td {
    color: #000000 !important;
}
html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td.subject span.msgicon.status {
    color: #000000 !important;
}

/* Dark mode - message list (solo sfondo) */
html.dark-mode .messagelist tbody tr {
    background: #1e1e1e !important;
}
html.dark-mode .messagelist tbody tr:hover {
    background: #2a2a2a !important;
}
html.dark-mode .custom-control-input:focus ~ .custom-control-label::before {
    border-color: #000000 !important;
}
html.dark-mode .multi-input:not(.is-invalid) > .content.focused,
html.dark-mode .input-group a:focus,
html.dark-mode .recipient-input.focus,
html.dark-mode .tagedit-list[tabindex="-1"] {
    border-color: #000000 !important;
}
html.dark-mode .tox .tox-dialog__body-nav-item--active,
html.dark-mode .tox .tox-collection__item--enabled {
    color: #000000 !important;
}
html.dark-mode .ui-datepicker.ui-widget-content .ui-state-highlight {
    color: #000000 !important;
}
html.dark-mode .custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #000000 !important;
    border-color: #000000 !important;
}
html.dark-mode body:not(.task-login) #layout-sidebar .folderlist li a:hover:before {
    color: #000000 !important;
}

/* Dark mode taskmenu icons - normal */
html.dark-mode #taskmenu a,
html.dark-mode #layout-menu #taskmenu a {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
}
html.dark-mode #taskmenu a:before,
html.dark-mode #layout-menu #taskmenu a:before {
    color: #ffffff !important;
}

/* Dark mode taskmenu icons - active */
html.dark-mode #taskmenu a.selected,
html.dark-mode #layout-menu #taskmenu a.selected {
    background: #ff0000 !important;
    background-color: #ff0000 !important;
}
html.dark-mode #taskmenu a.selected:before,
html.dark-mode #layout-menu #taskmenu a.selected:before {
    color: #ffffff !important;
}

/* ===========================================
   SPINNER / LOADER (styles.css:737, 1187)
   =========================================== */
.spinner-border,
.spinner > i {
    background-color: #000000 !important;
}

/* ===========================================
   FOCUS INDICATOR / SELECTED STATE
   =========================================== */
html:not(.touch) .listing li > a:focus,
html:not(.touch) .listing.focus tbody tr.focused > td:first-child {
    border-left-color: #000000 !important;
}

/* ===========================================
   FULLCALENDAR
   =========================================== */
.fc-button-primary,
.fc .fc-button-primary {
    background-color: #000000 !important;
    border-color: #000000 !important;
}
.fc-button-primary:not(:disabled).fc-button-active,
.fc-button-primary:not(:disabled):active {
    background-color: #000000 !important;
    border-color: #000000 !important;
    filter: brightness(0.9);
}
td.fc-today,
.fc-day.fc-today,
.fc .fc-daygrid-day.fc-day-today {
    background: rgba(0, 0, 0, 0.1) !important;
}
/* ===========================================
   CALENDAR PLUGIN ICONS
   =========================================== */
#calendars .treelist li > a:before,
#calendars-content .treelist li > a:before {
    color: #000000 !important;
}

/* ===========================================
   QUOTA / PROGRESS BAR
   =========================================== */
.quota .bar,
.progress-bar,
#quota-display .bar,
.quota-widget .value {
    background-color: #000000 !important;
}

/* ===========================================
   BLOCKQUOTE (citazioni email)
   =========================================== */
.message-part blockquote,
.message-htmlpart blockquote {
    border-left-color: #000000 !important;
    border-right-color: #000000 !important;
}

/* ===========================================
   FOLDERLIST / MAILBOX ICONS
   =========================================== */
.treelist li > a:before,
#mailboxlist li > a:before,
.folderlist li > a:before,
.listing.iconized li > a:before {
    color: #000000 !important;
}

.folderlist li.mailbox.unread > a,
.folderlist li.mailbox.recent > a {
    color: #000000 !important;
}

/* ===========================================
   MENU HOVER (dropdown menu)
   =========================================== */
.menu a:not(.disabled):hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
    color: #2c363a !important;
}
.menu a:not(.disabled):hover:before {
    color: #000000 !important;
}

/* ===========================================
   TASKMENU COMPOSE BUTTON
   =========================================== */
#taskmenu a.button.compose:before {
    color: #000000 !important;
}

/* ===========================================
   ESCLUSIONI - TOOLBAR (devono rimanere grigie)
   =========================================== */
.menu.toolbar a,
.menu.toolbar a:before,
.menu.toolbar a:after,
.menu.toolbar li a,
.menu.toolbar li a:before,
.toolbar a,
.toolbar a:before,
.header .toolbar a,
.header .toolbar a:before,
#layout-content .menu.toolbar a,
#layout-content .menu.toolbar a:before,
#layout-content .header .toolbar a,
#layout-content .header .toolbar a:before,
a.button:not(.btn-primary):not(.compose),
a.button.icon,
a.button.icon:before,
a.back-sidebar-button,
a.back-list-button,
a.back-content-button,
a.button.icon.toolbar-menu-button,
a.button.icon.toolbar-menu-button:before,
a.button.icon.toolbar-list-button,
a.button.icon.toolbar-list-button:before,
button.btn.toolbar-menu-button,
button.btn.toolbar-menu-button:before,
button.btn.toolbar-list-button,
button.btn.toolbar-list-button:before,
a.toolbar-button,
a.toolbar-button:before,
#attachment-list a.button.dropdown,
.attachmentslist a.button.dropdown,
a.button.icon.dropdown,
.menu.toolbar .dropbutton a.dropdown,
.menu.toolbar .dropbutton a.dropdown:before {
    color: #333 !important;
}

/* Dark mode toolbar */
html.dark-mode .menu.toolbar a,
html.dark-mode .menu.toolbar a:before,
html.dark-mode .toolbar a,
html.dark-mode .toolbar a:before {
    color: #e0e0e0 !important;
}

/* ===========================================
   TOOLBAR HOVER - icone bianche su sfondo colorato
   =========================================== */
.menu.toolbar a:hover,
.menu.toolbar a:hover:before,
.menu.toolbar li a:hover,
.menu.toolbar li a:hover:before,
.toolbar a:hover,
.toolbar a:hover:before,
.header .toolbar a:hover,
.header .toolbar a:hover:before,
#layout-content .menu.toolbar a:hover,
#layout-content .menu.toolbar a:hover:before,
a.button:not(.btn-primary):not(.compose):hover,
a.button:not(.btn-primary):not(.compose):hover:before,
a.button.icon:hover,
a.button.icon:hover:before,
a.toolbar-button:hover,
a.toolbar-button:hover:before {
    color: #ffffff !important;
    background-color: #000000 !important;
}

/* Dark mode toolbar hover */
html.dark-mode .menu.toolbar a:hover,
html.dark-mode .menu.toolbar a:hover:before,
html.dark-mode .toolbar a:hover,
html.dark-mode .toolbar a:hover:before {
    color: #ffffff !important;
    background-color: #000000 !important;
}

/* ===========================================
   CALENDARIO - MINI DATEPICKER (sidebar)
   =========================================== */

/* Numeri dei giorni nel mini calendario */
#datepicker .ui-datepicker td a,
#datepicker .ui-state-default,
.ui-datepicker td a,
.ui-datepicker .ui-state-default,
.calendarmain #datepicker td a {
    color: #000000 !important;
}

/* Numero settimana nel mini calendario */
body.task-calendar .ui-datepicker-inline .ui-datepicker-week-col,
.ui-datepicker .ui-datepicker-week-col,
#datepicker .ui-datepicker-week-col,
.calendarmain .ui-datepicker-week-col {
    color: #000000 !important;
    border-left-color: rgba(0, 0, 0, 0.3) !important;
    border-right-color: rgba(0, 0, 0, 0.3) !important;
    border-top-color: rgba(0, 0, 0, 0.3) !important;
    border-bottom-color: rgba(0, 0, 0, 0.3) !important;
}

/* Range di date attivo (giorni della settimana corrente) */
#datepicker td.ui-datepicker-activerange,
#datepicker .ui-datepicker-activerange a,
.ui-datepicker-activerange a.ui-state-default {
    background: rgba(0, 0, 0, 0.15) !important;
    color: #000000 !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
}

/* Hover sui giorni */
#datepicker .ui-datepicker-days-cell-over a,
#datepicker .ui-datepicker-days-cell-over a.ui-state-default,
.ui-datepicker .ui-datepicker-days-cell-over a,
.ui-datepicker .ui-datepicker-days-cell-over a.ui-state-default {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
    border-color: #000000 !important;
}

/* Giorno selezionato/attivo - MASSIMA PRIORITÀ */
#datepicker .ui-datepicker-activerange a.ui-state-active,
#datepicker .ui-state-active,
#datepicker a.ui-state-active,
.ui-datepicker a.ui-state-active,
.ui-datepicker .ui-state-active,
.ui-datepicker td a.ui-state-active,
.calendarmain .ui-datepicker .ui-state-active {
    background: #000000 !important;
    color: #ffffff !important;
    font-weight: bold !important;
}

/* Giorno di oggi evidenziato */
#datepicker .ui-state-highlight,
.ui-datepicker .ui-state-highlight,
.ui-datepicker td a.ui-state-highlight {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #000000 !important;
}

/* ===========================================
   CALENDARIO - FULLCALENDAR (vista principale)
   =========================================== */

/* Numero del giorno nella griglia mensile */
.fc-day-number,
.fc .fc-daygrid-day-number,
.fc-daygrid-day-number {
    color: #000000 !important;
}

/* Giorno di oggi */
.fc-day.fc-today,
.fc .fc-day-today,
.fc-daygrid-day.fc-day-today,
td.fc-today,
.calendarmain .fc-unthemed td.fc-day.fc-today {
    background: rgba(0, 0, 0, 0.12) !important;
}

/* Indicatore ORA nel calendario (linea rossa) */
.fc .fc-now-indicator,
.fc-now-indicator,
.fc-time-grid .fc-now-indicator,
.fc-time-grid .fc-now-indicator-line,
.fc-timegrid-now-indicator-line,
.fc .fc-timegrid-now-indicator-line {
    border-color: #000000 !important;
    background-color: #000000 !important;
}

.fc-time-grid .fc-now-indicator-arrow,
.fc-timegrid-now-indicator-arrow,
.fc .fc-timegrid-now-indicator-arrow {
    border-color: #000000 !important;
    border-left-color: #000000 !important;
    border-right-color: transparent !important;
    border-top-color: transparent !important;
    border-bottom-color: transparent !important;
}

.fc-day-today .fc-daygrid-day-number,
.fc-day.fc-today .fc-day-number,
.calendarmain .fc-day.fc-today .fc-day-number {
    color: #000000 !important;
    font-weight: bold !important;
}

/* Eventi nel calendario - usano i colori delle categorie definite in config.inc.php */
/* calendar_event_coloring = 1 significa che gli eventi prendono il colore dalla categoria */

/* Bottoni del calendario (già inclusi sopra, ma rafforziamo) */
.fc-button-primary,
.fc .fc-button-primary,
.fc-toolbar .fc-button,
.fc-toolbar-chunk .fc-button,
.calendarmain .fc-button {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
}

.fc-button-primary:hover,
.fc .fc-button-primary:hover,
.fc-button-primary:focus,
.fc-button-primary:active,
.fc-button-primary.fc-button-active {
    background-color: #000000 !important;
    border-color: #000000 !important;
}

/* Header del calendario (giorni della settimana) */
.fc-widget-header,
.fc th,
.fc-col-header-cell,
.fc-scrollgrid-sync-inner {
    color: #000000 !important;
}

/* ===========================================
   CALENDARIO - VISTA LISTA/AGENDA
   =========================================== */

/* Header della lista eventi */
.fc-list-heading td,
.fc-list-heading-main,
.fc-list-heading-alt,
.fc-list-table td.fc-list-header,
.calendarmain .fc-view-table td.fc-list-header {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #000000 !important;
}

/* Righe della lista eventi */
.fc-list-item:hover td,
.fc-list-table tr.fc-list-item:hover td {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* ===========================================
   CALENDARIO - PANNELLO LATERALE (sidebar)
   =========================================== */

/* Lista calendari */
#calendars .treelist li.selected > div.calendar,
#calendars .treelist li.selected > a.calname {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

/* ===========================================
   LISTING - ELEMENTI SELEZIONATI E QUICKVIEW
   =========================================== */

/* Quickview icon */
.listing li > div a.quickview:before,
#calendars .treelist div a.quickview:before,
#calendars .treelist div:hover a.quickview:before,
.listing li > div a.quickview:hover:before {
    color: #000000 !important;
}

/* Elementi selezionati nella listing */
.listing li.selected > div > *,
.listing li.selected > div,
.listing li.selected > div > a,
.listing li.selected > div > span {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

/* Treelist elementi selezionati */
ul.treelist li.selected > a,
ul.treelist li.selected > div > a,
ul.treelist li.selected > div,
.treelist li.selected > a,
.treelist li.selected > div > a,
.treelist li.selected > div {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

/* Bordo sinistro per elementi selezionati */
.listing li.selected,
ul.treelist li.selected,
.treelist li.selected {
    border-left-color: #000000 !important;
}

/* Testo elementi selezionati */
.listing li.selected > div > a,
ul.treelist li.selected > a,
ul.treelist li.selected > div > a {
    color: #000000 !important;
}

/* Badge conteggio eventi */
#calendars .treelist .calendar .count {
    background: #000000 !important;
    color: #ffffff !important;
}

/* Icona del calendario */
#calendars .treelist li span.handle {
    border-color: #000000 !important;
}

/* ===========================================
   CALENDARIO - DIALOG/POPUP EVENTI
   =========================================== */

/* Focus negli input dei dialog */
.calendarmain .ui-dialog input:focus,
.calendarmain .ui-dialog select:focus,
.calendarmain .ui-dialog textarea:focus {
    border-color: #000000 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2) !important;
}

/* Bottoni del dialog */
.calendarmain .ui-dialog .ui-dialog-buttonset button.btn-primary {
    background: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
}

/* ===========================================
   TASKLIST - LISTA ATTIVITÀ
   =========================================== */

/* Checkbox delle attività */
.tasklist .taskhead input[type="checkbox"]:checked + label:before {
    color: #000000 !important;
}

/* Priorità alta */
.tasklist li.taskitem.flagged .taskhead {
    border-left-color: #000000 !important;
}

/* Badge conteggio attività */
#tasklists .treelist .tasklist .count {
    background: #000000 !important;
    color: #ffffff !important;
}

/* ===========================================
   CALENDARIO - DARK MODE
   =========================================== */
html.dark-mode #datepicker .ui-datepicker td a,
html.dark-mode #datepicker .ui-state-default,
html.dark-mode .ui-datepicker td a,
html.dark-mode .fc-day-number,
html.dark-mode .fc .fc-daygrid-day-number {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.dark-mode #datepicker .ui-state-active,
html.dark-mode .ui-datepicker .ui-state-active {
    background: #000000 !important;
    color: #ffffff !important;
}

html.dark-mode .fc-day.fc-today,
html.dark-mode td.fc-today {
    background: rgba(0, 0, 0, 0.15) !important;
}

/* ===========================================
   EMAIL - NASCONDE BORDI TABELLE HTML
   =========================================== */

/* Nascondi i bordi tratteggiati delle celle nelle email HTML */
#messagebody table,
#messagebody td,
#messagebody th,
#messagebody tr,
.message-part table,
.message-part td,
.message-part th,
.message-part tr,
.message-htmlpart table,
.message-htmlpart td,
.message-htmlpart th,
.message-htmlpart tr,
#messagecontframe table,
#messagecontframe td,
#messagecontframe th,
#messagecontframe tr {
    border: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    outline: none !important;
}

/* Nascondi bordi anche in composizione email */
#compose-body table,
#compose-body td,
#compose-body th,
#compose-body tr,
.mce-content-body table,
.mce-content-body td,
.mce-content-body th,
.mce-content-body tr,
.html-editor table,
.html-editor td,
.html-editor th,
.html-editor tr {
    border: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

/* Specifico per iframe del messaggio */
iframe#messagecontframe table,
iframe#messagecontframe td,
iframe#messagecontframe th,
iframe.mail-preview-frame table,
iframe.mail-preview-frame td,
iframe.mail-preview-frame th {
    border: none !important;
}

/* Rimuovi bordi da email inoltrate/risposte */
.rcmBody table,
.rcmBody td,
.rcmBody th,
.rcmBody tr,
blockquote table,
blockquote td,
blockquote th,
blockquote tr {
    border: none !important;
    border-collapse: collapse !important;
}

/* ===========================================
   OVERRIDE TINYMCE - Rimuovi bordi tratteggiati editor
   =========================================== */

/* TinyMCE aggiunge bordi dashed alle tabelle - rimuovili */
.mce-content-body table,
.mce-content-body td,
.mce-content-body th,
.mce-content-body tr,
.mce-content-body .mce-item-table,
.mce-content-body .mce-item-table td,
.mce-content-body .mce-item-table th,
#tinymce table,
#tinymce td,
#tinymce th,
#composebody table,
#composebody td,
#composebody th,
.mce-item-table:not([border]),
.mce-item-table:not([border]) td,
.mce-item-table:not([border]) th,
.mce-item-table[border="0"],
.mce-item-table[border="0"] td,
.mce-item-table[border="0"] th {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
}

/* ===========================================
   FINESTRA ESTERNA (extwin) - Rimuovi spazio navbar
   =========================================== */

/* Quando siamo in finestra esterna, il layout-menu non esiste */
/* quindi il contenuto deve occupare tutto lo spazio disponibile */
body.extwin #layout,
body.extwin #layout-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Nascondi navbar e header vuoti nella finestra compose esterna */
body.extwin #layout > .header:empty,
body.extwin #layout-menu,
body.extwin .popover-header:empty {
    display: none !important;
}

/* Il layout content deve partire dall'inizio */
body.extwin #layout {
    padding-top: 0 !important;
}

/* Rimuovi lo spazio riservato per il menu a sinistra */
body.extwin #layout-sidebar,
body.extwin #layout-list,
body.extwin #layout-content,
body.extwin #compose-sidebar {
    left: 0 !important;
}

/* Nasconde completamente la sidebar sinistra in extwin */
body.extwin #layout-sidebar {
    display: none !important;
}

/* In extwin il contenuto deve usare tutto lo spazio */
body.extwin #layout-content {
    width: 100% !important;
    flex: 1 !important;
}

/* Assicura che non ci sia padding in alto */
body.extwin,
body.extwin #layout {
    padding: 0 !important;
    margin: 0 !important;
}

/* Rimuovi header vuoto sopra il compose */
body.extwin .voice:first-child {
    display: none !important;
}
