/* ==========================================
   QUẢN TRỊ HTC TOOLS (04/12/2026)
   Màu theo trang chủ htcons.net. CSP: không có style nội tuyến.
   ========================================== */

:root {
    --navy: #134578;
    --navy-dark: #0d2f52;
    --blue: #2874bc;
    --orange: #f56a20;
    --orange-dark: #d9510c;
    --green: #23804b;
    --green-bg: #e5f5ec;
    --amber: #a86400;
    --amber-bg: #fff3dc;
    --red: #b8321d;
    --red-bg: #fdecea;
    --gray-bg: #eef2f6;
    --text: #15364c;
    --muted: #64788a;
    --line: #e1e8ef;
    --paper: #f4f7fb;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 42, 70, .05), 0 6px 20px rgba(16, 42, 70, .05);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

[hidden] {
    display: none !important;
}

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

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

:focus-visible {
    outline: 3px solid #8fc0ec;
    outline-offset: 2px;
}

h1,
h2,
h3,
p {
    margin: 0;
}

.a-muted {
    color: var(--muted);
}

.a-small {
    font-size: 12.5px;
}

.a-eyebrow {
    color: var(--orange);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
}

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

.a-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: none;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.a-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.a-btn-sm {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 13px;
}

.a-btn-primary {
    background: var(--navy);
    color: #fff;
}

.a-btn-primary:hover:not(:disabled) {
    background: var(--navy-dark);
}

.a-btn-accent {
    background: var(--orange);
    color: #fff;
}

.a-btn-accent:hover:not(:disabled) {
    background: var(--orange-dark);
}

.a-btn-success {
    background: #2a9257;
    color: #fff;
}

.a-btn-success:hover:not(:disabled) {
    background: #207747;
}

.a-btn-danger {
    background: #cf3a22;
    color: #fff;
}

.a-btn-danger:hover:not(:disabled) {
    background: #ad2d18;
}

.a-btn-outline {
    border-color: #cbd8e5;
    background: #fff;
    color: var(--navy);
}

.a-btn-outline:hover:not(:disabled) {
    border-color: var(--navy);
    background: #f1f6fb;
}

.a-btn-ghost {
    color: var(--muted);
}

.a-btn-ghost:hover:not(:disabled) {
    background: var(--gray-bg);
    color: var(--navy);
}

.a-btn-link-danger {
    color: var(--red);
}

.a-btn-link-danger:hover:not(:disabled) {
    background: var(--red-bg);
}

/* ---------- Thanh trên ---------- */

.a-top {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.a-brand img {
    display: block;
    width: 120px;
    height: 44px;
    object-fit: contain;
}

.a-brand-title {
    padding-left: 14px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 15px;
}

.a-brand-title b {
    color: var(--navy);
}

.a-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.a-top-link {
    font-size: 13.5px;
    font-weight: 600;
}

.a-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 650;
}

.a-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e3eef9;
    color: var(--navy);
    font-size: 12.5px;
    font-weight: 800;
}

.a-avatar.lg {
    width: 52px;
    height: 52px;
    font-size: 18px;
}

/* ---------- Màn hình chờ / không quyền ---------- */

.a-gate {
    display: grid;
    min-height: calc(100vh - 60px);
    place-items: center;
    padding: 20px;
}

.a-gate-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: min(420px, 100%);
    padding: 32px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.a-gate-icon {
    font-size: 34px;
}

.a-gate-card h1 {
    font-size: 20px;
}

/* ---------- Khung chính ---------- */

.a-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: calc(100vh - 60px);
}

.a-nav {
    position: sticky;
    top: 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: calc(100vh - 60px);
    padding: 16px 12px;
    border-right: 1px solid var(--line);
    background: #fff;
}

.a-nav > button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.a-nav > button:hover {
    background: var(--gray-bg);
}

.a-nav > button.active {
    background: #e6effa;
    color: var(--navy);
}

.a-nav-ico {
    width: 20px;
    text-align: center;
    opacity: .85;
}

.a-count {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.a-count.warn {
    background: #f2b33d;
    color: #4d3300;
}

.a-nav-foot {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.a-main {
    min-width: 0;
    padding: 24px 28px 48px;
    outline: none;
}

.a-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 18px;
}

.a-page-head h1 {
    color: var(--navy-dark);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.a-page-head p {
    margin-top: 4px;
    color: var(--muted);
}

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

.a-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.a-kpi {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    text-align: left;
}

button.a-kpi {
    cursor: pointer;
}

button.a-kpi:hover {
    border-color: #bcd0e4;
}

.a-kpi span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.a-kpi b {
    color: var(--navy-dark);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
}

.a-kpi small {
    color: var(--muted);
    font-size: 12.5px;
}

.a-kpi.hot b {
    color: var(--orange-dark);
}

.a-kpi.warn b {
    color: var(--amber);
}

/* ---------- Thẻ nội dung ---------- */

.a-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.a-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.a-card.full {
    grid-column: 1 / -1;
}

.a-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.a-card-head h2 {
    color: var(--navy-dark);
    font-size: 15.5px;
    font-weight: 800;
}

.a-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.a-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-top: 1px solid #eef2f6;
}

.a-list li:first-child {
    border-top: 0;
}

.a-list-main {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 1px;
}

.a-list-main b {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.a-list-main span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.a-empty {
    padding: 22px 16px;
    color: var(--muted);
    text-align: center;
}

/* ---------- Thanh công cụ (tìm kiếm, lọc) ---------- */

.a-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.a-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 380px;
}

.a-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border: 1px solid #cfdae5;
    border-radius: 9px;
    background: #fff;
}

.a-search::before {
    content: "⌕";
    position: absolute;
    top: 50%;
    left: 11px;
    color: var(--muted);
    font-size: 17px;
    transform: translateY(-52%);
}

.a-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.a-chips button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.a-chips button:hover {
    border-color: #bccbdb;
    color: var(--navy);
}

.a-chips button.active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.a-chips button i {
    font-style: normal;
    opacity: .75;
}

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

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

.a-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.a-table th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.a-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.a-table tbody tr:last-child td {
    border-bottom: 0;
}

.a-table tr.click {
    cursor: pointer;
}

.a-table tr.click:hover td {
    background: #f6f9fd;
}

.a-table .num {
    text-align: right;
    white-space: nowrap;
}

.a-table .nowrap {
    white-space: nowrap;
}

.a-table .actions {
    text-align: right;
    white-space: nowrap;
}

.a-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.a-user > div {
    display: grid;
    min-width: 0;
}

.a-user b {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.a-user span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.a-sub {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
}

/* ---------- Nhãn trạng thái ---------- */

.a-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.a-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.a-pill.green { background: var(--green-bg); color: var(--green); }
.a-pill.amber { background: var(--amber-bg); color: var(--amber); }
.a-pill.red { background: var(--red-bg); color: var(--red); }
.a-pill.gray { background: var(--gray-bg); color: #5c6f80; }
.a-pill.blue { background: #e6f0fb; color: var(--blue); }
.a-pill.orange { background: #fff0e6; color: var(--orange-dark); }

.a-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 5px;
    background: #e6effa;
    color: var(--navy);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .04em;
    vertical-align: 1px;
}

.a-tag.trial {
    background: #fff0e6;
    color: var(--orange-dark);
}

.a-days.green { color: var(--green); }
.a-days.amber { color: var(--amber); }
.a-days.red { color: var(--red); }

.a-devices {
    font-weight: 700;
    white-space: nowrap;
}

.a-devices.full {
    color: var(--amber);
}

.a-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

/* ---------- Bảng chi tiết trượt ---------- */

.a-drawer-backdrop {
    position: fixed;
    z-index: 40;
    inset: 0;
    background: rgba(9, 25, 45, .35);
}

.a-drawer {
    position: fixed;
    z-index: 41;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(620px, 100vw);
    background: var(--paper);
    box-shadow: -20px 0 60px rgba(9, 25, 45, .2);
    animation: drawer-in .2s ease-out;
}

@keyframes drawer-in {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.a-drawer-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.a-drawer-head h2 {
    color: var(--navy-dark);
    font-size: 19px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.a-drawer-head .a-muted {
    overflow-wrap: anywhere;
}

.a-drawer-head .a-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.a-x {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: var(--gray-bg);
    color: var(--navy);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.a-x:hover {
    background: #e0e8f0;
}

.a-drawer-body {
    display: grid;
    align-content: start;
    gap: 14px;
    flex: 1 1 auto;
    padding: 16px 20px 28px;
    overflow-y: auto;
}

.a-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.a-facts div {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.a-facts span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.a-facts b {
    font-size: 14px;
}

.a-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.a-section-title {
    margin-top: 4px;
    color: var(--navy-dark);
    font-size: 14.5px;
    font-weight: 800;
}

/* Khối cấp gói / gia hạn */

.a-panel {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.a-panel.accent {
    border-color: #f6c7aa;
    background: #fffaf6;
}

.a-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 800;
}

.a-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.a-presets button {
    padding: 7px 12px;
    border: 1px solid #cfdae5;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.a-presets button:hover {
    border-color: var(--navy);
}

.a-presets button.active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.a-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.a-field {
    display: grid;
    gap: 5px;
    font-size: 13px;
    font-weight: 650;
}

.a-field input {
    height: 38px;
    padding: 0 10px;
    border: 1px solid #cfdae5;
    border-radius: 8px;
    background: #fff;
    font-weight: 500;
}

.a-field input.short {
    width: 110px;
}

.a-field small {
    font-weight: 400;
}

.a-stepper {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #cfdae5;
    border-radius: 8px;
    background: #fff;
}

.a-stepper button {
    width: 34px;
    height: 36px;
    border: 0;
    background: #fff;
    color: var(--navy);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.a-stepper button:hover:not(:disabled) {
    background: #eef4fa;
}

.a-stepper button:disabled {
    color: #b9c5d0;
    cursor: not-allowed;
}

.a-stepper input {
    width: 54px;
    height: 36px;
    border: 0;
    border-right: 1px solid #e5ebf1;
    border-left: 1px solid #e5ebf1;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.a-stepper input::-webkit-inner-spin-button,
.a-stepper input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.a-preview {
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--paper);
    color: var(--text);
    font-size: 13.5px;
}

.a-preview b {
    color: var(--navy);
}

.a-key {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px dashed #8cc7a4;
    border-radius: 10px;
    background: #f0faf4;
}

.a-key code {
    padding: 8px 10px;
    border-radius: 7px;
    background: #fff;
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

/* Thẻ thuê bao */

.a-lic {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.a-lic.dim {
    opacity: .8;
}

.a-lic-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.a-lic-top b {
    font-size: 15px;
}

.a-lic-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 13px;
}

.a-lic-meta span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.a-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--gray-bg);
}

.a-bar > i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #3aa569;
}

.a-bar.amber > i {
    background: #e9a52e;
}

.a-bar.red > i {
    background: #d9534f;
}

.a-lic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.a-lic-actions .spacer {
    flex: 1 1 auto;
}

.a-devlist {
    display: grid;
    gap: 6px;
}

.a-dev {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--paper);
    font-size: 13px;
}

.a-dev > div {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.a-dev b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.a-dev span {
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Hộp thoại ---------- */

.a-dialog {
    width: min(460px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 30px 80px rgba(9, 25, 45, .35);
}

.a-dialog-wide {
    width: min(640px, calc(100vw - 32px));
}

.a-dialog::backdrop {
    background: rgba(9, 25, 45, .5);
}

.a-dialog[open] {
    animation: pop .16s ease-out;
}

@keyframes pop {
    from { transform: scale(.96); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.a-dialog-body {
    display: flex;
    gap: 14px;
    padding: 22px 22px 8px;
}

.a-dialog-body h2 {
    margin-bottom: 6px;
    color: var(--navy-dark);
    font-size: 17.5px;
    line-height: 1.3;
}

.a-dialog-body p {
    color: var(--muted);
    line-height: 1.5;
}

.a-dialog-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e6effa;
    color: var(--navy);
    font-size: 20px;
    font-weight: 800;
}

.a-dialog.danger .a-dialog-icon {
    background: var(--red-bg);
    color: var(--red);
}

.a-dialog.success .a-dialog-icon {
    background: var(--green-bg);
    color: var(--green);
}

.a-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 22px 20px;
}

.a-dialog-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 22px 12px;
}

.a-dialog-head h2 {
    margin-top: 2px;
    color: var(--navy-dark);
    font-size: 19px;
}

#orderForm {
    display: grid;
    gap: 14px;
}

#orderForm > .a-field,
#orderForm > .a-check,
#orderForm > .a-form-error {
    margin: 0 22px;
}

.a-order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 12px;
    margin: 0 22px;
}

.a-order-amount {
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 14px;
    border-radius: 12px;
    background: #fff3ea;
    text-align: center;
}

.a-order-amount span {
    color: var(--muted);
    font-size: 12.5px;
}

.a-order-amount b {
    color: var(--orange-dark);
    font-size: 26px;
    line-height: 1.2;
}

.a-order-amount small {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.a-dl {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    font-size: 13.5px;
}

.a-order-grid .a-dl {
    margin: 0;
}

.a-dl div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
}

.a-dl dt {
    color: var(--muted);
}

.a-dl dd {
    margin: 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.a-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: 14px;
    cursor: pointer;
}

.a-check input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--green);
}

.a-form-error {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--red-bg);
    color: var(--red);
    font-size: 13.5px;
}

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

.a-toasts {
    position: fixed;
    z-index: 60;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 8px;
    width: min(380px, calc(100vw - 40px));
}

.a-toast {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-left: 4px solid #3aa569;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(9, 25, 45, .2);
    font-size: 14px;
    animation: pop .16s ease-out;
}

.a-toast.error {
    border-left-color: #d9534f;
}

/* ---------- Máy tính bảng / điện thoại ---------- */

@media (max-width: 1200px) {
    .a-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .a-shell {
        grid-template-columns: 1fr;
    }

    .a-nav {
        position: sticky;
        z-index: 10;
        top: 60px;
        flex-direction: row;
        height: auto;
        padding: 8px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .a-nav > button {
        width: auto;
        white-space: nowrap;
    }

    .a-nav-foot {
        display: none;
    }

    .a-main {
        padding: 18px 16px 40px;
    }

    .a-grid-2 {
        grid-template-columns: 1fr;
    }

    .a-brand-title,
    .a-top-link,
    .a-me-name {
        display: none;
    }
}

@media (max-width: 640px) {
    .a-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .a-facts,
    .a-lic-meta {
        grid-template-columns: 1fr 1fr;
    }

    .a-order-grid {
        grid-template-columns: 1fr;
    }

    /* Bảng thành thẻ trên điện thoại */
    .a-table.cards thead {
        display: none;
    }

    .a-table.cards tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        padding: 12px 14px;
        border-bottom: 1px solid #eef2f6;
    }

    .a-table.cards td {
        padding: 0;
        border: 0;
    }

    .a-table.cards td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 11.5px;
    }

    .a-table.cards td.wide {
        grid-column: 1 / -1;
    }

    .a-table.cards .num,
    .a-table.cards .actions {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .a-drawer,
    .a-dialog[open],
    .a-toast {
        animation: none;
    }
}
