:root {
    --bg-gradient: linear-gradient(135deg, #1e053a 0%, #0f021f 100%);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(139, 92, 246, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #a78bfa;
    --accent-color: #8b5cf6;
    --accent-hover: #a78bfa;
    --danger-color: #ef4444;
    --success-color: #10b981;
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel, .glass-card, .glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}

.glass-panel:hover, .glass-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Auth Section */
#auth-section {
    margin-top: 15vh;
    padding: 50px 40px;
    text-align: center;
    width: 90%;
    max-width: 420px;
    animation: fadeIn 0.8s ease-out;
}

#auth-section h1 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 700;
    background: linear-gradient(to right, #c4b5fd, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#auth-section p {
    color: var(--text-secondary);
    margin-bottom: 35px;
    font-size: 15px;
}

/* Dashboard Section */
#dashboard-section {
    width: 100%;
    max-width: 1200px;
    padding: 30px 20px;
    animation: slideUp 0.6s ease-out;
}

.hidden {
    display: none !important;
}

/* Navbar */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin-bottom: 40px;
    border-radius: 16px;
}

.glass-nav h2 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.glass-nav h2 span {
    color: var(--accent-color);
    font-weight: 400;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

#admin-email {
    font-weight: 600;
    color: #c4b5fd;
}

/* Chart & Stats Section */
.top-section {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
}

.chart-container {
    flex: 2;
    padding: 25px;
    position: relative;
    min-height: 300px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header select {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}
.chart-header select:hover {
    border-color: var(--accent-color);
}
.chart-header select option {
    background: #1e053a;
}

.stats-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.stat-card {
    padding: 30px 25px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-weight: 600;
}

.stat-card p {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(to right, #c4b5fd, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Main Panel & Table */
.main-panel {
    padding: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

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

.hidden {
    display: none !important;
}

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

th, td {
    padding: 18px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tr {
    transition: all 0.3s ease;
}

tr:hover {
    background-color: rgba(139, 92, 246, 0.05);
    transform: scale(1.005);
}

/* Progress Bar */
.usage-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-top: 10px;
    overflow: hidden;
}

.usage-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
}

.usage-text {
    font-size: 13px;
    color: #c4b5fd;
    font-weight: 500;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    padding: 14px 28px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.secondary-btn {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 10px 20px;
}

.secondary-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.icon-btn {
    background: transparent;
    color: var(--accent-hover);
    padding: 10px 16px;
    border: 1px solid transparent;
}

.icon-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: white;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .top-section {
        flex-direction: column;
    }
}
