:root {
    --primary: #6C63FF;
    --secondary: #24243e;
    --accent: #00cec9;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #b2bec3;
    --success: #00b894;
    --danger: #d63031;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #1e1e2f;
    color: var(--text-main);
    min-height: 100vh;
}

/* --- GLASSMORPHISM COMPONENTS --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-header {
    background: rgba(30, 30, 47, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
}

/* --- LAYOUT UTILS --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* --- NAVIGATION --- */
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    transition: 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

/* Mobile Nav Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(30, 30, 47, 0.98);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--glass-border);
        transform: translateY(-150%);
        transition: 0.3s;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
    }
}

/* --- BUTTONS & FORMS --- */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #5a52d5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 15px;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    /* Space from top */
    overflow-y: auto;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-content {
    background: #24243e;
    /* Solid background for modal content to prevent transparency issues */
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

/* --- TABS --- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 15px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 8px;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* --- UTILS --- */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-purple {
    background: rgba(108, 99, 255, 0.2);
    color: #a29bfe;
}

.badge-green {
    background: rgba(0, 184, 148, 0.2);
    color: #55efc4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: fadeIn 0.3s forwards;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- ADMIN DASHBOARD LAYOUT --- */
:root {
    --sidebar-width: 260px;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(30, 30, 47, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 30px;
    transition: margin-right 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

.nav-item {
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    padding: 15px;
    text-align: right;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        width: 100%;
    }

    .menu-toggle {
        display: block !important;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1000;
        background: var(--primary);
        padding: 10px;
        border-radius: 8px;
    }
}