:root {
    --page-bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #eef2f3;
    --text: #202629;
    --text-muted: #667176;
    --border: #d9e0e3;
    --header: #24282a;
    --header-soft: #303638;
    --brand: #d95f18;
    --brand-dark: #ad4310;
    --gold: #d8a31a;
    --success: #15803d;
    --danger: #c53030;
    --focus: #1177bb;
    --shell: 1440px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font: 14px/1.5 "Segoe UI", Arial, sans-serif;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    color: var(--brand);
}

img {
    max-width: 100%;
    border: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.button {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.button-primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.button-primary:hover {
    color: #fff;
    background: var(--brand-dark);
}

.button-secondary {
    color: #fff;
    background: transparent;
    border-color: #7b8589;
}

.button-secondary:hover {
    color: #fff;
    background: #3b4144;
}

:focus-visible {
    outline: 3px solid rgba(17, 119, 187, 0.35);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 9999;
    padding: 10px 14px;
    color: #fff;
    background: var(--focus);
    border-radius: 4px;
}

.skip-link:focus {
    top: 12px;
}

.site-shell {
    width: min(100% - 32px, var(--shell));
    margin-inline: auto;
}

.site-header {
    position: relative;
    z-index: 20;
    width: 100%;
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.age-notice {
    color: #e7ecee;
    background: #181b1d;
    font-size: 12px;
}

.age-notice .site-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.age-notice i {
    color: #f0bd35;
}

.brand-bar {
    color: #fff;
    background: var(--header);
}

.brand-layout {
    display: grid;
    grid-template-columns: minmax(190px, 280px) minmax(420px, 1fr) auto;
    align-items: center;
    gap: 28px;
    min-height: 108px;
}

.brand-link {
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand-link img {
    display: block;
    width: min(100%, 270px);
    max-height: 94px;
    object-fit: contain;
}

.primary-nav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
}

.primary-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    color: #dfe5e7;
    border-bottom: 3px solid transparent;
    font-weight: 650;
    white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a.active {
    color: #fff;
    background: var(--header-soft);
    border-bottom-color: var(--gold);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.account-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    padding: 7px 10px;
    color: #fff;
    border: 1px solid #535c60;
    border-radius: 6px;
}

.account-summary:hover {
    color: #fff;
    background: var(--header-soft);
}

.account-summary img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}

.account-summary span {
    display: grid;
}

.account-summary small {
    color: #e4bd51;
}

.account-toolbar {
    color: #273034;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.toolbar-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-height: 44px;
    overflow-x: auto;
}

.toolbar-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    color: #374145;
    white-space: nowrap;
}

.toolbar-links a:hover {
    color: var(--brand-dark);
    background: #f3f5f6;
}

.toolbar-links .logout-link {
    color: var(--danger);
}

.download-toolbar {
    color: #263034;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.download-layout {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    overflow-x: auto;
}

.download-title {
    margin-right: 4px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 150px;
    padding: 8px 12px;
    color: #293235;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.download-link:hover {
    color: var(--brand-dark);
    border-color: #c5a654;
}

.download-link i {
    color: var(--brand);
    font-size: 22px;
}

.download-link span {
    display: grid;
    line-height: 1.2;
}

.download-link small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.download-link.pending {
    color: #778287;
    background: #f7f8f8;
}

.download-link.pending i {
    color: #899398;
}

.site-main {
    width: 100%;
    min-height: calc(100vh - 320px);
    overflow: hidden;
}

.site-main > .body,
.site-main > .bg-content,
.site-main > .box_list_chuyenmuc,
.site-main > form {
    width: min(100% - 32px, 1200px);
    margin-inline: auto;
}

.body {
    color: var(--text);
    background: transparent;
}

.bg_top_22,
.bg_top_2 {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    overflow: hidden;
    background: #dcecf1;
}

.bg_top_22 img,
.bg_top_2 img {
    display: block;
    width: 100%;
    max-height: 470px;
    object-fit: cover;
    object-position: center;
}

.bg-content {
    width: 100%;
    margin: 0;
    padding: 30px max(16px, calc((100% - 1200px) / 2));
    color: var(--text);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.bg-content:nth-of-type(even) {
    background: #f7f9fa;
}

.bg-content .title {
    margin-bottom: 18px;
    color: var(--text);
    border-bottom: 2px solid #e5b83e;
}

.bg-content .title h4 {
    margin: 0;
    padding-bottom: 10px;
    font-size: 22px;
}

.bg-content .content {
    font-size: 15px;
}

.content-p {
    color: var(--brand-dark);
    text-align: center;
    font-weight: 800;
}

.text-center {
    text-align: center;
}

.site-footer {
    color: #dfe4e6;
    background: #202426;
    border-top: 4px solid var(--brand);
}

.footer-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: center;
    gap: 30px;
    min-height: 150px;
    padding-block: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.footer-brand img {
    width: 180px;
    max-height: 86px;
    object-fit: contain;
}

.footer-brand p,
.footer-copy {
    margin: 0;
    color: #abb5b9;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: #e5e9ea;
}

.footer-links a:hover {
    color: #f2bf38;
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--brand);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.back-to-top:hover {
    color: #fff;
    background: var(--brand-dark);
}

table {
    max-width: 100%;
    border-collapse: collapse;
    font: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    min-height: 40px;
    border: 1px solid #b8c2c7;
    border-radius: 5px;
    padding: 8px 10px;
    color: var(--text);
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--focus);
    outline: 3px solid rgba(17, 119, 187, 0.15);
}

.w3-button {
    border-radius: 5px !important;
}

@media (max-width: 1050px) {
    .brand-layout {
        grid-template-columns: 220px 1fr;
        gap: 16px;
        padding-block: 12px;
    }

    .primary-nav {
        justify-content: flex-end;
    }

    .header-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .footer-layout {
        grid-template-columns: 1fr auto;
    }

    .footer-copy {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .site-shell {
        width: min(100% - 20px, var(--shell));
    }

    .age-notice .site-shell {
        align-items: flex-start;
        padding-block: 6px;
    }

    .brand-layout {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        min-height: 0;
    }

    .brand-link {
        width: 100%;
        justify-content: center;
    }

    .brand-link img {
        width: min(100%, 240px);
        max-height: 86px;
    }

    .primary-nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .primary-nav a {
        padding-inline: 11px;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .toolbar-links {
        justify-content: flex-start;
    }

    .download-layout {
        align-items: stretch;
        padding-block: 10px;
    }

    .download-title {
        align-self: center;
    }

    .download-link {
        min-width: 138px;
    }

    .site-main > .body,
    .site-main > .bg-content,
    .site-main > .box_list_chuyenmuc,
    .site-main > form {
        width: min(100% - 20px, 1200px);
    }

    .bg-content {
        padding: 24px 14px;
    }

    .footer-layout {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .footer-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}
