/**
 * Dark mode — eye-friendly palette (soft dark blue-gray, not pure black)
 */
html[data-theme="dark"] {
  color-scheme: dark;
  --dm-bg: #111820;
  --dm-bg-alt: #0d1218;
  --dm-surface: #1a2332;
  --dm-surface-2: #222d3f;
  --dm-surface-3: #2a3649;
  --dm-border: #2f3d52;
  --dm-border-light: #3d4f68;
  --dm-text: #dce4ef;
  --dm-text-secondary: #a8b6c8;
  --dm-text-muted: #7b8da3;
  --dm-accent: #5b9cf5;
  --dm-accent-hover: #7ab3f8;
  --dm-accent-soft: rgba(91, 156, 245, 0.14);
  --dm-accent-border: rgba(91, 156, 245, 0.35);
  --dm-success-soft: rgba(34, 197, 94, 0.15);
  --dm-danger-soft: rgba(239, 68, 68, 0.15);
  --dm-warning-soft: rgba(245, 158, 11, 0.15);
  --dm-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --dm-input-bg: #1e2838;
  --dm-header-from: #1a2332;
  --dm-header-to: #151d2a;
}

/* ── Base ── */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: var(--dm-bg) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] body.hold-transition {
  background-color: var(--dm-bg) !important;
}
html[data-theme="dark"] main,
html[data-theme="dark"] #scrollable-container,
html[data-theme="dark"] .content-wrapper,
html[data-theme="dark"] .tw-bg-gray-100 {
  background-color: var(--dm-bg) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .tw-bg-white {
  background-color: var(--dm-surface) !important;
}
html[data-theme="dark"] .tw-text-gray-900,
html[data-theme="dark"] .tw-text-black {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .tw-text-gray-700,
html[data-theme="dark"] .tw-text-gray-600 {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .tw-text-gray-500,
html[data-theme="dark"] .tw-text-gray-400 {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .tw-border-gray-200,
html[data-theme="dark"] .tw-border-gray-100 {
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .tw-ring-gray-200 {
  --tw-ring-color: var(--dm-border) !important;
}
html[data-theme="dark"] .tw-shadow-sm,
html[data-theme="dark"] .tw-shadow {
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .content-header h1,
html[data-theme="dark"] .content-header h1 small {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .content-header h1 small {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] a:not(.btn):not(.app-btn-primary):not(.theme-btn-bg) {
  color: var(--dm-accent);
}
html[data-theme="dark"] a:not(.btn):not(.app-btn-primary):not(.theme-btn-bg):hover {
  color: var(--dm-accent-hover);
}
html[data-theme="dark"] hr {
  border-color: var(--dm-border) !important;
}

/* ── Header & logo ── */
html[data-theme="dark"] .theme-header-bg,
html[data-theme="dark"] .theme-logo-bg {
  background: linear-gradient(180deg, var(--dm-header-from) 0%, var(--dm-header-to) 100%) !important;
  background-image: linear-gradient(180deg, var(--dm-header-from) 0%, var(--dm-header-to) 100%) !important;
  border-bottom-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow);
}
html[data-theme="dark"] .theme-logo-bg {
  border-inline-end-color: var(--dm-border) !important;
}
html[data-theme="dark"] .theme-logo-bg .side-bar-heading {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .theme-header-bg .theme-btn-bg {
  color: var(--dm-text-secondary) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .theme-header-bg .theme-btn-bg:hover,
html[data-theme="dark"] .theme-header-bg .theme-btn-bg:focus,
html[data-theme="dark"] .theme-header-bg .theme-btn-bg:focus-visible {
  color: var(--dm-accent) !important;
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .theme-header-bg a.theme-btn-bg {
  color: #fff !important;
  background: linear-gradient(180deg, #4d8fe6 0%, #2f6fcb 100%) !important;
  border-color: #2f6fcb !important;
}
html[data-theme="dark"] .theme-header-bg a.theme-btn-bg:hover {
  background: linear-gradient(180deg, #3f84df 0%, #255fb4 100%) !important;
}
html[data-theme="dark"] .theme-header-bg .theme-btn-bg.tw-font-mono {
  color: var(--dm-text-secondary) !important;
  background: transparent !important;
}
html[data-theme="dark"] .theme-header-bg [class*="ring-white"] {
  --tw-ring-color: var(--dm-border) !important;
}
/* Header — user account menu */
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul {
  background: var(--dm-surface) !important;
  border: 1px solid var(--dm-border) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul.tw-bg-white {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul.tw-ring-gray-200 {
  --tw-ring-color: var(--dm-border) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul > div {
  border-bottom: 1px solid var(--dm-border);
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul p {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul .tw-text-gray-900 {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul a {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul a.tw-text-gray-600 {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul a:hover {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul a svg {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul a:hover svg {
  color: var(--dm-accent);
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul li:last-child a:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown ul li:last-child a:hover svg {
  color: #f87171;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown summary {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .theme-header-bg .tw-dw-dropdown summary span {
  color: var(--dm-text-secondary) !important;
}

/* ── Sidebar ── */
html[data-theme="dark"] .side-bar {
  background-color: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] #side-bar {
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] #side-bar a,
html[data-theme="dark"] #side-bar .drop_down {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] #side-bar a svg,
html[data-theme="dark"] #side-bar a i {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] #side-bar .theme-sidebar-hover:hover,
html[data-theme="dark"] #side-bar .theme-sidebar-active {
  background-color: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] #side-bar a:hover svg,
html[data-theme="dark"] #side-bar a.theme-sidebar-active svg,
html[data-theme="dark"] #side-bar .theme-sidebar-active {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] #sidebar-search {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .side-bar .tw-bg-gray-100 {
  background-color: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] #sidebar-no-results {
  color: var(--dm-text-muted) !important;
  border-color: var(--dm-border) !important;
}

/* ── Cards, boxes, widgets ── */
html[data-theme="dark"] .box,
html[data-theme="dark"] .box-solid,
html[data-theme="dark"] .box-primary,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .contact-show-page__card,
html[data-theme="dark"] .contact-show-unified .contact-show-tabs,
html[data-theme="dark"] .contact-show-tab-panel,
html[data-theme="dark"] .contact-show-profile__section,
html[data-theme="dark"] .contact-show-profile__stat,
html[data-theme="dark"] .contact-show-profile__head {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .contact-ledger__summary-card,
html[data-theme="dark"] .contact-ledger__statement-banner,
html[data-theme="dark"] .catalog-settings-page__intro,
html[data-theme="dark"] .superadmin-package-card--public,
html[data-theme="dark"] .superadmin-subscription-card {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text);
  box-shadow: var(--dm-shadow);
}
html[data-theme="dark"] .superadmin-register-pay-page__shell {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface) 55%) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__top-bar,
html[data-theme="dark"] .superadmin-register-pay-page__hero {
  background: linear-gradient(135deg, #1a2d4a 0%, #1e3a5f 100%) !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__back {
  color: #8ec0ff !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__eyebrow {
  color: #8ec0ff !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__lead {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__user-badge {
  color: #d7e8ff !important;
  background: #1a2d4a !important;
  border-color: #2f6fcb !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__summary .superadmin-subscription-pay-page__package,
html[data-theme="dark"] .superadmin-register-pay-page__checkout {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__summary .superadmin-package-card__header--public {
  background: linear-gradient(180deg, #1a2d4a 0%, var(--dm-surface) 100%) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-register-pay-page__summary .superadmin-package-card__title,
html[data-theme="dark"] .superadmin-register-pay-page__checkout .supplier-contact-form__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__gateway,
html[data-theme="dark"] .superadmin-subscription-pay-page__offline-details {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__gateway-head {
  background: linear-gradient(180deg, #1a2d4a 0%, var(--dm-surface-2) 100%) !important;
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__gateway-body {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__checkout .supplier-contact-form__section {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__coupon-result--success {
  background: rgba(34, 197, 94, 0.12) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__coupon-result--danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__no-gateway {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .superadmin-subscription-page__waiting-lock {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .superadmin-subscription-page__waiting-lock-hint {
  color: #fbbf24 !important;
}

/* ── Superadmin — nav, dashboard, cards, pricing ── */
html[data-theme="dark"] section.no-print nav.navbar-default {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow);
}
html[data-theme="dark"] section.no-print nav.navbar-default .navbar-brand,
html[data-theme="dark"] section.no-print nav.navbar-default .nav > li > a {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] section.no-print nav.navbar-default .nav > li.active > a,
html[data-theme="dark"] section.no-print nav.navbar-default .nav > li > a:hover,
html[data-theme="dark"] section.no-print nav.navbar-default .nav > li > a:focus {
  color: var(--dm-accent) !important;
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] section.no-print nav.navbar-default .icon-bar {
  background-color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .btn-group[data-toggle="buttons"] .btn-info {
  background: var(--dm-surface-3) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .btn-group[data-toggle="buttons"] .btn-info.active {
  background: linear-gradient(180deg, #4d8fe6 0%, #2f6fcb 100%) !important;
  border-color: #2f6fcb !important;
  color: #fff !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .tw-bg-white.tw-ring-gray-200,
html[data-theme="dark"] .superadmin-dashboard-page .superadmin-dashboard-chart-card {
  background: var(--dm-surface) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .tw-ring-gray-200 {
  --tw-ring-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .tw-text-sky-500 {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .tw-bg-sky-100 {
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .tw-bg-red-200 {
  background: var(--dm-danger-soft) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .tw-text-black-200 {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .superadmin-dashboard-page .superadmin-dashboard-chart-card .tw-text-gray-900 {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page [id$="_loader"] svg stop {
  stop-color: var(--dm-accent) !important;
}
html[data-theme="dark"] .superadmin-dashboard-page [id$="_loader"] svg circle {
  fill: var(--dm-accent) !important;
}
html[data-theme="dark"] .dashboard-subscription-banner {
  background: linear-gradient(135deg, rgba(47, 111, 203, 0.18) 0%, rgba(47, 111, 203, 0.08) 55%, var(--dm-surface) 100%) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .dashboard-subscription-banner__icon {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .dashboard-subscription-banner__title {
  color: #93c5fd !important;
}
html[data-theme="dark"] .dashboard-subscription-banner__message {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .dashboard-subscription-banner__hint {
  color: var(--dm-text-muted) !important;
}

/* Superadmin — business list & show */
html[data-theme="dark"] .superadmin-business-page .catalog-settings-page__intro,
html[data-theme="dark"] .superadmin-business-show-page .catalog-settings-page__intro {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-business-page #superadmin_business_table_wrapper .app-table-actions,
html[data-theme="dark"] .superadmin-business-show-page #users_table_wrapper .app-table-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.35rem;
}
html[data-theme="dark"] .superadmin-business-page #superadmin_business_table_wrapper .app-btn-table,
html[data-theme="dark"] .superadmin-business-show-page #users_table_wrapper .app-btn-table {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}
html[data-theme="dark"] .superadmin-business-card {
  background: var(--dm-surface) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-business-card.tw-ring-gray-200,
html[data-theme="dark"] .superadmin-business-page .tw-ring-gray-200,
html[data-theme="dark"] .superadmin-business-show-page .tw-ring-gray-200 {
  --tw-ring-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-business-show-page .text-muted {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-business-show-page .text-muted strong {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-business-show-page .supplier-contact-form__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-business-show-page .supplier-contact-form__title i {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .superadmin-business-show-page .supplier-contact-form__section {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-business-show-page .supplier-contact-form__section p {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-page__business-logo {
  background: var(--dm-surface-2) !important;
  border: 1px solid var(--dm-border) !important;
  border-radius: 0.5rem;
  padding: 0.35rem;
}
html[data-theme="dark"] .superadmin-form-page .tw-bg-white.tw-ring-gray-200 {
  background: var(--dm-surface) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-form-page .tw-ring-gray-200 {
  --tw-ring-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-form-page .supplier-contact-form__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-form-page .supplier-contact-form__title i {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .superadmin-form-page .supplier-contact-form__section {
  border-bottom-color: var(--dm-border) !important;
}

/* Package cards — admin grid */
html[data-theme="dark"] .superadmin-package-card,
html[data-theme="dark"] .superadmin-package-card--subscription {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface) 55%) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .superadmin-package-card:hover,
html[data-theme="dark"] .superadmin-package-card--subscription:hover {
  border-color: var(--dm-border-light) !important;
}
html[data-theme="dark"] .superadmin-package-card--popular,
html[data-theme="dark"] .superadmin-package-card--subscription.superadmin-package-card--popular {
  border-color: var(--dm-accent-border) !important;
  box-shadow: 0 0 0 2px var(--dm-accent-soft), var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-package-card--inactive {
  background: var(--dm-surface) !important;
  opacity: 0.75;
}
html[data-theme="dark"] .superadmin-package-card--subscription.superadmin-package-card--free {
  border-color: rgba(34, 197, 94, 0.35) !important;
  box-shadow: 0 0 0 2px var(--dm-success-soft), var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-package-card__header,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__header {
  background: linear-gradient(135deg, var(--dm-surface-3) 0%, var(--dm-surface-2) 100%) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-package-card--subscription.superadmin-package-card--free .superadmin-package-card__header {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, var(--dm-surface-2) 100%) !important;
}
html[data-theme="dark"] .superadmin-package-card--subscription.superadmin-package-card--popular .superadmin-package-card__header {
  background: linear-gradient(135deg, rgba(47, 111, 203, 0.2) 0%, var(--dm-surface-2) 100%) !important;
}
html[data-theme="dark"] .superadmin-package-card__title,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-package-card__badge--popular {
  background: var(--dm-accent-soft) !important;
  color: #93c5fd !important;
}
html[data-theme="dark"] .superadmin-package-card__badge--active,
html[data-theme="dark"] .superadmin-package-card__badge--discount,
html[data-theme="dark"] .superadmin-package-card__badge--trial {
  background: var(--dm-success-soft) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .superadmin-package-card__badge--inactive {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-package-card__badge--private,
html[data-theme="dark"] .superadmin-package-card__badge--onetime {
  background: var(--dm-warning-soft) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .superadmin-package-card__price,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__price {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-package-card__price-amount,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__price-amount {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .superadmin-package-card__price-period,
html[data-theme="dark"] .superadmin-package-card__price-compare-label,
html[data-theme="dark"] .superadmin-package-card__price-original {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-package-card__price-free,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__price-free {
  color: #86efac !important;
}
html[data-theme="dark"] .superadmin-package-card__description,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__description {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-package-card__limits li,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__limits li {
  background: var(--dm-surface-3) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-package-card__limits li i,
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__limits li i {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .superadmin-package-card__limit-label {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-package-card__limit-value {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-package-card__permissions {
  border-top-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-package-card__permissions-title {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-package-card__permissions-list li {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-package-card--subscription .superadmin-package-card__footer {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface-3) 100%) !important;
  border-top-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-packages-page__empty,
html[data-theme="dark"] .superadmin-pricing-page__empty {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-packages-page__empty i,
html[data-theme="dark"] .superadmin-pricing-page__empty i {
  color: var(--dm-text-muted) !important;
}

/* Subscription status cards */
html[data-theme="dark"] .superadmin-subscription-card {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface) 100%) !important;
}
html[data-theme="dark"] .superadmin-subscription-card--running {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12) 0%, var(--dm-surface) 100%) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}
html[data-theme="dark"] .superadmin-subscription-card--upcoming {
  background: linear-gradient(180deg, rgba(47, 111, 203, 0.12) 0%, var(--dm-surface) 100%) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-card--waiting {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, var(--dm-surface) 100%) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="dark"] .superadmin-subscription-card__head {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-card__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-subscription-card__badge--running {
  background: var(--dm-success-soft) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .superadmin-subscription-card__badge--upcoming {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
  color: #93c5fd !important;
}
html[data-theme="dark"] .superadmin-subscription-card__badge--waiting {
  background: var(--dm-warning-soft) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .superadmin-subscription-card__meta-row {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-card__meta-row dt {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-subscription-card__meta-row dd {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-subscription-card__remaining {
  background: var(--dm-success-soft) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .superadmin-subscription-card__status-text {
  color: #fcd34d !important;
}
html[data-theme="dark"] .active-subscription-modal__limits {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-page__no-active {
  background: var(--dm-danger-soft) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .superadmin-subscription-page__packages-toolbar {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface) 100%) !important;
  border-color: var(--dm-border) !important;
}

/* Repair dashboard & settings */
html[data-theme="dark"] .repair-dashboard-page__empty {
  background: var(--dm-info-soft) !important;
  border-color: rgba(47, 111, 203, 0.35) !important;
  color: #93b4ee !important;
}
html[data-theme="dark"] .repair-dashboard-page__status-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .repair-job-sheet-form-page__checklist-panel {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}

/* Pricing page */
html[data-theme="dark"] .superadmin-pricing-page__header-card {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface) 55%) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__hero {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__back {
  color: var(--dm-text-secondary) !important;
  background: var(--dm-surface-3) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__back:hover,
html[data-theme="dark"] .superadmin-pricing-page__back:focus {
  color: var(--dm-accent) !important;
  border-color: var(--dm-accent-border) !important;
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__eyebrow {
  color: var(--dm-accent) !important;
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__lead {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__toggle-wrap {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .superadmin-pricing-page__toggle-label {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__toggle-label.is-active {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__toggle-slider {
  background: var(--dm-surface-3) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__toggle-slider::before {
  background: var(--dm-text) !important;
}
html[data-theme="dark"] .superadmin-pricing-page__toggle-switch input:checked + .superadmin-pricing-page__toggle-slider {
  background: #2f6fcb !important;
}
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__top-bar,
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__hero,
html[data-theme="dark"] .auth-layout .superadmin-register-pay-page__top-bar,
html[data-theme="dark"] .auth-layout .superadmin-register-pay-page__hero {
  background: linear-gradient(135deg, #1a2d4a 0%, #1e3a5f 100%) !important;
}
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__back {
  color: #8ec0ff !important;
  background: transparent !important;
  border: none !important;
}
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__back:hover,
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__back:focus {
  color: #b3d4ff !important;
  background: transparent !important;
}
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__lead {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .auth-layout .superadmin-pricing-page--auth .superadmin-pricing-page__toggle-label.is-active {
  color: var(--dm-accent) !important;
}

/* Alerts, modals, receipts */
html[data-theme="dark"] .subscription-expired-alert {
  background: var(--dm-danger-soft) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
html[data-theme="dark"] .subscription-expired-alert__icon {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .subscription-expired-alert__message {
  color: #fca5a5 !important;
}
html[data-theme="dark"] .subscription-expired-alert__hint {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .subscription-view-modal__party {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .subscription-view-modal__party-title {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .subscription-view-modal__party-title i {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .subscription-view-modal__meta-row dt {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .subscription-view-modal__meta-row dd,
html[data-theme="dark"] .subscription-view-modal__price-final {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .subscription-view-modal__price-original {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .subscription-view-modal__price-discount {
  color: #86efac !important;
}
html[data-theme="dark"] .subscription-view-modal__coupon-badge {
  background: var(--dm-accent-soft) !important;
  color: #93c5fd !important;
}
html[data-theme="dark"] .subscription-view-modal .supplier-contact-form__section {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .subscription-receipt-modal__body {
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .subscription-receipt-modal__image,
html[data-theme="dark"] .superadmin-subscription-receipt-thumb {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

/* Pay page extras */
html[data-theme="dark"] .superadmin-subscription-pay-page__coupon-form .form-group label,
html[data-theme="dark"] .superadmin-subscription-pay-page__receipt-upload label {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__help {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__checkout .supplier-contact-form__section {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-subscription-pay-page__offline-details {
  color: var(--dm-text-secondary) !important;
}

/* Settings & forms */
html[data-theme="dark"] .superadmin-settings-page .supplier-contact-form__section {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-form-page .box-footer,
html[data-theme="dark"] .superadmin-form-page__footer {
  border-top-color: var(--dm-border) !important;
}
html[data-theme="dark"] .superadmin-package-form .help-block {
  color: var(--dm-text-muted) !important;
}

/* Auth layout (pricing / register-pay) */
html[data-theme="dark"] body.auth-layout {
  background: var(--dm-bg) !important;
  background-image: none !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .auth-layout__header {
  background: var(--dm-surface-2) !important;
  border-bottom-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .auth-layout__app-name,
html[data-theme="dark"] .auth-layout__tagline {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .auth-layout__logo-link:hover,
html[data-theme="dark"] .auth-layout__logo-link:focus {
  background: var(--dm-accent-soft) !important;
}

html[data-theme="dark"] .box-header,
html[data-theme="dark"] .box-title,
html[data-theme="dark"] .contact-show-tab-panel__title,
html[data-theme="dark"] .contact-show-profile__name,
html[data-theme="dark"] .contact-show-page__heading {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .box-body {
  background: var(--dm-surface) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .box-body:has(.table-responsive),
html[data-theme="dark"] .box-body:has(.dataTables_wrapper),
html[data-theme="dark"] .box-body:has(.table) {
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .contact-show-profile__stat--due {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .contact-show-profile__stat-label,
html[data-theme="dark"] .contact-show-profile__field-label {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .contact-show-profile__stat-value,
html[data-theme="dark"] .contact-show-profile__field-value {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .contact-show-unified .contact-show-tabs__nav {
  background: var(--dm-surface-2) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .contact-show-unified .contact-show-tabs__nav > li > a {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .contact-show-unified .contact-show-tabs__nav > li.active > a {
  color: var(--dm-accent) !important;
  background: var(--dm-accent-soft) !important;
}

/* ── Tables (match card / box color) ── */
html[data-theme="dark"] .table,
html[data-theme="dark"] .table-bordered,
html[data-theme="dark"] .contact-show-table,
html[data-theme="dark"] .dataTable {
  color: var(--dm-text);
  background-color: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] .table > tbody > tr > th,
html[data-theme="dark"] .table-bordered > thead > tr > th,
html[data-theme="dark"] .table-bordered > tbody > tr > th {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table-bordered > tbody > tr > td {
  background-color: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td,
html[data-theme="dark"] .contact-show-unified .contact-show-table > tbody > tr:nth-child(odd),
html[data-theme="dark"] .contact-show-unified .contact-show-table > tbody > tr:nth-child(odd) > td,
html[data-theme="dark"] table.dataTable.stripe tbody tr.odd,
html[data-theme="dark"] table.dataTable.stripe tbody tr.odd > td,
html[data-theme="dark"] table.dataTable.display tbody tr.odd,
html[data-theme="dark"] table.dataTable.display tbody tr.odd > td {
  background-color: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even),
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > td,
html[data-theme="dark"] .contact-show-unified .contact-show-table > tbody > tr:nth-child(even),
html[data-theme="dark"] .contact-show-unified .contact-show-table > tbody > tr:nth-child(even) > td,
html[data-theme="dark"] table.dataTable.stripe tbody tr.even,
html[data-theme="dark"] table.dataTable.stripe tbody tr.even > td,
html[data-theme="dark"] table.dataTable.display tbody tr.even,
html[data-theme="dark"] table.dataTable.display tbody tr.even > td {
  background-color: var(--dm-surface-3) !important;
}
html[data-theme="dark"] table.dataTable.display tbody tr.odd > .sorting_1,
html[data-theme="dark"] table.dataTable.display tbody tr.odd > .sorting_2,
html[data-theme="dark"] table.dataTable.display tbody tr.odd > .sorting_3,
html[data-theme="dark"] table.dataTable.order-column.stripe tbody tr.odd > .sorting_1,
html[data-theme="dark"] table.dataTable.order-column.stripe tbody tr.odd > .sorting_2,
html[data-theme="dark"] table.dataTable.order-column.stripe tbody tr.odd > .sorting_3 {
  background-color: var(--dm-surface-2) !important;
}
html[data-theme="dark"] table.dataTable.display tbody tr.even > .sorting_1,
html[data-theme="dark"] table.dataTable.display tbody tr.even > .sorting_2,
html[data-theme="dark"] table.dataTable.display tbody tr.even > .sorting_3,
html[data-theme="dark"] table.dataTable.order-column.stripe tbody tr.even > .sorting_1,
html[data-theme="dark"] table.dataTable.order-column.stripe tbody tr.even > .sorting_2,
html[data-theme="dark"] table.dataTable.order-column.stripe tbody tr.even > .sorting_3 {
  background-color: var(--dm-surface-3) !important;
}
html[data-theme="dark"] table.dataTable.hover tbody tr:hover,
html[data-theme="dark"] table.dataTable.hover tbody tr:hover > td,
html[data-theme="dark"] table.dataTable.display tbody tr:hover,
html[data-theme="dark"] table.dataTable.display tbody tr:hover > td,
html[data-theme="dark"] .table-hover > tbody > tr:hover,
html[data-theme="dark"] .table-hover > tbody > tr:hover > td {
  background-color: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .table-bordered {
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap {
  border: none !important;
  border-radius: 0;
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scroll {
  border: none !important;
  border-radius: 0;
  background: var(--dm-surface-2) !important;
  overflow: hidden;
}
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollHead {
  border-bottom: 1px solid var(--dm-border);
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollFoot {
  border-top: 1px solid var(--dm-border);
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .jquery-top-scrollbar {
  background: var(--dm-surface-2) !important;
  border: none !important;
  border-radius: 0;
}
html[data-theme="dark"] .jquery-top-scrollbar div {
  background: var(--dm-border-light) !important;
  border-radius: 4px;
}

/* Table & wrapper scrollbars */
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap,
html[data-theme="dark"] div.dataTables_wrapper,
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody {
  scrollbar-color: var(--dm-border-light) var(--dm-surface-2);
  scrollbar-width: thin;
}
html[data-theme="dark"] .table-responsive::-webkit-scrollbar,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap::-webkit-scrollbar,
html[data-theme="dark"] div.dataTables_wrapper::-webkit-scrollbar,
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html[data-theme="dark"] .table-responsive::-webkit-scrollbar-track,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap::-webkit-scrollbar-track,
html[data-theme="dark"] div.dataTables_wrapper::-webkit-scrollbar-track,
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
  background: var(--dm-surface-2);
  border-radius: 4px;
}
html[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap::-webkit-scrollbar-thumb,
html[data-theme="dark"] div.dataTables_wrapper::-webkit-scrollbar-thumb,
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: var(--dm-border-light);
  border-radius: 4px;
  border: 2px solid var(--dm-surface-2);
}
html[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] div.dataTables_wrapper::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
  background: var(--dm-text-muted);
}
html[data-theme="dark"] .table-responsive::-webkit-scrollbar-corner,
html[data-theme="dark"] .contact-show-tab-panel__table-wrap::-webkit-scrollbar-corner,
html[data-theme="dark"] div.dataTables_wrapper::-webkit-scrollbar-corner,
html[data-theme="dark"] div.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-corner {
  background: var(--dm-surface-2);
}

/* ── Forms ── */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input.form-control,
html[data-theme="dark"] textarea.form-control,
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] .input-group-addon {
  background-color: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .form-control:focus {
  border-color: var(--dm-accent) !important;
  box-shadow: 0 0 0 3px var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .form-control::placeholder {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .form-group > label,
html[data-theme="dark"] .user-form-page .form-group > label,
html[data-theme="dark"] .checkbox label {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .input-group .input-group-addon {
  background: var(--dm-surface-2) !important;
}

/* ── Select2 ── */
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple {
  background-color: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .select2-dropdown {
  background-color: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option {
  color: var(--dm-text);
}
html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .select2-search--dropdown .select2-search__field {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ── Filters panel (components/filters) ── */
html[data-theme="dark"] [id^="pf_"].tw-bg-white {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] .pf-btn:hover,
html[data-theme="dark"] .pf-btn:focus,
html[data-theme="dark"] .hover\:tw-bg-gray-50:hover {
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .pf-open .pf-btn {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .pf-btn .tw-text-gray-900 {
  color: var(--dm-text) !important;
}

/* ── DataTables ── */
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_processing,
html[data-theme="dark"] div.dataTables_processing,
html[data-theme="dark"] .dataTables_processing.panel,
html[data-theme="dark"] .dataTables_processing.panel-default {
  background: var(--dm-surface-2) !important;
  border: 1px solid var(--dm-border) !important;
  color: var(--dm-text) !important;
  box-shadow: var(--dm-shadow) !important;
  border-radius: 0.5rem;
}
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_info {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate ul.pagination > li > a,
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate .paginate_button {
  color: var(--dm-text-secondary) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate ul.pagination > li > a:hover,
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover:not(.disabled):not(.active) {
  color: var(--dm-accent) !important;
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_filter input,
html[data-theme="dark"] div.dataTables_wrapper div.dataTables_length select {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ── Modals & dropdowns ── */
html[data-theme="dark"] .modal-content {
  background-color: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: var(--dm-border) !important;
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .close {
  color: var(--dm-text) !important;
  opacity: 0.8;
}
html[data-theme="dark"] .dropdown-menu {
  background-color: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .dropdown-menu > li > a {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .dropdown-menu > li > a:hover {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-text) !important;
}

/* ── Dashboard ── */
html[data-theme="dark"] .dashboard-desktop {
  background: var(--dm-bg) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-stat-card,
html[data-theme="dark"] .dashboard-desktop .dashboard-panel,
html[data-theme="dark"] .dashboard-desktop .dashboard-widgets > .tw-grid > div[class*="tw-bg-white"],
html[data-theme="dark"] .dashboard-desktop .dashboard-widgets .tw-bg-white.tw-shadow-sm,
html[data-theme="dark"] .dashboard-desktop .dashboard-quick-row__card,
html[data-theme="dark"] .dashboard-desktop .dashboard-quick-row > .dashboard-alert-card,
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-title,
html[data-theme="dark"] .dashboard-desktop .dashboard-panel h3,
html[data-theme="dark"] .dashboard-desktop .dashboard-quick-row__card-title,
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__title,
html[data-theme="dark"] .dashboard-desktop .dashboard-stat-card p[class^="total_"],
html[data-theme="dark"] .dashboard-desktop .dashboard-stat-card p.net,
html[data-theme="dark"] .dashboard-desktop .dashboard-stat-card p.invoice_due,
html[data-theme="dark"] .dashboard-desktop .dashboard-stat-card p.purchase_due {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-stat-card span {
  color: var(--dm-text-muted) !important;
}

/* Dashboard — filter button & location */
html[data-theme="dark"] .dashboard-desktop .dashboard-filter-btn {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-filter-btn:hover,
html[data-theme="dark"] .dashboard-desktop .dashboard-filter-btn:focus {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-filter-btn svg {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .dashboard-desktop .dashboard-filter-location .select2-container--default .select2-selection--single {
  background-color: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
}

/* Dashboard — stock alert card */
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__badge {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__filter .select2-container--default .select2-selection--single {
  background-color: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__loading,
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__empty,
html[data-theme="dark"] .dashboard-desktop .dashboard-quick-row .dashboard-alert-card__empty {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-item {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-item__text {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-item__status--danger {
  color: #f87171 !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-item__status--low {
  color: #fb923c !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-item__status--warning {
  color: #fbbf24 !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__more {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border-light) !important;
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-alert-card__more:hover {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
  color: var(--dm-accent) !important;
}

/* Dashboard — quick summary mini cards */
html[data-theme="dark"] .dashboard-desktop .dashboard-mini-card {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-mini-card .tw-text-gray-600 {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-mini-card .tw-text-gray-900,
html[data-theme="dark"] .dashboard-desktop .dashboard-mini-card [id^="dash_summary_"] {
  color: var(--dm-text) !important;
}

/* Dashboard — quick action buttons */
html[data-theme="dark"] .dashboard-desktop .dashboard-action-btn--primary {
  background: linear-gradient(180deg, #4d8fe6 0%, #2f6fcb 100%) !important;
  border-color: #2f6fcb !important;
  color: #fff !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-action-btn--primary:hover {
  background: linear-gradient(180deg, #3f84df 0%, #255fb4 100%) !important;
  border-color: #255fb4 !important;
  color: #fff !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-action-btn--secondary {
  background: var(--dm-surface-3) !important;
  border: 1px solid var(--dm-border-light) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-action-btn--secondary:hover {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .dashboard-desktop .dashboard-action-btn svg {
  color: currentColor;
}

/* ── Nav tabs (legacy) ── */
html[data-theme="dark"] .nav-tabs-custom {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] .nav-tabs {
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .nav-tabs > li > a {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .nav-tabs > li.active > a {
  background: var(--dm-surface) !important;
  color: var(--dm-accent) !important;
  border-color: var(--dm-border) var(--dm-border) transparent !important;
}

/* ── Buttons (secondary/cancel) ── */
html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .app-btn-cancel,
html[data-theme="dark"] .app-btn-table--secondary,
html[data-theme="dark"] .tw-dw-btn-neutral {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .btn-default:hover,
html[data-theme="dark"] .app-btn-cancel:hover,
html[data-theme="dark"] .app-btn-table--secondary:hover,
html[data-theme="dark"] .app-btn-table--secondary:focus {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .app-btn-table--danger {
  color: #fca5a5 !important;
  background: var(--dm-danger-soft) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
html[data-theme="dark"] .app-btn-table--danger:hover,
html[data-theme="dark"] .app-btn-table--danger:focus {
  color: #fff !important;
  background: rgba(220, 38, 38, 0.45) !important;
  border-color: rgba(239, 68, 68, 0.55) !important;
}
html[data-theme="dark"] .contact-show-segment .btn-default {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .contact-show-segment .btn-default.active {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
  border-color: var(--dm-accent-border) !important;
}

/* ── Alerts & labels ── */
html[data-theme="dark"] .alert {
  border-color: var(--dm-border);
}
html[data-theme="dark"] .alert-info {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .alert-warning {
  background: var(--dm-warning-soft) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .alert-danger {
  background: var(--dm-danger-soft) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .alert-success {
  background: var(--dm-success-soft) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .label-default,
html[data-theme="dark"] .label.bg-gray {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .label.bg-green,
html[data-theme="dark"] .label.bg-light-green {
  background: var(--dm-success-soft) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .label.bg-red {
  background: var(--dm-danger-soft) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .label.bg-aqua,
html[data-theme="dark"] .label.bg-yellow,
html[data-theme="dark"] .label.bg-orange {
  background: var(--dm-warning-soft) !important;
  color: #fcd34d !important;
}

/* ── DateRangePicker ── */
html[data-theme="dark"] .daterangepicker {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .daterangepicker .calendar-table {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .daterangepicker td.available:hover,
html[data-theme="dark"] .daterangepicker .ranges li:hover {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .daterangepicker .ranges li.active {
  background: var(--dm-accent) !important;
  color: #fff !important;
}

/* ── Cash register open page ── */
html[data-theme="dark"] .cash-register-open-page__card {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .cash-register-open-page__header {
  background: var(--dm-surface) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .cash-register-open-page__icon {
  color: var(--dm-accent) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .cash-register-open-page__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .cash-register-open-page__lead,
html[data-theme="dark"] .cash-register-open-page__empty {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .cash-register-open-page__label {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .cash-register-open-page__input {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .cash-register-open-page__input:focus {
  border-color: var(--dm-accent) !important;
  box-shadow: 0 0 0 3px var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .cash-register-open-page__empty p {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .open-register-modal__content {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .open-register-modal__header,
html[data-theme="dark"] .view_modal .open-register-modal__content .modal-header {
  background: var(--dm-surface) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .open-register-modal__title,
html[data-theme="dark"] .open-register-modal__summary-value {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .open-register-modal__title i {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .open-register-modal__subtitle,
html[data-theme="dark"] .open-register-modal__summary-label {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .open-register-modal__summary-item {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .open-register-modal__summary-item--accent {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .open-register-modal__section {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .open-register-modal__field label {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .open-register-modal__input {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .open-register-modal__input:focus {
  border-color: var(--dm-accent) !important;
  box-shadow: 0 0 0 3px var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .open-register-modal__select + .select2-container--default .select2-selection--single {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .open-register-modal__select + .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .open_register_modal.modal {
  background: rgba(0, 0, 0, 0.55);
}

/* ── User show page ── */
html[data-theme="dark"] .user-show-page__page-header-card,
html[data-theme="dark"] .user-show-page__main-card {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  box-shadow: var(--dm-shadow) !important;
}
html[data-theme="dark"] .user-show-page__page-title,
html[data-theme="dark"] .user-show-page__name {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .user-show-page__page-subtitle,
html[data-theme="dark"] .user-show-page__eyebrow,
html[data-theme="dark"] .user-show-page__switcher-label,
html[data-theme="dark"] .user-show-page__stat-label {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .user-show-page__back {
  color: var(--dm-text-secondary) !important;
  background: var(--dm-surface-3) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__back:hover,
html[data-theme="dark"] .user-show-page__back:focus {
  color: var(--dm-accent) !important;
  border-color: var(--dm-accent-border) !important;
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .user-show-page__switcher-box {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__switcher-icon {
  color: var(--dm-accent) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__switcher-field .select2-container--default .select2-selection--single {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__switcher-field .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .user-show-page__switcher-field .select2-container--default.select2-container--focus .select2-selection--single,
html[data-theme="dark"] .user-show-page__switcher-field .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--dm-accent) !important;
  box-shadow: 0 0 0 2px var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .user-show-page__hero {
  background: var(--dm-surface) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__avatar {
  border-color: var(--dm-surface-2) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .user-show-page__badge--role {
  color: var(--dm-accent) !important;
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .user-show-page__badge--active {
  color: #4ade80 !important;
  background: var(--dm-success-soft) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}
html[data-theme="dark"] .user-show-page__badge--inactive {
  color: #f87171 !important;
  background: var(--dm-danger-soft) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
html[data-theme="dark"] .user-show-page__stats {
  background: var(--dm-surface-2) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__stat {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__stat--highlight {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .user-show-page__stat-icon {
  color: var(--dm-accent) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__stat--highlight .user-show-page__stat-icon {
  color: var(--dm-accent) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .user-show-page__stat-value {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .user-show-page__tabs {
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .user-show-page__panel,
html[data-theme="dark"] .user-show-page__panel--tab {
  background: var(--dm-surface-2) !important;
}
html[data-theme="dark"] .user-show-page__info-form .supplier-contact-form__section {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page__info-form .supplier-contact-form__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .user-show-page__activity-meta {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .user-show-page__activity-meta strong {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .user-show-page__inline-badge--active {
  color: #4ade80 !important;
  background: var(--dm-success-soft) !important;
}
html[data-theme="dark"] .user-show-page__inline-badge--inactive {
  color: #f87171 !important;
  background: var(--dm-danger-soft) !important;
}
html[data-theme="dark"] .user-show-page__module-partials {
  border-top-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page .document_note_body .box {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page .contact-show-profile__badge {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .user-show-page .contact-show-tab-panel__empty {
  color: var(--dm-text-muted) !important;
}

/* ── User / role forms ── */
html[data-theme="dark"] .user-form-page .box-title,
html[data-theme="dark"] .user-form-page h4,
html[data-theme="dark"] .role-form-page .check_group {
  color: var(--dm-text) !important;
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .role-form-page .check_group h4 {
  color: var(--dm-text) !important;
}

/* ── POS (when not full-screen lock) ── */
html[data-theme="dark"] .pos-unified-page .box,
html[data-theme="dark"] .sell-form-page .box {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

/* ── Today's profit modal ── */
html[data-theme="dark"] #todays_profit_modal .modal-body {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-card {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-card--totals {
  background: var(--dm-surface-3) !important;
  border-color: var(--dm-border-light) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-card__title {
  color: var(--dm-text) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-table > tbody > tr > th,
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-table > tbody > tr > td {
  color: var(--dm-text-secondary) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-table__amount {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-table__highlight > th,
html[data-theme="dark"] #todays_profit_modal .profit-loss-report-table__highlight > td {
  background: var(--dm-surface-3) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__block {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__block--positive {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__block--negative {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__block--tax,
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__block--overall {
  background: var(--dm-surface-3) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__title,
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__label {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__value {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] #todays_profit_modal .profit-loss-summary__hint {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] #todays_profit_modal .text-danger {
  color: #f87171 !important;
}
html[data-theme="dark"] #todays_profit_modal .text-success {
  color: #4ade80 !important;
}

/* ── Notifications dropdown panel ── */
html[data-theme="dark"] .pos-floating-panel {
  background: var(--dm-surface) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
html[data-theme="dark"] .pos-floating-panel::before {
  border-color: transparent transparent var(--dm-surface) transparent !important;
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.2));
}
html[data-theme="dark"] .pos-floating-panel--above::before {
  border-color: var(--dm-surface) transparent transparent transparent !important;
}
html[data-theme="dark"] .app-notifications-panel__head {
  background: linear-gradient(180deg, var(--dm-surface-2) 0%, var(--dm-surface) 100%) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .app-notifications-panel__title {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .app-notifications-panel__title i {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .app-notifications-panel__loading-spinner {
  border-color: var(--dm-border) !important;
  border-top-color: var(--dm-accent) !important;
}
html[data-theme="dark"] .app-notifications-panel__list {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] .app-notifications-menu__badge,
html[data-theme="dark"] .app-notifications-menu .notifications_count {
  background-color: #dc2626 !important;
  color: #fff !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li > a {
  color: inherit !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li:hover,
html[data-theme="dark"] .app-notifications-panel__list .notification-li.notification-li:hover {
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li.unread {
  background: rgba(91, 156, 245, 0.08) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li.unread > a {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notif-info {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .time {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .no-notification {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li.tw-text-gray-600 {
  color: var(--dm-text-secondary) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li:hover.tw-text-gray-900,
html[data-theme="dark"] .app-notifications-panel__list .notification-li.hover\:tw-text-gray-900:hover {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .app-notifications-panel__list .notification-li:hover.tw-bg-gray-100,
html[data-theme="dark"] .app-notifications-panel__list .notification-li.hover\:tw-bg-gray-100:hover {
  background: var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .app-notifications-panel__footer {
  background: var(--dm-surface-2) !important;
  border-top-color: var(--dm-border) !important;
}
html[data-theme="dark"] .app-notifications-panel__load-more {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .app-notifications-panel__load-more:hover,
html[data-theme="dark"] .app-notifications-panel__load-more:focus {
  color: var(--dm-accent-hover) !important;
}

/* ── Calculator panel ── */
html[data-theme="dark"] .pos-calculator-panel .pos-floating-panel__inner,
html[data-theme="dark"] .pos-calculator-panel .pos-calculator {
  background: var(--dm-surface) !important;
  color: var(--dm-text);
}
html[data-theme="dark"] .pos-calculator-panel__header,
html[data-theme="dark"] .pos-floating-panel__header.pos-calculator-panel__header {
  border-bottom-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .pos-calculator-panel__title-wrap {
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .pos-calculator-panel__header i.fa-calculator {
  color: #4ade80 !important;
}
html[data-theme="dark"] .pos-calculator-panel__hist-btn {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .pos-calculator-panel__hist-btn:hover,
html[data-theme="dark"] .pos-calculator-panel__hist-btn:focus {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .pos-calculator-panel .pos-calculator__display,
html[data-theme="dark"] .pos-calculator-panel #calc-display,
html[data-theme="dark"] .pos-calculator-panel .pos-floating-panel__input {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .pos-calculator-panel .pos-floating-panel__input:focus {
  border-color: var(--dm-accent) !important;
  box-shadow: 0 0 0 3px var(--dm-accent-soft) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn {
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-num {
  background: var(--dm-surface-2) !important;
  color: var(--dm-text) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-num:hover {
  background: var(--dm-surface-3) !important;
  border-color: var(--dm-border-light) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-op {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-op:hover {
  background: rgba(91, 156, 245, 0.22) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-ac {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-ac:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-ce {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-ce:hover {
  background: rgba(245, 158, 11, 0.2) !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-eq {
  background: linear-gradient(180deg, #4d8fe6 0%, #2f6fcb 100%) !important;
  color: #fff !important;
  border-color: #2f6fcb !important;
}
html[data-theme="dark"] .pos-calculator-panel #calculator .calc-btn-eq:hover {
  background: linear-gradient(180deg, #3f84df 0%, #255fb4 100%) !important;
}

/* Calculator history popup */
html[data-theme="dark"] #calc-hist-popup {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
}
html[data-theme="dark"] .calc-hist-head {
  color: var(--dm-text-muted) !important;
  border-bottom-color: var(--dm-border) !important;
}
html[data-theme="dark"] .calc-hist-entry {
  background: var(--dm-surface-2) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .calc-hist-entry:hover {
  background: var(--dm-accent-soft) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .calc-hist-expr {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] .calc-hist-result {
  color: var(--dm-accent) !important;
}
html[data-theme="dark"] .calc-hist-empty {
  color: var(--dm-text-muted) !important;
}
html[data-theme="dark"] #calc-hist-clear {
  background: var(--dm-surface-2) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
}
html[data-theme="dark"] #calc-hist-clear:hover {
  background: rgba(239, 68, 68, 0.12) !important;
}

/* Calculator popover fallback */
html[data-theme="dark"] .popover:has(#calculator) .popover-content {
  background: var(--dm-surface) !important;
}
html[data-theme="dark"] .popover:has(#calculator).bottom > .arrow:after {
  border-bottom-color: var(--dm-surface) !important;
}
html[data-theme="dark"] .popover:has(#calculator) #calculator .calc-btn-num {
  background: var(--dm-surface-2) !important;
  color: var(--dm-text) !important;
  border-color: var(--dm-border) !important;
}
html[data-theme="dark"] .popover:has(#calculator) #calculator .calc-btn-op {
  background: var(--dm-accent-soft) !important;
  color: var(--dm-accent) !important;
  border-color: var(--dm-accent-border) !important;
}
html[data-theme="dark"] .popover:has(#calculator) #calculator .calc-btn-ac {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
html[data-theme="dark"] .popover:has(#calculator) #calculator .calc-btn-ce {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="dark"] .popover:has(#calculator) #calculator .calc-btn-eq {
  background: linear-gradient(180deg, #4d8fe6 0%, #2f6fcb 100%) !important;
  color: #fff !important;
  border-color: #2f6fcb !important;
}
html[data-theme="dark"] .popover:has(#calculator) #calc-display,
html[data-theme="dark"] .popover:has(#calculator) .pos-calculator__display {
  background: var(--dm-input-bg) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

/* ── Theme toggle — hidden (no layout space) ── */
#theme_mode_toggle {
  display: none !important;
}

/* ── Theme toggle active state in header ── */
html[data-theme="dark"] #theme_mode_toggle.is-dark-active {
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.12) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
}

/* ── Smooth transition (respect reduced motion) ── */
@media (prefers-reduced-motion: no-preference) {
  html[data-theme="dark"] body,
  html[data-theme="dark"] .side-bar,
  html[data-theme="dark"] .box,
  html[data-theme="dark"] .theme-header-bg {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }
}
