/* ============================================================
   BotonPanico — Scoxe Overrides
   Solo lo que no cubre el tema base. El topbar/layout usa
   las clases nativas de Scoxe; aqui van brand, sidebar cards,
   status pills, paneles operativos y utils de pagina.
   ============================================================ */

/* ── Variables ── */
:root {
  --bp-accent:        #e11d48;
  --bp-accent-strong: #be123c;
  --bp-info:          #0ea5e9;
  --bp-success:       #16a34a;
  --bp-warning:       #d97706;
  --bp-dark:          #0f172a;
  --bp-muted:         #64748b;
  --bp-border:        rgba(148, 163, 184, 0.18);
  --bp-border-strong: rgba(148, 163, 184, 0.26);
  --bp-panel-shadow:  0 24px 60px rgba(15, 23, 42, 0.12);
}

/* ── Fondos por tema ── */
html[data-bs-theme="dark"] body {
  background:
    radial-gradient(circle at top left,  rgba(14, 165, 233, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(225, 29, 72, 0.14),  transparent 22%),
    linear-gradient(180deg, #081121 0%, #0f172a 100%);
}
html[data-bs-theme="light"] body {
  background:
    radial-gradient(circle at top left,  rgba(14, 165, 233, 0.10), transparent 22%),
    radial-gradient(circle at top right, rgba(225, 29, 72, 0.08),  transparent 18%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
}
body { min-height: 100vh; }

/* Grilla sutil de fondo */
.layout-wrapper::before,
.auth-layout-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.48), transparent 85%);
}

/* ── Sidebar ── */
.main-menu {
  border-right: 1px solid var(--bp-border);
  backdrop-filter: blur(18px);
}
html[data-bs-theme="dark"] .main-menu {
  background: linear-gradient(180deg, rgba(4,11,24,0.98), rgba(11,19,36,0.95));
}
html[data-bs-theme="light"] .main-menu {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(244,247,251,0.92));
}

/* ── Brand lockup (sidebar + topbar mobile) ── */
.logo-box { padding-inline: 1.3rem; }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}
.brand-icon {
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--bp-accent) 0%, #fb7185 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(225, 29, 72, 0.28);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.brand-icon-sm {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 12px;
  font-size: 1rem;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-copy small {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.63rem;
  color: #38bdf8;
  font-weight: 700;
}
.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
}

/* ── Menu links ── */
.app-menu .menu-link {
  border-radius: 14px;
  margin: 0 0.75rem 0.35rem;
  padding-block: 0.82rem;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  border-left: 3px solid transparent;
}

/* Hover */
.app-menu .menu-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}
html[data-bs-theme="dark"]  .app-menu .menu-link:hover {
  background: rgba(255, 255, 255, 0.07);
}
html[data-bs-theme="light"] .app-menu .menu-link:hover {
  background: rgba(14, 165, 233, 0.09);
}

/* Activo (pagina actual) */
.app-menu .menuitem-active > .menu-link {
  transform: translateY(-1px);
  border-left: 3px solid var(--bp-accent);
}
html[data-bs-theme="dark"] .app-menu .menuitem-active > .menu-link {
  background: linear-gradient(135deg, rgba(225,29,72,0.32), rgba(14,165,233,0.26));
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.22);
  color: #fff;
}
html[data-bs-theme="light"] .app-menu .menuitem-active > .menu-link {
  background: linear-gradient(135deg, rgba(225,29,72,0.14), rgba(14,165,233,0.12));
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.14);
  color: var(--bp-accent);
}

/* Feedback visual al hacer click (:active) */
.app-menu .menu-link:active {
  transform: scale(0.97) translateY(0);
  box-shadow: none;
}

/* ── Sidebar cards (rol + capacidades) ── */
.bp-side-card {
  margin: 0 1rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--bp-border);
  box-shadow: var(--bp-panel-shadow);
  overflow: hidden;
}
.bp-side-card .card-body { padding: 1rem 1.1rem; }

.bp-role-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

/* ── Avatar de usuario (topbar) ── */
.bp-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bp-accent) 0%, #fb7185 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.22);
  flex-shrink: 0;
}

/* nav-user usa el avatar como imagen — anular el borde circular de Scoxe */
.nav-user .bp-avatar { vertical-align: middle; }

/* ── Profile dropdown ── */
.profile-dropdown .dropdown-header {
  padding: 0.75rem 1rem;
}
.profile-dropdown .dropdown-header p {
  font-size: 0.78rem;
}

/* ── Page title box ── */
.page-title { font-weight: 800; letter-spacing: -0.03em; }

/* ── Panels operativos ── */
.card.hero-card,
.card.control-card,
.card.ops-panel {
  border-radius: 24px;
  border: 1px solid var(--bp-border);
  box-shadow: var(--bp-panel-shadow);
  overflow: hidden;
  position: relative;
}
.card.hero-card::before,
.card.control-card::before,
.card.ops-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(14,165,233,0.4), rgba(225,29,72,0.12), transparent);
}

html[data-bs-theme="dark"] .card.control-card,
html[data-bs-theme="dark"] .card.hero-card,
html[data-bs-theme="dark"] .card.ops-panel {
  background: rgba(15, 23, 42, 0.82);
}
html[data-bs-theme="light"] .card.control-card,
html[data-bs-theme="light"] .card.hero-card,
html[data-bs-theme="light"] .card.ops-panel {
  background: rgba(255, 255, 255, 0.92);
}

/* ── Status pills ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-pill.status-ok     { background: rgba(34,197,94,0.12);  color: #16a34a; }
.status-pill.status-warn   { background: rgba(245,158,11,0.14); color: #b45309; }
.status-pill.status-danger { background: rgba(239,68,68,0.14);  color: #dc2626; }
.status-pill.status-info   { background: rgba(59,130,246,0.14); color: #2563eb; }
.status-pill.status-idle   { background: rgba(100,116,139,0.14);color: #475569; }

/* ── Summary chip ── */
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(58, 79, 120, 0.12);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Auth code display ── */
.auth-command {
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

/* ── Map ── */
#map { min-height: 430px; }

/* ── Utilidades ── */
.hidden { display: none !important; }

/* ── Auth pages ── */
.auth-hero {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left,  rgba(59,130,246,0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(6,182,212,0.08), transparent 24%);
}
.auth-panel-shell {
  border-radius: 28px !important;
  border: 1px solid var(--bp-border) !important;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  background: transparent;
}
.auth-visual {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(8,17,33,0.2), rgba(8,17,33,0.82)),
    url("/static/scoxe/assets/images/bg-login.jpg") center/cover no-repeat;
  color: #fff;
}
.auth-visual.auth-register {
  background:
    linear-gradient(180deg, rgba(8,17,33,0.24), rgba(8,17,33,0.82)),
    url("/static/scoxe/assets/images/bg-register.jpg") center/cover no-repeat;
}
.auth-surface { height: 100%; }
html[data-bs-theme="dark"]  .auth-surface { background: rgba(8,17,33,0.92); }
html[data-bs-theme="light"] .auth-surface { background: rgba(255,255,255,0.96); }

.auth-kicker {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
}
.auth-feature-list { display: grid; gap: 0.9rem; }
.auth-feature {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}
.auth-feature i {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(56,189,248,0.18);
  color: #67e8f9;
}
.auth-form-card { border-radius: 20px; border: 1px solid var(--bp-border); }
.auth-form-card .form-control,
.auth-form-card .form-select,
.auth-surface .form-control,
.auth-surface .form-select {
  min-height: 50px;
  border-radius: 14px;
}
.auth-helper-card { border-radius: 18px; border: 1px solid var(--bp-border); }

.btn-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

/* ── Sidebar condensado (sidebar-enable toggle de Scoxe) ── */
html.sidebar-enable:not([data-sidebar-size=full]) .bp-side-card { display: none; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
  #map { min-height: 320px; }
  .bp-side-card { display: none; }
  .logo-box { padding-inline: 0.65rem; }
}
