/* ============================================================
   Tema oscuro MDRP para el monitor (mismos colores que mdrp.rsec.ai).
   Se carga después de los estilos del panel: para volver al tema claro
   basta con quitar la línea <link ... mdrp-dark.css> de la plantilla.
   ============================================================ */
:root {
    --bg-body: #09090C;
    --topbar-bg: #0F1014;
    --card-bg: #121317;
    --card-subtle: #16181E;
    --border-color: #24262E;
    --border-highlight: #33363F;
    --text-main: #E6E8EE;
    --text-muted: #A3A8B4;
    --accent-blue: #3B82F6;
    --accent-hover: #2563EB;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
}

html, body { background: var(--bg-body) !important; color: var(--text-main); }

/* Encabezado: acento rojo de MDRP en lugar del azul */
.zerofox-header { border-bottom-color: #CC2027 !important; }
.brand-divider { color: #33363F; }

/* Fondos claros escritos directo en el HTML/JS del panel */
[style*="background:#f8fafc"], [style*="background: #f8fafc"],
[style*="background-color:#f8fafc"], [style*="background-color: #f8fafc"],
[style*="background:#f1f5f9"], [style*="background: #f1f5f9"] {
    background: var(--card-subtle) !important;
}
[style*="background:#fff"], [style*="background: #fff"],
[style*="background:#ffffff"], [style*="background: #ffffff"],
[style*="background-color:#fff"], [style*="background-color: #fff"],
[style*="background:white"], [style*="background: white"] {
    background: var(--card-bg) !important;
}
[style*="color:#0f172a"], [style*="color: #0f172a"],
[style*="color:#1e293b"], [style*="color: #1e293b"],
[style*="color:#334155"], [style*="color: #334155"] {
    color: var(--text-main) !important;
}
[style*="border:1px solid #e2e8f0"], [style*="border: 1px solid #e2e8f0"] {
    border-color: var(--border-color) !important;
}

/* Tarjetas, paneles y widgets */
.kpi-card, .toolbar-card, .chart-widget, .workspace-card, .logo-card,
.critical-alerts-panel, .critical-alert-card, .escalated-panel, .tab-content {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main);
}
.chart-widget-header, .escalated-header { background: var(--card-subtle) !important; border-color: var(--border-color) !important; }

/* Tablas */
.soc-table, .soc-table th, .soc-table td { border-color: var(--border-color) !important; }
.soc-table thead th, .soc-table th { background: var(--card-subtle) !important; color: var(--text-muted) !important; }
.soc-table tbody tr { background: var(--card-bg); }
.soc-table tbody tr:nth-child(even) { background: #14161B; }
.soc-table tbody tr:hover { background: #1C1F27 !important; }
.table-link { color: #60A5FA; }

/* Pestañas */
.nav-tabs { border-bottom-color: var(--border-color) !important; }
.tab-button { color: var(--text-muted); }
.tab-button:hover { color: var(--text-main); }

/* Botones secundarios y menús */
.btn-secondary { background: #1C1F27 !important; color: var(--text-main) !important; border-color: var(--border-color) !important; }
.btn-secondary:hover { background: #24262E !important; }
.btn-primary { background: #CC2027 !important; border-color: #CC2027 !important; }
.btn-primary:hover { background: #E0262E !important; }
.settings-dropdown, .settings-menu, .action-dropdown .dropdown-menu, .zerofox-menu {
    background: var(--card-bg) !important; border-color: var(--border-color) !important;
}
.settings-menu-item, .zerofox-menu-item, .action-dropdown .dropdown-menu .dropdown-item { color: var(--text-main) !important; }
.settings-menu-item:hover, .zerofox-menu-item:hover, .action-dropdown .dropdown-menu .dropdown-item:hover {
    background: #1C1F27 !important; color: #FFFFFF !important;
}
.tenant-list-item { border-color: var(--border-color) !important; }
.tenant-list-item:hover { background: #1C1F27 !important; }

/* Modales */
.modal-box { background: var(--card-bg) !important; border: 1px solid var(--border-color); color: var(--text-main); }
.modal-header { background: var(--card-subtle) !important; border-color: var(--border-color) !important; }
.modal-body { background: var(--card-bg) !important; }
.modal-overlay { background: rgba(0, 0, 0, 0.7) !important; }

/* Formularios */
input, select, textarea, .modal-search {
    background: #0F1014 !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}
input::placeholder, textarea::placeholder { color: #5C6070 !important; }
input:focus, select:focus, textarea:focus, .modal-search:focus {
    border-color: #CC2027 !important;
    box-shadow: 0 0 0 3px rgba(204, 32, 39, 0.18) !important;
    outline: none;
}
option { background: #121317; color: var(--text-main); }

/* Etiquetas suaves (fondos pastel) legibles sobre oscuro */
.type-badge, .badge-risk, .soc-badge, .tenant-badge { filter: saturate(1.05); }
[style*="background:#fee2e2"], [style*="background: #fee2e2"], [style*="background:#fef2f2"], [style*="background: #fef2f2"] { background: rgba(220, 38, 38, 0.14) !important; }
[style*="background:#fef9c3"], [style*="background: #fef9c3"], [style*="background:#ffedd5"], [style*="background: #ffedd5"] { background: rgba(234, 179, 8, 0.14) !important; }
[style*="background:#f0fdf4"], [style*="background: #f0fdf4"] { background: rgba(34, 197, 94, 0.14) !important; }
[style*="background:#fce7f3"], [style*="background: #fce7f3"] { background: rgba(236, 72, 153, 0.14) !important; }

/* Piezas que el panel pinta con blanco fijo */
.nav-tabs { background: var(--card-bg) !important; }
.tab-button.active { background: #1C1F27 !important; color: #FFFFFF !important; }
.batch-actions-bar { background: var(--card-subtle) !important; border-color: var(--border-color) !important; color: var(--text-main); }
.risk-bar-container { background: #24262E !important; }
.soc-table { background: var(--card-bg) !important; }
.id-tracker, .chart-widget-badge { background: #1C1F27 !important; color: var(--text-main) !important; border-color: var(--border-color) !important; }
.badge-risk.risk-BAJO { background: rgba(34, 197, 94, 0.15) !important; color: #4ADE80 !important; }
.type-badge.type-monitoring { background: rgba(148, 163, 184, 0.15) !important; color: #CBD5E1 !important; }
.type-badge.type-sponsored { background: rgba(234, 179, 8, 0.15) !important; color: #FACC15 !important; }

/* Barras de desplazamiento */
* { scrollbar-color: #33363F #0F1014; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0F1014; }
::-webkit-scrollbar-thumb { background: #33363F; border-radius: 6px; }
