/* ===== MODO OSCURO ===== */

/* Base */
html.dark body{background:#0f172a!important;color:#e2e8f0!important}
html.dark *{color-scheme:dark}

/* Fondos blancos → slate oscuro */
html.dark .wcard,html.dark .trabajo-hd{background:#1e293b!important;border-color:#334155!important}
html.dark .sec{background:#1e293b!important}
html.dark .modulo{background:#1e293b!important;border-color:#334155!important}
html.dark .draft-row{background:#1e293b!important;border-color:#334155!important}
html.dark .ucard{background:#1e293b!important;border-color:#334155!important}
html.dark .col{background:#162032!important}
html.dark .view-toggle{background:#1e293b!important;border-color:#334155!important}
html.dark .filters{background:#0f172a!important}
html.dark .nota-otro{background:#1e293b!important;border-color:#334155!important}
html.dark .nota-mia{background:#1e3a5f!important}
html.dark .modal{background:#1e293b!important}
html.dark .modal-hd{border-color:#334155!important}

/* Texto gris oscuro → legible */
html.dark .wcard-cliente,html.dark .etapa-lbl,html.dark .sec-title,
html.dark .nota-autor,html.dark .act-texto,html.dark .mf label,
html.dark .welcome p,html.dark .modulo p,html.dark .hero p,
html.dark .draft-empresa,html.dark .uemail,html.dark .stat-l,
html.dark .draft-num,html.dark .act-texto{color:#94a3b8!important}

html.dark .nota-fecha,html.dark .act-fecha,html.dark .dias-badge,
html.dark .draft-fecha,html.dark .empty{color:#475569!important}

html.dark .wcard-num{color:#60a5fa!important}
html.dark .wcard-titulo,html.dark .trabajo-titulo,html.dark .trabajo-cliente,
html.dark .tarea-texto,html.dark .info-item .val,html.dark .act-autor,
html.dark .draft-cliente,html.dark .uname{color:#e2e8f0!important}

html.dark .etapa-val{color:#93c5fd!important}

/* Botones de vista y filtro */
html.dark .vtb{background:#1e293b!important;border-color:#334155!important;color:#94a3b8!important}
html.dark .vtb.act{background:var(--az)!important;color:#fff!important;border-color:var(--az)!important}
html.dark .fbtn{background:#1e293b!important;border-color:#334155!important;color:#94a3b8!important}
html.dark .fbtn.act{background:var(--am)!important;color:#fff!important;border-color:var(--am)!important}
html.dark .mbtn-cancel{background:#334155!important;color:#e2e8f0!important}
html.dark .mclose{color:#94a3b8!important}
html.dark .back{color:#fff!important}

/* Inputs */
html.dark input,html.dark select,html.dark textarea{background:#334155!important;color:#e2e8f0!important;border-color:#475569!important}
html.dark input::placeholder,html.dark textarea::placeholder{color:#64748b!important}
html.dark #buscador,html.dark #orden,html.dark #busqueda{background:#1e293b!important;color:#e2e8f0!important;border-color:#334155!important}

/* Bordes */
html.dark .tarea{border-color:#334155!important}
html.dark .act-item{border-color:#1e2d40!important}
html.dark .view-toggle{border-color:#334155!important}

/* Checkbox de tareas */
html.dark .tarea-check{background:#334155!important;border-color:#475569!important;color:#94a3b8!important}

/* EF etapa flow (barra de etapas en trabajo.php) */
html.dark .ef-item{background:#1e293b!important;border-color:#334155!important;color:#94a3b8!important}

/* Acción botones de presupuesto */
html.dark .dact-edit,html.dark .dact-send,html.dark .dact-approve,html.dark .dact-del{opacity:.85}

/* Inline styles generados por JS — captura la mayoría sin clases */
html.dark [style*="color:#aaa"],html.dark [style*="color: #aaa"],
html.dark [style*="color:#888"],html.dark [style*="color: #888"],
html.dark [style*="color:#555"],html.dark [style*="color: #555"],
html.dark [style*="color:#666"],html.dark [style*="color: #666"],
html.dark [style*="color:#333"],html.dark [style*="color: #333"]{color:#64748b!important}

html.dark [style*="background:#fff"],html.dark [style*="background: #fff"],
html.dark [style*="background:#f0f4f8"],html.dark [style*="background:#f8fafc"],
html.dark [style*="background:#fafafa"],html.dark [style*="background:#eee"],
html.dark [style*="background:#f5f5f5"]{background:#1e293b!important}

html.dark [style*="border-top:1px solid #"],
html.dark [style*="border-bottom:1px solid #"]{border-color:#334155!important}

html.dark [style*="background:#f0f4f8;color:#555"]{background:#334155!important;color:#94a3b8!important}

/* Trabajo detalle */
html.dark .trabajo-hd{background:#1e293b!important;border-color:#334155!important}
html.dark .btn-cancelar{background:#3d1a1a!important;color:#e88!important}
html.dark .btn-eliminar{border-color:#334155!important;color:#64748b!important}
html.dark .btn-eliminar:hover{background:#3d1a1a!important;color:#e88!important;border-color:#7f1d1d!important}
html.dark .etapa-select{background:#334155!important;color:#e2e8f0!important;border-color:#475569!important}

/* Generador de presupuestos */
html.dark .g-sec{background:#1e293b!important;border-color:#334155!important}
html.dark .g-row{border-color:#334155!important}
html.dark .g-total{background:#162032!important;border-color:#334155!important}
html.dark .g-label{color:#94a3b8!important}
html.dark .g-op-hd{background:#162032!important;border-color:#334155!important}

/* Tarjetas Kanban (.kcard) y lista (.wcard) */
html.dark .kcard{background:#1e293b!important;border-color:#334155!important}
html.dark .kcard-titulo{color:#93c5fd!important}
html.dark .kcard-cliente{color:#94a3b8!important}
html.dark .board .wcard{background:#1e293b!important;border-color:#334155!important}
html.dark .board .wcard-titulo{color:#e2e8f0!important}
html.dark .board .wcard-cliente{color:#94a3b8!important}

/* Index — card bienvenida y módulos */
html.dark .welcome{background:#1e293b!important;border-color:#334155!important}
html.dark .welcome h2{color:#e2e8f0!important}
html.dark .modulo{background:#1e293b!important;border-color:#334155!important;color:#e2e8f0!important}
html.dark .modulo h3{color:#93c5fd!important}
html.dark .modulo p{color:#94a3b8!important}

/* Lista presupuestos — hero, stats y cards */
html.dark .hero{background:#1e293b!important;border-color:#334155!important}
html.dark .hero h2{color:#e2e8f0!important}
html.dark .hero p{color:#94a3b8!important}
html.dark .stat{background:#1e293b!important;border-color:#334155!important}
html.dark .stat-l{color:#94a3b8!important}
html.dark .draft{background:#1e293b!important;border-color:#334155!important}
html.dark .draft:hover{box-shadow:0 3px 12px rgba(0,0,0,.4)!important}
html.dark .draft-cliente{color:#93c5fd!important}
html.dark .draft-num{color:#64748b!important}
html.dark .draft-empresa{color:#94a3b8!important}
html.dark .draft-fecha{color:#475569!important}
html.dark .est-borrador{background:#2d2006!important;color:#fb923c!important}
html.dark .est-enviado{background:#0d2d0d!important;color:#4ade80!important}
html.dark .est-aprobado{background:#0d1f2d!important;color:#60a5fa!important}
html.dark .est-rechazado{background:#2d0d0d!important;color:#f87171!important}

/* Scrollbar en dark */
html.dark ::-webkit-scrollbar{background:#0f172a}
html.dark ::-webkit-scrollbar-thumb{background:#334155;border-radius:4px}
