:root {
    --sidebar-width: 260px;
    --primary-color: #6366f1;
    --secondary-color: #4f46e5;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
}

/* Sidebar */
.sidebar {
    height: 95vh;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    color: white;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-link {
    padding: 12px 16px;
    text-decoration: none;
    color: #94a3b8;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link:hover {
    background: #1e293b;
    color: white;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Sidebar Dropdown & Submenu */
.sidebar-dropdown {
    display: flex;
    flex-direction: column;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    outline: none;
}

.dropdown-icon {
    font-size: 0.7rem;
    color: #475569;
    transition: transform 0.3s;
    margin-left: auto;
}

.sidebar-dropdown.open .dropdown-icon {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-left: 15px;
    margin-top: 5px;
}

.sidebar-dropdown.open .submenu {
    display: flex;
}

.submenu .nav-link {
    font-size: 0.85rem;
    padding: 10px 15px;
    color: #64748b;
}

.submenu .nav-link:hover {
    color: white;
    background: #1e293b;
}

.submenu .nav-link.active {
    color: white;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: none;
}

/* Main Content area offset */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.user-section {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid #1e293b;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-email {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    padding-left: 10px;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Page Content */
.content {
    padding: 30px;
    flex: 1;
}

.page-title {
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 1.5rem;
}

/* Cards & Layout */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h1,
.card-header h2,
.card-header h3 {
    margin: 0;
    font-weight: 700;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

th {
    text-align: left;
    padding: 12px 15px;
    background: #0f172a;
    color: #94a3b8;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: #4f46e5;
}

/* Badges & Text Utilities */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-vendor {
    background: #312e81;
    color: #c7d2fe;
}

.price-text {
    color: var(--success-color);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #475569;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #0f172a;
    color: white;
}

.form-control:focus {
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #64748b;
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-outline {
    background: white;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

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

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
}

.stat-card.primary {
    border-left: 4px solid var(--primary-color);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card.success {
    border-left: 4px solid var(--success-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* SKU List in Tables */
.sku-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sku-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px solid #f8fafc;
    padding-bottom: 2px;
}

.sku-label {
    color: #4f46e5;
}

.sku-qty {
    font-weight: 600;
    color: #1e293b;
}

/* Variation Row in Forms */
.variation-row {
    display: flex;
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    align-items: flex-end;
}

/* Responsive */
@media (max-width: 1100px) {
    :root {
        --sidebar-width: 80px;
    }

    .sidebar-brand,
    .nav-link span:not(:first-child),
    .user-email {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 15px;
    }

    .sidebar {
        padding: 20px 10px;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 15px;
        flex-direction: column;
        z-index: 1001;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        width: 100%;
        gap: 5px;
    }

    .nav-link {
        white-space: nowrap;
        padding: 10px 15px;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .user-section {
        display: none;
    }
}