:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #a855f7;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #22d3ee;
    --danger: #ef4444;
    --success: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

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

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

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-link.active {
    border-left: 4px solid var(--primary);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Responsive Grids */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .form-grid > div[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }
}

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

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

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

.form-control:focus {
    border-color: var(--primary);
}

select.form-control option {
    background-color: white;
    color: #1e293b; /* Dark color for readability */
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

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

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

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

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

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    justify-content: center;
}

.pagination li a, .pagination li span {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s;
}

.pagination li.active span {
    background: var(--primary);
    border-color: var(--primary);
}

.pagination li.disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Media Queries for Responsiveness */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    body {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
        min-width: 0;
    }

    .mobile-nav {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: var(--bg-card);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--glass-border);
        position: sticky;
        top: 0;
        z-index: 900;
        margin-bottom: 1.5rem;
        border-radius: 0 0 1rem 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Sidebar Toggle Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 950;
}

.overlay.active {
    display: block;
}

.mobile-nav {
    display: none;
}

/* Typography Scale */
@media (max-width: 640px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.25rem !important;
    }
}
