/* ═══════════════════════════════════════════════════════════════
   SENTINEL PLATFORM — sentinel-mobile.css
   Responsive / Mobile-first overrides
   Breakpoints: ≤768px (móvil), ≤1024px (tablet)
   ═══════════════════════════════════════════════════════════════ */

/* ─── HAMBURGER BUTTON ─────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border, #0f3460);
  padding: 8px 10px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cyan, #00e5ff);
  transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── NAV LINKS WRAPPER ────────────────────────────────────────── */
.nav-links {
  display: contents; /* comportamiento por defecto — no cambia nada en desktop */
}

/* ─── TABLE SCROLL WRAPPER ─────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tbl-wrap .tbl {
  min-width: 600px;
}

/* ─── SUBNAV DESKTOP ───────────────────────────────────────────── */

/* Etiqueta de grupo mas compacta en pantallas medianas */
@media (max-width: 1280px) {
  .subnav-group::before { display: none; }
  .subnav { gap: 4px; }
}

/* ─── TABLET (≤1024px) ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .subnav { padding: 0 16px; }
  .container { padding: 20px 16px; }
  .kpi-value { font-size: 32px !important; }
}

/* ─── MÓVIL (≤768px) ───────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Body: permitir scroll */
  body { overflow-x: hidden; overflow-y: auto !important; }

  /* Subnav: oculto en movil (los enlaces ya estan en el desplegable) */
  .subnav { display: none !important; }

  /* Topbar: altura auto cuando está desplegado */
  .topbar {
    flex-wrap: wrap;
    height: auto !important;
    min-height: 52px;
    padding: 10px 16px;
    gap: 0;
  }

  /* Logo siempre visible */
  .logo { flex: 1; font-size: 15px !important; letter-spacing: 2px !important; }

  /* Mostrar hamburger */
  .hamburger { display: flex; }

  /* Nav links ocultos por defecto en móvil */
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border, #0f3460);
    margin-top: 10px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }

  /* Topbar-right: dentro del menú desplegable */
  .topbar-right {
    display: none;
    width: 100%;
    padding: 8px 0 4px;
    border-top: 1px solid rgba(15,52,96,.5);
    margin-top: 4px;
    justify-content: space-between;
    align-items: center;
  }
  .topbar-right.open { display: flex; }

  /* Nav links ocupan todo el ancho */
  .nav-link {
    width: 100%;
    padding: 10px 12px !important;
    border: none !important;
    border-bottom: 1px solid rgba(15,52,96,.3) !important;
    font-size: 14px !important;
    letter-spacing: 1px !important;
  }
  .nav-link:last-child { border-bottom: none !important; }
  .nav-link:hover, .nav-link.active {
    border-color: transparent !important;
    background: rgba(0,229,255,.08) !important;
  }

  /* KPIs: 2 columnas en móvil */
  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .kpi { padding: 14px 16px !important; }
  .kpi-value { font-size: 28px !important; }
  .kpi-label { font-size: 9px !important; }

  /* Main grid: columna única */
  .main-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Tablas: scroll horizontal */
  .panel .panel-body,
  .tbl-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 560px; }

  /* Incidentes: ajuste del grid interior */
  .inc-item {
    grid-template-columns: auto 1fr !important;
    gap: 8px !important;
  }
  .inc-right { display: none !important; }

  /* Container: menos padding */
  .container { padding: 14px 12px; padding-bottom: 50px; }

  /* Ticker: texto más pequeño */
  .ticker { font-size: 9px !important; height: 28px !important; }

  /* Toast: ancho completo en móvil */
  .toast { right: 12px; left: 12px; max-width: none; top: 56px; }

  /* Ocultar columnas secundarias en tablas pequeñas */
  .tbl .hide-mobile { display: none; }

  /* Login específico */
  .login-wrap { padding: 20px 16px !important; }
  .login-box  { padding: 24px 20px !important; }

  /* Cmd grid */
  .cmd-grid { grid-template-columns: 1fr !important; padding: 12px !important; }
}

/* ─── PEQUEÑO (≤480px) ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  .kpi-value { font-size: 36px !important; }
  .logo { font-size: 14px !important; }
  .topbar-right .user-badge { font-size: 10px !important; }
}
