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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* LOGIN PAGE */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 20px;
}

.login-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
}

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

.login-header .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 16px;
    margin-bottom: 20px;
    color: #fff;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: #94a3b8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input::placeholder {
    color: #475569;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.login-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 4px;
}

.login-btn:hover {
    opacity: 0.9;
}

.login-btn:active {
    transform: scale(0.98);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #334155;
}

.login-footer p {
    font-size: 11px;
    color: #475569;
}

/* DASHBOARD */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 32px;
}

.logo-icon.small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 10px;
    color: #fff;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
}

.nav-links {
    list-style: none;
    flex: 1;
    padding: 0 12px;
}

.nav-links li {
    margin-bottom: 2px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-links li a:hover {
    background: #334155;
    color: #e2e8f0;
}

.nav-links li.active a {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.sidebar-footer {
    padding: 16px 24px 0;
    border-top: 1px solid #334155;
    margin-top: 16px;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid #334155;
    background: #1e293b;
}

.topbar h1 {
    font-size: 20px;
    font-weight: 600;
    color: #f1f5f9;
}

.teacher-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

.profile-id {
    font-size: 11px;
    color: #64748b;
}

.profile-role {
    font-size: 10px;
    color: #f59e0b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content {
    padding: 32px;
    flex: 1;
}

.welcome-card {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 28px;
    border: 1px solid #475569;
}

.welcome-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.welcome-card p {
    color: #94a3b8;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #1e293b;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #334155;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: #f59e0b;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 12px;
    color: #f59e0b;
    flex-shrink: 0;
}

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

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* KELAS PAGE */
.block-section {
    margin-bottom: 16px;
}

.block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #334155;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.block-header:hover {
    border-color: #f59e0b;
}

.block-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.block-name {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
}

.block-body {
    padding: 12px 0 4px 20px;
}

.tingkatan-section {
    margin-bottom: 8px;
}

.tingkatan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #334155;
    background: #1e293b;
}

.tingkatan-header:hover {
    border-color: #475569;
}

.tingkatan-header.green {
    border-left: 4px solid #22c55e;
}

.tingkatan-header.red {
    border-left: 4px solid #ef4444;
}

.tingkatan-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chevron {
    color: #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.chevron.small {
    color: #475569;
}

.tingkatan-name {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}

.tingkatan-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.tingkatan-badge.green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.tingkatan-badge.red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.kelas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 14px 0 14px 24px;
}

.class-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.class-card.green {
    border-color: #22c55e;
    background: linear-gradient(135deg, #1e293b 0%, #052e16 100%);
}

.class-card.red {
    border-color: #ef4444;
    background: linear-gradient(135deg, #1e293b 0%, #2e0505 100%);
}

.class-card.green .class-status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.class-card.red .class-status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.class-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 12px;
    right: 12px;
}

.class-name {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}

.class-status {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
}

.class-card.green .class-status {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.class-card.red .class-status {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #f1f5f9;
}

.modal-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f1f5f9;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #0f172a;
    border-radius: 10px;
}

.device-label {
    font-size: 15px;
    font-weight: 500;
    color: #e2e8f0;
    flex: 1;
}

.device-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.device-badge.green {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.device-badge.red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.device-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.device-text.green {
    color: #4ade80;
}

.device-text.red {
    color: #f87171;
}

/* ELEKTRIK PAGE */
.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.month-selector label {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

.month-selector select {
    padding: 8px 16px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.month-selector select:focus {
    outline: none;
    border-color: #f59e0b;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.chart-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 18px;
}

.chart-wrapper {
    position: relative;
    height: 350px;
}

.table-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 16px;
}

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

.usage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.usage-table th {
    text-align: left;
    padding: 10px 14px;
    color: #94a3b8;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

.usage-table td {
    padding: 10px 14px;
    color: #e2e8f0;
    border-bottom: 1px solid #1a2332;
}

.usage-table tbody tr:hover {
    background: rgba(245, 158, 11, 0.05);
}

.usage-table tfoot th {
    padding: 12px 14px;
    color: #f59e0b;
    border-top: 2px solid #f59e0b;
    border-bottom: none;
}

/* GAMIFIKASI PAGE */
.gami-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.gami-stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.gami-stat-icon {
    font-size: 28px;
}

.gami-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #f59e0b;
}

.gami-stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 16px;
}

.badge-section {
    margin-bottom: 28px;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.badge-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.3s;
}

.badge-card.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.badge-card.unlocked {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #1e293b, #2e1f05);
    opacity: 1;
    filter: none;
}

.badge-icon {
    font-size: 36px;
}

.badge-name {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

.badge-desc {
    font-size: 11px;
    color: #64748b;
}

@keyframes badgePop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.quiz-section {
    margin-bottom: 28px;
}

.quiz-progress {
    height: 6px;
    background: #334155;
    border-radius: 3px;
    margin-bottom: 18px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.quiz-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 28px;
}

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

.quiz-num {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.quiz-points {
    font-size: 12px;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.quiz-question {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 22px;
    line-height: 1.4;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.quiz-option:hover:not(:disabled) {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.quiz-option:disabled {
    cursor: not-allowed;
}

.quiz-option.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.quiz-option.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.quiz-option.correct .option-letter {
    background: #22c55e;
    color: #fff;
}

.quiz-option.wrong .option-letter {
    background: #ef4444;
    color: #fff;
}

.quiz-result {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 36px;
    text-align: center;
    display: none;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.result-text {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 20px;
}

.quiz-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.quiz-btn:hover {
    opacity: 0.9;
}

.quiz-selesai {
    text-align: center;
    padding: 20px;
}

.quiz-selesai h3 {
    font-size: 20px;
    color: #f1f5f9;
    margin: 12px 0 8px;
}

.quiz-selesai p {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 4px;
}

.leaderboard-section {
    margin-bottom: 24px;
}

.leaderboard {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    overflow: hidden;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #1a2332;
    gap: 14px;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row.top .rank {
    background: #f59e0b;
    color: #0f172a;
}

.rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.lb-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}

.lb-score {
    font-size: 13px;
    font-weight: 600;
    color: #f59e0b;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .gami-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .badge-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 16px 0;
    }
    .sidebar-header h2,
    .nav-links li span,
    .sidebar-footer {
        display: none;
    }
    .sidebar-header {
        padding: 0 10px;
        justify-content: center;
    }
    .nav-links {
        padding: 0 8px;
    }
    .nav-links li {
        justify-content: center;
        padding: 12px;
    }
    .content {
        padding: 20px;
    }
    .topbar {
        padding: 16px 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
