
/* ===== Base sizing & theme ===== */
html {
    font-size: 16px;
}

:root {
    --bg-solid: rgb(15,15,20);
    --surface-top: hsl(215, 11%, 15%);
    --surface-bot: hsl(215, 20%, 26%);
    --surface-text: hsl(210, 30%, 95%);
    --surface-shadow: 0 0.32rem 0.9rem rgba(0,0,0,.34);
    --surface-border: hsl(215, 12%, 32%);
    --text: hsl(210, 30%, 88%);
    --muted: hsl(210, 20%, 70%);
    --input-bg: hsl(210, 25%, 22%);
    --input-hover: hsl(210, 25%, 26%);
    --input-border: hsl(210, 20%, 30%);
    --input-focus: hsl(215, 80%, 56%);
    --btn-top: hsl(215, 40%, 40%);
    --btn-mid: hsl(215, 45%, 34%);
    --btn-bot: hsl(215, 50%, 28%);
    --btn-hover-top: hsl(215, 42%, 44%);
    --btn-hover-bot: hsl(215, 52%, 30%);
    --s-2: .5rem;
    --s-3: .75rem;
    --s-4: 1rem;
    --s-5: 1.25rem;
    --s-6: 1.5rem;
    --fs-12: .75rem;
    --fs-14: .875rem;
    --fs-16: 1rem;
    --fs-20: 1.25rem;
    --overlay-bg: rgba(10,12,16,.92);
    --overlay-z: 950;
    --header-h: 4rem;
    /* Layout widths (mặc định, KHÔNG collapse trong file này) */
    --col-left: 23rem;
    --col-right: 15rem;
    --gap: 1rem;
    --shellMax: 100rem;
    --main-min: 40rem;
}

/* ===== Global ===== */
html, body {
    overflow: hidden;
}

body {
    margin: 0;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg-solid);

}

*, *::before, *::after {
    box-sizing: border-box;
}

img, iframe, video {
    max-width: 100%;
    display: block;
}

a {
    color: cornflowerblue;
    text-decoration: none;
}
a:hover{
    cursor:pointer;
}

ul, ol {
    margin: 0;
    padding-left: 1.25rem;
}

li {
    margin-bottom: .375rem;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .75rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--surface-text);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: .875rem;
}
.General {
    width: 100%;
    container-type: inline-size; /* bắt buộc để đo theo chiều ngang */
    container-name: app; /* tên container dùng trong @container */
    background: linear-gradient(180deg, hsl(225, 31%, 22%), hsl(235, 11%, 13%), hsl(235, 3%, 8%));
}
/* ===== Header ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(90deg, var(--surface-top), var(--surface-bot));
    color: var(--surface-text);
    height: var(--header-h);
    padding-inline: var(--s-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    border: none;
    box-shadow: var(--surface-shadow);
    will-change: transform, opacity;
    transition: transform .18s ease, opacity .18s ease;
}

@media (prefers-reduced-motion: reduce) {
    header {
        transition: none;
    }
}

.header-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--s-4);
}

header .brand {
    font-size: var(--fs-20);
    letter-spacing: .02em;
}

header nav {
    margin: 0 1rem 0 3rem;
}

    header nav a {
        color: hsl(210, 35%, 95%);
        margin-left: var(--s-4);
        font-weight: 600;
        font-size: var(--fs-16);
    }

        header nav a:hover {
            color: #fff;
            text-shadow: 0 0 .28rem rgba(255,255,255,.28);
        }

/* Hide-on-scroll: giữ lớp này cho JS */
.header--hidden {
    transform: translateY(-100%);
}

/* Nút Menu (hiển thị mặc định để có thể click; bạn override ở file khác nếu muốn) */
.header-toggle-left {
    display: none;
    font-weight: 800;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

    .header-toggle-left:hover {
        filter: saturate(106%) contrast(103%);
    }

/* ===== ContentBox (scroll box) ===== */
.ContentBox {
    height: 100vh;
    overflow: auto;
    padding-top: var(--header-h);
    width: 100%;
}


/* ===== KHUNG ba cột (mặc định, không collapse trong file này) ===== */
.page-shell {
    display: flex;
    width: var(--shellMax);
    flex-direction: row;
    align-items: flex-start;
    margin-inline: auto;
    gap: var(--gap);
}

aside {
    flex: 1 1 auto;
    padding:0;
    margin:0;
}
#submainleft.card {
    width: var(--col-left);
}
#submainright.card {
    width: var(--col-right);
}

main {
    flex: 1 1 auto;
    margin-top: var(--s-6);
}




/*DISPLAY DEFAULT DONT TOUCH*/

/* ===== Visuals ===== */
button, .button, input[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: black;
    color: #fff;
    font-weight: 800;
    padding: calc(var(--s-3) - .45rem) var(--s-3);
    font-size: var(--fs-12);
    border: none;
    border-radius: 0;
    cursor: pointer;
    letter-spacing: .01em;
    box-shadow: 0 .5rem 1rem rgba(255,255,255,.30), 0 .125rem .25rem rgba(0,0,0,.26);
    transition: transform .1s, box-shadow .15s, filter .15s, background .15s;
}

    button:hover, .button:hover, input[type="submit"]:hover {
        background: linear-gradient(90deg,var(--btn-hover-top),var(--btn-mid) 10%,var(--btn-bot));
        filter: saturate(106%) contrast(103%);
        box-shadow: 0 .7rem 1.2rem rgba(0,0,0,.6), 0 .1875rem .35rem rgba(0,0,0,.28);
        border:0.1rem groove solid;
    }

    button:active, .button:active, input[type="submit"]:active {
        transform: translateY(.08rem);
    }

/* ⚠️ Dọn duplicate: chỉ giữ MỘT định nghĩa .panel */
.panel {
    background: linear-gradient(90deg,var(--surface-top),var(--surface-bot));
    color: var(--surface-text);
    border: 1px solid var(--surface-border);
    border-radius: .375rem;
    box-shadow: var(--surface-shadow);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.card {
    background: linear-gradient(-90deg,var(--surface-top),var(--surface-bot));
    color: var(--surface-text);
    border: 1px solid var(--surface-border);
    border-radius: .375rem;
    box-shadow: var(--surface-shadow);
    padding: 0;
}

main .card {
    padding: var(--s-4);
}
.panel-header {
    background: linear-gradient(90deg, color-mix(in oklab,var(--surface-top) 98%, white 2%), color-mix(in oklab,var(--surface-bot) 98%, black 2%));
    color: var(--surface-text);
    padding: var(--s-3) var(--s-4);
    font-weight: 700;
    font-size: var(--fs-16);
    border-bottom: 1px solid color-mix(in oklab,var(--surface-border) 80%, black 20%);
}

.panel-body {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: .75rem;
    box-sizing: border-box;
}

.panel-footer {
    background: linear-gradient(90deg, color-mix(in oklab,var(--surface-top) 90%, black 10%), color-mix(in oklab,var(--surface-bot) 90%, black 10%));
    padding: var(--s-2) var(--s-4);
    font-size: var(--fs-12);
    color: var(--muted);
    border-top: 1px solid color-mix(in oklab,var(--surface-border) 80%, black 20%);
}

/* Tabs */
.panel-header.tabs {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid color-mix(in oklab,var(--surface-border) 80%, black 20%);
    background: linear-gradient(180deg, color-mix(in oklab,var(--surface-top) 98%, white 2%), color-mix(in oklab,var(--surface-bot) 98%, black 2%));
}

.tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--surface-text);
    font: inherit;
    font-weight: 700;
    padding: .6rem .9rem;
    cursor: default;
    border-radius: 0;
    box-shadow: inset 0 -2px 0 color-mix(in oklab,var(--surface-border) 70%, white 30%);
    opacity: .9;
}

    .tab:hover {
        opacity: 1;
    }

    .tab.is-active {
        opacity: 1;
        background: linear-gradient(180deg, color-mix(in oklab,var(--surface-top) 99%, white 1%), color-mix(in oklab,var(--surface-bot) 99%, black 1%));
        box-shadow: inset 0 -2px 0 hsl(215,70%,56%);
    }


/*Flash*/
.flash {
    background: linear-gradient(90deg, #000000 0%, hsl(215, 12%, 32%) 100%);
    padding: 0.1rem;
}

    .flash.error {
        color: crimson;
    }

    .flash.warn {
        color: orange;
    }

    .flash.info {
        color: lightgray;
    }

    .flash.success {
        color: cyan;
    }

    /* Nếu muốn close-able */
    .flash .close {
        float: right;
        cursor: pointer;
        margin-left: .5rem;
    }

/* ===== Form ===== */

.form {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: .75rem;
    margin: 0;
}

.form-field label {
    display: block;
    margin-bottom: .375rem;
    color: var(--surface-text);
    font-weight: 600;
}

.form-field input[type="text"], .form-field input[type="email"], .form-field input[type="password"] {
    width: 100%;
    padding: .5rem .75rem;
    border-radius: .25rem;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-size: var(--fs-16);
    line-height: 1.25;
    transition: background .2s, box-shadow .2s, border-color .2s;
}

.form-field input:hover {
    background: var(--input-hover);
}

.form-field input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 .1875rem hsla(215,80%,56%,.26);
    outline: none;
}

.form-field input::placeholder {
    color: hsl(210,15%,62%);
}

.form-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: flex-start;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin: 0;
    padding: .75rem 1rem;
    border-top: 1px solid color-mix(in oklab,var(--surface-border) 80%, black 20%);
    color: var(--muted);
    font-size: .875rem;
    box-sizing: border-box;
}

    .panel-footer .link {
        color: hsl(210,35%,95%);
        text-decoration: none;
    }

        .panel-footer .link:hover {
            text-decoration: underline;
        }

.panel-desc {
    margin: 0 0 .75rem;
    color: hsl(210,15%,70%);
    font-size: var(--fs-14);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
}

    .checkbox input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
    }

.input-otp {
    max-width: 12rem;
    letter-spacing: .08em;
    text-align: center;
}

footer{
    background-color:black;
}
footer div{
    padding: 2rem;
}

.footer-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #cfd8dc;
    border-top: 1px solid rgba(255,255,255,.08);
}

    .footer-card .footer-col {
        flex: 1 1 220px;
        min-width: 220px;
    }

    .footer-card .footer-brand {
        text-align: right;
    }

    .footer-card h4 {
        margin: 0 0 8px;
        font-size: 16px;
        font-weight: 600;
        color: #e0f7fa;
    }

    .footer-card ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .footer-card a {
        color: #00d4ff;
        text-decoration: none;
    }

        .footer-card a:hover {
            text-decoration: underline;
        }

/* --- Lớp phủ che nội dung (Main) --- */
.is-loading {
    position: relative;
    pointer-events: none;
    user-select: none;
}

    .is-loading::before {
        content: "";
        position: absolute;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: var(--overlay-z);
        backdrop-filter: blur(1px);
    }

/* --- Thanh Loading "Hít" mép --- */
/* Chỉ dùng duy nhất một thanh này gắn vào body để không bị kéo đi bởi header */
body.app-is-loading::after {
    content: "";
    position: fixed;
    left: 0;
    top: var(--header-h); /* Mặc định nằm dưới header */
    width: 100%;
    height: 0.1rem;
    background: linear-gradient(90deg, transparent, #3498db, #00d4ff, transparent);
    z-index: 1001; /* Nằm trên cả header (1000) */

    animation: loading-bar 1.5s infinite ease-in-out;
    transition: top 0.18s ease; /* Khớp với transition ẩn header */
    will-change: top;
}

/* Khi Header ẩn đi, "hít" thanh loading lên sát mép 0 */
body.app-is-loading:has(header.header--hidden)::after {
    top: 0;
}

/* Animation chạy tràn màn hình */
@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}