/* ============================================================
   THOR — Modo Oscuro Completo
   Se activa con data-theme="dark" en <html>

   Paleta base:
     bg-deep:    #0B1120  (fondo principal)
     bg-base:    #0F172A  (fondo secundario)
     bg-card:    #1E293B  (tarjetas, paneles)
     bg-raised:  #263348  (hover, elevated)
     bg-input:   #0F172A  (inputs)
     border:     #334155  (bordes)
     border-lt:  #1E293B  (bordes suaves)
     text-main:  #E2E8F0  (texto principal)
     text-sec:   #94A3B8  (texto secundario)
     text-muted: #64748B  (texto terciario)
     accent:     #60A5FA  (azul accent)
     accent-ost: #F0923E  (naranja OST suave)
   ============================================================ */

/* ─── Transicion suave al cambiar tema ─── */
html {
  transition: background-color .25s ease, color .25s ease;
}

/* ═══════════════════════════════════════════════════════════════
   1. VARIABLES Y BASE
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --primary-blue:        #60A5FA;
  --primary-blue-dark:   #3B82F6;
  --primary-blue-darker: #2563EB;
  --primary-blue-light:  #93C5FD;
  --primary-blue-lighter:#BFDBFE;
  --secondary-blue:      #BFDBFE;
  --accent-blue:         #22D3EE;
  --light-blue:          #1E3A5F;
  --very-light-blue:     #172554;

  --gray-50:  #0F172A;
  --gray-100: #1E293B;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748B;
  --gray-500: #94A3B8;
  --gray-600: #CBD5E1;
  --gray-700: #E2E8F0;
  --gray-800: #F1F5F9;

  --sc-title:    #F1F5F9;
  --sc-sub:      #94A3B8;
  --sc-border:   #334155;
  --sc-bg-card:  #1E293B;
  --sc-bg-input: #0F172A;
  --sc-panel-bg: #1E293B;

  /* ── Variables globales de style.css ── */
  --bg-primary:   #0B1120;
  --bg-secondary: #1E293B;
  --bg-card:      #1E293B;

  /* ── Variables de seguimiento.css ── */
  --seg-bg:   #0F172A;
  --seg-card: #1E293B;
  --seg-text: #E2E8F0;
  --seg-text-secondary: #94A3B8;
  --seg-text-muted: #64748B;
  --seg-border: #334155;
  --seg-accent: #60A5FA;

  /* ── Variables de Apple dashboard (dashboard-apple.css) ── */
  --apple-bg: #0F172A;
  --apple-card-bg: #1E293B;
  --apple-text: #E2E8F0;
  --apple-text-secondary: #94A3B8;
  --apple-border: #334155;
  --apple-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --apple-shadow-hover: 0 4px 16px rgba(0,0,0,0.4);

  /* ── Variables de search-unified.css ── */
  --thor-bg: #0B1120;
  --thor-bg-secondary: #1E293B;
  --thor-card: #1E293B;
  --thor-text: #E2E8F0;
  --thor-text-secondary: #94A3B8;
  --thor-text-muted: #64748B;
  --thor-border: #334155;
  --thor-accent: #60A5FA;

  /* ── Variables de workflow-apple.css ── */
  --wf-bg: #0B1120;
  --wf-bg-board: #0F172A;
  --wf-card: #1E293B;
  --wf-text: #E2E8F0;
  --wf-text-secondary: #94A3B8;
  --wf-border: #334155;

  /* ── Variables de left-sidebar.css ── */
  --sidebar-bg: #0F172A;
  --sidebar-border: #334155;
  --sidebar-shadow: 0 8px 24px rgba(0,0,0,0.4);
  --text-strong: #E2E8F0;

  /* ── Variables de misLicitaciones.js (inyectadas en :root) ── */
  --ml-bg: #0F172A;
  --ml-card: #1E293B;
  --ml-card-hover: #263348;
  --ml-border: #334155;
  --ml-text: #E2E8F0;
  --ml-text2: #94A3B8;
  --ml-text3: #64748B;
  --ml-accent: #60A5FA;
  --ml-accent-soft: rgba(96, 165, 250, 0.1);
  --ml-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
  --ml-shadow-hover: 0 2px 8px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);

  /* ── Variables de usuarios.js (inline con fallback) ── */
  --border-color: #334155;
  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;

  color-scheme: dark;
}

[data-theme="dark"] body {
  background-color: #0B1120 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   2. HEADER Y NAVEGACION
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] header,
[data-theme="dark"] .header-pro {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] #mainNav,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .left-sidebar,
[data-theme="dark"] nav,
[data-theme="dark"] .nav-sidebar {
  background: #0F172A !important;
  border-right: 1px solid #1E293B !important;
}

[data-theme="dark"] nav ul li,
[data-theme="dark"] .nav-item {
  color: #CBD5E1 !important;
}

[data-theme="dark"] nav ul li:hover,
[data-theme="dark"] nav ul li.active,
[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
  background: #1E293B !important;
  color: #F1F5F9 !important;
}

/* ═══════════════════════════════════════════════════════════════
   3. SECCIONES Y FONDOS GENERICOS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .section,
[data-theme="dark"] .content,
[data-theme="dark"] .main-content,
[data-theme="dark"] .container,
[data-theme="dark"] .page-content {
  background: #0B1120 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-white {
  background: #1E293B !important;
}

/* ═══════════════════════════════════════════════════════════════
   4. CARDS GENERICAS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .panel,
[data-theme="dark"] .box {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .panel:hover,
[data-theme="dark"] .box:hover {
  background: #263348 !important;
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .panel-header {
  background: #0F172A !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .card-title,
[data-theme="dark"] .card-header h4,
[data-theme="dark"] .card-header h5 {
  color: #F1F5F9 !important;
}

/* ═══════════════════════════════════════════════════════════════
   5. INPUTS, SELECTS, TEXTAREAS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  background: #1E293B !important;
  border-color: #60A5FA !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .form-label {
  color: #CBD5E1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   6. TABLAS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] table,
[data-theme="dark"] .table {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] table thead,
[data-theme="dark"] .table thead {
  background: #0F172A !important;
}

[data-theme="dark"] table thead th,
[data-theme="dark"] .table thead th {
  background: #0F172A !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] table tbody tr,
[data-theme="dark"] .table tbody tr {
  border-color: #1E293B !important;
}

[data-theme="dark"] table tbody tr:hover,
[data-theme="dark"] .table tbody tr:hover {
  background: #263348 !important;
}

[data-theme="dark"] table tbody td,
[data-theme="dark"] .table tbody td {
  border-color: #1E293B !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   7. KANBAN — TABLERO COMPLETO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .kanban-container,
[data-theme="dark"] #kanban,
[data-theme="dark"] .kanban-board {
  background: #0B1120 !important;
}

[data-theme="dark"] .kanban-column,
[data-theme="dark"] .kanban-swim,
[data-theme="dark"] .kanban-list {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .kanban-column-title,
[data-theme="dark"] .kanban-header {
  background: #1E293B !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .kanban-card,
[data-theme="dark"] .task-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .kanban-card:hover,
[data-theme="dark"] .task-card:hover {
  background: #263348 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .kanban-card-title,
[data-theme="dark"] .task-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .kanban-card-body,
[data-theme="dark"] .task-body {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════
   8. FILTROS Y BUSCADOR KANBAN
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .kanban-filter,
[data-theme="dark"] .kanban-search {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .filter-chip,
[data-theme="dark"] .filter-tag {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .filter-chip:hover {
  background: #334155 !important;
}

/* ═══════════════════════════════════════════════════════════════
   9. MODALES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .modal,
[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .modal-content {
  background: #1E293B !important;
}

[data-theme="dark"] .modal-header {
  background: #0F172A !important;
  border-bottom-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .modal-body {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .modal-footer {
  background: #0F172A !important;
  border-top-color: #334155 !important;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0,0,0,0.5) !important;
}

/* ═══════════════════════════════════════════════════════════════
   10. TAGS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .tag,
[data-theme="dark"] .badge,
[data-theme="dark"] .label {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .badge-secondary {
  background: #334155 !important;
}

[data-theme="dark"] .badge-primary {
  background: #60A5FA !important;
  color: #000 !important;
}

[data-theme="dark"] .badge-success {
  background: #10B981 !important;
  color: #000 !important;
}

[data-theme="dark"] .badge-danger {
  background: #EF4444 !important;
  color: #fff !important;
}

[data-theme="dark"] .badge-warning {
  background: #F59E0B !important;
  color: #000 !important;
}

/* ═══════════════════════════════════════════════════════════════
   11. NOTIFICACIONES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .notification,
[data-theme="dark"] .alert,
[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert-success,
[data-theme="dark"] .alert-warning,
[data-theme="dark"] .alert-danger {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .alert-info {
  background: rgba(96, 165, 250, 0.15) !important;
  border-color: #60A5FA !important;
}

[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: #10B981 !important;
}

[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: #F59E0B !important;
}

[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #EF4444 !important;
}

/* ═══════════════════════════════════════════════════════════════
   12. CALENDARIO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .calendar,
[data-theme="dark"] .calendar-container {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .calendar-header {
  background: #1E293B !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .calendar-day,
[data-theme="dark"] .calendar-date {
  background: #0F172A !important;
  color: #E2E8F0 !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .calendar-day:hover,
[data-theme="dark"] .calendar-date:hover {
  background: #1E293B !important;
}

[data-theme="dark"] .calendar-day.selected,
[data-theme="dark"] .calendar-date.selected {
  background: #60A5FA !important;
  color: #000 !important;
}

/* ═══════════════════════════════════════════════════════════════
   13. DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .dashboard,
[data-theme="dark"] .dashboard-container {
  background: #0B1120 !important;
}

[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .dashboard-panel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .dashboard-card-header,
[data-theme="dark"] .dashboard-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .dashboard-value {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .dashboard-label {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════
   13-B. APPLE DASHBOARD (CRITICAL OVERRIDE)
   ═══════════════════════════════════════════════════════════════ */

/* Override root Apple variables */
[data-theme="dark"] {
  --apple-bg: #0F172A !important;
  --apple-card-bg: #1E293B !important;
  --apple-text: #E2E8F0 !important;
  --apple-text-secondary: #94A3B8 !important;
  --apple-border: #334155 !important;
  --apple-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  --apple-shadow-hover: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* Main Dashboard Container */
[data-theme="dark"] #dashboardProSection,
[data-theme="dark"] #dashboardProContainer,
[data-theme="dark"] [data-theme="dark"] #dashboardProSection,
[data-theme="dark"] [data-theme="dark"] #dashboardProContainer {
  background: #0B1120 !important;
}

/* Apple Dashboard Classes */
[data-theme="dark"] .apple-dashboard,
[data-theme="dark"] [data-theme="dark"] .apple-dashboard {
  background: #0B1120 !important;
}

[data-theme="dark"] .apple-dashboard .apple-title,
[data-theme="dark"] [data-theme="dark"] .apple-dashboard .apple-title {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-card,
[data-theme="dark"] [data-theme="dark"] .apple-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: var(--apple-shadow) !important;
}

[data-theme="dark"] .apple-card:hover,
[data-theme="dark"] [data-theme="dark"] .apple-card:hover {
  background: #263348 !important;
  box-shadow: var(--apple-shadow-hover) !important;
}

/* Apple Button Overrides */
[data-theme="dark"] .apple-btn-icon,
[data-theme="dark"] [data-theme="dark"] .apple-btn-icon {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-btn-icon:hover,
[data-theme="dark"] [data-theme="dark"] .apple-btn-icon:hover {
  background: #334155 !important;
}

[data-theme="dark"] .apple-btn-toggle,
[data-theme="dark"] [data-theme="dark"] .apple-btn-toggle {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-btn-toggle:hover,
[data-theme="dark"] [data-theme="dark"] .apple-btn-toggle:hover {
  background: #334155 !important;
}

[data-theme="dark"] .apple-btn-toggle.active,
[data-theme="dark"] [data-theme="dark"] .apple-btn-toggle.active {
  background: #60A5FA !important;
  color: #000 !important;
}

/* Apple Table */
[data-theme="dark"] .apple-table,
[data-theme="dark"] [data-theme="dark"] .apple-table {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-table th,
[data-theme="dark"] [data-theme="dark"] .apple-table th {
  background: #0F172A !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .apple-table td,
[data-theme="dark"] [data-theme="dark"] .apple-table td {
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-table tbody tr:hover,
[data-theme="dark"] [data-theme="dark"] .apple-table tbody tr:hover {
  background: #263348 !important;
}

/* Apple Bar Track */
[data-theme="dark"] .apple-bar-track,
[data-theme="dark"] [data-theme="dark"] .apple-bar-track {
  background: rgba(255,255,255,0.08) !important;
}

/* Apple Modal */
[data-theme="dark"] .apple-modal,
[data-theme="dark"] [data-theme="dark"] .apple-modal {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: var(--apple-shadow) !important;
}

[data-theme="dark"] .apple-modal-header,
[data-theme="dark"] [data-theme="dark"] .apple-modal-header {
  background: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-modal-body,
[data-theme="dark"] [data-theme="dark"] .apple-modal-body {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-modal-footer,
[data-theme="dark"] [data-theme="dark"] .apple-modal-footer {
  background: #0F172A !important;
  border-top: 1px solid #334155 !important;
}

/* Apple Config Item */
[data-theme="dark"] .apple-config-item,
[data-theme="dark"] [data-theme="dark"] .apple-config-item {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-config-item:hover,
[data-theme="dark"] [data-theme="dark"] .apple-config-item:hover {
  background: #1E293B !important;
}

/* Apple Select */
[data-theme="dark"] .apple-select,
[data-theme="dark"] [data-theme="dark"] .apple-select {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .apple-select:focus,
[data-theme="dark"] [data-theme="dark"] .apple-select:focus {
  border-color: #60A5FA !important;
  background: #1E293B !important;
}

/* Apple KPI */
[data-theme="dark"] .apple-kpi,
[data-theme="dark"] [data-theme="dark"] .apple-kpi {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .apple-kpi-value,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-value {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .apple-kpi-label,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-label {
  color: #94A3B8 !important;
}

/* Apple KPI Icon Backgrounds - Darkened */
[data-theme="dark"] .apple-kpi-icon,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon {
  background: rgba(96, 165, 250, 0.15) !important;
}

[data-theme="dark"] .apple-kpi-icon.blue,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon.blue {
  background: rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .apple-kpi-icon.green,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon.green {
  background: rgba(16, 185, 129, 0.15) !important;
}

[data-theme="dark"] .apple-kpi-icon.red,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon.red {
  background: rgba(239, 68, 68, 0.15) !important;
}

[data-theme="dark"] .apple-kpi-icon.orange,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon.orange {
  background: rgba(245, 158, 11, 0.15) !important;
}

[data-theme="dark"] .apple-kpi-icon.purple,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon.purple {
  background: rgba(139, 92, 246, 0.15) !important;
}

[data-theme="dark"] .apple-kpi-icon.cyan,
[data-theme="dark"] [data-theme="dark"] .apple-kpi-icon.cyan {
  background: rgba(34, 211, 238, 0.15) !important;
}

/* Apple Phase Badge */
[data-theme="dark"] .apple-phase-badge,
[data-theme="dark"] [data-theme="dark"] .apple-phase-badge {
  border-radius: 12px;
  font-size: 12px;
  padding: 4px 12px;
}

/* Apple Status Badge */
[data-theme="dark"] .apple-status-badge,
[data-theme="dark"] [data-theme="dark"] .apple-status-badge {
  border-radius: 12px;
  font-size: 12px;
  padding: 4px 12px;
}

/* ═══════════════════════════════════════════════════════════════
   14. WORKFLOW / GO-NOGO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .workflow,
[data-theme="dark"] .workflow-board,
[data-theme="dark"] .go-nogo {
  background: #0B1120 !important;
}

[data-theme="dark"] .workflow-item,
[data-theme="dark"] .workflow-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .workflow-item:hover {
  background: #263348 !important;
}

[data-theme="dark"] .workflow-step {
  background: #0F172A !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .workflow-step.active {
  background: #60A5FA !important;
  color: #000 !important;
}

/* ═══════════════════════════════════════════════════════════════
   15. BUSQUEDA UNIFICADA
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .search-unified,
[data-theme="dark"] .search-container {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .search-result,
[data-theme="dark"] .search-item {
  background: #1E293B !important;
  border-bottom: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .search-result:hover,
[data-theme="dark"] .search-item:hover {
  background: #263348 !important;
}

[data-theme="dark"] .search-result-title,
[data-theme="dark"] .search-item-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .search-result-meta,
[data-theme="dark"] .search-item-meta {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════
   15-B. BUSQUEDA / SCHEDULER SECTIONS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .search-unified,
[data-theme="dark"] [data-theme="dark"] .search-unified {
  background: #0F172A !important;
}

[data-theme="dark"] .scheduler-panel,
[data-theme="dark"] [data-theme="dark"] .scheduler-panel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .schedule-container,
[data-theme="dark"] [data-theme="dark"] .schedule-container {
  background: #0F172A !important;
}

[data-theme="dark"] .scheduler-item,
[data-theme="dark"] [data-theme="dark"] .scheduler-item {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .scheduler-item:hover,
[data-theme="dark"] [data-theme="dark"] .scheduler-item:hover {
  background: #263348 !important;
}

/* ═══════════════════════════════════════════════════════════════
   16. HISTORIAL
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .historial,
[data-theme="dark"] .history {
  background: #0B1120 !important;
}

[data-theme="dark"] .historial-item,
[data-theme="dark"] .history-item {
  background: #1E293B !important;
  border-left: 2px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-date,
[data-theme="dark"] .history-date {
  color: #94A3B8 !important;
}

[data-theme="dark"] .historial-description,
[data-theme="dark"] .history-description {
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   16-B. HISTORIAL ENHANCED
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .historial-container,
[data-theme="dark"] [data-theme="dark"] .historial-container {
  background: #0B1120 !important;
}

[data-theme="dark"] .historial-panel,
[data-theme="dark"] [data-theme="dark"] .historial-panel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .historial-lista,
[data-theme="dark"] [data-theme="dark"] .historial-lista {
  background: #0F172A !important;
}

[data-theme="dark"] .historial-lista li,
[data-theme="dark"] [data-theme="dark"] .historial-lista li {
  background: #1E293B !important;
  border-bottom: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-lista li:hover,
[data-theme="dark"] [data-theme="dark"] .historial-lista li:hover {
  background: #263348 !important;
}

[data-theme="dark"] .timeline-item,
[data-theme="dark"] [data-theme="dark"] .timeline-item {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .timeline-marker,
[data-theme="dark"] [data-theme="dark"] .timeline-marker {
  background: #60A5FA !important;
  border: 2px solid #1E293B !important;
}

/* ═══════════════════════════════════════════════════════════════
   17. SEGUIMIENTO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .seguimiento,
[data-theme="dark"] .tracking {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .seguimiento-item {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .seguimiento-status {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════
   18. MODO PREVENTA
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .preventa,
[data-theme="dark"] .presale-mode {
  background: #0F172A !important;
}

[data-theme="dark"] .preventa-card,
[data-theme="dark"] .presale-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .preventa-item {
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   19. THORIA CHAT
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .chat,
[data-theme="dark"] .chat-container {
  background: #0B1120 !important;
}

[data-theme="dark"] .chat-message,
[data-theme="dark"] .message {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .chat-message.user {
  background: #60A5FA !important;
  color: #000 !important;
}

[data-theme="dark"] .chat-input {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   20. BOTONES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] button,
[data-theme="dark"] .btn,
[data-theme="dark"] .button {
  color: #E2E8F0 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .button-primary {
  background: #60A5FA !important;
  color: #000 !important;
  border: none !important;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .button-primary:hover {
  background: #93C5FD !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .button-secondary {
  background: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .button-secondary:hover {
  background: #475569 !important;
}

[data-theme="dark"] .btn-danger {
  background: #EF4444 !important;
  color: #fff !important;
}

[data-theme="dark"] .btn-danger:hover {
  background: #DC2626 !important;
}

[data-theme="dark"] .btn-success {
  background: #10B981 !important;
  color: #000 !important;
}

[data-theme="dark"] .btn-success:hover {
  background: #34D399 !important;
}

[data-theme="dark"] button:disabled {
  background: #334155 !important;
  color: #64748B !important;
}

/* ═══════════════════════════════════════════════════════════════
   21. TEXTOS TAILWIND
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .text-gray-50 {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .text-gray-100,
[data-theme="dark"] .text-gray-200,
[data-theme="dark"] .text-gray-300 {
  color: #CBD5E1 !important;
}

[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-600 {
  color: #94A3B8 !important;
}

[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-900 {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] .bg-gray-200 {
  background: #1E293B !important;
}

[data-theme="dark"] .bg-gray-300,
[data-theme="dark"] .bg-gray-400 {
  background: #334155 !important;
}

/* ═══════════════════════════════════════════════════════════════
   22. SEPARADORES Y BORDES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] hr,
[data-theme="dark"] .divider {
  border-color: #334155 !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-gray,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 {
  border-color: #334155 !important;
}

[data-theme="dark"] .border-top {
  border-top-color: #334155 !important;
}

[data-theme="dark"] .border-bottom {
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .border-left {
  border-left-color: #334155 !important;
}

[data-theme="dark"] .border-right {
  border-right-color: #334155 !important;
}

/* ═══════════════════════════════════════════════════════════════
   23. GLOBALLOADER
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .loader,
[data-theme="dark"] .spinner,
[data-theme="dark"] .global-loader {
  background: transparent !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .loader::before,
[data-theme="dark"] .loader::after,
[data-theme="dark"] .spinner::before,
[data-theme="dark"] .spinner::after {
  background: #60A5FA !important;
}

/* ═══════════════════════════════════════════════════════════════
   24. TOASTS Y BADGES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .toast,
[data-theme="dark"] .toast-container {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .toast-header {
  background: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .badge,
[data-theme="dark"] .badge-light {
  background: #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   25. DOCUMENTOS / PLIEGOS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .document,
[data-theme="dark"] .docview,
[data-theme="dark"] .pliego {
  background: #0B1120 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .document-page {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .document-header {
  background: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
}

/* ═══════════════════════════════════════════════════════════════
   26. ACTIVIDAD RECIENTE
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .activity,
[data-theme="dark"] .activity-feed {
  background: #0B1120 !important;
}

[data-theme="dark"] .activity-item {
  background: #1E293B !important;
  border-left: 3px solid #60A5FA !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .activity-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .activity-description {
  color: #94A3B8 !important;
}

[data-theme="dark"] .activity-timestamp {
  color: #64748B !important;
}

/* ═══════════════════════════════════════════════════════════════
   27. SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0F172A !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15) !important;
  border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   28. OVERRIDE PARA ESTILOS INLINE DE KANBAN.JS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] [style*="background: #f5f5f5"],
[data-theme="dark"] [style*="background:#f5f5f5"],
[data-theme="dark"] [style*="background: #fcfcfc"],
[data-theme="dark"] [style*="background:#fcfcfc"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"] {
  background: #1E293B !important;
}

[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color: #1a1a1a"],
[data-theme="dark"] [style*="color:#1a1a1a"],
[data-theme="dark"] [style*="color: #222"],
[data-theme="dark"] [style*="color:#222"] {
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   29. AUTH / LOGIN
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #loginSection {
  background: #0B1120 !important;
}

[data-theme="dark"] .login-container {
  background: #1E293B !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 20px 40px -10px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .login-header h2 {
  color: #F97316 !important;
}

[data-theme="dark"] .login-subtitle {
  color: #94A3B8 !important;
}

[data-theme="dark"] .btn-microsoft {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .login-hint {
  color: #64748B !important;
}

[data-theme="dark"] .login-hint strong {
  color: #94A3B8 !important;
}

[data-theme="dark"] #loginError {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #FCA5A5 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
}

[data-theme="dark"] .login-divider::before,
[data-theme="dark"] .login-divider::after {
  background: #334155 !important;
}

[data-theme="dark"] .login-divider span {
  color: #64748B !important;
}

[data-theme="dark"] .login-tradicional summary {
  color: #94A3B8 !important;
  border-color: #334155 !important;
  background: transparent !important;
}

[data-theme="dark"] .login-tradicional summary:hover {
  background: #263348 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .login-tradicional[open] summary {
  border-color: #ea580c !important;
  color: #F97316 !important;
  background: rgba(234, 88, 12, 0.1) !important;
}

[data-theme="dark"] #loginForm label {
  color: #94A3B8 !important;
}

[data-theme="dark"] #loginForm input[type="text"],
[data-theme="dark"] #loginForm input[type="password"] {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] #loginForm input:focus {
  border-color: #ea580c !important;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2) !important;
}

[data-theme="dark"] #loginForm button[type="submit"] {
  background: #475569 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] #loginForm button[type="submit"]:hover {
  background: #64748B !important;
}

/* ═══════════════════════════════════════════════════════════════
   30. PT-INTEGRATION (Oferta Pricing Tool en modal licitación)
   ═══════════════════════════════════════════════════════════════ */

/* Contenedor principal */
[data-theme="dark"] .pt-integration-section {
  border-top-color: #334155 !important;
}

/* Sección card */
[data-theme="dark"] .pt-section {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .pt-section-vinculada {
  border-color: #10b981 !important;
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.1), #1E293B) !important;
}

[data-theme="dark"] .pt-section-disabled {
  background: #0F172A !important;
}

/* Header */
[data-theme="dark"] .pt-section-header {
  background: #0F172A !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .pt-section-header h4 {
  color: #E2E8F0 !important;
}

/* Badges */
[data-theme="dark"] .pt-badge-green {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
}

[data-theme="dark"] .pt-badge-gray {
  background: #263348 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .pt-badge-orange {
  background: rgba(249, 115, 22, 0.15) !important;
  color: #FB923C !important;
}

/* Body */
[data-theme="dark"] .pt-section-body {
  background: #1E293B !important;
}

/* Oferta vinculada */
[data-theme="dark"] .pt-oferta-code {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .pt-oferta-org {
  color: #94A3B8 !important;
}

[data-theme="dark"] .pt-detail {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .pt-detail strong {
  color: #94A3B8 !important;
}

[data-theme="dark"] .pt-estado {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .pt-estado-aprobada {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
}

[data-theme="dark"] .pt-estado-en-dynamics {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .pt-oferta-meta {
  color: #64748B !important;
}

/* Inputs y Select */
[data-theme="dark"] .pt-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .pt-input::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] .pt-input:focus {
  border-color: #F0923E !important;
  box-shadow: 0 0 0 3px rgba(240, 146, 62, 0.15) !important;
}

[data-theme="dark"] .pt-select {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .pt-select:focus {
  border-color: #F0923E !important;
  box-shadow: 0 0 0 3px rgba(240, 146, 62, 0.15) !important;
}

/* Botones */
[data-theme="dark"] .pt-btn-secondary {
  background: #263348 !important;
  color: #E2E8F0 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .pt-btn-secondary:hover:not(:disabled) {
  background: #334155 !important;
}

[data-theme="dark"] .pt-btn-danger {
  background: rgba(220, 38, 38, 0.1) !important;
  color: #F87171 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
}

[data-theme="dark"] .pt-btn-danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.2) !important;
}

/* Resultados de búsqueda */
[data-theme="dark"] .pt-results-header {
  color: #94A3B8 !important;
}

[data-theme="dark"] .pt-result-item {
  background: #0F172A !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .pt-result-item:hover {
  background: #263348 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .pt-result-code {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .pt-result-org {
  color: #94A3B8 !important;
}

[data-theme="dark"] .pt-result-details {
  color: #64748B !important;
}

[data-theme="dark"] .pt-no-results {
  background: #0F172A !important;
  color: #94A3B8 !important;
}

/* Sección manual */
[data-theme="dark"] .pt-divider {
  color: #64748B !important;
}

[data-theme="dark"] .pt-divider::before,
[data-theme="dark"] .pt-divider::after {
  background: #334155 !important;
}

/* Texto helpers */
[data-theme="dark"] .pt-text-muted {
  color: #94A3B8 !important;
}

/* Legacy classes (compatibilidad) */
[data-theme="dark"] .pt-integration,
[data-theme="dark"] .pt-panel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .pt-item {
  background: #0F172A !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .pt-title {
  color: #F1F5F9 !important;
}

/* ═══════════════════════════════════════════════════════════════
   31. OVERRIDE NUCLEAR — SECCIONES Y KANBAN CONTAINER
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] [style*="background-color: #f5f5f5"],
[data-theme="dark"] [style*="background-color:#f5f5f5"],
[data-theme="dark"] [style*="background-color: #fcfcfc"],
[data-theme="dark"] [style*="background-color:#fcfcfc"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:white"],
[data-theme="dark"] [style*="background-color: #ffffff"],
[data-theme="dark"] [style*="background-color:#ffffff"],
[data-theme="dark"] [style*="background-color: #fafafa"],
[data-theme="dark"] [style*="background-color:#fafafa"] {
  background-color: #1E293B !important;
}

[data-theme="dark"] [style*="color: #666"],
[data-theme="dark"] [style*="color:#666"],
[data-theme="dark"] [style*="color: #999"],
[data-theme="dark"] [style*="color:#999"],
[data-theme="dark"] [style*="color: #444"],
[data-theme="dark"] [style*="color:#444"] {
  color: #CBD5E1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   32. OVERRIDE GLOBAL — cualquier fondo blanco restante
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color:#000"],
[data-theme="dark"] [style*="color: black"],
[data-theme="dark"] [style*="color:black"] {
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   33. BRIEFING ADMIN
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .briefing-admin,
[data-theme="dark"] [data-theme="dark"] .briefing-admin {
  background: #0B1120 !important;
}

[data-theme="dark"] .briefing-card,
[data-theme="dark"] [data-theme="dark"] .briefing-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] [style*="background: #fffbeb"],
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background-color: #fffbeb"],
[data-theme="dark"] [style*="background-color:#fffbeb"] {
  background: #1E293B !important;
  background-color: #1E293B !important;
}

[data-theme="dark"] .vacation-row,
[data-theme="dark"] [data-theme="dark"] .vacation-row {
  background: #263348 !important;
}

[data-theme="dark"] .briefing-table,
[data-theme="dark"] [data-theme="dark"] .briefing-table {
  background: #1E293B !important;
}

[data-theme="dark"] .briefing-table th,
[data-theme="dark"] [data-theme="dark"] .briefing-table th {
  background: #0F172A !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background-color: #f9fafb"],
[data-theme="dark"] [style*="background-color:#f9fafb"] {
  background: #1E293B !important;
  background-color: #1E293B !important;
}

/* ═══════════════════════════════════════════════════════════════
   34. SCRAPER CONFIG
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .scraper-config,
[data-theme="dark"] [data-theme="dark"] .scraper-config {
  background: #0B1120 !important;
}

[data-theme="dark"] .sc-panel,
[data-theme="dark"] [data-theme="dark"] .sc-panel {
  background: var(--sc-panel-bg) !important;
  border: 1px solid var(--sc-border) !important;
}

[data-theme="dark"] .sc-card,
[data-theme="dark"] [data-theme="dark"] .sc-card {
  background: var(--sc-bg-card) !important;
  border: 1px solid var(--sc-border) !important;
  color: var(--sc-title) !important;
}

[data-theme="dark"] .sc-title,
[data-theme="dark"] [data-theme="dark"] .sc-title {
  color: var(--sc-title) !important;
}

[data-theme="dark"] .sc-subtitle,
[data-theme="dark"] [data-theme="dark"] .sc-subtitle {
  color: var(--sc-sub) !important;
}

[data-theme="dark"] .sc-input,
[data-theme="dark"] [data-theme="dark"] .sc-input {
  background: var(--sc-bg-input) !important;
  border: 1px solid var(--sc-border) !important;
  color: var(--sc-title) !important;
}

/* ═══════════════════════════════════════════════════════════════
   35. LEFT SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .left-sidebar,
[data-theme="dark"] [data-theme="dark"] .left-sidebar {
  background: #0F172A !important;
  border-right: 1px solid #334155 !important;
}

[data-theme="dark"] .left-sidebar-item,
[data-theme="dark"] [data-theme="dark"] .left-sidebar-item {
  color: #CBD5E1 !important;
}

[data-theme="dark"] .left-sidebar-item:hover,
[data-theme="dark"] [data-theme="dark"] .left-sidebar-item:hover {
  background: #1E293B !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .left-sidebar-item.active,
[data-theme="dark"] [data-theme="dark"] .left-sidebar-item.active {
  background: #263348 !important;
  color: #F1F5F9 !important;
  border-left: 3px solid #60A5FA !important;
}

[data-theme="dark"] [style*="--sidebar-bg"],
[data-theme="dark"] [data-theme="dark"] [style*="--sidebar-bg"] {
  --sidebar-bg: #0F172A !important;
}

[data-theme="dark"] [style*="--text-strong"],
[data-theme="dark"] [data-theme="dark"] [style*="--text-strong"] {
  --text-strong: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   36. WORKFLOW-APPLE ENHANCED
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .workflow-apple,
[data-theme="dark"] [data-theme="dark"] .workflow-apple {
  background: #0B1120 !important;
}

[data-theme="dark"] .workflow-board,
[data-theme="dark"] [data-theme="dark"] .workflow-board {
  background: #0F172A !important;
}

[data-theme="dark"] .workflow-column,
[data-theme="dark"] [data-theme="dark"] .workflow-column {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .workflow-card,
[data-theme="dark"] [data-theme="dark"] .workflow-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .workflow-card:hover,
[data-theme="dark"] [data-theme="dark"] .workflow-card:hover {
  background: #263348 !important;
}

[data-theme="dark"] .go-nogo-item,
[data-theme="dark"] [data-theme="dark"] .go-nogo-item {
  background: #1E293B !important;
}

[data-theme="dark"] .go-nogo-item.go,
[data-theme="dark"] [data-theme="dark"] .go-nogo-item.go {
  border-left: 4px solid #10B981 !important;
}

[data-theme="dark"] .go-nogo-item.nogo,
[data-theme="dark"] [data-theme="dark"] .go-nogo-item.nogo {
  border-left: 4px solid #EF4444 !important;
}

/* ═══════════════════════════════════════════════════════════════
   37. GRADIENT OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] [style*="linear-gradient(135deg, #f3f4f6"],
[data-theme="dark"] [style*="linear-gradient(135deg, #e5e7eb"],
[data-theme="dark"] [style*="linear-gradient(135deg,#f3f4f6"],
[data-theme="dark"] [style*="linear-gradient(135deg,#e5e7eb"],
[data-theme="dark"] [style*="linear-gradient(to right, #f3f4f6"],
[data-theme="dark"] [style*="linear-gradient(to right, #e5e7eb"],
[data-theme="dark"] [style*="linear-gradient(to bottom, #f3f4f6"],
[data-theme="dark"] [style*="linear-gradient(to bottom, #e5e7eb"] {
  background: linear-gradient(135deg, #1E293B, #263348) !important;
}

[data-theme="dark"] [style*="background: linear-gradient"],
[data-theme="dark"] [style*="background:linear-gradient"] {
  background: linear-gradient(135deg, #1E293B 0%, #263348 100%) !important;
}

/* ═══════════════════════════════════════════════════════════════
   38. COMPREHENSIVE INLINE STYLE CATCH-ALL
   ═══════════════════════════════════════════════════════════════ */

/* Light gray backgrounds */
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background:#f8f9fa"],
[data-theme="dark"] [style*="background-color: #f8f9fa"],
[data-theme="dark"] [style*="background-color:#f8f9fa"] {
  background: #1E293B !important;
  background-color: #1E293B !important;
}

/* Light yellow/warning backgrounds */
[data-theme="dark"] [style*="background: #fef3c7"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background-color: #fef3c7"],
[data-theme="dark"] [style*="background-color:#fef3c7"],
[data-theme="dark"] [style*="background: #fff3cd"],
[data-theme="dark"] [style*="background:#fff3cd"],
[data-theme="dark"] [style*="background-color: #fff3cd"],
[data-theme="dark"] [style*="background-color:#fff3cd"] {
  background: rgba(245, 158, 11, 0.15) !important;
  background-color: rgba(245, 158, 11, 0.15) !important;
}

/* Light blue backgrounds */
[data-theme="dark"] [style*="background: #e7f1ff"],
[data-theme="dark"] [style*="background:#e7f1ff"],
[data-theme="dark"] [style*="background-color: #e7f1ff"],
[data-theme="dark"] [style*="background-color:#e7f1ff"],
[data-theme="dark"] [style*="background: #dbeafe"],
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background-color: #dbeafe"],
[data-theme="dark"] [style*="background-color:#dbeafe"] {
  background: rgba(96, 165, 250, 0.15) !important;
  background-color: rgba(96, 165, 250, 0.15) !important;
}

/* Very light yellow */
[data-theme="dark"] [style*="background: #fffbeb"],
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background-color: #fffbeb"],
[data-theme="dark"] [style*="background-color:#fffbeb"] {
  background: rgba(245, 158, 11, 0.1) !important;
  background-color: rgba(245, 158, 11, 0.1) !important;
}

/* Light red/error backgrounds */
[data-theme="dark"] [style*="background: #fee2e2"],
[data-theme="dark"] [style*="background:#fee2e2"],
[data-theme="dark"] [style*="background-color: #fee2e2"],
[data-theme="dark"] [style*="background-color:#fee2e2"] {
  background: rgba(239, 68, 68, 0.15) !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
}

/* Light green/success backgrounds */
[data-theme="dark"] [style*="background: #dcfce7"],
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background-color: #dcfce7"],
[data-theme="dark"] [style*="background-color:#dcfce7"] {
  background: rgba(16, 185, 129, 0.15) !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
}

/* Light purple/indigo backgrounds */
[data-theme="dark"] [style*="background: #ede9fe"],
[data-theme="dark"] [style*="background:#ede9fe"],
[data-theme="dark"] [style*="background-color: #ede9fe"],
[data-theme="dark"] [style*="background-color:#ede9fe"] {
  background: rgba(139, 92, 246, 0.15) !important;
  background-color: rgba(139, 92, 246, 0.15) !important;
}

/* Additional gray variations */
[data-theme="dark"] [style*="background: #f5f5f7"],
[data-theme="dark"] [style*="background:#f5f5f7"],
[data-theme="dark"] [style*="background-color: #f5f5f7"],
[data-theme="dark"] [style*="background-color:#f5f5f7"],
[data-theme="dark"] [style*="background: #fafafa"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background-color: #fafafa"],
[data-theme="dark"] [style*="background-color:#fafafa"],
[data-theme="dark"] [style*="background: #f0f0f0"],
[data-theme="dark"] [style*="background:#f0f0f0"],
[data-theme="dark"] [style*="background-color: #f0f0f0"],
[data-theme="dark"] [style*="background-color:#f0f0f0"],
[data-theme="dark"] [style*="background: #f9f9f9"],
[data-theme="dark"] [style*="background:#f9f9f9"],
[data-theme="dark"] [style*="background-color: #f9f9f9"],
[data-theme="dark"] [style*="background-color:#f9f9f9"] {
  background: #1E293B !important;
  background-color: #1E293B !important;
}

/* Override for general white backgrounds not caught above */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:white"],
[data-theme="dark"] div[style*="background: white"],
[data-theme="dark"] div[style*="background:white"] {
  background: #1E293B !important;
  background-color: #1E293B !important;
}

/* ═══════════════════════════════════════════════════════════════
   39. SEARCH-GROUP — Contenedor principal de Buscar, Programar, Historial
   Las cajas blancas grandes que envuelven cada sección
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .search-group,
[data-theme="dark"] .search-group:not(.resumenes-preserve) {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .search-group:not(.resumenes-preserve):hover {
  border-color: #475569 !important;
}

[data-theme="dark"] .search-group h3,
[data-theme="dark"] .search-group:not(.resumenes-preserve) h3 {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .search-group p,
[data-theme="dark"] .search-group label,
[data-theme="dark"] .search-group span {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .search-group .text-gray-500,
[data-theme="dark"] .search-group .text-gray-400 {
  color: #94A3B8 !important;
}

/* Stat cards dentro de buscar (SOFTWARE, TELECOM, etc.) */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .search-stat-card,
[data-theme="dark"] .search-category-stat {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Empty state */
[data-theme="dark"] .search-empty,
[data-theme="dark"] .empty-state {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════
   40. PROGRAMAR BUSQUEDA — Scheduler section
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #programarBusqueda .search-group,
[data-theme="dark"] #programarBusqueda .card,
[data-theme="dark"] #programarBusqueda .panel {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Day buttons (Lun, Mar, etc.) */
[data-theme="dark"] .day-btn,
[data-theme="dark"] .schedule-day-btn,
[data-theme="dark"] .day-selector button {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

[data-theme="dark"] .day-btn.active,
[data-theme="dark"] .schedule-day-btn.active,
[data-theme="dark"] .day-selector button.active {
  background: #3B82F6 !important;
  color: #fff !important;
  border-color: #3B82F6 !important;
}

/* Type selection cards (Software, Telecom, etc. en Programar) */
[data-theme="dark"] .search-type-card,
[data-theme="dark"] .tipo-busqueda-card,
[data-theme="dark"] .schedule-type-option {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .search-type-card:hover,
[data-theme="dark"] .tipo-busqueda-card:hover,
[data-theme="dark"] .schedule-type-option:hover {
  background: #1E293B !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .search-type-card.active,
[data-theme="dark"] .tipo-busqueda-card.active,
[data-theme="dark"] .schedule-type-option.active {
  border-color: #3B82F6 !important;
}

/* Scheduled search list */
[data-theme="dark"] .scheduled-list-container,
[data-theme="dark"] .scheduled-search-item {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   41. HISTORIAL DE BUSQUEDAS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #historial .search-group,
[data-theme="dark"] .historial-container,
[data-theme="dark"] .historial-panel {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-filter-btn,
[data-theme="dark"] .historial-period-btn {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

[data-theme="dark"] .historial-filter-btn.active,
[data-theme="dark"] .historial-period-btn.active {
  background: #3B82F6 !important;
  color: #fff !important;
}

[data-theme="dark"] .historial-search-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .search-results-container,
[data-theme="dark"] .historial-results {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-result-item,
[data-theme="dark"] .search-result-card {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-result-item:hover,
[data-theme="dark"] .search-result-card:hover {
  background: #1E293B !important;
}

/* ═══════════════════════════════════════════════════════════════
   42. GESTION DE EQUIPOS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #equiposSection {
  color: #E2E8F0 !important;
}

/* Delegation panel (fondo crema/blanco) */
[data-theme="dark"] .delegacion-panel,
[data-theme="dark"] #delegacionSection,
[data-theme="dark"] #equiposSection .card,
[data-theme="dark"] #equiposSection .panel,
[data-theme="dark"] #equiposSection > div > div {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Team cards (AAPP Sales, Presales Team) */
[data-theme="dark"] .equipo-card,
[data-theme="dark"] #equiposGrid > div,
[data-theme="dark"] #equiposListContainer > div {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .equipo-card:hover,
[data-theme="dark"] #equiposGrid > div:hover {
  background: #263348 !important;
}

/* Delegation yellow info box */
[data-theme="dark"] .delegacion-info,
[data-theme="dark"] [class*="delegacion"] [style*="background: #fffbeb"],
[data-theme="dark"] [class*="delegacion"] [style*="background:#fffbeb"] {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #E2E8F0 !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Member list in team cards */
[data-theme="dark"] .equipo-miembro,
[data-theme="dark"] .team-member-item {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   43. FAVORITAS DE USUARIOS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #favoritasAdminSection {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-favoritas-container {
  background: transparent !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-favoritas-grid {
  background: transparent !important;
}

[data-theme="dark"] .admin-fav-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .admin-fav-card:hover {
  background: #263348 !important;
  border-color: #475569 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

[data-theme="dark"] .admin-fav-header {
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .admin-fav-expediente {
  color: #60A5FA !important;
}

[data-theme="dark"] .admin-fav-titulo {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .admin-fav-label {
  color: #94A3B8 !important;
}

[data-theme="dark"] .admin-fav-value {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-favoritas-stats {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   44. SEGUIMIENTO DE LICITACIONES
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #seguimientoSection {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .seg-filters,
[data-theme="dark"] .seg-header {
  background: transparent !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .seg-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .seg-card:hover {
  background: #263348 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .seg-card[data-estado="Adjudicada"] {
  border-left-color: #10b981 !important;
}

[data-theme="dark"] .seg-card[data-estado="Perdida"] {
  border-left-color: #ef4444 !important;
}

[data-theme="dark"] .seg-card-header {
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .seg-card-expediente {
  color: #60A5FA !important;
}

[data-theme="dark"] .seg-card-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .seg-card-organismo {
  color: #94A3B8 !important;
}

[data-theme="dark"] .seg-card-info {
  background: #0F172A !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .seg-card-info-label {
  color: #94A3B8 !important;
}

[data-theme="dark"] .seg-card-info-value {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .seg-card-stats {
  border-top-color: #334155 !important;
}

[data-theme="dark"] .seg-card-badges {
  background: transparent !important;
}

/* Seguimiento filter selects */
[data-theme="dark"] .seg-filter-select,
[data-theme="dark"] #seguimientoSection select {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .seg-tab,
[data-theme="dark"] .seg-tab-btn {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

[data-theme="dark"] .seg-tab.active,
[data-theme="dark"] .seg-tab-btn.active {
  background: #3B82F6 !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════════
   45. KANBAN — REFUERZO COMPLETO
   Columnas, tarjetas y título con fondo blanco
   ═══════════════════════════════════════════════════════════════ */

/* Título principal "Gestión Interna de Licitaciones" */
[data-theme="dark"] #kanbanLicitacionesSection > div:first-child,
[data-theme="dark"] #kanbanLicitacionesSection > .card,
[data-theme="dark"] #kanbanLicitacionesSection > div > .card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Kanban title h2/h3 */
[data-theme="dark"] #kanbanLicitacionesSection h2,
[data-theme="dark"] #kanbanLicitacionesSection h3 {
  color: #F1F5F9 !important;
}

/* Column bodies — FORZAR oscuro */
[data-theme="dark"] .kanban-column-stacked .kanban-cards-stack-container,
[data-theme="dark"] .kanban-column .kanban-cards-container {
  background: transparent !important;
}

/* Cards dentro de columnas — FORZAR FONDO OSCURO */
[data-theme="dark"] .kanban-card-stacked,
[data-theme="dark"] .kanban-card-stacked--modern,
[data-theme="dark"] .kanban-card,
[data-theme="dark"] .kanban-card-stacked[style],
[data-theme="dark"] .kanban-card[style] {
  background: #1A2332 !important;
  border: 1px solid #263348 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   46. RESUMENES DE PLIEGOS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #resumenesSection {
  color: #E2E8F0 !important;
}

[data-theme="dark"] #resumenesSection .search-group,
[data-theme="dark"] #resumenesSection .resumenes-preserve,
[data-theme="dark"] .resumenes-container,
[data-theme="dark"] #resumenesContainer {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .resumenes-toolbar,
[data-theme="dark"] .resumenes-toolbar.avanzada {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* PDF Analysis section */
[data-theme="dark"] #analisisPDFSection {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* File upload areas */
[data-theme="dark"] .file-upload-area,
[data-theme="dark"] [class*="upload"] {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   47. MIS LICITACIONES / GO-NOGO (vista estado)
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #misLicitacionesSection,
[data-theme="dark"] #misLicitacionesEstadoSection {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .licitacion-card,
[data-theme="dark"] .mis-licit-card,
[data-theme="dark"] #misLicitacionesEstadoSection .card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .licitacion-card:hover,
[data-theme="dark"] .mis-licit-card:hover {
  background: #263348 !important;
}

/* Stat cards en la parte superior */
[data-theme="dark"] .gonogo-stats,
[data-theme="dark"] .workflow-stats {
  background: transparent !important;
}

[data-theme="dark"] .gonogo-stat-card,
[data-theme="dark"] .workflow-stat-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   48. RENOVACIONES PANEL
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .renovacion-card,
[data-theme="dark"] .renovaciones-panel .card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .renovacion-card:hover {
  background: #263348 !important;
}

/* ═══════════════════════════════════════════════════════════════
   49. GLOBAL CATCH-ALL — CUALQUIER FONDO BLANCO RESTANTE
   Selectores de alta especificidad para container divs blancos
   ═══════════════════════════════════════════════════════════════ */

/* Cualquier div con class .card, .panel, .container con fondo blanco */
[data-theme="dark"] .card:not(.kanban-card):not(.kanban-card-stacked) {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Rounded containers (Tailwind) */
[data-theme="dark"] .rounded-xl:not(.badge):not(.pill):not([class*="btn"]),
[data-theme="dark"] .rounded-2xl:not(.badge):not(.pill):not([class*="btn"]),
[data-theme="dark"] .rounded-lg:not(.badge):not(.pill):not([class*="btn"]) {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Containers con padding que suelen ser paneles */
[data-theme="dark"] .p-6:not(button):not(a),
[data-theme="dark"] .p-8:not(button):not(a) {
  color: #E2E8F0 !important;
}

/* Shadow containers */
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-md,
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-xl,
[data-theme="dark"] [class*="shadow-"] {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* bg-white con Tailwind */
[data-theme="dark"] .bg-white {
  background-color: #1E293B !important;
}

/* bg-indigo-50 y similares */
[data-theme="dark"] .bg-indigo-50,
[data-theme="dark"] [class*="bg-indigo-5"] {
  background-color: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] .bg-yellow-50,
[data-theme="dark"] [class*="bg-yellow-5"] {
  background-color: rgba(245, 158, 11, 0.1) !important;
}

[data-theme="dark"] .bg-red-50,
[data-theme="dark"] [class*="bg-red-5"] {
  background-color: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="dark"] .bg-green-50,
[data-theme="dark"] [class*="bg-green-5"] {
  background-color: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] .bg-blue-50,
[data-theme="dark"] [class*="bg-blue-5"] {
  background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Tailwind hover backgrounds for dark */
[data-theme="dark"] .hover\:bg-gray-50:hover {
  background-color: #263348 !important;
}

[data-theme="dark"] .hover\:shadow-md:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* Labels y textos en todas las secciones */
[data-theme="dark"] .section label,
[data-theme="dark"] .section h2,
[data-theme="dark"] .section h3,
[data-theme="dark"] .section h4 {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .section p,
[data-theme="dark"] .section span:not([class*="badge"]):not([class*="pill"]):not([style*="background"]) {
  color: inherit !important;
}

/* Footer links */
[data-theme="dark"] footer,
[data-theme="dark"] .footer {
  color: #64748B !important;
}

[data-theme="dark"] footer a {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════
   50. MIS LICITACIONES — ML-CARD (inyectadas por misLicitaciones.js)
   Variables --ml-* ya definidas arriba en [data-theme="dark"]
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .ml-container {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .ml-stat-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .ml-stat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

[data-theme="dark"] .ml-stat-card.active {
  border-color: #60A5FA !important;
  background: rgba(96, 165, 250, 0.1) !important;
}

[data-theme="dark"] .ml-stat-number {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .ml-stat-label {
  color: #64748B !important;
}

[data-theme="dark"] .ml-search-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .ml-search-input::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] .ml-search-input:focus {
  border-color: #60A5FA !important;
}

[data-theme="dark"] .ml-sort-select {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .ml-count-label {
  color: #64748B !important;
}

[data-theme="dark"] .ml-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .ml-card:hover {
  background: #263348 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

[data-theme="dark"] .ml-card-header {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .ml-card-body {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .ml-titulo {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .ml-titulo:hover {
  background: rgba(96, 165, 250, 0.1) !important;
}

[data-theme="dark"] .ml-field-value {
  color: #94A3B8 !important;
}

[data-theme="dark"] .ml-field-value:hover {
  background: rgba(96, 165, 250, 0.1) !important;
}

[data-theme="dark"] .ml-field-value.ml-empty-field {
  color: #475569 !important;
}

[data-theme="dark"] .ml-field-value.ml-no-edit:hover {
  background: transparent !important;
}

[data-theme="dark"] .ml-field-label {
  opacity: 0.6 !important;
}

[data-theme="dark"] .ml-observaciones {
  color: #64748B !important;
  background: rgba(255,255,255,0.03) !important;
}

[data-theme="dark"] .ml-observaciones:hover {
  background: rgba(96, 165, 250, 0.1) !important;
}

[data-theme="dark"] .ml-observaciones.ml-empty-field {
  color: #475569 !important;
}

[data-theme="dark"] .ml-card-footer {
  border-color: #334155 !important;
}

[data-theme="dark"] .ml-action-btn {
  color: #94A3B8 !important;
}

[data-theme="dark"] .ml-action-btn:hover {
  background: rgba(96, 165, 250, 0.1) !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .ml-action-btn.danger:hover {
  background: rgba(255, 59, 48, 0.1) !important;
  color: #FCA5A5 !important;
}

[data-theme="dark"] .ml-expediente {
  background: rgba(96, 165, 250, 0.12) !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .ml-expediente:hover {
  background: rgba(96, 165, 250, 0.2) !important;
}

[data-theme="dark"] .ml-enlace-link {
  color: #60A5FA !important;
}

/* Inline editing inputs */
[data-theme="dark"] .ml-edit-input {
  background: #0F172A !important;
  border-color: #60A5FA !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .ml-edit-textarea {
  background: #0F172A !important;
  border-color: #60A5FA !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .ml-saving {
  color: #60A5FA !important;
}

/* Badges */
[data-theme="dark"] .ml-badge {
  color: inherit !important;
}

[data-theme="dark"] .ml-badge-go {
  background: rgba(52, 199, 89, 0.15) !important;
  color: #34D399 !important;
}

[data-theme="dark"] .ml-badge-nogo {
  background: rgba(255, 59, 48, 0.15) !important;
  color: #FCA5A5 !important;
}

[data-theme="dark"] .ml-badge-pending {
  background: rgba(255, 149, 0, 0.15) !important;
  color: #FBBF24 !important;
}

/* Empty state */
[data-theme="dark"] .ml-empty {
  color: #64748B !important;
}

/* ═══════════════════════════════════════════════════════════════
   51. RESUMENES DE PLIEGOS — TARJETAS DE RESULTADO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .resumen-card-modern {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .resumen-card-modern:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

[data-theme="dark"] .resumen-card-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-bottom-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .resumen-card-info {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .resumen-card-actions button,
[data-theme="dark"] .resumen-card-modern button {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .resumen-card-actions button:hover,
[data-theme="dark"] .resumen-card-modern button:hover {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

/* Resumen results list container */
[data-theme="dark"] #resumenesResultados,
[data-theme="dark"] .resumenes-results,
[data-theme="dark"] #listaResumenes {
  background: transparent !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   52. FAVORITAS — REFUERZO HEADER GRADIENTE
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .admin-fav-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-bottom: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

/* Double specificity para ganar a style.css */
[data-theme="dark"][data-theme="dark"] .admin-fav-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .admin-favoritas-grid {
  background: transparent !important;
}

/* Botones dentro de favoritas */
[data-theme="dark"] .admin-fav-card button,
[data-theme="dark"] .admin-fav-actions button {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .admin-fav-card button:hover,
[data-theme="dark"] .admin-fav-actions button:hover {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   53. HISTORIAL — FILTROS Y PANEL COMPLETO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .historial-filters {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .historial-config-btn {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .historial-config-btn:hover {
  background: #263348 !important;
}

[data-theme="dark"] .historial-config-panel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .config-row label {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .config-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .config-status {
  color: #64748B !important;
}

[data-theme="dark"] .btn-config-danger {
  background: transparent !important;
  color: #FCA5A5 !important;
  border-color: #ef4444 !important;
}

[data-theme="dark"] .btn-config-danger:hover {
  background: #ef4444 !important;
  color: #fff !important;
}

/* Filter chips */
[data-theme="dark"] .filter-chip {
  background: #0F172A !important;
  border-color: transparent !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .filter-chip:hover {
  background: #263348 !important;
}

[data-theme="dark"] .filter-chip.active {
  background: rgba(96, 165, 250, 0.15) !important;
  border-color: #60A5FA !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .filter-label,
[data-theme="dark"] .filter-label-small {
  color: #64748B !important;
}

/* Quick date buttons */
[data-theme="dark"] .quick-date-btn {
  background: #0F172A !important;
  border-color: transparent !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .quick-date-btn:hover {
  background: #263348 !important;
}

[data-theme="dark"] .quick-date-btn.active {
  background: rgba(96, 165, 250, 0.15) !important;
  border-color: #60A5FA !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .quick-date-btn.custom {
  border-color: #475569 !important;
  color: #64748B !important;
}

[data-theme="dark"] .quick-date-btn.custom:hover {
  border-color: #60A5FA !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .quick-date-btn.custom.active {
  background: #1E293B !important;
}

/* Date inputs */
[data-theme="dark"] .date-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .date-separator {
  color: #64748B !important;
}

[data-theme="dark"] .custom-date-inputs {
  background: #0F172A !important;
}

/* Filter inputs */
[data-theme="dark"] .filter-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .filter-input:focus {
  background: #1E293B !important;
  border-color: #60A5FA !important;
}

[data-theme="dark"] .filter-input::placeholder {
  color: #64748B !important;
}

/* ═══════════════════════════════════════════════════════════════
   54. GESTION DE USUARIOS — USER CARDS Y TABLA
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #equipoSection,
[data-theme="dark"] #adminSection,
[data-theme="dark"] .admin-section {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-user-filter {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-user-filter:focus {
  border-color: #60A5FA !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15) !important;
}

[data-theme="dark"] .btn-refresh-admin {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .btn-refresh-admin:hover {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

/* User cards generadas por usuarios.js con inline styles */
[data-theme="dark"] .user-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .user-row-header {
  color: #E2E8F0 !important;
}

/* Tablas de usuarios */
[data-theme="dark"] .admin-table,
[data-theme="dark"] .user-table,
[data-theme="dark"] table {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-table th,
[data-theme="dark"] .user-table th,
[data-theme="dark"] table th {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .admin-table td,
[data-theme="dark"] .user-table td,
[data-theme="dark"] table td {
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-table tr:hover td,
[data-theme="dark"] .user-table tr:hover td,
[data-theme="dark"] table tr:hover td {
  background: #263348 !important;
}

/* Select y botones dentro de user cards */
[data-theme="dark"] .user-card select,
[data-theme="dark"] .btn-rol-select {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* Expanded user detail panel */
[data-theme="dark"] .user-card .user-detail,
[data-theme="dark"] .user-card > div:last-child {
  background: #0F172A !important;
  border-top: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   55. GO-NOGO OVERLAY Y DECISION BUTTONS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .go-btn {
  background: linear-gradient(135deg, rgba(52,199,89,0.2) 0%, rgba(52,199,89,0.1) 100%) !important;
  color: #34D399 !important;
  border-color: rgba(52,199,89,0.3) !important;
}

[data-theme="dark"] .go-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(52,199,89,0.3) 0%, rgba(52,199,89,0.2) 100%) !important;
}

[data-theme="dark"] .go-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white !important;
}

[data-theme="dark"] .nogo-btn {
  background: linear-gradient(135deg, rgba(255,59,48,0.2) 0%, rgba(255,59,48,0.1) 100%) !important;
  color: #FCA5A5 !important;
  border-color: rgba(255,59,48,0.3) !important;
}

[data-theme="dark"] .nogo-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255,59,48,0.3) 0%, rgba(255,59,48,0.2) 100%) !important;
}

[data-theme="dark"] .nogo-btn.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
}

/* ═══════════════════════════════════════════════════════════════
   56. INLINE STYLE OVERRIDES — Elementos con style="background:#fff"
   Estos selectores [style*=...] capturan inline backgrounds
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background-color:#ffffff"] {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

/* Seguimiento inline white backgrounds */
[data-theme="dark"] #seguimientoSection [style*="background: white"],
[data-theme="dark"] #seguimientoSection [style*="background:#fff"],
[data-theme="dark"] #seguimientoSection [style*="background: #fff"] {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] #seguimientoSection [style*="background: #fff8f5"],
[data-theme="dark"] #seguimientoSection [style*="background:#fff3ed"] {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #E2E8F0 !important;
}

/* Renovaciones inline white */
[data-theme="dark"] .renovacion-detail [style*="background: white"],
[data-theme="dark"] .renovacion-detail [style*="background:#fff"] {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   57. RESULT-CARD — TARJETAS DE RESULTADOS DE BÚSQUEDA
   (Buscar Ahora, resultados de licitaciones en grid)
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .result-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .result-card:hover {
  background: #263348 !important;
  border-color: #60A5FA !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.4) !important;
}

/* Header de la tarjeta (gradiente claro → oscuro) */
[data-theme="dark"] .card-header-section {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .card-title-main {
  color: #F1F5F9 !important;
}

/* Body */
[data-theme="dark"] .card-body-section {
  color: #E2E8F0 !important;
}

/* Info grid labels y values */
[data-theme="dark"] .card-info-label {
  color: #64748B !important;
}

[data-theme="dark"] .card-info-value {
  color: #E2E8F0 !important;
}

/* Estado badges — versiones oscuras con color de fondo rebajado */
[data-theme="dark"] .estado-badge-card.publicada {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #34D399 !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}

[data-theme="dark"] .estado-badge-card.evaluacion {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #FBBF24 !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] .estado-badge-card.adjudicada {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60A5FA !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .estado-badge-card.cerrada {
  background: rgba(107, 114, 128, 0.15) !important;
  color: #94A3B8 !important;
  border-color: rgba(107, 114, 128, 0.3) !important;
}

/* Importe — mantener el gradiente pero para dark */
[data-theme="dark"] .importe-value {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Fecha límite — versiones oscuras de los colores de urgencia */
[data-theme="dark"] .fecha-limite-card {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

[data-theme="dark"] .fecha-limite-card.proxima {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}

[data-theme="dark"] .fecha-limite-card.urgente {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .fecha-limite-text {
  color: #FCA5A5 !important;
}

[data-theme="dark"] .dias-restantes {
  background: #0F172A !important;
  color: #FCA5A5 !important;
}

/* Sección de acciones (fondo gris claro → oscuro) */
[data-theme="dark"] .card-actions-section {
  background: #0F172A !important;
  border-top-color: #334155 !important;
}

/* Enlaces */
[data-theme="dark"] .link-licitacion a,
[data-theme="dark"] .lic-link {
  color: #60A5FA !important;
}

[data-theme="dark"] .link-licitacion a:hover,
[data-theme="dark"] .lic-link:hover {
  color: #93C5FD !important;
}

/* Botón capturar enlace */
[data-theme="dark"] .capturar-enlace-btn {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #60A5FA !important;
}

[data-theme="dark"] .capturar-enlace-btn:hover {
  background: #263348 !important;
  border-color: #60A5FA !important;
}

/* Botón favorito */
[data-theme="dark"] .add-fav-btn {
  background: #0F172A !important;
  color: #94A3B8 !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .add-fav-btn:hover:not(:disabled) {
  background: #1E293B !important;
  color: #FBBF24 !important;
  border-color: #FBBF24 !important;
}

[data-theme="dark"] .add-fav-btn:disabled {
  background: rgba(34, 197, 94, 0.1) !important;
  color: #34D399 !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}

/* Botón quitar favorito */
[data-theme="dark"] .remove-fav-btn {
  background: #0F172A !important;
  color: #FCA5A5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .remove-fav-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
}

/* Botón analizar — mantener gradiente púrpura */
[data-theme="dark"] .analizar-btn:disabled {
  background: #334155 !important;
  color: #64748B !important;
}

/* Pill auto y companero */
[data-theme="dark"] .pill-auto {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #FBBF24 !important;
}

[data-theme="dark"] .pill-companero {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60A5FA !important;
}

/* Botón No me interesa */
[data-theme="dark"] .btn-no-me-interesa-thoria {
  background: #0F172A !important;
  color: #64748B !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] .btn-no-me-interesa-thoria:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #FCA5A5 !important;
}

/* Botón abrir en gestión interna */
[data-theme="dark"] .btn-thoria-open-workflow {
  background: rgba(96, 165, 250, 0.1) !important;
  color: #60A5FA !important;
  border: 1px solid rgba(96, 165, 250, 0.3) !important;
}

[data-theme="dark"] .btn-thoria-open-workflow:hover {
  background: rgba(96, 165, 250, 0.2) !important;
}

/* ═══════════════════════════════════════════════════════════════
   58. FAVORITAS — FOOTER Y BODY REFUERZO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .admin-fav-footer {
  background: #0F172A !important;
  border-top-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-fav-date {
  color: #64748B !important;
}

[data-theme="dark"] .admin-fav-body {
  background: transparent !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-fav-info-item {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .admin-fav-user {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #34D399 !important;
}

/* ═══════════════════════════════════════════════════════════════
   59. NOTIFICACIONES — PANEL, ITEMS, BADGE
   El notifications.css y style.css fuerzan fondo blanco con !important
   ═══════════════════════════════════════════════════════════════ */

/* Panel principal de notificaciones (notifications.css override) */
[data-theme="dark"] #notifMenu {
  background-color: #1E293B !important;
  background: linear-gradient(135deg, #1E293B 0%, #263348 100%) !important;
  color: #E2E8F0 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] #notifMenu li {
  color: #E2E8F0 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] #notifMenu li p {
  color: #E2E8F0 !important;
}

[data-theme="dark"] #notifMenu li * {
  color: inherit !important;
}

[data-theme="dark"] #notifMenu li .mark-read {
  color: #60A5FA !important;
}

/* Centro de notificaciones (style.css override) */
[data-theme="dark"] #notificacionesCenter .notificaciones-panel,
[data-theme="dark"] .notificaciones-center .notificaciones-panel {
  background: #1E293B !important;
  border-color: #334155 !important;
  box-shadow: 0 10px 50px rgba(0,0,0,0.5) !important;
}

[data-theme="dark"] #notificacionesCenter .notificaciones-lista,
[data-theme="dark"] .notificaciones-center .notificaciones-lista {
  background: #0F172A !important;
}

[data-theme="dark"] #notificacionesCenter .notificacion-item,
[data-theme="dark"] .notificaciones-center .notificacion-item {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

[data-theme="dark"] #notificacionesCenter .notificacion-item:hover,
[data-theme="dark"] .notificaciones-center .notificacion-item:hover {
  background: #263348 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] #notificacionesCenter .notificaciones-empty,
[data-theme="dark"] .notificaciones-center .notificaciones-empty {
  background: #1E293B !important;
  color: #64748B !important;
}

[data-theme="dark"] #notificacionesCenter .notificaciones-btn,
[data-theme="dark"] .notificaciones-center .notificaciones-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #60A5FA !important;
}

[data-theme="dark"] #notificacionesCenter .notificaciones-badge,
[data-theme="dark"] .notificaciones-center .notificaciones-badge {
  border-color: #0F172A !important;
}

/* Sub-elementos de cada notificación */
[data-theme="dark"] .notificacion-icono {
  background: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .notificacion-texto {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .notificacion-texto strong {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .notificacion-meta {
  color: #94A3B8 !important;
}

[data-theme="dark"] .notificacion-fecha {
  color: #64748B !important;
}

[data-theme="dark"] .notificacion-dot {
  background: #818CF8 !important;
}

[data-theme="dark"] .notificacion-item {
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .notificacion-item:hover {
  background: #263348 !important;
}

/* Header actions buttons */
[data-theme="dark"] .notificaciones-header .btn-marcar-todas,
[data-theme="dark"] .notificaciones-header .btn-refresh-notif {
  background: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
  border: none !important;
}

[data-theme="dark"] .notificaciones-header .btn-marcar-todas:hover,
[data-theme="dark"] .notificaciones-header .btn-refresh-notif:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Bell button en dark mode */
[data-theme="dark"] .notificaciones-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #A5B4FC !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════
   59b. MODAL DETALLE COMPETIDOR (Inteligencia de Mercado)
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] #modal-competidor-detalle .modal-competidor-contenido {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] #modal-competidor-detalle h2,
[data-theme="dark"] #modal-competidor-detalle h3,
[data-theme="dark"] #modal-competidor-detalle h4 {
  color: #F1F5F9 !important;
}

[data-theme="dark"] #modal-competidor-detalle #btn-cerrar-competidor {
  background: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] #modal-competidor-detalle #btn-cerrar-competidor:hover {
  background: #475569 !important;
}

/* Stat cards */
[data-theme="dark"] #modal-competidor-detalle div[style*="background: #f3f4f6"] {
  background: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] #modal-competidor-detalle div[style*="color: #6b7280"] {
  color: #94A3B8 !important;
}

/* Tables */
[data-theme="dark"] #modal-competidor-detalle table {
  color: #E2E8F0 !important;
}

[data-theme="dark"] #modal-competidor-detalle thead tr {
  background: #0F172A !important;
}

[data-theme="dark"] #modal-competidor-detalle th {
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] #modal-competidor-detalle td {
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
}

[data-theme="dark"] #modal-competidor-detalle tr[style*="border-bottom"] {
  border-color: #334155 !important;
}

[data-theme="dark"] #modal-competidor-detalle div[style*="border: 1px solid #e5e7eb"] {
  border-color: #334155 !important;
}

/* ═══════════════════════════════════════════════════════════════
   60. USER-INFO BADGE (esquina superior derecha)
   style.css tiene background: rgba(255,255,255,0.95)
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .user-info {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #E2E8F0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .user-info:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   61. THORIA CHAT — DRAWER, MENSAJES, INPUT
   ═══════════════════════════════════════════════════════════════ */

/* Drawer panel */
[data-theme="dark"] .thoria-drawer {
  background: #1E293B !important;
  border-color: #334155 !important;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5) !important;
}

/* Messages area */
[data-theme="dark"] .thoria-messages {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
}

[data-theme="dark"] .thoria-messages::-webkit-scrollbar-track {
  background: #0F172A !important;
}

[data-theme="dark"] .thoria-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* Bot messages (burbujas de respuesta) */
[data-theme="dark"] .message.bot {
  background: linear-gradient(135deg, #1E293B 0%, #263348 100%) !important;
  color: #E2E8F0 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .message.bot::after {
  border-right-color: #263348 !important;
}

[data-theme="dark"] .message.bot .timestamp {
  color: #64748B !important;
}

/* User messages — mantener gradiente azul */
[data-theme="dark"] .message.user {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: #fff !important;
}

/* Input area */
[data-theme="dark"] .thoria-input-area {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-top-color: #334155 !important;
}

[data-theme="dark"] .thoria-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2) !important;
}

[data-theme="dark"] .thoria-input:focus {
  border-color: #3b82f6 !important;
  background: #1E293B !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .thoria-input::placeholder {
  color: #64748B !important;
}

/* Send button disabled */
[data-theme="dark"] .thoria-send:disabled {
  background: linear-gradient(135deg, #334155 0%, #475569 100%) !important;
  color: #64748B !important;
}

/* Typing indicator */
[data-theme="dark"] .typing-indicator {
  background: linear-gradient(135deg, #1E293B 0%, #263348 100%) !important;
  border-color: #334155 !important;
}

/* Float button border */
[data-theme="dark"] .thoria-float-btn {
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* Modal de thoria (thoria.js inline styles) */
[data-theme="dark"] .thoria-modal,
[data-theme="dark"] [style*="background: white"][style*="border-radius: 12px"] {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

/* Welcome message */
[data-theme="dark"] .welcome-message {
  background: linear-gradient(135deg, rgba(96,165,250,0.1) 0%, rgba(59,130,246,0.15) 100%) !important;
  border-color: rgba(96,165,250,0.3) !important;
  color: #93C5FD !important;
}

/* Thoria body & input row */
[data-theme="dark"] .thoria-body {
  background: transparent !important;
}

[data-theme="dark"] .thoria-input-row {
  background: transparent !important;
}

/* Send button orange gradient — mantener */
[data-theme="dark"] .thoria-send {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════
   62. RENOVACIONES PENDIENTES PANEL (slide-in izquierda)
   CSS inyectado por renovaciones-panel.js
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .renovaciones-panel {
  background: #0F172A !important;
  box-shadow: 4px 0 30px rgba(0,0,0,0.5) !important;
}

/* Header verde — mantener gradiente verde */

[data-theme="dark"] .renovaciones-panel-info {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}

[data-theme="dark"] .renovaciones-panel-info p {
  color: #34D399 !important;
}

[data-theme="dark"] .renovaciones-panel-content {
  background: transparent !important;
}

[data-theme="dark"] .renovaciones-loading {
  color: #64748B !important;
}

[data-theme="dark"] .renovacion-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

[data-theme="dark"] .renovacion-card:hover {
  background: #263348 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .renovacion-card-expediente {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
}

[data-theme="dark"] .renovacion-card-titulo {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .renovacion-card-organismo,
[data-theme="dark"] .renovacion-card-meta {
  color: #94A3B8 !important;
}

[data-theme="dark"] .renovacion-btn-dynamics {
  background: #0F172A !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .renovacion-btn-dynamics:hover {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .renovaciones-empty-state {
  color: #64748B !important;
}

/* ═══════════════════════════════════════════════════════════════
   63. HISTORIAL DE ELIMINACIONES PANEL (slide-in derecha)
   CSS en style.css lineas 9070-9382
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .historial-panel-overlay {
  background: rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"][data-theme="dark"] .historial-panel {
  background: #0F172A !important;
  box-shadow: -4px 0 30px rgba(0,0,0,0.5) !important;
}

/* Header oscuro — mantener gradiente gris oscuro que ya combina */

/* Stats bar */
[data-theme="dark"] .historial-panel-stats {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .historial-stat {
  background: #0F172A !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .historial-stat-value {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .historial-stat-label {
  color: #64748B !important;
}

[data-theme="dark"] .historial-stat.no-go .historial-stat-value {
  color: #FCA5A5 !important;
}

[data-theme="dark"] .historial-stat.manual .historial-stat-value {
  color: #94A3B8 !important;
}

/* Filters */
[data-theme="dark"] .historial-panel-filters {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .historial-search {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-search:focus {
  border-color: #60A5FA !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15) !important;
}

[data-theme="dark"] .historial-search::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] .historial-filter-select {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

/* History items */
[data-theme="dark"][data-theme="dark"] .historial-item {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-item:hover {
  background: #263348 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .historial-item-tipo.no-go {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #FCA5A5 !important;
}

[data-theme="dark"] .historial-item-tipo.manual {
  background: rgba(107, 114, 128, 0.15) !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .historial-item-titulo {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .historial-item-organismo,
[data-theme="dark"] .historial-item-meta,
[data-theme="dark"] .historial-item-motivo-label {
  color: #94A3B8 !important;
}

[data-theme="dark"] .historial-item-motivo {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  color: #FBBF24 !important;
}

[data-theme="dark"] .historial-item-user,
[data-theme="dark"] .historial-item-date {
  color: #64748B !important;
}

/* Footer / pagination */
[data-theme="dark"] .historial-panel-footer {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .historial-panel-footer button {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .historial-panel-footer button:hover {
  background: #263348 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .historial-panel-footer button.active {
  background: #3B82F6 !important;
  color: white !important;
}

/* ═══════════════════════════════════════════════════════════════
   64. GESTIÓN DE INVITACIONES MODAL (centered overlay)
   CSS en style.css lineas 3848-4097
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] .modal-overlay-invitacion {
  background: rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .modal-container-invitacion {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .modal-header-invitacion {
  border-color: #334155 !important;
}

[data-theme="dark"] .modal-title-invitacion {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .modal-close-btn {
  color: #94A3B8 !important;
}

[data-theme="dark"] .modal-close-btn:hover {
  background: #1E293B !important;
  color: #E2E8F0 !important;
}

/* Export section (tiene inline styles, override con selector de especificidad) */
[data-theme="dark"] .modal-body-invitacion > div:first-child {
  background: linear-gradient(135deg, #1E293B 0%, #263348 100%) !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .modal-body-invitacion > div:first-child h3 {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .modal-body-invitacion > div:first-child p {
  color: #94A3B8 !important;
}

/* Info box */
[data-theme="dark"] .modal-info-box {
  background: rgba(96, 165, 250, 0.1) !important;
  border-color: rgba(96, 165, 250, 0.2) !important;
}

[data-theme="dark"] .modal-info-box p {
  color: #93C5FD !important;
}

/* Upload area */
[data-theme="dark"] .upload-area {
  border-color: #334155 !important;
  background: transparent !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .upload-area:hover {
  background: rgba(139, 92, 246, 0.05) !important;
  border-color: #8b5cf6 !important;
}

[data-theme="dark"] .upload-area.drag-over {
  background: rgba(139, 92, 246, 0.1) !important;
  border-color: #8b5cf6 !important;
}

[data-theme="dark"] .upload-area p {
  color: #94A3B8 !important;
}

/* File preview */
[data-theme="dark"] .file-preview {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .file-name {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .file-size {
  color: #64748B !important;
}

/* Form inputs */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .modern-input {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .modern-input:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
  background: #0F172A !important;
}

[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] .form-textarea::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] .form-group label {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .datos-adicionales h3 {
  color: #F1F5F9 !important;
}

/* Modal footer */
[data-theme="dark"] .modal-footer-invitacion {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .btn-cancel {
  background: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .btn-cancel:hover {
  background: #475569 !important;
}

/* Export buttons */
[data-theme="dark"] .btn-export-pdf {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .btn-export-pdf:hover {
  background: #263348 !important;
}

[data-theme="dark"] .btn-export-excel {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .btn-export-excel:hover {
  background: #263348 !important;
}

/* Invitaciones list inside modal */
[data-theme="dark"] .invitaciones-list,
[data-theme="dark"] .invitacion-item {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .invitacion-item:hover {
  background: #263348 !important;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT DE COMENTARIOS — Kanban / Modal licitación
   ═══════════════════════════════════════════════════════════════ */

/* Variables CSS del chat: sobreescribir para dark */
[data-theme="dark"] {
  --th-naranja: #F0923E;
  --th-naranja-oscuro: #d9620f;
  --th-azul: #60A5FA;
  --th-borde: #334155;
  --th-texto: #E2E8F0;
  --th-dim: #94A3B8;
  --th-gris: #0F172A;
}

/* Sección contenedora */
[data-theme="dark"] .modal-comments-section {
  background: transparent !important;
  border-top-color: #334155 !important;
}

/* Título */
[data-theme="dark"] .modal-comments-title,
[data-theme="dark"] #chatComentarios .modal-comments-title {
  color: #E2E8F0 !important;
}

/* Badge contador */
[data-theme="dark"] .badge-soft {
  background: rgba(240, 146, 62, 0.2) !important;
  color: #F0923E !important;
  border-color: rgba(240, 146, 62, 0.3) !important;
}

/* Lista de comentarios */
[data-theme="dark"] #chatComentarios .modal-comments-list {
  background: #0B1120 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] #chatComentarios .modal-comments-list::-webkit-scrollbar-thumb {
  background: #475569 !important;
}

/* Tarjeta de comentario individual */
[data-theme="dark"] .modal-comment,
[data-theme="dark"] #chatComentarios .modal-comment {
  background: #1E293B !important;
  border-color: #334155 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .modal-comment:hover,
[data-theme="dark"] #chatComentarios .modal-comment:hover {
  background: #263348 !important;
  border-color: #475569 !important;
}

/* Comentario no leído */
[data-theme="dark"] #chatComentarios .modal-comment--unread {
  border-color: #F0923E !important;
  box-shadow: 0 0 0 3px rgba(240, 146, 62, 0.15) inset !important;
}

/* Autor */
[data-theme="dark"] .modal-comment-author,
[data-theme="dark"] #chatComentarios .modal-comment-author {
  color: #60A5FA !important;
}

/* Fecha */
[data-theme="dark"] .modal-comment-date,
[data-theme="dark"] #chatComentarios .modal-comment-date {
  color: #94A3B8 !important;
}

/* Contenido del comentario */
[data-theme="dark"] .modal-comment-content,
[data-theme="dark"] #chatComentarios .modal-comment-content {
  color: #E2E8F0 !important;
}

/* Imágenes adjuntas */
[data-theme="dark"] #chatComentarios .modal-comment-images img {
  border-color: #334155 !important;
  background: #0F172A !important;
}

/* Estado vacío */
[data-theme="dark"] .modal-no-comments,
[data-theme="dark"] #chatComentarios .modal-no-comments {
  color: #64748B !important;
  background: #0F172A !important;
  border-color: #334155 !important;
}

/* Formulario de envío */
[data-theme="dark"] #chatComentarios .modal-comment-form {
  background: #1E293B !important;
  border-top-color: #334155 !important;
}

/* Textarea */
[data-theme="dark"] .modal-comment-input,
[data-theme="dark"] #chatComentarios .modal-comment-input {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .modal-comment-input::placeholder,
[data-theme="dark"] #chatComentarios .modal-comment-input::placeholder {
  color: #64748B !important;
}

[data-theme="dark"] #chatComentarios .modal-comment-input:focus {
  border-color: #F0923E !important;
  box-shadow: 0 0 0 3px rgba(240, 146, 62, 0.15) !important;
}

/* Botón Enviar */
[data-theme="dark"] #chatComentarios .modal-comment-submit.btn-soft {
  background: linear-gradient(180deg, #F0923E, #d9620f) !important;
  color: #fff !important;
}

/* Botón Adjuntar */
[data-theme="dark"] .btn-soft,
[data-theme="dark"] .btn-attach {
  background: #263348 !important;
  border-color: #475569 !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .btn-soft:hover,
[data-theme="dark"] .btn-attach:hover {
  background: #334155 !important;
}

/* Estado del comentario */
[data-theme="dark"] .modal-comment-status {
  color: #94A3B8 !important;
}

/* Reacciones */
[data-theme="dark"] .btn-reaccion {
  background: #263348 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .btn-reaccion span {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .btn-reaccion.activa {
  background: rgba(96, 165, 250, 0.15) !important;
  border-color: #60A5FA !important;
}

/* Vistos ("Visto por X") */
[data-theme="dark"] .comment-vistos {
  color: #64748B !important;
}

/* Badge "Nuevo" en comentarios no leídos */
[data-theme="dark"] .modal-comment .bg-yellow-200 {
  background: rgba(240, 146, 62, 0.2) !important;
  color: #F0923E !important;
}

/* Dropdown de menciones @usuario */
[data-theme="dark"] .mencion-dropdown,
[data-theme="dark"] #mencion-dropdown {
  background: #1E293B !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .mencion-item {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .mencion-item--selected,
[data-theme="dark"] .mencion-item:hover {
  background: #263348 !important;
}

/* Preview de imágenes pegadas */
[data-theme="dark"] #previewPegadas {
  background: #0F172A !important;
  border-color: #334155 !important;
}

/* Limpiar clean theme variants para dark */
[data-theme="dark"] .modal-comments-list--clean .modal-comment {
  border-color: #334155 !important;
}

[data-theme="dark"] .modal-comment-form--clean {
  border-top-color: #334155 !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Section 60: Comparativa Precios tab (IM)
   ───────────────────────────────────────────────────────────────────────────── */

[data-theme="dark"] #im-tab-comparativa {
  color: #E2E8F0 !important;
}

/* Stat cards */
[data-theme="dark"] .comp-stat-card {
  background: #1E293B !important;
}

/* Filtros */
[data-theme="dark"] .comparativa-filtros select,
[data-theme="dark"] #im-tab-comparativa select {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .comparativa-filtros label,
[data-theme="dark"] #im-tab-comparativa label {
  color: #CBD5E1 !important;
}

[data-theme="dark"] .comp-vista-btn {
  background: #334155 !important;
  color: #E2E8F0 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .comp-vista-btn.active {
  background: var(--wf-accent, #3b82f6) !important;
  color: #fff !important;
}

/* Tabla resumen */
[data-theme="dark"] .comparativa-table,
[data-theme="dark"] #im-tab-comparativa table {
  color: #E2E8F0 !important;
}

[data-theme="dark"] .comparativa-table thead tr,
[data-theme="dark"] #im-tab-comparativa thead tr {
  background: #0F172A !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .comparativa-table th,
[data-theme="dark"] #im-tab-comparativa th {
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .comparativa-table td,
[data-theme="dark"] #im-tab-comparativa td {
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
}

[data-theme="dark"] .comparativa-row:hover {
  background: #1E293B !important;
}

[data-theme="dark"] #im-tab-comparativa div[style*="border: 1px solid"] {
  border-color: #334155 !important;
}

/* Licitación card (vista detalle) */
[data-theme="dark"] .comparativa-licitacion-card {
  background: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .comparativa-licitacion-card div[style*="background: var(--wf-bg-tertiary"],
[data-theme="dark"] .comparativa-licitacion-card > div:first-child {
  background: #0F172A !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .comparativa-licitacion-card div[style*="font-weight: 700"] {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .comparativa-licitacion-card div[style*="color: var(--wf-text-secondary"] {
  color: #94A3B8 !important;
}

/* NCE ref footer in card */
[data-theme="dark"] .comparativa-licitacion-card > div:last-child {
  border-color: #334155 !important;
  color: #64748B !important;
}

/* Pagination buttons */
[data-theme="dark"] #im-tab-comparativa button[onclick*="loadComparativaPage"] {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  border-color: #475569 !important;
}

/* Resultado badges */
[data-theme="dark"] #im-tab-comparativa span[style*="background: #dcfce7"] {
  background: #064E3B !important;
  color: #6EE7B7 !important;
}
[data-theme="dark"] #im-tab-comparativa span[style*="background: #fef2f2"] {
  background: #7F1D1D !important;
  color: #FCA5A5 !important;
}
[data-theme="dark"] #im-tab-comparativa span[style*="background: #fefce8"] {
  background: #713F12 !important;
  color: #FDE68A !important;
}
[data-theme="dark"] #im-tab-comparativa span[style*="background: #f3f4f6"] {
  background: #334155 !important;
  color: #94A3B8 !important;
}

/* Offshore highlight row */
[data-theme="dark"] #im-tab-comparativa tr[style*="background: var(--wf-accent-bg"] {
  background: #172554 !important;
}

/* Adjudicatario highlight row */
[data-theme="dark"] #im-tab-comparativa tr[style*="background: var(--wf-success-bg"] {
  background: #052E16 !important;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL TABS - Pestañas del modal de licitación
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] .modal-tabs-bar {
  background: #0F172A !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .modal-tab-btn {
  color: #94A3B8 !important;
  border-bottom-color: transparent !important;
}

[data-theme="dark"] .modal-tab-btn:hover {
  color: #E2E8F0 !important;
  background: #1E293B !important;
}

[data-theme="dark"] .modal-tab-btn.active {
  color: #60A5FA !important;
  border-bottom-color: #60A5FA !important;
  background: transparent !important;
}

[data-theme="dark"] .modal-tab-panel {
  background: transparent !important;
}

[data-theme="dark"] .modal-tab-badge {
  background: #334155 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .modal-tab-btn.active .modal-tab-badge {
  background: rgba(96, 165, 250, 0.2) !important;
  color: #60A5FA !important;
}
