:root {
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.2);
    --secondary: #6366f1;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.2);
    
    /* Backgrounds & Surfaces */
    --bg-deep: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #f8fafc;
    
    /* Text */
    --text-white: #000000;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    
    /* Layout & Borders */
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.1);
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    
    /* Effects */
    --glass: blur(20px) saturate(180%) rgba(255, 255, 255, 0.7);
    --shadow-main: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 50%);
    color: var(--text-white);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Layout Classes */
.app-container {
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #0f172a, #64748b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.3s ease;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-dim);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(59, 130, 246, 0.05);
    color: var(--primary);
}

.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.sidebar.collapsed .logo-container {
    justify-content: center;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .chevron-icon {
    display: none;
    opacity: 0;
}

.sidebar.collapsed .nav-item a {
    justify-content: center;
    padding: 12px;
}

/* Navigation */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item.active a,
.nav-item a:hover {
    background: rgba(59, 130, 246, 0.05);
    color: var(--primary);
}

.nav-item.active a {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
    padding-left: 13px; /* account for border */
}

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

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between !important;
}

.dropdown-trigger .nav-link-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-item-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    margin-top: 4px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    padding-left: 1.5rem;
}

.nav-item-dropdown.open .submenu {
    max-height: 200px; /* Adjust as needed */
}

.submenu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.submenu-item.active a,
.submenu-item a:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.submenu-item.active a {
    font-weight: 600;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.08);
}

/* Stats */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-white);
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Table */
.table-container {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-white);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(59, 130, 246, 0.02);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
    filter: brightness(1.1);
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
        padding: 2rem 1rem;
    }
    .logo-text, .nav-text {
        display: none;
    }
    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu {
        flex-direction: row;
        gap: 15px;
    }
    .logo-container {
        margin-bottom: 0;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: all 0.3s ease;
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-white);
}

.toast.success { border-left: 4px solid var(--accent); border-color: rgba(16, 185, 129, 0.2); }
.toast.error { border-left: 4px solid #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.toast.info { border-left: 4px solid var(--primary); border-color: rgba(59, 130, 246, 0.2); }

.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: #ef4444; }
.toast.info .toast-icon { color: var(--primary); }

.toast.hiding {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(100%) scale(0.9); opacity: 0; }
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

