/* ==========================================================================
   Topaz — giao diện quản lý nội bộ
   Phong cách: nền chuyển sắc, thẻ kính mờ, bo góc lớn, đổ bóng mềm.
   Màu thương hiệu lấy từ logo (xanh lá).
   Viết tay, không dùng framework: sửa trực tiếp trên hosting được.
   ========================================================================== */

:root {
    /* --- Màu thương hiệu: đổi 3 dòng này là đổi toàn bộ giao diện --- */
    --brand:        #00b14f;
    --brand-dark:   #009543;
    --brand-soft:   #e8f8ef;

    /* Sidebar tối chuyển sắc */
    --nav-1:        #06281e;
    --nav-2:        #0d4a34;
    --nav-3:        #10684a;

    --chu:          #14211c;
    --chu-nhat:     #6b7b74;
    --vien:         rgba(16, 40, 32, .09);
    --vien-dam:     rgba(16, 40, 32, .16);

    --do:           #d4453c;
    --do-nhat:      #fdeceb;
    --cam:          #b8791a;
    --cam-nhat:     #fdf4e4;
    --luc:          #10804d;
    --luc-nhat:     #e6f6ee;
    --lam:          #2563a8;
    --lam-nhat:     #eaf2fb;

    /* Kính mờ */
    --kinh:         rgba(255, 255, 255, .62);
    --kinh-dam:     rgba(255, 255, 255, .8);
    --mo:           saturate(165%) blur(18px);

    --bong-nho:     0 1px 2px rgba(9, 30, 22, .04), 0 2px 8px rgba(9, 30, 22, .05);
    --bong:         0 2px 6px rgba(9, 30, 22, .05), 0 10px 28px rgba(9, 30, 22, .07);
    --bong-noi:     0 8px 20px rgba(9, 30, 22, .10), 0 24px 48px rgba(9, 30, 22, .10);

    --goc:          16px;
    --goc-nho:      10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--chu);
    background: #dcebe3;
    /* Vệt sáng mềm phía sau, tạo chiều sâu để thẻ kính mờ nổi lên */
    background-image:
        radial-gradient(1150px 700px at 88% -14%, rgba(0, 177, 79, .40), transparent 60%),
        radial-gradient(900px 620px at -10% 4%, rgba(37, 99, 168, .26), transparent 58%),
        radial-gradient(820px 700px at 42% 112%, rgba(16, 121, 79, .30), transparent 60%),
        linear-gradient(160deg, #eaf5ef 0%, #d7e9e0 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.06rem; }
h3 { font-size: .95rem; }

/* ---------------------------------------------------------------- Bố cục */

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 258px;
    flex: 0 0 258px;
    background: linear-gradient(168deg, var(--nav-1) 0%, var(--nav-2) 58%, var(--nav-3) 100%);
    color: #cfe3d9;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }

.sidebar__brand {
    padding: 1.1rem 1.15rem 1rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.sidebar__logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    color: #29e07f;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(41, 224, 127, .28);
    border-radius: 12px;
}
.sidebar__logo svg { width: 30px; height: 30px; display: block; }
.sidebar__brand strong { color: #fff; font-size: 1.02rem; display: block; letter-spacing: .06em; }
.sidebar__brand span { font-size: .74rem; color: #8fb3a4; }

.sidebar nav { padding: .55rem .6rem 2rem; }

.sidebar__group {
    padding: .95rem .55rem .35rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #6f958a;
    font-weight: 700;
}

.sidebar a.item {
    display: block;
    padding: .46rem .7rem;
    margin-bottom: 1px;
    color: #c6dcd2;
    font-size: .868rem;
    border-radius: var(--goc-nho);
    transition: background .13s ease, color .13s ease;
}
.sidebar a.item:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.sidebar a.item.active {
    background: linear-gradient(96deg, rgba(41, 224, 127, .26), rgba(41, 224, 127, .10));
    box-shadow: inset 3px 0 0 #29e07f;
    color: #fff;
    font-weight: 600;
}

/* --- Nhóm con bấm mở/đóng trong menu --- */
.nav-sec { margin-bottom: 1px; }

.nav-sec > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .46rem .7rem;
    border-radius: var(--goc-nho);
    color: #a9c9bb;
    font-size: .855rem;
    font-weight: 600;
    user-select: none;
    transition: background .13s ease, color .13s ease;
}
.nav-sec > summary::-webkit-details-marker { display: none; }

/* Mũi tên tự vẽ, xoay khi mở */
.nav-sec > summary::before {
    content: '';
    width: 0; height: 0;
    flex: 0 0 auto;
    border-left: 4.5px solid currentColor;
    border-top: 3.5px solid transparent;
    border-bottom: 3.5px solid transparent;
    transition: transform .15s ease;
}
.nav-sec[open] > summary::before { transform: rotate(90deg); }

.nav-sec > summary:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-sec[open] > summary { color: #dcefe6; }

.nav-sec__count {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 600;
    color: #6f958a;
    background: rgba(255, 255, 255, .07);
    border-radius: 999px;
    padding: 0 .4rem;
    min-width: 18px;
    text-align: center;
}
.nav-sec[open] > summary .nav-sec__count { color: #8fb3a4; }

/* Mục con thụt vào để thấy rõ thứ bậc */
.nav-sec > a.item { padding-left: 1.55rem; font-size: .845rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--kinh-dam);
    -webkit-backdrop-filter: var(--mo);
    backdrop-filter: var(--mo);
    border-bottom: 1px solid var(--vien);
    padding: .7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar__title { font-weight: 650; font-size: 1.02rem; flex: 1; letter-spacing: -.01em; }
.topbar__user { font-size: .8rem; color: var(--chu-nhat); text-align: right; line-height: 1.35; }
.topbar__user strong { display: block; color: var(--chu); font-size: .89rem; font-weight: 600; }

.content { padding: 1.4rem 1.5rem 3.5rem; flex: 1; }

/* ------------------------------------------------------------------ Thẻ */

.card {
    background: var(--kinh);
    -webkit-backdrop-filter: var(--mo);
    backdrop-filter: var(--mo);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--goc);
    box-shadow: var(--bong);
    margin-bottom: 1.15rem;
    overflow: hidden;
}
.card__head {
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--vien);
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
}
.card__head h2, .card__head h3 { margin: 0; flex: 1; }
.card__body { padding: 1.1rem; }
.card__body--flush { padding: 0; }

/* --------------------------------------------------------- Thẻ số liệu */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.3rem;
}
.stat {
    position: relative;
    background: var(--kinh);
    -webkit-backdrop-filter: var(--mo);
    backdrop-filter: var(--mo);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--goc);
    padding: 1rem 1.1rem;
    box-shadow: var(--bong);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--bong-noi); }
/* Vệt màu mờ ở góc, tạo chiều sâu giống ảnh mẫu */
.stat::after {
    content: '';
    position: absolute;
    right: -46px;
    top: -46px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 177, 79, .17), transparent 70%);
    pointer-events: none;
}
.stat__label { font-size: .74rem; color: var(--chu-nhat); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat__value { font-size: 1.72rem; font-weight: 700; margin: .3rem 0 .15rem; letter-spacing: -.02em; }
.stat__hint  { font-size: .8rem; color: var(--chu-nhat); }

.stat--warn  { border-left: 3px solid var(--cam); }
.stat--bad   { border-left: 3px solid var(--do); }
.stat--bad::after  { background: radial-gradient(circle, rgba(212, 69, 60, .16), transparent 70%); }
.stat--good  { border-left: 3px solid var(--luc); }

.delta-up   { color: var(--luc); font-weight: 650; }
.delta-down { color: var(--do);  font-weight: 650; }

/* ---------------------------------------------------------------- Bảng */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    background: rgba(255, 255, 255, .62);
}
table.data th, table.data td {
    padding: .58rem .8rem;
    border-bottom: 1px solid var(--vien);
    text-align: left;
    vertical-align: top;
}
table.data th {
    background: rgba(246, 251, 248, .95);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-weight: 650;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--chu-nhat);
    white-space: nowrap;
    position: sticky;
    top: 0;
}
table.data tbody tr { transition: background .1s ease; }
table.data tbody tr:hover { background: rgba(0, 177, 79, .05); }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tfoot td {
    font-weight: 650;
    background: rgba(240, 248, 244, .95);
    border-top: 2px solid var(--vien-dam);
}

.empty { padding: 2.8rem 1rem; text-align: center; color: var(--chu-nhat); }

/* ---------------------------------------------------------------- Nhãn */

.tag {
    display: inline-block;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 650;
    background: var(--brand-soft);
    color: var(--brand-dark);
    white-space: nowrap;
    border: 1px solid rgba(0, 177, 79, .18);
}
.tag--bad   { background: var(--do-nhat);  color: var(--do);  border-color: rgba(212, 69, 60, .2); }
.tag--warn  { background: var(--cam-nhat); color: var(--cam); border-color: rgba(184, 121, 26, .22); }
.tag--good  { background: var(--luc-nhat); color: var(--luc); border-color: rgba(16, 128, 77, .2); }
.tag--mute  { background: rgba(20, 33, 28, .05); color: var(--chu-nhat); border-color: var(--vien); }

/* ----------------------------------------------------------------- Form */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .9rem 1rem;
}
.field { display: flex; flex-direction: column; gap: .28rem; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: .78rem; font-weight: 650; color: var(--chu-nhat); }
.field small { font-size: .74rem; color: var(--chu-nhat); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=url], input[type=tel], select, textarea {
    width: 100%;
    padding: .5rem .7rem;
    border: 1px solid var(--vien-dam);
    border-radius: var(--goc-nho);
    font: inherit;
    background: rgba(255, 255, 255, .85);
    color: var(--chu);
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 177, 79, .16);
}
input:disabled, select:disabled, textarea:disabled,
input[readonly], textarea[readonly] {
    background: rgba(20, 33, 28, .045);
    color: #7b8b84;
    cursor: not-allowed;
    border-style: dashed;
}
textarea { min-height: 82px; resize: vertical; }
input[type=file] { padding: .4rem; background: rgba(255, 255, 255, .7); }
input[type=checkbox] { accent-color: var(--brand); }

.readonly-note { font-size: .74rem; color: var(--chu-nhat); font-style: italic; }

/* ----------------------------------------------------------------- Nút */

.btn {
    display: inline-block;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    border-radius: var(--goc-nho);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 120, 54, .2), 0 4px 12px rgba(0, 177, 79, .22);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); text-decoration: none; color: #fff;
             box-shadow: 0 2px 4px rgba(0, 120, 54, .2), 0 8px 20px rgba(0, 177, 79, .28); }
.btn:active { transform: translateY(0); }

.btn--ghost {
    background: rgba(255, 255, 255, .8);
    color: var(--brand-dark);
    border-color: rgba(0, 177, 79, .32);
    box-shadow: var(--bong-nho);
}
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand-dark); filter: none; }

.btn--muted {
    background: rgba(255, 255, 255, .8);
    color: var(--chu-nhat);
    border-color: var(--vien-dam);
    box-shadow: var(--bong-nho);
}
.btn--muted:hover { background: #fff; color: var(--chu); filter: none; }

.btn--danger { background: linear-gradient(180deg, #e0554b 0%, var(--do) 100%);
               box-shadow: 0 1px 2px rgba(150, 40, 27, .2), 0 4px 12px rgba(212, 69, 60, .24); }
.btn--danger:hover { color: #fff; }

.btn--sm { padding: .28rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

.actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------ Thông báo */

.flash {
    padding: .75rem 1rem;
    border-radius: var(--goc-nho);
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid transparent;
    box-shadow: var(--bong-nho);
}
.flash--success { background: var(--luc-nhat); color: #0c5c37; border-color: rgba(16, 128, 77, .26); }
.flash--error   { background: var(--do-nhat);  color: #96281b; border-color: rgba(212, 69, 60, .26); }
.flash--warning { background: var(--cam-nhat); color: #8a5a12; border-color: rgba(184, 121, 26, .3); }
.flash--info    { background: var(--lam-nhat); color: #1d4f86; border-color: rgba(37, 99, 168, .24); }

/* ------------------------------------- Khung "Thêm …" bấm mới bung ra */

.them-box > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 1.1rem;
    font-weight: 650;
    color: var(--brand-dark);
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background .13s ease;
}
.them-box > summary::-webkit-details-marker { display: none; }

/* Dấu cộng tự vẽ, xoay thành dấu trừ khi mở */
.them-box > summary::before {
    content: '+';
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 177, 79, .28);
    transition: transform .15s ease;
}
.them-box[open] > summary::before { content: '−'; transform: rotate(180deg); }

.them-box > summary:hover { background: rgba(0, 177, 79, .06); }
.them-box[open] > summary { border-bottom-color: var(--vien); }

/* Khi khung nằm gọn trong một thẻ card thì bỏ viền kép */
.card > .them-box > summary { border-radius: var(--goc) var(--goc) 0 0; }

/* Kiểu nút dùng cho summary ở nơi không phải card (vd danh sách xem trước) */
.them-box > summary.btn { justify-content: center; }
.them-box > summary.btn::before { display: none; }

/* ------------------------------------------------------------ Bộ lọc */

.filters { display: flex; flex-wrap: wrap; gap: .65rem; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 0 1 auto; }

/* -------------------------------------------------- Bảng phân quyền */

table.perm { width: 100%; border-collapse: collapse; font-size: .85rem; background: rgba(255, 255, 255, .5); }
table.perm th, table.perm td { padding: .4rem .55rem; border-bottom: 1px solid var(--vien); }
table.perm th {
    background: rgba(246, 251, 248, .95);
    font-size: .71rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--chu-nhat); font-weight: 650;
}
table.perm th.rot { width: 62px; text-align: center; }
table.perm td.tick { text-align: center; }
table.perm tr.group-row td {
    background: linear-gradient(90deg, rgba(0, 177, 79, .13), rgba(0, 177, 79, .05));
    font-weight: 650;
}
table.perm tr.group-row td:first-child { color: #0a5c33; }
table.perm td.name { padding-left: 2.4rem; }

/* Dòng tên nhóm con trong bảng phân quyền */
table.perm tr.section-row td {
    background: rgba(20, 33, 28, .045);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--chu-nhat);
    padding-left: 1.5rem;
}
table.perm tr.section-row:hover td { background: rgba(20, 33, 28, .045); }
table.perm tbody tr:hover td { background: rgba(0, 177, 79, .05); }
table.perm tr.group-row:hover td { background: rgba(0, 177, 79, .17); }
table.perm input[type=checkbox] { width: 17px; height: 17px; cursor: pointer; }
table.perm select { padding: .22rem .4rem; font-size: .8rem; }

.tabs { display: flex; gap: .35rem; margin-bottom: 1.1rem; }
.tabs a {
    padding: .48rem .95rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--chu-nhat);
    font-weight: 600;
    font-size: .875rem;
    background: rgba(255, 255, 255, .6);
}
.tabs a:hover { text-decoration: none; background: #fff; }
.tabs a.active {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 177, 79, .26);
}

/* ------------------------------------------------------- Dòng thời gian */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    position: relative;
    padding: .5rem 0 .5rem 1.35rem;
    border-left: 2px solid var(--vien-dam);
    font-size: .85rem;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: .85rem;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 177, 79, .18);
}
.timeline time { color: var(--chu-nhat); font-size: .77rem; }

/* ------------------------------------------------------------ Tệp đính kèm */

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .1rem;
    border-bottom: 1px solid var(--vien);
    font-size: .875rem;
}
.file-list li:last-child { border-bottom: none; }
.file-list .meta { color: var(--chu-nhat); font-size: .77rem; margin-left: auto; white-space: nowrap; }

/* ------------------------------------------------------------- Biểu đồ */

.chart { display: flex; align-items: flex-end; gap: .55rem; height: 200px; padding-top: .5rem; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0; }
.chart .bars { display: flex; align-items: flex-end; gap: 3px; height: 158px; width: 100%; justify-content: center; }
.chart .bar {
    width: 30%; min-width: 6px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #34d97f 0%, var(--brand) 100%);
    box-shadow: 0 2px 6px rgba(0, 177, 79, .3);
    transition: filter .12s ease;
}
.chart .bar:hover { filter: brightness(1.1); }
.chart .bar--paid { background: linear-gradient(180deg, #5aa9f0 0%, var(--lam) 100%);
                    box-shadow: 0 2px 6px rgba(37, 99, 168, .28); }
.chart .bar--debt { background: linear-gradient(180deg, #f0b458 0%, var(--cam) 100%);
                    box-shadow: 0 2px 6px rgba(184, 121, 26, .28); }
.chart .label { font-size: .7rem; color: var(--chu-nhat); white-space: nowrap; }

.legend { display: flex; gap: 1.1rem; font-size: .8rem; color: var(--chu-nhat); margin-top: .6rem; }
.legend span::before {
    content: ''; display: inline-block;
    width: 10px; height: 10px; border-radius: 3px; margin-right: .38rem;
}
.legend .rev::before  { background: var(--brand); }
.legend .paid::before { background: var(--lam); }
.legend .debt::before { background: var(--cam); }

/* ------------------------------------------------------- Trang đăng nhập */

.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(150deg, #052a1e 0%, #0b4632 46%, #10794f 100%);
    position: relative;
    overflow: hidden;
}
/* Hai quầng sáng mờ phía sau tấm kính */
.auth-page::before, .auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    pointer-events: none;
}
.auth-page::before { width: 460px; height: 460px; top: -130px; right: -90px;
                     background: rgba(41, 224, 127, .3); }
.auth-page::after  { width: 380px; height: 380px; bottom: -130px; left: -80px;
                     background: rgba(37, 99, 168, .28); }

.auth-box {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    backdrop-filter: saturate(160%) blur(20px);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 22px;
    box-shadow: 0 20px 55px rgba(2, 20, 13, .42);
    width: 100%;
    max-width: 392px;
    padding: 2.1rem 1.9rem;
    color: #eaf6f0;
}
.auth-box__logo {
    width: 66px; height: 66px;
    margin: 0 auto .9rem;
    display: grid; place-items: center;
    color: #29e07f;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(41, 224, 127, .3);
    border-radius: 18px;
}
.auth-box__logo svg { width: 46px; height: 46px; display: block; }
.auth-box h1 { text-align: center; margin-bottom: .15rem; color: #fff; letter-spacing: .1em; }
.auth-box .sub { text-align: center; color: #a9cbbc; font-size: .85rem; margin-bottom: 1.5rem; }
.auth-box .field { margin-bottom: 1rem; }
.auth-box .field label { color: #b9d6c9; }
.auth-box input {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
}
.auth-box input::placeholder { color: #8fb3a4; }
.auth-box input:focus {
    background: rgba(255, 255, 255, .16);
    border-color: #29e07f;
    box-shadow: 0 0 0 3px rgba(41, 224, 127, .2);
    color: #fff;
}
.auth-box .btn { width: 100%; text-align: center; padding: .65rem; margin-top: .3rem; }
.auth-box .flash { background: rgba(212, 69, 60, .18); color: #ffd9d5; border-color: rgba(255, 150, 140, .35); }

/* ---------------------------------------------------------------- Khác */

.muted { color: var(--chu-nhat); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.row-split { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.row-split > * { flex: 1 1 320px; min-width: 0; }

.pagination { display: flex; gap: .35rem; padding: .85rem 1.1rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: .28rem .68rem;
    border: 1px solid var(--vien-dam);
    border-radius: 8px;
    font-size: .85rem;
    background: rgba(255, 255, 255, .7);
}
.pagination a:hover { background: #fff; text-decoration: none; }
.pagination span.current {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff; border-color: transparent;
    box-shadow: 0 3px 10px rgba(0, 177, 79, .26);
}

.error-page { max-width: 480px; margin: 4rem auto; text-align: center; }
.error-page .code {
    font-size: 3.6rem; font-weight: 800; line-height: 1;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: static; }
    .sidebar nav { display: none; }
    .sidebar.open nav { display: block; }
    .content { padding: 1rem; }
    .topbar { padding: .6rem 1rem; }
}

@media print {
    body { background: #fff; }
    .sidebar, .topbar, .actions, .filters { display: none !important; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; background: #fff; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .stat:hover, .btn:hover { transform: none; }
}
