:root {
    /* Color Palette - Premium Dark/Light Theme compatible base */
    --primary-color: #2563eb; /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b; /* Slate */
    --accent-color: #0ea5e9; /* Sky Blue */
    
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #0f172a; /* Dark Slate */
    
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --text-on-dark: #f1f5f9;
    
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --status-ordered: #64748b;
    --status-production: #eab308;
    --status-transit: #3b82f6;
    --status-customs: #f97316;
    --status-released: #22c55e;
    --status-warehouse: #15803d;

    /* Spacing & Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    
    --font-sans: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: 0;
}

.sidebar.collapsed {
    margin-left: -260px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.logo-icon {
    color: var(--accent-color);
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 1rem;
    padding-right: 4px; /* Evita que el scrollbar se pegue al texto */
}

/* Custom Scrollbar for Nav Menu (Chrome/Edge/Safari) */
.nav-menu::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #94a3b8;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.nav-item .material-icons-round {
    font-size: 1.25rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-body);
}

.top-bar {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

#page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.view-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilities */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}
