/* DARK_FIX_V1 — dark-mode readability for every page (client + admin, any theme).
   The old theme forces light text on every div/span/p in dark mode, so widgets that keep a
   white background (toasts, alerts, pop-ups, pickers, white boxes) became light-on-white.
   Here those surfaces turn dark instead. Colours fall back to neutral values when the glass theme is off. */

/* ---------- toasts: simple-notify (copy / success / error pop-ups) ---------- */
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify{background:var(--g-solid,#1e293b)!important;color:var(--g-ink,#f1f5f9)!important;border-color:rgba(255,255,255,.14)!important;box-shadow:0 12px 32px rgba(0,0,0,.45)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify__title{color:var(--g-ink,#f8fafc)!important;font-weight:700!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify__text{color:var(--g-muted,#cbd5e1)!important;opacity:1!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify__close,:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify__close *{color:var(--g-muted,#cbd5e1)!important;fill:currentColor!important;opacity:.9!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify--success{border-left:4px solid #34D399!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify--success .notify__icon{color:#34D399!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify--error{border-left:4px solid #F87171!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify--error .notify__icon{color:#F87171!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify--warning{border-left:4px solid #FBBF24!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .notify--info{border-left:4px solid #60A5FA!important}

/* ---------- SweetAlert2 ---------- */
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .swal2-popup{background:var(--g-solid,#1e293b)!important;color:var(--g-ink,#f1f5f9)!important;border:1px solid rgba(255,255,255,.12)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.swal2-title,.swal2-html-container,.swal2-content){color:var(--g-ink,#f1f5f9)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .swal2-input,:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .swal2-textarea,:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .swal2-select{background:rgba(255,255,255,.06)!important;color:var(--g-ink,#f1f5f9)!important;border-color:rgba(255,255,255,.18)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .swal2-timer-progress-bar{background:rgba(255,255,255,.35)!important}

/* ---------- cute-alert ---------- */
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.alert-frame,.toast-content){background:var(--g-solid,#1e293b)!important;color:var(--g-ink,#f1f5f9)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.alert-title,.alert-message,.toast-message){color:var(--g-ink,#f1f5f9)!important}

/* ---------- Bootstrap alerts: tinted dark panels with readable text ---------- */
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .alert-success{background:rgba(16,185,129,.14)!important;border-color:rgba(16,185,129,.35)!important;color:#A7F3D0!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .alert-danger{background:rgba(239,68,68,.14)!important;border-color:rgba(239,68,68,.35)!important;color:#FECACA!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .alert-warning{background:rgba(245,158,11,.14)!important;border-color:rgba(245,158,11,.35)!important;color:#FDE68A!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .alert-info{background:rgba(56,189,248,.14)!important;border-color:rgba(56,189,248,.35)!important;color:#BAE6FD!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .alert-primary{background:rgba(96,165,250,.14)!important;border-color:rgba(96,165,250,.35)!important;color:#BFDBFE!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.alert-secondary,.alert-light){background:rgba(255,255,255,.06)!important;border-color:rgba(255,255,255,.14)!important;color:var(--g-ink,#e5e7eb)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .alert :is(p,span,div,li,strong,b){color:inherit!important}

/* ---------- white helpers / white inline boxes -> dark surface ---------- */
:is(html[data-theme="dark"]) :is(.bg-white,.bg-light){background-color:var(--g-solid,#1e293b)!important}
:is(html[data-theme="dark"]) :is([style*="background: #fff"],[style*="background:#fff"],[style*="background-color: #fff"],[style*="background-color:#fff"],[style*="background: white"],[style*="background:white"],[style*="background-color: white"],[style*="background-color:white"],[style*="background: #ffffff"],[style*="background-color: #ffffff"],[style*="background:#ffffff"],[style*="background-color:#ffffff"]){background-color:var(--g-solid,#1e293b)!important}
:is(html[data-theme="dark"]) :is(.text-dark,.text-black,.link-dark){color:var(--g-ink,#e5e7eb)!important}
:is(html[data-theme="dark"]) .text-muted{color:var(--g-muted,#94a3b8)!important}
:is(html[data-theme="dark"]) .text-secondary{color:var(--g-muted,#94a3b8)!important}

/* ---------- lists, tabs, pagination, dropdowns, pickers ---------- */
:is(html[data-theme="dark"]) .list-group-item{background:rgba(255,255,255,.04)!important;color:var(--g-ink,#e5e7eb)!important;border-color:rgba(255,255,255,.1)!important}
:is(html[data-theme="dark"]) .nav-tabs .nav-link.active,:is(html[data-theme="dark"]) .nav-pills .nav-link:not(.active){background:rgba(255,255,255,.06)!important;color:var(--g-ink,#e5e7eb)!important;border-color:rgba(255,255,255,.12)!important}
:is(html[data-theme="dark"]) .page-link{background:rgba(255,255,255,.06)!important;color:var(--g-ink,#e5e7eb)!important;border-color:rgba(255,255,255,.12)!important}
:is(html[data-theme="dark"]) .dropdown-menu{background:var(--g-solid,#1e293b)!important;border-color:rgba(255,255,255,.12)!important}
:is(html[data-theme="dark"]) .dropdown-menu :is(.dropdown-item,a,li){color:var(--g-ink,#e5e7eb)!important}
:is(html[data-theme="dark"]) .dropdown-menu .dropdown-item:hover{background:rgba(255,255,255,.08)!important}
:is(html[data-theme="dark"]) .nice-select .list{background:var(--g-solid,#1e293b)!important;border:1px solid rgba(255,255,255,.12)!important}
:is(html[data-theme="dark"]) .nice-select .option{color:var(--g-ink,#e5e7eb)!important}
:is(html[data-theme="dark"]) .nice-select .option:hover,:is(html[data-theme="dark"]) .nice-select .option.focus,:is(html[data-theme="dark"]) .nice-select .option.selected.focus{background:rgba(255,255,255,.08)!important}
:is(html[data-theme="dark"]) .ui-autocomplete,:is(html[data-theme="dark"]) .ui-menu{background:var(--g-solid,#1e293b)!important;border-color:rgba(255,255,255,.12)!important;color:var(--g-ink,#e5e7eb)!important}
:is(html[data-theme="dark"]) .ui-menu .ui-state-active{background:rgba(255,255,255,.1)!important;border-color:transparent!important;color:#fff!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .flatpickr-calendar{background:var(--g-solid,#1e293b)!important;box-shadow:0 12px 32px rgba(0,0,0,.45)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .flatpickr-calendar :is(.flatpickr-day,.flatpickr-weekday,.flatpickr-month,.cur-month,.cur-year,.flatpickr-monthDropdown-months){color:var(--g-ink,#e5e7eb)!important;fill:var(--g-ink,#e5e7eb)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .flatpickr-day:hover{background:rgba(255,255,255,.1)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .flatpickr-day.flatpickr-disabled{color:rgba(255,255,255,.3)!important}

/* ---------- forms + placeholders + code ---------- */
:is(html[data-theme="dark"]) :is(textarea,select,input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"]):not(.header-form input){background-color:rgba(255,255,255,.06)!important;color:var(--g-ink,#e5e7eb)!important;border-color:rgba(255,255,255,.16)!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) ::placeholder{color:var(--g-muted,#94a3b8)!important;opacity:1!important}
:is(html[data-theme="dark"]) select option{background:var(--g-solid,#1e293b);color:var(--g-ink,#e5e7eb)}
:is(html[data-theme="dark"]) :not(pre)>code{background:rgba(255,255,255,.08)!important;color:#FBCFE8!important;padding:.1em .35em;border-radius:6px}

/* ---------- tables keep readable stripes / hover ---------- */
:is(html[data-theme="dark"]) .table{--bs-table-color:var(--g-ink,#e5e7eb);--bs-table-bg:transparent;--bs-table-striped-color:var(--g-ink,#e5e7eb);--bs-table-hover-color:#fff;--bs-table-border-color:rgba(255,255,255,.1)}
:is(html[data-theme="dark"]) .table-light,:is(html[data-theme="dark"]) .table-light>*>*{--bs-table-bg:rgba(255,255,255,.06)!important;background-color:rgba(255,255,255,.06)!important;color:var(--g-ink,#e5e7eb)!important}

/* ---------- links in dark ---------- */
:is(html[data-theme="dark"]) .text-primary{color:var(--g-brand-text,#7FB6FF)!important}

/* DARK_FIX_V2 — simple-notify 1.x uses "sn-" class names; Bootstrap toasts */
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify{background:var(--g-solid,#1e293b)!important;color:var(--g-ink,#f1f5f9)!important;border:1px solid rgba(255,255,255,.14)!important;box-shadow:0 12px 32px rgba(0,0,0,.45)!important;opacity:1!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-title{color:var(--g-ink,#f8fafc)!important;font-weight:700!important;opacity:1!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-text{color:var(--g-muted,#cbd5e1)!important;opacity:1!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-close,:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-close *{color:var(--g-muted,#cbd5e1)!important;fill:currentColor!important;opacity:.9!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-success{border-left:4px solid #34D399!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-success .sn-notify-icon{color:#34D399!important;opacity:1!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-error{border-left:4px solid #F87171!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-error .sn-notify-icon{color:#F87171!important;opacity:1!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-warning{border-left:4px solid #FBBF24!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .sn-notify-info{border-left:4px solid #60A5FA!important}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.toast,.toast-header,.toast-body){background:var(--g-solid,#1e293b)!important;color:var(--g-ink,#f1f5f9)!important;border-color:rgba(255,255,255,.14)!important}

/* NO_FOCUS_RING_V1 — no glow / ring / colour-change around fields on hover or click, every page, both modes */
html:root body :is(input,textarea,select,.form-control,.form-select,.nice-select,.input-group-text,.choices__inner):is(:hover,:focus,:focus-visible,:focus-within,:active){outline:none!important;box-shadow:none!important}
html:root body :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select,.form-control,.form-select,.nice-select,.choices__inner):is(:focus,:focus-visible,:active,.open,.is-focused){border-color:var(--g-line-soft,#dee2e6)!important}
html:root:is([data-theme="dark"],[data-theme-mode="dark"]) body :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select,.form-control,.form-select,.nice-select,.choices__inner):is(:focus,:focus-visible,:active,.open,.is-focused){border-color:rgba(255,255,255,.16)!important}
html:root body .input-group:focus-within{box-shadow:none!important;outline:none!important}
