:root {
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 85px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    background-color: white;
    border-right: 1px solid var(--border-color);
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* Collapsed Desktop State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-name-text,
.sidebar.collapsed hr {
    display: none;
}

.sidebar.collapsed .nav-link {
    text-align: center;
    padding: 0.8rem;
    margin: 0.2rem auto;
    width: 50px;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .nav-link i {
    margin: 0 !important;
    font-size: 1.25rem;
}

/* Sidebar Nav */
.sidebar .nav-link {
    color: var(--text-muted);
    border-radius: 12px;
    margin: 2px 0;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: #f8fafc;
    color: var(--primary) !important;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

/* Gradients & Text */
.gradient-text {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-title {
    letter-spacing: -0.02em;
}

/* Premium Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.icon-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.icon-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.icon-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.icon-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Table Styling */
.table-premium {
    color: var(--text-main);
    background-color: transparent;
    border-collapse: separate;
    border-spacing: 0;
}

.table-premium th {
    background-color: rgba(0,0,0,0.03) !important;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}

.table-premium td {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    vertical-align: middle;
}

.table-premium tbody tr {
    transition: background-color 0.2s;
}

.table-premium tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-subtle-success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-subtle-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-subtle-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-subtle-primary { background-color: rgba(99, 102, 241, 0.1); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.2); }

/* Buttons */
.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s;
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, var(--primary-hover), #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

/* Alerts */
.premium-alert {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    border-radius: 12px;
    backdrop-filter: blur(8px);
}
.premium-alert.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Navbar */
.top-navbar {
    height: 70px;
    z-index: 1040;
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
        z-index: 2000;
        height: 100vh;
    }
    
    .sidebar.mobile-show {
        left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        min-width: 0; /* Fix flexbox overflow */
    }

    .content-body {
        padding: 1rem !important;
    }

    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.1rem; }

    .glass-card {
        padding: 1.25rem !important;
        border-radius: 12px;
    }

    .top-navbar {
        padding: 0.75rem 1rem !important;
    }
}

@media (min-width: 992px) {
    .sidebar.collapsed + .main-wrapper {
        margin-left: 0;
    }
}

/* Content Transitions */
.content-body {
    background-color: var(--bg-body);
}

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-slide-down { animation: slideDown 0.3s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.2s ease-out forwards; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
