/*
 * PRETIUM - LIGHT MODE THEME  v2
 * Activado con <html data-theme="light">
 * PRINCIPIO: contornos visibles en todo, cabeceras de tabla oscuras, secciones diferenciables.
 */

/* ═══════════════════════════════════════════════════════════
   VARIABLES
═══════════════════════════════════════════════════════════ */
/* html[...] tiene especificidad (0,1,1) — supera :root (0,1,0) de inline <style> */
html[data-theme="light"],
[data-theme="light"] {
    --bg:          #eef1f6;
    --bg2:         #ffffff;
    --bg3:         #f5f7fb;
    --bd:          #c8cdd8;
    --bd-strong:   #aab0bf;
    --txt:         #1a1a1a;
    --txt2:        #5a6070;
    --txt3:        #7a8290;
    --text:        #1a1a1a;
    --text2:       #5a6070;
    --ora:         #c96800;
    --ora2:        #a85500;
    /* CRM page variables */
    --bg-body:     #eef1f6;
    --text-primary: #1a1a1a;
    --shadow-sm:   0 2px 8px rgba(0,0,0,.10);
    --shadow-md:   0 4px 18px rgba(0,0,0,.14);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.16);
    --table-head:  #2a2d35;
    --table-row:   #ffffff;
    --table-alt:   #f5f7fb;
    --table-hover: #fff4e6;

    /* ── Variables cotizador (interface.css / cotizador.css) ── */
    --bg-dark:      #f0f2f5;
    --bg-lighter:   #ffffff;
    --text-color:   #1a1a1a;
    --text-muted:   #5a6070;
    --border-color: #c8cdd8;
    --input-bg:     #ffffff;
    --input-text:   #1a1a1a;
    --input-border: #c8cdd8;
    --accent:       #ff8c00;
    --btn-text:     #ffffff;
    --btn-bg:       #ff8c00;
}

/* ═══════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════ */
[data-theme="light"] html {
    background: #eef1f6 !important;
}
[data-theme="light"] body {
    background: linear-gradient(160deg, #eef1f6 0%, #e6eaf3 50%, #eef1f6 100%) !important;
    color: #1a1a1a !important;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   HTML5UP WRAPPERS
═══════════════════════════════════════════════════════════ */
[data-theme="light"] #wrapper {
    background: transparent !important;
}
[data-theme="light"] #main,
[data-theme="light"] #main > .inner {
    background: transparent !important;
}

/* ═══════════════════════════════════════════════════════════
   NAV PRINCIPAL HORIZONTAL (nav_main.php — #nav con .links)
═══════════════════════════════════════════════════════════ */
[data-theme="light"] #nav {
    background: #ffffff !important;
    border: 2px solid #c0c6d4 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.14) !important;
    border-radius: 15px !important;
}

/* Texto de los links: oscuro y legible */
[data-theme="light"] #nav .links li a {
    color: #3a4055 !important;
    background: transparent !important;
    font-weight: 700 !important;
}

/* Separadores entre items: línea gris visible */
[data-theme="light"] #nav .links li:not(:last-child)::after {
    background: #c0c6d4 !important;
    height: 40% !important;
    width: 1.5px !important;
}

/* Hover: fondo naranja suave + texto naranja */
[data-theme="light"] #nav .links li a:hover {
    color: #c96800 !important;
    background: rgba(255,140,0,.09) !important;
}

/* Tab activa: gradiente naranja como en dark mode */
[data-theme="light"] #nav .links li.active a {
    background: linear-gradient(135deg,#ff8c00,#e07000) !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,.15) !important;
}

/* Header HTML5UP */
[data-theme="light"] header#header {
    background: #ffffff !important;
    border-bottom: 2px solid #c0c6d4 !important;
    color: #c96800 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.1) !important;
}

/* ── Barra superior de empresa (include/header.php — .menu) ── */
[data-theme="light"] .menu {
    background: linear-gradient(135deg, #ffffff, #f8f9fa) !important;
    border-bottom: 2px solid #c0c6d4 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.1) !important;
}
/* Nombre de empresa en header */
[data-theme="light"] .empresa-name,
[data-theme="light"] .header-left .empresa-name * { color: #1a1a1a !important; }
/* Nombre usuario en header */
[data-theme="light"] .header-right,
[data-theme="light"] .header-right *:not(button):not(i) { color: #333 !important; }
/* Botones del header (perfil, notif, etc.) */
[data-theme="light"] .header-btn,
[data-theme="light"] .btn-header {
    background: #f0f3f8 !important;
    border: 1.5px solid #c0c6d4 !important;
    color: #333 !important;
}
[data-theme="light"] .header-btn:hover,
[data-theme="light"] .btn-header:hover {
    background: #fff8f0 !important;
    border-color: #c96800 !important;
    color: #c96800 !important;
}

/* ═══════════════════════════════════════════════════════════
   CABECERAS DE TABLAS — TODAS OSCURAS, NO NARANJA
═══════════════════════════════════════════════════════════ */
[data-theme="light"] table thead th,
[data-theme="light"] table th,
[data-theme="light"] .tabla-contactos th,
[data-theme="light"] .tabla-productos th,
[data-theme="light"] .tabla-productos thead tr th,
[data-theme="light"] .recent-table th,
[data-theme="light"] .root-table th {
    background: #2a2d35 !important;
    color: #ffffff !important;
    border-color: #3a3d47 !important;
    font-weight: 700 !important;
    letter-spacing: .3px !important;
}

/* Filas de tablas */
[data-theme="light"] table tbody tr td,
[data-theme="light"] .tabla-contactos td,
[data-theme="light"] .tabla-productos td,
[data-theme="light"] .recent-table td {
    background: #ffffff !important;
    color: #333 !important;
    border-color: #dde1ea !important;
}
[data-theme="light"] table tbody tr:nth-child(even) td,
[data-theme="light"] .tabla-contactos tbody tr:nth-child(even) td,
[data-theme="light"] .tabla-productos tbody tr:nth-child(even) td {
    background: #f5f7fb !important;
}
[data-theme="light"] table tbody tr:hover td,
[data-theme="light"] .tabla-contactos tbody tr:hover td,
[data-theme="light"] .tabla-productos tbody tr:hover td {
    background: #fff4e6 !important;
}
/* Borde exterior de todas las tablas */
[data-theme="light"] table {
    border: 1.5px solid #c8cdd8 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* ═══════════════════════════════════════════════════════════
   CARD CONTAINERS — CONTORNO FUERTE
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .card-container {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 6px 28px rgba(0,0,0,.13) !important;
    border-radius: 14px !important;
}
[data-theme="light"] .card-container h2,
[data-theme="light"] .card-container h3 { color: #1a1a1a !important; }

/* ═══════════════════════════════════════════════════════════
   PRODUCTOS / PANELES
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .productos-wrapper,
[data-theme="light"] .paneles-wrapper,
[data-theme="light"] .inversores-wrapper,
[data-theme="light"] .baterias-wrapper {
    background: #eef1f6 !important;
}

/* Tabs de categorías */
[data-theme="light"] .productos-nav {
    gap: 8px !important;
}
[data-theme="light"] .productos-nav a {
    background: #ffffff !important;
    color: #4a5060 !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.08) !important;
    font-weight: 600 !important;
}
[data-theme="light"] .productos-nav a:hover {
    background: #fff8f0 !important;
    color: #c96800 !important;
    border-color: #c96800 !important;
    box-shadow: 0 3px 10px rgba(255,140,0,.2) !important;
}
[data-theme="light"] .productos-nav a.active {
    background: linear-gradient(135deg,#ff8c00,#e07000) !important;
    color: #fff !important;
    border-color: #c96800 !important;
    box-shadow: 0 4px 14px rgba(255,140,0,.4) !important;
}

/* Inputs de búsqueda */
[data-theme="light"] .filtro-input,
[data-theme="light"] .search-input {
    background: #ffffff !important;
    color: #333 !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: inset 0 1px 4px rgba(0,0,0,.06) !important;
}
[data-theme="light"] .filtro-input:focus,
[data-theme="light"] .search-input:focus {
    border-color: #c96800 !important;
    box-shadow: 0 0 0 3px rgba(255,140,0,.15) !important;
    outline: none !important;
}

/* Barra de botones de tabla */
[data-theme="light"] .mover-botones {
    background: #f0f3f8 !important;
    border-top: 1.5px solid #c8cdd8 !important;
}
[data-theme="light"] .mover-botones button {
    background: #ffffff !important;
    color: #444 !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .mover-botones button:hover {
    border-color: #c96800 !important;
    color: #c96800 !important;
}

/* ═══════════════════════════════════════════════════════════
   CONTACTOS
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .contactos-wrapper {
    background: #eef1f6 !important;
}
[data-theme="light"] .contactos-header {
    background: #ffffff !important;
    border-bottom: 2px solid #c8cdd8 !important;
    box-shadow: 0 3px 14px rgba(0,0,0,.1) !important;
}
[data-theme="light"] .contactos-header h1,
[data-theme="light"] .page-title {
    color: #1a1a1a !important;
    text-shadow: none !important;
}
[data-theme="light"] .stats-bar {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.09) !important;
}
[data-theme="light"] .stat-item .stat-value { color: #1a1a1a !important; }
[data-theme="light"] .stat-item .stat-label { color: #666 !important; }
[data-theme="light"] .filtros-container { background: transparent !important; }
[data-theme="light"] .filtro-select,
[data-theme="light"] select.form-select {
    background: #ffffff !important;
    color: #333 !important;
    border: 1.5px solid #c0c6d4 !important;
}

/* Modal contactos */
[data-theme="light"] #miModal {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
}
[data-theme="light"] #miModal .form1 input,
[data-theme="light"] #miModal .form1 select,
[data-theme="light"] #miModal .form1 textarea {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] #miModal .form1 input:focus,
[data-theme="light"] #miModal .form1 select:focus {
    background: #ffffff !important;
    border-color: #c96800 !important;
}
[data-theme="light"] #miModal label { color: #555 !important; }
[data-theme="light"] .modal-background { background: rgba(0,0,0,.5) !important; }
[data-theme="light"] .modal-premium-content,
[data-theme="light"] .modal-content {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
}
[data-theme="light"] .modal-header { border-bottom: 1.5px solid #dde1ea !important; }
[data-theme="light"] .modal-footer {
    border-top: 1.5px solid #dde1ea !important;
    background: #f5f7fb !important;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD / MENU.PHP
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .db-header h1,
[data-theme="light"] .db-header h2 {
    color: #1a1a1a !important;
    text-shadow: none !important;
}
[data-theme="light"] .db-header {
    border-bottom: 2px solid #c8cdd8 !important;
    padding-bottom: 14px !important;
    margin-bottom: 20px !important;
}

/* KPI cards */
[data-theme="light"] .kpi-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.12) !important;
}
[data-theme="light"] .kpi-card .k-num  { color: #1a1a1a !important; }
[data-theme="light"] .kpi-card .k-lbl  { color: #666 !important; }
[data-theme="light"] .kpi-card .k-sub  { color: #999 !important; }

/* Separadores de borde superior en KPI */
[data-theme="light"] .kpi-card.c-orange { border-top: 3px solid #ff8c00 !important; }
[data-theme="light"] .kpi-card.c-green  { border-top: 3px solid #2e7d32 !important; }
[data-theme="light"] .kpi-card.c-yellow { border-top: 3px solid #f9a825 !important; }
[data-theme="light"] .kpi-card.c-gray   { border-top: 3px solid #78909c !important; }
[data-theme="light"] .kpi-card.c-blue   { border-top: 3px solid #1565c0 !important; }
[data-theme="light"] .kpi-card.c-red    { border-top: 3px solid #c62828 !important; }

/* Tarjetas de acciones rápidas (negras en dark) */
[data-theme="light"] .action-btn {
    background: #ffffff !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: 0 3px 14px rgba(0,0,0,.1) !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .action-btn:hover {
    background: #fff8f0 !important;
    border-color: #c96800 !important;
    box-shadow: 0 6px 22px rgba(255,140,0,.2) !important;
}
[data-theme="light"] .action-btn .ab-text { color: #1a1a1a !important; font-weight: 700 !important; }
[data-theme="light"] .action-btn .ab-sub  { color: #777 !important; }
[data-theme="light"] .action-btn::before {
    background: linear-gradient(to bottom, #ff8c00, #e07000) !important;
}

/* Secciones de gráficas / recientes / instalados */
[data-theme="light"] .chart-card,
[data-theme="light"] .recent-card,
[data-theme="light"] .instalados-card,
[data-theme="light"] .dash-section {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.11) !important;
    color: #1a1a1a !important;
    border-radius: 12px !important;
}
[data-theme="light"] .chart-card h3,
[data-theme="light"] .recent-card h3,
[data-theme="light"] .section-header,
[data-theme="light"] .chart-title,
[data-theme="light"] .chart-card .chart-label { color: #1a1a1a !important; }
[data-theme="light"] .chart-card .chart-sub,
[data-theme="light"] .recent-card .recent-sub  { color: #777 !important; }

/* Barra de progreso / cuota */
[data-theme="light"] .cuota-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.1) !important;
}
[data-theme="light"] .cuota-lbl     { color: #444 !important; }
[data-theme="light"] .cuota-bar-bg  { background: #dde1ea !important; }

/* ═══════════════════════════════════════════════════════════
   PERFIL (perfil.php) — TAB NAV
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .perfil-tabnav {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.12) !important;
    padding: 6px !important;
    gap: 6px !important;
}
[data-theme="light"] .ptab:not(.active) {
    background: #f0f3f8 !important;
    color: #3a4055 !important;
    border: 1.5px solid #c0c6d4 !important;
    border-radius: 9px !important;
}
[data-theme="light"] .ptab:not(.active):hover {
    background: #e6e9f0 !important;
    color: #c96800 !important;
    border-color: #c96800 !important;
}
/* Tabs activos mantienen su color (solar=naranja, bess=azul, etc.) — no tocar */
[data-theme="light"] .ptab-panel {
    background: #eef1f6 !important;
}

/* ── PANEL BESS — "coming soon" ── */
[data-theme="light"] .cs-card {
    background: #ffffff !important;
    border: 2px dashed #c0c6d4 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.08) !important;
}
[data-theme="light"] .cs-title {
    color: #2a2d35 !important;
}
[data-theme="light"] .cs-desc {
    color: #666 !important;
}
[data-theme="light"] .cs-tag {
    background: #f0f3f8 !important;
    color: #555 !important;
    border: 1px solid #c0c6d4 !important;
}
[data-theme="light"] .cs-icon.bess     { background: rgba(21,101,192,.12) !important; color:#1565c0 !important; }
[data-theme="light"] .cs-icon.unifilar { background: rgba(106,27,154,.12) !important; color:#6a1b9a !important; }
[data-theme="light"] .cs-icon.contratos{ background: rgba(46,125,50,.12)  !important; color:#2e7d32 !important; }

/* ── PANEL UNIFILAR ── */
[data-theme="light"] .uni-proj-card {
    background: #ffffff !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: 0 3px 14px rgba(0,0,0,.1) !important;
}
[data-theme="light"] .uni-proj-card:hover {
    border-color: #9575cd !important;
    box-shadow: 0 8px 24px rgba(106,27,154,.2) !important;
    background: #faf8ff !important;
}
[data-theme="light"] .uni-proj-name {
    color: #1a1a1a !important;
}
[data-theme="light"] .uni-proj-meta span {
    background: #f0f3f8 !important;
    color: #555 !important;
    border: 1px solid #dde1ea !important;
}
[data-theme="light"] .uni-proj-meta i {
    color: #7e57c2 !important;
}
[data-theme="light"] .uni-proj-fecha {
    color: #888 !important;
}
/* Textos de descripción del panel unifilar con inline style rgba blanco */
[data-theme="light"] #panel-unifilar p[style*="rgba(255,255,255"] {
    color: #555 !important;
}
[data-theme="light"] #panel-unifilar .section-title {
    color: #1a1a1a !important;
}

/* ── PANEL CONTRATOS ── */
/* Tarjetas de contratos guardados */
[data-theme="light"] .ctr-card {
    background: #ffffff !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.09) !important;
}
[data-theme="light"] .ctr-card:hover {
    border-color: #4caf50 !important;
    box-shadow: 0 6px 20px rgba(46,125,50,.15) !important;
}
[data-theme="light"] .ctr-card-name {
    color: #1a1a1a !important;
}
[data-theme="light"] .ctr-card-meta {
    color: #666 !important;
}

/* Badges de estatus de contratos */
[data-theme="light"] .ctr-status.Borrador  { background: #f0f3f8 !important; color: #555 !important; border: 1px solid #c0c6d4 !important; }
[data-theme="light"] .ctr-status.Enviado   { background: rgba(21,101,192,.12) !important; color: #1565c0 !important; border: 1px solid rgba(21,101,192,.3) !important; }
[data-theme="light"] .ctr-status.Firmado   { background: rgba(46,125,50,.12) !important; color: #2e7d32 !important; border: 1px solid rgba(46,125,50,.3) !important; }
[data-theme="light"] .ctr-status.Cancelado { background: rgba(198,40,40,.1) !important; color: #c62828 !important; border: 1px solid rgba(198,40,40,.25) !important; }

/* Botones de acción en tarjetas de contrato */
[data-theme="light"] .ctr-btn-view {
    background: #f0f3f8 !important;
    color: #3a4055 !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .ctr-btn-view:hover {
    background: #e6e9f0 !important;
    border-color: #aab0bf !important;
}
[data-theme="light"] .ctr-btn-send {
    background: rgba(21,101,192,.1) !important;
    color: #1565c0 !important;
    border: 1.5px solid rgba(21,101,192,.3) !important;
}
[data-theme="light"] .ctr-btn-sign {
    background: rgba(46,125,50,.1) !important;
    color: #2e7d32 !important;
    border: 1.5px solid rgba(46,125,50,.3) !important;
}
[data-theme="light"] .ctr-btn-del {
    background: rgba(198,40,40,.08) !important;
    color: #c62828 !important;
    border: 1.5px solid rgba(198,40,40,.25) !important;
}

/* Sección generador de contratos */
[data-theme="light"] .ctr-gen-wrap {
    background: #ffffff !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.09) !important;
}
/* Selectores dentro del generador */
[data-theme="light"] #sel-proyecto-contrato,
[data-theme="light"] #sel-plantilla-contrato {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c0c6d4 !important;
}
/* Área de contrato generado */
[data-theme="light"] #contrato-generado-wrap {
    background: #ffffff !important;
    border: 1.5px solid #c0c6d4 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.1) !important;
    border-radius: 12px !important;
}
[data-theme="light"] #contrato-titulo { color: #1a1a1a !important; }
[data-theme="light"] #contrato-subtitulo { color: #666 !important; }
/* El cuerpo del contrato ya es blanco con texto oscuro por diseño */

/* Textos con inline style blanco dentro de paneles de perfil */
[data-theme="light"] #panel-contratos p[style*="rgba(255,255,255"],
[data-theme="light"] #panel-contratos span[style*="rgba(255,255,255"],
[data-theme="light"] #panel-bess p[style*="rgba(255,255,255"],
[data-theme="light"] #panel-unifilar p[style*="rgba(255,255,255"] {
    color: #555 !important;
}
[data-theme="light"] #panel-contratos [style*="color:#fff"],
[data-theme="light"] #panel-contratos [style*="color: #fff"],
[data-theme="light"] #panel-unifilar [style*="color:#fff"],
[data-theme="light"] #panel-unifilar [style*="color: #fff"] {
    color: #1a1a1a !important;
}
[data-theme="light"] .proyecto-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.11) !important;
}
[data-theme="light"] .proyecto-titulo    { color: #1a1a1a !important; }
[data-theme="light"] .proyecto-fecha     { color: #888 !important; }
[data-theme="light"] .proyecto-grid {
    background: #f0f3f8 !important;
    border: 1.5px solid #c8cdd8 !important;
}
[data-theme="light"] .proyecto-grid .grid-label { color: #777 !important; }
[data-theme="light"] .proyecto-grid .grid-value { color: #1a1a1a !important; }
[data-theme="light"] .prop-header {
    background: #f5f7fb !important;
    border-bottom: 1.5px solid #c8cdd8 !important;
}
[data-theme="light"] .prop-stat-btns .psb {
    background: #f0f3f8 !important;
    color: #444 !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .sidebar-derecha {
    background: #ffffff !important;
    border-left: 2px solid #c8cdd8 !important;
    box-shadow: -3px 0 14px rgba(0,0,0,.08) !important;
}
[data-theme="light"] .info-block {
    background: #f5f7fb !important;
    border: 1.5px solid #c8cdd8 !important;
    border-radius: 10px !important;
}
[data-theme="light"] .info-block .lbl { color: #777 !important; }
[data-theme="light"] .info-block .val { color: #1a1a1a !important; }
[data-theme="light"] .uni-proj-card,
[data-theme="light"] .ctr-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 3px 14px rgba(0,0,0,.1) !important;
}
[data-theme="light"] .ctr-card-title { color: #1a1a1a !important; }
[data-theme="light"] .ctr-card-meta  { color: #777 !important; }
[data-theme="light"] .section-title  { color: #1a1a1a !important; }

/* Sidebar derecho de perfil.php */
[data-theme="light"] .perfil-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.1) !important;
}
[data-theme="light"] .contacto-info {
    background: #f5f7fb !important;
    border: 1px solid #dde1ea !important;
}
[data-theme="light"] .contacto-info-item {
    border-bottom-color: #dde1ea !important;
}
[data-theme="light"] .stats-grid {
    background: #f5f7fb !important;
    border: 1px solid #dde1ea !important;
}
[data-theme="light"] .stat-box {
    background: #ffffff !important;
    border: 1px solid #dde1ea !important;
}
[data-theme="light"] .stat-box .stat-num { color: #1a1a1a !important; }
[data-theme="light"] .stat-box .stat-lbl { color: #777 !important; }

/* ═══════════════════════════════════════════════════════════
   PERFIL USUARIO (perfil_usuario.php)
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .pu-wrap   { background: #eef1f6 !important; }

/* Hero del perfil en modo día: fondo claro con acento naranja */
[data-theme="light"] .pu-hero {
    background: linear-gradient(135deg, #ffffff, #fff8f0) !important;
    border: 2px solid #e0a050 !important;
    box-shadow: 0 6px 24px rgba(255,140,0,.14) !important;
}
/* Textos dentro del hero claro: oscuros */
[data-theme="light"] .pu-hero .pu-hero-info h2,
[data-theme="light"] .pu-hero h2 { color: #1a1a1a !important; }
[data-theme="light"] .pu-hero .pu-hero-info p,
[data-theme="light"] .pu-hero p  { color: #666 !important; }
[data-theme="light"] .pu-hero .pu-stat-lbl { color: #888 !important; }
[data-theme="light"] .pu-hero .pu-stat-val  { color: #1a1a1a !important; }
/* Avatar mantiene su color */
[data-theme="light"] .pu-hero .pu-avatar { box-shadow: 0 0 0 4px rgba(255,140,0,.25) !important; }

[data-theme="light"] .pu-tabnav {
    background: #ffffff !important;
    border-bottom: 2px solid #c8cdd8 !important;
    box-shadow: 0 3px 14px rgba(0,0,0,.1) !important;
}
[data-theme="light"] .pu-tab:not(.active) {
    background: #f0f3f8 !important;
    color: #4a5060 !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .pu-tab:not(.active):hover {
    background: #e6e9f0 !important;
    color: #1a1a1a !important;
    border-color: #aab0bf !important;
}
[data-theme="light"] .pu-panel { background: #eef1f6 !important; }
[data-theme="light"] .pu-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.11) !important;
}
[data-theme="light"] .pu-card-title {
    color: #1a1a1a !important;
    border-bottom: 1.5px solid #dde1ea !important;
}
[data-theme="light"] .pu-form-group label { color: #555 !important; }
[data-theme="light"] .pu-input,
[data-theme="light"] .pu-textarea,
[data-theme="light"] .pu-select {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .pu-input:focus,
[data-theme="light"] .pu-textarea:focus,
[data-theme="light"] .pu-select:focus {
    background: #ffffff !important;
    border-color: #c96800 !important;
    box-shadow: 0 0 0 3px rgba(255,140,0,.15) !important;
}
/* Validación visual — modo día */
[data-theme="light"] .pu-input.field-error,
[data-theme="light"] .pu-textarea.field-error { border-color: #e53935 !important; box-shadow: 0 0 0 3px rgba(229,57,53,.12) !important; }
[data-theme="light"] .pu-input.field-ok,
[data-theme="light"] .pu-textarea.field-ok { border-color: #43a047 !important; box-shadow: 0 0 0 3px rgba(67,160,71,.12) !important; }

[data-theme="light"] .img-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.09) !important;
}
/* Textos blancos CSS (clases) en cards de imágenes */
[data-theme="light"] .img-card-header .label { color: #111 !important; }
[data-theme="light"] .img-card-header .sublabel { color: #666 !important; }
[data-theme="light"] .tpl-name { color: #1a1a1a !important; }
[data-theme="light"] .img-card-footer {
    background: #f5f7fb !important;
    color: #666 !important;
    border-top: 1.5px solid #dde1ea !important;
}
[data-theme="light"] .img-placeholder { color: #aaa !important; }
[data-theme="light"] .tpl-card {
    background: #f5f7fb !important;
    border: 1.5px solid #c8cdd8 !important;
}
[data-theme="light"] .tpl-card:hover {
    background: #ffffff !important;
    border-color: #c96800 !important;
    box-shadow: 0 4px 14px rgba(255,140,0,.18) !important;
}
[data-theme="light"] .tpl-name  { color: #1a1a1a !important; }
[data-theme="light"] .tpl-meta  { color: #777 !important; }
[data-theme="light"] .tpl-editor {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
}
[data-theme="light"] .tpl-editor-title {
    color: #1a1a1a !important;
    border-bottom: 1.5px solid #dde1ea !important;
}
[data-theme="light"] .tpl-textarea {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .tpl-var-btn {
    background: #f0f3f8 !important;
    color: #4a5060 !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .tpl-var-btn:hover {
    background: #fff8f0 !important;
    color: #c96800 !important;
    border-color: #c96800 !important;
}
[data-theme="light"] .footer-preview {
    background: #f5f7fb !important;
    border: 2px solid #004aad !important;
}
[data-theme="light"] .pu-flash.success { background: rgba(46,125,50,.12) !important; color:#2e7d32 !important; border-color: rgba(46,125,50,.3) !important; }
[data-theme="light"] .pu-flash.error   { background: rgba(198,40,40,.1)  !important; color:#c62828 !important; border-color: rgba(198,40,40,.3) !important; }
[data-theme="light"] .pu-flash.warning { background: rgba(255,140,0,.1)  !important; color:#e65100 !important; border-color: rgba(255,140,0,.3) !important; }

/* ═══════════════════════════════════════════════════════════
   INPUTS GLOBALES
═══════════════════════════════════════════════════════════ */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="search"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border-color: #c0c6d4 !important;
}
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    background: #ffffff !important;
    border-color: #c96800 !important;
    box-shadow: 0 0 0 3px rgba(255,140,0,.15) !important;
    outline: none !important;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder { color: #aaa !important; }
[data-theme="light"] select option {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .login-container { background: #eef1f6 !important; }
[data-theme="light"] .login-brand     { background: linear-gradient(135deg,#1a1a1a,#333) !important; }
[data-theme="light"] .login-form-container {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 8px 40px rgba(0,0,0,.16) !important;
}
[data-theme="light"] .login-form-container h2 { color: #1a1a1a !important; }
[data-theme="light"] .form-group label         { color: #555 !important; }
[data-theme="light"] .login-input {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c0c6d4 !important;
}

/* ═══════════════════════════════════════════════════════════
   TEXTOS Y HEADINGS
   Excluimos elementos dentro de secciones que mantienen fondo oscuro
═══════════════════════════════════════════════════════════ */
[data-theme="light"] h1:not(.pu-hero *):not(.perfil-hero *):not(.root-header *),
[data-theme="light"] h2:not(.pu-hero *):not(.perfil-hero *):not(.root-header *),
[data-theme="light"] h3:not(.pu-hero *):not(.perfil-hero *):not(.root-header *),
[data-theme="light"] h4:not(.pu-hero *):not(.perfil-hero *):not(.root-header *) { color: #1a1a1a !important; }
[data-theme="light"] p:not(.pu-hero *):not(.perfil-hero *) { color: #444 !important; }
[data-theme="light"] a:not(.btn):not([class*="btn"]):not([class*="ptab"]):not([class*="pu-btn"]):not(.action-btn):not(.productos-nav) {
    color: #c96800 !important;
}
[data-theme="light"] hr { border-color: #c8cdd8 !important; }
[data-theme="light"] .text-muted,
[data-theme="light"] .muted { color: #777 !important; }
[data-theme="light"] .sub-text,
[data-theme="light"] .subtitle,
[data-theme="light"] .label-text { color: #666 !important; }

/* ═══════════════════════════════════════════════════════════
   ROOT ADMIN
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .root-body,
[data-theme="light"] .root-content,
[data-theme="light"] .root-wrap { background: #eef1f6 !important; }
[data-theme="light"] .root-card,
[data-theme="light"] .admin-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    color: #1a1a1a !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.11) !important;
}
[data-theme="light"] .stats-grid .stat-card {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .root-nav,
[data-theme="light"] .admin-nav {
    background: #ffffff !important;
    border-bottom: 2px solid #c8cdd8 !important;
    box-shadow: 0 3px 14px rgba(0,0,0,.1) !important;
}

/* ═══════════════════════════════════════════════════════════
   MODALES GENÉRICOS
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.5) !important; }
[data-theme="light"] .modal-box {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: 1.5px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
}
[data-theme="light"] .modal-title { color: #1a1a1a !important; }

/* ═══════════════════════════════════════════════════════════
   SCROLLBARS
═══════════════════════════════════════════════════════════ */
[data-theme="light"] ::-webkit-scrollbar { background: #eef1f6 !important; }
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #c0c6d4 !important;
    border-radius: 4px !important;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #ff8c00 !important; }

/* ═══════════════════════════════════════════════════════════
   SEPARACIÓN ENTRE DIVS Y CONTAINERS
   Toda sección/bloque/panel debe tener borde visible y sombra
   para que el usuario siempre distinga dónde empieza y termina.
═══════════════════════════════════════════════════════════ */

/* Regla base: cualquier div con clase que implique "sección" */
[data-theme="light"] [class*="-wrap"],
[data-theme="light"] [class*="-card"]:not([class*="kpi"]),
[data-theme="light"] [class*="-panel"]:not(.pu-panel):not(.ptab-panel),
[data-theme="light"] [class*="-section"],
[data-theme="light"] [class*="-box"],
[data-theme="light"] [class*="-container"]:not(.login-container):not(.filtros-container) {
    outline: 0 !important; /* reset */
}

/* Separadores internos — cuando un div tiene fondo blanco sobre fondo gris, añadir borde */
[data-theme="light"] .inner-block,
[data-theme="light"] .block-section,
[data-theme="light"] .content-block {
    background: #ffffff !important;
    border: 1.5px solid #c8cdd8 !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.09) !important;
    padding: 16px !important;
}

/* Líneas divisoras (hr) más visibles */
[data-theme="light"] hr {
    border: 0 !important;
    border-top: 2px solid #c8cdd8 !important;
    margin: 16px 0 !important;
}

/* Secciones con fondo alterno en páginas de lista */
[data-theme="light"] .section-divider {
    border-top: 2px solid #c8cdd8 !important;
    margin: 20px 0 !important;
}

/* Grid/flex containers que agrupan tarjetas */
[data-theme="light"] .kpi-grid,
[data-theme="light"] .cards-grid,
[data-theme="light"] .uni-proj-grid {
    gap: 14px !important;
}

/* ═══════════════════════════════════════════════════════════
   IMAGES / GALERÍA — perfil_usuario.php
═══════════════════════════════════════════════════════════ */
[data-theme="light"] img { filter: none !important; }

/* Preview placeholder (fondo negro en dark) */
[data-theme="light"] .img-preview-wrap {
    background: #eef1f6 !important;
    border-bottom: 1.5px solid #dde1ea !important;
}
[data-theme="light"] .img-placeholder { color: #aab0bf !important; }

/* ─── Sección de imágenes — fondo oscuro via var(--bg2) inline overridden ─── */
[data-theme="light"] .img-section {
    background: #ffffff !important;
    border: 1.5px solid #d0d5e0 !important;
}

/* Preview de logo (fondo negro inline en dark) */
[data-theme="light"] #logo_preview_wrap {
    background: #f0f3f8 !important;
    border-color: rgba(255,140,0,.4) !important;
}

/* Textos con color:#fff inline dentro de img-card — modo día */
[data-theme="light"] .img-card [style*="color:#fff"],
[data-theme="light"] .img-card [style*="color: #fff"] {
    color: #1a1a1a !important;
}
[data-theme="light"] .img-section [style*="color:#fff"],
[data-theme="light"] .img-section [style*="color: #fff"] {
    color: #1a1a1a !important;
}

/* Área de upload de logo (fondo negro en dark) */
[data-theme="light"] .logo-upload-area {
    background: #f5f7fb !important;
    border-color: rgba(255,140,0,.4) !important;
}
[data-theme="light"] .logo-upload-area:hover {
    background: #fff8f0 !important;
    border-color: #c96800 !important;
}
[data-theme="light"] .logo-upload-area .upload-text { color: #666 !important; }

/* Modal de galería */
[data-theme="light"] .gal-modal {
    background: rgba(0,0,0,.45) !important;
    backdrop-filter: blur(6px) !important;
}
[data-theme="light"] .gal-modal-inner {
    background: #ffffff !important;
    border: 2px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
}
[data-theme="light"] .gal-modal-title { color: #c96800 !important; }
[data-theme="light"] .gal-col { background:#f5f7fb !important; border-color:#c8cdd8 !important; }
[data-theme="light"] .gal-item-label { background:#e8ebf0 !important; color:#555 !important; }

/* ═══════════════════════════════════════════════════════════
   BOTÓN FLOTANTE (FAB)
═══════════════════════════════════════════════════════════ */
.theme-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    transition: all .22s;
    background: linear-gradient(135deg,#444,#1a1a1a);
    color: #fff;
}
.theme-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
/* En modo claro: botón naranja brillante para destacar */
[data-theme="light"] .theme-fab {
    background: linear-gradient(135deg,#ff8c00,#e07000) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 18px rgba(255,140,0,.45) !important;
}
[data-theme="light"] .theme-fab:hover {
    box-shadow: 0 8px 28px rgba(255,140,0,.6) !important;
}

/* ═══════════════════════════════════════════════════════════
   PLANTILLAS DE CONTRATO — perfil_usuario.php (modo día)
═══════════════════════════════════════════════════════════ */
/* Botones outline y ghost de perfil_usuario en modo día */
[data-theme="light"] .pu-btn-outline {
    background: #f0f3f8 !important;
    color: #2a2d35 !important;
    border: 1.5px solid #b0b8cc !important;
    font-weight: 700 !important;
}
[data-theme="light"] .pu-btn-outline:hover {
    background: #e6e9f0 !important;
    border-color: #c96800 !important;
    color: #c96800 !important;
}
[data-theme="light"] .pu-btn-ghost {
    background: #f0f3f8 !important;
    color: #2a2d35 !important;
    border: 1.5px solid #b0b8cc !important;
}
[data-theme="light"] .pu-btn-ghost:hover {
    background: #e6e9f0 !important;
    border-color: #c96800 !important;
    color: #c96800 !important;
}
/* Etiqueta "Plantillas base:" */
[data-theme="light"] #lista-plantillas-wrap [style*="color:#888"] {
    color: #666 !important;
}

/* Título sección plantillas */
[data-theme="light"] .tpl-section-title { color: #111 !important; }
[data-theme="light"] .tpl-section-title i { color: #2e7d32 !important; }

/* Descripción bajo el título */
[data-theme="light"] .tpl-section-desc  { color: #444 !important; }

/* Caja de tip (fondo verde muy suave) — texto visible en blanco */
[data-theme="light"] .tpl-tip-box {
    background: rgba(46,125,50,.08) !important;
    border-color: rgba(46,125,50,.35) !important;
    color: #2e5c32 !important;
}
[data-theme="light"] .tpl-tip-box strong { color: #1b5e20 !important; }
[data-theme="light"] .tpl-tip-box code {
    background: rgba(0,0,0,.08) !important;
    color: #1b5e20 !important;
}

/* Label "Plantillas de ejemplo" */
[data-theme="light"] .tpl-example-label { color: #444 !important; }

/* Tarjeta de plantilla */
[data-theme="light"] .tpl-card {
    background: #ffffff !important;
    border-color: #c8cdd8 !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.09) !important;
}
[data-theme="light"] .tpl-name  { color: #111 !important; }
[data-theme="light"] .tpl-date  { color: #666 !important; }

/* Estado vacío plantillas — modo día */
[data-theme="light"] .tpl-empty-state {
    background: #f5f7fb !important;
    border-color: #c0c6d4 !important;
}
[data-theme="light"] .tpl-empty-title { color: #555 !important; }
[data-theme="light"] .tpl-empty-desc  { color: #777 !important; }

/* Editor de plantillas */
[data-theme="light"] .tpl-editor-wrap {
    background: #ffffff !important;
    border-color: rgba(46,125,50,.4) !important;
}
[data-theme="light"] .tpl-editor-title { color: #2e7d32 !important; }
[data-theme="light"] .tpl-vars-bar {
    background: #f0f3f8 !important;
    border-color: #c8cdd8 !important;
}
[data-theme="light"] .tpl-var-btn {
    background: rgba(46,125,50,.12) !important;
    color: #1b5e20 !important;
    border-color: rgba(46,125,50,.35) !important;
}
[data-theme="light"] .tpl-var-btn:hover {
    background: rgba(46,125,50,.25) !important;
    border-color: #4caf50 !important;
}
[data-theme="light"] .tpl-content-area {
    background: #f5f7fb !important;
    border-color: #c0c6d4 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .tpl-content-area:focus {
    border-color: #4caf50 !important;
    background: #ffffff !important;
}
/* Texto "Variables disponibles" inline */
[data-theme="light"] #editor-plantilla-wrap [style*="color:#888"] {
    color: #444 !important;
}

/* ═══════════════════════════════════════════════════════════
   CONTRATOS — TEXTOS MÁS OSCUROS (legibilidad en modo día)
═══════════════════════════════════════════════════════════ */
/* Nombres y metadatos de tarjetas de contrato */
[data-theme="light"] .ctr-card-name,
[data-theme="light"] .ctr-card-title { color: #111 !important; font-weight: 700 !important; }
[data-theme="light"] .ctr-card-meta,
[data-theme="light"] .ctr-meta       { color: #444 !important; }

/* Sección generador: etiquetas, textos de ayuda */
[data-theme="light"] .ctr-gen-wrap label,
[data-theme="light"] .ctr-gen-label  { color: #222 !important; font-weight: 600 !important; }
[data-theme="light"] .ctr-gen-wrap p,
[data-theme="light"] .ctr-gen-desc   { color: #444 !important; }
[data-theme="light"] .ctr-gen-wrap h3,
[data-theme="light"] .ctr-gen-wrap h4 { color: #111 !important; }
[data-theme="light"] .ctr-gen-wrap small,
[data-theme="light"] .ctr-gen-help   { color: #555 !important; }
[data-theme="light"] .ctr-gen-wrap span:not([class*="status"]):not([class*="badge"]) {
    color: #333 !important;
}

/* Panel contratos: todos los textos sueltos */
[data-theme="light"] #panel-contratos h2,
[data-theme="light"] #panel-contratos h3,
[data-theme="light"] #panel-contratos h4 { color: #111 !important; }
[data-theme="light"] #panel-contratos p   { color: #444 !important; }
[data-theme="light"] #panel-contratos label { color: #222 !important; font-weight: 600 !important; }
[data-theme="light"] #panel-contratos .section-title { color: #111 !important; }
[data-theme="light"] #panel-contratos small { color: #555 !important; }

/* Contrato generado — título y subtítulo */
[data-theme="light"] #contrato-titulo    { color: #111 !important; font-weight: 700 !important; }
[data-theme="light"] #contrato-subtitulo { color: #444 !important; }
[data-theme="light"] #contrato-cuerpo    { color: #222 !important; }

/* ═══════════════════════════════════════════════════════════
   PERFIL USUARIO — TEXTOS MÁS OSCUROS (legibilidad en modo día)
═══════════════════════════════════════════════════════════ */
/* Labels en formularios */
[data-theme="light"] .pu-form-group label,
[data-theme="light"] .pu-label         { color: #222 !important; font-weight: 600 !important; }

/* Textos de información / ayuda */
[data-theme="light"] .pu-card p,
[data-theme="light"] .pu-info-text     { color: #333 !important; }
[data-theme="light"] .pu-card small,
[data-theme="light"] .pu-card .help-text { color: #555 !important; }

/* Sección Mi Perfil: datos personales */
[data-theme="light"] .pu-panel h2,
[data-theme="light"] .pu-panel h3,
[data-theme="light"] .pu-panel h4      { color: #111 !important; }
[data-theme="light"] .pu-panel label   { color: #222 !important; font-weight: 600 !important; }
[data-theme="light"] .pu-panel p       { color: #333 !important; }
[data-theme="light"] .pu-panel small   { color: #555 !important; }
[data-theme="light"] .pu-panel span:not([class*="badge"]):not([class*="status"]) {
    color: #333 !important;
}

/* Foto / galería: pie de fotos */
[data-theme="light"] .img-card-footer  { color: #444 !important; }

/* Sección Apariencia */
[data-theme="light"] .appearance-card p,
[data-theme="light"] .appearance-desc  { color: #444 !important; }
[data-theme="light"] .appearance-card label { color: #222 !important; }

/* Stats del hero — aún más visibles */
[data-theme="light"] .pu-stat-lbl { color: #555 !important; font-weight: 600 !important; }
[data-theme="light"] .pu-stat-val { color: #111 !important; font-weight: 700 !important; }

/* ═══════════════════════════════════════════════════════════
   MODALES — ESTÁNDAR UNIFICADO MODO DÍA
   Convierte todos los modales oscuros a tema claro.
   El header naranja se mantiene (es el acento de marca).
═══════════════════════════════════════════════════════════ */

/* ── Overlay de fondo (aplica a todos los tipos) ── */
[data-theme="light"] .modal-verificacion,
[data-theme="light"] .modal-ver-propuesta,
[data-theme="light"] .modal-premium,
[data-theme="light"] #modalFinanciamiento,
[data-theme="light"] #modalUnifilar,
[data-theme="light"] .modal-background {
    background: rgba(0,0,0,.45) !important;
    backdrop-filter: blur(6px) !important;
}

/* ── Contenedor principal de cada modal ── */
[data-theme="light"] .modal-verificacion-content,
[data-theme="light"] .modal-ver-propuesta-content,
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-content-premium-large,
[data-theme="light"] .modal-premium-content,
[data-theme="light"] #modalFinanciamiento .modal-content,
[data-theme="light"] #miModal {
    background: #ffffff !important;
    border: 2px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
    color: #1a1a1a !important;
}

/* El unifilar tiene color propio (morado) — solo aclaramos el body */
[data-theme="light"] .uni-content {
    background: #ffffff !important;
    border: 2px solid #9575cd !important;
    box-shadow: 0 20px 60px rgba(106,27,154,.2) !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .uni-body { background: #f5f7fb !important; }
[data-theme="light"] .uni-body * { color: #333 !important; }

/* ── Headers de modal (naranja — se mantiene en ambos modos) ── */
/* (No se tocan: ya son naranja gradiente, visible en claro y oscuro) */

/* ── Cuerpo del modal ── */
[data-theme="light"] .modal-verificacion-body,
[data-theme="light"] .modal-ver-propuesta-body,
[data-theme="light"] .modal-body,
[data-theme="light"] .modal-body-premium-large {
    background: #ffffff !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .modal-verificacion-body::-webkit-scrollbar-track { background: #eef1f6 !important; }

/* ── Secciones internas ── */
[data-theme="light"] .datos-section h4,
[data-theme="light"] .propuesta-section-title,
[data-theme="light"] .modal-ver-propuesta-content h2,
[data-theme="light"] .modal-ver-propuesta-content h3,
[data-theme="light"] .modal-ver-propuesta-content h4 {
    color: #111 !important;
    border-bottom-color: #e0e4ec !important;
}
[data-theme="light"] .datos-section h4 { border-bottom-color: #dde1ea !important; }

/* ── Labels e inputs dentro de modales ── */
[data-theme="light"] .dato-item label,
[data-theme="light"] .modal-verificacion-content label,
[data-theme="light"] .modal-ver-propuesta-content label,
[data-theme="light"] .modal-content label,
[data-theme="light"] #miModal label { color: #555 !important; font-weight: 600 !important; }

[data-theme="light"] .dato-input,
[data-theme="light"] .modal-verificacion-content input,
[data-theme="light"] .modal-verificacion-content select,
[data-theme="light"] .modal-content input,
[data-theme="light"] .modal-content select,
[data-theme="light"] #miModal input,
[data-theme="light"] #miModal select {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border-color: #c0c6d4 !important;
}
[data-theme="light"] .dato-input:read-only { background: #eef1f6 !important; color: #888 !important; }

/* ── Alerta info dentro de modal verificar datos ── */
[data-theme="light"] .alert-info {
    background: rgba(255,140,0,.08) !important;
    border-left-color: #c96800 !important;
    color: #7a4500 !important;
}
[data-theme="light"] .alert-warning {
    background: #fff8e1 !important;
    border-color: #ffc107 !important;
    color: #856404 !important;
}

/* ── Tabla de consumos ── */
[data-theme="light"] .tabla-consumos-container {
    border-color: #c8cdd8 !important;
}
[data-theme="light"] .tabla-consumos { background: #ffffff !important; }
[data-theme="light"] .tabla-consumos td { color: #333 !important; border-bottom-color: #eee !important; }
[data-theme="light"] .tabla-consumos tbody tr:hover { background: #fff4e6 !important; }
[data-theme="light"] .tabla-consumos input {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border-color: #c0c6d4 !important;
}

/* ── Info items de propuesta ── */
[data-theme="light"] .propuesta-info-item {
    background: #f5f7fb !important;
    border-left-color: #c96800 !important;
}
[data-theme="light"] .propuesta-info-item label { color: #777 !important; }
[data-theme="light"] .propuesta-info-item .value { color: #111 !important; }

/* ── Tabla productos de propuesta ── */
[data-theme="light"] .propuesta-productos-table { background: #ffffff !important; }
[data-theme="light"] .propuesta-productos-table td {
    color: #333 !important;
    border-bottom-color: #eee !important;
}
[data-theme="light"] .propuesta-productos-table tbody tr:hover { background: #fff4e6 !important; }

/* ── Stat cards en propuesta ── */
[data-theme="light"] .propuesta-stat-card {
    background: rgba(255,140,0,.06) !important;
    border-color: rgba(255,140,0,.25) !important;
}
[data-theme="light"] .propuesta-stat-card h4 { color: #666 !important; }

/* ── Footer del modal ── */
[data-theme="light"] .modal-ver-propuesta-footer,
[data-theme="light"] .modal-verificacion-footer,
[data-theme="light"] .modal-footer,
[data-theme="light"] .mover-botones {
    background: #f5f7fb !important;
    border-top: 1.5px solid #dde1ea !important;
    color: #333 !important;
}

/* ── Botones secundarios en modales ── */
[data-theme="light"] .btn-modal-secondary,
[data-theme="light"] .btn-cancelar {
    background: #f0f3f8 !important;
    color: #444 !important;
    border: 1.5px solid #c0c6d4 !important;
}
[data-theme="light"] .btn-modal-secondary:hover,
[data-theme="light"] .btn-cancelar:hover {
    background: #e6e9f0 !important;
    border-color: #aab0bf !important;
}

/* ── Modal de financiamiento ── */
[data-theme="light"] #modalFinanciamiento {
    background: rgba(0,0,0,.45) !important;
}
[data-theme="light"] #modalFinanciamiento .modal-content {
    background: #ffffff !important;
    border: 2px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
}
[data-theme="light"] #modalFinanciamiento .modal-body { background: #ffffff !important; }
[data-theme="light"] #modalFinanciamiento label { color: #555 !important; }
[data-theme="light"] #modalFinanciamiento input,
[data-theme="light"] #modalFinanciamiento select {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border-color: #c0c6d4 !important;
}
[data-theme="light"] #modalFinanciamiento p,
[data-theme="light"] #modalFinanciamiento span { color: #333 !important; }
[data-theme="light"] #modalFinanciamiento h3,
[data-theme="light"] #modalFinanciamiento h4 { color: #111 !important; }

/* ── Modal subir PDF ── */
[data-theme="light"] .modal-premium { background: rgba(0,0,0,.45) !important; }
[data-theme="light"] .modal-content-premium-large,
[data-theme="light"] .modal-premium-content {
    background: #ffffff !important;
    border: 2px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .modal-header-premium-compact {
    background: linear-gradient(135deg,#ff8c00,#e07000) !important;
    color: #fff !important;
}
[data-theme="light"] .modal-body-premium-large { background: #f5f7fb !important; }
[data-theme="light"] .modal-body-premium-large p,
[data-theme="light"] .modal-body-premium-large span,
[data-theme="light"] .modal-body-premium-large label { color: #333 !important; }
[data-theme="light"] .modal-body-premium-large h3,
[data-theme="light"] .modal-body-premium-large h4 { color: #111 !important; }

/* Tarjetas de modo en subir PDF */
[data-theme="light"] .mode-card {
    background: #f5f7fb !important;
    border: 1.5px solid #c8cdd8 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .mode-card:hover,
[data-theme="light"] .mode-card.active {
    background: #fff8f0 !important;
    border-color: #c96800 !important;
}
[data-theme="light"] .mode-card h3 { color: #111 !important; }
[data-theme="light"] .mode-card p  { color: #555 !important; }

/* ── Modal subir PDF — clases reales .mode-card-pretium-compact ── */
[data-theme="light"] .mode-card-pretium-compact {
    background: #f5f7fb !important;
    border: 2px solid #c8cdd8 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .mode-card-pretium-compact:hover {
    background: #fff8f0 !important;
    border-color: rgba(255,140,0,0.6) !important;
}
[data-theme="light"] .mode-card-pretium-compact.selected {
    background: linear-gradient(135deg,#fff8f0,#ffecd6) !important;
    border-color: #c96800 !important;
}
[data-theme="light"] .mode-title-large { color: #1a1a1a !important; }
[data-theme="light"] .mode-desc        { color: #555 !important; }

/* Zona de upload */
[data-theme="light"] .upload-section-pretium-compact {
    background: #f5f7fb !important;
    border: 2px dashed #b0b8cc !important;
}
[data-theme="light"] .upload-section-pretium-compact:hover {
    background: #eef1f8 !important;
    border-color: #c96800 !important;
}
[data-theme="light"] .upload-section-pretium-compact p { color: #1a1a1a !important; }
[data-theme="light"] .upload-section-pretium-compact small { color: #666 !important; }

/* Archivo seleccionado */
[data-theme="light"] .file-name-compact {
    background: #eef1f8 !important;
    border: 2px solid #ff8c00 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .file-name-compact span { color: #1a1a1a !important; }

/* Controles de formulario */
[data-theme="light"] .form-control-compact {
    background: #f5f7fb !important;
    border: 2px solid #c0c6d4 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .form-control-compact:focus {
    background: #ffffff !important;
    border-color: #c96800 !important;
}
[data-theme="light"] .form-control-compact option,
[data-theme="light"] .form-control-compact optgroup {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

/* Labels en formulario */
[data-theme="light"] .form-group-compact label { color: #2a2d35 !important; }

/* Registros de consumo */
[data-theme="light"] .registros-container-large,
[data-theme="light"] .registro-item-compact {
    background: #f0f3f8 !important;
    border-color: #c8cdd8 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .registro-item-compact input {
    background: #ffffff !important;
    border-color: #c0c6d4 !important;
    color: #1a1a1a !important;
}

/* Progreso */
[data-theme="light"] .progress-bar-compact {
    background: #dde2ec !important;
}
[data-theme="light"] .progress-text-compact { color: #1a1a1a !important; }

/* Footer del modal */
[data-theme="light"] .modal-footer-compact {
    background: #eef1f8 !important;
    border-top: 2px solid #c8cdd8 !important;
}

/* Botones secundarios/cancel en modal subir PDF */
[data-theme="light"] .btn-cancel-compact {
    background: #dde2ec !important;
    color: #2a2d35 !important;
    border: 1px solid #b0b8cc !important;
}
[data-theme="light"] .btn-cancel-compact:hover {
    background: #c8cdd8 !important;
}
[data-theme="light"] .btn-secondary-compact {
    background: #dde2ec !important;
    color: #2a2d35 !important;
    border: 1px solid #b0b8cc !important;
}
[data-theme="light"] .btn-secondary-compact:hover {
    background: #c8cdd8 !important;
}

/* Paso del formulario */
[data-theme="light"] .paso-form-compact { color: #1a1a1a !important; }

/* ── Modal contactos (#miModal) ── */
[data-theme="light"] #miModal {
    background: linear-gradient(135deg,#ffffff,#f8f9fa) !important;
    border: 2px solid #c8cdd8 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
    color: #1a1a1a !important;
}
[data-theme="light"] #miModal .form1 input,
[data-theme="light"] #miModal .form1 select {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
    border-color: #c0c6d4 !important;
}
[data-theme="light"] #miModal label { color: #555 !important; }
[data-theme="light"] #miModal h3   { color: #111 !important; }

/* ── Resumen items (modal verificar) ── */
[data-theme="light"] .resumen-item {
    background: #f5f7fb !important;
    border: 1.5px solid #c8cdd8 !important;
    color: #333 !important;
}
[data-theme="light"] .resumen-label { color: #666 !important; }
[data-theme="light"] .resumen-valor { color: #111 !important; font-weight: 700 !important; }

/* ── Stat boxes inline (subperiodos — background:white inline) ── */
[data-theme="light"] .modal-verificacion-body [style*="background: white"],
[data-theme="light"] .modal-verificacion-body [style*="background:white"] {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .modal-verificacion-body [style*="color: #666"],
[data-theme="light"] .modal-verificacion-body [style*="color:#666"] {
    color: #555 !important;
}

/* ═══════════════════════════════════════════════════════════
   TRANSICIONES SUAVES
═══════════════════════════════════════════════════════════ */
body, #wrapper, #main, #nav,
.perfil-tabnav, .ptab-panel, .proyecto-card,
.pu-wrap, .pu-card, .pu-panel,
.contactos-wrapper, .card-container,
.productos-wrapper, .dash-card, .kpi-card,
.action-btn, .chart-card, .recent-card,
.productos-nav a, .page-title, table th, table td {
    transition: background .28s ease, color .22s ease,
                border-color .22s ease, box-shadow .22s ease !important;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVIDAD MOBILE  (max-width: 600px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

    /* Nav tabs horizontales → wrap */
    #nav .links { flex-wrap: wrap !important; }
    #nav .links li { flex: 0 0 50% !important; }
    #nav .links li:not(:last-child)::after { display: none !important; }

    /* Tablas: scroll horizontal */
    .table-responsive,
    .tabla-consumos-container { overflow-x: auto !important; }

    /* KPI cards en 2 columnas */
    .kpi-grid { grid-template-columns: 1fr 1fr !important; }

    /* Cards de proyecto a 1 columna */
    .cards-grid,
    .proyectos-grid { grid-template-columns: 1fr !important; }

    /* FAB — pequeño ajuste posición */
    .theme-fab { left: 12px !important; bottom: 12px !important; }

    /* Modales ocupan toda la pantalla */
    .modal-content-premium-large,
    .modal-verificacion-content,
    .modal-ver-propuesta-content,
    #modalFinanciamiento .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 10px !important;
        margin: 4px !important;
    }

    /* pu-tabnav en perfil_usuario — 2 cols */
    .pu-tabnav { flex-wrap: wrap !important; }
    .pu-tab { flex: 0 0 calc(50% - 3px) !important; font-size: 11px !important; padding: 9px 6px !important; }

    /* Formulario a 1 columna */
    .pu-form-row { grid-template-columns: 1fr !important; }

    /* Tabla con scroll */
    table { display: block !important; overflow-x: auto !important; white-space: nowrap !important; }
}

/* ═══════════════════════════════════════════════════════════
   COTIZADOR SOLAR — overrides modo luz
   (cotizador.css usa variables de interface.css; aquí forzamos
   los valores correctos para [data-theme="light"])
═══════════════════════════════════════════════════════════ */
[data-theme="light"] .left-panel,
[data-theme="light"] .right-panel {
    background: #ffffff !important;
    border-color: #c8cdd8 !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .section {
    background: #f5f7fb !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .section-header {
    background: #ffffff !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .section-header:hover {
    background: #f0f2f5 !important;
}

[data-theme="light"] .section-title {
    color: #1a1a1a !important;
}

[data-theme="light"] .form-label {
    color: #5a6070 !important;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus {
    border-color: #c96800 !important;
    box-shadow: 0 0 0 3px rgba(255,140,0,0.12) !important;
}

[data-theme="light"] .form-input::placeholder {
    color: #aab0bf !important;
}

[data-theme="light"] .generate-btn {
    color: #ffffff !important;
}

[data-theme="light"] .toggle-icon,
[data-theme="light"] .price-display {
    color: #c96800 !important;
}

[data-theme="light"] .pdf-upload {
    background: #ffffff !important;
    border: 2px dashed #c8cdd8 !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .pdf-upload h3 {
    color: #1a1a1a !important;
}

/* Paneles extra / filas dinámicas del cotizador */
[data-theme="light"] .extra-item,
[data-theme="light"] .extra-row {
    background: #f5f7fb !important;
    border-color: #c8cdd8 !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .extra-item input,
[data-theme="light"] .extra-row input,
[data-theme="light"] .extra-item select,
[data-theme="light"] .extra-row select {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .summary-item {
    background: #f5f7fb !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .summary-spec,
[data-theme="light"] .cost-label {
    color: #1a1a1a !important;
}

[data-theme="light"] .summary-name {
    color: #5a6070 !important;
}

[data-theme="light"] .cost-breakdown {
    background: #f5f7fb !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .cost-row {
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .pricing-mode-container {
    background: #f5f7fb !important;
    border-color: #c8cdd8 !important;
}

[data-theme="light"] .toggle-label {
    color: #5a6070 !important;
}

[data-theme="light"] .toggle-label.active {
    color: #c96800 !important;
}

[data-theme="light"] .slider {
    background-color: #c8cdd8 !important;
}

/* section.post wrapper del cotizador */
[data-theme="light"] section.post {
    background-color: #f0f2f5 !important;
    color: #1a1a1a !important;
}

/* Contenido desplegable de secciones */
[data-theme="light"] .section-content {
    background: #f5f7fb !important;
    color: #1a1a1a !important;
}

/* Títulos y valores numéricos en el panel derecho */
[data-theme="light"] .summary-title {
    color: #c96800 !important;
}

[data-theme="light"] .cost-value {
    color: #1a1a1a !important;
}

/* Opciones de select */
[data-theme="light"] .form-select option,
[data-theme="light"] select option {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

/* Textos hardcodeados en blanco dentro de las secciones */
[data-theme="light"] .section-content,
[data-theme="light"] .form-label {
    color: #1a1a1a !important;
}

/* ── Logo header (CRM / WhatsApp pages) ── */
.page-logo-header {
    text-align: center;
    padding: 28px 0 18px;
    background: var(--bg-body, #111);
}
.page-logo-header img {
    max-height: 110px;
    width: auto;
    display: block;
    margin: 0 auto;
}
[data-theme="light"] .page-logo-header {
    background: #eef1f6;
}

/* ═══════════════════════════════════════════════════════════
   CRM — MÓDULOS (dashboard, pipeline, calendario, etc.)
   Todos los CRM usan clases con colores hardcoded en dark.
   Estas reglas tienen especificidad [data-theme] + clase para ganar.
═══════════════════════════════════════════════════════════ */

/* ── Body base de páginas CRM ── */
[data-theme="light"] body {
    background: #eef1f6 !important;
    color: #1a1a1a !important;
}

/* ── KPI/Metric cards ── */
[data-theme="light"] .crm-metric {
    background: #ffffff !important;
    border-color: #d0d6e2 !important;
}
[data-theme="light"] .crm-metric:hover { border-color: rgba(255,140,0,.4) !important; background: #fff8f0 !important; }
[data-theme="light"] .crm-metric-data .lbl { color: #6a7080 !important; }
[data-theme="light"] .crm-metric-data .sub { color: #8a909c !important; }

/* ── Estatus pills (dashboard) ── */
[data-theme="light"] .es-pill {
    background: #ffffff !important;
    border-color: #d0d6e2 !important;
}
[data-theme="light"] .es-pill:hover { border-color: rgba(255,140,0,.4) !important; }
[data-theme="light"] .es-pill .ep-l { color: #6a7080 !important; opacity: 1 !important; }
[data-theme="light"] .ep-borrador .ep-n { color: #777 !important; }
[data-theme="light"] .ep-enviada  .ep-n { color: #1565c0 !important; }
[data-theme="light"] .ep-aceptada .ep-n { color: #2e7d32 !important; }
[data-theme="light"] .ep-rechazada .ep-n { color: #c62828 !important; }
[data-theme="light"] .ep-vencida  .ep-n { color: #546e7a !important; }

/* ── Section titles ── */
[data-theme="light"] .section-title {
    color: #6a7080 !important;
}
[data-theme="light"] .section-title::after { background: #d0d6e2 !important; }

/* ── Bar chart ── */
[data-theme="light"] .chart-card {
    background: #ffffff !important;
    border-color: #d0d6e2 !important;
}
[data-theme="light"] .chart-label { color: #6a7080 !important; }
[data-theme="light"] .chart-divider { background: #e4e8f0 !important; }
[data-theme="light"] .bar-lbl { color: #6a7080 !important; }
[data-theme="light"] .bar-val { color: #444 !important; }
[data-theme="light"] .progress-bar-wrap { background: #e0e4ee !important; }

/* ── Dash cards (listas cotizaciones, tareas, etc.) ── */
[data-theme="light"] .dash-card {
    background: #ffffff !important;
    border-color: #d0d6e2 !important;
}
[data-theme="light"] .dash-card-head { border-color: #e8ebf2 !important; }
[data-theme="light"] .dash-card-head span { color: #1a1a1a !important; }
[data-theme="light"] .dash-list li { border-color: #f0f2f6 !important; color: #1a1a1a !important; }
[data-theme="light"] .dash-list li:hover { background: #f5f7fb !important; }
[data-theme="light"] .dl-sub  { color: #7a8290 !important; }
[data-theme="light"] .dl-fecha { color: #9a9ea8 !important; }
[data-theme="light"] .dl-title { color: #1a1a1a !important; }
[data-theme="light"] .empty-state { color: #aaa !important; }

/* ── Badges en light ── */
[data-theme="light"] .badge-borrador  { background: rgba(0,0,0,.07) !important; color: #555 !important; }
[data-theme="light"] .badge-enviada   { background: rgba(21,101,192,.1) !important; color: #1565c0 !important; }
[data-theme="light"] .badge-aceptada  { background: rgba(46,125,50,.1) !important; color: #2e7d32 !important; }
[data-theme="light"] .badge-rechazada { background: rgba(198,40,40,.1) !important; color: #c62828 !important; }
[data-theme="light"] .badge-vencida   { background: rgba(84,110,122,.1) !important; color: #546e7a !important; }
[data-theme="light"] .badge-alta  { background: rgba(198,40,40,.1) !important; color: #c62828 !important; }
[data-theme="light"] .badge-media { background: rgba(230,81,0,.1) !important; color: #e65100 !important; }
[data-theme="light"] .badge-baja  { background: rgba(46,125,50,.1) !important; color: #2e7d32 !important; }

/* ── Seguimientos urgentes ── */
[data-theme="light"] .seg-alert { background: rgba(255,140,0,.06) !important; border-color: rgba(255,140,0,.25) !important; }
[data-theme="light"] .seg-item  { border-color: rgba(255,140,0,.12) !important; }
[data-theme="light"] .seg-info .sc { color: #7a8290 !important; }
[data-theme="light"] .seg-info .st { color: #1a1a1a !important; }

/* ── Contactos ── */
[data-theme="light"] .contact-card {
    background: #ffffff !important;
    border-color: #d0d6e2 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .contact-card:hover { border-color: rgba(255,140,0,.4) !important; background: #fff8f0 !important; }
[data-theme="light"] .contact-info .cn { color: #1a1a1a !important; }
[data-theme="light"] .contact-info .ce { color: #7a8290 !important; }

/* ══════════════════════════════════════════════
   CRM CALENDARIO — clases reales de crm_calendario.php
   ══════════════════════════════════════════════ */
/* Hero */
[data-theme="light"] .cal-hero { background: #ffffff !important; border-color: rgba(255,140,0,.2) !important; }
[data-theme="light"] .cal-hero p { color: #666 !important; }
[data-theme="light"] .btn-c-ghost { background: rgba(0,0,0,.04) !important; border-color: rgba(0,0,0,.12) !important; color: #555 !important; }
[data-theme="light"] .btn-c-ghost:hover { background: rgba(0,0,0,.08) !important; color: #1a1a1a !important; }
/* Stats */
[data-theme="light"] .cal-stat { background: #ffffff !important; border-color: #e0e4ee !important; }
[data-theme="light"] .cal-stat-val { color: #1a1a1a !important; }
[data-theme="light"] .cal-stat-lbl { color: #888 !important; }
/* Navegación mes */
[data-theme="light"] .cal-nav-title { color: #1a1a1a !important; }
[data-theme="light"] .cal-nav-btn { background: rgba(0,0,0,.05) !important; border-color: #c8d0de !important; color: #444 !important; }
[data-theme="light"] .cal-nav-btn:hover { background: rgba(255,140,0,.1) !important; border-color: #c96800 !important; color: #c96800 !important; }
/* Filtros */
[data-theme="light"] .fil-btn { background: rgba(0,0,0,.05) !important; color: #555 !important; border-color: transparent !important; }
[data-theme="light"] .fil-btn.on { color: #fff !important; }
/* Grid */
[data-theme="light"] .cal-grid { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .cal-weekdays { background: #f0f3f8 !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .cal-wd { color: #888 !important; }
[data-theme="light"] .cal-wd:first-child,
[data-theme="light"] .cal-wd:last-child { color: rgba(255,140,0,.75) !important; }
[data-theme="light"] .cal-day { background: #ffffff !important; border-color: #e4e8f2 !important; }
[data-theme="light"] .cal-day:hover { background: rgba(255,140,0,.05) !important; }
[data-theme="light"] .cal-day.today { background: rgba(255,140,0,.07) !important; border-color: rgba(255,140,0,.25) !important; }
[data-theme="light"] .cal-day.selected { background: rgba(255,140,0,.1) !important; outline-color: rgba(255,140,0,.4) !important; }
[data-theme="light"] .cal-day.other-month { opacity: .5 !important; }
[data-theme="light"] .cal-day-num { color: #444 !important; }
[data-theme="light"] .cal-day.today .cal-day-num { color: #c96800 !important; }
[data-theme="light"] .cal-day-more { color: #999 !important; }
[data-theme="light"] .cal-add-btn { color: rgba(0,0,0,.3) !important; }
[data-theme="light"] .cal-add-btn:hover { background: rgba(255,140,0,.15) !important; color: #c96800 !important; }
/* Panel detalle */
[data-theme="light"] .cal-detail { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .cal-detail-title { color: #1a1a1a !important; }
[data-theme="light"] .cal-detail-sub { color: #888 !important; }
[data-theme="light"] .cal-detail-empty { color: #bbb !important; }
[data-theme="light"] .ev-item { background: rgba(0,0,0,.03) !important; border-color: #e4e8f0 !important; }
[data-theme="light"] .ev-item:hover { background: rgba(255,140,0,.07) !important; border-color: rgba(255,140,0,.2) !important; }
[data-theme="light"] .ev-titulo { color: #1a1a1a !important; }
[data-theme="light"] .ev-sub { color: #777 !important; }
[data-theme="light"] .ev-hora { color: #aaa !important; }
/* Reporte / tabla */
[data-theme="light"] .cal-report { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .cal-report h2 { color: #1a1a1a !important; }

/* ── Pipeline Kanban ── */
[data-theme="light"] .kanban-wrap  { background: #f0f2f6 !important; }
[data-theme="light"] .kanban-col   { background: #ffffff !important; border-color: #d0d6e2 !important; }
[data-theme="light"] .kanban-header { border-color: #e4e8f0 !important; }
[data-theme="light"] .kanban-inner { background: transparent !important; }
[data-theme="light"] .crm-card .card-name { color: #1a1a1a !important; }
[data-theme="light"] .crm-card .card-val  { color: #1a1a1a !important; }
[data-theme="light"] .crm-card .card-sub  { color: #7a8290 !important; }
[data-theme="light"] .kanban-add { color: rgba(0,0,0,.35) !important; border-color: rgba(0,0,0,.1) !important; }
[data-theme="light"] .kanban-add:hover { background: rgba(255,140,0,.06) !important; color: #c96800 !important; }
[data-theme="light"] .kanban-search { background: #f5f7fb !important; border-color: #d0d6e2 !important; color: #1a1a1a !important; }

/* ── Reportes y Cotizaciones tablas ── */
[data-theme="light"] .rep-table th  { background: #2a2d35 !important; color: #fff !important; }
[data-theme="light"] .rep-table td  { border-color: #e8ebf2 !important; color: #1a1a1a !important; }
[data-theme="light"] .rep-table tr:hover td { background: #fff8f0 !important; }
[data-theme="light"] .rep-filter-bar { background: #ffffff !important; border-color: #d0d6e2 !important; }
[data-theme="light"] .kpi-card { background: #ffffff !important; border-color: #d0d6e2 !important; color: #1a1a1a !important; }
[data-theme="light"] .kpi-card .kpi-val { color: #1a1a1a !important; }
[data-theme="light"] .kpi-card .kpi-lbl { color: #7a8290 !important; }

/* ── perfil_usuario: Cotización config editor ── */
[data-theme="light"] #cot-split > div:first-child { background: #f9fafb !important; border-color: #e0e4ee !important; }
[data-theme="light"] #cot-split .cfg-panel-header { color: #666 !important; }
[data-theme="light"] #cot-split label { color: #555 !important; }
[data-theme="light"] #cot-split label span { color: #999 !important; }
[data-theme="light"] #cot-split input[type="number"],
[data-theme="light"] #cot-split input[type="text"],
[data-theme="light"] #cot-split textarea { background: #ffffff !important; color: #1a1a1a !important; border-color: #d0d6e2 !important; }
[data-theme="light"] #cot-split > div:last-child .cfg-panel-header { color: #666 !important; }

/* ── perfil_usuario: PDF config editor ── */
[data-theme="light"] #seccion-pdf-config .cfg-panel-header { color: #666 !important; }
[data-theme="light"] #seccion-pdf-config .pdf-editor-card { background: #f9fafb !important; border-color: #e0e4ee !important; }
[data-theme="light"] #seccion-pdf-config label { color: #555 !important; }
[data-theme="light"] #seccion-pdf-config label span { color: #999 !important; }
[data-theme="light"] #seccion-pdf-config input[type="text"],
[data-theme="light"] #seccion-pdf-config input[type="color"],
[data-theme="light"] #seccion-pdf-config textarea { background: #ffffff !important; color: #1a1a1a !important; border-color: #d0d6e2 !important; }
[data-theme="light"] #seccion-pdf-config .pdf-check-label { color: #333 !important; background: rgba(0,0,0,.04) !important; border-color: rgba(0,0,0,.12) !important; }

/* ── perfil_usuario: Contrato nueva plantilla modal ── */
[data-theme="light"] .tpl-preview-panel { border-color: #d0d6e2 !important; }
[data-theme="light"] .tpl-preview-header { background: #f0f2f6 !important; border-color: #d0d6e2 !important; }
[data-theme="light"] .tpl-preview-header span:first-child { color: #1b5e20 !important; }
[data-theme="light"] .tpl-preview-scroll { background: #dde2ec !important; }
[data-theme="light"] .tpl-content-area { background: #ffffff !important; color: #1a1a1a !important; border-color: #d0d6e2 !important; }

/* ══════════════════════════════════════════════
   CRM HERO HEADER BAR (crm_hero_nav.php)
   ══════════════════════════════════════════════ */
[data-theme="light"] .crm-hero { background: #ffffff !important; border-bottom: 2px solid rgba(255,140,0,.2) !important; box-shadow: 0 2px 12px rgba(0,0,0,.06) !important; }
[data-theme="light"] .crm-hero-text h1 { color: #1a1a1a !important; }
[data-theme="light"] .crm-hero-text h1 span { color: #c96800 !important; }
[data-theme="light"] .crm-hero-text p { color: #666 !important; }
[data-theme="light"] .btn-crm.btn-ghost { background: rgba(0,0,0,.04) !important; border-color: rgba(0,0,0,.12) !important; color: #444 !important; }
[data-theme="light"] .btn-crm.btn-ghost:hover { background: rgba(0,0,0,.08) !important; color: #1a1a1a !important; border-color: rgba(0,0,0,.2) !important; }
[data-theme="light"] .btn-crm.btn-ghost.crm-nav-active { background: rgba(255,140,0,.1) !important; border-color: rgba(255,140,0,.45) !important; color: #e67e00 !important; }

/* ══════════════════════════════════════════════
   CRM COTIZACIONES — filtros, cards, modal
   ══════════════════════════════════════════════ */
[data-theme="light"] .filtro-btn { color: #555 !important; border-color: #c8d0de !important; background: transparent !important; }
[data-theme="light"] .filtro-btn:hover { color: #c96800 !important; border-color: rgba(255,140,0,.5) !important; }
[data-theme="light"] .filtro-btn.active { color: #e67e00 !important; border-color: #c96800 !important; background: rgba(255,140,0,.08) !important; }
[data-theme="light"] .search-wrap input { background: #ffffff !important; color: #1a1a1a !important; border-color: #c8d0de !important; }
[data-theme="light"] .search-wrap i { color: #aaa !important; }
[data-theme="light"] .cot-card { background: #ffffff !important; border-color: #e0e4ee !important; box-shadow: 0 1px 6px rgba(0,0,0,.06) !important; }
[data-theme="light"] .cot-card:hover { border-color: rgba(255,140,0,.4) !important; background: #fff8f0 !important; }
[data-theme="light"] .cot-titulo { color: #1a1a1a !important; }
[data-theme="light"] .cot-contacto { color: #777 !important; }
[data-theme="light"] .cot-meta { color: #999 !important; }
[data-theme="light"] .badge-borrador { background: rgba(0,0,0,.06) !important; color: #666 !important; }
[data-theme="light"] .btn-ghost { background: rgba(0,0,0,.04) !important; border-color: rgba(0,0,0,.12) !important; color: #555 !important; }
[data-theme="light"] .btn-ghost:hover { background: rgba(0,0,0,.08) !important; color: #1a1a1a !important; }
[data-theme="light"] .btn-icon { color: #777 !important; }
[data-theme="light"] .btn-icon:hover { background: rgba(0,0,0,.06) !important; color: #1a1a1a !important; }
[data-theme="light"] .btn-back { color: #777 !important; }
/* Modal cotización */
[data-theme="light"] .modal-box { background: #ffffff !important; border-color: rgba(255,140,0,.25) !important; box-shadow: 0 16px 48px rgba(0,0,0,.15) !important; }
[data-theme="light"] .modal-title { color: #1a1a1a !important; }
[data-theme="light"] .modal-close { color: #888 !important; }
[data-theme="light"] .modal-close:hover { color: #1a1a1a !important; }
[data-theme="light"] .section-label { color: #888 !important; }
[data-theme="light"] .section-label::after { background: rgba(0,0,0,.1) !important; }
[data-theme="light"] .form-field label { color: #666 !important; }
[data-theme="light"] .form-field input,
[data-theme="light"] .form-field select,
[data-theme="light"] .form-field textarea { background: #f7f9fc !important; color: #1a1a1a !important; border-color: #c8d0de !important; }
[data-theme="light"] .form-field select option { background: #ffffff !important; color: #1a1a1a !important; }
[data-theme="light"] .items-header { color: #888 !important; }
[data-theme="light"] .item-row input,
[data-theme="light"] .item-row select { background: #f7f9fc !important; color: #1a1a1a !important; border-color: #c8d0de !important; }
[data-theme="light"] .btn-add-item { background: rgba(0,0,0,.03) !important; border-color: rgba(0,0,0,.15) !important; color: #777 !important; }
[data-theme="light"] .btn-add-item:hover { border-color: #c96800 !important; color: #c96800 !important; }
[data-theme="light"] .totales-box { background: #f5f7fb !important; }
[data-theme="light"] .totales-row { color: #1a1a1a !important; }
[data-theme="light"] .totales-row.grand { border-color: rgba(0,0,0,.1) !important; }
[data-theme="light"] .ac-list { background: #ffffff !important; border-color: rgba(255,140,0,.3) !important; }
[data-theme="light"] .ac-item { border-color: rgba(0,0,0,.06) !important; color: #1a1a1a !important; }
[data-theme="light"] .ac-item:hover { background: rgba(255,140,0,.07) !important; }
[data-theme="light"] .ac-item small { color: #888 !important; }

/* ══════════════════════════════════════════════
   CRM REPORTES — filtros, KPIs, tabla
   ══════════════════════════════════════════════ */
[data-theme="light"] .filters-panel { background: #ffffff !important; border-color: rgba(255,140,0,.2) !important; }
[data-theme="light"] .filters-title { color: #888 !important; }
[data-theme="light"] .f-group label { color: #666 !important; }
[data-theme="light"] .f-input { background: #f5f7fb !important; color: #1a1a1a !important; border-color: #c8d0de !important; }
[data-theme="light"] .kpi-c { background: #ffffff !important; border-color: #e0e4ee !important; box-shadow: 0 1px 5px rgba(0,0,0,.05) !important; }
[data-theme="light"] .kpi-c .kl { color: #888 !important; }
[data-theme="light"] .progress-bar-wrap { background: rgba(0,0,0,.07) !important; }
[data-theme="light"] .table-wrap { background: #ffffff !important; border-color: #e0e4ee !important; }
[data-theme="light"] .table-head-bar { border-color: #e0e4ee !important; }
[data-theme="light"] .table-head-bar .tit { color: #1a1a1a !important; }
[data-theme="light"] .cot-table th { color: #666 !important; border-color: #e8edf5 !important; }
[data-theme="light"] .cot-table td { color: #1a1a1a !important; border-color: #f0f3f8 !important; }
[data-theme="light"] .cot-table tr:nth-child(even) td { background: #fafbfd !important; }
[data-theme="light"] .cot-table tr:hover td { background: #fff8f0 !important; }
[data-theme="light"] .cot-table tfoot td { border-color: rgba(255,140,0,.3) !important; color: #1a1a1a !important; background: #f5f7fb !important; }
[data-theme="light"] .btn-ghost2 { background: rgba(0,0,0,.04) !important; color: #555 !important; border-color: rgba(0,0,0,.1) !important; }
[data-theme="light"] .btn-ghost2:hover { background: rgba(0,0,0,.08) !important; color: #1a1a1a !important; }

/* ══════════════════════════════════════════════
   CRM PIPELINE — kanban body, cards sub-elements
   ══════════════════════════════════════════════ */
[data-theme="light"] .kanban-body { background: #eef0f5 !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .kanban-body.drag-over { background: rgba(255,140,0,.08) !important; border-color: rgba(255,140,0,.35) !important; }
[data-theme="light"] .crm-card { background: #ffffff !important; border-color: #d4d9e8 !important; box-shadow: 0 2px 8px rgba(0,0,0,.08) !important; }
[data-theme="light"] .crm-card:hover { border-color: rgba(255,140,0,.5) !important; box-shadow: 0 4px 14px rgba(0,0,0,.12) !important; }
[data-theme="light"] .crm-card .card-title { color: #1a1a1a !important; }
[data-theme="light"] .crm-card .card-contact { color: #666 !important; }
[data-theme="light"] .crm-card .card-prob { color: #888 !important; }
[data-theme="light"] .crm-card .card-fecha { color: #999 !important; }
[data-theme="light"] .crm-card .card-footer { border-color: rgba(0,0,0,.08) !important; }
[data-theme="light"] .prob-bar { background: rgba(0,0,0,.1) !important; }
[data-theme="light"] .col-empty { color: #aaa !important; }
[data-theme="light"] .col-empty i { opacity: .4 !important; color: #888 !important; }

/* ── Pipeline: search bar + modal ── */
[data-theme="light"] .crm-search { background: #ffffff !important; color: #1a1a1a !important; border-color: #c8d0de !important; }
[data-theme="light"] .crm-search::placeholder { color: #aaa !important; }
[data-theme="light"] .crm-modal { background: #ffffff !important; border-color: rgba(255,140,0,.2) !important; box-shadow: 0 20px 60px rgba(0,0,0,.15) !important; }
[data-theme="light"] .crm-modal-header h2 { color: #1a1a1a !important; }
[data-theme="light"] .modal-proy-card { border-color: #e0e4ee !important; background: #fafbfd !important; color: #1a1a1a !important; }
[data-theme="light"] .modal-proy-card:hover { border-color: rgba(255,140,0,.3) !important; background: rgba(255,140,0,.05) !important; }
[data-theme="light"] .modal-proy-card.selected { border-color: #c96800 !important; background: rgba(255,140,0,.1) !important; }
[data-theme="light"] .divider { background: rgba(0,0,0,.08) !important; }
[data-theme="light"] .modal-footer { border-color: rgba(0,0,0,.08) !important; }

/* ══════════════════════════════════════════════
   WHATSAPP PANEL (whatsapp_panel.php)
   ══════════════════════════════════════════════ */
/* Layout wrapper */
[data-theme="light"] .wa-layout { border-color: #d4d9e8 !important; background: #f0f3f8 !important; }

/* Sidebar izquierdo */
[data-theme="light"] .wa-sidebar { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .wa-sidebar-header { border-color: #e4e8f0 !important; }
[data-theme="light"] .wa-sidebar-header h2 { color: #1a1a1a !important; }
[data-theme="light"] .wa-sidebar-header .btn-icon { color: #888 !important; }
[data-theme="light"] .wa-sidebar-header .btn-icon:hover { color: #25d366 !important; background: rgba(37,211,102,.1) !important; }
[data-theme="light"] .wa-search { border-color: #e4e8f0 !important; }
[data-theme="light"] .wa-search input { background: #f5f7fb !important; color: #1a1a1a !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .wa-search input::placeholder { color: #aaa !important; }
[data-theme="light"] .wa-search i { color: #aaa !important; }
[data-theme="light"] .wa-tabs { border-color: #e4e8f0 !important; }
[data-theme="light"] .wa-tab { color: #888 !important; background: none !important; }
[data-theme="light"] .wa-tab.active { color: #25d366 !important; }
[data-theme="light"] .wa-tab:hover { color: #444 !important; }
[data-theme="light"] .wa-conv-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15) !important; }
[data-theme="light"] .wa-conv-item { border-color: #f0f2f6 !important; }
[data-theme="light"] .wa-conv-item:hover { background: rgba(0,0,0,.03) !important; }
[data-theme="light"] .wa-conv-item.active { background: rgba(37,211,102,.07) !important; border-left-color: #25d366 !important; }
[data-theme="light"] .wa-conv-name { color: #1a1a1a !important; }
[data-theme="light"] .wa-conv-preview { color: #888 !important; }
[data-theme="light"] .wa-conv-time { color: #aaa !important; }
[data-theme="light"] .wa-empty-side { color: #bbb !important; }

/* Chat principal */
[data-theme="light"] .wa-chat { background: #e8edf5 !important; }
[data-theme="light"] .wa-chat-placeholder { color: #999 !important; opacity: .7 !important; }
[data-theme="light"] .wa-chat-placeholder p { color: #888 !important; }
[data-theme="light"] .wa-chat-header { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .wa-chat-header-name { color: #1a1a1a !important; }
[data-theme="light"] .btn-chat-action { color: #888 !important; }
[data-theme="light"] .btn-chat-action:hover { color: #25d366 !important; background: rgba(37,211,102,.1) !important; }
[data-theme="light"] .wa-messages { background: #e8edf5 !important; }
[data-theme="light"] .wa-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15) !important; }
/* Mensajes recibidos */
[data-theme="light"] .wa-msg.entrante { background: #ffffff !important; color: #1a1a1a !important; box-shadow: 0 1px 3px rgba(0,0,0,.08) !important; }
[data-theme="light"] .wa-msg.entrante .wa-msg-time { color: #aaa !important; }
/* Mensajes enviados — mantienen verde WhatsApp */
[data-theme="light"] .wa-msg.saliente .wa-msg-time { color: rgba(255,255,255,.6) !important; }
[data-theme="light"] .wa-date-sep span { background: rgba(255,255,255,.7) !important; color: #777 !important; }
/* Input área */
[data-theme="light"] .wa-input-area { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .wa-input-area textarea { background: #f5f7fb !important; color: #1a1a1a !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .wa-input-area textarea::placeholder { color: #bbb !important; }
[data-theme="light"] .btn-send:disabled { background: #d0d5e0 !important; }

/* Modal nueva conversación */
[data-theme="light"] .modal { background: #ffffff !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .modal-field input { background: #f5f7fb !important; color: #1a1a1a !important; border-color: #d4d9e8 !important; }
[data-theme="light"] .btn-sm-cancel { border-color: rgba(0,0,0,.15) !important; color: #555 !important; }

/* ══════════════════════════════════════════════
   DASHBOARD (menu.php) — met-card, crm-kpi, bess, tbl, dash-card
   ══════════════════════════════════════════════ */

/* Métricas grandes (ahorro, potencia, generación) */
[data-theme="light"] .met-card {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.07) !important;
}
[data-theme="light"] .met-num { color: #1a1a1a !important; }
[data-theme="light"] .met-lbl { color: #555 !important; }
[data-theme="light"] .met-icon { opacity: .85 !important; }

/* KPIs del CRM en dashboard */
[data-theme="light"] .crm-kpi,
[data-theme="light"] a.crm-kpi {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
    color: inherit !important;
}
[data-theme="light"] .crm-kpi:hover {
    background: #fff8f0 !important;
    border-color: rgba(255,140,0,.4) !important;
}
[data-theme="light"] .crm-kpi-lbl { color: #555 !important; }
[data-theme="light"] .crm-kpi-sub { color: #888 !important; }

/* Recientes CRM */
[data-theme="light"] .crm-recientes {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
}
[data-theme="light"] .crm-rec-hdr {
    background: #f5f7fb !important;
    border-bottom: 1px solid #e0e4ee !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .crm-rec-row {
    border-bottom: 1px solid #f0f3f8 !important;
}
[data-theme="light"] .crm-rec-row:hover { background: #fffbf6 !important; }
[data-theme="light"] .crm-rec-nombre { color: #1a1a1a !important; }
[data-theme="light"] .crm-rec-contacto { color: #666 !important; }
[data-theme="light"] .crm-rec-valor  { color: #1a1a1a !important; }
[data-theme="light"] .crm-rec-fecha  { color: #888 !important; }

/* KPIs BESS en dashboard */
[data-theme="light"] .bess-kpi {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
}
[data-theme="light"] .bess-kpi-lbl { color: #555 !important; }
[data-theme="light"] .bess-kpi-sub { color: #888 !important; }

/* Recientes BESS */
[data-theme="light"] .bess-recientes {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
}
[data-theme="light"] .bess-rec-hdr {
    background: #f5f7fb !important;
    border-bottom: 1px solid #e0e4ee !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .bess-rec-row { border-bottom: 1px solid #f0f3f8 !important; }
[data-theme="light"] .bess-rec-nombre { color: #1a1a1a !important; }
[data-theme="light"] .bess-rec-contacto { color: #666 !important; }
[data-theme="light"] .bess-rec-valor  { color: #1a1a1a !important; }
[data-theme="light"] .bess-rec-fecha  { color: #888 !important; }

/* Tabla propuestas más vistas (.tbl) */
[data-theme="light"] .tbl {
    background: #ffffff !important;
}
[data-theme="light"] .tbl thead th,
[data-theme="light"] .tbl th {
    background: #f0f2f8 !important;
    color: #444 !important;
    border-bottom: 2px solid #d8dde8 !important;
}
[data-theme="light"] .tbl td {
    color: #1a1a1a !important;
    border-bottom: 1px solid #f0f3f8 !important;
}
[data-theme="light"] .tbl tr:hover td { background: #fffbf6 !important; }

/* Dash card (prop-list, prop-item, etc.) */
[data-theme="light"] .dash-card {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.07) !important;
}
[data-theme="light"] .dash-card-hdr { color: #1a1a1a !important; border-bottom: 1px solid #e8edf5 !important; }
[data-theme="light"] .prop-item { border-bottom: 1px solid #f0f3f8 !important; }
[data-theme="light"] .prop-item:hover { background: #fffbf6 !important; }
[data-theme="light"] .pi-name  { color: #1a1a1a !important; }
[data-theme="light"] .pi-proj  { color: #666 !important; }
[data-theme="light"] .pi-amount { color: #c96800 !important; }

/* Sección combinada CRM+BESS */
[data-theme="light"] .combined-section {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
}
[data-theme="light"] .combined-title { color: #1a1a1a !important; border-bottom: 1px solid #e8edf5 !important; }

/* Comp table */
[data-theme="light"] .comp-table th { background: #f0f2f8 !important; color: #444 !important; }
[data-theme="light"] .comp-table td { color: #1a1a1a !important; border-bottom: 1px solid #f0f3f8 !important; }
[data-theme="light"] .comp-table tr:hover td { background: #fffbf6 !important; }

/* CRM/BESS section headers */
[data-theme="light"] .crm-dash-section,
[data-theme="light"] .bess-dash-section {
    background: #ffffff !important;
    border: 1px solid #e0e4ee !important;
}
[data-theme="light"] .crm-dash-title,
[data-theme="light"] .bess-dash-title { color: #1a1a1a !important; border-bottom: 1px solid #e8edf5 !important; }
[data-theme="light"] .sec-divider { border-color: #e0e4ee !important; color: #888 !important; }
[data-theme="light"] .empty-state { color: #888 !important; }

/* Inline style backgrounds in menu.php cards */
[data-theme="light"] #main > div[style*="background:linear-gradient(135deg,#1a1a1a"],
[data-theme="light"] #main > div > div[style*="background:linear-gradient(135deg,#1a1a1a"],
[data-theme="light"] div[style*="background:linear-gradient(135deg,#1a1a1a,#1e1e1e"],
[data-theme="light"] div[style*="background: linear-gradient(135deg, #1a1a1a"] {
    background: #ffffff !important;
    border-color: #e0e4ee !important;
}

/* Inline style overrides para secciones con background dark forzado */
[data-theme="light"] .met-card,
[data-theme="light"] .crm-kpi,
[data-theme="light"] a.crm-kpi,
[data-theme="light"] .crm-recientes,
[data-theme="light"] .bess-kpi,
[data-theme="light"] .bess-recientes,
[data-theme="light"] .dash-card,
[data-theme="light"] .crm-dash-section,
[data-theme="light"] .bess-dash-section,
[data-theme="light"] .combined-section {
    background: #ffffff !important;
    border-color: #e0e4ee !important;
    color: #1a1a1a !important;
}

/* ═══════════════════════════════════════════════════════════
   CONTRASTE ICONOS NARANJA EN MODO DÍA
   #ff8c00 sobre blanco = 3:1 (insuficiente para iconos pequeños)
   #c96800 sobre blanco = 4.8:1 (pasa WCAG AA)
═══════════════════════════════════════════════════════════ */

/* Iconos con inline style color:#ff8c00 — selectores de atributo */
[data-theme="light"] i[style*="color:#ff8c00"],
[data-theme="light"] i[style*="color: #ff8c00"],
[data-theme="light"] span[style*="color:#ff8c00"],
[data-theme="light"] span[style*="color: #ff8c00"] {
    color: #c96800 !important;
}

/* Nav: iconos dentro de los links (crown, handshake, etc.) */
[data-theme="light"] #nav .links a i {
    color: inherit !important;
}
[data-theme="light"] #nav .links li:not(.active) a i[style*="color:#ff8c00"],
[data-theme="light"] #nav .links li:not(.active) a i[style*="color: #ff8c00"] {
    color: #c96800 !important;
}

/* Textos naranjas sobre fondos claros (--ora usa #c96800, pero overrides explícitos con #ff8c00 aún existen) */
[data-theme="light"] .pi-amount { color: #c96800 !important; }
[data-theme="light"] .price-display { color: #c96800 !important; }
[data-theme="light"] .summary-title { color: #c96800 !important; }
[data-theme="light"] .gal-modal-title { color: #c96800 !important; }

/* KPI icons de dashboard que usan inline orange */
[data-theme="light"] .met-card i[style*="color:#ff8c00"],
[data-theme="light"] .crm-kpi  i[style*="color:#ff8c00"],
[data-theme="light"] .bess-kpi i[style*="color:#ff8c00"],
[data-theme="light"] .dash-card i[style*="color:#ff8c00"] {
    color: #c96800 !important;
}

/* Hover/focus naranja en nav — mantener legible */
[data-theme="light"] #nav .links li a:hover { color: #c96800 !important; }

/* Links genéricos naranja */
[data-theme="light"] a:not(.btn):not([class*="btn"]):not([class*="ptab"]):not([class*="pu-btn"]):not(.action-btn):not(.productos-nav) {
    color: #c96800 !important;
}

/* Tabs activas y botones primarios mantienen fondo naranja con texto blanco — no cambiar */
[data-theme="light"] #nav .links li.active a,
[data-theme="light"] .btn-primary,
[data-theme="light"] [class*="btn-ora"],
[data-theme="light"] .action-btn {
    color: #ffffff !important;
}

/* ── Modal Vista Previa PDF — forzar colores oscuros independiente del tema ── */
/* El modal es siempre dark (simula el visor de PDF) — no debe heredar overrides de light */
#modal-preview-pdf,
#modal-preview-pdf > * {
    /* El fondo del modal es oscuro siempre */
}
[data-theme="light"] #modal-preview-pdf {
    background: rgba(0,0,0,.85) !important;
}
[data-theme="light"] #modal-preview-pdf > div:first-child {
    background: #1a1a2e !important;
    border-bottom-color: rgba(255,140,0,.3) !important;
}
[data-theme="light"] #modal-preview-pdf #pvw-pages > div {
    /* Las páginas del PDF ya tienen sus propios estilos inline — no tocar */
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT MODE — OVERRIDES GLOBALES DE MODALES
   Cubre todos los modales legacy que usan colores hardcodeados.
   Alta especificidad + !important para vencer inline styles.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay / backdrop ──────────────────────────────────────────────────── */
[data-theme="light"] .modal-overlay,
[data-theme="light"] .modal-background,
[data-theme="light"] .crm-overlay {
    background: rgba(0,0,0,.45) !important;
    backdrop-filter: blur(5px) !important;
}

/* ── Caja del modal ──────────────────────────────────────────────────────── */
[data-theme="light"] .modal-box,
[data-theme="light"] .crm-modal,
[data-theme="light"] #miModal,
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-content-premium,
[data-theme="light"] .modal-premium-content {
    background: #ffffff !important;
    border: 1px solid #d0d5e0 !important;
    color: #1a1a2e !important;
    box-shadow: 0 24px 64px rgba(0,0,0,.18) !important;
}

/* ── Header del modal ────────────────────────────────────────────────────── */
[data-theme="light"] .modal-header,
[data-theme="light"] .modal-header-premium,
[data-theme="light"] .crm-modal-header {
    background: linear-gradient(135deg, #f8fafd 0%, #f0f3f8 100%) !important;
    border-bottom: 1px solid #dde1ea !important;
}
[data-theme="light"] .modal-header h2,
[data-theme="light"] .modal-header h3,
[data-theme="light"] .modal-header-title,
[data-theme="light"] .crm-modal-header h2 {
    color: #1a1a2e !important;
}
[data-theme="light"] .modal-header i,
[data-theme="light"] .modal-header-icon,
[data-theme="light"] .crm-modal-header i {
    color: #ff8c00 !important;
}

/* ── Botón cerrar ────────────────────────────────────────────────────────── */
[data-theme="light"] .modal-close,
[data-theme="light"] .cerrar-modal,
[data-theme="light"] .close-premium,
[data-theme="light"] button.modal-close-btn {
    color: rgba(26,26,46,.35) !important;
    border-color: transparent !important;
    background: none !important;
}
[data-theme="light"] .modal-close:hover,
[data-theme="light"] .cerrar-modal:hover {
    background: rgba(239,68,68,.08) !important;
    color: #dc2626 !important;
}

/* ── Texto y labels ──────────────────────────────────────────────────────── */
[data-theme="light"] .modal-body,
[data-theme="light"] .crm-modal-body,
[data-theme="light"] .modal-body p,
[data-theme="light"] .modal-body span,
[data-theme="light"] .modal-body div {
    color: #1a1a2e;
}
[data-theme="light"] .form-field label,
[data-theme="light"] .modal label,
[data-theme="light"] .modal-label {
    color: #4b5563 !important;
}

/* ── Inputs, selects, textareas ──────────────────────────────────────────── */
[data-theme="light"] .form-field input,
[data-theme="light"] .form-field select,
[data-theme="light"] .form-field textarea,
[data-theme="light"] .modal input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] .modal select,
[data-theme="light"] .modal textarea,
[data-theme="light"] .crm-modal input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] .crm-modal select,
[data-theme="light"] .crm-modal textarea,
[data-theme="light"] .modal-input {
    background: #f5f7fb !important;
    border: 1.5px solid #c8cdd8 !important;
    color: #1a1a2e !important;
}
[data-theme="light"] .form-field input::placeholder,
[data-theme="light"] .form-field textarea::placeholder,
[data-theme="light"] .modal input::placeholder,
[data-theme="light"] .modal textarea::placeholder {
    color: rgba(26,26,46,.35) !important;
}
[data-theme="light"] .form-field input:focus,
[data-theme="light"] .form-field select:focus,
[data-theme="light"] .form-field textarea:focus,
[data-theme="light"] .modal input:focus,
[data-theme="light"] .modal select:focus,
[data-theme="light"] .modal textarea:focus {
    border-color: #c96800 !important;
    box-shadow: 0 0 0 3px rgba(201,104,0,.15) !important;
}
[data-theme="light"] .form-field select option,
[data-theme="light"] .modal select option {
    background: #ffffff !important;
    color: #1a1a2e !important;
}

/* ── Footer del modal ────────────────────────────────────────────────────── */
[data-theme="light"] .modal-footer,
[data-theme="light"] .mover-botones,
[data-theme="light"] .crm-modal-footer {
    background: #f0f3f8 !important;
    border-top: 1px solid #dde1ea !important;
}

/* ── Botón primario ──────────────────────────────────────────────────────── */
[data-theme="light"] .mu-btn.primary,
[data-theme="light"] .mu-btn-primary,
[data-theme="light"] .modal input[type="submit"],
[data-theme="light"] .mover-botones input[type="submit"],
[data-theme="light"] .btn-submit,
[data-theme="light"] .btn-guardar,
[data-theme="light"] .btn-contratar,
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #ff8c00, #cc6a00) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

/* ── Botón cancelar ──────────────────────────────────────────────────────── */
[data-theme="light"] .mu-btn.cancel,
[data-theme="light"] .mu-btn-cancel,
[data-theme="light"] .btn-cancelar,
[data-theme="light"] .btn-cancel,
[data-theme="light"] .btn-outline {
    background: #eef1f6 !important;
    border-color: #c8cdd8 !important;
    color: #374151 !important;
}

/* ── Divider / separadores ───────────────────────────────────────────────── */
[data-theme="light"] .modal-divider,
[data-theme="light"] .modal hr {
    background: #e5e7eb !important;
    border-color: #e5e7eb !important;
}

/* ── Info boxes dentro de modales ────────────────────────────────────────── */
[data-theme="light"] .mu-info-box {
    background: rgba(255,140,0,.07) !important;
    color: #1a1a2e !important;
}
[data-theme="light"] .mu-alert-success { background: rgba(34,197,94,.08) !important; color: #1a1a2e !important; }
[data-theme="light"] .mu-alert-danger  { background: rgba(239,68,68,.08) !important; color: #1a1a2e !important; }

/* ── Scrollbar del modal en light ────────────────────────────────────────── */
[data-theme="light"] .modal-body::-webkit-scrollbar-track { background: #f0f3f8; }
[data-theme="light"] .modal-body::-webkit-scrollbar-thumb { background: #c8cdd8; }
[data-theme="light"] .modal-body::-webkit-scrollbar-thumb:hover { background: #ff8c00; }

/* ── Excepciones: modales que SIEMPRE deben ser dark ────────────────────── */
/* (chat widget, vista previa PDF, overlay de carga, ticket chat) */
[data-theme="light"] #chat-window,
[data-theme="light"] #preview-overlay,
[data-theme="light"] #ticket-widget,
[data-theme="light"] .contactoLoadingOverlay,
[data-theme="light"] #contactoLoadingOverlay {
    /* Mantener dark — estas UIs tienen contexto oscuro deliberado */
    background: #12151e !important;
    color: #e2e8f0 !important;
    border-color: rgba(255,140,0,.2) !important;
}
