/*
 * Melier CRM — TEMA VISUAL NUEVO (aditivo, 2026-11-28)
 * =====================================================================
 * El visual de la landing del SaaS (azul marino + violeta/índigo) en
 * DOS modos, elegibles en Más → Tema nuevo junto al clásico:
 *   html.crm-theme-dark  = fondos azul marino muy oscuros, tarjetas
 *                          con borde violeta sutil, acentos luminosos.
 *   html.crm-theme-light = fondos claros, encabezados y tarjetas
 *                          destacadas en azul marino, acentos violeta.
 * La clase la pone theme.js solo si el dispositivo activó un modo
 * (localStorage "crm-theme" = "light" | "dark"). Sin clase, este
 * archivo no aplica NADA: el CRM clásico queda intacto, píxel a
 * píxel. SOLO presentación: sin datos, sin lógica.
 *
 * Estrategia: styles.css trabaja con variables (--bg, --card,
 * --gold…). Aquí (1) remapeamos esas variables por modo — --gold
 * pasa a ser el violeta acento, así la mayoría de componentes se
 * re-tiñen solos — y (2) pulimos con gradientes/sombras los
 * componentes clave (tarjetas, botones, navegación, Panel, Agenda).
 * Los colores de ESTADO (verde/rojo/azul de badges, chips de
 * inventario, dona de reportes generada en JS) se dejan intactos a
 * propósito: son semánticos, no de marca.
 * =====================================================================
 */

/* =====================================================================
 * MODO DARK — azul marino muy oscuro + violeta luminoso
 * ===================================================================== */
html.crm-theme-dark {
  --bg: #070b26;
  --bg2: #0c1233;
  --card: #111838;
  --card2: #1a2250;
  --gold: #7c6cf6;
  --gold-soft: #b7adff;
  --gold-dim: rgba(124, 108, 246, 0.18);
  --text: #eef0ff;
  --muted: #9aa5cf;
  --line: #273166;
  --radius: 16px;
}
html.crm-theme-dark body {
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(109, 88, 246, 0.28), rgba(109, 88, 246, 0) 60%),
    radial-gradient(900px 480px at -12% 4%, rgba(56, 89, 246, 0.20), rgba(56, 89, 246, 0) 55%),
    var(--bg);
}
html.crm-theme-dark .splash-m,
html.crm-theme-dark .login-card .logo {
  background: linear-gradient(145deg, #6d58f6, #4338ca);
  border-color: rgba(183, 173, 255, 0.65);
  color: #fff;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45);
}
html.crm-theme-dark .topbar {
  background: rgba(7, 11, 38, 0.92);
  border-bottom-color: rgba(124, 108, 246, 0.35);
}
html.crm-theme-dark .topbar .brand {
  background: linear-gradient(145deg, #6d58f6, #4338ca);
  border-color: rgba(183, 173, 255, 0.65);
  color: #fff;
}
html.crm-theme-dark .bottomnav {
  background: rgba(8, 12, 38, 0.97);
  border-top-color: rgba(124, 108, 246, 0.35);
}
html.crm-theme-dark .bottomnav a.active { color: var(--gold-soft); }
html.crm-theme-dark .card,
html.crm-theme-dark .kpi,
html.crm-theme-dark .pnl-mini,
html.crm-theme-dark .cal-cell,
html.crm-theme-dark .cal-booked,
html.crm-theme-dark .inv-row,
html.crm-theme-dark .listitem {
  background: linear-gradient(165deg, #151e4a 0%, #0e1434 100%);
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(2, 4, 20, 0.35);
}
html.crm-theme-dark .pnl-kpi {
  background: linear-gradient(160deg, #1b2560, #10173c);
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(2, 4, 20, 0.4);
}
html.crm-theme-dark .pnl-ic {
  background: linear-gradient(145deg, rgba(124, 108, 246, 0.35), rgba(79, 70, 229, 0.22));
  color: var(--gold-soft);
}
html.crm-theme-dark .login-card {
  background: linear-gradient(170deg, #151e4a, #0d1332);
  border-color: rgba(124, 108, 246, 0.4);
  box-shadow: 0 18px 44px rgba(2, 4, 20, 0.55);
}
html.crm-theme-dark .kcol { background: linear-gradient(170deg, #10173c, #0b1130); }
html.crm-theme-dark .listitem:active,
html.crm-theme-dark .pnl-row:active { background: #1a2250; }
html.crm-theme-dark .btn {
  background: linear-gradient(135deg, #6a58f0 0%, #4f46e5 100%);
  border-color: rgba(183, 173, 255, 0.5);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}
html.crm-theme-dark .btn.ghost {
  background: rgba(124, 108, 246, 0.10);
  color: var(--gold-soft);
  box-shadow: none;
}
html.crm-theme-dark .btn.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: none;
}
html.crm-theme-dark .fab {
  background: linear-gradient(145deg, #6a58f0, #4f46e5);
  color: #fff;
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.5);
}
html.crm-theme-dark .tabs button.on {
  color: var(--gold-soft);
  border-color: var(--gold);
  background: var(--gold-dim);
}
html.crm-theme-dark .checkrow input { accent-color: var(--gold); }
html.crm-theme-dark .pnl-day { background: #0c1233; }
html.crm-theme-dark .pnl-day.today,
html.crm-theme-dark .cal-cell.today {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 18px rgba(124, 108, 246, 0.25);
}
html.crm-theme-dark .pnl-job,
html.crm-theme-dark .cal-chip { background: #1a2250; }
html.crm-theme-dark tr.wk-now td { background: rgba(124, 108, 246, 0.10); }
html.crm-theme-dark .wk-tag { color: #fff; }

/* =====================================================================
 * MODO CLARO — fondos claros + azul marino en encabezados/tarjetas
 * destacadas + acentos violeta
 * ===================================================================== */
html.crm-theme-light {
  --bg: #eceefb;
  --bg2: #e3e7fa;
  --card: #ffffff;
  --card2: #eef0fc;
  --gold: #6a58f0;
  --gold-soft: #5546e0;
  --gold-dim: rgba(106, 88, 240, 0.14);
  --text: #131a3a;
  --muted: #59638e;
  --line: #d3d9f2;
  --radius: 16px;
}
html.crm-theme-light body {
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(109, 88, 246, 0.16), rgba(109, 88, 246, 0) 60%),
    radial-gradient(900px 480px at -12% 4%, rgba(56, 89, 246, 0.10), rgba(56, 89, 246, 0) 55%),
    var(--bg);
}
html.crm-theme-light .splash-m,
html.crm-theme-light .login-card .logo {
  background: linear-gradient(145deg, #6d58f6, #4338ca);
  border-color: rgba(85, 70, 224, 0.5);
  color: #fff;
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.35);
}
/* Encabezados en azul marino (barra superior y navegación inferior) */
html.crm-theme-light .topbar {
  background: linear-gradient(135deg, #141c48 0%, #1d2560 100%);
  border-bottom-color: rgba(124, 108, 246, 0.45);
  color: #eef0ff;
}
html.crm-theme-light .topbar h1 { color: #fff; }
html.crm-theme-light .topbar h1 small { color: #aab3dd; }
html.crm-theme-light .topbar .brand {
  background: linear-gradient(145deg, #6d58f6, #4338ca);
  border-color: rgba(183, 173, 255, 0.65);
  color: #fff;
}
html.crm-theme-light .topbar a { color: #cfd6ff; }
html.crm-theme-light .bottomnav {
  background: linear-gradient(180deg, #171f52, #10173c);
  border-top-color: rgba(124, 108, 246, 0.45);
}
html.crm-theme-light .bottomnav a { color: #aab3dd; }
html.crm-theme-light .bottomnav a.active { color: #fff; }
/* Tarjetas: blancas con gradiente apenas perceptible y sombra suave */
html.crm-theme-light .card,
html.crm-theme-light .kpi,
html.crm-theme-light .pnl-mini,
html.crm-theme-light .cal-cell,
html.crm-theme-light .cal-booked,
html.crm-theme-light .inv-row,
html.crm-theme-light .listitem {
  background: linear-gradient(165deg, #ffffff 0%, #f1f2fd 100%);
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(19, 26, 58, 0.08);
}
html.crm-theme-light .listitem:active,
html.crm-theme-light .pnl-row:active { background: #e6e9fb; }
/* Tarjetas destacadas del Panel: azul marino, como en la landing */
html.crm-theme-light .pnl-kpi {
  background: linear-gradient(160deg, #1b2560, #10173c);
  border-color: #273166;
  box-shadow: 0 10px 24px rgba(19, 26, 58, 0.28);
  color: #eef0ff;
}
html.crm-theme-light .pnl-kpi-v { color: #fff; }
html.crm-theme-light .pnl-kpi-l { color: #aab3dd; }
html.crm-theme-light .pnl-ic {
  background: linear-gradient(145deg, rgba(124, 108, 246, 0.4), rgba(79, 70, 229, 0.25));
  color: #cfc8ff;
}
html.crm-theme-light .pnl-chip { border-color: #46538c; color: #aab3dd; }
html.crm-theme-light .login-card {
  background: linear-gradient(170deg, #ffffff, #eef0fc);
  border-color: rgba(106, 88, 240, 0.35);
  box-shadow: 0 18px 40px rgba(19, 26, 58, 0.16);
}
html.crm-theme-light .kcol { background: linear-gradient(170deg, #e8ebfb, #dde2f8); }
/* Botones: primario con gradiente violeta en ambos modos */
html.crm-theme-light .btn {
  background: linear-gradient(135deg, #6a58f0 0%, #4f46e5 100%);
  border-color: rgba(85, 70, 224, 0.5);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
}
html.crm-theme-light .btn.ghost {
  background: rgba(106, 88, 240, 0.08);
  color: var(--gold-soft);
  box-shadow: none;
}
html.crm-theme-light .btn.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: none;
}
html.crm-theme-light .fab {
  background: linear-gradient(145deg, #6a58f0, #4f46e5);
  color: #fff;
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.4);
}
html.crm-theme-light .tabs button.on {
  color: var(--gold-soft);
  border-color: var(--gold);
  background: var(--gold-dim);
}
html.crm-theme-light .checkrow input { accent-color: var(--gold); }
html.crm-theme-light .pnl-day { background: #f4f5fd; }
html.crm-theme-light .pnl-day.today,
html.crm-theme-light .cal-cell.today {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 14px rgba(106, 88, 240, 0.22);
}
html.crm-theme-light .pnl-job,
html.crm-theme-light .cal-chip { background: #e8ebfb; }
html.crm-theme-light tr.wk-now td { background: rgba(106, 88, 240, 0.08); }
html.crm-theme-light .wk-tag { color: #fff; }
/* Campos de formulario: fondo blanco real sobre el fondo claro */
html.crm-theme-light label.f input,
html.crm-theme-light label.f select,
html.crm-theme-light label.f textarea,
html.crm-theme-light .searchbar { background: #ffffff; }
html.crm-theme-light .pinpad button { background: #ffffff; }
html.crm-theme-light .pinpad button:active { background: #e6e9fb; }
