/* WEBNEGOCIO360 PRO — Design tokens SaaS + tema claro/oscuro (APK parity) */
/* Fuentes: link en index.html (sin @import = arranque más rápido) */

:root, html[data-theme="light"], body[data-theme="light"] {
  --navy: #05162d;
  --navy2: #0a2344;
  --blue: #1e5eff;
  --cyan: #22d3ee;
  --yellow: #f5c518;
  --bg: #eef2f7;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --mut: #64748b;
  --ok: #16a34a;
  --bad: #dc2626;
  --shadow: 0 4px 14px rgba(5, 22, 45, 0.08);
  --radius: 16px;
  --font: "Manrope", "Inter", system-ui, sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;
  --side: 248px;
  --side-bg: linear-gradient(180deg, #0b1729, #0f172a);
  --side-text: #cbd5e1;
  --landing-bg: #05162d;
}

html[data-theme="dark"], body[data-theme="dark"] {
  --navy: #e2e8f0;
  --navy2: #94a3b8;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --yellow: #f5c518;
  --bg: #0b1220;
  --card: #111827;
  --line: #1f2a3d;
  --text: #e2e8f0;
  --mut: #94a3b8;
  --ok: #34d399;
  --bad: #f87171;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  --side-bg: linear-gradient(180deg, #070b14, #0b1220);
  --side-text: #94a3b8;
  --landing-bg: #070b14;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--landing-bg);
  color: #fff;
}
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

#app-root { min-height: 100vh; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 12px 20px;
  box-shadow: 0 10px 28px rgba(30, 94, 255, 0.35);
}
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 12px 20px;
}
.btn-light {
  background: #fff;
  color: #05162d;
  padding: 12px 20px;
}

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--mut); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--card);
  color: var(--text);
}

html[data-theme="dark"] .shell-header,
html[data-theme="dark"] .data-panel,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .quick-card,
html[data-theme="dark"] .drawer-card,
html[data-theme="dark"] .kb-col,
html[data-theme="dark"] .module-empty {
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .shell-brand,
html[data-theme="dark"] .page-title h1,
html[data-theme="dark"] .kpi-card .value,
html[data-theme="dark"] .panel h2 {
  color: #f8fafc;
}
html[data-theme="dark"] .data-table th {
  background: #0b1220;
  color: #94a3b8;
}
html[data-theme="dark"] .data-table td { color: #e2e8f0; border-color: var(--line); }
html[data-theme="dark"] .kb-card,
html[data-theme="dark"] .pos-item {
  background: #0b1220;
  border-color: var(--line);
  color: #e2e8f0;
}
html[data-theme="dark"] .login-card {
  background: #111827;
  color: #e2e8f0;
}
html[data-theme="dark"] .login-card h1 { color: #f8fafc; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(80px);
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transition: .25s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fin-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.fin-box div { display: grid; gap: 2px; font-size: 11px; color: var(--mut); }
.fin-box b { font-size: 13px; color: var(--navy); }
.fin-box b.bad { color: var(--bad); }
.fin-box b.ok { color: var(--ok); }

.cfg-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.cfg-hub-btn {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
}
.cfg-hub-btn.on { border-color: var(--cyan); box-shadow: inset 3px 0 0 var(--cyan); }
.cfg-hub-btn b { display: block; font-size: 14px; color: var(--navy); margin-bottom: 4px; }
.cfg-hub-btn span { font-size: 12px; color: var(--mut); font-weight: 500; }
.cfg-pane { display: none; }
.cfg-pane.show { display: block; }

.brand-logo-preview {
  width: 96px; height: 96px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 10px;
}
.brand-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
#wnBrandLogo {
  width: 28px; height: 28px; border-radius: 8px; object-fit: cover;
  margin-right: 8px;
}
[data-theme-btn].on {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: transparent !important;
}
