/* ===================================================
   CAPA RESPONSIVA MÓVIL AISLADA - AGGY LABS
   Solo aplica en pantallas menores o iguales a 768px
=================================================== */

@media (max-width: 768px) {
  /* Evitar desbordes horizontales accidentales */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Ajuste de contenedores principales a columna única */
  .main-content, 
  .workspace-container, 
  .dashboard-wrapper,
  .app-container {
    padding: 12px !important;
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Forzar grids de 2 o 3 columnas a 1 sola columna */
  .grid, 
  [class*="grid-cols-"], 
  #training-grid-container,
  .metrics-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Sidebar en móvil: Modo Drawer deslizante */
  #sidebar, 
  aside.sidebar,
  .sidebar-container {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.8) !important;
    background: rgba(13, 17, 23, 0.98) !important;
    backdrop-filter: blur(16px) !important;
  }

  #sidebar.mobile-open,
  aside.sidebar.mobile-open {
    left: 0 !important;
  }

  /* Overlay de fondo oscuro al abrir el sidebar */
  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9998;
  }
  .mobile-overlay.active {
    display: block !important;
  }

  /* Barra de cabecera móvil con botón de menú */
  .mobile-header-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  /* Modales a pantalla completa o estilo bottom-sheet */
  .modal-content,
  .modal-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 10px auto !important;
    padding: 16px !important;
  }

  /* Tablas con scroll horizontal suave */
  .table-responsive, 
  .overflow-x-auto {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 769px) {
  .mobile-header-bar,
  .mobile-overlay {
    display: none !important;
  }
}


/* Ajustes de contraste para botones de Acciones Rápidas */
#btn-start-engine, .btn-action-start {
  color: #34d399 !important;
}
#btn-start-engine span, .btn-action-start span {
  color: #34d399 !important;
}
#btn-unlink-whatsapp, .btn-action-unlink {
  color: #e2e8f0 !important;
}
#btn-unlink-whatsapp span, .btn-action-unlink span {
  color: #e2e8f0 !important;
}
