/* ═══════════════════════════════════════════════════════════════
   TEMA "COBRE & CORMORANT" — Funeraria La Unión Los Andes
   Solo estilo. No toca ninguna función, ningún id, ningún <script>.

   Cómo se instala:
     <link rel="stylesheet" href="tema-cobre.css">
   como ÚLTIMA línea del <head>, después de todo el CSS actual.
   Para volver atrás, borra esa línea. Nada más cambia.

   NOTA IMPORTANTE — leer antes de usar:
   Este archivo reemplaza la línea de tema-lujo.css. No cargues los
   dos temas al mismo tiempo: dejarían reglas compitiendo entre sí.

   Los nombres de variables de color del sistema (--gold, --card,
   --sub, --brd, --muted, --green, --red...) NO se cambiaron — se les
   reasignaron los valores de la paleta "Cobre" para que TODO el
   sistema (incluidos los cientos de estilos en línea que ya existen
   en el HTML) tome el color nuevo automáticamente, sin tener que
   tocar una sola línea de HTML o JavaScript.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Jost:wght@300;400;500&display=swap');

/* ── 1. PALETA — mapeada a las variables reales del sistema ──── */
:root {
  --font:  'Jost', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;

  --rad:    10px;
  --rad-sm: 8px;

  /* Cobre (antes "Ónix & Oro") */
  --gold:     #a25a34;
  --gold-dk:  #c07a4f;
  --gold-bg:  #fbf3ee;
  --gold-brd: #e6cdbd;

  --pri:   #17150f;
  --bg:    #f7f3ec;
  --card:  #fffdf9;
  --brd:   #e7ded0;
  --brd-s: #d2c7b2;
  --ink:   #17150f;
  --sub:   #5f5a4e;
  --muted: #a8a190;

  --green: #15803d;
  --red:   #c0392b;

  /* elevación apagada — "sin sombras", solo un rastro mínimo */
  --sh:    0 0 0 1px var(--brd);
  --sh-md: 0 0 0 1px var(--brd);
  --sh-lg: 0 0 0 1px var(--brd);

  /* tokens propios del panel secundario / líneas suaves de tabla,
     usados solo por las reglas nuevas de este archivo */
  --panel-2:   #fbf7ef;
  --line-soft: #f0e9da;
}

[data-theme="dark"] {
  --gold:     #d99a72;
  --gold-dk:  #e8b28c;
  --gold-bg:  #241e17;
  --gold-brd: #3a2c20;

  --pri:   #f5f0e4;
  --bg:    #0e0d0b;
  --card:  #16150f;
  --brd:   #2c2a20;
  --brd-s: #3c3930;
  --ink:   #f5f0e4;
  --sub:   #a8a292;
  --muted: #6d6859;

  --green: #5dbd82;
  --red:   #e4796a;

  --sh:    0 0 0 1px var(--brd);
  --sh-md: 0 0 0 1px var(--brd);
  --sh-lg: 0 0 0 1px var(--brd);

  --panel-2:   #1c1a13;
  --line-soft: #241f18;
}

/* ── 2. BASE ───────────────────────────────────────────────────── */
body { font-family: var(--font); font-size: 13.5px; letter-spacing: .005em; }

/* Barra lateral: siempre oscura, en los dos modos */
.sidebar { background: #17150f !important; }
[data-theme="dark"] .sidebar { background: #080706 !important; }
.sb-item, .sb-logo h2, .sb-section { color: #f2ece0; }

/* ── 3. TIPOGRAFÍA ─────────────────────────────────────────────── */
/* Cormorant solo en cifras y títulos — nunca bajo 18px */
.topbar h1, .login-logo h1,
.kpi-value, .kpi-val, .kpi-v, .kpi-main-v, .stat-v {
  font-family: var(--serif);
}
.topbar h1        { font-size: 1.75rem; font-weight: 500; letter-spacing: -.01em; }
.login-logo h1    { font-size: 1.9rem;  font-weight: 500; letter-spacing: -.01em; }
.card-head h2, .modal-head h3 {
  font-family: var(--font);
  font-size: 1.15rem; font-weight: 500; letter-spacing: -.005em;
}

.kpi-value, .kpi-val, .kpi-v, .kpi-main-v, .stat-v {
  font-size: 1.875rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.kpi-label, .kpi-l, .kpi-main-l, .stat-l {
  font-family: var(--font);
  font-size: .6875rem; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
}
.kpi-sub, .stat-s { font-size: .8125rem; color: var(--sub); }

/* Cualquier monto/cifra genérico en tablas y filas */
td, .kpi-value, .kpi-val, .kpi-v { font-variant-numeric: tabular-nums; }

/* ── 4. TARJETAS / PANELES — sin sombra difusa, solo borde 1px ─── */
.card, .kpi-card, .stat, .modal-box, .dropdown-list, .spotlight-box, .user-card {
  box-shadow: none !important;
  border: 1px solid var(--brd);
  border-top: 1px solid var(--brd) !important;
}
.card:hover, .kpi-card:hover, .stat:hover, .agenda-tl-card:hover, .user-card:hover {
  box-shadow: none !important;
  transform: none !important;
  border-color: var(--brd-s);
}
.card-head {
  padding: 1rem 1.25rem;
  background: transparent;
}

/* ── 5. FORMULARIOS ────────────────────────────────────────────── */
.fg { gap: .4rem; margin-bottom: 1rem; }
.fg label {
  font-size: .75rem; font-weight: 500; color: var(--sub);
}
.req { color: var(--red); font-weight: 500; }

.fg input, .fg select, .fg textarea,
input, select, textarea {
  border-width: 1px;
  border-radius: var(--rad-sm);
  background: var(--bg);
  min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 15%, transparent) !important;
}

.fsec-title {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--brd) !important;
  border-radius: 0;
  font-family: var(--serif);
  font-size: 1.125rem; font-weight: 500;
  color: var(--ink) !important;
  padding: 0 0 .5rem; margin-bottom: 1rem;
}

/* ── 6. BOTONES — píldora, sin sombra, contorno en estados ──────── */
.btn {
  border-radius: 30px;
  border-width: 1px;
  font-weight: 500;
  letter-spacing: .02em;
  min-height: 42px;
  box-shadow: none !important;
}
.btn-pri {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.btn-pri:hover { background: var(--gold-dk); border-color: var(--gold-dk); }
.btn-sec { background: transparent; border-color: var(--brd); color: var(--sub); }
.btn-sec:hover { border-color: var(--gold); color: var(--ink); background: transparent; }
.btn-sm { min-height: 36px; }

.aqb, .avt-btn { border-radius: 30px; }
.aqb.on, .aqb.active, .avt-btn.on, .avt-btn.active {
  background: transparent; border: 1px solid var(--gold); color: var(--gold);
}

/* Badges/estados: contorno, no relleno */
.badge {
  background: transparent !important;
  border: 1px solid currentColor;
}

/* ── 7. TABLA ──────────────────────────────────────────────────── */
table th {
  font-size: .625rem; font-weight: 500; letter-spacing: .14em;
  color: var(--muted); background: var(--panel-2);
  text-transform: uppercase;
}
table td { padding-top: .75rem; padding-bottom: .75rem; border-color: var(--line-soft); }

/* ── 8. MODALES ────────────────────────────────────────────────── */
.modal-box { border-top: 1px solid var(--brd) !important; }
.modal-head { padding: 1.15rem 1.25rem; }
.modal-body { padding: 1.4rem 1.25rem; }
.modal-foot { background: transparent; border-top: 1px solid var(--brd); padding: 1rem 1.25rem; }

/* ── 9. VELO DEL MENÚ EN MÓVIL ─────────────────────────────────── */
#sbOverlay { background: rgba(8,7,6,.55) !important; }

/* ── 10. DETALLES ──────────────────────────────────────────────── */
::selection { background: color-mix(in srgb, var(--gold) 25%, transparent); }
/* ═══ COBRE — SOBRE-ESCRITURA COMPLETA DE MODO OSCURO ═══
   Generado a partir de las ~190 reglas de modo oscuro originales,
   remapeando neutros/bordes/texto y el acento dorado a la paleta
   Cobre. Los botones de acción con color fijo por función (WhatsApp,
   Mapa, Vale, Geo) y los estados semánticos de rol/alerta se dejaron
   intactos a propósito — son códigos de color funcionales, no
   decorativos.
   Selector con prefijo html[data-theme="dark"] + !important para
   ganar siempre, sin importar el orden u origen de la regla vieja. */
html[data-theme="dark"] .topbar-user { color: var(--sub) !important; }
html[data-theme="dark"] [data-tip]::after { background: #f5f0e4 !important; color: #0e0d0b !important; }
html[data-theme="dark"] .dropdown-list { background: var(--card) !important; border-color: var(--brd) !important; }
html[data-theme="dark"] .user-avatar { background: var(--blue) !important; }
/* ══ DARK MODE ══════════════════════════════════════════════════ */
/* ══ DARK MODE MODERNO ══════════════════════════════════════════ */
html[data-theme="dark"] { /* Fondos — negro cálido profundo, consistente con Ónix & Oro */
  --bg:    #0e0d0b !important; --pri:   #d99a72 !important; /* el dorado ES el acento principal en modo oscuro */
  --pri-h: #d99a72 !important; --card:  #16150f !important; --brd:   #2c2a20 !important; --brd-s: #3c3930 !important; /* Tipografía — alta legibilidad, tinte cálido */
  --ink:   #f5f0e4 !important; --sub:   #a8a292 !important; --muted: #6d6859 !important; /* Acento dorado más luminoso sobre negro */
  --gold:     #d99a72 !important; --gold-bg:  #241e17 !important; --gold-brd: #3a2c20 !important; --gold-dk:  #d99a72 !important; /* Colores de estado — más vivos en oscuro */
  --green:  #5dbd82 !important; --green-bg:  rgba(93,189,130,.1) !important; --green-brd: rgba(93,189,130,.2) !important; --amber:  #fbbf24 !important; --amber-bg:  rgba(251,191,36,.09) !important; --amber-brd: rgba(251,191,36,.2) !important; --red:    #e4796a !important; --red-bg:    rgba(228,121,106,.1) !important; --red-brd:   rgba(228,121,106,.2) !important; --pur:    #c4b5fd !important; --pur-bg:    rgba(196,181,253,.09) !important; --pur-brd:   rgba(196,181,253,.2) !important; --blue:   #d99a72 !important; --blue-bg:   #241e17 !important; --blue-brd:  #3a2c20 !important; --teal:   #5eead4 !important; --teal-bg:   #0a3330 !important; --teal-brd:  #167a6e !important; --sh:    0 1px 3px rgba(0,0,0,.6), 0 4px 16px rgba(0,0,0,.4) !important; --sh-md: 0 4px 20px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4) !important; --sh-lg: 0 8px 40px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.4) !important; }
/* ── SIDEBAR ── */
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0a0908 0%, #0d0c0a 100%) !important; border-right: 1px solid #1c1a13 !important; box-shadow: 2px 0 20px rgba(0,0,0,.5) !important; }
html[data-theme="dark"] .sb-section { color: rgba(168,159,140,.4) !important; }
html[data-theme="dark"] .sb-item { color: rgba(168,159,140,.8) !important; }
html[data-theme="dark"] .sb-item:hover { background: rgba(217,154,114,.08) !important; color: #f5f0e4 !important; }
html[data-theme="dark"] .sb-item.on { background: rgba(217,154,114,.14) !important; color: #d99a72 !important; border-left-color: #d99a72 !important; font-weight: 600 !important; }
html[data-theme="dark"] .sb-logo { border-color: rgba(255,255,255,.06) !important; }
html[data-theme="dark"] .sb-user { border-color: rgba(255,255,255,.06) !important; }
html[data-theme="dark"] .btn-logout { background: rgba(255,255,255,.05) !important; border-color: rgba(255,255,255,.08) !important; color: rgba(168,162,146,.7) !important; }
html[data-theme="dark"] .btn-logout:hover { background: rgba(228,121,106,.15) !important; color: #e4796a !important; }
/* ── LAYOUT PRINCIPAL ── */
html[data-theme="dark"] body { background: #0e0d0b !important; }
html[data-theme="dark"] .main { background: #0e0d0b !important; }
html[data-theme="dark"] .topbar { border-color: #2c2a20 !important; background: #16150f !important; backdrop-filter: blur(8px) !important; }
html[data-theme="dark"] .topbar h1 { color: #f5f0e4 !important; }
html[data-theme="dark"] .topbar-user { color: #a8a292 !important; }
html[data-theme="dark"] #btnHamburger { background: #16150f !important; border-color: #2c2a20 !important; color: #a8a292 !important; }
/* ── CARDS ── */
html[data-theme="dark"] .card { background: #16150f !important; border-color: #2c2a20 !important; box-shadow: 0 2px 12px rgba(0,0,0,.4) !important; }
html[data-theme="dark"] .card-head { background: rgba(255,255,255,.02) !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .card-head h2 { color: #f5f0e4 !important; }
html[data-theme="dark"] .card-body { color: #f5f0e4 !important; }
html[data-theme="dark"] .kpi-card { background: #16150f !important; border-color: #2c2a20 !important; box-shadow: 0 2px 12px rgba(0,0,0,.4) !important; }
html[data-theme="dark"] .kpi-label { color: #a8a292 !important; }
html[data-theme="dark"] .kpi-value { color: #f5f0e4 !important; }
html[data-theme="dark"] .kpi-sub { color: #a8a292 !important; }
html[data-theme="dark"] .stat { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .stat-l { color: #a8a292 !important; }
html[data-theme="dark"] .stat-v { color: #f5f0e4 !important; }
html[data-theme="dark"] .stat-s { color: #a8a292 !important; }
/* ── TABLA ── */
html[data-theme="dark"] th { background: rgba(22,21,15,.95) !important; color: #6d6859 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] td { color: #f5f0e4 !important; border-color: #1c1a13 !important; }
html[data-theme="dark"] tr:hover td { background: rgba(217,154,114,.05) !important; }
html[data-theme="dark"] tr:nth-child(even) td { background: rgba(255,255,255,.02) !important; }
html[data-theme="dark"] tr:nth-child(even):hover td { background: rgba(217,154,114,.06) !important; }
html[data-theme="dark"] .tfoot { background: rgba(0,0,0,.3) !important; border-color: #2c2a20 !important; color: #a8a292 !important; }
html[data-theme="dark"] .corr-tag { color: #d99a72 !important; }
/* ── EXPAND PANEL ── */
html[data-theme="dark"] .expand-panel { background: rgba(0,0,0,.25) !important; }
html[data-theme="dark"] .ep-label { color: #a8a292 !important; }
html[data-theme="dark"] .ep-value { color: #f5f0e4 !important; }
html[data-theme="dark"] .ep-divider { border-color: #2c2a20 !important; }
/* ── FORMULARIOS ── */
html[data-theme="dark"] .fg label { color: #a8a292 !important; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #0e0d0b !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .fg input,
html[data-theme="dark"] .fg textarea { background: #0e0d0b !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .fg select { background: #0e0d0b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; padding-right: 2rem !important; }
html[data-theme="dark"] .fg textarea { background: #0e0d0b !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
/* Inputs de fecha/hora — ícono visible en dark mode */
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] input[type="week"] { color-scheme: dark !important; background: #0e0d0b !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; -webkit-text-fill-color: #f5f0e4 !important; }
html[data-theme="dark"] input[type="date"]::-webkit-datetime-edit,
html[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-fields-wrapper,
html[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-text,
html[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field,
html[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field,
html[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field { color: #f5f0e4 !important; -webkit-text-fill-color: #f5f0e4 !important; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { background-color: transparent !important; color: #a8a292 !important; filter: brightness(0) invert(0.7) !important; opacity: 1 !important; cursor: pointer !important; padding: 2px !important; border-radius: 3px !important; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover { filter: brightness(0) invert(1) !important; opacity: 1 !important; }
/* Inputs numéricos — flechas visibles en dark mode */
html[data-theme="dark"] input[type="number"]::-webkit-inner-spin-button,
html[data-theme="dark"] input[type="number"]::-webkit-outer-spin-button { filter: invert(1) brightness(0.7) !important; opacity: 1 !important; cursor: pointer !important; }
/* Select — flecha visible */
html[data-theme="dark"] select { -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 10px center !important; padding-right: 28px !important; }
html[data-theme="dark"] .fg input:focus,
html[data-theme="dark"] .fg select:focus,
html[data-theme="dark"] .fg textarea:focus { border-color: #d99a72 !important; box-shadow: 0 0 0 3px rgba(217,154,114,.15) !important; background: #16150f !important; }
html[data-theme="dark"] .fg input::placeholder,
html[data-theme="dark"] .fg textarea::placeholder { color: #6d6859 !important; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #6d6859 !important; }
/* ── TOOLBAR / BÚSQUEDA ── */
html[data-theme="dark"] .tbar { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] #srch { background: #0e0d0b !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] #srch:focus { border-color: #d99a72 !important; box-shadow: 0 0 0 3px rgba(217,154,114,.12) !important; }
html[data-theme="dark"] #srch::placeholder { color: #6d6859 !important; }
html[data-theme="dark"] .tbar select { background: #0e0d0b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
/* ── BOTONES ── */
html[data-theme="dark"] .btn-sec { background: #16150f !important; color: #a8a292 !important; border-color: #3c3930 !important; }
html[data-theme="dark"] .btn-sec:hover { background: #2c2a20 !important; border-color: #d99a72 !important; color: #d99a72 !important; }
html[data-theme="dark"] .btn-pri { background: #d99a72 !important; border-color: #d99a72 !important; color: #17150f !important; }
html[data-theme="dark"] .btn-pri:hover { background: #d99a72 !important; border-color: #d99a72 !important; color: #17150f !important; }
html[data-theme="dark"] .btn-ghost { color: #a8a292 !important; }
html[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,.06) !important; color: #f5f0e4 !important; }
html[data-theme="dark"] .btn-act { background: #1c1a13 !important; border-color: #3c3930 !important; color: #a8a292 !important; }
html[data-theme="dark"] .btn-act:hover { background: #2c2a20 !important; border-color: #d99a72 !important; color: #d99a72 !important; }
html[data-theme="dark"] .btn-danger { background: rgba(228,121,106,.12) !important; color: #e4796a !important; border-color: rgba(228,121,106,.3) !important; }
html[data-theme="dark"] .btn-danger:hover { background: #e4796a !important; color: #fff !important; }
html[data-theme="dark"] .btn-gold { background: rgba(217,154,114,.12) !important; color: #d99a72 !important; border-color: rgba(217,154,114,.3) !important; }
html[data-theme="dark"] .btn-gold:hover { background: #e8b28c !important; color: var(--ink) !important; }
html[data-theme="dark"] .pnav button { background: #1c1a13 !important; border-color: #3c3930 !important; color: #a8a292 !important; }
html[data-theme="dark"] .pnav button:hover { border-color: #d99a72 !important; color: #d99a72 !important; }
html[data-theme="dark"] .pnav button.on { background: rgba(217,154,114,.16) !important; border-color: #d99a72 !important; color: #d99a72 !important; }
html[data-theme="dark"] .btn-print { background: #1c1a13 !important; border-color: #3c3930 !important; color: #a8a292 !important; }
html[data-theme="dark"] .btn-print:hover { border-color: #d99a72 !important; color: #d99a72 !important; }
/* Botones de acción en tabla — colores fijos para dark mode */
html[data-theme="dark"] .btn-cert { background: #d99a72 !important; color: #17150f !important; }
html[data-theme="dark"] .btn-del { background: rgba(228,121,106,.15) !important; border-color: rgba(228,121,106,.3) !important; color: #e4796a !important; }
html[data-theme="dark"] .btn-del:hover { background: #e4796a !important; color: #fff !important; }
/* ── WIZARD ── */
html[data-theme="dark"] .wz-steps { background: rgba(0,0,0,.3) !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .wz-circle { background: #1c1a13 !important; border-color: #3c3930 !important; color: #6d6859 !important; }
html[data-theme="dark"] .wz-label { color: #a8a292 !important; }
html[data-theme="dark"] .wz-line { background: #2c2a20 !important; }
html[data-theme="dark"] .wz-step.active .wz-label { color: #d99a72 !important; }
html[data-theme="dark"] .wz-step.done .wz-label { color: #5dbd82 !important; }
/* ── SECCIONES DE FORMULARIO ── */
html[data-theme="dark"] .fsec-title { background: var(--gold-bg) !important; border-color: var(--gold-brd) !important; border-left-color: var(--gold) !important; color: var(--gold) !important; }
/* ── MODALES ── */
html[data-theme="dark"] .modal-box { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .modal-head { background: #1c1a13 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .modal-head h3 { color: #f5f0e4 !important; }
html[data-theme="dark"] .modal-foot { background: rgba(0,0,0,.3) !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .btn-close { background: transparent !important; border-color: #3c3930 !important; color: #a8a292 !important; }
html[data-theme="dark"] .btn-close:hover { background: #1c1a13 !important; color: #f5f0e4 !important; }
/* ── LOGIN ── */
html[data-theme="dark"] .login-box { background: #16150f !important; border: 1px solid #2c2a20 !important; box-shadow: 0 24px 64px rgba(0,0,0,.6) !important; }
html[data-theme="dark"] .login-logo h1 { color: #f5f0e4 !important; }
html[data-theme="dark"] .login-logo p { color: #a8a292 !important; }
html[data-theme="dark"] .login-form label { color: #a8a292 !important; }
html[data-theme="dark"] .login-form input { background: #0e0d0b !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .login-form input:focus { border-color: #d99a72 !important; }
/* ── TOAST ── */
html[data-theme="dark"] .toast { background: #16150f !important; border-left-color: #d99a72 !important; color: #f5f0e4 !important; box-shadow: 0 8px 32px rgba(0,0,0,.6) !important; }
/* ── SPOTLIGHT ── */
html[data-theme="dark"] .spotlight-box { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .spotlight-input { color: #f5f0e4 !important; background: transparent !important; }
html[data-theme="dark"] .spotlight-input::placeholder { color: #6d6859 !important; }
html[data-theme="dark"] .spotlight-footer { background: #1c1a13 !important; border-color: #2c2a20 !important; color: #6d6859 !important; }
html[data-theme="dark"] .spotlight-result { border-color: #1c1a13 !important; }
html[data-theme="dark"] .spotlight-result:hover,
html[data-theme="dark"] .spotlight-result.on { background: rgba(217,154,114,.08) !important; }
html[data-theme="dark"] .spotlight-result-main { color: #f5f0e4 !important; }
html[data-theme="dark"] .spotlight-result-sub { color: #a8a292 !important; }
html[data-theme="dark"] .spotlight-empty { color: #a8a292 !important; }
/* ── DASHBOARD ── */
html[data-theme="dark"] .dash-period-bar { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .dash-period-bar select { background: #1c1a13 !important; color: #f5f0e4 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .dash-period-label { color: #a8a292 !important; }
/* ── AGENDA ── */
html[data-theme="dark"] .agenda-day-col { border-color: #2c2a20 !important; }
html[data-theme="dark"] .agenda-day-header { background: #1c1a13 !important; color: #a8a292 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .agenda-day-header.today { background: #3a2c20 !important; color: #fff !important; }
html[data-theme="dark"] .agenda-day-header.has-services { background: rgba(217,154,114,.1) !important; color: #d99a72 !important; }
html[data-theme="dark"] .agenda-mini-card { background: rgba(217,154,114,.1) !important; border-left-color: #d99a72 !important; color: #f5f0e4 !important; }
html[data-theme="dark"] .agenda-mini-card.pendiente { background: rgba(228,121,106,.1) !important; border-left-color: #e4796a !important; }
html[data-theme="dark"] .agenda-mini-card.pagado { background: rgba(93,189,130,.1) !important; border-left-color: #5dbd82 !important; }
html[data-theme="dark"] .agenda-tl-card { background: #1c1a13 !important; border-color: #3c3930 !important; }
html[data-theme="dark"] .avt-btn { background: #1c1a13 !important; color: #a8a292 !important; border-color: #3c3930 !important; }
html[data-theme="dark"] .avt-btn.on, html[data-theme="dark"] .avt-btn.active { background: rgba(217,154,114,.16) !important; border-color: #d99a72 !important; color: #d99a72 !important; }
html[data-theme="dark"] .aqb { background: #1c1a13 !important; color: #a8a292 !important; border-color: #3c3930 !important; }
html[data-theme="dark"] .aqb:hover, html[data-theme="dark"] .aqb.on, html[data-theme="dark"] .aqb.active { background: rgba(217,154,114,.16) !important; border-color: #d99a72 !important; color: #d99a72 !important; }
/* ── CONFIG ── */
html[data-theme="dark"] .cfg-item { background: #1c1a13 !important; border-color: #2c2a20 !important; color: #f5f0e4 !important; }
html[data-theme="dark"] .precio-item { background: #1c1a13 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .precio-nombre { color: #f5f0e4 !important; }
html[data-theme="dark"] .precio-valor { color: #d99a72 !important; }
/* ── USUARIOS ── */
html[data-theme="dark"] .user-card { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .user-name { color: #f5f0e4 !important; }
html[data-theme="dark"] .user-meta { color: #a8a292 !important; }
html[data-theme="dark"] .user-avatar { background: #d99a72 !important; }
/* ── SALDO / ADDR BLOCK ── */
html[data-theme="dark"] .saldo-box { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .addr-block { background: #1c1a13 !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .ab-title { color: #a8a292 !important; }
/* ── DROPDOWN / COTIZACIONES ── */
html[data-theme="dark"] .dropdown-list { background: #16150f !important; border-color: #2c2a20 !important; }
html[data-theme="dark"] .dropdown-item { color: #f5f0e4 !important; border-color: #1c1a13 !important; }
html[data-theme="dark"] .dropdown-item:hover { background: #1c1a13 !important; }
html[data-theme="dark"] .cot-card { border-color: #1c1a13 !important; }
html[data-theme="dark"] .cot-card:hover { background: rgba(255,255,255,.02) !important; }
html[data-theme="dark"] .cot-name { color: #f5f0e4 !important; }
html[data-theme="dark"] .cot-sub { color: #a8a292 !important; }
html[data-theme="dark"] .cot-meta { color: #a8a292 !important; }
/* ── VALES ── */
html[data-theme="dark"] .vales-dash-table td { color: #f5f0e4 !important; }
/* ── OVERRIDES PARA ESTILOS INLINE ── */
html[data-theme="dark"] [style*="background:#F"],
html[data-theme="dark"] [style*="background:#f"],
html[data-theme="dark"] [style*="background:#E"],
html[data-theme="dark"] [style*="background:#e"] { background: #16150f !important; color: #f5f0e4 !important; }
html[data-theme="dark"] [style*="color:#1c"],
html[data-theme="dark"] [style*="color:#5a"],
html[data-theme="dark"] [style*="color:#18"] { color: #f5f0e4 !important; }
html[data-theme="dark"] [style*="background:var(--card)"] { color: #f5f0e4 !important; }
html[data-theme="dark"] [style*="background:#f"] { background: #16150f !important; color: #f5f0e4 !important; }
html[data-theme="dark"] [style*="color:#1"] { color: #f5f0e4 !important; }
/* ── SCROLLBAR PERSONALIZADA ── */


/* ══ DARK MODE OVERRIDES COMPLETOS ══════════════════════════════ */
/* Cualquier inline background claro se convierte a card */
html[data-theme="dark"] [style*="background:#f"],
html[data-theme="dark"] [style*="background: #f"],
html[data-theme="dark"] [style*="background:#e"],
html[data-theme="dark"] [style*="background:#fff"] { background: var(--card) !important; }
html[data-theme="dark"] [style*="color:#000"],
html[data-theme="dark"] [style*="color: #000"],
html[data-theme="dark"] [style*="color:#1a1815"]:not(.corr-tag):not(.btn-pri):not(.badge) { color: var(--ink) !important; }
/* Cards pcard */
html[data-theme="dark"] .pcard-fall { background: rgba(245,158,11,.08) !important; border-color: rgba(245,158,11,.2) !important; }
html[data-theme="dark"] .pcard-cont { background: rgba(139,92,246,.08) !important; border-color: rgba(139,92,246,.2) !important; }
/* Tablas del dashboard — legibilidad en dark mode */
html[data-theme="dark"] td { color: var(--ink) !important; }
html[data-theme="dark"] .kpi-value { color: var(--ink) !important; }
html[data-theme="dark"] .stat-v { color: var(--ink) !important; }
/* Mobile cards dark mode */
html[data-theme="dark"] #tBody tr.tr-main { background: var(--card) !important; border-color: var(--brd) !important; }
html[data-theme="dark"] #tBody tr.tr-expand.on { background: var(--bg) !important; border-color: var(--brd) !important; }
html[data-theme="dark"] .td-mobile-main { background: var(--card) !important; }
html[data-theme="dark"] .expand-panel { background: var(--bg) !important; }
html[data-theme="dark"] .ep-label { color: var(--sub) !important; }
html[data-theme="dark"] .ep-value { color: var(--ink) !important; }
/* Sidebar overlay dark */
html[data-theme="dark"] #sbOverlay { background: rgba(0,0,0,.65) !important; }

/* ── AJUSTES FINALES MANUALES (van al final para tener la última palabra) ── */
html[data-theme="dark"] .sidebar { background: #080706 !important; border-right: 1px solid #1c1a13 !important; }
html[data-theme="dark"] #sbOverlay { background: rgba(8,7,6,.55) !important; }

/* ── CAMPO RUT + SERVEL / REGISTRO CIVIL ─────────────────────────
   Iconos de acción integrados al borde del campo, en vez de botones
   sueltos flotando sobre la etiqueta. */
.rut-field { position: relative; }
.rut-field input { padding-right: 2.1rem !important; }
.rut-field:has(.rut-actions > :nth-child(2)) input { padding-right: 3.5rem !important; }
.rut-actions {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: flex; gap: 3px; z-index: 2;
}
.rut-ico-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--sub);
  font-size: .85rem; line-height: 1; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.rut-ico-btn:hover { background: var(--gold-bg); border-color: var(--gold-brd); color: var(--gold); }
