/* ════════════════════════════════════════════════════════════
   Elegant Suit — Dark mode overrides
   Se carga AL FINAL, después de app.min.css, para ganar especificidad.
   Solo aplica cuando html[data-bs-theme="dark"].

   Prefijos cubiertos:
   .inv-*        → inventario / gestión inventario
   .dash-*       → dashboard
   .cli-*        → clientes
   .deals-*      → kanban negocios
   .dh-*         → historial deals
   .guar-*       → garantías
   .gm-*         → garment-cards (stock cards)
   .gc-*         → garment-carousel (lightbox)
   .garment-*    → grid de prendas
   .usr-*        → usuarios
   .rental-*     → nueva reserva
   .rcal-*       → calendario reservas
   .cfg-*        → system config
   .brn-*        → branches (sección dentro de config)
   .notif-*      → notificaciones
   .nc-*         → nuevo cliente (sub-form de reserva)
   ════════════════════════════════════════════════════════════ */

html[data-bs-theme="dark"] {
  --es-surface:        #1f2330;   /* cards / paneles / modales */
  --es-surface-2:      #272b3a;   /* hover, fila zebra de tablas */
  --es-surface-soft:   #2a2f3e;   /* inputs / fondos suaves / chips inactivos */
  --es-border:         #353a4a;
  --es-border-strong:  #404555;
  --es-text:           #e6e8ec;
  --es-text-muted:     #9aa3b2;
  --es-accent:         #c5a45a;   /* dorado marca Elegant Suit */
  --es-accent-d:       #b0903e;
  --es-danger:         #f87171;
  --es-success:        #4ade80;

  /* ── Override TODAS las variables :root de las páginas custom ──
     Cada módulo declara sus propias variables (--dash-*, --cli-*, etc.)
     en su :root. Las reasignamos aquí para que en dark mode automáticamente
     todos los selectores que usen var(--prefix-text) etc. se vean bien. */

  /* Dashboard */
  --dash-bg:             #1f2330;
  --dash-bg-subtle:      #181b27;
  --dash-border:         #353a4a;
  --dash-text:           #e6e8ec;
  --dash-text-secondary: #9aa3b2;
  --dash-text-muted:     #6b7280;
  --dash-primary-light:  rgba(197,164,90,0.18);
  --dash-success-light:  rgba(16,185,129,0.18);
  --dash-info-light:     rgba(59,130,246,0.18);
  --dash-warning-light:  rgba(245,158,11,0.18);
  --dash-orange-light:   rgba(249,115,22,0.18);
  --dash-danger-light:   rgba(239,68,68,0.18);
  --dash-shadow:         0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --dash-shadow-lg:      0 10px 25px rgba(0,0,0,0.4);

  /* Clientes */
  --cli-bg:             #1f2330;
  --cli-bg-subtle:      #181b27;
  --cli-border:         #353a4a;
  --cli-text:           #e6e8ec;
  --cli-text-secondary: #9aa3b2;
  --cli-text-muted:     #6b7280;
  --cli-primary-light:  rgba(197,164,90,0.18);
  --cli-success-light:  rgba(16,185,129,0.18);
  --cli-danger-light:   rgba(239,68,68,0.18);
  --cli-shadow:         0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --cli-shadow-lg:      0 10px 25px rgba(0,0,0,0.4);

  /* Negocios (deals/kanban) */
  --deal-bg:             #1f2330;
  --deal-bg-subtle:      #181b27;
  --deal-border:         #353a4a;
  --deal-text:           #e6e8ec;
  --deal-text-secondary: #9aa3b2;
  --deal-text-muted:     #6b7280;
  --deal-primary-light:  rgba(197,164,90,0.18);
  --deal-success-light:  rgba(16,185,129,0.18);
  --deal-info-light:     rgba(59,130,246,0.18);
  --deal-warning-light:  rgba(245,158,11,0.18);
  --deal-danger-light:   rgba(239,68,68,0.18);
  --deal-purple-light:   rgba(139,92,246,0.18);
  --deal-shadow:         0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --deal-shadow-lg:      0 10px 25px rgba(0,0,0,0.4);

  /* Inventario / Gestión */
  --inv-bg:            #1f2330;
  --inv-bg-subtle:     #181b27;
  --inv-border:        #353a4a;
  --inv-text:          #e6e8ec;
  --inv-text-secondary:#9aa3b2;
  --inv-text-muted:    #6b7280;
  --inv-shadow:        0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --inv-shadow-lg:     0 10px 25px rgba(0,0,0,0.4);

  /* Notifications */
  --notif-bg-unread:  rgba(197,164,90,0.10);
  --notif-border:     #353a4a;
  --notif-text:       #e6e8ec;
  --notif-text-muted: #9aa3b2;

  /* Calendario reservas */
  --rcal-bg:          #1f2330;
  --rcal-bg-card:     #1f2330;
  --rcal-border:      #353a4a;
  --rcal-text:        #e6e8ec;
  --rcal-text-muted:  #9aa3b2;
  --rcal-shadow:      0 1px 4px rgba(0,0,0,.3);

  /* Nueva reserva */
  --rental-bg:          #1f2330;
  --rental-border:      #353a4a;
  --rental-text:        #e6e8ec;
  --rental-text-muted:  #9aa3b2;

  /* System config */
  --cfg-bg:              #1f2330;
  --cfg-bg-subtle:       #181b27;
  --cfg-border:          #353a4a;
  --cfg-text:            #e6e8ec;
  --cfg-text-secondary:  #9aa3b2;
  --cfg-text-muted:      #6b7280;
  --cfg-primary-light:   rgba(197,164,90,0.18);
  --cfg-danger-light:    rgba(239,68,68,0.18);
  --cfg-shadow:          0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);

  /* Users */
  --usr-bg:             #1f2330;
  --usr-bg-subtle:      #181b27;
  --usr-border:         #353a4a;
  --usr-text:           #e6e8ec;
  --usr-text-secondary: #9aa3b2;
  --usr-text-muted:     #6b7280;
  --usr-primary-light:  rgba(197,164,90,0.18);
  --usr-success-light:  rgba(16,185,129,0.18);
  --usr-danger-light:   rgba(239,68,68,0.18);
  --usr-info-light:     rgba(59,130,246,0.18);
  --usr-purple-light:   rgba(139,92,246,0.18);
  --usr-shadow:         0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --usr-shadow-lg:      0 10px 25px rgba(0,0,0,0.4);

  /* Garment cards — los status colors están bien, pero los thumbs/bg subtle no.
     Estos están como bg blanco en --gc-thumb-bg si existe */
  --gc-bg-disponible:    rgba(16,185,129, 0.18);
  --gc-bg-arrendada:     rgba(59,130,246, 0.18);
  --gc-bg-habilitacion:  rgba(245,158,11, 0.18);
  --gc-bg-danada:        rgba(239,68,68,  0.18);
  --gc-bg-baja:          rgba(107,114,128,0.18);
}

/* ─── 1. Inputs / Selects / Textareas ─── */
html[data-bs-theme="dark"] .inv-filter input,
html[data-bs-theme="dark"] .inv-filter select,
html[data-bs-theme="dark"] .inv-field input,
html[data-bs-theme="dark"] .inv-field select,
html[data-bs-theme="dark"] .inv-field textarea,
html[data-bs-theme="dark"] .inv-modal input,
html[data-bs-theme="dark"] .inv-modal select,
html[data-bs-theme="dark"] .inv-modal textarea,
html[data-bs-theme="dark"] .cli-filter input,
html[data-bs-theme="dark"] .cli-filter select,
html[data-bs-theme="dark"] .cli-field input,
html[data-bs-theme="dark"] .cli-field select,
html[data-bs-theme="dark"] .cli-field textarea,
html[data-bs-theme="dark"] .guar-filters input,
html[data-bs-theme="dark"] .guar-filters select,
html[data-bs-theme="dark"] .deals-filters input,
html[data-bs-theme="dark"] .deals-filters select,
html[data-bs-theme="dark"] .dh-filter input,
html[data-bs-theme="dark"] .dh-filter select,
html[data-bs-theme="dark"] .dh-filters input,
html[data-bs-theme="dark"] .dh-filters select,
html[data-bs-theme="dark"] .usr-filter input,
html[data-bs-theme="dark"] .usr-filter select,
html[data-bs-theme="dark"] .usr-filter-group input,
html[data-bs-theme="dark"] .usr-filter-group select,
html[data-bs-theme="dark"] .usr-filter-search input,
html[data-bs-theme="dark"] .usr-field input,
html[data-bs-theme="dark"] .usr-field select,
html[data-bs-theme="dark"] .usr-field textarea,
html[data-bs-theme="dark"] .usr-modal input,
html[data-bs-theme="dark"] .usr-modal select,
html[data-bs-theme="dark"] .rental-field input,
html[data-bs-theme="dark"] .rental-field select,
html[data-bs-theme="dark"] .rental-field textarea,
html[data-bs-theme="dark"] .rental-totals input,
html[data-bs-theme="dark"] .rental-totals select,
html[data-bs-theme="dark"] .rental-search input,
html[data-bs-theme="dark"] .rental-client-search input,
html[data-bs-theme="dark"] .rcal-filters input,
html[data-bs-theme="dark"] .rcal-filters select,
html[data-bs-theme="dark"] .cfg-field input,
html[data-bs-theme="dark"] .cfg-field select,
html[data-bs-theme="dark"] .cfg-field textarea,
html[data-bs-theme="dark"] .cfg-input,
html[data-bs-theme="dark"] .brn-field input,
html[data-bs-theme="dark"] .brn-field select,
html[data-bs-theme="dark"] .brn-modal input,
html[data-bs-theme="dark"] .brn-modal select,
html[data-bs-theme="dark"] .gm-detail input,
html[data-bs-theme="dark"] .gm-detail select,
html[data-bs-theme="dark"] .gm-detail textarea,
html[data-bs-theme="dark"] .nc-field input,
html[data-bs-theme="dark"] .nc-field select,
html[data-bs-theme="dark"] .nc-photo input {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}

/* ─── 2. <option> nativos: solo respeta background-color + color ─── */
html[data-bs-theme="dark"] select option {
  background-color: #1f2330 !important;
  color: #e6e8ec !important;
}
html[data-bs-theme="dark"] select option:checked,
html[data-bs-theme="dark"] select option:hover {
  background-color: var(--es-accent) !important;
  color: #1a1a1a !important;
}

/* ─── 3. Placeholders ─── */
html[data-bs-theme="dark"] input::placeholder,
html[data-bs-theme="dark"] textarea::placeholder {
  color: var(--es-text-muted) !important;
  opacity: 0.7;
}

/* ─── 4. Labels ─── */
html[data-bs-theme="dark"] .inv-filter label,
html[data-bs-theme="dark"] .inv-field label,
html[data-bs-theme="dark"] .cli-filter label,
html[data-bs-theme="dark"] .cli-field label,
html[data-bs-theme="dark"] .guar-filters label,
html[data-bs-theme="dark"] .deals-filters label,
html[data-bs-theme="dark"] .dh-filter label,
html[data-bs-theme="dark"] .dh-filters label,
html[data-bs-theme="dark"] .usr-filter label,
html[data-bs-theme="dark"] .usr-filter-group label,
html[data-bs-theme="dark"] .usr-field label,
html[data-bs-theme="dark"] .rental-field label,
html[data-bs-theme="dark"] .rental-section__title,
html[data-bs-theme="dark"] .rcal-filters label,
html[data-bs-theme="dark"] .cfg-field__label,
html[data-bs-theme="dark"] .cfg-field label,
html[data-bs-theme="dark"] .brn-field label,
html[data-bs-theme="dark"] .gm-detail label,
html[data-bs-theme="dark"] .nc-field label {
  color: var(--es-text-muted) !important;
}

/* ─── 5. Cards / paneles principales ─── */
html[data-bs-theme="dark"] .inv-card,
html[data-bs-theme="dark"] .inv-filters,
html[data-bs-theme="dark"] .inv-list-row,
html[data-bs-theme="dark"] .inv-changelog,
html[data-bs-theme="dark"] .cli-card,
html[data-bs-theme="dark"] .cli-filters,
html[data-bs-theme="dark"] .dash-card,
html[data-bs-theme="dark"] .dash-kpi,
html[data-bs-theme="dark"] .dash-welcome,
html[data-bs-theme="dark"] .dh-card,
html[data-bs-theme="dark"] .dh-filters,
html[data-bs-theme="dark"] .dh-detail,
html[data-bs-theme="dark"] .deals-filters,
html[data-bs-theme="dark"] .guar-filters,
html[data-bs-theme="dark"] .guar-kpi,
html[data-bs-theme="dark"] .guar-header,
html[data-bs-theme="dark"] .usr-card,
html[data-bs-theme="dark"] .usr-filters,
html[data-bs-theme="dark"] .garment-card,
html[data-bs-theme="dark"] .rental-card,
html[data-bs-theme="dark"] .rental-section,
html[data-bs-theme="dark"] .rental-results,
html[data-bs-theme="dark"] .rental-items,
html[data-bs-theme="dark"] .rental-totals,
html[data-bs-theme="dark"] .rcal-calendar,
html[data-bs-theme="dark"] .rcal-filters,
html[data-bs-theme="dark"] .rcal-stats,
html[data-bs-theme="dark"] .rcal-stat,
html[data-bs-theme="dark"] .cfg-pane,
html[data-bs-theme="dark"] .cfg-header,
html[data-bs-theme="dark"] .notif-item,
html[data-bs-theme="dark"] .notif-body,
html[data-bs-theme="dark"] .brn-table,
html[data-bs-theme="dark"] .brn-transfer {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text);
}

/* ─── 6. Tablas custom ─── */
html[data-bs-theme="dark"] .inv-changelog table,
html[data-bs-theme="dark"] .cli-table-wrap,
html[data-bs-theme="dark"] .dh-table-wrap,
html[data-bs-theme="dark"] .guar-table-wrap,
html[data-bs-theme="dark"] .rental-results table,
html[data-bs-theme="dark"] .rental-items table,
html[data-bs-theme="dark"] .brn-table {
  background-color: var(--es-surface) !important;
}
html[data-bs-theme="dark"] .inv-changelog thead th,
html[data-bs-theme="dark"] .cli-table thead th,
html[data-bs-theme="dark"] .dh-table thead th,
html[data-bs-theme="dark"] .guar-table thead th,
html[data-bs-theme="dark"] .rental-results thead th,
html[data-bs-theme="dark"] .rental-items thead th,
html[data-bs-theme="dark"] .brn-table thead th {
  background-color: #181b27 !important;
  color: var(--es-text-muted) !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .inv-changelog tbody td,
html[data-bs-theme="dark"] .cli-table tbody td,
html[data-bs-theme="dark"] .dh-table tbody td,
html[data-bs-theme="dark"] .guar-table tbody td,
html[data-bs-theme="dark"] .rental-results tbody td,
html[data-bs-theme="dark"] .rental-items tbody td,
html[data-bs-theme="dark"] .brn-table tbody td {
  color: var(--es-text) !important;
  border-bottom-color: var(--es-border) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .inv-changelog tbody tr:hover,
html[data-bs-theme="dark"] .cli-table tbody tr:hover,
html[data-bs-theme="dark"] .dh-table tbody tr:hover,
html[data-bs-theme="dark"] .guar-table tbody tr:hover,
html[data-bs-theme="dark"] .rental-results tbody tr:hover,
html[data-bs-theme="dark"] .rental-items tbody tr:hover {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .inv-changelog tbody td strong,
html[data-bs-theme="dark"] .cli-table tbody td strong,
html[data-bs-theme="dark"] .dh-table tbody td strong,
html[data-bs-theme="dark"] .guar-table tbody td strong,
html[data-bs-theme="dark"] .rental-results tbody td strong,
html[data-bs-theme="dark"] .rental-items tbody td strong,
html[data-bs-theme="dark"] .brn-table tbody td strong {
  color: var(--es-text) !important;
}

/* Tabla dash-sbs (detalle por vendedor en dashboard) */
html[data-bs-theme="dark"] .dash-sbs-table-wrapper { background-color: var(--es-surface) !important; }
html[data-bs-theme="dark"] .dash-sbs-table thead th {
  background-color: #181b27 !important;
  color: var(--es-text-muted) !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-sbs-table tbody td {
  color: var(--es-text) !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-sbs-table tbody tr:hover { background-color: var(--es-surface-2) !important; }
html[data-bs-theme="dark"] .dash-sbs-summary {
  background-color: #181b27 !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-sbs-summary__item {
  background-color: var(--es-surface-soft) !important;
}
html[data-bs-theme="dark"] .dash-sbs-summary__seller { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .dash-sbs-summary__stats { color: var(--es-text-muted) !important; }

/* ─── 7. Modales custom ─── */
html[data-bs-theme="dark"] .inv-modal,
html[data-bs-theme="dark"] .cli-modal,
html[data-bs-theme="dark"] .dh-modal,
html[data-bs-theme="dark"] .guar-modal,
html[data-bs-theme="dark"] .usr-modal,
html[data-bs-theme="dark"] .gm-modal,
html[data-bs-theme="dark"] .rental-modal,
html[data-bs-theme="dark"] .rental-pin-modal,
html[data-bs-theme="dark"] .rental-zero-modal,
html[data-bs-theme="dark"] .brn-modal,
html[data-bs-theme="dark"] .deals-modal,
html[data-bs-theme="dark"] .deals-pay-modal,
html[data-bs-theme="dark"] .deals-pin-modal,
html[data-bs-theme="dark"] .gc-lightbox {
  background-color: var(--es-surface) !important;
  color: var(--es-text);
  border-color: var(--es-border);
}
html[data-bs-theme="dark"] .inv-modal__header,
html[data-bs-theme="dark"] .cli-modal__header,
html[data-bs-theme="dark"] .dh-modal__header,
html[data-bs-theme="dark"] .guar-modal__header,
html[data-bs-theme="dark"] .usr-modal__header,
html[data-bs-theme="dark"] .gm-modal__header,
html[data-bs-theme="dark"] .brn-modal__header,
html[data-bs-theme="dark"] .deals-modal__header {
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .inv-modal__footer,
html[data-bs-theme="dark"] .cli-modal__footer,
html[data-bs-theme="dark"] .dh-modal__footer,
html[data-bs-theme="dark"] .guar-modal__footer,
html[data-bs-theme="dark"] .usr-modal__footer,
html[data-bs-theme="dark"] .gm-modal__footer,
html[data-bs-theme="dark"] .brn-modal__footer,
html[data-bs-theme="dark"] .deals-modal__footer {
  background-color: #181b27 !important;
  border-top-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .inv-modal__title,
html[data-bs-theme="dark"] .cli-modal__title,
html[data-bs-theme="dark"] .dh-modal__title,
html[data-bs-theme="dark"] .guar-modal__title,
html[data-bs-theme="dark"] .usr-modal__title,
html[data-bs-theme="dark"] .gm-modal__title,
html[data-bs-theme="dark"] .brn-modal__title,
html[data-bs-theme="dark"] .deals-modal__title,
html[data-bs-theme="dark"] .deals-pin-modal__title,
html[data-bs-theme="dark"] .rental-pin-modal__title,
html[data-bs-theme="dark"] .rental-zero-modal__title,
html[data-bs-theme="dark"] .deals-pay-modal__title {
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .rental-pin-modal__subtitle,
html[data-bs-theme="dark"] .deals-pin-modal__subtitle {
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .rental-pin-digit,
html[data-bs-theme="dark"] .deals-pin-digit {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-pin-digit:focus,
html[data-bs-theme="dark"] .deals-pin-digit:focus {
  border-color: var(--es-accent) !important;
}

/* Sub-bloques con fondo soft dentro de modales */
html[data-bs-theme="dark"] .inv-add-sale__note,
html[data-bs-theme="dark"] .inv-recent-thumb,
html[data-bs-theme="dark"] .gm-info-block,
html[data-bs-theme="dark"] .gm-thumbnail,
html[data-bs-theme="dark"] .gm-card-thumbnail,
html[data-bs-theme="dark"] .rental-bg-soft,
html[data-bs-theme="dark"] .nc-photo-slot,
html[data-bs-theme="dark"] .nc-photo-preview {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}

/* ─── 8. Overlays / fondos modales ─── */
html[data-bs-theme="dark"] .inv-overlay,
html[data-bs-theme="dark"] .cli-overlay,
html[data-bs-theme="dark"] .dh-overlay,
html[data-bs-theme="dark"] .guar-overlay,
html[data-bs-theme="dark"] .usr-overlay,
html[data-bs-theme="dark"] .gm-overlay,
html[data-bs-theme="dark"] .rental-overlay,
html[data-bs-theme="dark"] .rental-pin-overlay,
html[data-bs-theme="dark"] .rental-zero-overlay,
html[data-bs-theme="dark"] .brn-overlay,
html[data-bs-theme="dark"] .deals-modal-overlay,
html[data-bs-theme="dark"] .deals-pay-overlay,
html[data-bs-theme="dark"] .deals-pin-overlay,
html[data-bs-theme="dark"] .gc-lightbox-overlay {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* ─── 9. Botones custom ─── */
html[data-bs-theme="dark"] .inv-btn,
html[data-bs-theme="dark"] .cli-btn,
html[data-bs-theme="dark"] .dh-btn,
html[data-bs-theme="dark"] .guar-btn,
html[data-bs-theme="dark"] .usr-toolbar__btn,
html[data-bs-theme="dark"] .gm-btn,
html[data-bs-theme="dark"] .rental-btn,
html[data-bs-theme="dark"] .deals-btn,
html[data-bs-theme="dark"] .brn-btn,
html[data-bs-theme="dark"] .cfg-btn,
html[data-bs-theme="dark"] .nc-btn {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .inv-btn:hover,
html[data-bs-theme="dark"] .cli-btn:hover,
html[data-bs-theme="dark"] .dh-btn:hover,
html[data-bs-theme="dark"] .guar-btn:hover,
html[data-bs-theme="dark"] .gm-btn:hover,
html[data-bs-theme="dark"] .rental-btn:hover,
html[data-bs-theme="dark"] .deals-btn:hover,
html[data-bs-theme="dark"] .brn-btn:hover,
html[data-bs-theme="dark"] .cfg-btn:hover {
  background-color: var(--es-surface-2) !important;
  border-color: var(--es-accent) !important;
}

html[data-bs-theme="dark"] .inv-btn--primary,
html[data-bs-theme="dark"] .cli-btn--primary,
html[data-bs-theme="dark"] .dh-btn--primary,
html[data-bs-theme="dark"] .guar-btn--primary,
html[data-bs-theme="dark"] .gm-btn--primary,
html[data-bs-theme="dark"] .rental-btn--success,
html[data-bs-theme="dark"] .deals-btn--primary,
html[data-bs-theme="dark"] .deals-btn--payment,
html[data-bs-theme="dark"] .deals-btn--guarantee,
html[data-bs-theme="dark"] .brn-btn--primary,
html[data-bs-theme="dark"] .cfg-btn--primary,
html[data-bs-theme="dark"] .nc-btn--primary {
  background-color: var(--es-accent) !important;
  border-color: var(--es-accent) !important;
  color: #1a1a1a !important;
  font-weight: 600;
}
html[data-bs-theme="dark"] .inv-btn--primary:hover,
html[data-bs-theme="dark"] .cli-btn--primary:hover,
html[data-bs-theme="dark"] .gm-btn--primary:hover,
html[data-bs-theme="dark"] .deals-btn--primary:hover {
  background-color: var(--es-accent-d) !important;
  border-color: var(--es-accent-d) !important;
}

html[data-bs-theme="dark"] .rental-btn--secondary,
html[data-bs-theme="dark"] .deals-btn--outline,
html[data-bs-theme="dark"] .inv-btn--ghost,
html[data-bs-theme="dark"] .cli-btn--ghost,
html[data-bs-theme="dark"] .gm-btn--ghost {
  background-color: transparent !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}

/* Action buttons en filas (lápiz, ojo, copy, etc.) */
html[data-bs-theme="dark"] .inv-row-btn,
html[data-bs-theme="dark"] .inv-icon-btn,
html[data-bs-theme="dark"] .cli-icon-btn,
html[data-bs-theme="dark"] .dh-icon-btn,
html[data-bs-theme="dark"] .guar-icon-btn,
html[data-bs-theme="dark"] .usr-icon-btn,
html[data-bs-theme="dark"] .gm-action-btn,
html[data-bs-theme="dark"] .deals-photo-add-btn {
  background-color: transparent !important;
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .inv-row-btn:hover,
html[data-bs-theme="dark"] .cli-icon-btn:hover,
html[data-bs-theme="dark"] .dh-icon-btn:hover,
html[data-bs-theme="dark"] .guar-icon-btn:hover,
html[data-bs-theme="dark"] .deals-photo-add-btn:hover {
  background-color: var(--es-surface-2) !important;
  color: var(--es-text) !important;
}

/* ─── 10. Chips de filtro / sort / view toggles ─── */
html[data-bs-theme="dark"] .inv-chip-filter,
html[data-bs-theme="dark"] .inv-sort-chip,
html[data-bs-theme="dark"] .inv-view-btn,
html[data-bs-theme="dark"] .guar-chip,
html[data-bs-theme="dark"] .rcal-chip,
html[data-bs-theme="dark"] .gm-chip,
html[data-bs-theme="dark"] .cli-chip {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .inv-chip-filter--active,
html[data-bs-theme="dark"] .inv-sort-chip--active,
html[data-bs-theme="dark"] .inv-view-btn--active,
html[data-bs-theme="dark"] .guar-chip--active,
html[data-bs-theme="dark"] .rcal-chip--active,
html[data-bs-theme="dark"] .gm-chip--active,
html[data-bs-theme="dark"] .cli-chip--active {
  background-color: var(--es-accent) !important;
  border-color: var(--es-accent) !important;
  color: #1a1a1a !important;
}

/* Selector de modo en reserva (solo reserva / entregado) */
html[data-bs-theme="dark"] .rental-mode {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-mode:hover {
  background-color: var(--es-surface-2) !important;
  border-color: var(--es-accent) !important;
}
html[data-bs-theme="dark"] .rental-mode--active {
  background: linear-gradient(135deg, rgba(197,164,90,.12) 0%, var(--es-surface) 100%) !important;
  border-color: var(--es-accent) !important;
}
html[data-bs-theme="dark"] .rental-mode__icon { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .rental-mode--active .rental-mode__icon { color: var(--es-accent) !important; }
html[data-bs-theme="dark"] .rental-mode__title { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .rental-mode__desc { color: var(--es-text-muted) !important; }

/* ─── 11. Tabs custom (no Bootstrap) ─── */
html[data-bs-theme="dark"] .cfg-tabs,
html[data-bs-theme="dark"] .cfg-tab {
  background-color: var(--es-surface) !important;
  color: var(--es-text-muted) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .cfg-tab--active,
html[data-bs-theme="dark"] .cfg-tab:hover {
  background-color: var(--es-surface-2) !important;
  color: var(--es-accent) !important;
}
html[data-bs-theme="dark"] .guar-tab {
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .guar-tab--active {
  color: var(--es-accent) !important;
  border-bottom-color: var(--es-accent) !important;
}

/* ─── 12. Textos hardcoded oscuros ─── */
html[data-bs-theme="dark"] .inv-toolbar__title,
html[data-bs-theme="dark"] .inv-card__name,
html[data-bs-theme="dark"] .inv-product-name,
html[data-bs-theme="dark"] .inv-card__brand,
html[data-bs-theme="dark"] .cli-toolbar__title,
html[data-bs-theme="dark"] .cli-card__name,
html[data-bs-theme="dark"] .cli-form h4,
html[data-bs-theme="dark"] .dh-toolbar__title,
html[data-bs-theme="dark"] .dh-card__title,
html[data-bs-theme="dark"] .dh-detail-section__title,
html[data-bs-theme="dark"] .dh-detail-grid label,
html[data-bs-theme="dark"] .guar-header h2,
html[data-bs-theme="dark"] .guar-toolbar__title,
html[data-bs-theme="dark"] .usr-toolbar__title,
html[data-bs-theme="dark"] .usr-card__name,
html[data-bs-theme="dark"] .usr-card__email,
html[data-bs-theme="dark"] .usr-card__handle,
html[data-bs-theme="dark"] .garment-card__name,
html[data-bs-theme="dark"] .garment-card__code,
html[data-bs-theme="dark"] .gm-name,
html[data-bs-theme="dark"] .gm-section__title,
html[data-bs-theme="dark"] .gm-card-name,
html[data-bs-theme="dark"] .rental-header__title,
html[data-bs-theme="dark"] .rental-header__contract,
html[data-bs-theme="dark"] .rental-section__title,
html[data-bs-theme="dark"] .rental-totals .rental-total-row th,
html[data-bs-theme="dark"] .rcal-header h2,
html[data-bs-theme="dark"] .rcal-header__title,
html[data-bs-theme="dark"] .cfg-header__title,
html[data-bs-theme="dark"] .brn-table__name,
html[data-bs-theme="dark"] .dash-welcome__name,
html[data-bs-theme="dark"] .dash-card__title,
html[data-bs-theme="dark"] .dash-kpi__value,
html[data-bs-theme="dark"] .dash-pending-item__num,
html[data-bs-theme="dark"] .dash-rbs-row__name,
html[data-bs-theme="dark"] .dash-rbs-row__amount,
html[data-bs-theme="dark"] .deals-modal__title,
html[data-bs-theme="dark"] .deals-modal-section__title,
html[data-bs-theme="dark"] .deals-modal-grid label,
html[data-bs-theme="dark"] .deals-column__title {
  color: var(--es-text) !important;
}

/* Textos muted */
html[data-bs-theme="dark"] .inv-card__type,
html[data-bs-theme="dark"] .inv-card__meta,
html[data-bs-theme="dark"] .cli-card__email,
html[data-bs-theme="dark"] .cli-card__phone,
html[data-bs-theme="dark"] .usr-card__date,
html[data-bs-theme="dark"] .dh-card__client,
html[data-bs-theme="dark"] .dh-card__date,
html[data-bs-theme="dark"] .dh-detail-grid > div > div,
html[data-bs-theme="dark"] .garment-card__branch,
html[data-bs-theme="dark"] .garment-card__meta,
html[data-bs-theme="dark"] .garment-card__wear-label,
html[data-bs-theme="dark"] .gm-meta,
html[data-bs-theme="dark"] .rental-totals td,
html[data-bs-theme="dark"] .rcal-stat__label,
html[data-bs-theme="dark"] .dash-card__subtitle,
html[data-bs-theme="dark"] .dash-kpi__label,
html[data-bs-theme="dark"] .dash-pending-item__label,
html[data-bs-theme="dark"] .dash-rbs-row__pct,
html[data-bs-theme="dark"] .dash-rbs-row__meta,
html[data-bs-theme="dark"] .dash-rbs-total,
html[data-bs-theme="dark"] .deals-card__client,
html[data-bs-theme="dark"] .deals-card__dates,
html[data-bs-theme="dark"] .deals-card__items,
html[data-bs-theme="dark"] .deals-card__managed {
  color: var(--es-text-muted) !important;
}

/* ─── 13. Empty states ─── */
html[data-bs-theme="dark"] .inv-empty,
html[data-bs-theme="dark"] .cli-empty,
html[data-bs-theme="dark"] .dh-empty,
html[data-bs-theme="dark"] .guar-empty,
html[data-bs-theme="dark"] .usr-empty,
html[data-bs-theme="dark"] .garment-grid__empty,
html[data-bs-theme="dark"] .deals-empty,
html[data-bs-theme="dark"] .rental-results__empty,
html[data-bs-theme="dark"] .rental-items__empty,
html[data-bs-theme="dark"] .rcal-empty {
  color: var(--es-text-muted) !important;
}

/* ─── 14. Badges, pills, mono ─── */
html[data-bs-theme="dark"] .inv-meta-pill,
html[data-bs-theme="dark"] .inv-sku,
html[data-bs-theme="dark"] .cli-mono,
html[data-bs-theme="dark"] .usr-card__role,
html[data-bs-theme="dark"] .gm-pill,
html[data-bs-theme="dark"] .dh-pill {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}

/* ─── 15. Thumbnails / placeholder de imágenes ─── */
html[data-bs-theme="dark"] .garment-card__thumb,
html[data-bs-theme="dark"] .gm-thumb,
html[data-bs-theme="dark"] .gm-card-thumbnail,
html[data-bs-theme="dark"] .cli-photo-slot,
html[data-bs-theme="dark"] .cli-photo-preview,
html[data-bs-theme="dark"] .nc-photo-slot,
html[data-bs-theme="dark"] .nc-photo-preview,
html[data-bs-theme="dark"] .inv-thumb,
html[data-bs-theme="dark"] .deals-photo-thumb,
html[data-bs-theme="dark"] .rental-photos__item,
html[data-bs-theme="dark"] .rental-photos__upload {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}

/* ═══════════════════════════════════════════════════════════
   KANBAN DE NEGOCIOS (.deals-*)
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .deals-board { background-color: transparent !important; }
html[data-bs-theme="dark"] .deals-column {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .deals-column__header { border-bottom-color: var(--es-border) !important; }
html[data-bs-theme="dark"] .deals-column__count {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .deals-card {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .deals-card:hover {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .deals-card__number,
html[data-bs-theme="dark"] .deals-card__total {
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .deals-modal__body { color: var(--es-text); }
html[data-bs-theme="dark"] .deals-modal-section { border-color: var(--es-border) !important; }
html[data-bs-theme="dark"] .deals-modal-grid label { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .deals-modal-grid > div > div { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .deals-modal-items thead th,
html[data-bs-theme="dark"] .deals-payment-table thead th {
  background-color: #181b27 !important;
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .deals-modal-items tbody td,
html[data-bs-theme="dark"] .deals-payment-table tbody td {
  color: var(--es-text) !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .deals-payment-section,
html[data-bs-theme="dark"] .deals-modal__total {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .deals-toast {
  background-color: var(--es-surface) !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}

/* ═══════════════════════════════════════════════════════════
   GARMENT CARDS (.garment-card / .gm-*)
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .garment-card {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text);
}
html[data-bs-theme="dark"] .garment-card:hover {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .garment-card__price {
  color: var(--es-accent) !important;
}
html[data-bs-theme="dark"] .garment-card__divider {
  background-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .garment-card__wear-track {
  background-color: var(--es-surface-soft) !important;
}
html[data-bs-theme="dark"] .garment-card__metric {
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .stock-pagination {
  background-color: var(--es-surface) !important;
  border-top-color: var(--es-border) !important;
  color: var(--es-text-muted) !important;
}

/* GM Modal de detalle */
html[data-bs-theme="dark"] .gm-modal { background-color: var(--es-surface) !important; }
html[data-bs-theme="dark"] .gm-modal__header,
html[data-bs-theme="dark"] .gm-modal__footer {
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .gm-section {
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .gm-section__title { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .gm-info-block label { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .gm-info-block div { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .gm-status-badge {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
}

/* ═══════════════════════════════════════════════════════════
   RENTAL FORM (.rental-* / .nc-*)
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .rental-card {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-header {
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-section {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-client-search {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-client-search input {
  background-color: transparent !important;
}
html[data-bs-theme="dark"] .rental-client-dropdown {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-client-dropdown__item {
  color: var(--es-text) !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-client-dropdown__item:hover {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .rental-client-selected {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-totals table { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .rental-totals th,
html[data-bs-theme="dark"] .rental-totals td {
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-totals .rental-total-row,
html[data-bs-theme="dark"] .rental-totals .rental-balance-row {
  background-color: var(--es-surface-soft) !important;
}
html[data-bs-theme="dark"] .rental-photos {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .rental-photos__hint { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .rental-message {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .rental-footer {
  background-color: #181b27 !important;
  border-top-color: var(--es-border) !important;
}

/* New Client form (sub-form de reserva) */
html[data-bs-theme="dark"] .nc-form {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
}

/* ═══════════════════════════════════════════════════════════
   CALENDARIO DE RESERVAS (.rcal-* + FullCalendar .fc-*)
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .rcal-stat__value { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .rcal-popover {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}

/* FullCalendar widget */
html[data-bs-theme="dark"] .fc {
  background-color: var(--es-surface) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .fc .fc-toolbar-title { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .fc .fc-col-header-cell {
  background-color: #181b27 !important;
  color: var(--es-text-muted) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .fc .fc-col-header-cell-cushion { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .fc .fc-scrollgrid,
html[data-bs-theme="dark"] .fc .fc-scrollgrid td,
html[data-bs-theme="dark"] .fc .fc-scrollgrid th,
html[data-bs-theme="dark"] .fc-theme-standard td,
html[data-bs-theme="dark"] .fc-theme-standard th {
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .fc .fc-daygrid-day,
html[data-bs-theme="dark"] .fc-daygrid-day-frame {
  background-color: var(--es-surface) !important;
}
html[data-bs-theme="dark"] .fc .fc-daygrid-day-number,
html[data-bs-theme="dark"] .fc .fc-daygrid-day-top { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .fc .fc-day-today { background-color: rgba(197, 164, 90, 0.12) !important; }
html[data-bs-theme="dark"] .fc .fc-day-other .fc-daygrid-day-frame { background-color: #181b27 !important; }
html[data-bs-theme="dark"] .fc .fc-day-other .fc-daygrid-day-number { opacity: 0.5; }
html[data-bs-theme="dark"] .fc .fc-button,
html[data-bs-theme="dark"] .fc .fc-button-primary {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .fc .fc-button:hover {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .fc .fc-button-active,
html[data-bs-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
html[data-bs-theme="dark"] .fc .fc-button-primary:not(:disabled):active {
  background-color: var(--es-accent) !important;
  border-color: var(--es-accent) !important;
  color: #1a1a1a !important;
}
html[data-bs-theme="dark"] .fc .fc-popover {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .fc .fc-popover-header {
  background-color: #181b27 !important;
  color: var(--es-text) !important;
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICACIONES (.notif-*)
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .notif-item {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .notif-item:hover {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .notif-title { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .notif-message,
html[data-bs-theme="dark"] .notif-time { color: var(--es-text-muted) !important; }

/* ═══════════════════════════════════════════════════════════
   GUARANTEES (.guar-*)
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .guar-header__title { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .guar-kpi {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
  box-shadow: none !important;
}
html[data-bs-theme="dark"] .guar-kpi__label { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .guar-kpi__value { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .guar-kpi__value--success { color: #4ade80 !important; }
html[data-bs-theme="dark"] .guar-kpi__value--warning { color: #fbbf24 !important; }
html[data-bs-theme="dark"] .guar-kpi__value--danger { color: #f87171 !important; }
html[data-bs-theme="dark"] .guar-tabs { border-bottom-color: var(--es-border) !important; }
html[data-bs-theme="dark"] .guar-tab:hover { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .guar-filters__search,
html[data-bs-theme="dark"] .guar-filters__select {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .guar-filters__search:focus { border-color: var(--es-accent) !important; }
html[data-bs-theme="dark"] .guar-table__contract { color: var(--es-accent) !important; }
html[data-bs-theme="dark"] .guar-table__rut { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .guar-table__client { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .guar-table__amount { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .guar-table__amount--pending { color: #fbbf24 !important; }
html[data-bs-theme="dark"] .guar-table__amount--returned { color: #4ade80 !important; }
html[data-bs-theme="dark"] .guar-pagination__btn {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .guar-pagination__btn--active {
  background-color: var(--es-accent) !important;
  color: #1a1a1a !important;
}
html[data-bs-theme="dark"] .guar-no-data { color: var(--es-text-muted) !important; }

/* ═══════════════════════════════════════════════════════════
   BARRA STOCK / FILTROS GENERALES
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .stock-range,
html[data-bs-theme="dark"] .stock-pagination__btn {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] #wear-range-fill { background-color: var(--es-accent) !important; }

/* ═══════════════════════════════════════════════════════════
   AJUSTES FINOS — Filas, alertas, status badges
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .dash-alert {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .dash-alert__text { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .dash-alert__count {
  background-color: var(--es-surface) !important;
  color: var(--es-text) !important;
}

html[data-bs-theme="dark"] .dash-timeline__item {
  background-color: var(--es-surface) !important;
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-timeline__text { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .dash-timeline__meta { color: var(--es-text-muted) !important; }
html[data-bs-theme="dark"] .dash-table__link { color: var(--es-accent) !important; }

html[data-bs-theme="dark"] .dash-pending-item {
  background-color: var(--es-surface-soft) !important;
}

html[data-bs-theme="dark"] .dash-rbs-row__bar {
  background-color: var(--es-surface-soft) !important;
}

/* ─── Dash card header (fondo blanco brillante en dark) ─── */
html[data-bs-theme="dark"] .dash-card__header {
  background-color: transparent !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-card--alerts .dash-card__header {
  background-color: transparent !important;
}
html[data-bs-theme="dark"] .dash-card__title { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .dash-card__badge {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text-muted) !important;
  border-color: var(--es-border) !important;
}

/* ─── Selector de período (fondo blanco en dark) ─── */
html[data-bs-theme="dark"] .dash-period-select {
  background-color: var(--es-surface-soft) !important;
  border-color: var(--es-border) !important;
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .dash-period-select option {
  background-color: var(--es-surface) !important;
  color: var(--es-text) !important;
}

/* Card body (puede tener fondo blanco implícito) */
html[data-bs-theme="dark"] .dash-card__body { background-color: transparent !important; }

/* Logística diaria — items individuales */
html[data-bs-theme="dark"] .dash-pending-grid { background-color: transparent !important; }

/* ─── Tabla del Rendimiento del Equipo (.dash-table) ─── */
html[data-bs-theme="dark"] .dash-table { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .dash-table th {
  background-color: #181b27 !important;
  color: var(--es-text-muted) !important;
  border-bottom-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-table td {
  color: var(--es-text) !important;
  border-bottom-color: var(--es-border) !important;
  background-color: transparent !important;
}
html[data-bs-theme="dark"] .dash-table tr:hover td {
  background-color: var(--es-surface-2) !important;
}
html[data-bs-theme="dark"] .dash-table tr:last-child td {
  background-color: transparent !important;
}
html[data-bs-theme="dark"] .dash-table__amount,
html[data-bs-theme="dark"] .dash-table__code {
  color: var(--es-text) !important;
}
html[data-bs-theme="dark"] .dash-client__name { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .dash-badge {
  border-color: var(--es-border) !important;
}
html[data-bs-theme="dark"] .dash-badge--activo {
  background-color: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
}
html[data-bs-theme="dark"] .dash-badge--confirmado {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #4ade80 !important;
}
html[data-bs-theme="dark"] .dash-badge--completado {
  background-color: var(--es-surface-soft) !important;
  color: var(--es-text-muted) !important;
}
html[data-bs-theme="dark"] .dash-badge--borrador {
  background-color: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}
html[data-bs-theme="dark"] .dash-badge--cancelado {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
}

/* Sidenav active states / hover refinements ya cubiertos por Velzon dark */

/* ═══════════════════════════════════════════════════════════
   BRANCHES (.brn-*) — Sub-vista en system config
   ═══════════════════════════════════════════════════════════ */
html[data-bs-theme="dark"] .brn-toolbar { color: var(--es-text); }
html[data-bs-theme="dark"] .brn-toolbar__title { color: var(--es-text) !important; }
html[data-bs-theme="dark"] .brn-table tbody tr:hover {
  background-color: var(--es-surface-2) !important;
}
