:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --sidebar-width: 260px;
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-light);
    min-height: 100vh;
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(
        135deg,
        var(--primary-light) 0%,
        var(--secondary-color) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check label {
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

.btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-secondary {
    background: var(--dark-card);
    color: var(--text-light);
    border: 1px solid var(--dark-border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-light);
}

.mobile-menu-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--dark-border);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--dark-border);
    margin-bottom: 24px;
}

.sidebar-brand h2 {
    font-size: 24px;
    background: linear-gradient(
        135deg,
        var(--primary-light) 0%,
        var(--secondary-color) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    list-style: none;
    padding: 0 12px;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

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

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.sidebar-nav svg {
    width: 20px;
    height: 20px;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    width: calc(100% - var(--sidebar-width));
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dark-border);
    flex-wrap: wrap;
    gap: 16px;
}

.card-header .btn {
    white-space: nowrap;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.1) 0%,
        rgba(139, 92, 246, 0.1) 100%
    );
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(
        135deg,
        var(--primary-light) 0%,
        var(--secondary-color) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.table-responsive {
    overflow-x: auto;
}

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

table thead {
    background: rgba(15, 23, 42, 0.6);
}

table thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--dark-border);
}

table tbody tr {
    border-bottom: 1px solid var(--dark-border);
    transition: background 0.2s ease;
}

table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

table tbody td {
    padding: 16px;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.btn-group {
    display: flex;
    gap: 6px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    list-style: none;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

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

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.search-box input[type="text"] {
    flex: 3;
    max-width: 500px;
    min-width: 250px;
}

.search-box select {
    flex: 1;
    max-width: 180px;
}

.search-box .btn {
    flex: 0 0 auto;
    min-width: 90px;
}

/* Button utilities */
.btn-full-width {
    width: 100%;
}

.btn-auto {
    width: auto;
}

/* Responsive */
@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Show sidebar overlay when active */
    .sidebar-overlay.show {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 80px; /* Space for mobile menu button */
    }

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

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-header .btn {
        width: 100%;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input[type="text"],
    .search-box select,
    .search-box .btn {
        width: 100%;
        max-width: none;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* Make tables scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
