/**
 * FacturandoRD - Dark Mode Global Engine 2026
 * Homologado con la arquitectura y paleta de TailAdmin (Tailwind CSS Admin Dashboard)
 *
 * Paleta de referencia TailAdmin:
 * - Canvas / Base: #101828 (dark:bg-gray-900)
 * - Tarjetas / Cards: #1a2231 (dark:bg-gray-dark / #ffffff08)
 * - Superficies elevadas: #162032 (dark:bg-gray-800)
 * - Bordes estructurales unificados: #1d2939 (dark:border-gray-800)
 * - Bordes de inputs / acento: #344054 (dark:border-gray-700)
 * - Texto principal: rgba(255, 255, 255, 0.90) (dark:text-white/90)
 * - Texto secundario / muted: #98a2b3 (dark:text-gray-400)
 * - Acento de marca: #3b82f6 / #465fff (dark:text-brand-500)
 */

html[data-theme="dark"],
html.dark,
body.dark {
  --frd-dm-bg: #101828;
  --frd-dm-surface: #1a2231;
  --frd-dm-surface-elevated: #162032;
  --frd-dm-border: #1d2939;
  --frd-dm-border-input: #344054;
  --frd-dm-text: rgba(255, 255, 255, 0.90);
  --frd-dm-text-muted: #98a2b3;
  --frd-dm-text-dim: #667085;
  --frd-dm-input-bg: #101828;

  color-scheme: dark;
}

/* ==========================================================================
   1. GLOBAL CANVAS & WRAPPERS (TAILADMIN STYLE)
   ========================================================================== */
html[data-theme="dark"],
html[data-theme="dark"] body,
body.dark {
  background-color: var(--frd-dm-bg) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tw-bg-gray-100,
html[data-theme="dark"] .tw-bg-gray-50,
body.dark .tw-bg-gray-100,
body.dark .tw-bg-gray-50,
html[data-theme="dark"] main,
body.dark main,
html[data-theme="dark"] #scrollable-container,
body.dark #scrollable-container,
html[data-theme="dark"] .content-wrapper,
body.dark .content-wrapper {
  background-color: var(--frd-dm-bg) !important;
  color: var(--frd-dm-text) !important;
}

/* Reemplazar fondos blancos de Tailwind por superficie de tarjeta TailAdmin */
html[data-theme="dark"] .tw-bg-white,
body.dark .tw-bg-white,
html[data-theme="dark"] [class*="tw-bg-white"],
body.dark [class*="tw-bg-white"] {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
}

/* Anillos sutiles */
html[data-theme="dark"] .tw-ring-gray-200,
html[data-theme="dark"] .tw-ring-gray-100,
body.dark .tw-ring-gray-200,
body.dark .tw-ring-gray-100 {
  --tw-ring-color: var(--frd-dm-border) !important;
}

/* ==========================================================================
   2. TIPOGRAFÍA TAILADMIN (INVERSIÓN ELEGANTE)
   ========================================================================== */
html[data-theme="dark"] .tw-text-gray-900,
html[data-theme="dark"] .tw-text-gray-800,
html[data-theme="dark"] .tw-text-gray-700,
html[data-theme="dark"] .tw-text-black,
html[data-theme="dark"] .tw-text-slate-900,
html[data-theme="dark"] .tw-text-slate-800,
html[data-theme="dark"] .tw-text-slate-700,
body.dark .tw-text-gray-900,
body.dark .tw-text-gray-800,
body.dark .tw-text-gray-700,
body.dark .tw-text-black,
body.dark .tw-text-slate-900,
body.dark .tw-text-slate-800,
body.dark .tw-text-slate-700 {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tw-text-gray-600,
html[data-theme="dark"] .tw-text-gray-500,
html[data-theme="dark"] .tw-text-slate-600,
html[data-theme="dark"] .tw-text-slate-500,
body.dark .tw-text-gray-600,
body.dark .tw-text-gray-500,
body.dark .tw-text-slate-600,
body.dark .tw-text-slate-500 {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .tw-text-gray-400,
html[data-theme="dark"] .tw-text-slate-400,
body.dark .tw-text-gray-400,
body.dark .tw-text-slate-400 {
  color: #98a2b3 !important;
}

/* Fondos Slate de Tailwind */
html[data-theme="dark"] .tw-bg-slate-50,
html[data-theme="dark"] .tw-bg-slate-100,
body.dark .tw-bg-slate-50,
body.dark .tw-bg-slate-100 {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tw-border-slate-100,
html[data-theme="dark"] .tw-border-slate-200,
body.dark .tw-border-slate-100,
body.dark .tw-border-slate-200 {
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .tw-bg-sky-100,
body.dark .tw-bg-sky-100,
html[data-theme="dark"] .tw-bg-blue-100,
body.dark .tw-bg-blue-100 {
  background-color: rgba(70, 95, 255, 0.15) !important;
  color: #7592ff !important;
}

/* ==========================================================================
   3. HEADER & SIDEBAR NAVIGATION (TAILADMIN #101828)
   ========================================================================== */
html[data-theme="dark"] .frd-app-header,
body.dark .frd-app-header {
  background: var(--frd-dm-bg) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 4px 20px -2px rgba(16, 24, 40, 0.5) !important;
}

html[data-theme="dark"] .side-bar,
body.dark .side-bar {
  --frd-sidebar-bg: var(--frd-dm-bg) !important;
  --frd-sidebar-surface-hover: var(--frd-dm-surface) !important;
  --frd-sidebar-text: #e4e7ec !important;
  --frd-sidebar-muted: var(--frd-dm-text-muted) !important;
  --frd-sidebar-border: var(--frd-dm-border) !important;
  background-color: var(--frd-dm-bg) !important;
  border-right: 1px solid var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sidebar-brand,
body.dark .frd-sidebar-brand {
  background-color: var(--frd-dm-bg) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-sidebar-item,
body.dark .frd-sidebar-item {
  color: #d0d5dd !important;
}

html[data-theme="dark"] .frd-sidebar-item:hover,
html[data-theme="dark"] .frd-sidebar-item:focus,
body.dark .frd-sidebar-item:hover,
body.dark .frd-sidebar-item:focus {
  background: var(--frd-dm-surface) !important;
  color: #ffffff !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sidebar-item.is-active,
html[data-theme="dark"] .frd-sidebar-item--group.is-open,
body.dark .frd-sidebar-item.is-active,
body.dark .frd-sidebar-item--group.is-open {
  background: rgba(147, 51, 234, 0.22) !important;
  color: #ffffff !important;
  border-color: rgba(147, 51, 234, 0.45) !important;
}

/* Iconos de la barra lateral en Dark Mode - Alto Contraste */
html[data-theme="dark"] .frd-sidebar-item__icon,
body.dark .frd-sidebar-item__icon {
  color: #98a2b3 !important;
}

html[data-theme="dark"] .frd-sidebar-item:hover .frd-sidebar-item__icon,
html[data-theme="dark"] .frd-sidebar-item:focus .frd-sidebar-item__icon,
body.dark .frd-sidebar-item:hover .frd-sidebar-item__icon,
body.dark .frd-sidebar-item:focus .frd-sidebar-item__icon {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sidebar-item.is-active .frd-sidebar-item__icon,
html[data-theme="dark"] .frd-sidebar-item--group.is-open .frd-sidebar-item__icon,
body.dark .frd-sidebar-item.is-active .frd-sidebar-item__icon,
body.dark .frd-sidebar-item--group.is-open .frd-sidebar-item__icon {
  color: #ffffff !important;
}

/* Cuando el sidebar está colapsado (solo iconos): cápsula luminosa de alto contraste */
@media (min-width: 1024px) {
  body.sidebar-collapse.dark .frd-sidebar-item.is-active,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-item.is-active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(147, 51, 234, 0.45)) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.4) !important;
  }

  body.sidebar-collapse.dark .frd-sidebar-item.is-active .frd-sidebar-item__icon,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-item.is-active .frd-sidebar-item__icon {
    color: #ffffff !important;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  }
}

html[data-theme="dark"] .frd-sidebar-footer,
body.dark .frd-sidebar-footer {
  background: var(--frd-dm-bg) !important;
  border-top: 1px solid var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sidebar-profile__identity:hover,
body.dark .frd-sidebar-profile__identity:hover {
  background: var(--frd-dm-surface) !important;
}

html[data-theme="dark"] .frd-sidebar-profile__dropdown,
body.dark .frd-sidebar-profile__dropdown {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 16px 36px -4px rgba(16, 24, 40, 0.6) !important;
}

html[data-theme="dark"] .frd-sidebar-profile__dropdown a,
body.dark .frd-sidebar-profile__dropdown a {
  color: #d0d5dd !important;
}

html[data-theme="dark"] .frd-sidebar-profile__dropdown a:hover,
body.dark .frd-sidebar-profile__dropdown a:hover {
  background: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

/* Sidebar Normal & Flyout Submenus in Collapse mode */
html[data-theme="dark"] .frd-sidebar-submenu,
body.dark .frd-sidebar-submenu {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sidebar-subitem,
body.dark .frd-sidebar-subitem {
  color: #98a2b3 !important;
}

html[data-theme="dark"] .frd-sidebar-subitem:hover,
html[data-theme="dark"] .frd-sidebar-subitem:focus,
body.dark .frd-sidebar-subitem:hover,
body.dark .frd-sidebar-subitem:focus {
  background: rgba(70, 95, 255, 0.15) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sidebar-subitem.is-active,
body.dark .frd-sidebar-subitem.is-active {
  background: rgba(70, 95, 255, 0.22) !important;
  color: #7592ff !important;
  font-weight: 600 !important;
}

/* Sidebar Flyout Submenus in Collapse mode: elevar z-index y posición */
@media (min-width: 1024px) {
  body.sidebar-collapse.dark .side-bar,
  html[data-theme="dark"] body.sidebar-collapse .side-bar {
    z-index: 1050 !important;
    overflow: hidden !important;
  }

  body.sidebar-collapse.dark .side-bar:hover,
  html[data-theme="dark"] body.sidebar-collapse .side-bar:hover,
  body.sidebar-collapse.dark .side-bar.is-hover-expanded,
  html[data-theme="dark"] body.sidebar-collapse .side-bar.is-hover-expanded,
  body.sidebar-collapse.frd-sidebar-hover-open.dark .side-bar,
  html[data-theme="dark"] body.sidebar-collapse.frd-sidebar-hover-open .side-bar {
    background: var(--frd-dm-surface) !important;
    border-right: 1px solid var(--frd-dm-border) !important;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(0, 0, 0, 0.45) !important;
  }

  body.sidebar-collapse.dark .frd-sidebar-nav,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-nav {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.sidebar-collapse.dark .frd-sidebar-group,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-group {
    position: relative !important;
    z-index: 1055 !important;
  }

  body.sidebar-collapse.dark .frd-sidebar-group:hover,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-group:hover {
    z-index: 1100 !important;
  }

  body.sidebar-collapse.dark .frd-sidebar-submenu.is-flyout-open,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-submenu.is-flyout-open {
    background: var(--frd-dm-surface-elevated) !important;
    border: 1px solid var(--frd-dm-border) !important;
    box-shadow: 0 20px 40px -4px rgba(16, 24, 40, 0.85) !important;
    z-index: 4000 !important;
  }

  body.sidebar-collapse.dark .frd-sidebar-submenu.is-flyout-open::before,
  html[data-theme="dark"] body.sidebar-collapse .frd-sidebar-submenu.is-flyout-open::before {
    display: none !important;
  }
}

/* ==========================================================================
   4. HOME / DASHBOARD & HERO BANNER
   ========================================================================== */
html[data-theme="dark"] .frd-dashboard,
body.dark .frd-dashboard {
  --frd-dash-surface: var(--frd-dm-surface);
  --frd-dash-surface-muted: var(--frd-dm-surface-elevated);
  --frd-dash-border: var(--frd-dm-border);
  --frd-dash-text: var(--frd-dm-text);
  --frd-dash-text-muted: var(--frd-dm-text-muted);
  --frd-dash-body-bg: var(--frd-dm-bg);
}

html[data-theme="dark"] .frd-dashboard-hero,
body.dark .frd-dashboard-hero {
  background: linear-gradient(135deg, #0c111d 0%, #151e33 60%, #101828 100%) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-dashboard-hero__title,
body.dark .frd-dashboard-hero__title {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-dashboard-hero__date-btn,
body.dark .frd-dashboard-hero__date-btn {
  background: rgba(16, 24, 40, 0.75) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-dashboard-kpi-card,
body.dark .frd-dashboard-kpi-card {
  background: #1a2231 !important;
  border: 1px solid #344054 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .frd-dashboard-kpi-card:hover,
body.dark .frd-dashboard-kpi-card:hover {
  background: #222c40 !important;
  border-color: #465fff !important;
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .frd-dashboard-kpi-card::before,
body.dark .frd-dashboard-kpi-card::before {
  display: none !important;
}

html[data-theme="dark"] .frd-dashboard-kpi-card__label,
html[data-theme="dark"] .frd-dashboard-kpi-card__label-text,
body.dark .frd-dashboard-kpi-card__label,
body.dark .frd-dashboard-kpi-card__label-text {
  color: #98a2b3 !important;
}

html[data-theme="dark"] .frd-dashboard-kpi-card__value,
body.dark .frd-dashboard-kpi-card__value {
  color: #ffffff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .frd-dashboard-chart,
body.dark .frd-dashboard-chart {
  background: transparent !important;
  border-color: var(--frd-dm-border) !important;
}

/* ==========================================================================
   5. CARDS, BOXES, MODALES Y PANELES (TAILADMIN #1a2231)
   ========================================================================== */
html[data-theme="dark"] .box,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .frd-dashboard-panel,
html[data-theme="dark"] .modal-content,
body.dark .box,
body.dark .panel,
body.dark .card,
body.dark .frd-dashboard-panel,
body.dark .modal-content {
  background-color: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 24, 40, 0.3) !important;
}

html[data-theme="dark"] .box-header,
html[data-theme="dark"] .panel-heading,
html[data-theme="dark"] .modal-header,
body.dark .box-header,
body.dark .panel-heading,
body.dark .modal-header {
  background-color: var(--frd-dm-surface) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .box-title,
html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .modal-title,
body.dark .box-title,
body.dark .panel-title,
body.dark .modal-title {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .box-body,
html[data-theme="dark"] .panel-body,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .box-footer,
html[data-theme="dark"] .panel-footer,
html[data-theme="dark"] .modal-footer,
body.dark .box-body,
body.dark .panel-body,
body.dark .modal-body,
body.dark .box-footer,
body.dark .panel-footer,
body.dark .modal-footer {
  background-color: var(--frd-dm-surface) !important;
  border-top-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

/* ==========================================================================
   6. DATATABLES & TABLAS (DIVIDERS TAILADMIN #1d2939)
   ========================================================================== */
html[data-theme="dark"] .dataTables_wrapper,
body.dark .dataTables_wrapper {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] div.dataTables_wrapper .frd-dt-toolbar,
body.dark div.dataTables_wrapper .frd-dt-toolbar,
html[data-theme="dark"] div.dataTables_wrapper .frd-dt-footer,
body.dark div.dataTables_wrapper .frd-dt-footer {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  box-shadow: none !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] div.dataTables_wrapper .frd-dt-table-scroll,
body.dark div.dataTables_wrapper .frd-dt-table-scroll {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

/* Botones de exportación / herramientas DataTables */
html[data-theme="dark"] div.dataTables_wrapper .dt-buttons .dt-button,
html[data-theme="dark"] div.dataTables_wrapper .dt-buttons .btn,
html[data-theme="dark"] div.dataTables_wrapper .dt-buttons a.tw-dw-btn-outline,
body.dark div.dataTables_wrapper .dt-buttons .dt-button,
body.dark div.dataTables_wrapper .dt-buttons .btn,
body.dark div.dataTables_wrapper .dt-buttons a.tw-dw-btn-outline {
  background: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] div.dataTables_wrapper .dt-buttons .dt-button:hover,
html[data-theme="dark"] div.dataTables_wrapper .dt-buttons .btn:hover,
html[data-theme="dark"] div.dataTables_wrapper .dt-buttons a.tw-dw-btn-outline:hover,
body.dark div.dataTables_wrapper .dt-buttons .dt-button:hover,
body.dark div.dataTables_wrapper .dt-buttons .btn:hover,
body.dark div.dataTables_wrapper .dt-buttons a.tw-dw-btn-outline:hover {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: #465fff !important;
  color: #ffffff !important;
}

/* Botón Kebab (...) y Menú de Acciones en Filas DataTables */
html[data-theme="dark"] .frd-dt-kebab-btn,
body.dark .frd-dt-kebab-btn {
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-dt-kebab-btn:hover,
html[data-theme="dark"] .frd-dt-kebab-btn:focus-visible,
html[data-theme="dark"] .open > .frd-dt-kebab-btn,
html[data-theme="dark"] .frd-dt-kebab-btn[aria-expanded="true"],
body.dark .frd-dt-kebab-btn:hover,
body.dark .frd-dt-kebab-btn:focus-visible,
body.dark .open > .frd-dt-kebab-btn,
body.dark .frd-dt-kebab-btn[aria-expanded="true"] {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* Dropdowns flotantes generales (incluyendo el menú Acciones de tablas) */
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] ul.dt-button-collection.dropdown-menu,
body.dark .dropdown-menu,
body.dark ul.dt-button-collection.dropdown-menu {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 16px 36px -4px rgba(16, 24, 40, 0.7) !important;
  color: var(--frd-dm-text) !important;
  z-index: 1060 !important;
}

html[data-theme="dark"] .dropdown-menu > li > a,
body.dark .dropdown-menu > li > a {
  color: #d0d5dd !important;
  transition: background 0.15s ease, color 0.15s ease;
}

html[data-theme="dark"] .dropdown-menu > li > a:hover,
html[data-theme="dark"] .dropdown-menu > li > a:focus,
body.dark .dropdown-menu > li > a:hover,
body.dark .dropdown-menu > li > a:focus {
  background-color: rgba(70, 95, 255, 0.18) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-menu .divider,
body.dark .dropdown-menu .divider {
  background-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .dropdown-menu svg.frd-action-icon,
body.dark .dropdown-menu svg.frd-action-icon {
  color: inherit !important;
}

html[data-theme="dark"] table.dataTable,
html[data-theme="dark"] .table,
body.dark table.dataTable,
body.dark .table {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] table.dataTable thead th,
html[data-theme="dark"] table.dataTable thead td,
html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] .table > thead > tr > td,
body.dark table.dataTable thead th,
body.dark table.dataTable thead td,
body.dark .table > thead > tr > th,
body.dark .table > thead > tr > td {
  background-color: var(--frd-dm-bg) !important;
  color: var(--frd-dm-text) !important;
  border-color: var(--frd-dm-border) !important;
  border-bottom: 2px solid var(--frd-dm-border) !important;
}

/* Forzar anulación sobre las reglas table-striped de app.css y vendor.css */
html[data-theme="dark"] .dataTables_wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd),
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"] .table-striped > tbody > tr:nth-of-type(odd) > th,
body.dark .dataTables_wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd),
body.dark .table-striped > tbody > tr:nth-of-type(odd),
body.dark .table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark .table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even),
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"] .table-striped > tbody > tr:nth-of-type(even) > th,
body.dark .dataTables_wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even),
body.dark .table-striped > tbody > tr:nth-of-type(even),
body.dark .table-striped > tbody > tr:nth-of-type(even) > td,
body.dark .table-striped > tbody > tr:nth-of-type(even) > th {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: var(--frd-dm-text) !important;
}

/* Hover de filas */
html[data-theme="dark"] .dataTables_wrapper table.dataTable tbody > tr:hover,
html[data-theme="dark"] .dataTables_wrapper table.dataTable tbody > tr:hover > td,
html[data-theme="dark"] .table-hover > tbody > tr:hover,
html[data-theme="dark"] .table-hover > tbody > tr:hover > td,
body.dark .dataTables_wrapper table.dataTable tbody > tr:hover,
body.dark .dataTables_wrapper table.dataTable tbody > tr:hover > td,
body.dark .table-hover > tbody > tr:hover,
body.dark .table-hover > tbody > tr:hover > td {
  background-color: rgba(70, 95, 255, 0.16) !important;
  color: #ffffff !important;
}

/* Celdas generales y bordes */
html[data-theme="dark"] table.dataTable tbody td,
html[data-theme="dark"] table.dataTable tbody th,
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table > tbody > tr > th,
body.dark table.dataTable tbody td,
body.dark table.dataTable tbody th,
body.dark .table > tbody > tr > td,
body.dark .table > tbody > tr > th {
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

/* Paginadores & Filtros DataTables */
html[data-theme="dark"] .dataTables_info,
html[data-theme="dark"] .dataTables_paginate,
html[data-theme="dark"] .dataTables_length,
html[data-theme="dark"] .dataTables_filter,
body.dark .dataTables_info,
body.dark .dataTables_paginate,
body.dark .dataTables_length,
body.dark .dataTables_filter {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .dataTables_filter input,
html[data-theme="dark"] .dataTables_length select,
body.dark .dataTables_filter input,
body.dark .dataTables_length select {
  background-color: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text) !important;
  border-radius: 8px;
  padding: 5px 10px;
}

html[data-theme="dark"] .pagination > li > a,
html[data-theme="dark"] .pagination > li > span,
body.dark .pagination > li > a,
body.dark .pagination > li > span {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .pagination > .active > a,
html[data-theme="dark"] .pagination > .active > span,
body.dark .pagination > .active > a,
body.dark .pagination > .active > span {
  background-color: #465fff !important;
  border-color: #465fff !important;
  color: #ffffff !important;
}

/* Mensaje empty state DataTables ("No hay datos disponibles en la tabla") */
html[data-theme="dark"] td.dataTables_empty,
body.dark td.dataTables_empty {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .dataTables_wrapper .frd-dt-empty-msg,
body.dark .dataTables_wrapper .frd-dt-empty-msg {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper .frd-dt-empty-today__title,
body.dark .dataTables_wrapper .frd-dt-empty-today__title {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper .frd-dt-empty-today__hint,
body.dark .dataTables_wrapper .frd-dt-empty-today__hint {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .dataTables_wrapper .frd-dt-empty-last7,
body.dark .dataTables_wrapper .frd-dt-empty-last7 {
  background: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

/* ==========================================================================
   7. FORMULARIOS, INPUTS & SELECT2
   ========================================================================== */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
body.dark .form-control,
body.dark input[type="text"],
body.dark input[type="search"],
body.dark input[type="number"],
body.dark input[type="password"],
body.dark input[type="email"],
body.dark select,
body.dark textarea {
  background-color: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text) !important;
  border-radius: 8px;
}

html[data-theme="dark"] .form-control:focus,
body.dark .form-control:focus {
  border-color: #465fff !important;
  box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.15) !important;
}

html[data-theme="dark"] .input-group-addon,
body.dark .input-group-addon {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text-muted) !important;
}

/* Select2 dropdowns */
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
body.dark .select2-container--default .select2-selection--single,
body.dark .select2-container--default .select2-selection--multiple {
  background-color: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text) !important;
  border-radius: 8px;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
body.dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .select2-dropdown,
body.dark .select2-dropdown {
  background-color: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: 0 16px 36px -4px rgba(16, 24, 40, 0.6) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"],
body.dark .select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #465fff !important;
  color: #ffffff !important;
}

/* ==========================================================================
   9. PUNTO DE VENTA (POS / LOCKSCREEN)
   ========================================================================== */
body.lockscreen.dark,
html[data-theme="dark"] body.lockscreen {
  --frd-pos-surface: var(--frd-dm-surface) !important;
  --frd-pos-border: var(--frd-dm-border) !important;
  --frd-pos-text: var(--frd-dm-text) !important;
  --frd-pos-muted: var(--frd-dm-text-muted) !important;
  --frd-pos-success-soft: rgba(16, 185, 129, 0.15) !important;
  --frd-pos-success-border: #059669 !important;
  --frd-pos-success-text: #34d399 !important;
  background-color: var(--frd-dm-bg) !important;
}

/* Barra superior POS */
body.lockscreen.dark .frd-pos-header__bar,
html[data-theme="dark"] body.lockscreen .frd-pos-header__bar {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark .frd-pos-header__location-name,
html[data-theme="dark"] body.lockscreen .frd-pos-header__location-name {
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark .frd-pos-header__btn,
html[data-theme="dark"] body.lockscreen .frd-pos-header__btn {
  background-color: var(--frd-dm-bg) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

/* Formulario central POS y tabla de productos */
body.lockscreen.dark #add_pos_sell_form,
html[data-theme="dark"] body.lockscreen #add_pos_sell_form {
  background: transparent !important;
}

body.lockscreen.dark #pos_table,
html[data-theme="dark"] body.lockscreen #pos_table {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark #pos_table thead th,
html[data-theme="dark"] body.lockscreen #pos_table thead th {
  background-color: var(--frd-dm-bg) !important;
  color: var(--frd-dm-text) !important;
  border-color: var(--frd-dm-border) !important;
}

body.lockscreen.dark #pos_table td,
html[data-theme="dark"] body.lockscreen #pos_table td {
  border-color: var(--frd-dm-border) !important;
}

/* Barra inferior de acciones (pos-form-actions) */
body.lockscreen.dark .pos-form-actions.frd-pos-footer,
html[data-theme="dark"] body.lockscreen .pos-form-actions.frd-pos-footer {
  background: var(--frd-dm-bg) !important;
  border-top: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 -4px 24px rgba(16, 24, 40, 0.6) !important;
}

body.lockscreen.dark .frd-pos-tool,
html[data-theme="dark"] body.lockscreen .frd-pos-tool {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: #e4e7ec !important;
}

body.lockscreen.dark .frd-pos-tool:hover,
html[data-theme="dark"] body.lockscreen .frd-pos-tool:hover {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

body.lockscreen.dark .frd-pos-footer__total-value,
html[data-theme="dark"] body.lockscreen .frd-pos-footer__total-value {
  color: var(--frd-dm-text) !important;
}

/* Tarjetas de productos sugeridos en POS sidebar y grid de productos */
body.lockscreen.dark .tw-dw-card,
html[data-theme="dark"] body.lockscreen .tw-dw-card,
body.lockscreen.dark .product_box,
html[data-theme="dark"] body.lockscreen .product_box {
  background-color: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark .tw-dw-card:hover,
html[data-theme="dark"] body.lockscreen .tw-dw-card:hover,
body.lockscreen.dark .product_box:hover,
html[data-theme="dark"] body.lockscreen .product_box:hover {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-color: #465fff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.lockscreen.dark .product_box .text,
html[data-theme="dark"] body.lockscreen .product_box .text,
body.lockscreen.dark .product_box .text-muted,
html[data-theme="dark"] body.lockscreen .product_box .text-muted {
  color: var(--frd-dm-text) !important;
}

/* Modal de Cobro / Pago POS (#modal_payment) */
body.lockscreen.dark #modal_payment .modal-content,
html[data-theme="dark"] body.lockscreen #modal_payment .modal-content {
  background-color: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark #modal_payment .modal-header,
html[data-theme="dark"] body.lockscreen #modal_payment .modal-header,
body.lockscreen.dark #modal_payment .frd-pos-pay__header,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__header {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
  color: #ffffff !important;
}

body.lockscreen.dark #modal_payment .modal-header .close,
html[data-theme="dark"] body.lockscreen #modal_payment .modal-header .close {
  color: #ffffff !important;
  opacity: 0.8;
}

body.lockscreen.dark #modal_payment .frd-pos-pay__summary .box.bg-orange,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__summary .box.bg-orange {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: #ffffff !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay__summary strong,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__summary strong {
  color: #98a2b3 !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay__summary .lead,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__summary .lead {
  color: #ffffff !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay-row,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-row {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay-more,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay-more > summary,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more > summary {
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay__footer,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__footer {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-top: 1px solid var(--frd-dm-border) !important;
}

/* Inputs de cobro y monto en POS y scopes v2 */
html[data-theme="dark"] body.lockscreen #modal_payment .form-control,
body.lockscreen.dark #modal_payment .form-control,
html[data-theme="dark"] .css-v2-form-scope .form-control,
body.dark .css-v2-form-scope .form-control,
html[data-theme="dark"] input.payment-amount,
body.dark input.payment-amount,
html[data-theme="dark"] input.input_number,
body.dark input.input_number {
  background-color: var(--frd-dm-input-bg) !important;
  color: #ffffff !important;
  border-color: var(--frd-dm-border-input) !important;
}

html[data-theme="dark"] body.lockscreen #modal_payment .form-control:focus,
body.lockscreen.dark #modal_payment .form-control:focus,
html[data-theme="dark"] .css-v2-form-scope .form-control:focus,
body.dark .css-v2-form-scope .form-control:focus,
html[data-theme="dark"] input.payment-amount:focus,
body.dark input.payment-amount:focus {
  background-color: var(--frd-dm-input-bg) !important;
  color: #ffffff !important;
  border-color: #465fff !important;
}

/* ==========================================================================
   Banner Compacto .frd-pos-stale-register (Estilos Base Globales)
   ========================================================================== */
.frd-pos-stale-register {
  margin: 0 0 0.65rem;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.frd-pos-stale-register__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: #92400e;
  box-sizing: border-box;
}

.frd-pos-stale-register__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fef3c7;
  color: #b45309;
}

.frd-pos-stale-register__icon svg {
  width: 18px;
  height: 18px;
}

.frd-pos-stale-register__text {
  flex: 1 1 180px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #78350f;
}

.frd-pos-stale-register__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.4rem 0.95rem;
  border: 1px solid #7c2d12;
  border-radius: 8px;
  background: #7c2d12;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: none;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none !important;
}

.frd-pos-stale-register__btn:hover,
.frd-pos-stale-register__btn:focus {
  background: #5c1a0b;
  border-color: #5c1a0b;
  color: #ffffff !important;
  outline: none;
}

.frd-pos-stale-register__dismiss {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #b45309;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Banner de Caja Abierta de varios días (Stale Register) */
html[data-theme="dark"] .frd-pos-stale-register__inner,
body.lockscreen.dark .frd-pos-stale-register__inner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(180, 83, 9, 0.18)) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
}

html[data-theme="dark"] .frd-pos-stale-register__icon,
body.lockscreen.dark .frd-pos-stale-register__icon {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fef08a !important;
}

html[data-theme="dark"] .frd-pos-stale-register__text,
body.lockscreen.dark .frd-pos-stale-register__text {
  color: #fef3c7 !important;
}

html[data-theme="dark"] .frd-pos-stale-register__btn,
body.lockscreen.dark .frd-pos-stale-register__btn {
  background: #f59e0b !important;
  border-color: #d97706 !important;
  color: #0f172a !important;
}

html[data-theme="dark"] .frd-pos-stale-register__btn:hover,
body.lockscreen.dark .frd-pos-stale-register__btn:hover {
  background: #fbbf24 !important;
  color: #000000 !important;
}

/* Drawer / Menús flotantes de Categorías y Marcas en POS */
html[data-theme="dark"] .tw-dw-drawer-side .tw-dw-menu,
body.lockscreen.dark .tw-dw-drawer-side .tw-dw-menu {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tw-dw-drawer-side .tw-dw-card,
body.lockscreen.dark .tw-dw-drawer-side .tw-dw-card {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tw-dw-drawer-side .tw-dw-card:hover,
body.lockscreen.dark .tw-dw-drawer-side .tw-dw-card:hover {
  background-color: var(--frd-dm-surface) !important;
  border-color: #465fff !important;
}

/* Popover de Atajos de Teclado */
html[data-theme="dark"] .popover,
body.dark .popover {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .popover .popover-title,
body.dark .popover .popover-title {
  background-color: var(--frd-dm-surface) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .popover .popover-content,
body.dark .popover .popover-content {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .popover.bottom > .arrow:after,
body.dark .popover.bottom > .arrow:after {
  border-bottom-color: var(--frd-dm-surface) !important;
}

html[data-theme="dark"] .popover.top > .arrow:after,
body.dark .popover.top > .arrow:after {
  border-top-color: var(--frd-dm-surface-elevated) !important;
}

/* Botones de acción del Modal de Cerrar Caja */
html[data-theme="dark"] .modal-footer .tw-dw-btn-info,
body.dark .modal-footer .tw-dw-btn-info,
html[data-theme="dark"] .close_register_modal .tw-dw-btn-info,
body.dark .close_register_modal .tw-dw-btn-info {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: #7592ff !important;
}

html[data-theme="dark"] .modal-footer .tw-dw-btn-info:hover,
body.dark .modal-footer .tw-dw-btn-info:hover {
  background-color: rgba(70, 95, 255, 0.2) !important;
  border-color: #465fff !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .modal-footer .tw-dw-btn-neutral,
body.dark .modal-footer .tw-dw-btn-neutral {
  background-color: transparent !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .modal-footer .tw-dw-btn-neutral:hover,
body.dark .modal-footer .tw-dw-btn-neutral:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .close_register_modal p,
body.dark .close_register_modal p,
html[data-theme="dark"] .close_register_modal h3,
body.dark .close_register_modal h3,
html[data-theme="dark"] .close_register_modal table,
body.dark .close_register_modal table {
  color: var(--frd-dm-text) !important;
}

/* Botones de + Agregar Rápido en POS */
body.lockscreen.dark .pos_add_quick_product,
html[data-theme="dark"] body.lockscreen .pos_add_quick_product,
body.lockscreen.dark .btn.bg-white.pos_add_quick_product,
html[data-theme="dark"] body.lockscreen .btn.bg-white.pos_add_quick_product {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: #7592ff !important;
}

body.lockscreen.dark .pos_add_quick_product:hover,
html[data-theme="dark"] body.lockscreen .pos_add_quick_product:hover {
  background-color: rgba(70, 95, 255, 0.2) !important;
  border-color: #465fff !important;
  color: #ffffff !important;
}

body.lockscreen.dark .pos_add_quick_product svg,
html[data-theme="dark"] body.lockscreen .pos_add_quick_product svg {
  color: inherit !important;
}

/* Modales de Cerrar Caja & Detalles de Caja */
html[data-theme="dark"] .modal-dialog table.table-condensed,
body.dark .modal-dialog table.table-condensed {
  background-color: transparent !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .modal-dialog table.table-condensed td,
body.dark .modal-dialog table.table-condensed td {
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .modal-dialog table.table-condensed tr.success,
body.dark .modal-dialog table.table-condensed tr.success {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

html[data-theme="dark"] .modal-dialog h4[style*="border-bottom"],
body.dark .modal-dialog h4[style*="border-bottom"] {
  border-bottom-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   11. CERTIFICACIÓN DGII V1 WIZARD DARK MODE
   ========================================================================== */
html[data-theme="dark"] .fe-wizard-scope,
body.dark .fe-wizard-scope {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-header-card,
html[data-theme="dark"] .fe-wz-card,
body.dark .fe-header-card,
body.dark .fe-wz-card {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: 0 4px 20px -2px rgba(16, 24, 40, 0.4) !important;
}

html[data-theme="dark"] .fe-company-title,
html[data-theme="dark"] .fe-step-title,
body.dark .fe-company-title,
body.dark .fe-step-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .fe-meta-info,
html[data-theme="dark"] .fe-step-desc,
body.dark .fe-meta-info,
body.dark .fe-step-desc {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .fe-meta-info strong,
body.dark .fe-meta-info strong {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-meta-code,
body.dark .fe-meta-code {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: #7592ff !important;
}

html[data-theme="dark"] .fe-wz-stepper,
body.dark .fe-wz-stepper {
  background: var(--frd-dm-bg) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .fe-wz-step-item,
body.dark .fe-wz-step-item {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .fe-wz-step-item:hover,
body.dark .fe-wz-step-item:hover {
  background: var(--frd-dm-surface-elevated) !important;
}

html[data-theme="dark"] .fe-wz-step-badge,
body.dark .fe-wz-step-badge {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .fe-wz-step-title,
body.dark .fe-wz-step-title {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .fe-wz-step-item.is-completed .fe-wz-step-badge,
body.dark .fe-wz-step-item.is-completed .fe-wz-step-badge {
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

html[data-theme="dark"] .fe-wz-step-item.is-completed .fe-wz-step-title,
body.dark .fe-wz-step-item.is-completed .fe-wz-step-title {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-progress-track,
body.dark .fe-progress-track {
  background: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .fe-progress-labels,
body.dark .fe-progress-labels {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .fe-callout,
body.dark .fe-callout {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-form-group label,
body.dark .fe-form-group label {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-input,
body.dark .fe-input {
  background-color: var(--frd-dm-input-bg) !important;
  border-color: var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-footer-nav,
body.dark .fe-footer-nav {
  border-top-color: var(--frd-dm-border) !important;
}

/* ==========================================================================
   12. PESTAÑAS (NAV-TABS & NAV-TABS-CUSTOM) EN DARK MODE
   ========================================================================== */
html[data-theme="dark"] .nav-tabs,
body.dark .nav-tabs,
html[data-theme="dark"] .nav-tabs-custom > .nav-tabs,
body.dark .nav-tabs-custom > .nav-tabs {
  border-bottom: 1px solid var(--frd-dm-border) !important;
  background-color: var(--frd-dm-surface) !important;
}

html[data-theme="dark"] .nav-tabs > li > a,
body.dark .nav-tabs > li > a,
html[data-theme="dark"] .nav-tabs-custom > .nav-tabs > li > a,
body.dark .nav-tabs-custom > .nav-tabs > li > a {
  color: var(--frd-dm-text-muted) !important;
  border-color: transparent !important;
  background: transparent !important;
  font-weight: 600;
  transition: all 0.15s ease-in-out;
}

html[data-theme="dark"] .nav-tabs > li > a:hover,
html[data-theme="dark"] .nav-tabs > li > a:focus,
body.dark .nav-tabs > li > a:hover,
body.dark .nav-tabs > li > a:focus,
html[data-theme="dark"] .nav-tabs-custom > .nav-tabs > li > a:hover,
body.dark .nav-tabs-custom > .nav-tabs > li > a:hover {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .nav-tabs > li.active > a,
html[data-theme="dark"] .nav-tabs > li.active > a:hover,
html[data-theme="dark"] .nav-tabs > li.active > a:focus,
body.dark .nav-tabs > li.active > a,
body.dark .nav-tabs > li.active > a:hover,
body.dark .nav-tabs > li.active > a:focus,
html[data-theme="dark"] .nav-tabs-custom > .nav-tabs > li.active > a,
body.dark .nav-tabs-custom > .nav-tabs > li.active > a {
  background-color: var(--frd-dm-bg) !important;
  color: #ffffff !important;
  border: 1px solid var(--frd-dm-border) !important;
  border-bottom-color: var(--frd-dm-bg) !important;
  font-weight: 700;
}

html[data-theme="dark"] .nav-tabs-custom,
body.dark .nav-tabs-custom,
html[data-theme="dark"] .nav-tabs-custom > .tab-content,
body.dark .nav-tabs-custom > .tab-content,
html[data-theme="dark"] .tab-content,
body.dark .tab-content {
  background: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
  border-color: var(--frd-dm-border) !important;
}

/* ==========================================================================
   13. ESQUEMAS Y DISEÑOS DE FACTURAS (/invoice-schemes & /invoice-layouts)
   ========================================================================== */
/* Celdas de esquema con texto blanco y badges limpios */
html[data-theme="dark"] #invoice_table tbody td,
body.dark #invoice_table tbody td {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] #invoice_table tbody tr.frd-row-inactive,
body.dark #invoice_table tbody tr.frd-row-inactive {
  background-color: var(--frd-dm-bg) !important;
  opacity: 0.65;
}

/* Badges de esquema y prefijo */
html[data-theme="dark"] #invoice_table [style*="color:#0f172a"],
html[data-theme="dark"] #invoice_table [style*="color: #0f172a"],
body.dark #invoice_table [style*="color:#0f172a"],
body.dark #invoice_table [style*="color: #0f172a"] {
  color: #ffffff !important;
}

html[data-theme="dark"] #invoice_table [style*="color:#1e293b"],
html[data-theme="dark"] #invoice_table [style*="color: #1e293b"],
body.dark #invoice_table [style*="color:#1e293b"],
body.dark #invoice_table [style*="color: #1e293b"] {
  color: #ffffff !important;
}

html[data-theme="dark"] #invoice_table span.text-muted,
body.dark #invoice_table span.text-muted {
  color: #98a2b3 !important;
}

html[data-theme="dark"] #invoice_table [style*="background: #f1f5f9"],
html[data-theme="dark"] #invoice_table [style*="background:#f1f5f9"],
body.dark #invoice_table [style*="background: #f1f5f9"],
body.dark #invoice_table [style*="background:#f1f5f9"] {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #38bdf8 !important;
}

/* Tarjetas de diseños de factura (Tab 2) */
html[data-theme="dark"] #tab_2 .tw-bg-white,
body.dark #tab_2 .tw-bg-white {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] #tab_2 .tw-bg-slate-50,
body.dark #tab_2 .tw-bg-slate-50 {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

/* ==========================================================================
   14. FACTURA STUDIO (PERSONALIZAR DISEÑO - /invoice-layouts/{id}/edit)
   ========================================================================== */
html[data-theme="dark"] .studio-pills-bar,
body.dark .studio-pills-bar {
  background: var(--frd-dm-surface-elevated) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
}

html[data-theme="dark"] .studio-pill-btn,
body.dark .studio-pill-btn {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .studio-pill-btn:hover,
body.dark .studio-pill-btn:hover {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: #465fff !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .studio-pill-btn.active,
body.dark .studio-pill-btn.active {
  background: rgba(70, 95, 255, 0.22) !important;
  border-color: #465fff !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(70, 95, 255, 0.3) !important;
}

html[data-theme="dark"] .studio-subheading,
body.dark .studio-subheading {
  color: #ffffff !important;
  border-bottom-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .studio-subheading i,
body.dark .studio-subheading i {
  color: #7592ff !important;
}

html[data-theme="dark"] .studio-switch-item,
body.dark .studio-switch-item {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .studio-switch-item:hover,
body.dark .studio-switch-item:hover {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border-input) !important;
}

html[data-theme="dark"] .studio-switch-item__label,
body.dark .studio-switch-item__label {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .studio-switch-item__label i,
body.dark .studio-switch-item__label i {
  color: #98a2b3 !important;
}

html[data-theme="dark"] .studio-slider,
body.dark .studio-slider {
  background-color: var(--frd-dm-border-input) !important;
}

html[data-theme="dark"] input:checked + .studio-slider,
body.dark input:checked + .studio-slider {
  background-color: #465fff !important;
}

html[data-theme="dark"] .studio-alert--info,
body.dark .studio-alert--info {
  background: rgba(70, 95, 255, 0.15) !important;
  border-color: rgba(70, 95, 255, 0.3) !important;
  color: #93c5fd !important;
}

html[data-theme="dark"] .studio-alert--success,
body.dark .studio-alert--success {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #6ee7b7 !important;
}

/* Simulación de Comprobante / Ticket Térmico en Factura Studio */
html[data-theme="dark"] .thermal-paper,
body.dark .thermal-paper {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="dark"] .sheet-paper,
body.dark .sheet-paper {
  background: #ffffff !important;
  color: #1e293b !important;
}

/* ==========================================================================
   15. CENTRO DE SUSCRIPCIÓN & CHECKOUT (/subscription)
   ========================================================================== */
html[data-theme="dark"] .frd-sub-hub,
body.dark .frd-sub-hub {
  --frd-sub-border: var(--frd-dm-border);
  --frd-sub-text: var(--frd-dm-text);
  --frd-sub-muted: var(--frd-dm-text-muted);
  --frd-sub-accent-soft: rgba(70, 95, 255, 0.15);
}

html[data-theme="dark"] .frd-sub-hero,
body.dark .frd-sub-hero {
  background: linear-gradient(135deg, var(--frd-dm-surface) 0%, var(--frd-dm-surface-elevated) 100%) !important;
  border-color: var(--frd-dm-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .frd-sub-hero__title,
body.dark .frd-sub-hero__title,
html[data-theme="dark"] .frd-sub-validity-line strong,
body.dark .frd-sub-validity-line strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sub-hero__meta,
body.dark .frd-sub-hero__meta,
html[data-theme="dark"] .frd-sub-renewal-date,
body.dark .frd-sub-renewal-date,
html[data-theme="dark"] .frd-sub-usage__period,
body.dark .frd-sub-usage__period,
html[data-theme="dark"] .frd-sub-usage__note,
body.dark .frd-sub-usage__note,
html[data-theme="dark"] .frd-sub-section__subtitle,
body.dark .frd-sub-section__subtitle {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-sub-usage__item,
body.dark .frd-sub-usage__item {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sub-usage__item--ecf,
body.dark .frd-sub-usage__item--ecf {
  background: rgba(70, 95, 255, 0.12) !important;
  border-color: rgba(70, 95, 255, 0.35) !important;
}

html[data-theme="dark"] .frd-sub-usage__label,
body.dark .frd-sub-usage__label,
html[data-theme="dark"] .frd-sub-usage__values,
body.dark .frd-sub-usage__values,
html[data-theme="dark"] .frd-sub-usage__values strong,
body.dark .frd-sub-usage__values strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sub-usage__track,
body.dark .frd-sub-usage__track {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .frd-sub-queue__card,
body.dark .frd-sub-queue__card {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-sub-queue__name,
body.dark .frd-sub-queue__name {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sub-section__title,
body.dark .frd-sub-section__title {
  color: #ffffff !important;
}

/* Selector Mensual / Anual */
html[data-theme="dark"] .frd-billing-cycle-nav,
body.dark .frd-billing-cycle-nav {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-billing-cycle-btn,
body.dark .frd-billing-cycle-btn {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-billing-cycle-btn.active,
body.dark .frd-billing-cycle-btn.active {
  background: var(--frd-dm-surface) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .frd-billing-cycle-hint,
body.dark .frd-billing-cycle-hint {
  color: var(--frd-dm-text-muted) !important;
}

/* Tarjetas de Planes de Precios */
html[data-theme="dark"] .frd-plan-card,
body.dark .frd-plan-card {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .frd-plan-card:hover,
body.dark .frd-plan-card:hover {
  border-color: #465fff !important;
  background: var(--frd-dm-surface-elevated) !important;
}

html[data-theme="dark"] .frd-plan-card--current,
body.dark .frd-plan-card--current {
  border-color: #465fff !important;
  box-shadow: 0 0 0 1px #465fff, 0 4px 20px rgba(70, 95, 255, 0.2) !important;
}

html[data-theme="dark"] .frd-plan-card__header,
body.dark .frd-plan-card__header,
html[data-theme="dark"] .frd-plan-card__features,
body.dark .frd-plan-card__features {
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-plan-card__name,
body.dark .frd-plan-card__name,
html[data-theme="dark"] .frd-plan-card__price,
body.dark .frd-plan-card__price,
html[data-theme="dark"] .frd-plan-card__price--annual,
body.dark .frd-plan-card__price--annual {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-pricing-equiv-text strong,
body.dark .frd-pricing-equiv-text strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-plan-card__description,
body.dark .frd-plan-card__description,
html[data-theme="dark"] .frd-pricing-equiv-text,
body.dark .frd-pricing-equiv-text,
html[data-theme="dark"] .frd-plan-card__footer-note,
body.dark .frd-plan-card__footer-note {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-plan-card__specs > div,
body.dark .frd-plan-card__specs > div {
  border-bottom-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-plan-card__specs dt,
body.dark .frd-plan-card__specs dt {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-plan-card__specs dd,
body.dark .frd-plan-card__specs dd {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-plan-card__features,
body.dark .frd-plan-card__features {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-plan-card__features i,
body.dark .frd-plan-card__features i {
  color: #34d399 !important;
}

/* Checkout y Breakdown */
html[data-theme="dark"] .frd-sub-checkout__summary,
body.dark .frd-sub-checkout__summary,
html[data-theme="dark"] .frd-sub-checkout__breakdown-box,
body.dark .frd-sub-checkout__breakdown-box {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-sub-checkout__plan-name,
body.dark .frd-sub-checkout__plan-name {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sub-checkout__total,
body.dark .frd-sub-checkout__total {
  border-color: var(--frd-dm-border) !important;
}

/* ==========================================================================
   Nuevas Adaptaciones Dark Mode: Filtros, Datatables Footer, Sidebar y POS
   ========================================================================== */

/* 1. Panel Global de Filtros (.frd-filter-panel) */
html[data-theme="dark"] .frd-filter-panel,
body.dark .frd-filter-panel {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .frd-filter-panel__header,
body.dark .frd-filter-panel__header {
  background: var(--frd-dm-surface-elevated) !important;
}

html[data-theme="dark"] .frd-filter-panel__toggle,
body.dark .frd-filter-panel__toggle {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-filter-panel__toggle:hover,
html[data-theme="dark"] .frd-filter-panel__toggle:focus,
body.dark .frd-filter-panel__toggle:hover,
body.dark .frd-filter-panel__toggle:focus {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-filter-panel__icon,
body.dark .frd-filter-panel__icon {
  background: rgba(70, 95, 255, 0.15) !important;
  border-color: rgba(70, 95, 255, 0.3) !important;
  color: #7592ff !important;
}

html[data-theme="dark"] .frd-filter-panel__title,
body.dark .frd-filter-panel__title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-filter-panel__hint,
body.dark .frd-filter-panel__hint {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-filter-panel__chevron,
body.dark .frd-filter-panel__chevron {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-filter-panel__toggle:hover .frd-filter-panel__chevron,
html[data-theme="dark"] .frd-filter-panel__toggle:focus .frd-filter-panel__chevron,
body.dark .frd-filter-panel__toggle:hover .frd-filter-panel__chevron,
body.dark .frd-filter-panel__toggle:focus .frd-filter-panel__chevron {
  background: rgba(70, 95, 255, 0.2) !important;
  color: #7592ff !important;
}

html[data-theme="dark"] .frd-filter-panel__collapse,
body.dark .frd-filter-panel__collapse {
  background: var(--frd-dm-surface) !important;
  border-top-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-filter-panel__body,
body.dark .frd-filter-panel__body {
  background: var(--frd-dm-surface) !important;
}

html[data-theme="dark"] .frd-filter-panel__body label,
body.dark .frd-filter-panel__body label {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-filter-panel__body .form-control,
body.dark .frd-filter-panel__body .form-control,
html[data-theme="dark"] .frd-filter-panel__body .select2-container--default .select2-selection--single,
body.dark .frd-filter-panel__body .select2-container--default .select2-selection--single {
  background-color: var(--frd-dm-input-bg) !important;
  border-color: var(--frd-dm-border-input) !important;
  color: #ffffff !important;
}

/* 2. Totales Inferiores de DataTables (tfoot tr.footer-total) */
html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.footer-total,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.footer-total,
html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.bg-gray,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.bg-gray,
body.dark .dataTables_wrapper table.dataTable tfoot tr.footer-total,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.footer-total,
body.dark .dataTables_wrapper table.dataTable tfoot tr.bg-gray,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.bg-gray {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.footer-total td,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td,
body.dark .dataTables_wrapper table.dataTable tfoot tr.footer-total td,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.footer-total td strong,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td strong,
body.dark .dataTables_wrapper table.dataTable tfoot tr.footer-total td strong,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.footer-total td small,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td small,
body.dark .dataTables_wrapper table.dataTable tfoot tr.footer-total td small,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td small {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.footer-total td small span.footer_total_due,
html[data-theme="dark"] .dataTables_wrapper table.dataTable tfoot tr.footer-total td small span.footer_total_purchase_return_due,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td small span.footer_total_due,
html[data-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td small span.footer_total_purchase_return_due,
body.dark .dataTables_wrapper table.dataTable tfoot tr.footer-total td small span.footer_total_due,
body.dark .dataTables_wrapper table.dataTable tfoot tr.footer-total td small span.footer_total_purchase_return_due,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td small span.footer_total_due,
body.dark .dataTables_scrollFoot table.dataTable tfoot tr.footer-total td small span.footer_total_purchase_return_due {
  color: #fbbf24 !important;
}

/* 3. Datos del Usuario en el Menú Sidebar (Parte inferior) */
html[data-theme="dark"] .frd-sidebar-profile__text strong,
body.dark .frd-sidebar-profile__text strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sidebar-profile__text > span,
body.dark .frd-sidebar-profile__text > span {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-sidebar-profile__settings,
body.dark .frd-sidebar-profile__settings {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-sidebar-profile__settings:hover,
html[data-theme="dark"] .frd-sidebar-profile__settings:focus,
html[data-theme="dark"] .frd-sidebar-profile__menu[open] .frd-sidebar-profile__settings,
body.dark .frd-sidebar-profile__settings:hover,
body.dark .frd-sidebar-profile__settings:focus,
body.dark .frd-sidebar-profile__menu[open] .frd-sidebar-profile__settings {
  background: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

/* 4. Modal de Pago POS: Más opciones y Denominaciones en Efectivo */
body.lockscreen.dark #modal_payment .frd-pos-pay-more--extra,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more--extra {
  background-color: rgba(70, 95, 255, 0.1) !important;
  border-color: rgba(70, 95, 255, 0.3) !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay-more--extra > summary,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more--extra > summary {
  color: #9cb4ff !important;
}

body.lockscreen.dark #modal_payment .cash_denomination_div table.table > tbody > tr,
html[data-theme="dark"] body.lockscreen #modal_payment .cash_denomination_div table.table > tbody > tr {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
}

body.lockscreen.dark #modal_payment .cash_denomination_div table.table > tbody > tr > td:nth-child(1),
html[data-theme="dark"] body.lockscreen #modal_payment .cash_denomination_div table.table > tbody > tr > td:nth-child(1) {
  color: #ffffff !important;
}

body.lockscreen.dark #modal_payment .cash_denomination_div .cash_denomination,
html[data-theme="dark"] body.lockscreen #modal_payment .cash_denomination_div .cash_denomination {
  background-color: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border-input) !important;
  color: #ffffff !important;
}

body.lockscreen.dark #modal_payment .cash_denomination_div .cash_denomination:focus,
html[data-theme="dark"] body.lockscreen #modal_payment .cash_denomination_div .cash_denomination:focus {
  border-color: #465fff !important;
}

body.lockscreen.dark #modal_payment .cash_denomination_div table.table > tfoot th,
body.lockscreen.dark #modal_payment .cash_denomination_div table.table > tfoot td,
html[data-theme="dark"] body.lockscreen #modal_payment .cash_denomination_div table.table > tfoot th,
html[data-theme="dark"] body.lockscreen #modal_payment .cash_denomination_div table.table > tfoot td {
  color: #ffffff !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay__footer-actions .tw-dw-btn-outline,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__footer-actions .tw-dw-btn-outline {
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  background: transparent !important;
}

body.lockscreen.dark #modal_payment .frd-pos-pay__footer-actions .tw-dw-btn-outline:hover,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__footer-actions .tw-dw-btn-outline:hover {
  background: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

/* 5. Modal de Cerrar Caja: Líneas de Resumen y Efectivo Esperado */
html[data-theme="dark"] .close_register_modal .modal-content,
body.dark .close_register_modal .modal-content {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .close_register_modal .modal-header,
body.dark .close_register_modal .modal-header {
  border-bottom-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .close_register_modal .modal-header .modal-title,
body.dark .close_register_modal .modal-header .modal-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .close_register_modal .modal-header .close,
body.dark .close_register_modal .modal-header .close {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .close_register_modal table.table tr.success,
body.dark .close_register_modal table.table tr.success,
html[data-theme="dark"] .close_register_modal table.table tr.success td,
body.dark .close_register_modal table.table tr.success td,
html[data-theme="dark"] .close_register_modal table.table tr.success th,
body.dark .close_register_modal table.table tr.success th,
html[data-theme="dark"] .close_register_modal table.table td.success,
body.dark .close_register_modal table.table td.success {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
}

html[data-theme="dark"] .close_register_modal table.table td.info,
body.dark .close_register_modal table.table td.info,
html[data-theme="dark"] .close_register_modal table.table tr.info,
body.dark .close_register_modal table.table tr.info,
html[data-theme="dark"] .close_register_modal table.table tr.info td,
body.dark .close_register_modal table.table tr.info td,
html[data-theme="dark"] .close_register_modal table.table tr.info th,
body.dark .close_register_modal table.table tr.info th {
  background-color: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
}

html[data-theme="dark"] .close_register_modal table.table td.danger,
body.dark .close_register_modal table.table td.danger,
html[data-theme="dark"] .close_register_modal table.table tr.danger,
body.dark .close_register_modal table.table tr.danger,
html[data-theme="dark"] .close_register_modal table.table tr.danger td,
body.dark .close_register_modal table.table tr.danger td,
html[data-theme="dark"] .close_register_modal table.table tr.danger th,
body.dark .close_register_modal table.table tr.danger th {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
}

html[data-theme="dark"] .close_register_modal table.table td.warning,
body.dark .close_register_modal table.table td.warning,
html[data-theme="dark"] .close_register_modal table.table tr.warning,
body.dark .close_register_modal table.table tr.warning,
html[data-theme="dark"] .close_register_modal table.table tr.warning td,
body.dark .close_register_modal table.table tr.warning td,
html[data-theme="dark"] .close_register_modal table.table tr.warning th,
body.dark .close_register_modal table.table tr.warning th {
  background-color: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}

html[data-theme="dark"] .close_register_modal table.table td,
html[data-theme="dark"] .close_register_modal table.table th,
body.dark .close_register_modal table.table td,
body.dark .close_register_modal table.table th {
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .close_register_modal table.table td span.display_currency,
html[data-theme="dark"] .close_register_modal table.table th span.display_currency,
body.dark .close_register_modal table.table td span.display_currency,
body.dark .close_register_modal table.table th span.display_currency,
html[data-theme="dark"] .close_register_modal table.table td b,
html[data-theme="dark"] .close_register_modal table.table th b,
html[data-theme="dark"] .close_register_modal table.table td strong,
html[data-theme="dark"] .close_register_modal table.table th strong,
body.dark .close_register_modal table.table td b,
body.dark .close_register_modal table.table th b,
body.dark .close_register_modal table.table td strong,
body.dark .close_register_modal table.table th strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .close_register_modal table.table tr[style*="border-top"],
body.dark .close_register_modal table.table tr[style*="border-top"] {
  border-top-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .close_register_modal h4,
body.dark .close_register_modal h4 {
  border-bottom-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .close_register_modal .cash_denomination,
body.dark .close_register_modal .cash_denomination {
  background-color: var(--frd-dm-input-bg) !important;
  border: 1px solid var(--frd-dm-border-input) !important;
  color: #ffffff !important;
}

/* 6. Botones de + Contacto, Íconos de Búsqueda y Carrito Vacío en POS */
body.lockscreen.dark .btn.bg-white.btn-flat.frd-pos-field-icon-btn,
html[data-theme="dark"] body.lockscreen .btn.bg-white.btn-flat.frd-pos-field-icon-btn,
body.lockscreen.dark .input-group-btn .btn.bg-white.btn-flat,
html[data-theme="dark"] body.lockscreen .input-group-btn .btn.bg-white.btn-flat {
  background-color: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

body.lockscreen.dark .btn.bg-white.btn-flat.frd-pos-field-icon-btn:hover,
html[data-theme="dark"] body.lockscreen .btn.bg-white.btn-flat.frd-pos-field-icon-btn:hover,
body.lockscreen.dark .input-group-btn .btn.bg-white.btn-flat:hover,
html[data-theme="dark"] body.lockscreen .input-group-btn .btn.bg-white.btn-flat:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

body.lockscreen.dark .add_new_customer .text-primary,
html[data-theme="dark"] body.lockscreen .add_new_customer .text-primary {
  color: #7592ff !important;
}

body.lockscreen.dark #pos_table .pos-empty-state-row td,
html[data-theme="dark"] body.lockscreen #pos_table .pos-empty-state-row td {
  background: transparent !important;
}

body.lockscreen.dark #pos_table .pos-empty-state-row div[style*="background-color: #F1F5F9"],
html[data-theme="dark"] body.lockscreen #pos_table .pos-empty-state-row div[style*="background-color: #F1F5F9"] {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: #7592ff !important;
}

body.lockscreen.dark #pos_table .pos-empty-state-row div[style*="color: #4B5563"],
html[data-theme="dark"] body.lockscreen #pos_table .pos-empty-state-row div[style*="color: #4B5563"] {
  color: #ffffff !important;
}

body.lockscreen.dark #pos_table .pos-empty-state-row div[style*="color: #9CA3AF"],
html[data-theme="dark"] body.lockscreen #pos_table .pos-empty-state-row div[style*="color: #9CA3AF"] {
  color: var(--frd-dm-text-muted) !important;
}

/* 7. Productos agregados al carrito de POS y botón de eliminar fila */
body.lockscreen.dark #pos_table .pos-cart-product-name,
body.lockscreen.dark #pos_table .pos-product-title,
html[data-theme="dark"] body.lockscreen #pos_table .pos-cart-product-name,
html[data-theme="dark"] body.lockscreen #pos_table .pos-product-title,
html[data-theme="dark"] body.lockscreen #pos_table .product_row .text-info,
html[data-theme="dark"] body.lockscreen #pos_table .product_row .text-link,
body.lockscreen.dark #pos_table .product_row .text-info,
body.lockscreen.dark #pos_table .product_row .text-link {
  color: #ffffff !important;
}

body.lockscreen.dark #pos_table .pos-product-sku,
html[data-theme="dark"] body.lockscreen #pos_table .pos-product-sku {
  color: var(--frd-dm-text-muted) !important;
}

body.lockscreen.dark #pos_table .pos-product-stock,
html[data-theme="dark"] body.lockscreen #pos_table .pos-product-stock {
  color: #34d399 !important;
}

body.lockscreen.dark #pos_table .pos-product-thumbnail,
html[data-theme="dark"] body.lockscreen #pos_table .pos-product-thumbnail,
html[data-theme="dark"] .pos-product-thumbnail {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background-color: #1e293b !important;
}

/* Ícono moderno 'X' para eliminar producto del carrito en POS */
body.lockscreen #pos_table i.pos_remove_row,
html[data-theme="dark"] body.lockscreen #pos_table i.pos_remove_row {
  cursor: pointer;
  color: #ef4444 !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: all 0.15s ease;
}

body.lockscreen #pos_table i.pos_remove_row:hover,
html[data-theme="dark"] body.lockscreen #pos_table i.pos_remove_row:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.08);
}

/* ==========================================================================
   8. Adaptación Dark Mode Integral para el Módulo de Restaurante
   ========================================================================== */
html[data-theme="dark"] .frd-restaurant-module,
body.dark .frd-restaurant-module,
html[data-theme="dark"] .frd-comandero-page,
body.dark .frd-comandero-page,
html[data-theme="dark"] .frd-kds-page,
body.dark .frd-kds-page,
html[data-theme="dark"] #modulo_plano_mesas,
body.dark #modulo_plano_mesas,
html[data-theme="dark"] #app_cobro,
body.dark #app_cobro,
html[data-theme="dark"] #app_cuadre,
body.dark #app_cuadre,
html[data-theme="dark"] #app_escandallo,
body.dark #app_escandallo {
  --frd-rest-surface: #101828 !important;
  --frd-rest-surface-muted: #0c111d !important;
  --frd-rest-surface-hover: #162032 !important;
  --frd-rest-border: #1d2939 !important;
  --frd-rest-border-focus: #344054 !important;
  --frd-rest-text: #f8fafc !important;
  --frd-rest-text-muted: #98a2b3 !important;
  --frd-rest-text-light: #667085 !important;
  --frd-rest-primary-soft: rgba(70, 95, 255, 0.15) !important;
  --frd-rest-primary-border: rgba(70, 95, 255, 0.3) !important;
  --frd-rest-success-soft: rgba(16, 185, 129, 0.15) !important;
  --frd-rest-success-border: rgba(16, 185, 129, 0.3) !important;
  --frd-rest-warning-soft: rgba(245, 158, 11, 0.15) !important;
  --frd-rest-warning-border: rgba(245, 158, 11, 0.3) !important;
  --frd-rest-danger-soft: rgba(239, 68, 68, 0.15) !important;
  --frd-rest-danger-border: rgba(239, 68, 68, 0.3) !important;
  --frd-rest-purple-soft: rgba(139, 92, 246, 0.15) !important;
  --frd-rest-purple-border: rgba(139, 92, 246, 0.3) !important;
}

/* Headers y Barras de Restaurante */
html[data-theme="dark"] .frd-rest-header,
body.dark .frd-rest-header,
html[data-theme="dark"] .frd-comandero-header-card,
body.dark .frd-comandero-header-card,
html[data-theme="dark"] .frd-rest-card,
body.dark .frd-rest-card,
html[data-theme="dark"] .frd-order-panel,
body.dark .frd-order-panel {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-rest-title,
body.dark .frd-rest-title,
html[data-theme="dark"] .frd-rest-subtitle,
body.dark .frd-rest-subtitle {
  color: #ffffff !important;
}

/* Botones de acción y filtros en restaurante */
html[data-theme="dark"] .frd-btn-outline,
body.dark .frd-btn-outline,
html[data-theme="dark"] .frd-header-action-btn,
body.dark .frd-header-action-btn,
html[data-theme="dark"] .frd-back-salon-btn,
body.dark .frd-back-salon-btn {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-btn-outline:hover,
body.dark .frd-btn-outline:hover,
html[data-theme="dark"] .frd-header-action-btn:hover,
body.dark .frd-header-action-btn:hover,
html[data-theme="dark"] .frd-back-salon-btn:hover,
body.dark .frd-back-salon-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

/* Plano de mesas: Lienzo y Tarjetas de Mesa */
html[data-theme="dark"] .frd-canvas-container,
body.dark .frd-canvas-container {
  background-color: #0b0f19 !important;
  background-image: radial-gradient(#1e293b 1.2px, transparent 1.2px) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-table-card,
body.dark .frd-table-card {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .frd-table-card .frd-table-number,
body.dark .frd-table-card .frd-table-number {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-table-card .frd-table-meta,
body.dark .frd-table-card .frd-table-meta {
  color: var(--frd-dm-text-muted) !important;
}

/* Comandero: Categorías, Platos y Panel de Comanda */
html[data-theme="dark"] .frd-comandero-page .frd-cat-pill,
body.dark .frd-comandero-page .frd-cat-pill {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-comandero-page .frd-cat-pill.is-active,
body.dark .frd-comandero-page .frd-cat-pill.is-active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-dish-card,
body.dark .frd-dish-card {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-dish-name,
body.dark .frd-dish-name {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-dish-price,
body.dark .frd-dish-price {
  color: #60a5fa !important;
}

html[data-theme="dark"] .frd-order-item,
body.dark .frd-order-item {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-order-footer,
body.dark .frd-order-footer {
  background: var(--frd-dm-surface) !important;
  border-top-color: var(--frd-dm-border) !important;
}

/* Pantalla de Cocina / KDS */
html[data-theme="dark"] .frd-kds-card,
body.dark .frd-kds-card {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-kds-card-head,
body.dark .frd-kds-card-head {
  border-bottom-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-kds-item,
body.dark .frd-kds-item {
  border-bottom-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* Pantalla de Cobro de Restaurante (#app_cobro) */
html[data-theme="dark"] #app_cobro,
body.dark #app_cobro {
  background-color: #0b0f19 !important;
}

html[data-theme="dark"] #app_cobro .tw-bg-white,
body.dark #app_cobro .tw-bg-white {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] #app_cobro .tw-bg-slate-50,
body.dark #app_cobro .tw-bg-slate-50,
html[data-theme="dark"] #app_cobro .tw-bg-slate-100,
body.dark #app_cobro .tw-bg-slate-100 {
  background-color: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] #app_cobro .tw-text-slate-800,
html[data-theme="dark"] #app_cobro .tw-text-slate-900,
body.dark #app_cobro .tw-text-slate-800,
body.dark #app_cobro .tw-text-slate-900 {
  color: #ffffff !important;
}

html[data-theme="dark"] #app_cobro .tw-text-slate-500,
html[data-theme="dark"] #app_cobro .tw-text-slate-600,
body.dark #app_cobro .tw-text-slate-500,
body.dark #app_cobro .tw-text-slate-600 {
  color: var(--frd-dm-text-muted) !important;
}

/* ==========================================================================
   9. Salón de Mesas, Plano y Diseñador de Restaurante (/restaurante/plano)
   ========================================================================== */

/* Barra de herramientas superior del salón (Vistas Salón/Tarjetas, Timbre, + Para llevar) */
html[data-theme="dark"] .frd-salon-toolbar,
body.dark .frd-salon-toolbar {
  background: transparent !important;
}

html[data-theme="dark"] .frd-segmented-control,
body.dark .frd-segmented-control {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-segment-btn,
body.dark .frd-segment-btn {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-segment-btn.active,
body.dark .frd-segment-btn.active {
  background: var(--frd-dm-surface) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .frd-btn-para-llevar-top,
body.dark .frd-btn-para-llevar-top {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-btn-para-llevar-top:hover,
body.dark .frd-btn-para-llevar-top:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .frd-timbre-salon,
body.dark .frd-timbre-salon {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* Selector de Pisos / Niveles */
html[data-theme="dark"] .frd-rest-level-tab,
body.dark .frd-rest-level-tab {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-rest-level-tab:hover,
body.dark .frd-rest-level-tab:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-rest-level-tab.active,
body.dark .frd-rest-level-tab.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

/* Barra de pedidos en curso sin mesa */
html[data-theme="dark"] .frd-sin-mesa,
body.dark .frd-sin-mesa {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-sin-mesa-head span,
body.dark .frd-sin-mesa-head span {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-sin-mesa-pedido,
body.dark .frd-sin-mesa-pedido {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* Tarjeta Hero de Onboarding del Salón (Cuando no hay mesas) */
html[data-theme="dark"] .frd-onboarding-card,
body.dark .frd-onboarding-card {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .frd-onboarding-badge,
body.dark .frd-onboarding-badge {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  color: #93c5fd !important;
}

html[data-theme="dark"] .frd-onboarding-title,
body.dark .frd-onboarding-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-onboarding-subtitle,
body.dark .frd-onboarding-subtitle {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-onboarding-subtitle strong,
body.dark .frd-onboarding-subtitle strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-onboarding-step,
body.dark .frd-onboarding-step {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-onboarding-step:hover,
body.dark .frd-onboarding-step:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .frd-step-number,
body.dark .frd-step-number {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-step-title,
body.dark .frd-step-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-step-desc,
body.dark .frd-step-desc {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-btn-onboarding-sample,
body.dark .frd-btn-onboarding-sample {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-btn-onboarding-outline,
body.dark .frd-btn-onboarding-outline {
  background: transparent !important;
  border-color: var(--frd-dm-border) !important;
  color: #60a5fa !important;
}

/* Barra de herramientas del Diseñador (.frd-canvas-toolbar, .frd-toolbar-pill) */
html[data-theme="dark"] .frd-canvas-toolbar,
body.dark .frd-canvas-toolbar {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-toolbar-pill,
body.dark .frd-toolbar-pill {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-toolbar-pill span,
body.dark .frd-toolbar-pill span {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-autosave-indicator,
body.dark .frd-autosave-indicator {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* Tarjeta de Diseñador Vacío (.frd-canvas-empty-state) */
html[data-theme="dark"] .frd-canvas-empty-state,
body.dark .frd-canvas-empty-state {
  background: rgba(16, 24, 40, 0.96) !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .frd-canvas-empty-icon,
body.dark .frd-canvas-empty-icon {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}

html[data-theme="dark"] .frd-canvas-empty-badge,
body.dark .frd-canvas-empty-badge {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #93c5fd !important;
}

html[data-theme="dark"] .frd-canvas-empty-title,
body.dark .frd-canvas-empty-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-canvas-empty-desc,
body.dark .frd-canvas-empty-desc,
html[data-theme="dark"] .frd-canvas-empty-tips,
body.dark .frd-canvas-empty-tips {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-btn-center-sample,
body.dark .frd-btn-center-sample {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: #ffffff !important;
}

/* Mesas en el lienzo arquitectónico (.mesa-canvas-item) */
html[data-theme="dark"] .mesa-canvas-item,
body.dark .mesa-canvas-item {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .mesa-canvas-title,
body.dark .mesa-canvas-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .mesa-canvas-estado,
body.dark .mesa-canvas-estado {
  color: var(--frd-dm-text-muted) !important;
}

/* Modales de Crear / Editar Mesa y Niveles */
html[data-theme="dark"] #modal_nueva_mesa .modal-content,
html[data-theme="dark"] #modal_editar_mesa .modal-content,
html[data-theme="dark"] #modal_nuevo_nivel .modal-content,
html[data-theme="dark"] #modal_editar_nivel .modal-content,
html[data-theme="dark"] #modal_nuevo_elemento_canvas .modal-content,
body.dark #modal_nueva_mesa .modal-content,
body.dark #modal_editar_mesa .modal-content,
body.dark #modal_nuevo_nivel .modal-content,
body.dark #modal_editar_nivel .modal-content,
body.dark #modal_nuevo_elemento_canvas .modal-content {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] #modal_nueva_mesa .modal-header,
html[data-theme="dark"] #modal_editar_mesa .modal-header,
html[data-theme="dark"] #modal_nueva_mesa .modal-body,
html[data-theme="dark"] #modal_editar_mesa .modal-body,
body.dark #modal_nueva_mesa .modal-header,
body.dark #modal_editar_mesa .modal-header,
body.dark #modal_nueva_mesa .modal-body,
body.dark #modal_editar_mesa .modal-body {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] #modal_nueva_mesa .modal-title,
html[data-theme="dark"] #modal_editar_mesa .modal-title,
body.dark #modal_nueva_mesa .modal-title,
body.dark #modal_editar_mesa .modal-title {
  color: #ffffff !important;
}

html[data-theme="dark"] #modal_nueva_mesa label,
html[data-theme="dark"] #modal_editar_mesa label,
body.dark #modal_nueva_mesa label,
body.dark #modal_editar_mesa label {
  color: #ffffff !important;
}

/* Formas Geométricas en el Modal de Mesa (.frd-shape-card) */
html[data-theme="dark"] .frd-shape-card,
body.dark .frd-shape-card {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-shape-card:hover,
body.dark .frd-shape-card:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .frd-shape-card.is-selected,
body.dark .frd-shape-card.is-selected {
  background: rgba(37, 99, 235, 0.25) !important;
  border-color: #3b82f6 !important;
}

html[data-theme="dark"] .frd-shape-label,
body.dark .frd-shape-label {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-shape-pax,
body.dark .frd-shape-pax {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-pax-pill,
body.dark .frd-pax-pill {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-preset-chip,
body.dark .frd-preset-chip {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-preset-chip:hover,
body.dark .frd-preset-chip:hover {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-mesa-preview-box,
body.dark .frd-mesa-preview-box {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-preview-icon,
body.dark .frd-preview-icon {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

/* Modal de Pago POS: Bloque agregar método de pago y Más opciones */
body.dark #modal_payment .frd-pos-pay__add-wrap,
body.lockscreen.dark #modal_payment .frd-pos-pay__add-wrap,
html[data-theme="dark"] #modal_payment .frd-pos-pay__add-wrap,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__add-wrap {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
}

body.dark #modal_payment .frd-pos-pay__add-row,
body.lockscreen.dark #modal_payment .frd-pos-pay__add-row,
html[data-theme="dark"] #modal_payment .frd-pos-pay__add-row,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__add-row {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  color: #93c5fd !important;
}

body.dark #modal_payment .frd-pos-pay__add-row:hover,
body.dark #modal_payment .frd-pos-pay__add-row:focus,
body.lockscreen.dark #modal_payment .frd-pos-pay__add-row:hover,
body.lockscreen.dark #modal_payment .frd-pos-pay__add-row:focus,
html[data-theme="dark"] #modal_payment .frd-pos-pay__add-row:hover,
html[data-theme="dark"] #modal_payment .frd-pos-pay__add-row:focus,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__add-row:hover,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__add-row:focus {
  background: rgba(59, 130, 246, 0.28) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

body.dark #modal_payment .frd-pos-pay__add-row-help,
body.lockscreen.dark #modal_payment .frd-pos-pay__add-row-help,
html[data-theme="dark"] #modal_payment .frd-pos-pay__add-row-help,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay__add-row-help {
  color: var(--frd-dm-text-muted) !important;
}

body.dark #modal_payment .frd-pos-pay-more,
body.lockscreen.dark #modal_payment .frd-pos-pay-more,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
}

body.dark #modal_payment .frd-pos-pay-more > summary,
body.lockscreen.dark #modal_payment .frd-pos-pay-more > summary,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more > summary,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more > summary {
  color: #ffffff !important;
}

body.dark #modal_payment .frd-pos-pay-more > summary::after,
body.lockscreen.dark #modal_payment .frd-pos-pay-more > summary::after,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more > summary::after,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more > summary::after {
  border-right-color: #98a2b3 !important;
  border-bottom-color: #98a2b3 !important;
}

body.dark #modal_payment .frd-pos-pay-more--extra,
body.lockscreen.dark #modal_payment .frd-pos-pay-more--extra,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more--extra,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more--extra {
  background: rgba(59, 130, 246, 0.12) !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

body.dark #modal_payment .frd-pos-pay-more--extra > summary,
body.lockscreen.dark #modal_payment .frd-pos-pay-more--extra > summary,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more--extra > summary,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more--extra > summary {
  color: #93c5fd !important;
}

body.dark #modal_payment .frd-pos-pay-more--extra > summary::after,
body.lockscreen.dark #modal_payment .frd-pos-pay-more--extra > summary::after,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more--extra > summary::after,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more--extra > summary::after {
  border-right-color: #93c5fd !important;
  border-bottom-color: #93c5fd !important;
}

body.dark #modal_payment .frd-pos-pay-more__body label,
body.lockscreen.dark #modal_payment .frd-pos-pay-more__body label,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more__body label,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more__body label {
  color: #ffffff !important;
}

body.dark #modal_payment .frd-pos-pay-more__body textarea,
body.lockscreen.dark #modal_payment .frd-pos-pay-more__body textarea,
html[data-theme="dark"] #modal_payment .frd-pos-pay-more__body textarea,
html[data-theme="dark"] body.lockscreen #modal_payment .frd-pos-pay-more__body textarea {
  background-color: var(--frd-dm-input-bg) !important;
  border-color: var(--frd-dm-border-input) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   19. ADAPTACIÓN UNIVERSAL: /sells/create, /products/create, /business/settings,
       /repair/dashboard, /integrations, /user/profile, /users/create,
       /roles/create, /facturacion-electronica/certificar-empresa-v1,
       /accounting/chart-of-accounts
   ========================================================================== */

/* 19.1 Encabezados de página y títulos globales (Content Header) */
html[data-theme="dark"] .content-header,
body.dark .content-header {
  background: transparent !important;
}

html[data-theme="dark"] .content-header h1,
html[data-theme="dark"] .content-header h1 small,
body.dark .content-header h1,
body.dark .content-header h1 small {
  color: #ffffff !important;
}

/* 19.2 Ventas y Facturación Clásica (/sells/create) */
html[data-theme="dark"] .frd-sell-view,
body.dark .frd-sell-view {
  --frd-sell-border: var(--frd-dm-border) !important;
  --frd-sell-surface: var(--frd-dm-surface) !important;
  --frd-sell-surface-muted: var(--frd-dm-surface-elevated) !important;
  --frd-sell-text: #ffffff !important;
  --frd-sell-text-muted: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-sell-view .sell-section-card,
body.dark .frd-sell-view .sell-section-card {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 24, 40, 0.4) !important;
}

html[data-theme="dark"] .frd-sell-view .sell-section-header,
body.dark .frd-sell-view .sell-section-header {
  background: var(--frd-dm-surface-elevated) !important;
  border-bottom: 1px solid var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sell-view .sell-section-title,
body.dark .frd-sell-view .sell-section-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-sell-view .sell-section-body,
body.dark .frd-sell-view .sell-section-body,
html[data-theme="dark"] .frd-sell-view .sell-action-footer,
body.dark .frd-sell-view .sell-action-footer {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-sell-view .table > thead > tr > th,
body.dark .frd-sell-view .table > thead > tr > th {
  background: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sell-view .table > tbody > tr > td,
body.dark .frd-sell-view .table > tbody > tr > td {
  border-color: var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

/* 19.3 Configuración de Negocio (/business/settings) y Menú Pos-Tab */
html[data-theme="dark"] div.pos-tab-container,
body.dark div.pos-tab-container {
  background-color: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 24, 40, 0.4) !important;
}

html[data-theme="dark"] div.pos-tab-menu div.list-group > a,
body.dark div.pos-tab-menu div.list-group > a {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text-muted) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] div.pos-tab-menu div.list-group > a:hover,
body.dark div.pos-tab-menu div.list-group > a:hover {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] div.pos-tab-menu div.list-group > a.active,
body.dark div.pos-tab-menu div.list-group > a.active {
  background: linear-gradient(135deg, rgba(70, 95, 255, 0.25) 0%, rgba(59, 130, 246, 0.2) 100%) !important;
  color: #93c5fd !important;
  border-left: 3px solid #3b82f6 !important;
  font-weight: 700;
}

/* Pestañas de Ajustes de la empresa en móvil: degradado y flechas de scroll con los colores del tema oscuro,
   y pestañas como botones redondeados con la activa subrayada (antes: degradado blanco y borde izquierdo). */
@media (max-width: 767px) {
  html[data-theme="dark"] div.pos-tab-container.business-settings-tab-container .pos-tab-menu,
  body.dark div.pos-tab-container.business-settings-tab-container .pos-tab-menu {
    --frd-tabs-fade: 26, 34, 49;
  }

  html[data-theme="dark"] div.pos-tab-container.business-settings-tab-container .pos-tab-menu::before,
  body.dark div.pos-tab-container.business-settings-tab-container .pos-tab-menu::before {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 6l-6 6l6 6'/%3E%3C/svg%3E") no-repeat left 3px center / 16px 16px,
      linear-gradient(to right, rgba(26, 34, 49, .98) 55%, rgba(26, 34, 49, 0)) !important;
  }

  html[data-theme="dark"] div.pos-tab-container.business-settings-tab-container .pos-tab-menu::after,
  body.dark div.pos-tab-container.business-settings-tab-container .pos-tab-menu::after {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6l-6 6'/%3E%3C/svg%3E") no-repeat right 3px center / 16px 16px,
      linear-gradient(to left, rgba(26, 34, 49, 1) 55%, rgba(26, 34, 49, 0)) !important;
  }

  html[data-theme="dark"] div.pos-tab-container.business-settings-tab-container .pos-tab-menu .list-group > a,
  body.dark div.pos-tab-container.business-settings-tab-container .pos-tab-menu .list-group > a {
    border: 1px solid var(--frd-dm-border) !important;
    border-radius: 10px !important;
    font-weight: 600;
  }

  html[data-theme="dark"] div.pos-tab-container.business-settings-tab-container .pos-tab-menu .list-group > a.active,
  body.dark div.pos-tab-container.business-settings-tab-container .pos-tab-menu .list-group > a.active {
    border: 1px solid rgba(96, 165, 250, 0.55) !important;
    box-shadow: inset 0 -3px 0 #3b82f6;
  }
}

html[data-theme="dark"] div.pos-tab-content,
body.dark div.pos-tab-content {
  background-color: var(--frd-dm-surface) !important;
  color: var(--frd-dm-text) !important;
}

/* 19.4 Centro de Integraciones (/integrations) */
html[data-theme="dark"] .frd-int-hub,
body.dark .frd-int-hub {
  --frd-int-ring: var(--frd-dm-border) !important;
  --frd-int-text: #ffffff !important;
  --frd-int-muted: var(--frd-dm-text-muted) !important;
  background-color: transparent !important;
}

html[data-theme="dark"] .frd-int-promo,
body.dark .frd-int-promo {
  background: linear-gradient(135deg, #131d2e 0%, #1a2231 100%) !important;
  border: 1px solid var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-int-promo__title,
body.dark .frd-int-promo__title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-int-promo__body,
body.dark .frd-int-promo__body {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-int-card,
body.dark .frd-int-card,
html[data-theme="dark"] .frd-int-item,
body.dark .frd-int-item {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-int-card:hover,
body.dark .frd-int-card:hover {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

/* 19.5 Tablero de Taller / Reparaciones (/repair/dashboard) */
html[data-theme="dark"] #repair-tour-kpis [style*="background:#fff"],
html[data-theme="dark"] #repair-tour-kpis [style*="background: #fff"],
html[data-theme="dark"] #repair-tour-kpis [style*="background: white"],
body.dark #repair-tour-kpis [style*="background:#fff"],
body.dark #repair-tour-kpis [style*="background: #fff"],
body.dark #repair-tour-kpis [style*="background: white"] {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] #repair-tour-kpis [style*="color:#0f172a"],
html[data-theme="dark"] #repair-tour-kpis [style*="color: #0f172a"],
body.dark #repair-tour-kpis [style*="color:#0f172a"],
body.dark #repair-tour-kpis [style*="color: #0f172a"] {
  color: #ffffff !important;
}

html[data-theme="dark"] [data-repair-tour-start],
body.dark [data-repair-tour-start] {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}

/* 19.6 Perfil de Usuario y Seguridad (/user/profile, /user/profile#security) */
html[data-theme="dark"] .frd-profile-page,
body.dark .frd-profile-page {
  --frd-profile-border: var(--frd-dm-border) !important;
  --frd-profile-surface: var(--frd-dm-surface) !important;
  --frd-profile-muted: var(--frd-dm-text-muted) !important;
  --frd-profile-text: #ffffff !important;
}

html[data-theme="dark"] .frd-profile-card,
body.dark .frd-profile-card {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 24, 40, 0.4) !important;
}

html[data-theme="dark"] .frd-profile-card__header,
body.dark .frd-profile-card__header {
  border-bottom: 1px solid var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-profile-nav a,
body.dark .frd-profile-nav a {
  color: var(--frd-dm-text-muted) !important;
  background: transparent !important;
}

html[data-theme="dark"] .frd-profile-nav a.active,
html[data-theme="dark"] .frd-profile-nav a:hover,
body.dark .frd-profile-nav a.active,
body.dark .frd-profile-nav a:hover {
  background: var(--frd-dm-surface-elevated) !important;
  color: #ffffff !important;
}

/* 19.7 Botones de Acción Guardar y Formularios (/users/create, /roles/create) */
html[data-theme="dark"] .tw-dw-btn-primary,
body.dark .tw-dw-btn-primary {
  background-color: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .tw-dw-btn-primary:hover,
html[data-theme="dark"] .tw-dw-btn-primary:focus,
body.dark .tw-dw-btn-primary:hover,
body.dark .tw-dw-btn-primary:focus {
  background-color: #1d4ed8 !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-role-perm-toolbar,
body.dark .frd-role-perm-toolbar {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border) !important;
}

/* 19.8 Proceso de Certificación DGII (/facturacion-electronica/certificar-empresa-v1) */
html[data-theme="dark"] .fe-wizard-scope,
body.dark .fe-wizard-scope {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .fe-header-card,
body.dark .fe-header-card,
html[data-theme="dark"] .fe-card,
body.dark .fe-card,
html[data-theme="dark"] .fe-box,
body.dark .fe-box {
  background: var(--frd-dm-surface) !important;
  border: 1px solid var(--frd-dm-border) !important;
  color: var(--frd-dm-text) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 24, 40, 0.4) !important;
}

html[data-theme="dark"] .fe-step-nav,
body.dark .fe-step-nav {
  background: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .fe-step-title,
body.dark .fe-step-title {
  color: #ffffff !important;
}

/* 19.9 Catálogo de Cuentas Contables (/accounting/chart-of-accounts) */
html[data-theme="dark"] .jstree-default .jstree-wholerow,
body.dark .jstree-default .jstree-wholerow {
  background: transparent !important;
}

html[data-theme="dark"] .jstree-default .jstree-wholerow-hovered,
body.dark .jstree-default .jstree-wholerow-hovered {
  background: var(--frd-dm-surface-elevated) !important;
}

html[data-theme="dark"] .jstree-default .jstree-wholerow-clicked,
body.dark .jstree-default .jstree-wholerow-clicked {
  background: rgba(59, 130, 246, 0.2) !important;
}

html[data-theme="dark"] .jstree-default .jstree-anchor,
body.dark .jstree-default .jstree-anchor {
  color: #ffffff !important;
}

html[data-theme="dark"] .jstree-default .jstree-themeicon,
body.dark .jstree-default .jstree-themeicon {
  filter: brightness(0) invert(1);
}







/* ==========================================================================
   AUDITORÍA DE CONTRASTE (WCAG 2.2 AA: 4.5:1 texto normal, 3:1 texto grande)
   Componentes que fijaban colores claros y no tenían variante oscura.
   ========================================================================== */

/* Títulos: vendor.css fija h1-h6 en #32325d. :where() deja la especificidad igual a
   la de vendor (solo gana por orden), así cualquier título con color propio lo conserva. */
:where(html[data-theme="dark"], body.dark) :is(h1, h2, h3, h4, h5, h6) {
  color: var(--frd-dm-text);
}

/* Texto secundario de Bootstrap (#777 / #737373) */
html[data-theme="dark"] :is(.text-muted, .help-block),
body.dark :is(.text-muted, .help-block) {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .nav-tabs > li:not(.active) > a,
body.dark .nav-tabs > li:not(.active) > a {
  color: var(--frd-dm-text-muted);
}

html[data-theme="dark"] .navbar-default .navbar-nav > li > a,
html[data-theme="dark"] .navbar-default .navbar-brand,
body.dark .navbar-default .navbar-nav > li > a,
body.dark .navbar-default .navbar-brand {
  color: var(--frd-dm-text-muted);
}

/* --- Paridad con las utilidades Tailwind v4 (tw:) --- */
html[data-theme="dark"] :is(.tw\:bg-white, .tw\:bg-gray-100, .tw\:bg-gray-50\/80, .tw\:bg-slate-50\/80),
body.dark :is(.tw\:bg-white, .tw\:bg-gray-100, .tw\:bg-gray-50\/80, .tw\:bg-slate-50\/80) {
  background-color: var(--frd-dm-surface-elevated) !important;
}

html[data-theme="dark"] .tw\:bg-white\/60,
body.dark .tw\:bg-white\/60 {
  background-color: rgba(26, 34, 49, 0.6) !important;
}

html[data-theme="dark"] .tw\:bg-slate-200,
body.dark .tw\:bg-slate-200 {
  background-color: var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] :is(.tw\:hover\:bg-slate-50\/80, .tw\:hover\:bg-slate-100, .tw\:hover\:bg-slate-200, .tw\:hover\:bg-slate-300):hover,
body.dark :is(.tw\:hover\:bg-slate-50\/80, .tw\:hover\:bg-slate-100, .tw\:hover\:bg-slate-200, .tw\:hover\:bg-slate-300):hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .tw\:hover\:border-slate-300:hover,
body.dark .tw\:hover\:border-slate-300:hover {
  border-color: var(--frd-dm-border-input) !important;
}

html[data-theme="dark"] .tw\:text-gray-900,
body.dark .tw\:text-gray-900 {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] :is(.tw\:text-slate-400, .tw\:hover\:text-slate-600:hover),
body.dark :is(.tw\:text-slate-400, .tw\:hover\:text-slate-600:hover) {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .tw\:ring-gray-200,
body.dark .tw\:ring-gray-200 {
  --tw-ring-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .tw\:divide-slate-100 > :not(:last-child),
body.dark .tw\:divide-slate-100 > :not(:last-child) {
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .tw\:from-blue-50,
body.dark .tw\:from-blue-50 {
  --tw-gradient-from: rgba(59, 130, 246, 0.14) !important;
}

html[data-theme="dark"] .tw\:via-indigo-50,
body.dark .tw\:via-indigo-50 {
  --tw-gradient-via: rgba(99, 102, 241, 0.1) !important;
}

html[data-theme="dark"] .tw\:to-white,
body.dark .tw\:to-white {
  --tw-gradient-to: var(--frd-dm-surface) !important;
}

html[data-theme="dark"] .tw\:border-blue-200,
body.dark .tw\:border-blue-200 {
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* ==========================================================================
   MODAL DE ACCIONES RÁPIDAS (+) EN DARK MODE (TailAdmin Architecture)
   ========================================================================== */
html[data-theme="dark"] .frd-hdr-dropdown__menu,
html.dark .frd-hdr-dropdown__menu,
body.dark .frd-hdr-dropdown__menu {
  background-color: var(--frd-dm-surface, #1a2231) !important;
  border: 1px solid var(--frd-dm-border, #1d2939) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .frd-hdr-create-menu,
html.dark .frd-hdr-create-menu,
body.dark .frd-hdr-create-menu {
  background-color: var(--frd-dm-surface, #1a2231) !important;
  border: 1px solid var(--frd-dm-border, #1d2939) !important;
}

html[data-theme="dark"] .frd-hdr-create-menu__head,
html.dark .frd-hdr-create-menu__head,
body.dark .frd-hdr-create-menu__head {
  border-bottom: 1px solid var(--frd-dm-border, #1d2939) !important;
}

html[data-theme="dark"] :is(.frd-hdr-dropdown__item, .frd-hdr-dropdown__item--button),
html.dark :is(.frd-hdr-dropdown__item, .frd-hdr-dropdown__item--button),
body.dark :is(.frd-hdr-dropdown__item, .frd-hdr-dropdown__item--button) {
  color: var(--frd-dm-text, #f1f5f9) !important;
}

html[data-theme="dark"] :is(.frd-hdr-dropdown__item svg, .frd-hdr-dropdown__item i, .frd-hdr-dropdown__header-label),
html.dark :is(.frd-hdr-dropdown__item svg, .frd-hdr-dropdown__item i, .frd-hdr-dropdown__header-label),
body.dark :is(.frd-hdr-dropdown__item svg, .frd-hdr-dropdown__item i, .frd-hdr-dropdown__header-label) {
  color: var(--frd-dm-text-muted, #94a3b8) !important;
}

html[data-theme="dark"] :is(.frd-hdr-dropdown__item:hover, .frd-hdr-dropdown__item:focus),
html.dark :is(.frd-hdr-dropdown__item:hover, .frd-hdr-dropdown__item:focus),
body.dark :is(.frd-hdr-dropdown__item:hover, .frd-hdr-dropdown__item:focus) {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] :is(.frd-hdr-create-menu__title, .frd-hdr-dropdown__header-name),
html.dark :is(.frd-hdr-create-menu__title, .frd-hdr-dropdown__header-name),
body.dark :is(.frd-hdr-create-menu__title, .frd-hdr-dropdown__header-name) {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-hdr-create-menu__eyebrow,
html.dark .frd-hdr-create-menu__eyebrow,
body.dark .frd-hdr-create-menu__eyebrow {
  color: var(--frd-theme-btn-from, #60a5fa) !important;
}

/* Secciones agrupadoras */
html[data-theme="dark"] .frd-hdr-create-section,
html.dark .frd-hdr-create-section,
body.dark .frd-hdr-create-section {
  background-color: var(--frd-dm-input-bg, #101828) !important;
  border: 1px solid var(--frd-dm-border, #1d2939) !important;
}

html[data-theme="dark"] .frd-hdr-create-section__title,
html.dark .frd-hdr-create-section__title,
body.dark .frd-hdr-create-section__title {
  color: #94a3b8 !important;
}

/* Tarjetas individuales dentro de cada sección en Dark Mode */
html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item {
  background-color: var(--frd-dm-surface, #1e293b) !important;
  border: 1px solid var(--frd-dm-border-input, #334155) !important;
  color: #f8fafc !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item span,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item span,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item span {
  color: #f8fafc !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item i,
html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item svg,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item i,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item svg,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item i,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item svg {
  color: var(--frd-theme-btn-from, #60a5fa) !important;
}

html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item:hover,
html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item:focus,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:focus,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:focus {
  background-color: #27354a !important;
  border-color: var(--frd-theme-btn-from, #3b82f6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25) !important;
}

html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item:hover span,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover span,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover span {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item:hover i,
html[data-theme="dark"] .frd-hdr-create-grid .frd-hdr-dropdown__item:hover svg,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover i,
html.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover svg,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover i,
body.dark .frd-hdr-create-grid .frd-hdr-dropdown__item:hover svg {
  color: #93c5fd !important;
}

/* Botón (+) de Crear en el header */
html[data-theme="dark"] .frd-hdr-btn-create,
html.dark .frd-hdr-btn-create,
body.dark .frd-hdr-btn-create {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
  border-color: var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .frd-hdr-create-dropdown[open] > .frd-hdr-btn-create,
html.dark .frd-hdr-create-dropdown[open] > .frd-hdr-btn-create,
body.dark .frd-hdr-create-dropdown[open] > .frd-hdr-btn-create,
html[data-theme="dark"] .frd-hdr-btn-create:hover,
html.dark .frd-hdr-btn-create:hover,
body.dark .frd-hdr-btn-create:hover {
  background-color: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  border-color: var(--frd-theme-btn-from, #3b82f6) !important;
}

html[data-theme="dark"] .frd-hdr-create-menu__close,
html.dark .frd-hdr-create-menu__close,
body.dark .frd-hdr-create-menu__close {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .frd-hdr-create-menu__close:hover,
html[data-theme="dark"] .frd-hdr-create-menu__close:focus,
html.dark .frd-hdr-create-menu__close:hover,
html.dark .frd-hdr-create-menu__close:focus,
body.dark .frd-hdr-create-menu__close:hover,
body.dark .frd-hdr-create-menu__close:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Scrollbar en modo oscuro para el menú de creación */
html[data-theme="dark"] .frd-hdr-create-menu::-webkit-scrollbar-thumb,
html.dark .frd-hdr-create-menu::-webkit-scrollbar-thumb,
body.dark .frd-hdr-create-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}
html[data-theme="dark"] .frd-hdr-create-menu::-webkit-scrollbar-thumb:hover,
html.dark .frd-hdr-create-menu::-webkit-scrollbar-thumb:hover,
body.dark .frd-hdr-create-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* --- Popover de la suscripción (botón del plan en el header) --- */
html[data-theme="dark"] .popover.popover-subscription,
body.dark .popover.popover-subscription {
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .popover.popover-subscription .popover-title,
body.dark .popover.popover-subscription .popover-title {
  color: #ffffff !important;
  background: var(--frd-dm-surface) !important;
  border-bottom-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .popover.popover-subscription .subscription-card,
html[data-theme="dark"] .popover.popover-subscription .subscription-card .text-dark,
body.dark .popover.popover-subscription .subscription-card,
body.dark .popover.popover-subscription .subscription-card .text-dark {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .popover.popover-subscription .sub-date-info,
body.dark .popover.popover-subscription .sub-date-info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
}

html[data-theme="dark"] .popover.popover-subscription .progress-tiny,
body.dark .popover.popover-subscription .progress-tiny {
  background: var(--frd-dm-border-input) !important;
}

html[data-theme="dark"] .popover.popover-subscription .limit-infinite,
body.dark .popover.popover-subscription .limit-infinite {
  color: #4ade80;
}

/* --- Avisos globales (barra superior) --- */
html[data-theme="dark"] .avisos-topo-stack :is(.alert-info, .alert-primary),
body.dark .avisos-topo-stack :is(.alert-info, .alert-primary) {
  --aviso-bg: rgba(59, 130, 246, 0.12);
  --aviso-border: rgba(59, 130, 246, 0.3);
  --aviso-text: #93c5fd;
}

html[data-theme="dark"] .avisos-topo-stack .alert-success,
body.dark .avisos-topo-stack .alert-success {
  --aviso-bg: rgba(34, 197, 94, 0.12);
  --aviso-border: rgba(34, 197, 94, 0.3);
  --aviso-text: #86efac;
}

html[data-theme="dark"] .avisos-topo-stack .alert-warning,
body.dark .avisos-topo-stack .alert-warning {
  --aviso-bg: rgba(245, 158, 11, 0.12);
  --aviso-border: rgba(245, 158, 11, 0.3);
  --aviso-text: #fcd34d;
}

html[data-theme="dark"] .avisos-topo-stack .alert-danger,
body.dark .avisos-topo-stack .alert-danger {
  --aviso-bg: rgba(239, 68, 68, 0.12);
  --aviso-border: rgba(239, 68, 68, 0.3);
  --aviso-text: #fca5a5;
}

/* --- Avatar sin foto en el menú lateral --- */
html[data-theme="dark"] .frd-sidebar-profile__avatar,
body.dark .frd-sidebar-profile__avatar {
  color: var(--frd-dm-text);
  background: var(--frd-dm-border-input);
}

/* --- Select2: sell-modern y css-v2 fuerzan fondo blanco con más especificidad --- */
html[data-theme="dark"] :is(body, .css-v2-form-scope, .frd-sell-view) .select2-container .select2-selection--single,
html[data-theme="dark"] :is(body, .css-v2-form-scope, .frd-sell-view) .input-group > .select2-container .select2-selection--single,
body.dark :is(.css-v2-form-scope, .frd-sell-view) .select2-container .select2-selection--single,
body.dark :is(.css-v2-form-scope, .frd-sell-view) .input-group > .select2-container .select2-selection--single {
  background-color: var(--frd-dm-input-bg) !important;
  border-color: var(--frd-dm-border-input) !important;
}

/* --- DataTables: "Mostrar", info y paginación deshabilitada --- */
html[data-theme="dark"] div.dataTables_wrapper :is(.dataTables_length label, .dataTables_info),
body.dark div.dataTables_wrapper :is(.dataTables_length label, .dataTables_info) {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single,
html.dark div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single,
body.dark div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single {
  background-color: var(--frd-dm-input-bg, #101828) !important;
  border: 1px solid var(--frd-dm-border-input, #334155) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
}

html[data-theme="dark"] div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single .select2-selection__rendered,
html.dark div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single .select2-selection__rendered,
body.dark div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--frd-dm-text, #f8fafc) !important;
}

html[data-theme="dark"] div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow b,
html.dark div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.dark div.dataTables_wrapper .dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #94a3b8 transparent transparent transparent !important;
}

html[data-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b,
html.dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b,
body.dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #94a3b8 transparent !important;
}

html[data-theme="dark"] div.dataTables_wrapper .dataTables_length select,
html.dark div.dataTables_wrapper .dataTables_length select,
body.dark div.dataTables_wrapper .dataTables_length select {
  background-color: var(--frd-dm-input-bg, #101828) !important;
  border: 1px solid var(--frd-dm-border-input, #334155) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2394a3b8' d='M0.8 0.8L4 4l3.2-3.2'/%3E%3C/svg%3E") !important;
}

html[data-theme="dark"] .select2-container--default .select2-dropdown.frd-dt-length-dropdown,
html.dark .select2-container--default .select2-dropdown.frd-dt-length-dropdown,
body.dark .select2-container--default .select2-dropdown.frd-dt-length-dropdown {
  background: var(--frd-dm-surface, #1e293b) !important;
  border: 1px solid var(--frd-dm-border, #334155) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .select2-container--default .frd-dt-length-dropdown .select2-results__option,
html.dark .select2-container--default .frd-dt-length-dropdown .select2-results__option,
body.dark .select2-container--default .frd-dt-length-dropdown .select2-results__option {
  color: var(--frd-dm-text, #f8fafc) !important;
}

html[data-theme="dark"] .select2-container--default .frd-dt-length-dropdown .select2-results__option--highlighted[aria-selected],
html.dark .select2-container--default .frd-dt-length-dropdown .select2-results__option--highlighted[aria-selected],
body.dark .select2-container--default .frd-dt-length-dropdown .select2-results__option--highlighted[aria-selected] {
  background-color: var(--frd-theme-btn-from, #3b82f6) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] :is(.pagination, .dataTables_wrapper .dataTables_paginate .pagination),
body.dark :is(.pagination, .dataTables_wrapper .dataTables_paginate .pagination) {
  background-color: var(--frd-dm-surface) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] :is(.pagination > .disabled > a, .pagination > .disabled > span, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled > a),
body.dark :is(.pagination > .disabled > a, .pagination > .disabled > span, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled > a) {
  color: var(--frd-dm-text-muted) !important;
}

/* Enlaces sin color propio: el #3c8dbc de AdminLTE queda en 4.35:1 sobre las superficies oscuras. */
:where(html[data-theme="dark"], body.dark) a {
  color: #60a5fa;
}

/* --- Agregar / editar venta --- */
html[data-theme="dark"] .frd-sell-view :is(.sell-totals-panel, .sell-products-empty),
body.dark .frd-sell-view :is(.sell-totals-panel, .sell-products-empty) {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border) !important;
}

html[data-theme="dark"] .frd-sell-view :is(.sell-totals-row, .sell-products-empty p),
body.dark .frd-sell-view :is(.sell-totals-row, .sell-products-empty p) {
  color: var(--frd-dm-text-muted);
}

html[data-theme="dark"] .frd-sell-view .sell-totals-row.is-net,
body.dark .frd-sell-view .sell-totals-row.is-net {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}

html[data-theme="dark"] .frd-sell-view .sell-totals-row.is-net :is(.net-label, .net-sublabel, .net-amount),
body.dark .frd-sell-view .sell-totals-row.is-net :is(.net-label, .net-sublabel, .net-amount) {
  color: #86efac;
}

html[data-theme="dark"] .css-v2-form-scope :is(.item-kind-card, .item-kind-card-radio),
body.dark .css-v2-form-scope :is(.item-kind-card, .item-kind-card-radio) {
  background-color: var(--frd-dm-surface-elevated);
  border-color: var(--frd-dm-border-input);
}

html[data-theme="dark"] .css-v2-form-scope .item-kind-card-desc,
body.dark .css-v2-form-scope .item-kind-card-desc {
  color: var(--frd-dm-text-muted);
}

/* --- Mi perfil --- */
html[data-theme="dark"] .frd-profile-page :is(.frd-profile-card__header, .frd-profile-card--collapsible .frd-profile-card__header:hover),
body.dark .frd-profile-page :is(.frd-profile-card__header, .frd-profile-card--collapsible .frd-profile-card__header:hover) {
  background: var(--frd-dm-surface) !important;
}

html[data-theme="dark"] .frd-profile-page .frd-profile-card__footer,
body.dark .frd-profile-page .frd-profile-card__footer {
  background: var(--frd-dm-surface-elevated) !important;
}

html[data-theme="dark"] .frd-profile-page .frd-profile-nav-tab:not(.active),
body.dark .frd-profile-page .frd-profile-nav-tab:not(.active) {
  color: var(--frd-dm-text-muted);
}

html[data-theme="dark"] .frd-profile-page .frd-profile-nav-tab.active,
html[data-theme="dark"] .frd-profile-page .frd-profile-nav-tab.active svg,
body.dark .frd-profile-page .frd-profile-nav-tab.active,
body.dark .frd-profile-page .frd-profile-nav-tab.active svg {
  color: color-mix(in srgb, var(--frd-theme-btn-from, #3b82f6) 55%, #ffffff) !important;
}

/* --- Hub de facturación electrónica --- */
html[data-theme="dark"] :is(.fe-title, .fe-subtitle),
body.dark :is(.fe-title, .fe-subtitle) {
  color: #ffffff;
}

html[data-theme="dark"] .fe-title-highlight,
body.dark .fe-title-highlight {
  color: color-mix(in srgb, var(--fe-theme-color, #9333ea) 55%, #ffffff);
}

html[data-theme="dark"] .fe-prereq-item,
body.dark .fe-prereq-item {
  color: var(--frd-dm-text-muted);
  border-color: var(--frd-dm-border);
}

html[data-theme="dark"] .fe-active-banner,
body.dark .fe-active-banner {
  background: var(--frd-dm-surface-elevated);
}

html[data-theme="dark"] .btn-fe-resume,
body.dark .btn-fe-resume {
  background: transparent;
  color: color-mix(in srgb, var(--fe-theme-color, #9333ea) 55%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--fe-theme-color, #9333ea) 55%, #ffffff);
}

/* --- Píldoras de estado (frd-badge-status y .label): fondo translúcido en oscuro --- */
html[data-theme="dark"] .label:not(.notifications_count):not(.main-header .label):not(.main-sidebar .label),
body.dark .label:not(.notifications_count):not(.main-header .label):not(.main-sidebar .label) {
  background-color: rgba(152, 162, 179, 0.12) !important;
  color: #d0d5dd !important;
  border-color: rgba(152, 162, 179, 0.28) !important;
}

html[data-theme="dark"] :is(.frd-status-paid, .frd-status-received, .frd-status-delivered, .frd-status-approved, .frd-status-active),
html[data-theme="dark"] .label:is(.bg-green, .bg-green-active, .bg-light-green, .bg-olive, .label-success):not(.notifications_count):not(.main-header .label):not(.main-sidebar .label),
body.dark :is(.frd-status-paid, .frd-status-received, .frd-status-delivered, .frd-status-approved, .frd-status-active) {
  background-color: rgba(34, 197, 94, 0.14) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, 0.32) !important;
}

html[data-theme="dark"] :is(.frd-status-partial),
html[data-theme="dark"] .label:is(.bg-yellow, .bg-yellow-active, .bg-orange, .label-warning):not(.notifications_count):not(.main-header .label):not(.main-sidebar .label),
body.dark .frd-status-partial {
  background-color: rgba(245, 158, 11, 0.14) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
}

html[data-theme="dark"] :is(.frd-status-due, .frd-status-overdue, .frd-status-cancelled, .frd-status-declined, .frd-status-pending, .frd-status-inactive),
html[data-theme="dark"] .label:is(.bg-red, .bg-red-active, .bg-maroon, .label-danger):not(.notifications_count):not(.main-header .label):not(.main-sidebar .label),
body.dark :is(.frd-status-due, .frd-status-overdue, .frd-status-cancelled, .frd-status-declined, .frd-status-pending, .frd-status-inactive) {
  background-color: rgba(239, 68, 68, 0.14) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.32) !important;
}

html[data-theme="dark"] :is(.frd-status-ordered, .frd-status-waiting, .frd-status-packed),
html[data-theme="dark"] .label:is(.bg-info, .bg-aqua, .bg-light-blue, .bg-blue, .bg-primary, .label-info, .label-primary):not(.notifications_count):not(.main-header .label):not(.main-sidebar .label),
body.dark :is(.frd-status-ordered, .frd-status-waiting, .frd-status-packed) {
  background-color: rgba(59, 130, 246, 0.14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.32) !important;
}

html[data-theme="dark"] .frd-status-shipped,
html[data-theme="dark"] .label:is(.bg-purple, .bg-navy):not(.notifications_count):not(.main-header .label):not(.main-sidebar .label),
body.dark .frd-status-shipped {
  background-color: rgba(99, 102, 241, 0.16) !important;
  color: #c7d2fe !important;
  border-color: rgba(99, 102, 241, 0.34) !important;
}

html[data-theme="dark"] .frd-status-other,
body.dark .frd-status-other {
  background-color: rgba(152, 162, 179, 0.12) !important;
  color: #d0d5dd !important;
  border-color: rgba(152, 162, 179, 0.28) !important;
}

html[data-theme="dark"] .frd-profile-card__eyebrow,
body.dark .frd-profile-card__eyebrow {
  color: color-mix(in srgb, var(--frd-profile-accent, #3b82f6) 45%, #ffffff);
}

/* Paginación activa de DataTables: app.css fija #475569 con (0,4,1) !important. */
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:not(.disabled):not(.active) > a,
body.dark .dataTables_wrapper .dataTables_paginate .paginate_button:not(.disabled):not(.active) > a {
  color: var(--frd-dm-text) !important;
}

/* Barra de navegación de los módulos (Superadmin, etc.) */
html[data-theme="dark"] .navbar-default,
body.dark .navbar-default {
  background-color: var(--frd-dm-surface);
  border-color: var(--frd-dm-border);
}

html[data-theme="dark"] .navbar-default .navbar-nav > .active > a,
html[data-theme="dark"] .navbar-default .navbar-nav > .active > a:is(:hover, :focus),
body.dark .navbar-default .navbar-nav > .active > a,
body.dark .navbar-default .navbar-nav > .active > a:is(:hover, :focus) {
  color: #ffffff;
  background-color: var(--frd-dm-surface-elevated);
}

/* ==========================================================================
   MODAL DETALLES DE VENTA (.frd-sell-detail) EN MODO OSCURO
   ========================================================================== */
html[data-theme="dark"] .frd-sell-detail .modal-content,
body.dark .frd-sell-detail .modal-content {
  background-color: var(--frd-dm-surface, #101828) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
}

html[data-theme="dark"] .frd-sell-detail .modal-header,
html[data-theme="dark"] .frd-sell-detail .modal-footer,
body.dark .frd-sell-detail .modal-header,
body.dark .frd-sell-detail .modal-footer {
  background-color: var(--frd-dm-surface, #101828) !important;
  border-color: var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
}

/* Tablas de productos vendidos e información de pago */
html[data-theme="dark"] .frd-sell-detail .table.bg-gray,
html[data-theme="dark"] .frd-sell-detail .table.bg-light-gray,
body.dark .frd-sell-detail .table.bg-gray,
body.dark .frd-sell-detail .table.bg-light-gray {
  background-color: var(--frd-dm-surface, #101828) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .frd-sell-detail tr.bg-green,
html[data-theme="dark"] .frd-sell-detail tr.bg-green > th,
body.dark .frd-sell-detail tr.bg-green,
body.dark .frd-sell-detail tr.bg-green > th {
  background-color: var(--frd-dm-surface-elevated, #162032) !important;
  color: #ffffff !important;
  border-color: var(--frd-dm-border, #1f2a37) !important;
  border-bottom: 2px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .frd-sell-detail .table > tbody > tr > td,
html[data-theme="dark"] .frd-sell-detail .table > tbody > tr > th,
body.dark .frd-sell-detail .table > tbody > tr > td,
body.dark .frd-sell-detail .table > tbody > tr > th {
  border-color: var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  background-color: transparent !important;
}

html[data-theme="dark"] .frd-sell-detail .table > tbody > tr:nth-of-type(even),
body.dark .frd-sell-detail .table > tbody > tr:nth-of-type(even) {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

html[data-theme="dark"] .frd-sell-detail .table > tbody > tr:hover,
body.dark .frd-sell-detail .table > tbody > tr:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Desglose de totales */
html[data-theme="dark"] .frd-sell-detail .frd-sell-detail__payable,
body.dark .frd-sell-detail .frd-sell-detail__payable {
  background-color: rgba(37, 99, 235, 0.14) !important;
}

html[data-theme="dark"] .frd-sell-detail .frd-sell-detail__payable th,
html[data-theme="dark"] .frd-sell-detail .frd-sell-detail__payable td,
body.dark .frd-sell-detail .frd-sell-detail__payable th,
body.dark .frd-sell-detail .frd-sell-detail__payable td {
  color: #93c5fd !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .frd-sell-detail .frd-sell-detail__due,
body.dark .frd-sell-detail .frd-sell-detail__due {
  background-color: rgba(239, 68, 68, 0.14) !important;
}

html[data-theme="dark"] .frd-sell-detail .frd-sell-detail__due th,
html[data-theme="dark"] .frd-sell-detail .frd-sell-detail__due td,
body.dark .frd-sell-detail .frd-sell-detail__due th,
body.dark .frd-sell-detail .frd-sell-detail__due td {
  color: #fca5a5 !important;
  font-weight: 700 !important;
}

/* Notas / Well */
html[data-theme="dark"] .frd-sell-detail .well.bg-gray,
body.dark .frd-sell-detail .well.bg-gray {
  background-color: var(--frd-dm-surface-elevated, #162032) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #e2e8f0) !important;
}

/* Tarjeta DGII en show */
html[data-theme="dark"] .frd-dgii-card,
body.dark .frd-dgii-card {
  background-color: var(--frd-dm-surface-elevated, #162032) !important;
  border-color: var(--frd-dm-border, #1f2a37) !important;
}

/* ==========================================================================
   MODAL ESTADO DGII (.dgii-status-modal) EN MODO OSCURO
   ========================================================================== */
html[data-theme="dark"] .dgii-status-modal .modal-content,
body.dark .dgii-status-modal .modal-content {
  background-color: var(--frd-dm-surface, #101828) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-modal-header,
body.dark .dgii-status-modal .dgii-modal-header {
  background-color: var(--frd-dm-surface, #101828) !important;
  border-bottom: 1px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-header-info h2,
body.dark .dgii-status-modal .dgii-header-info h2 {
  color: #ffffff !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-header-info span,
body.dark .dgii-status-modal .dgii-header-info span {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-financial-metrics > div,
body.dark .dgii-status-modal .dgii-financial-metrics > div {
  border-color: var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-financial-metrics span:last-child,
body.dark .dgii-status-modal .dgii-financial-metrics span:last-child {
  color: #f8fafc !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-modal-body,
body.dark .dgii-status-modal .dgii-modal-body {
  background-color: var(--frd-dm-surface, #101828) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-logo-section,
body.dark .dgii-status-modal .dgii-logo-section {
  border-color: var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-logo-section h3,
body.dark .dgii-status-modal .dgii-logo-section h3 {
  color: #ffffff !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-info-section,
body.dark .dgii-status-modal .dgii-info-section {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-info-section h4,
body.dark .dgii-status-modal .dgii-info-section h4 {
  color: #ffffff !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-details-grid dt,
body.dark .dgii-status-modal .dgii-details-grid dt {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-details-grid dd,
body.dark .dgii-status-modal .dgii-details-grid dd {
  color: #f8fafc !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-download-link,
body.dark .dgii-status-modal .dgii-download-link {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-download-link:hover,
body.dark .dgii-status-modal .dgii-download-link:hover {
  background: #1e293b !important;
  border-color: #3b82f6 !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-download-link span:first-child,
body.dark .dgii-status-modal .dgii-download-link span:first-child {
  color: #ffffff !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-download-link span:last-child,
body.dark .dgii-status-modal .dgii-download-link span:last-child {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-info-section > div[style*="blur"],
body.dark .dgii-status-modal .dgii-info-section > div[style*="blur"] {
  opacity: 0.08 !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-modal-footer,
body.dark .dgii-status-modal .dgii-modal-footer {
  background: #0d1424 !important;
  border-top: 1px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .dgii-status-modal .dgii-modal-footer span,
body.dark .dgii-status-modal .dgii-modal-footer span {
  color: #94a3b8 !important;
}

/* ==========================================================================
   BOTONES DE COLOR DEL TEMA EN MODO OSCURO
   ========================================================================== */
html[data-theme="dark"] body.skin-primary,
html[data-theme="dark"] body.skin-blue-light,
body.dark.skin-primary,
body.dark.skin-blue-light {
  --frd-theme-btn-from: #2563eb;
  --frd-theme-btn-to: #1d4ed8;
  --frd-theme-btn-glow: rgba(37, 99, 235, 0.4);
}

html[data-theme="dark"] body.skin-purple,
body.dark.skin-purple {
  --frd-theme-btn-from: #7e22ce;
  --frd-theme-btn-to: #6b21a8;
  --frd-theme-btn-glow: rgba(126, 34, 206, 0.4);
}

html[data-theme="dark"] body.skin-green,
body.dark.skin-green {
  --frd-theme-btn-from: #15803d;
  --frd-theme-btn-to: #166534;
  --frd-theme-btn-glow: rgba(21, 128, 61, 0.4);
}

html[data-theme="dark"] body.skin-red,
body.dark.skin-red {
  --frd-theme-btn-from: #b91c1c;
  --frd-theme-btn-to: #991b1b;
  --frd-theme-btn-glow: rgba(185, 28, 28, 0.4);
}

html[data-theme="dark"] body.skin-yellow,
body.dark.skin-yellow {
  --frd-theme-btn-from: #d97706;
  --frd-theme-btn-to: #b45309;
  --frd-theme-btn-glow: rgba(217, 119, 6, 0.4);
}

html[data-theme="dark"] body.skin-orange,
body.dark.skin-orange {
  --frd-theme-btn-from: #ea580c;
  --frd-theme-btn-to: #c2410c;
  --frd-theme-btn-glow: rgba(234, 88, 12, 0.4);
}

html[data-theme="dark"] body.skin-sky,
body.dark.skin-sky {
  --frd-theme-btn-from: #0284c7;
  --frd-theme-btn-to: #0369a1;
  --frd-theme-btn-glow: rgba(2, 132, 199, 0.4);
}

/* Resalte sutil y glow en botones principales de tema */
html[data-theme="dark"] .frd-btn--primary,
html[data-theme="dark"] .tw-dw-btn.tw-bg-gradient-to-r.tw-from-indigo-600.tw-to-blue-500,
body.dark .frd-btn--primary,
body.dark .tw-dw-btn.tw-bg-gradient-to-r.tw-from-indigo-600.tw-to-blue-500 {
  box-shadow: 0 4px 14px var(--frd-theme-btn-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Botones secundarios en Dark Mode: evitar el blanco plano */
html[data-theme="dark"] .frd-btn--secondary,
html[data-theme="dark"] .btn-default,
body.dark .frd-btn--secondary,
body.dark .btn-default {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  border: 1px solid var(--frd-dm-border, #334155) !important;
}

html[data-theme="dark"] .frd-btn--secondary:hover,
html[data-theme="dark"] .btn-default:hover,
body.dark .frd-btn--secondary:hover,
body.dark .btn-default:hover {
  background: var(--frd-dm-input-bg, #1e293b) !important;
  border-color: var(--frd-theme-btn-from, #3b82f6) !important;
  color: #ffffff !important;
}

/* Selector de colores de apariencia en Dark Mode */
html[data-theme="dark"] .frd-appearance-modal__dialog,
body.dark .frd-appearance-modal__dialog {
  background: var(--frd-dm-surface, #101828) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
}

html[data-theme="dark"] .frd-appearance-modal__title,
body.dark .frd-appearance-modal__title {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-appearance-theme,
body.dark .frd-appearance-theme {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .frd-appearance-theme:hover:not(:disabled),
body.dark .frd-appearance-theme:hover:not(:disabled) {
  background: var(--frd-dm-input-bg, #1e293b) !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .frd-appearance-theme.is-active,
body.dark .frd-appearance-theme.is-active {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  border-color: var(--frd-theme-swatch-from, #3b82f6) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--frd-theme-swatch-from, #3b82f6) 35%, transparent) !important;
}

html[data-theme="dark"] .frd-appearance-theme__label,
body.dark .frd-appearance-theme__label {
  color: #f1f5f9 !important;
}

/* ==========================================================================
   MENÚ DE OPCIONES MÓVIL EN DARK MODE
   ========================================================================== */
html[data-theme="dark"] .frd-hdr-mobile-menu,
body.dark .frd-hdr-mobile-menu {
  background: var(--frd-dm-surface-elevated, #162032) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
  color: var(--frd-dm-text, #f8fafc) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .frd-hdr-mobile-user-name,
body.dark .frd-hdr-mobile-user-name {
  color: #ffffff !important;
}

html[data-theme="dark"] .frd-hdr-mobile-user-business,
body.dark .frd-hdr-mobile-user-business {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .frd-hdr-mobile-divider,
body.dark .frd-hdr-mobile-divider {
  background: var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .frd-hdr-mobile-search-btn,
body.dark .frd-hdr-mobile-search-btn {
  background: var(--frd-dm-input-bg, #101828) !important;
  color: #cbd5e1 !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .frd-hdr-mobile-kbd,
body.dark .frd-hdr-mobile-kbd {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .frd-hdr-mobile-quick-pill,
body.dark .frd-hdr-mobile-quick-pill {
  background: var(--frd-dm-input-bg, #101828) !important;
  border: 1px solid var(--frd-dm-border, #1f2a37) !important;
}

html[data-theme="dark"] .frd-hdr-mobile-quick-pill:hover,
body.dark .frd-hdr-mobile-quick-pill:hover {
  background: #1e293b !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .frd-hdr-mobile-quick-pill span,
body.dark .frd-hdr-mobile-quick-pill span {
  color: #e2e8f0 !important;
}


/* ==========================================================================
   Agregar compra: botón "más opciones" y editor TinyMCE (producto, notas)
   ========================================================================== */
html[data-theme="dark"] .purchase-more-toggle,
body.dark .purchase-more-toggle {
  background: var(--frd-dm-surface-elevated) !important;
  border-color: var(--frd-dm-border-input) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .purchase-more-toggle small,
body.dark .purchase-more-toggle small {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .tox .tox-menubar,
html[data-theme="dark"] .tox .tox-toolbar,
html[data-theme="dark"] .tox .tox-toolbar__primary,
html[data-theme="dark"] .tox .tox-toolbar-overlord,
html[data-theme="dark"] .tox .tox-statusbar,
body.dark .tox .tox-menubar,
body.dark .tox .tox-toolbar,
body.dark .tox .tox-toolbar__primary,
body.dark .tox .tox-toolbar-overlord,
body.dark .tox .tox-statusbar {
  background: var(--frd-dm-surface-elevated) !important;
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tox .tox-tinymce,
body.dark .tox .tox-tinymce {
  border-color: var(--frd-dm-border-input) !important;
}

html[data-theme="dark"] .tox .tox-mbtn,
html[data-theme="dark"] .tox .tox-tbtn,
html[data-theme="dark"] .tox .tox-statusbar__path-item,
html[data-theme="dark"] .tox .tox-statusbar__wordcount,
html[data-theme="dark"] .tox .tox-statusbar a,
body.dark .tox .tox-mbtn,
body.dark .tox .tox-tbtn,
body.dark .tox .tox-statusbar__path-item,
body.dark .tox .tox-statusbar__wordcount,
body.dark .tox .tox-statusbar a {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tox .tox-tbtn svg,
body.dark .tox .tox-tbtn svg {
  fill: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .tox .tox-tbtn:hover,
html[data-theme="dark"] .tox .tox-mbtn:hover,
body.dark .tox .tox-tbtn:hover,
body.dark .tox .tox-mbtn:hover {
  background: var(--frd-dm-surface) !important;
}

/* ==========================================================================
   Asistente de RNC (alta de contacto, facturas): tarjeta blanca con texto claro
   ========================================================================== */
html[data-theme="dark"] .frd-ai-assist:not(.frd-ai-assist--invoice),
html[data-theme="dark"] .css-v2-form-scope .frd-ai-assist:not(.frd-ai-assist--invoice),
body.dark .frd-ai-assist:not(.frd-ai-assist--invoice),
body.dark .css-v2-form-scope .frd-ai-assist:not(.frd-ai-assist--invoice) {
  background: var(--frd-dm-surface-elevated) !important;
  border: 1px solid var(--frd-dm-border-input) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .frd-ai-assist__title,
body.dark .frd-ai-assist__title {
  color: var(--frd-dm-text) !important;
}

html[data-theme="dark"] .frd-ai-assist__hints,
html[data-theme="dark"] .frd-ai-assist__hint-line,
html[data-theme="dark"] .frd-ai-assist__hint-line--secondary,
html[data-theme="dark"] .frd-ai-assist__consulting-text,
body.dark .frd-ai-assist__hints,
body.dark .frd-ai-assist__hint-line,
body.dark .frd-ai-assist__hint-line--secondary,
body.dark .frd-ai-assist__consulting-text {
  color: var(--frd-dm-text-muted) !important;
}

html[data-theme="dark"] .frd-ai-assist__icon-wrap,
body.dark .frd-ai-assist__icon-wrap {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}

html[data-theme="dark"] .frd-ai-assist__success,
body.dark .frd-ai-assist__success {
  color: #86efac !important;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: none;
}

html[data-theme="dark"] .invoice-scheme-field-locked,
body.dark .invoice-scheme-field-locked {
  background-color: var(--frd-dm-surface-elevated) !important;
  color: var(--frd-dm-text-muted) !important;
  border-color: var(--frd-dm-border-input) !important;
}
