:root {
    --primary: #774DC3;
    --primary-dark: #5e3bb1;
    --secondary: #a78bfa;
    --bg-color: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    width: 100%;
}

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

.responsive-grid {
    display: grid;
    gap: 1.5rem;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    transition: all 0.3s ease;
}

/* Sidebar Menu */
.sidebar-header {
    padding: 2.5rem 1.5rem 1.5rem;
    color: var(--secondary);
}

.menu-list {
    list-style: none;
    padding: 1rem;
}

.menu-section-label {
    font-size: 0.6125rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 1.5rem 1rem 0.5rem;
    font-weight: 700;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-section-label i {
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.menu-link:hover, .menu-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.menu-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--secondary);
}

.form-input option {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-block {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Modals & Popouts */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* Main Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    border: 1px solid var(--glass-border);
}

.hamburger-btn {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.hamburger-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        left: -260px;
    }
    .sidebar.open {
        left: 0;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem;
    }
    .hamburger-btn {
        display: flex;
    }
    .main-header {
        margin-bottom: 1.5rem;
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0.5rem;
        z-index: 100;
        background: rgba(30, 41, 59, 0.7);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    }
    .page-title {
        font-size: 1.25rem;
    }
    .user-name {
        display: none;
    }
    .mobile-close {
        display: block !important;
        position: absolute;
        top: 2rem;
        right: 1.5rem;
    }
}

/* Mobile Responsiveness Utilities */
.mobile-cards {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mobile-card, .glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-card:hover, .glass-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--secondary);
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .table-container, .table-wrapper {
        display: none !important;
    }
    .mobile-cards {
        display: flex !important;
    }
    
    .responsive-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stats-grid, .flagship-metrics {
        grid-template-columns: 1fr !important;
    }
}
