:root {
    /* =========================================
       COLOR PALETTE - PREMIUM MODERN
       ========================================= */
    /* Primary (Indigo) - Brand Identity */
    --primary-color: #4F46E5;
    /* Indigo 600 */
    --primary-light: #818CF8;
    /* Indigo 400 */
    --primary-dark: #3730A3;
    /* Indigo 800 */
    --primary-subtle: #EEF2FF;
    /* Indigo 50 */

    /* Secondary (Slate) - Backgrounds */
    --bg-main: #F8FAFC;
    /* Slate 50 */
    --bg-surface: #FFFFFF;
    /* White */
    --bg-subtle: #F1F5F9;
    /* Slate 100 */

    /* Typography Colors */
    --text-main: #1E293B;
    /* Slate 800 */
    --text-muted: #64748B;
    /* Slate 500 */
    --text-light: #94A3B8;
    /* Slate 400 */

    /* Functional Colors */
    --success: #10B981;
    /* Emerald 500 */
    --success-bg: #D1FAE5;
    /* Emerald 100 */
    --warning: #F59E0B;
    /* Amber 500 */
    --warning-bg: #FEF3C7;
    /* Amber 100 */
    --danger: #EF4444;
    /* Red 500 */
    --danger-bg: #FEE2E2;
    /* Red 100 */
    --info: #3B82F6;
    /* Blue 500 */

    /* =========================================
       GLASSMORPHISM TOKENS
       ========================================= */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --backdrop-blur: blur(16px);

    /* =========================================
       SPACING & RADIUS
       ========================================= */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;

    --header-height: 72px;
    --sidebar-width: 280px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
html {
    scroll-behavior: smooth;
    box-sizing: border-box;
    font-size: 16px;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

h3 {
    font-size: 1.5rem;
    line-height: 2rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.625;
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* =========================================
   UTILITIES
   ========================================= */
.d-flex {
    display: flex;
}

.flex-column {
    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;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.hidden {
    display: none !important;
}

/* =========================================
   COMPONENTS: BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(79, 70, 229, 0.35);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-light);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-surface);
}

/* =========================================
   COMPONENTS: CARDS (Glassmorphism)
   ========================================= */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

/* =========================================
   COMPONENTS: FORMS
   ========================================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* =========================================
   COMPONENTS: ALERTS / TOASTS
   ========================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out forwards;
    border-left: 4px solid var(--primary-color);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
}

/* =========================================
   LAYOUT: DASHBOARD
   ========================================= */
/* =========================================
   LAYOUT: DASHBOARD (Fixed Sidebar + Margin)
   ========================================= */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: #F1F5F9;
}

/* Sidebar - Fixed Position */
.sidebar {
    background: var(--bg-surface);
    border-right: 1px solid #E2E8F0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Main Content - Pushed by Sidebar */
.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 280px;
    /* Width of sidebar */
    width: calc(100% - 280px);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-subtle);
    color: var(--primary-color);
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mobile & Tablet Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        /* Hidden by default */
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
}