.ntg-history-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .25rem .8rem;
    margin-bottom: .65rem;
}
.ntg-history-header:has(> .sr-only):not(:has(> a)) { margin: 0; }
.ntg-history-header h2 { margin: 0; }
.ntg-history-header a { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-weight: 650; }

.ntg-history-scroll {
    border: 1px solid var(--ntg-border);
    border-radius: var(--ntg-radius);
}
.ntg-history-scroll .ntg-history-table.table {
    margin: 0;
    color: var(--ntg-text);
    background: var(--ntg-bg);
    font-size: .875rem;
}
.ntg-history-scroll .ntg-history-table.table :is(th, td) { padding: .65rem .7rem; vertical-align: middle; border-color: var(--ntg-border); }
.ntg-history-scroll .ntg-history-table.table th { background: var(--ntg-info-bg, #edf4fc); color: var(--ntg-text); white-space: nowrap; font-weight: 700; }
.ntg-history-scroll .ntg-history-table.table td { overflow-wrap: anywhere; }
.ntg-history-scroll .ntg-history-table.table .badge { padding: .32rem .55rem; border-radius: 999px; font-size: .78rem; white-space: nowrap; }
.ntg-history-table .ntg-history-total, .ntg-history-table .ntg-history-primary { font-weight: 750; }
.ntg-history-scroll .ntg-history-table.table :is(.ntg-history-number, .ntg-history-date, .ntg-history-action) { white-space: nowrap; }
.ntg-history-code { display: block; max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.ntg-history-table .ntg-history-date { font-variant-numeric: tabular-nums; font-size: .82rem; }
.ntg-history-table a { min-height: 40px; display: inline-flex; align-items: center; font-weight: 650; }

@media (min-width: 1100px) {
    .ntg-history-scroll .ntg-history-wide { min-width: 57rem; }
    .ntg-history-scroll .ntg-history-table.table tbody tr:nth-child(even) { background: var(--ntg-canvas); }
}

@media (max-width: 1099.98px) {
    .ntg-history-scroll { overflow: visible; border: 0; border-radius: 0; }
    .ntg-history-scroll .ntg-history-table.table { display: block; position: relative; }
    .ntg-history-scroll .ntg-history-table.table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .ntg-history-scroll .ntg-history-table.table tbody { display: grid; gap: .65rem; }
    .ntg-history-scroll .ntg-history-table.table tbody + tbody { margin-top: .65rem; }
    .ntg-history-scroll .ntg-history-table.table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem .75rem;
        padding: .8rem;
        border: 1px solid var(--ntg-border);
        border-radius: 12px;
        background: var(--ntg-bg);
    }
    .ntg-history-scroll .ntg-history-table.table tbody td[data-label] {
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
        text-align: start;
        white-space: normal;
    }
    .ntg-history-scroll .ntg-history-table.table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .15rem;
        color: var(--ntg-muted);
        font-size: .78rem;
        font-weight: 650;
    }
    .ntg-history-scroll .ntg-history-table.table td[data-label="Nội dung"] { grid-column: 1 / -1; }
    .ntg-history-scroll .ntg-history-table.table .ntg-history-code { max-width: 100%; }
    .ntg-history-table .ntg-history-action a { min-height: 44px; }
}
