/* Specific dark-theme overrides also win over page-local light styles. */
html body #alert-vade.payment-notification{width:390px;max-width:calc(100vw - 32px);min-width:0;padding:18px;background:#fff;color:#334155;border:1px solid #e2e8f0;border-left:4px solid var(--payment-accent,#6366f1);border-radius:14px;box-shadow:0 12px 40px #15233d26}
#alert-vade.vade-overdue{--payment-accent:#e11d48}
#alert-vade:is(.vade-today,.vade-d1){--payment-accent:#ea580c}
#alert-vade.vade-d2{--payment-accent:#ca8a04}
#alert-vade.vade-d3{--payment-accent:#0284c7}
.payment-notification-heading{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.payment-notification-heading>i{font-size:24px;color:var(--payment-accent);background:#6366f10d;border-radius:10px;padding:8px}
.payment-notification-heading strong{display:block;font-size:14px}
.payment-notification-heading span{display:block;font-size:11px;color:#64748b;margin-top:3px}
#alert-vade .vade-li{margin-bottom:7px;line-height:1.5}
html body #alert-vade .vade-btn{display:flex;align-items:center;justify-content:space-between;border:1px solid #e0e7ff;background:#eef2ff;color:#4338ca;padding:8px 12px;font-weight:600;border-radius:8px}
html[data-bs-theme="dark"] body #alert-vade.payment-notification{background:#2a3042;color:#e2e8f0;border-color:#41485c;border-left-color:var(--payment-accent);box-shadow:0 12px 40px #0005}
html[data-bs-theme="dark"] #alert-vade .payment-notification-heading span{color:#a8b2cc}
html[data-bs-theme="dark"] #alert-vade .vade-overdue{color:#fda4af}
html[data-bs-theme="dark"] #alert-vade :is(.vade-today,.vade-d1){color:#fdba74}
html[data-bs-theme="dark"] #alert-vade .vade-d2{color:#fde68a}
html[data-bs-theme="dark"] #alert-vade .vade-d3{color:#7dd3fc}
html[data-bs-theme="dark"] body #alert-vade .vade-btn{background:#353e58;color:#c7d2fe;border-color:#52617e}
html[data-bs-theme="dark"] #alert-vade .btn-close{filter:invert(1)}
html body .community-toast.message-toast{border-color:#c7d2fe;border-left-color:#6366f1}
.message-toast .message-toast-icon{font-size:23px;color:#6366f1;background:#eef2ff;border-radius:10px;padding:9px}
.message-toast a{flex:1;min-width:0;text-decoration:none;color:inherit}
.message-toast a strong{display:block;font-size:14px}
.message-toast a span{display:block;font-size:12px;opacity:.8;margin-top:3px}
html[data-bs-theme="dark"] body .community-toast.message-toast{background:#2a3042;color:#e2e8f0;border-color:#52617e;border-left-color:#a5b4fc}
html[data-bs-theme="dark"] .message-toast .message-toast-icon{background:#353e58;color:#c7d2fe}
html[data-bs-theme="dark"] .community-toast button{color:#c4cde1}
/* Sidebar palette follows the night theme, including collapsed flyout menus. */
html[data-bs-theme="dark"] body[data-sidebar="dark"]{
  --bs-sidebar-dark-bg:#242a3b;
  --bs-sidebar-bg:#242a3b;
  --bs-sidebar-dark-menu-item-color:#c4cde1;
  --bs-sidebar-dark-menu-sub-item-color:#b4bfd6;
  --bs-sidebar-dark-menu-item-hover-color:#f1f5ff;
  --bs-sidebar-dark-menu-item-active-color:#c7d2fe;
  --bs-sidebar-dark-menu-item-active-bg:#353e58;
}
html[data-bs-theme="dark"] body[data-sidebar="dark"] :is(.vertical-menu,.navbar-brand-box){background-color:#242a3b;border-right:1px solid #363e52}
html[data-bs-theme="dark"] body[data-sidebar="dark"] #sidebar-menu .menu-title{color:#98a6c3}
html[data-bs-theme="dark"] body[data-sidebar="dark"] #sidebar-menu a:is(:hover,:focus-visible){background-color:#30394f;color:#f1f5ff}
html[data-bs-theme="dark"] body[data-sidebar="dark"] #sidebar-menu a.active{background-color:#353e58;color:#c7d2fe!important}
html[data-bs-theme="dark"] body[data-sidebar="dark"] #sidebar-menu a.active i{color:#c7d2fe}
html[data-bs-theme="dark"]{color-scheme:dark;background:#222736}
html[data-bs-theme="dark"] body{background:var(--bs-body-bg,#222736);color:var(--bs-body-color,#bfc8e2)}
html[data-bs-theme="dark"] .main-content :is(.card,.community-card,.chat-layout,.chat-panel,.chat-people,.community-toast){background:var(--bs-secondary-bg,#2a3042);color:var(--bs-body-color,#bfc8e2);border-color:var(--bs-border-color,#383f54)!important}
html[data-bs-theme="dark"] :is(.form-label,.hint,.community p,.community-card small,.chat-meta){color:var(--bs-secondary-color,#a8b2cc)!important}
html[data-bs-theme="dark"] :is(.filter-box,.vt-box,.card-header.accent,.card-header.accent-2,.timeline-date,.timeline-content,.chat-bubble){background:var(--bs-tertiary-bg,#30384c)!important;color:var(--bs-body-color,#d0d7e8);border-color:var(--bs-border-color,#41485c)!important}
html[data-bs-theme="dark"] .main-content :is(.card-header,.form-control,.form-select,.table,.btn-icon){border-color:var(--bs-border-color,#41485c)!important}
html[data-bs-theme="dark"] .main-content :is(.form-control,.form-select,.btn-icon){background-color:var(--bs-secondary-bg,#2a3042)!important;color:var(--bs-body-color,#d0d7e8)!important}
html[data-bs-theme="dark"] .main-content .table{--bs-table-bg:transparent;--bs-table-color:var(--bs-body-color,#d0d7e8);--bs-table-striped-bg:#ffffff06;--bs-table-hover-bg:#ffffff0b}
html[data-bs-theme="dark"] .main-content .table thead th{background:var(--bs-tertiary-bg,#30384c)!important;color:var(--bs-body-color,#d0d7e8)}
html[data-bs-theme="dark"] .main-content .table-striped>tbody>tr:nth-of-type(odd){--bs-table-accent-bg:#ffffff06}
html[data-bs-theme="dark"] :is(.badge-soft,.btn-soft,.chip){background:#30384c!important;color:#cad5fc!important;border-color:#495675!important}
html[data-bs-theme="dark"] :is(.badge-soft-success,.bg-success-subtle){background:#193d35!important;color:#a1e5c3!important;border-color:#356d56!important}
html[data-bs-theme="dark"] :is(.badge-soft-danger,.btn-soft-danger){background:#492b36!important;color:#f5b3c0!important;border-color:#75505c!important}
html[data-bs-theme="dark"] .badge-soft-warning{background:#493e29!important;color:#f5d493!important;border-color:#706043!important}
html[data-bs-theme="dark"] .bg-secondary-subtle{background:#343c50!important;color:#cdd5e4!important}
html[data-bs-theme="dark"] :is(.border-success-subtle,.border-secondary-subtle){border-color:#495675!important}
html[data-bs-theme="dark"] .select2-container .select2-selection{background:var(--bs-secondary-bg,#2a3042)!important;border-color:var(--bs-border-color,#41485c)!important;color:var(--bs-body-color,#d0d7e8)!important}
html[data-bs-theme="dark"] :is(.select2-selection__rendered,.select2-search__field){color:var(--bs-body-color,#d0d7e8)!important}
html[data-bs-theme="dark"] :is(.select2-dropdown,.select2-search__field,.select2-results__option){background:var(--bs-secondary-bg,#2a3042);border-color:var(--bs-border-color,#41485c)!important;color:var(--bs-body-color,#d0d7e8)}
html[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected]{background:#445a94;color:white}
html[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true]{background:#38445f}
html[data-bs-theme="dark"] :is(.chat-peer:hover,.chat-peer.active,.mine .chat-bubble){background:#344364;color:#e1e7f7}
html[data-bs-theme="dark"] .community-toast{background:#2a3042;color:#e1e7f7;border-color:#356d56}
html[data-bs-theme="dark"] .timeline-dot{outline-color:var(--bs-secondary-bg,#2a3042)}
@media print{html[data-bs-theme="dark"] body{background:white;color:black}}

html[data-bs-theme="dark"] :is(.soft-box,.cs-totalbar,.cs-card .card-header,.toolbar .filters){background:var(--bs-secondary-bg,#2a3042)!important;color:var(--bs-body-color,#d0d7e8);border-color:var(--bs-border-color,#41485c)!important}
html[data-bs-theme="dark"] :is(.cs-rowno,.rowNo){color:#a8b2cc!important}
html[data-bs-theme="dark"] .btn-ghost:hover{background:#30384c}
html[data-bs-theme="dark"] .ue-ekstre{--ue-ink:#d0d7e8;--ue-muted:#a8b2cc;--ue-line:#41485c;--ue-card:#2a3042}
html[data-bs-theme="dark"] .ue-ekstre :is(.ue-dt,.ue-tag,.ue-mini,.ue-s,.ue-ba,.ue-items,.ue-bcell,.ue-it thead th){background:#30384c;color:#d0d7e8;border-color:#41485c}
html[data-bs-theme="dark"] .ue-ekstre .ue-sbal .ue-sval{color:#d0d7e8}
html[data-bs-theme="dark"] .ue-ekstre :is(.ue-tagred,.ue-bared){background:#492b36;color:#f5b3c0}

/* Card headings must override Bootstrap's !important bg-white utility. */
html[data-bs-theme="dark"] .main-content .card-header{
  background-color:var(--bs-secondary-bg,#2a3042)!important;
  color:var(--bs-body-color,#d0d7e8);
}
html[data-bs-theme="dark"] .main-content :is(.card-header h4,.card-header h5,.card-header h6){color:inherit}
html[data-bs-theme="dark"] .main-content .bg-light.text-dark{
  background-color:var(--bs-tertiary-bg,#30384c)!important;
  color:var(--bs-body-color,#d0d7e8)!important;
}
html[data-bs-theme="dark"] .main-content .table-light{
  --bs-table-bg:var(--bs-tertiary-bg,#30384c);
  --bs-table-color:var(--bs-body-color,#d0d7e8);
  --bs-table-border-color:var(--bs-border-color,#41485c);
}
html[data-bs-theme="dark"] .main-content :is(.table-container,.total-bar){
  background-color:var(--bs-tertiary-bg,#30384c);
  border-color:var(--bs-border-color,#41485c);
}
html[data-bs-theme="dark"] .main-content .section-header .tab{background:#30384c;color:#d0d7e8}
html[data-bs-theme="dark"] .main-content .section-header h2{color:#d0d7e8}
html[data-bs-theme="dark"] .main-content .tile{
  --tile-bg:linear-gradient(135deg,#30384c,#262e40 70%);
  --tile-shadow:0 2px 8px #0003;
  --tile-shadow-hover:0 12px 26px #0005;
  color:#d0d7e8;border-color:#ffffff14;
}
html[data-bs-theme="dark"] .main-content .tile h3{color:inherit}
html[data-bs-theme="dark"] .main-content .tile small{color:#bcc7d9}
html[data-bs-theme="dark"] .main-content .tile .tile-icon{background:#ffffff0d}
html[data-bs-theme="dark"] .main-content :is(.tile-cyan,.tile-sky,.tile-blue){--tile-bg:linear-gradient(135deg,#233f55,#203346 70%);color:#bae6fd}
html[data-bs-theme="dark"] .main-content :is(.tile-indigo,.tile-violet,.tile-purple,.tile-fuchsia){--tile-bg:linear-gradient(135deg,#393350,#2e2b45 70%);color:#ddd6fe}
html[data-bs-theme="dark"] .main-content :is(.tile-emerald,.tile-teal,.tile-green,.tile-lime){--tile-bg:linear-gradient(135deg,#23463d,#20392f 70%);color:#bbf7d0}
html[data-bs-theme="dark"] .main-content :is(.tile-amber,.tile-yellow,.tile-orange){--tile-bg:linear-gradient(135deg,#4b3c2d,#3a3026 70%);color:#fde68a}
html[data-bs-theme="dark"] .main-content :is(.tile-rose,.tile-red){--tile-bg:linear-gradient(135deg,#4c2d3c,#3d2733 70%);color:#fecdd3}
