/* =========================================
   2. LAYOUT PRINCIPAL
   Este archivo define la estructura: Sidebar a la izquierda y Contenido a la derecha.
   ========================================= */

.app-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: background-color 0.3s ease, width 0.3s ease;
    z-index: 50;
    height: 100vh;
    height: 100svh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3rem;
    color: var(--primary);
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

/* Área Principal */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    width: 100%;
}

/* Responsive Overrides */
@media (max-width: 1280px) {
    .main-content {
        padding: 1.5rem;
    }
}

/* Paneles (Tabs) */
.tab-panel {
    display: none;
    /* Ocultos por defecto */
    animation: fadeIn 0.4s ease-out;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem 1rem;
    }

    .tab-panel {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 1rem;
    }

    .panel-header h1 {
        font-size: 1.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 99px;
    transition: background-color 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Visibilidad responsiva garantizada para Pedidos */
@media (min-width: 768px) {
    #orders-table-wrapper {
        display: block !important;
    }
    #orders-cards-container {
        display: none !important;
    }
}

@media (max-width: 767px) {
    #orders-table-wrapper {
        display: none !important;
    }
    #orders-cards-container {
        display: block !important;
    }
}