/* ===== LabCel — Modo claro (blanco azulado + alto contraste) ===== */
html[data-theme="light"] {
  --bg: #e8eef6;
  --surface: #f3f6fb;
  --surface-2: #eef2f8;
  --border: #c5d0e0;
  --text: #1a2332;
  --text-muted: #5a6a80;
  --gray-100: #e8eef6;
  --gray-200: #d5dee9;
  --gray-300: #c5d0e0;
  --gray-400: #64748b;
  --gray-500: #475569;
  --gray-600: #334155;
  --gray-700: #2c3a4d;
  --gray-800: #1a2332;
  --gray-900: #0f1724;
  --primary: #0a8fc0;
  --primary-soft: rgba(10, 143, 192, 0.12);
  color-scheme: light;
}

html[data-theme="light"] body,
html[data-theme="light"] .app,
html[data-theme="light"] .main,
html[data-theme="light"] .content {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Sidebar */
html[data-theme="light"] .sidebar {
  background: #f0f4fa !important;
  border-right: 1px solid var(--border) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .sidebar-name,
html[data-theme="light"] .user-name,
html[data-theme="light"] .card-title,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] .page-title,
html[data-theme="light"] .topbar-title {
  color: var(--gray-900) !important;
}
html[data-theme="light"] .sidebar-sub,
html[data-theme="light"] .user-role,
html[data-theme="light"] .metric-label,
html[data-theme="light"] .page-sub,
html[data-theme="light"] .topbar-sub {
  color: var(--gray-500) !important;
}
html[data-theme="light"] .nav-item {
  color: var(--gray-600) !important;
}
html[data-theme="light"] .nav-item:hover {
  background: #e2eaf5 !important;
  color: var(--gray-900) !important;
}
html[data-theme="light"] .nav-item.active {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}
html[data-theme="light"] .nav-section-label {
  color: var(--gray-500) !important;
}

/* Topbar */
html[data-theme="light"] .topbar {
  background: #f0f4fa !important;
  border-bottom: 1px solid var(--border) !important;
}

/* Cards / metrics / tables */
html[data-theme="light"] .card,
html[data-theme="light"] .panel .card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .table-wrap {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 36, 0.06);
}
html[data-theme="light"] .metric-value {
  color: var(--gray-900) !important;
}
html[data-theme="light"] .table th {
  background: #e4ebf5 !important;
  color: var(--gray-700) !important;
  border-color: var(--border) !important;
  font-weight: 700;
}
html[data-theme="light"] .table td {
  border-color: var(--border) !important;
  color: var(--gray-800) !important;
}
html[data-theme="light"] .table tr:hover td {
  background: #e8eef6 !important;
}

/* ===== Pipeline / etapas de orden (arriba) ===== */
html[data-theme="light"] .pipeline,
html[data-theme="light"] .order-pipeline,
html[data-theme="light"] .status-pipeline,
html[data-theme="light"] [class*="pipeline"] {
  background: #e4ebf5 !important;
  border: 1px solid var(--border) !important;
}
html[data-theme="light"] .pipeline-step,
html[data-theme="light"] .status-step,
html[data-theme="light"] [class*="pipeline"] span,
html[data-theme="light"] [class*="pipeline"] div {
  color: var(--gray-700) !important;
}
html[data-theme="light"] .pipeline-step.active,
html[data-theme="light"] .status-step.active {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* ===== MODALES ===== */
html[data-theme="light"] .modal,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .modal-overlay .modal-box {
  background: #eef3f9 !important;
  border: 1px solid var(--border) !important;
  color: var(--gray-900) !important;
  box-shadow: 0 12px 40px rgba(15, 23, 36, 0.18);
}
html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer {
  background: #e4ebf5 !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] .modal-header h3,
html[data-theme="light"] .modal-box h3 {
  color: var(--gray-900) !important;
}
html[data-theme="light"] .modal-close {
  color: var(--gray-600) !important;
}

html[data-theme="light"] label,
html[data-theme="light"] .form-group label,
html[data-theme="light"] .modal label,
html[data-theme="light"] .modal-box label {
  color: #2c3a4d !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .input-search,
html[data-theme="light"] .modal input,
html[data-theme="light"] .modal select,
html[data-theme="light"] .modal textarea {
  background: #f7f9fc !important;
  border: 1px solid #b8c5d6 !important;
  color: var(--gray-900) !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #8b9bb0 !important;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: #0a8fc0 !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 143, 192, 0.15);
}

/* ===== DROPDOWN estado (Recepción / Diagnóstico / Listo) ===== */
html[data-theme="light"] .status-menu,
html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .estado-menu,
html[data-theme="light"] [class*="status-drop"],
html[data-theme="light"] [class*="dropdown"] {
  background: #f3f6fb !important;
  border: 1px solid #a8b8cc !important;
  box-shadow: 0 8px 24px rgba(15, 23, 36, 0.14) !important;
  color: var(--gray-900) !important;
}
html[data-theme="light"] .status-menu button,
html[data-theme="light"] .dropdown-menu button,
html[data-theme="light"] .status-menu a,
html[data-theme="light"] .dropdown-menu a,
html[data-theme="light"] .estado-menu button,
html[data-theme="light"] [class*="status-drop"] button {
  color: var(--gray-800) !important;
  background: transparent !important;
}
html[data-theme="light"] .status-menu button:hover,
html[data-theme="light"] .dropdown-menu button:hover,
html[data-theme="light"] .estado-menu button:hover {
  background: #e2eaf5 !important;
  color: var(--gray-900) !important;
}

/* Badge de estado en tabla */
html[data-theme="light"] .badge,
html[data-theme="light"] [class*="badge"] {
  font-weight: 700 !important;
}
html[data-theme="light"] .badge-green,
html[data-theme="light"] .status-listo {
  background: #dcfce7 !important;
  color: #166534 !important;
}
html[data-theme="light"] .badge-red,
html[data-theme="light"] .status-cancel {
  background: #fee2e2 !important;
  color: #991b1b !important;
}
html[data-theme="light"] .badge-yellow,
html[data-theme="light"] .status-proceso,
html[data-theme="light"] .status-diagnostico {
  background: #fef3c7 !important;
  color: #92400e !important;
}
html[data-theme="light"] .badge-blue,
html[data-theme="light"] .status-recepcion {
  background: #dbeafe !important;
  color: #1e40af !important;
}
html[data-theme="light"] .badge-purple {
  background: #ede9fe !important;
  color: #5b21b6 !important;
}

/* ===== BOTONES DE ACCIONES EN TABLA (los cuadrados oscuros) ===== */
html[data-theme="light"] .table .btn-icon,
html[data-theme="light"] .table button,
html[data-theme="light"] .table .btn-sm,
html[data-theme="light"] .acciones button,
html[data-theme="light"] td button {
  background: #e4ebf5 !important;
  border: 1px solid #a8b8cc !important;
  color: #1a2332 !important;
}
html[data-theme="light"] .table .btn-icon:hover,
html[data-theme="light"] .table button:hover,
html[data-theme="light"] td button:hover {
  background: #d5dee9 !important;
  border-color: #8b9bb0 !important;
}
/* Botón Recibo rojo visible */
html[data-theme="light"] .table .btn-recibo,
html[data-theme="light"] .table button.btn-primary,
html[data-theme="light"] td .btn-primary {
  background: #0a8fc0 !important;
  border-color: #be123c !important;
  color: #ffffff !important;
}
html[data-theme="light"] .btn-primary,
html[data-theme="light"] button.btn-primary {
  background: #0a8fc0 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(10, 143, 192, 0.25);
}
html[data-theme="light"] .btn-primary:hover {
  background: #be123c !important;
}
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] button.btn-secondary {
  background: #e4ebf5 !important;
  border: 1px solid #a8b8cc !important;
  color: #1a2332 !important;
  font-weight: 600 !important;
}
html[data-theme="light"] .btn-secondary:hover {
  background: #d5dee9 !important;
}

/* ===== ALERTA inventario (esquina) ===== */
html[data-theme="light"] .stock-alert,
html[data-theme="light"] .inventory-alert,
html[data-theme="light"] .alerta-inventario,
html[data-theme="light"] [class*="alert"][class*="invent"],
html[data-theme="light"] .labcel-toast,
html[data-theme="light"] .toast {
  background: #fff7ed !important;
  border: 1px solid #fdba74 !important;
  color: #9a3412 !important;
  box-shadow: 0 6px 20px rgba(15, 23, 36, 0.12) !important;
}
html[data-theme="light"] .labcel-toast.success,
html[data-theme="light"] .toast-success {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}
html[data-theme="light"] .labcel-toast.error,
html[data-theme="light"] .toast-error {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}
html[data-theme="light"] .labcel-toast.warn,
html[data-theme="light"] .toast-warn {
  background: #fffbeb !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
}

/* Code tags */
html[data-theme="light"] .code-tag {
  background: #ffe4e6 !important;
  color: #075985 !important;
}

/* Login */
html[data-theme="light"] .login-page,
html[data-theme="light"] #login-screen {
  background: linear-gradient(165deg, #dbe7f5 0%, #e8eef6 45%, #f0f4fa 100%) !important;
}

/* ===== Botón tema icono ===== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f5;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, transform .12s;
}
.theme-toggle-btn svg { display: block; pointer-events: none; }
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.theme-toggle-btn:active { transform: scale(0.94); }

html[data-theme="light"] .theme-toggle-btn {
  background: #e4ebf5;
  border: 1px solid #a8b8cc;
  color: #2c3a4d;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.06);
}
html[data-theme="light"] .theme-toggle-btn:hover {
  background: #d5dee9;
  border-color: #8b9bb0;
  color: #0f1724;
}

/* Select sucursal topbar */
html[data-theme="light"] .select-branch,
html[data-theme="light"] #orders-filter-branch {
  background: #f7f9fc !important;
  border: 1px solid #b8c5d6 !important;
  color: var(--gray-900) !important;
}

/* Sidebar footer / logout */
html[data-theme="light"] .btn-logout {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}
html[data-theme="light"] .sidebar-footer {
  border-top: 1px solid var(--border) !important;
}


/* ===== Tonos oro / verde (sin amarillo neón) ===== */

/* Pipeline: etapas suaves */
html[data-theme="light"] .pipe-step,
html[data-theme="light"] .pipeline-step,
html[data-theme="light"] .status-bar > *,
html[data-theme="light"] [class*="pipeline"] > * {
  border-color: #c5d0e0 !important;
}
/* Recepción / Diagnóstico — oro suave */
html[data-theme="light"] .pipe-recepcion,
html[data-theme="light"] .pipeline-step:nth-child(1),
html[data-theme="light"] .status-bar > :nth-child(1) {
  background: linear-gradient(180deg, #faf3e0 0%, #f3e6c4 100%) !important;
  color: #7a5c14 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .pipe-diagnostico,
html[data-theme="light"] .pipeline-step:nth-child(2),
html[data-theme="light"] .status-bar > :nth-child(2) {
  background: linear-gradient(180deg, #f7edd4 0%, #ead7a8 100%) !important;
  color: #6b5010 !important;
  font-weight: 700 !important;
}
/* Reparación — rosa suave (se mantiene) */
html[data-theme="light"] .pipe-reparacion,
html[data-theme="light"] .pipeline-step:nth-child(3),
html[data-theme="light"] .status-bar > :nth-child(3) {
  background: linear-gradient(180deg, #e0f4fb 0%, #f8d0d8 100%) !important;
  color: #075985 !important;
  font-weight: 700 !important;
}

/* Textos verdes/amarillos del dashboard (métricas y links) */
html[data-theme="light"] .metric-trend.positive,
html[data-theme="light"] .metric-trend,
html[data-theme="light"] .trend-up,
html[data-theme="light"] a.metric-link,
html[data-theme="light"] .metric-card .metric-trend {
  color: #1d6b3a !important; /* verde oscuro elegante */
}
html[data-theme="light"] .metric-trend.negative {
  color: #b91c1c !important;
}

/* Banner stock crítico — ámbar/oro en vez de amarillo limón */
html[data-theme="light"] .banner-warn,
html[data-theme="light"] .alert-stock,
html[data-theme="light"] .stock-banner,
html[data-theme="light"] [class*="stock-crit"],
html[data-theme="light"] .dash-alert-warn {
  background: #faf0d8 !important;
  border: 1px solid #d4a84b !important;
  color: #7a5c14 !important;
}

/* Banner “listos para entrega” — rosa suave */
html[data-theme="light"] .banner-info,
html[data-theme="light"] .dash-alert-ready,
html[data-theme="light"] [class*="listos"] {
  background: #e0f4fb !important;
  border: 1px solid #f0a8b8 !important;
  color: #075985 !important;
}

/* Badge estado Listo — verde bosque */
html[data-theme="light"] .badge-green,
html[data-theme="light"] .status-listo,
html[data-theme="light"] .estado-listo {
  background: #d8f0e0 !important;
  color: #14532d !important;
  border: 1px solid #86c9a0 !important;
}

/* Badge Diagnóstico — oro */
html[data-theme="light"] .badge-yellow,
html[data-theme="light"] .status-diagnostico,
html[data-theme="light"] .estado-diagnostico {
  background: #f5e6c0 !important;
  color: #6b5010 !important;
  border: 1px solid #d4a84b !important;
}

/* Toast alerta inventario — panel oscuro se queda; texto más legible si aplica claro */
html[data-theme="light"] .stock-alert,
html[data-theme="light"] .inventory-alert,
html[data-theme="light"] .alerta-inventario {
  background: #2a2118 !important;
  border: 1px solid #d4a84b !important;
  color: #f5e6c0 !important;
}


/* Forzar: cualquier fondo amarillo/lima chillón → oro */
html[data-theme="light"] [style*="background"][style*="#ff"],
html[data-theme="light"] [style*="background"][style*="yellow"],
html[data-theme="light"] [style*="background"][style*="#fef"],
html[data-theme="light"] [style*="background"][style*="#fef08a"],
html[data-theme="light"] [style*="background"][style*="#fde047"],
html[data-theme="light"] [style*="background"][style*="#eab308"],
html[data-theme="light"] [style*="background"][style*="#facc15"],
html[data-theme="light"] [style*="background"][style*="#fef9c3"],
html[data-theme="light"] [style*="background"][style*="#fefce8"] {
  /* no tocamos todos los style* para no romper primarios */
}

/* Pipeline bar genérica (divs en fila arriba de órdenes) */
html[data-theme="light"] .orders-pipeline > div:nth-child(1),
html[data-theme="light"] .pipeline-bar > div:nth-child(1),
html[data-theme="light"] #orders-pipeline > div:nth-child(1),
html[data-theme="light"] .status-pipeline > div:nth-child(1) {
  background: #f3e6c4 !important;
  color: #7a5c14 !important;
}
html[data-theme="light"] .orders-pipeline > div:nth-child(2),
html[data-theme="light"] .pipeline-bar > div:nth-child(2),
html[data-theme="light"] #orders-pipeline > div:nth-child(2),
html[data-theme="light"] .status-pipeline > div:nth-child(2) {
  background: #ead7a8 !important;
  color: #6b5010 !important;
}
html[data-theme="light"] .orders-pipeline > div:nth-child(3),
html[data-theme="light"] .pipeline-bar > div:nth-child(3),
html[data-theme="light"] #orders-pipeline > div:nth-child(3),
html[data-theme="light"] .status-pipeline > div:nth-child(3) {
  background: #f8d0d8 !important;
  color: #075985 !important;
}

/* Texto chartreuse / lima del dashboard */
html[data-theme="light"] .metric-trend,
html[data-theme="light"] [style*="color: #"] {
  /* se deja; el color positivo se fuerza abajo */
}
html[data-theme="light"] .metric-card small,
html[data-theme="light"] .metric-card .metric-trend,
html[data-theme="light"] .metric-card a {
  color: #1d6b3a !important;
}
html[data-theme="light"] .metric-card .metric-trend[style],
html[data-theme="light"] .metric-card a[style] {
  color: #1d6b3a !important;
}


/* ===== Modales: labels SIEMPRE legibles ===== */
html[data-theme="light"] .modal label,
html[data-theme="light"] .modal-box label,
html[data-theme="light"] .modal-content label,
html[data-theme="light"] .form-group label,
html[data-theme="light"] .modal .form-group > span,
html[data-theme="light"] .modal-box .form-group > span,
html[data-theme="light"] .modal small,
html[data-theme="light"] .modal-box small,
html[data-theme="light"] .modal .hint,
html[data-theme="light"] .modal-box .hint,
html[data-theme="light"] .modal [class*="label"],
html[data-theme="light"] .modal-box [class*="label"] {
  color: #1e293b !important;
  font-weight: 650 !important;
  opacity: 1 !important;
}

html[data-theme="light"] .modal h3,
html[data-theme="light"] .modal-box h3,
html[data-theme="light"] .modal-header h3,
html[data-theme="light"] .modal .modal-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

/* Placeholders más suaves pero visibles */
html[data-theme="light"] .modal input::placeholder,
html[data-theme="light"] .modal-box input::placeholder,
html[data-theme="light"] .modal textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

/* Texto auxiliar tipo (opcional) */
html[data-theme="light"] .modal .optional,
html[data-theme="light"] .modal-box .optional,
html[data-theme="light"] .modal label span,
html[data-theme="light"] .modal-box label span {
  color: #475569 !important;
  opacity: 1 !important;
}

/* Fondo modal un poco más definido */
html[data-theme="light"] .modal-box,
html[data-theme="light"] .modal-content {
  background: #f1f5f9 !important;
  border: 1px solid #94a3b8 !important;
}

html[data-theme="light"] .modal-header {
  background: #e2e8f0 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] .modal-footer {
  background: #e2e8f0 !important;
  border-top: 1px solid #cbd5e1 !important;
}


/* ===== Pipeline .pstep (Recepción / Diagnóstico…) — oro, no lima ===== */
html[data-theme="light"] .progress-bar-steps {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px;
  overflow: hidden;
}
html[data-theme="light"] .pstep {
  background: #e2e8f0 !important;
  color: #475569 !important;
  font-weight: 600 !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] .pstep.done {
  background: linear-gradient(180deg, #f5e6c0 0%, #e6d09a 100%) !important;
  color: #6b5010 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .pstep.current {
  background: linear-gradient(180deg, #e0f4fb 0%, #f5c2cc 100%) !important;
  color: #075985 !important;
  font-weight: 700 !important;
}

/* Labels de formularios / modales (var --gray-400 ya más oscuro) */
html[data-theme="light"] .form-group label,
html[data-theme="light"] .modal-box .form-group label,
html[data-theme="light"] .modal-overlay label {
  color: #0f172a !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .form-group label span,
html[data-theme="light"] .modal-box label span {
  color: #475569 !important;
  opacity: 1 !important;
}


/* ===== BUGFIX final: modales legibles + sin borde rojo ===== */

/* Quitar aros/rojos raros en cualquier modal */
html[data-theme="light"] .modal-box,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .modal-overlay > div,
.modal-box,
.modal-content,
.modal-overlay > div {
  outline: none !important;
}
.modal-box:focus,
.modal-box:focus-visible,
.modal-content:focus,
.modal-overlay > div:focus {
  outline: none !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.35) !important;
}

/* Si el rojo viene de box-shadow primary */
html[data-theme="light"] .modal-box,
html[data-theme="light"] .modal-overlay > .modal-box {
  box-shadow: 0 16px 48px rgba(15, 23, 36, 0.22) !important;
  border: 1px solid #94a3b8 !important;
}

/* Modo oscuro: modal CuotaLock sin glow rojo */
html[data-theme="dark"] .modal-box,
html:not([data-theme="light"]) .modal-box {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  outline: none !important;
}

/* Labels: forzar color aunque el CSS base diga gray-100 / blanco */
html[data-theme="light"] .modal-overlay label,
html[data-theme="light"] .modal-box label,
html[data-theme="light"] .modal-content label,
html[data-theme="light"] .form-grid label,
html[data-theme="light"] .form-group > label,
html[data-theme="light"] #modal-cliente label,
html[data-theme="light"] #modal-editar-cliente label,
html[data-theme="light"] #modal-cliente .form-group label,
html[data-theme="light"] #modal-editar-cliente .form-group label {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html[data-theme="light"] .modal-overlay h3,
html[data-theme="light"] .modal-box h3,
html[data-theme="light"] .modal-header h3,
html[data-theme="light"] #modal-cliente h3 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}

/* Header del modal no debe recortar el título */
html[data-theme="light"] .modal-header {
  overflow: visible !important;
  padding: 14px 18px !important;
}
html[data-theme="light"] .modal-header h3 {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  max-width: none !important;
}

/* Inputs del modal cliente legibles */
html[data-theme="light"] #modal-cliente input,
html[data-theme="light"] #modal-cliente select,
html[data-theme="light"] #modal-editar-cliente input,
html[data-theme="light"] #modal-editar-cliente select {
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #94a3b8 !important;
}


/* ===== Inputs de modal SIEMPRE legibles (oscuro y claro) ===== */
.modal-box input,
.modal-box select,
.modal-box textarea,
.modal-content input,
.modal-content select,
.modal-overlay input,
.modal-overlay select {
  color: inherit;
}

/* Modo oscuro: texto claro sobre input oscuro */
html:not([data-theme="light"]) .modal-box input,
html:not([data-theme="light"]) .modal-box select,
html:not([data-theme="light"]) .modal-box textarea,
html[data-theme="dark"] .modal-box input,
html[data-theme="dark"] .modal-box select,
html[data-theme="dark"] .modal-box textarea {
  background: #1e1e24 !important;
  color: #f4f4f5 !important;
  border: 1px solid #3f3f46 !important;
  -webkit-text-fill-color: #f4f4f5 !important;
  caret-color: #f4f4f5 !important;
}
html:not([data-theme="light"]) .modal-box input::placeholder,
html[data-theme="dark"] .modal-box input::placeholder {
  color: #a1a1aa !important;
  -webkit-text-fill-color: #a1a1aa !important;
  opacity: 1 !important;
}

/* Modo claro */
html[data-theme="light"] .modal-box input,
html[data-theme="light"] .modal-box select,
html[data-theme="light"] .modal-box textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
}
html[data-theme="light"] .modal-box input::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

/* Modal cliente compacto: sin huecos de grid */
#modal-cliente .form-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 16px 18px !important;
}
#modal-cliente .form-group {
  grid-column: auto !important;
  margin: 0 !important;
}
#modal-cliente.modal-box,
#modal-cliente .modal-box,
.modal-compact {
  width: 400px !important;
  max-width: 94vw !important;
}

/* ===== Autocompletado de Chrome =====
 * Chrome pinta de celeste/blanco los campos que autocompleta y deja el texto
 * claro del modo oscuro: no se leía nada. Se tapa su fondo con una sombra
 * interior del color del tema y se fija el color del texto. */
html:not([data-theme="light"]) input:-webkit-autofill,
html:not([data-theme="light"]) input:-webkit-autofill:hover,
html:not([data-theme="light"]) input:-webkit-autofill:focus,
html:not([data-theme="light"]) textarea:-webkit-autofill,
html:not([data-theme="light"]) select:-webkit-autofill {
  -webkit-text-fill-color: #f4f4f5 !important;
  -webkit-box-shadow: 0 0 0 1000px #1e1e24 inset !important;
  box-shadow: 0 0 0 1000px #1e1e24 inset !important;
  caret-color: #f4f4f5 !important;
  transition: background-color 9999s ease-out 0s;
}
html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] input:-webkit-autofill:hover,
html[data-theme="light"] input:-webkit-autofill:focus,
html[data-theme="light"] textarea:-webkit-autofill,
html[data-theme="light"] select:-webkit-autofill {
  -webkit-text-fill-color: #0f172a !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: #0f172a !important;
  transition: background-color 9999s ease-out 0s;
}
