/* ═══ Dashboard & Onboarding Styles ═══ */

/* ─── Onboarding ─── */
.onboarding-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.onboarding-card {
    width: 100%;
    max-width: 580px;
    padding: 48px;
}

.onboarding-card .ob-header {
    text-align: center;
    margin-bottom: 36px;
}

.onboarding-card .ob-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.onboarding-card .ob-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.ob-step {
    display: none;
}

.ob-step.active {
    display: block;
}

.ob-step h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ob-step h2 .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-button);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.ob-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.ob-progress .prog-dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    transition: background 0.3s;
}

.ob-progress .prog-dot.active {
    background: var(--gradient-button);
}

.ob-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.ob-actions .btn-primary,
.ob-actions .btn-secondary {
    flex: 1;
    justify-content: center;
}

/* ─── Dashboard Layout ─── */
.dash-layout {
    display: block;
    min-height: 100vh;
}

.dash-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: 24px 0;
    position: fixed;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.dash-sidebar .sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.dash-sidebar .sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.dash-sidebar .sidebar-logo .logo-text {
    font-size: 1.05rem;
}

.dash-nav {
    list-style: none;
    padding: 0 12px;
}

.dash-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.dash-nav li a:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.dash-nav li a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 600;
}

.dash-nav li a .nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.dash-profile-card {
    margin: 16px 12px 0;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.dash-profile-card .profile-name {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.dash-profile-card .profile-exam {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.dash-main {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.dash-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
}

.dash-header .greeting {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* ─── Stats Cards ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
    word-break: break-word;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── AGM Card (At-A-Glance Module) ─── */
.agm-card {
    padding: 32px;
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.agm-left h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.agm-exam-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.agm-mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.agm-mini-stat {
    padding: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.agm-mini-stat .mini-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.agm-mini-stat .mini-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.agm-right h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ─── Category Bars ─── */
.cat-bar-item {
    margin-bottom: 14px;
}

.cat-bar-item .cb-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.cat-bar-item .cb-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: capitalize;
}

.cat-bar-item .cb-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.cat-bar-item .cb-track {
    height: 7px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.cat-bar-item .cb-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gradient-button);
    transition: width 1s ease;
}

/* ─── Recent Sessions Table ─── */
.recent-section {
    margin-bottom: 28px;
}

.recent-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-item {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    cursor: pointer;
}

.session-item:hover {
    border-color: var(--border-accent);
}

.session-item .si-grade {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.session-item .si-grade.good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

.session-item .si-grade.avg {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}

.session-item .si-grade.poor {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
}

.session-item .si-info {
    flex: 1;
}

.session-item .si-info .si-exam {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.session-item .si-info .si-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.session-item .si-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* ─── Pre-Interview Page ─── */
.pre-interview-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.pre-card {
    width: 100%;
    max-width: 640px;
    padding: 48px;
}

.pre-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.pre-card .pre-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.92rem;
}

.device-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.check-item.passed {
    border-color: rgba(16, 185, 129, 0.3);
}

.check-item.failed {
    border-color: rgba(244, 63, 94, 0.3);
}

.check-item .check-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.check-item.passed .check-icon {
    background: rgba(16, 185, 129, 0.15);
}

.check-item.failed .check-icon {
    background: rgba(244, 63, 94, 0.15);
}

.check-item .check-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.check-item .check-info p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.check-item .check-status {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.check-item.passed .check-status {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

.check-item.failed .check-status {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
}

.check-item .check-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}

.pre-instructions {
    padding: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
}

.pre-instructions h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pre-instructions ul {
    list-style: none;
    padding: 0;
}

.pre-instructions li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.pre-instructions li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-emerald);
    font-weight: 700;
}

.pre-video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
}

.pre-video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── History Page ─── */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.history-card {
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.hc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.hc-grade {
    font-size: 1.4rem;
    font-weight: 900;
}

.hc-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.hc-exam {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.hc-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.hc-stats span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.hc-stats span strong {
    color: var(--text-secondary);
}

/* ─── Enhanced Interview Phases ─── */
.phase-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .dash-layout {
        grid-template-columns: 1fr;
    }

    .dash-sidebar {
        display: none;
    }

    .dash-main {
        margin-left: 0;
        padding: 20px;
    }

    .agm-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dash-header h1 {
        font-size: 1.4rem;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 10px;
    }

    .agm-card {
        padding: 20px;
    }

    .agm-mini-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .agm-mini-stat .mini-val {
        font-size: 1rem;
    }

    .history-grid {
        grid-template-columns: 1fr;
    }

    .session-item {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .dash-main {
        padding: 14px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .stat-card .stat-label {
        font-size: 0.68rem;
    }

    .agm-card {
        padding: 16px;
    }

    .agm-mini-stats {
        gap: 6px;
    }
}