/* ══════════════════════════════════════════════════════════════════
   theme-dark.css — Modo oscuro unificado para Xpress Tools
   ------------------------------------------------------------------
   Compañero de theme-light.css. Solo actúa cuando <html> tiene la
   clase "xp-dark", que pone theme.js según lo elegido en
   admin.html → Configuración → Apariencia. Si no está activo,
   este archivo no cambia NADA (el tema por defecto es el claro).

   Cada página solo necesita, justo DESPUÉS del link de theme-light.css:
       <link rel="stylesheet" href="theme-dark.css?v=1">
       <script src="theme.js?v=1"></script>

   No toca ningún ID, clase usada por JS ni estructura: solo colores.
   Paleta: pizarra / azul marino con acento índigo.
   ══════════════════════════════════════════════════════════════════ */

/* ── Variables (mismos nombres que theme-light.css, valores oscuros) ── */
html.xp-dark{
  color-scheme:dark;
  --bg:#0f1420 !important;
  --white:#161d2b !important;
  --border:#263044 !important;
  --border2:#2c3750 !important;
  --text:#e6eaf2 !important;
  --muted:#8e9ab0 !important;
  --light:#1b2333 !important;
  --orange:#818cf8 !important;
  --orange-l:rgba(129,140,248,.14) !important;
  --orange-b:rgba(129,140,248,.35) !important;
  --green:#34d399 !important;
  --green-l:rgba(52,211,153,.12) !important;
  --green-b:rgba(52,211,153,.30) !important;
  --red:#f87171 !important;
  --red-l:rgba(248,113,113,.12) !important;
  --red-b:rgba(248,113,113,.30) !important;
  --blue:#818cf8 !important;
  --blue-l:rgba(129,140,248,.12) !important;
  --blue-b:rgba(129,140,248,.30) !important;
  --yellow:#fbbf24 !important;
  --yellow-l:rgba(251,191,36,.12) !important;
  --yellow-b:rgba(251,191,36,.30) !important;
  --teal:#2dd4bf !important;
  --teal-l:rgba(45,212,191,.12) !important;
  --pink:#f472b6 !important;
  --pink-l:rgba(244,114,182,.12) !important;
  --pink-b:rgba(244,114,182,.30) !important;
  --purple:#a78bfa !important;
  --purple-l:rgba(167,139,250,.12) !important;
  --purple-b:rgba(167,139,250,.30) !important;
  --cyan:#22d3ee !important;
  --cyan-l:rgba(34,211,238,.12) !important;
  --cyan-b:rgba(34,211,238,.30) !important;

  /* Esquema B */
  --bg2:#161d2b !important;
  --bg3:#1b2333 !important;
  --bg4:#232c3d !important;
  --text2:#8e9ab0 !important;
  --text3:#6b778c !important;
  --accent:#818cf8 !important;
  --accent-dim:rgba(129,140,248,.12) !important;
  --green-bg:rgba(52,211,153,.12) !important;
  --amber:#fbbf24 !important;
  --amber-bg:rgba(251,191,36,.12) !important;
  --red-bg:rgba(248,113,113,.12) !important;
  --blue-bg:rgba(129,140,248,.12) !important;
  --purple-bg:rgba(167,139,250,.12) !important;
  /* Esquema C */
  --surface:#161d2b !important;
  --surface2:#1b2333 !important;
  --accent2:#fbbf24 !important;
  /* Esquema D */
  --panel:#161d2b !important;
  --sidebar:#121826 !important;
  --danger:#f87171 !important;
  --warn:#fbbf24 !important;
  /* Esquema E */
  --naranja:#818cf8 !important;
  --azul:#818cf8 !important;
  --card:#161d2b !important;
  --card-2:#1b2333 !important;
  --texto:#e6eaf2 !important;
  --texto-sec:#8e9ab0 !important;
  --verde:#34d399 !important;
  --rojo:#f87171 !important;
  --amarillo:#fbbf24 !important;
  /* Esquema F */
  --panel-2:#1b2333 !important;
  --accent-2:#34d399 !important;
  /* Otros nombres usados por algunas páginas */
  --text-primary:#e6eaf2 !important;
  --text-secondary:#8e9ab0 !important;
  --text-muted:#6b778c !important;
  --bg-main:#0f1420 !important;
  --gray-50:#161d2b !important;
  --gray-100:#1b2333 !important;
  --gray-200:#263044 !important;
  --gray-400:#6b778c !important;
  --gray-600:#a3aec2 !important;
  --gray-800:#e6eaf2 !important;
  --violet:#a78bfa !important;
  --violet-l:rgba(167,139,250,.12) !important;
}

/* ── Base ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3){background:var(--bg) !important;color:var(--text) !important;}

/* ── Menú lateral (en claro es azul marino; en oscuro, pizarra) ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar,
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar:hover,
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar:not(:hover){
  background:#121826 !important;
  border-right:1px solid #232c3d !important;
  box-shadow:none !important;
}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .sb-logo,
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .sb-conn{border-bottom-color:#232c3d !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .online-section{border-top-color:#232c3d !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .nb{color:#a3aec2 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .nb:hover{background:rgba(129,140,248,.08) !important;color:#e6eaf2 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .nb.on,
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .nb-cat.open{background:rgba(129,140,248,.16) !important;color:#e0e4ff !important;box-shadow:inset 3px 0 0 #818cf8 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .nb-cat.open .nb-ico{color:#c7cbff !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #sidebar .sb-foot{color:#6b778c !important;}

/* ── Barra superior ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #topbar{background:#121826 !important;border-bottom:1px solid #232c3d !important;box-shadow:0 1px 0 rgba(0,0,0,.25) !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .tb-title{color:#f1f4f9 !important;}

/* ── Tarjetas de herramientas (hub) ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard,
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #tools-grid .htcard{
  background:#161d2b !important;
  border:1px solid rgba(129,140,248,.30) !important;
  box-shadow:0 1px 2px rgba(0,0,0,.35) !important;
  backdrop-filter:none !important;-webkit-backdrop-filter:none !important;
}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard:hover,
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #tools-grid .htcard:hover{
  background:#1a2233 !important;
  border-color:#ef4444 !important;
  box-shadow:0 0 0 1px #ef4444, 0 0 26px 6px rgba(239,68,68,.35) !important;
}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard .hname{color:#e6eaf2 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard .hico{background:#1f2839 !important;border:1px solid #36415a !important;color:#a5b4fc !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard .hico svg:not([stroke="none"]),
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard .hico svg:not([stroke="none"]) *:not([stroke="none"]){stroke:#a5b4fc !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard .hico svg [fill="currentColor"]{fill:#a5b4fc !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .htcard .v1-glow{background:radial-gradient(180px circle at var(--mx,50%) var(--my,50%), rgba(129,140,248,.10), transparent 70%) !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .hgroup .hgroup-title{color:#f1f4f9 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .hgroup-mark{background:#818cf8 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .hgroup-line{background:#263044 !important;}

/* ── Buscador del hub ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #xs-input{background:#1b2333 !important;border:1px solid #2c3750 !important;color:#e6eaf2 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #xs-kbd{background:#232c3d !important;border-color:#2c3750 !important;color:#8e9ab0 !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) #xs-panel{background:#161d2b !important;border:1px solid #263044 !important;box-shadow:0 18px 48px rgba(0,0,0,.5) !important;}

/* ── Modales ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .modal-bg{background:rgba(6,9,16,.65) !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) .modal{box-shadow:0 24px 64px rgba(0,0,0,.6) !important;}

/* ── Formularios ── */
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) ::placeholder{color:#6b778c !important;}
html.xp-dark body:is(body,#_xd1#_xd2#_xd3) select option{background:#161d2b;color:#e6eaf2;}

/* ── Barras de desplazamiento ── */
html.xp-dark ::-webkit-scrollbar-thumb{background:#2c3750 !important;}
html.xp-dark ::-webkit-scrollbar-thumb:hover{background:#3a4764 !important;}

/* ── Ajustes puntuales (colores fijos en algunas herramientas) ── */
/* Contador "Despacho a bodega (destino)" en las páginas de trazabilidad */
html.xp-dark .counter-box[style*="#F1F3FF"]{background:rgba(129,140,248,.12) !important;border-color:rgba(129,140,248,.35) !important;}
html.xp-dark .counter-box[style*="#F1F3FF"] .counter-val{color:#a5b4fc !important;}
html.xp-dark .counter-box[style*="#F1F3FF"] .counter-lbl{color:#8e9ab0 !important;}
/* Panel "Actividad" (log) de Tiendas Masivo */
html.xp-dark .act-log{background:#111827 !important;border-color:#263044 !important;color:#e6eaf2 !important;}
html.xp-dark .act-log::-webkit-scrollbar-thumb{background:#2c3750 !important;}
html.xp-dark .act-log .log-line{border-bottom-color:#1f2839 !important;}
html.xp-dark .act-log .log-ts{color:#6b778c !important;}
html.xp-dark .act-log .log-tag{color:#a5b4fc !important;}
html.xp-dark .act-log .log-info .log-msg{color:#e6eaf2 !important;}
html.xp-dark .act-log .log-success .log-tag,html.xp-dark .act-log .log-success .log-msg{color:#34d399 !important;}
html.xp-dark .act-log .log-warning .log-tag,html.xp-dark .act-log .log-warning .log-msg{color:#fbbf24 !important;}
html.xp-dark .act-log .log-error .log-tag,html.xp-dark .act-log .log-error .log-msg{color:#f87171 !important;}
