:root {
    --primary: #1a56db;
    --primary-light: #ebf5ff;
    --primary-hover: #1e40af;
    --success: #057a55;
    --warning: #d97706;
    --danger: #dc2626;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #1a56db;
    --sidebar-active-bg: rgba(26, 86, 219, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --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);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; }

/* UTILITIES */
.container { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1.5rem; border: 1px solid var(--border); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* TYPOGRAPHY */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-weight: 500; transition: all 0.2s ease; gap: 0.5rem; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-color); }
.btn-danger { background: var(--danger); color: white; }

/* FORMS */
.form-group { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-weight: 500; font-size: 0.875rem; color: var(--text-main); }
.form-control { width: 100%; padding: 0.625rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-main); transition: border-color 0.2s, box-shadow 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* AUTH LAYOUT */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg-color) 0%, #e2e8f0 100%); padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-header { padding: 2rem 2rem 1rem; text-align: center; }
.auth-header h1 { color: var(--primary); font-size: 1.75rem; margin-bottom: 0.5rem; }
.auth-body { padding: 1rem 2rem 2rem; }

/* ALERTS */
.alert { padding: 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.alert-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* RESPONSIVE UTILITIES */
.flex-wrap { flex-wrap: wrap; }
.hidden-mobile { display: block; }
.visible-mobile { display: none !important; }

@media (max-width: 768px) {
    .hidden-mobile { display: none !important; }
    .visible-mobile { display: block !important; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .page-header > div { width: 100%; }
    .container { padding: 1rem; }
}

.product-details-grid, .dashboard-grid, .grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .product-details-grid, .dashboard-grid, .grid-2-1, .grid-1-2, .grid-2 {
        grid-template-columns: 1fr;
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

#mobileMenuToggle {
    display: none !important;
}

@media (max-width: 768px) {
    #mobileMenuToggle {
        display: inline-flex !important;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive table {
    min-width: 600px; /* Force scroll instead of squeezing columns */
}

/* For larger tables, we might need even more width */
.table-responsive table.w-full {
    min-width: 800px;
}

.nowrap {
    white-space: nowrap !important;
}

/* PAGINATION */
.pagination { display: flex; gap: 0.5rem; justify-content: center; align-items: center; margin-top: 1rem; }
.page-link { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font-weight: 500; transition: all 0.2s ease; text-decoration: none; }
.page-link:hover { background: var(--bg-color); border-color: var(--primary); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); color: white; border-color: var(--primary); }
.page-item.disabled .page-link { color: var(--text-muted); cursor: not-allowed; background: var(--bg-color); }
.page-item { list-style: none; }
