/* ============================================================
   DASHBOARD.CSS - Styling untuk Dashboard Guru & Orang Tua
   Designed by: Sari (UI/UX Designer)
   ============================================================ */

/* --- Layout --- */
.dashboard-page {
    min-height: 100vh;
    background: var(--bg-main);
    padding-bottom: 80px;
}

.dash-header {
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-500) 100%);
    color: white;
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.dash-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.dash-user-info h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: white;
}

.dash-user-info p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
}

.dash-logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s;
}

.dash-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-100);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--green-600);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    margin-top: 4px;
}

/* --- Section (Content Area) --- */
.dash-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-100);
}

.dash-section h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- History Table --- */
.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table th {
    background: var(--green-50);
    color: var(--green-700);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px;
    text-align: left;
    position: sticky;
    top: 0;
}

.history-table th:first-child {
    border-radius: 12px 0 0 0;
}

.history-table th:last-child {
    border-radius: 0 12px 0 0;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-700);
}

.history-table tr:hover td {
    background: var(--green-50);
}

/* --- Progress Bar (Subject Breakdown) --- */
.progress-item {
    margin-bottom: 14px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.progress-label span:first-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
}

.progress-label span:last-child {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-500);
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 1s ease;
}

/* --- Student Card (Teacher Dashboard) --- */
.student-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.student-card:hover {
    border-color: var(--green-300);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.1);
}

.student-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.student-meta h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--gray-800);
}

.student-meta p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 2px 0 0;
}

.student-score {
    text-align: center;
}

.student-score .score-val {
    font-size: 22px;
    font-weight: 900;
}

.student-score .score-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
}

.score-green {
    color: var(--green-600);
}

.score-gold {
    color: var(--gold);
}

.score-red {
    color: var(--red-text);
}

/* --- Tabs (Hari Ini / Riwayat / Analisa) --- */
.dash-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dash-tab {
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    transition: all 0.2s;
}

.dash-tab.active {
    background: var(--green-600);
    color: white;
    border-color: var(--green-600);
}

.dash-tab:hover:not(.active) {
    border-color: var(--green-400);
    color: var(--green-600);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dash-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-table {
        font-size: 12px;
    }

    .history-table td,
    .history-table th {
        padding: 8px;
    }
}