:root {
    --bg-dark: #0f172a;
    --sidebar-bg: #111827;
    --card-bg: #1e293b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --table-header-bg: rgba(51, 65, 85, 0.5);
}
 
body.light-mode {
    --bg-dark: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-hover: rgba(0, 0, 0, 0.03);
    --table-header-bg: #f1f5f9;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px; 
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem; /* More compact padding */
    border-radius: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border-left: 3px solid var(--accent-purple);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    flex-grow: 1;
    padding: 3rem 4rem; /* More generous horizontal padding */
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.05), transparent 40%);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Tables */
.table-container {
    background-color: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    background-color: var(--table-header-bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-received { background-color: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-preparation { background-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-shipped { background-color: rgba(16, 185, 129, 0.2); color: #34d399; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

input, select, textarea {
    width: 100%;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Responsive Utilities */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10001;
    background: var(--accent-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Media Queries */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 4rem 1rem 2rem 1rem !important;
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    header div[style*="gap: 1rem"] {
        justify-content: space-between;
    }

    header input[placeholder="Buscar..."] {
        width: 100% !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch !important;
    }

    .filter-container button {
        width: 100%;
        justify-content: center;
    }
}
@media (max-width: 576px) { [style*='padding: 2rem'] { padding: 1.25rem !important; } h1 { font-size: 1.25rem !important; } h2, h3 { font-size: 1rem !important; } }

.product-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; } @media (max-width: 768px) { .product-form-grid { grid-template-columns: 1fr; gap: 1rem; } .form-group { margin-bottom: 0.5rem !important; } }

.form-group label { display: block; min-height: 1.2rem; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); } .product-form-grid .form-group { align-self: start; }

@media (max-width: 768px) { .grid-col-mobile-1 { grid-column: span 2 !important; } .modern-form input, .modern-form select { font-size: 16px !important; } }

@media (max-width: 576px) { .action-buttons-container { flex-direction: column !important; } .action-buttons-container button { width: 100% !important; height: 50px !important; } h3 { font-size: 1rem !important; } }
