*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #0d0d14;
    --surface: #13131f;
    --surface2: #1c1c2e;
    --border: #2a2a3e;
    --accent: #b8f53e;
    --accent-dim: #8bc430;
    --text: #f0f0f5;
    --text-muted: #8888a0;
    --text-dim: #55556a;
    --radius: 12px;
    --danger: #f54e4e;
    --warning: #f5a623;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
h1, h2, h3, h4 { font-family: 'Sora', sans-serif; }

/* Top Navigation */
.topnav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 0 32px;
    height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(13,13,20,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-logo {
    font-family: 'Sora', sans-serif;
    font-weight: 700; font-size: 18px;
    color: var(--text); text-decoration: none;
    letter-spacing: -0.5px;
}
.nav-logo span { color: var(--accent); }
.nav-tabs { display: flex; gap: 4px; }
.tab {
    background: none; border: none; color: var(--text-muted);
    padding: 8px 16px; border-radius: 8px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all 0.2s;
}
.tab:hover { color: var(--text); background: var(--surface2); }
.tab.active { color: var(--accent); background: rgba(184,245,62,0.08); }
.nav-user { display: flex; align-items: center; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--accent);
}

/* Main content */
main {
    padding: 88px 32px 32px;
    max-width: 1280px; margin: 0 auto;
}

/* Stats Header */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.stat-card .label {
    font-size: 13px; color: var(--text-muted); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-card .value {
    font-family: 'Sora', sans-serif;
    font-size: 28px; font-weight: 700;
}
.stat-card .value.accent { color: var(--accent); }
.stat-card .sub {
    font-size: 12px; color: var(--text-dim); margin-top: 4px;
}

/* Section headers */
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.section-header h2 { font-size: 20px; font-weight: 600; }
.btn-add {
    background: var(--accent); color: #0d0d14;
    border: none; padding: 10px 20px; border-radius: 8px;
    font-weight: 600; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.btn-add:hover { background: var(--accent-dim); transform: translateY(-1px); }

/* Alert Banner */
.alert-banner {
    background: rgba(245,78,78,0.08); border: 1px solid rgba(245,78,78,0.2);
    border-radius: var(--radius); padding: 16px 20px;
    margin-bottom: 24px; display: flex; align-items: center; gap: 12px;
}
.alert-banner .alert-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(245,78,78,0.15); display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.alert-banner .alert-text { flex: 1; }
.alert-banner .alert-text strong { color: var(--danger); font-size: 14px; }
.alert-banner .alert-text p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.alert-banner .alert-action {
    background: none; border: 1px solid rgba(245,78,78,0.3);
    color: var(--danger); padding: 8px 14px; border-radius: 6px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.2s;
}
.alert-banner .alert-action:hover { background: rgba(245,78,78,0.1); }

/* Table */
.table-container {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 32px;
}
table {
    width: 100%; border-collapse: collapse;
}
th {
    text-align: left; padding: 14px 20px;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); background: var(--surface2);
    border-bottom: 1px solid var(--border);
}
td {
    padding: 14px 20px; font-size: 14px;
    border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(184,245,62,0.02); }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500;
}
.badge-active { background: rgba(184,245,62,0.1); color: var(--accent); }
.badge-at-risk { background: rgba(245,78,78,0.1); color: var(--danger); }
.badge-tier-basic { background: var(--surface2); color: var(--text-muted); }
.badge-tier-premium { background: rgba(184,245,62,0.06); color: var(--accent-dim); }
.badge-tier-unlimited { background: rgba(184,245,62,0.12); color: var(--accent); }

/* Class cards */
.class-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.class-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    transition: all 0.2s;
}
.class-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.class-card .class-time {
    font-family: 'Sora', sans-serif; font-size: 13px;
    color: var(--accent); font-weight: 600; margin-bottom: 6px;
}
.class-card .class-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.class-card .class-instructor { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.class-card .class-spots {
    display: flex; align-items: center; justify-content: space-between;
}
.class-card .spots-bar {
    flex: 1; height: 4px; background: var(--surface2);
    border-radius: 2px; margin-right: 12px; overflow: hidden;
}
.class-card .spots-bar .fill {
    height: 100%; border-radius: 2px;
    background: var(--accent); transition: width 0.3s;
}
.class-card .spots-bar .fill.full { background: var(--danger); }
.class-card .spots-text { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Action buttons in table */
.action-btn {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 6px 12px; border-radius: 6px; font-size: 12px;
    cursor: pointer; transition: all 0.2s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; width: 100%; max-width: 520px;
    padding: 32px; animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.modal-header h3 { font-size: 20px; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 24px; cursor: pointer; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group:first-child { grid-column: 1 / -1; }
.form-group label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-group input,
.form-group select {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 14px; color: var(--text);
    font-size: 14px; font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
    outline: none; border-color: var(--accent);
}
.form-group input::placeholder { color: var(--text-dim); }
.form-actions {
    display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px;
}
.btn-cancel {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
}
.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }
.btn-submit {
    background: var(--accent); color: #0d0d14; border: none;
    padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-submit:hover { background: var(--accent-dim); }

/* Responsive */
@media (max-width: 768px) {
    .topnav { padding: 0 16px; }
    .nav-tabs { gap: 2px; }
    .tab { padding: 6px 10px; font-size: 13px; }
    main { padding: 80px 16px 24px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .table-container { overflow-x: auto; }
    table { min-width: 600px; }
    .form-grid { grid-template-columns: 1fr; }
    .class-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
