
:root {
    --mau-chinh: #b30000;
    --mau-chinh-dam: #7d0000;
    --mau-chinh-nhat: #d61f1f;
    --mau-phu: #d4af37;
    --mau-phu-nhat: #f3d97a;
    --nen: #f6f1e7;
    --nen-dam: #efe7d6;
    --trang: #ffffff;
    --chu: #241a16;
    --chu-nhat: #6b5d54;
    --vien: #e3d9c6;
    --xanh-thanh-cong: #1c7a44;
    --xanh-thanh-cong-nen: #e8f5ee;
    --do-loi: #b30000;
    --do-loi-nen: #fdecec;
    --ban-kinh: 12px;
    --bong: 0 10px 30px rgba(80, 32, 10, 0.10);
    --bong-nhe: 0 4px 14px rgba(80, 32, 10, 0.07);
    --font-chinh: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-tieu-de: "Times New Roman", "Cambria", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-chinh);
    font-size: 16px;
    line-height: 1.65;
    color: var(--chu);
    background: var(--nen);
    background-image: url("../images/bg_giay.jpg");
    background-size: 900px auto;
}

img { max-width: 100%; display: block; }
a { color: var(--mau-chinh); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-tieu-de);
    color: var(--mau-chinh-dam);
    line-height: 1.28;
    margin: 0 0 12px;
}

p { margin: 0 0 14px; }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.topbar {
    background: linear-gradient(90deg, #6e0000, var(--mau-chinh) 55%, #8f1010);
    border-bottom: 3px solid var(--mau-phu);
    color: #fff;
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}
.brand-mini:hover { text-decoration: none; }
.brand-mini img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    border: 2px solid var(--mau-phu);
    flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-line-1 { font-size: 12px; letter-spacing: 2px; font-weight: 700; color: var(--mau-phu-nhat); }
.brand-line-2 { font-size: 15px; letter-spacing: 1.5px; font-weight: 700; }
.topbar-title {
    font-size: 13px;
    letter-spacing: 1.2px;
    font-weight: 600;
    text-align: right;
    text-transform: uppercase;
    color: #ffe9b8;
}

.main-nav {
    background: var(--trang);
    border-bottom: 1px solid var(--vien);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.main-nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--chu);
    font-weight: 600;
    font-size: 15px;
    border-bottom: 3px solid transparent;
    text-decoration: none;
}
.nav-link:hover { color: var(--mau-chinh); text-decoration: none; }
.nav-link.active { color: var(--mau-chinh); border-bottom-color: var(--mau-chinh); }
.nav-cta {
    background: var(--mau-chinh);
    color: #fff;
    border-bottom: none;
    border-radius: 6px;
    margin-left: 6px;
    padding: 8px 16px;
    align-self: center;
}
.nav-cta:hover, .nav-cta.active { color: #fff; background: var(--mau-chinh-dam); }
.nav-user {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--chu-nhat);
}
.nav-user-name { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { padding: 14px 10px; color: var(--chu-nhat); font-weight: 500; }

.site-main { min-height: 60vh; }

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: #5c0a0a url("../images/cong_hvct.jpg") center 32% / cover no-repeat;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(72, 0, 0, 0.94) 0%, rgba(120, 8, 8, 0.82) 45%, rgba(60, 10, 7, 0.42) 100%);
}
.hero-inner {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 20px 60px;
    display: flex;
    align-items: center;
    gap: 36px;
}
.hero-logo {
    width: 168px;
    height: 168px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
.hero-kicker {
    font-size: 14px;
    letter-spacing: 5px;
    font-weight: 700;
    color: var(--mau-phu-nhat);
    margin-bottom: 6px;
}
.hero-sub {
    font-family: var(--font-tieu-de);
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 700;
    letter-spacing: 3px;
    color: #ffe9b8;
    margin-bottom: 14px;
}
.hero-title {
    font-family: var(--font-tieu-de);
    font-size: clamp(30px, 4.6vw, 50px);
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    margin: 0 0 16px;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}
.hero-desc {
    max-width: 620px;
    color: #f6e6cf;
    font-size: 16px;
    margin-bottom: 22px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta span {
    border: 1px solid rgba(255, 232, 180, 0.5);
    background: rgba(0, 0, 0, 0.22);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 20px;
    font-family: var(--font-chinh);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--mau-chinh); color: #fff; box-shadow: 0 6px 16px rgba(179, 0, 0, 0.25); }
.btn-primary:hover { background: var(--mau-chinh-dam); color: #fff; }
.btn-gold { background: linear-gradient(180deg, var(--mau-phu-nhat), var(--mau-phu)); color: #4a3000; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.btn-gold:hover { color: #3a2500; }
.btn-outline { background: transparent; color: var(--mau-chinh); border-color: var(--mau-chinh); }
.btn-outline:hover { background: rgba(179, 0, 0, 0.06); }
.btn-light { background: #fff; color: var(--mau-chinh); border-color: #fff; }
.btn-light:hover { color: var(--mau-chinh-dam); }
.btn-ghost-light { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.65); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #a31515; color: #fff; }
.btn-muted { background: #efe7d6; color: #5a4a3c; border-color: #ddd1bb; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.section { padding: 54px 0; }
.section-alt { background: rgba(255, 255, 255, 0.72); border-top: 1px solid var(--vien); border-bottom: 1px solid var(--vien); }
.section-head { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.section-kicker {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 12px;
    font-weight: 800;
    color: var(--mau-chinh);
    margin-bottom: 8px;
}
.section-title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 10px; }
.section-sub { color: var(--chu-nhat); margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.feature-card {
    background: #fff;
    border: 1px solid var(--vien);
    border-top: 4px solid var(--mau-phu);
    border-radius: var(--ban-kinh);
    padding: 24px;
    box-shadow: var(--bong-nhe);
}
.feature-card h3 { font-size: 19px; margin-bottom: 8px; }
.feature-card p { color: var(--chu-nhat); font-size: 15px; margin: 0; }
.feature-icon {
    width: 46px; height: 46px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #fdf6e4, #f6e6bd);
    color: var(--mau-chinh-dam);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 14px;
}

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step {
    position: relative;
    background: #fff;
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    padding: 22px 20px 20px;
    box-shadow: var(--bong-nhe);
}
.step-num {
    position: absolute;
    top: -14px; left: 18px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--mau-chinh);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 15px;
    border: 3px solid var(--nen);
}
.step h3 { font-size: 17px; margin: 6px 0 6px; }
.step p { margin: 0; color: var(--chu-nhat); font-size: 14.5px; }

.notice-box {
    background: linear-gradient(180deg, #fff9ea, #fdf1d8);
    border: 1px solid #ecd49a;
    border-left: 5px solid var(--mau-phu);
    border-radius: var(--ban-kinh);
    padding: 20px 22px;
}
.notice-box h3 { font-size: 18px; margin-bottom: 8px; color: #6b4a00; }
.notice-box ul { margin: 0; padding-left: 20px; color: #5d4a2b; }
.notice-box li { margin-bottom: 6px; }

.cta-band {
    background: linear-gradient(115deg, var(--mau-chinh-dam), var(--mau-chinh) 60%, #9a1414);
    color: #fff;
    padding: 42px 0;
    border-top: 3px solid var(--mau-phu);
}
.cta-band-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: 26px; margin-bottom: 6px; }
.cta-band p { color: #ffe9c0; margin: 0; }

.site-footer {
    background: #2a1411;
    color: #e8dcc8;
    padding: 30px 0;
    border-top: 3px solid var(--mau-phu);
    font-size: 14px;
}
.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.8fr;
    gap: 22px;
}
.footer-col { display: flex; flex-direction: column; gap: 4px; }
.footer-brand strong { color: #fff; letter-spacing: 0.5px; }
.footer-brand span { color: var(--mau-phu-nhat); font-size: 13px; }
.footer-meta { text-align: right; color: #b9a88f; }

.card {
    background: var(--trang);
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong);
    overflow: hidden;
}
.card-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--vien);
    background: linear-gradient(180deg, #fff, #fcf8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 20px; }
.card-body { padding: 22px; }

.form-group { margin-bottom: 18px; }
.form-label, label.form-label {
    display: block;
    font-weight: 700;
    font-size: 14.5px;
    margin-bottom: 7px;
    color: #4b382d;
}
.form-label .required { color: var(--mau-chinh); }
.input, select.input, textarea.input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-chinh);
    font-size: 15.5px;
    color: var(--chu);
    background: #fffdf8;
    border: 1px solid #d6c9b2;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, select.input:focus, textarea.input:focus {
    border-color: var(--mau-chinh);
    box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.12);
    background: #fff;
}
textarea.input { min-height: 90px; resize: vertical; }
.input-note { font-size: 13px; color: var(--chu-nhat); margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.alert {
    border-radius: 9px;
    padding: 13px 16px;
    font-size: 15px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-danger { background: var(--do-loi-nen); color: #8f1111; border-color: #f3c3c3; }
.alert-success { background: var(--xanh-thanh-cong-nen); color: #115e33; border-color: #bfe3cf; }
.alert-info { background: #eef4fb; color: #22466e; border-color: #c9dcf0; }
.alert-warning { background: #fff7e2; color: #7a5200; border-color: #f0dca6; }

.auth-page { background: #f3ecdd url("../images/bg_thi.jpg") center / cover fixed no-repeat; }
.auth-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 44px 20px 60px;
    display: grid;
    grid-template-columns: 1fr 470px;
    gap: 34px;
    align-items: center;
}
.auth-intro { color: #2c1a12; }
.auth-intro .auth-logo { width: 150px; height: 150px; object-fit: contain; margin-bottom: 16px; }
.auth-intro h1 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 10px; }
.auth-intro ul { padding-left: 20px; color: #3f3026; }
.auth-intro li { margin-bottom: 8px; }
.auth-card {
    background: #fff;
    border: 1px solid var(--vien);
    border-top: 5px solid var(--mau-chinh);
    border-radius: var(--ban-kinh);
    box-shadow: 0 18px 50px rgba(70, 20, 5, 0.18);
    padding: 30px 28px;
}
.auth-logo-sm { width: 74px; height: 74px; object-fit: contain; margin: 0 auto 10px; }
.auth-title { text-align: center; font-size: 24px; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--chu-nhat); font-size: 14px; margin-bottom: 22px; }
.auth-links { margin-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14.5px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 14.5px; }

.dash { max-width: 1120px; margin: 0 auto; padding: 34px 20px 60px; }
.dash-head {
    background: linear-gradient(120deg, #fff 62%, #fdf3dd);
    border: 1px solid var(--vien);
    border-left: 6px solid var(--mau-chinh);
    border-radius: var(--ban-kinh);
    padding: 22px 26px;
    box-shadow: var(--bong-nhe);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.dash-head h1 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 4px; }
.dash-head p { margin: 0; color: var(--chu-nhat); }
.dash-user { text-align: right; font-size: 14px; color: var(--chu-nhat); }
.dash-user strong { display: block; color: var(--chu); font-size: 16px; }

.exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 26px; }
.exam-card {
    background: #fff;
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong-nhe);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.exam-card-head {
    padding: 16px 20px;
    background: linear-gradient(120deg, #fdf6e8, #fff);
    border-bottom: 1px solid var(--vien);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.exam-card-head h2 { font-size: 19px; margin: 0; }
.exam-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.exam-card-body p { margin: 0; color: var(--chu-nhat); font-size: 14.5px; }
.exam-card-foot { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; padding: 0 20px 20px; }
.exam-num {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--mau-chinh); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 17px; flex: 0 0 auto;
}
.exam-num.gold { background: linear-gradient(180deg, #e5c65a, #c39b1c); color: #3d2a00; }
.exam-num.gray { background: #cfc4b0; color: #fff; }
.exam-card.done { border-color: #cfe4d6; }
.exam-card.locked { opacity: 0.72; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge-red { background: #fdeaea; color: #a00d0d; }
.badge-green { background: var(--xanh-thanh-cong-nen); color: #14663a; }
.badge-gold { background: #fbf1d5; color: #7a5600; }
.badge-gray { background: #eee8dc; color: #6a5a4a; }
.badge-blue { background: #e8f1fb; color: #1e4f7a; }

.score-line { display: flex; align-items: baseline; gap: 8px; }
.score-line .score { font-size: 30px; font-weight: 800; color: var(--mau-chinh); font-family: var(--font-tieu-de); }
.score-line .score small { font-size: 15px; color: var(--chu-nhat); font-weight: 600; }

.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { padding: 10px 12px; border-bottom: 1px solid var(--vien); text-align: left; font-size: 14.5px; }
.history-table th { background: #faf6ec; color: #5b4636; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }

.exam-page {
    background: #e9e2d4 url("../images/bg_thi.jpg") center / cover fixed no-repeat;
}
.exam-page .site-main { padding: 22px 0 0; }
.exam-shell { max-width: 960px; margin: 0 auto; padding: 0 16px 130px; }
.exam-bar {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong-nhe);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    position: sticky;
    top: 8px;
    z-index: 30;
}
.exam-bar .exam-name { font-weight: 800; color: var(--mau-chinh-dam); font-size: 16px; }
.exam-bar .exam-name small { display: block; font-weight: 600; color: var(--chu-nhat); font-size: 12.5px; letter-spacing: 0.5px; }
.exam-progress-text { font-size: 13.5px; color: var(--chu-nhat); font-weight: 600; }
.exam-timer {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(180deg, #c62828, #8f0000);
    border-radius: 10px;
    padding: 6px 16px;
    letter-spacing: 1px;
    min-width: 118px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(140, 0, 0, 0.3);
}
.exam-timer.danger { animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%, 100% { background: #c62828; } 50% { background: #ff2d2d; } }
.exam-timer small { display: block; font-size: 10px; letter-spacing: 1.5px; font-weight: 700; opacity: 0.9; }

.question-card {
    background: #fff;
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong);
    padding: 26px 28px;
}
.q-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.q-badge {
    flex: 0 0 auto;
    background: var(--mau-chinh);
    color: #fff;
    font-weight: 800;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    letter-spacing: 0.5px;
}
.q-text { font-size: 19px; font-weight: 600; line-height: 1.55; margin: 0; color: #2b1a12; }
.options { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.option {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    border: 1.5px solid #ddd1bc;
    background: #fffdf7;
    border-radius: 10px;
    padding: 13px 15px;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.option:hover { border-color: var(--mau-phu); background: #fffaf0; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-letter {
    flex: 0 0 auto;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid #cbb99f;
    color: #7a644c;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 15px;
    background: #fff;
}
.option-text { font-size: 16px; line-height: 1.5; padding-top: 3px; color: #34251c; }
.option.selected { border-color: var(--mau-chinh); background: #fff5f3; }
.option.selected .option-letter { background: var(--mau-chinh); border-color: var(--mau-chinh); color: #fff; }
.option input:focus-visible + .option-letter { box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.2); }

.exam-answers { margin: 18px 0 0; }
.exam-answers h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--chu-nhat); margin-bottom: 10px; }
.answer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.answer-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #ddd1bc;
    background: #fff;
    color: #6a5a4a;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}
.answer-cell:hover { text-decoration: none; border-color: var(--mau-chinh); }
.answer-cell.done { background: #f3e2c8; border-color: #d9bd86; color: #6b4d11; }
.answer-cell.current { background: var(--mau-chinh); border-color: var(--mau-chinh); color: #fff; }

.exam-actions {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--vien);
    box-shadow: 0 -6px 20px rgba(60, 20, 5, 0.10);
    padding: 12px 16px;
    z-index: 50;
}
.exam-actions-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exam-actions .spacer { flex: 1; }
.exam-hint { font-size: 13px; color: var(--chu-nhat); }

.result-wrap { max-width: 980px; margin: 0 auto; padding: 30px 20px 60px; }
.result-hero {
    background: linear-gradient(130deg, #fff 55%, #fdf1d8);
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.score-ring {
    width: 168px; height: 168px;
    border-radius: 50%;
    background: conic-gradient(var(--mau-chinh) var(--pct), #eee4d2 0);
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 8px 24px rgba(179, 0, 0, 0.16);
}
.score-ring-inner {
    width: 134px; height: 134px;
    border-radius: 50%;
    background: #fff;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border: 2px solid #f3e6cf;
}
.score-ring-inner strong { font-family: var(--font-tieu-de); font-size: 38px; color: var(--mau-chinh); line-height: 1; }
.score-ring-inner span { font-size: 13px; color: var(--chu-nhat); margin-top: 5px; letter-spacing: 0.5px; }
.result-summary h1 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.result-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.result-detail div { background: #fffdf7; border: 1px solid var(--vien); border-radius: 9px; padding: 10px 14px; }
.result-detail span { display: block; font-size: 12px; color: var(--chu-nhat); text-transform: uppercase; letter-spacing: 0.6px; }
.result-detail strong { font-size: 18px; }

.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-item {
    background: #fff;
    border: 1px solid var(--vien);
    border-left: 5px solid #b5a88f;
    border-radius: 10px;
    padding: 16px 18px;
}
.review-item.correct { border-left-color: var(--xanh-thanh-cong); }
.review-item.wrong { border-left-color: #c62828; }
.review-item.blank { border-left-color: #9a8d7a; }
.review-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.review-q { font-weight: 700; font-size: 16px; margin: 0 0 10px; color: #2b1a12; }
.review-opts { display: grid; gap: 6px; font-size: 14.5px; }
.review-opts div { padding: 7px 11px; border-radius: 7px; background: #faf7f0; border: 1px solid #ece3d3; }
.review-opts div.chosen { background: #fff2ef; border-color: #e6a9a0; }
.review-opts div.answer { background: #eaf6ee; border-color: #a9d3b8; font-weight: 600; }
.review-answer { font-size: 14px; color: var(--chu-nhat); margin: 8px 0 0; }
.review-answer strong { color: var(--chu); }

.notice-card {
    max-width: 680px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid var(--vien);
    border-top: 5px solid var(--mau-phu);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong);
    padding: 34px;
    text-align: center;
}
.notice-card h1 { font-size: clamp(22px, 3vw, 30px); }
.notice-card p { color: var(--chu-nhat); }
.notice-icon {
    width: 74px; height: 74px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, #e8f5ee, #cde9d9);
    color: #14663a;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 800;
}

.guide-wrap { max-width: 960px; margin: 0 auto; padding: 34px 20px 60px; }
.guide-block {
    background: #fff;
    border: 1px solid var(--vien);
    border-radius: var(--ban-kinh);
    box-shadow: var(--bong-nhe);
    padding: 24px 26px;
    margin-bottom: 18px;
}
.guide-block h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.guide-block h2 .num {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--mau-chinh); color: #fff;
    font-family: var(--font-chinh);
    font-size: 15px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
}
.guide-block ol, .guide-block ul { margin: 0; padding-left: 22px; }
.guide-block li { margin-bottom: 8px; }
.guide-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.guide-table th, .guide-table td { border: 1px solid var(--vien); padding: 10px 12px; text-align: left; font-size: 14.5px; }
.guide-table th { background: #faf6ec; }

.faq-item { border-bottom: 1px dashed var(--vien); padding: 12px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item strong { display: block; color: var(--mau-chinh-dam); margin-bottom: 4px; }
.faq-item p { margin: 0; color: var(--chu-nhat); }

.admin-body { background: #f1f3f6; font-size: 15px; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 252px;
    flex: 0 0 252px;
    background: linear-gradient(180deg, #6e0000, #4c0000);
    color: #f3e6cf;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-brand {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-brand img {
    width: 42px; height: 42px; object-fit: contain;
    background: #fff; border-radius: 50%; padding: 3px;
    border: 2px solid var(--mau-phu);
}
.admin-brand strong { font-size: 14px; line-height: 1.3; display: block; color: #fff; }
.admin-brand span { font-size: 11.5px; color: var(--mau-phu-nhat); letter-spacing: 0.5px; }
.admin-nav { padding: 12px 10px 24px; }
.admin-nav-title {
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #cfae7a;
    padding: 14px 10px 6px;
    font-weight: 700;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 7px;
    color: #f0e3ce;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.10); text-decoration: none; }
.admin-nav a.active { background: var(--mau-phu); color: #402d00; font-weight: 700; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e2e6ec;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.admin-topbar .admin-title { font-family: var(--font-tieu-de); font-size: 19px; font-weight: 700; color: #3a241c; }
.admin-topbar .admin-user { font-size: 13.5px; color: #6a5a4a; display: flex; align-items: center; gap: 10px; }
.admin-content { padding: 22px 24px 50px; max-width: 1440px; width: 100%; }
.admin-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-page-head h1 { font-size: 24px; margin: 0 0 4px; }
.admin-page-head p { margin: 0; color: #6a5a4a; font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 2px 6px rgba(30, 20, 10, 0.04);
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--mau-chinh); font-family: var(--font-tieu-de); line-height: 1.15; }
.stat-label { font-size: 12.5px; color: #6a5a4a; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 2px; }

.table-wrap { background: #fff; border: 1px solid #e2e6ec; border-radius: 10px; overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.table th { background: #f8f9fb; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; color: #5a6472; white-space: nowrap; }
.table tbody tr:hover { background: #fcfaf6; }
.table td.num { white-space: nowrap; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.filters {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.filters form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.filters .filter-group label { font-size: 12px; font-weight: 700; color: #5a6472; text-transform: uppercase; letter-spacing: 0.4px; }
.filters .input { padding: 8px 10px; font-size: 14px; }
.filters .btn { padding: 8px 14px; font-size: 14px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px;
    padding: 0 10px;
    border: 1px solid #dfe3ea;
    border-radius: 7px;
    background: #fff;
    color: #3f4a58;
    font-size: 13.5px;
    text-decoration: none;
}
.page-link:hover { border-color: var(--mau-chinh); color: var(--mau-chinh); text-decoration: none; }
.page-link.active { background: var(--mau-chinh); border-color: var(--mau-chinh); color: #fff; }
.page-dots { color: #98a1ad; padding: 0 4px; }

.empty-state { padding: 40px 20px; text-align: center; color: #7b8592; font-size: 14.5px; }
.muted { color: #7b8592; }
.small { font-size: 13px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--vien); margin: 20px 0; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; }
.detail-row { padding: 9px 0; border-bottom: 1px dashed #e7dfd0; display: flex; justify-content: space-between; gap: 16px; font-size: 14.5px; }
.detail-row span:first-child { color: #6a5a4a; }
.detail-row strong { text-align: right; }
.inline-form { display: inline; }

.admin-login-page { background: #f3ecdd url("../images/bg_thi.jpg") center / cover fixed no-repeat; }
.admin-login-card {
    max-width: 430px;
    margin: 8vh auto;
    background: #fff;
    border-top: 5px solid var(--mau-chinh);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(50, 15, 5, 0.25);
    padding: 32px 30px;
}
.admin-login-card .auth-logo-sm { width: 80px; height: 80px; }

@media (max-width: 900px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-intro { display: none; }
    .hero-inner { padding: 40px 20px 44px; gap: 20px; }
    .hero-logo { width: 110px; height: 110px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-meta { text-align: left; }
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; flex: none; height: auto; position: static; }
    .admin-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; }
    .admin-nav-title { display: none; }
    .admin-nav a { padding: 7px 10px; font-size: 13px; }
    .admin-content { padding: 16px 14px 40px; }
}
@media (max-width: 640px) {
    body { font-size: 15px; }
    .topbar-title { display: none; }
    .nav-link { padding: 11px 10px; font-size: 14px; }
    .nav-user-name { max-width: 110px; }
    .hero-inner { flex-direction: column; align-items: flex-start; }
    .hero-logo { width: 96px; height: 96px; }
    .section { padding: 38px 0; }
    .question-card { padding: 20px 16px; }
    .q-text { font-size: 17px; }
    .option-text { font-size: 15px; }
    .exam-bar { position: static; }
    .exam-timer { font-size: 20px; min-width: 96px; }
    .result-hero { padding: 22px; gap: 20px; }
    .score-ring { width: 132px; height: 132px; }
    .score-ring-inner { width: 104px; height: 104px; }
    .score-ring-inner strong { font-size: 30px; }
    .form-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .auth-card { padding: 24px 18px; }
    .dash { padding: 20px 14px 44px; }
    .exam-shell { padding: 0 10px 140px; }
    .review-item { padding: 14px; }
}
@media (max-width: 560px) {
    .nav-user-name { display: none; }
}
@media (max-width: 420px) {
    .nav-link { padding: 11px 9px; font-size: 13.5px; }
    .nav-cta { padding: 7px 12px; }
    .nav-user-name { max-width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    .topbar, .main-nav, .site-footer, .filters, .toolbar, .pagination, .exam-actions, .admin-sidebar, .admin-topbar, .no-print { display: none !important; }
    body, .admin-body { background: #fff !important; }
    .admin-content { padding: 0 !important; }
    .table th, .table td { border: 1px solid #999; }
    .card, .table-wrap { box-shadow: none; border: 1px solid #999; }
    .print-title { display: block !important; margin-bottom: 14px; }
    a { color: #000; text-decoration: none; }
}
.print-title { display: none; font-size: 20px; font-weight: 700; text-align: center; }

.section-heading {
    margin: 30px 0 14px;
    font-size: 20px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--mau-chu-dao);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-heading::before {
    content: "";
    width: 5px; height: 22px;
    background: var(--mau-phu);
    border-radius: 2px;
}
.exam-num.gold { background: linear-gradient(135deg, #c9a227, #a8861b); }
.exam-page { -webkit-user-select: none; user-select: none; }
.exam-page .option, .exam-page .q-text { -webkit-touch-callout: none; }

.exam-guard-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fff7e6; border: 1px solid #e6c87a; color: #6b4e0f;
    padding: 10px 16px; border-radius: 10px; font-size: 14px; margin: 14px auto;
    max-width: 1080px;
}
.exam-guard-bar .guard-count { margin-left: auto; font-weight: 700; }
.exam-guard {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(20, 12, 6, .82);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.exam-guard[hidden] { display: none; }
.exam-guard-box {
    background: #fff; border-radius: 16px; max-width: 520px; width: 100%;
    padding: 28px 26px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.exam-guard-icon { font-size: 42px; color: #b30000; line-height: 1; }
.exam-guard-box h2 { margin: 10px 0 8px; color: #8a1414; font-size: 22px; }
.exam-guard-box p { margin: 6px 0; color: #4a3a2e; }
.exam-guard-note { font-size: 14px; color: #8a5a00 !important; }
.exam-guard-box .btn { margin-top: 16px; }

.cover { position: relative; background: #1a0b0b; }
.home-page .site-main { min-height: 0; padding: 0; }
.home-page { background: #1a0b0b; }
.cover-img { display: block; width: 100%; height: auto; }
.cover-actions {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
    padding: 26px 16px 22px;
    background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
}
.cover-actions .btn { min-width: 170px; padding: 12px 28px; font-size: 16px; }
@media (max-width: 720px) {
    .cover-actions { position: static; padding: 16px; background: #7a0d0d; }
    .cover-actions .btn { flex: 1; min-width: 0; }
}

.exam-watermark {
    position: fixed; inset: 0; z-index: 5; pointer-events: none;
    overflow: hidden; display: grid; grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr; opacity: .07; transform: rotate(-24deg) scale(1.45);
}
.exam-watermark span {
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; color: #7d0000; white-space: nowrap;
}
.exam-shell { -webkit-touch-callout: none; }
@media print {
    .exam-page .site-header, .exam-page .site-footer, .exam-page .exam-shell,
    .exam-page .exam-guard-bar, .exam-watermark { display: none !important; }
}
