body {
  font-family: 'Outfit', sans-serif;
  background-color: #0f172a;
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
  color: #fff;
  margin: 0;
  display: flex;
}
.main-wrapper {
    min-height: 100vh;
    display: flex;
    width: 100%;
}
.sidebar {
  width: 250px;
  min-width: 250px;
  background: rgba(15, 23, 42, 0.8);
  border-right: 1px solid rgba(255,255,255,0.05);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.content-area {
  flex-grow: 1;
  padding: 6rem 3rem 2rem;
  overflow-y: auto;
  height: 100vh;
}
.header-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  flex: 1;
  min-width: 14rem;
}
.header-quick-actions > button {
  position: relative !important;
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.875rem;
  padding: 0;
}

.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.4s ease-in-out; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #94a3b8;
    transition: all 0.2s;
    cursor: pointer;
    font-weight: 500;
}
.nav-btn:hover { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
.nav-btn.active { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border-left: 3px solid #38bdf8; }

.glass-panel {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px border border-white/10;
  border-radius: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.products-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.products-manager-copy {
  min-width: 0;
}
.products-manager-title {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
}
.products-manager-subtitle {
  margin-top: 0.35rem;
  color: #94a3b8;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.products-manager-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.products-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.products-toolbar-selection {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.products-toolbar-search {
  position: relative;
  width: min(100%, 18rem);
  flex: 1 1 16rem;
}
.products-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 1rem; color: #94a3b8; font-size: 0.875rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
td { padding: 1rem; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.05); }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-overlay.active { display: flex; }

/* Mobile Enhancements */
@media (max-width: 768px) {
    html, body { max-width: 100vw; overflow-x: hidden; }
    body, .main-wrapper { flex-direction: column; overflow-x: hidden; width: 100vw; max-width: 100vw; }
    .sidebar {
        width: 100vw; min-width: 100vw; flex-direction: row; overflow-x: auto;
        border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); padding: 0.75rem; gap: 0.25rem;
        position: sticky; top: 0; z-index: 40; background: rgba(15,23,42,0.95);
    }
    .sidebar > div:first-child { display: none; } /* Ocultar barra superior en movil */
    .nav-btn {
        white-space: nowrap; padding: 0.5rem 1rem; margin-bottom: 0 !important;
        border-left: none !important; border-bottom: 3px solid transparent; font-size: 0.85rem;
    }
    .nav-btn.active {
        border-left: none !important; border-bottom: 3px solid #38bdf8;
        background: rgba(56, 189, 248, 0.15);
    }
    .content-area { padding: 5rem 1rem 1rem; width: 100vw; max-width: 100vw; overflow-x: hidden; }
    #floating-action-rail { top: 4.75rem; right: 0.75rem; gap: 0.5rem; }
    #floating-action-rail > button { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; }
    div.glass-panel { width: 100%; max-width: 100%; overflow-x: auto; box-sizing: border-box; } /* Aplica solo a contenedores, no a botones */
    .grid { grid-template-columns: 1fr; width: 100%; max-width: 100%; overflow-x: hidden; } /* Colapsar grids de metricas */
    
    /* Enforce tables to scroll inside their limits */
    table { display: block; width: 100%; max-width: 100%; overflow-x: auto; white-space: nowrap; }
    
    /* Ajustar Sortable lists en moviles para que no se compriman tanto */
    .flex.items-center.justify-between.p-4.rounded-xl { flex-direction: column; align-items: stretch; gap: 1rem; width: 100%; box-sizing: border-box; }
    
    .header-quick-actions { flex: 0 0 auto; min-width: auto; justify-content: flex-start; margin-top: 0.75rem; }
    .header-quick-actions > button { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; }
    .products-manager-header { align-items: flex-start; }
    .products-manager-title { font-size: 1.65rem; }
    .products-manager-actions { width: 100%; align-items: stretch; }
    .products-toolbar-row { align-items: stretch; }
    .products-toolbar-search { width: 100%; flex-basis: 100%; }
    .products-toolbar-actions { width: 100%; margin-left: 0; justify-content: stretch; }
    .products-toolbar-actions > button { flex: 1 1 12rem; justify-content: center; }
}
