/* ============================================================================
 * BotNexo SaaS v4.0 — styles.css
 * Sistema visual dual:
 * 1) platform-shell (Tema claro / oscuro seleccionable, estética AppNexo)
 * 2) public-brand-shell (White-label por organización con contraste automático)
 * ============================================================================ */

:root {
  --bn-bg: #f4faf7;
  --bn-surface: #ffffff;
  --bn-surface-2: #f8fafc;
  --bn-border: #e2e8f0;
  --bn-text: #0f172a;
  --bn-muted: #64748b;
  --bn-primary: #10b981;
  --bn-primary-dark: #059669;
  --bn-primary-soft: rgba(16, 185, 129, 0.12);
  --bn-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --brand-primary: #10b981;
  --brand-bg: #f8fafc;
  --brand-fg: #0f172a;
  --brand-accent-bg: #059669;
  --brand-accent-fg: #ffffff;
}

[data-theme="dark"] {
  --bn-bg: #0b1220;
  --bn-surface: #111a2e;
  --bn-surface-2: #17233d;
  --bn-border: #24324d;
  --bn-text: #f1f5f9;
  --bn-muted: #94a3b8;
  --bn-primary: #10b981;
  --bn-primary-dark: #34d399;
  --bn-primary-soft: rgba(16, 185, 129, 0.16);
  --bn-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html { scroll-behavior: smooth; }

body.platform-shell {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bn-bg);
  color: var(--bn-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.public-brand-shell {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--brand-bg);
  color: var(--brand-fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bn-main { flex: 1; }

.bn-topbar {
  background: color-mix(in srgb, var(--bn-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bn-border);
  z-index: 1030;
}

.bn-logo-word {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.25rem;
  line-height: 1;
}

.bn-logo-accent { color: var(--bn-primary); }

.bn-card {
  background: var(--bn-surface);
  border: 1px solid var(--bn-border);
  border-radius: 1rem;
  box-shadow: var(--bn-shadow);
}

.bn-modal-content {
  background: var(--bn-surface);
  color: var(--bn-text);
  border: 1px solid var(--bn-border);
  border-radius: 1rem;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
  background-color: var(--bn-surface-2);
  color: var(--bn-text);
  border-color: var(--bn-border);
}

[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--bn-text);
  --bs-table-border-color: var(--bn-border);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-secondary { color: var(--bn-muted) !important; }

.bn-hero {
  background: radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.16), transparent 45%),
              radial-gradient(circle at 10% 80%, rgba(14, 165, 233, 0.08), transparent 40%);
  padding: 3.5rem 0 3rem;
}

.bn-hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.bn-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bn-primary);
  margin-bottom: 0.75rem;
}

.bn-btn-primary {
  background: var(--bn-primary);
  border-color: var(--bn-primary);
  color: #ffffff;
  font-weight: 700;
  border-radius: 0.75rem;
}
.bn-btn-primary:hover {
  background: var(--bn-primary-dark);
  border-color: var(--bn-primary-dark);
  color: #ffffff;
}

.bn-brand-btn {
  background: var(--brand-accent-bg);
  border-color: var(--brand-accent-bg);
  color: var(--brand-accent-fg);
  font-weight: 700;
  border-radius: 0.75rem;
}
.bn-brand-btn:hover { opacity: 0.92; color: var(--brand-accent-fg); }

.bn-brand-outline {
  border: 1.5px solid var(--brand-accent-bg);
  color: var(--brand-accent-bg);
  background: transparent;
  font-weight: 700;
  border-radius: 0.75rem;
}

.bn-pill-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--bn-muted);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.65rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.bn-pill-tab:hover { background: var(--bn-surface-2); color: var(--bn-text); }
.bn-pill-tab.active { background: #0f172a; color: #ffffff; }
[data-theme="dark"] .bn-pill-tab.active { background: var(--bn-primary); color: #0b1220; }

.bn-stat-box {
  background: var(--bn-surface-2);
  border: 1px solid var(--bn-border);
  border-radius: 0.85rem;
  padding: 1rem;
}

.bn-toast {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 1095;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.1rem;
  border-radius: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  max-width: 360px;
}

.bn-footer {
  border-top: 1px solid var(--bn-border);
  background: var(--bn-surface);
  color: var(--bn-muted);
  font-size: 0.82rem;
}

#bnMap { height: 58vh; min-height: 360px; border-radius: 0.85rem; z-index: 1; }
.tracking-wide { letter-spacing: 0.25em; }

@media (max-width: 767px) {
  .bn-toast { left: 1rem; right: 1rem; bottom: 4.5rem; max-width: none; }
}
