/* ========== Global ========== */
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;
}

/* ========== Login Page ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 50%, #1565c0 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.login-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 2rem;
    color: #fff;
}

.login-header h2 {
    color: #1a73e8;
    font-weight: 700;
    margin-bottom: 5px;
}

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

/* ========== Admin Layout ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background: linear-gradient(180deg, #1a237e 0%, #0d47a1 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header i {
    font-size: 1.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav li.active a {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left: 3px solid #64b5f6;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.admin-main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: #fff;
    padding: 15px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-content {
    padding: 25px;
    flex: 1;
}

/* ========== Stats Cards ========== */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.85;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-info p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

/* ========== Exam Card ========== */
.exam-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.exam-meta p {
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #555;
}

.exam-meta i {
    width: 18px;
    color: #1a73e8;
}

.exam-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px;
}

/* ========== Student Navbar ========== */
.student-navbar {
    background: linear-gradient(135deg, #1a73e8, #0d47a1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* ========== Tables ========== */
.table th {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ========== Cards ========== */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========== User Avatar ========== */
.user-avatar {
    width: 48px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: box-shadow 0.2s;
}

.user-avatar:hover {
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.35);
}

.user-avatar-placeholder {
    width: 48px;
    height: 60px;
    border-radius: 6px;
    border: 2px dashed #ccc;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 1.5rem;
}

/* ========== Score Display ========== */
.score-display {
    padding: 20px 0;
}

/* ========== Modals ========== */
.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
}

/* ========== Buttons ========== */
.btn-primary {
    background: #1a73e8;
    border-color: #1a73e8;
}

.btn-primary:hover {
    background: #1557b0;
    border-color: #1557b0;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }
    .admin-main {
        margin-left: 0;
    }
    .exam-layout {
        flex-direction: column;
    }
    .exam-right {
        width: 100% !important;
        min-width: 100% !important;
    }
}
