:root {
    --bg: var(--ui-bg);
    --card: var(--ui-surface);
    --text: var(--ui-text);
    --muted: var(--ui-text-muted);
    --border: var(--ui-border);
    --primary: var(--ui-primary);
    --danger: var(--ui-danger);
    --warning: var(--ui-warning);
    --success: var(--ui-success);
    --button-height: 44px;
    --button-height-compact: 34px;
    --button-radius: 10px;
    --button-padding-inline: 16px;
}

html { min-width: 320px; background: var(--bg); }
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
.topbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #d8e0ee;
    min-height: 66px;
    padding: 11px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 18px rgba(16, 24, 40, .05);
    backdrop-filter: blur(14px);
}
.topbar-mobile-toggle,
.topbar-mobile-drawer-header,
.topbar-mobile-backdrop { display: none; }
body.is-mobile-nav-open { overflow: hidden; }

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    color: #0b1f3a;
}
.topbar-brand:hover { color: #0b1f3a; }
.topbar-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 18px;
    font-weight: 950;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .24);
}
.topbar-brand-copy { display: flex; flex-direction: column; line-height: 1.08; }
.topbar-brand-copy strong {
    color: #071a33;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -.025em;
}
.topbar-brand-copy small {
    margin-top: 5px;
    color: #667085;
    font-size: 12px;
    font-weight: 750;
}
.topbar-nav {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.topbar-nav-primary,
.topbar-nav-account {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-nav-primary { min-width: 0; flex-wrap: wrap; }
.topbar-nav-account { margin-left: auto; }
.topbar-link,
.topbar-trigger {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 11px 15px;
    background: transparent;
    color: #344054;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.topbar-link:hover,
.topbar-trigger:hover,
.topbar-link.is-active,
.topbar-trigger.is-active,
.topbar-menu.is-open > .topbar-trigger {
    background: #eef4ff;
    border-color: #b9cdfd;
    color: #123da9;
}
.topbar-link.is-active,
.topbar-trigger.is-active {
    box-shadow: inset 0 -3px 0 #2563eb, 0 6px 14px rgba(37, 99, 235, .08);
}
.topbar-link-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf3ff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 950;
}
.topbar-trigger-label { display: inline-flex; align-items: center; gap: 10px; }
.topbar-split-trigger {
    padding: 0;
    gap: 0;
    overflow: hidden;
}
.topbar-split-trigger__link {
    min-height: 46px;
    padding: 11px 12px 11px 15px;
    color: inherit;
    display: inline-flex;
    align-items: center;
}
.topbar-split-trigger__link:hover { color: inherit; }
.topbar-split-trigger__toggle {
    align-self: stretch;
    min-width: 40px;
    padding: 0 11px;
    border: 0;
    border-left: 1px solid #d7e3ff;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.topbar-split-trigger__toggle:hover,
.topbar-split-trigger__toggle:focus-visible {
    background: rgba(37, 99, 235, .08);
}
.topbar-chevron {
    --ui-chevron-arm: 6px;
    --ui-chevron-stroke: 1.75px;
    width: 14px;
    height: 14px;
    color: #667085;
    transition: transform .16s ease;
}
.topbar-menu { position: relative; }
.topbar-menu.is-open > .topbar-trigger .topbar-chevron,
.topbar-menu:hover > .topbar-trigger .topbar-chevron { transform: rotate(180deg); }
.topbar-menu-panel {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    width: 340px;
    padding: 10px;
    background: #fff;
    border: 1px solid #d8e0ee;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(16, 24, 40, .16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-7px) scale(.985);
    transform-origin: top left;
    max-height: min(72vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: opacity .15s ease, visibility .15s ease, transform .15s ease;
    z-index: 120;
}
.topbar-menu-panel-wide { width: 390px; }
.topbar-menu:hover > .topbar-menu-panel,
.topbar-menu.is-open > .topbar-menu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.topbar-menu-header { padding: 8px 10px 10px; }
.topbar-menu-header strong,
.topbar-menu-header small { display: block; }
.topbar-menu-header strong { color: #0b1f3a; font-size: 16px; font-weight: 950; }
.topbar-menu-header small { margin-top: 4px; color: #667085; font-size: 12px; }
.topbar-menu-section-label {
    padding: 9px 10px 5px;
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.topbar-menu-divider { height: 1px; margin: 7px 4px; background: #e4e7ec; }
.topbar-menu-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #344054;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.topbar-menu-item:hover,
.topbar-menu-item.is-active {
    background: #f2f6ff;
    border-color: #d7e3ff;
    color: #1648c6;
}
.topbar-menu-item > span:last-child,
.topbar-account-summary > span:last-child { min-width: 0; }
.topbar-menu-item strong,
.topbar-menu-item small { display: block; }
.topbar-menu-item strong { color: inherit; font-size: 14px; font-weight: 900; }
.topbar-menu-item small { margin-top: 3px; color: #667085; font-size: 11.5px; line-height: 1.35; }
.topbar-menu-icon,
.topbar-menu-step {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf3ff;
    color: #2563eb;
    font-weight: 950;
}
.topbar-menu-step { border-radius: 50%; }
.topbar-menu-item-danger { color: #b42318; }
.topbar-menu-item-danger .topbar-menu-icon { background: #fef3f2; color: #b42318; }
.topbar-account-trigger { padding: 7px 10px 7px 7px; gap: 9px; }
.topbar-account-trigger.topbar-split-trigger { padding: 0; gap: 0; }
.topbar-account-link {
    gap: 9px;
    padding: 7px 10px 7px 7px;
    text-decoration: none;
}
.topbar-account-link:hover { color: inherit; }
.topbar-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eef4ff, #dce8ff);
    color: #1648c6;
    font-size: 14px;
    font-weight: 950;
}
.topbar-avatar.large { width: 42px; height: 42px; border-radius: 13px; font-size: 16px; }
.topbar-account-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.topbar-account-copy strong { color: #0b1f3a; font-size: 14px; font-weight: 900; }
.topbar-account-copy small { margin-top: 3px; color: #667085; font-size: 11px; font-weight: 650; }
.topbar-account-panel {
    left: auto;
    right: 0;
    width: 320px;
    transform-origin: top right;
}
.topbar-account-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 9px 10px;
}
.topbar-account-summary strong,
.topbar-account-summary small { display: block; }
.topbar-account-summary strong { color: #0b1f3a; font-size: 14px; font-weight: 950; }
.topbar-account-summary small { margin-top: 4px; color: #667085; font-size: 11px; }
.page { max-width: 1280px; margin: 18px auto; padding: 0 12px; }


/* UI-HQA4: topbar brand/menu hierarchy tuning. */
@media (min-width: 881px) {
    .topbar-nav-primary { align-items: center; }
    .topbar-link,
    .topbar-trigger { letter-spacing: -.01em; }
}
@media (max-width: 1180px) and (min-width: 881px) {
    .topbar-brand { min-width: 190px; }
    .topbar-brand-copy strong { font-size: 18px; }
    .topbar-link,
    .topbar-trigger { padding-inline: 12px; font-size: 14px; }
    .topbar-link-icon { width: 24px; height: 24px; }
}

@media (max-width: 880px) {
    .topbar {
        min-height: 60px;
        padding: 8px 12px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
    }
    .topbar-brand {
        min-width: 0;
        flex: 1 1 auto;
        gap: 9px;
    }
    .topbar-brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
    .topbar-brand-copy strong { font-size: 17px; }
    .topbar-brand-copy small { margin-top: 3px; font-size: 10.5px; }

    .topbar-mobile-toggle {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 8px 12px;
        border: 1px solid #c9d8f5;
        border-radius: 12px;
        background: #eef4ff;
        color: #1648c6;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font: inherit;
        font-size: 13px;
        font-weight: 900;
        cursor: pointer;
    }
    .topbar-mobile-toggle__bars { width: 18px; display: grid; gap: 3px; }
    .topbar-mobile-toggle__bars i { display: block; height: 2px; border-radius: 999px; background: currentColor; }

    .topbar-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 140;
        border: 0;
        background: rgba(15, 23, 42, .48);
        backdrop-filter: blur(1px);
        cursor: pointer;
    }
    .topbar-mobile-backdrop:not([hidden]) { display: block; }

    .topbar-nav {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 150;
        width: min(86vw, 340px);
        height: 100dvh;
        padding: 0 12px 14px;
        background: #fff;
        border-right: 1px solid #d8e0ee;
        box-shadow: 18px 0 44px rgba(15, 23, 42, .22);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-104%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .2s ease, visibility .2s ease;
    }
    .topbar.is-mobile-nav-open .topbar-nav {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    .topbar-mobile-drawer-header {
        position: sticky;
        top: 0;
        z-index: 2;
        min-height: 64px;
        margin: 0 -12px 4px;
        padding: 10px 12px;
        border-bottom: 1px solid #e4eaf4;
        background: rgba(255,255,255,.98);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .topbar-mobile-drawer-header span { min-width: 0; display: grid; gap: 2px; }
    .topbar-mobile-drawer-header strong { color: #0b1f3a; font-size: 16px; font-weight: 950; }
    .topbar-mobile-drawer-header small { color: #667085; font-size: 11px; font-weight: 650; }
    .topbar-mobile-drawer-header button {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border: 1px solid #d8e0ee;
        border-radius: 11px;
        background: #f8fafc;
        color: #344054;
        font: inherit;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }

    .topbar-nav-primary,
    .topbar-nav-account {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
    }
    .topbar-nav-primary { flex-wrap: nowrap; }
    .topbar-nav-account {
        margin: auto 0 0;
        padding-top: 10px;
        border-top: 1px solid #e4eaf4;
    }
    .topbar-link,
    .topbar-trigger {
        width: 100%;
        min-height: 48px;
        padding: 8px 10px;
        border-radius: 12px;
        justify-content: space-between;
        font-size: 14px;
    }
    .topbar-link.is-active,
    .topbar-trigger.is-active { box-shadow: inset 3px 0 0 #2563eb; }
    .topbar-link-icon { width: 32px; height: 32px; }
    .topbar-split-trigger__link { flex: 1; min-height: 46px; padding: 7px 8px; justify-content: flex-start; }
    .topbar-split-trigger__toggle { flex: 0 0 42px; min-width: 42px; }
    .topbar-menu { width: 100%; }
    .topbar-menu-panel,
    .topbar-menu-panel-wide,
    .topbar-account-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 4px 0 8px 34px;
        padding: 5px;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        border-radius: 12px;
        border-color: #e2e8f0;
        background: #f8fafc;
        box-shadow: none;
        overflow: visible;
    }
    .topbar-menu:hover > .topbar-menu-panel { display: none; }
    .topbar-menu.is-open > .topbar-menu-panel { display: block; }
    .topbar-menu-header { display: none; }
    .topbar-menu-section-label { padding: 7px 8px 4px; }
    .topbar-menu-item {
        min-height: 46px;
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 8px;
        padding: 7px 8px;
        border-radius: 10px;
    }
    .topbar-menu-item small { display: none; }
    .topbar-menu-icon,
    .topbar-menu-step { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
    .topbar-menu-step { border-radius: 50%; }
    .topbar-account-copy { flex: 1; }
    .topbar-layout-toggle { display: none; }
}
h1 { margin: 0 0 4px; font-size: 24px; }
h2 { margin-top: 22px; font-size: 18px; }
.muted { color: var(--muted); }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}
textarea { resize: vertical; }
.checkbox-line { flex-direction: row; align-items: center; font-weight: 500; }
.checkbox-line input { width: auto; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--button-height);
    padding: 10px var(--button-padding-inline);
    border: 1px solid transparent;
    border-radius: var(--button-radius);
    color: var(--text);
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background-color .14s ease, color .14s ease;
}
.button:hover:not(:disabled):not([aria-disabled="true"]) {
    transform: translateY(-1px);
}
.button:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus-ring, 0 0 0 3px rgba(37, 99, 235, .18));
}
.button:disabled,
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
}
.button-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(37, 99, 235, .16);
}
.button-primary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}
.button-secondary {
    color: #1f3aa9;
    background: #eef2ff;
    border-color: #c7d7fe;
}
.button-secondary:hover:not(:disabled):not([aria-disabled="true"]) {
    color: #17338f;
    background: #e3ebff;
    border-color: #9fbbfb;
}
.button-danger {
    color: var(--danger);
    background: #fee4e2;
    border-color: #fda29b;
}
.button-danger:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #fecdca;
    border-color: #f97066;
}
.button-danger.button-small {
    background: #fff;
}
.button-danger.button-small:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #fef3f2;
}
.button-ghost {
    color: var(--text);
    background: transparent;
    border-color: transparent;
}
.button-ghost:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #f2f4f7;
    border-color: #e4e7ec;
}
.button-action { min-width: 188px; }
.button-block { width: 100%; }
.button-icon {
    width: var(--button-height);
    min-width: var(--button-height);
    padding-inline: 0;
}
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; min-width: 1120px; font-size: 13px; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 8px; vertical-align: top; }
.data-table th { background: #f2f4f7; text-align: left; position: sticky; top: 56px; }
.status-ok { background: #f6fef9; }
.status-warning { background: #fffaeb; }
.status-danger { background: #fef3f2; }
@media (max-width: 720px) {
    /* GLOBAL-MOBILE-R1: topbar inherits the canonical one-row mobile shell from <=880px. */
    .form-grid { grid-template-columns: 1fr; }
    .page { margin: 10px auto; }
}
@media print {
    .topbar { display: none !important; }
    body { background: white; }
    .data-table th { position: static; }
}

/* Nhập báo cáo Yến — bản gọn giống thao tác Zalo */
.yen-page {
    display: flex;
    justify-content: center;
}
.yen-shell {
    width: min(760px, 100%);
}
.yen-back {
    align-self: center;
    color: #1f5eff;
    font-weight: 800;
    background: #eef4ff;
    border: 1px solid #c7d7fe;
    border-radius: 999px;
    padding: 9px 13px;
}
.yen-date-card,
.yen-zalo-card { margin-bottom: 14px; }
.yen-message-title {
    font-size: 22px;
    font-weight: 900;
    color: #101828;
    margin-bottom: 14px;
}
.yen-big-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
}
.yen-big-input,
.yen-debt-row label,
.yen-note {
    font-weight: 900;
    color: #182230;
}
.yen-big-input span,
.yen-debt-row span,
.yen-note span {
    font-size: 15px;
}
.yen-big-input input,
.yen-debt-row input,
.yen-note textarea,
.yen-date-card input {
    border: 1.5px solid #cbd5e1;
    border-radius: 15px;
    padding: 15px 16px;
    font-size: 22px;
    font-weight: 900;
    color: #0b1f3a;
    background: #fbfdff;
}
.yen-big-input.small input { text-align: center; }
.yen-section-title {
    margin-top: 18px;
    font-size: 19px;
    font-weight: 950;
}
.yen-help {
    margin: 4px 0 12px;
    color: #667085;
}
.yen-debt-list {
    display: grid;
    gap: 10px;
}
.yen-debt-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: end;
}
.yen-debt-row input { font-size: 18px; }
.yen-remove {
    width: 48px;
    height: 54px;
    border: 0;
    border-radius: 15px;
    background: #fee4e2;
    color: #b42318;
    font-size: 25px;
    font-weight: 950;
    cursor: pointer;
}
.yen-note { margin-top: 14px; }
.yen-note textarea { font-size: 16px; font-weight: 700; }
.yen-save-bar .button { flex: 1; min-height: 52px; font-size: 16px; }
@media (max-width: 720px) {
    .yen-date-card,
    .yen-big-grid,
    .yen-debt-row { grid-template-columns: 1fr; }
    .yen-message-title { font-size: 20px; }
    .yen-big-input input,
    .yen-date-card input { font-size: 20px; }
    .yen-remove { width: 100%; }
}

/* Nhập báo cáo Dư — bản gọn, dùng được điện thoại và máy tính */
.du-page {
    display: flex;
    justify-content: center;
}
.du-shell {
    width: min(920px, 100%);
}
.du-date-card,
.du-report-card { margin-bottom: 14px; }
.du-message-title {
    font-size: 22px;
    font-weight: 950;
    color: #101828;
    margin-bottom: 14px;
}
.du-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.du-big-input,
.du-note {
    font-weight: 900;
    color: #182230;
}
.du-big-input span,
.du-note span {
    font-size: 15px;
}
.du-big-input input,
.du-note textarea,
.du-date-card input {
    border: 1.5px solid #cbd5e1;
    border-radius: 15px;
    padding: 15px 16px;
    font-size: 22px;
    font-weight: 900;
    color: #0b1f3a;
    background: #fbfdff;
}
.du-big-input.cash input { border-color: #fed7aa; background: #fffaf4; }
.du-big-input.transfer input { border-color: #ddd6fe; background: #fbf8ff; }
.du-result-card {
    margin: 12px 0;
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid #d8e0ee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.du-result-card span {
    color: #475467;
    font-weight: 800;
}
.du-result-card strong {
    color: #0b1f3a;
    font-size: 24px;
    font-weight: 950;
    white-space: nowrap;
}
.du-blue { background: #eff6ff; border-color: #bfdbfe; }
.du-green { background: #ecfdf3; border-color: #abefc6; }
.du-note { display: block; margin-top: 14px; }
.du-note textarea { width: 100%; font-size: 16px; font-weight: 700; }
.du-save-bar .button { flex: 1; min-height: 52px; font-size: 16px; }
@media (max-width: 720px) {
    .du-date-card,
    .du-main-grid { grid-template-columns: 1fr; }
    .du-message-title { font-size: 20px; }
    .du-big-input input,
    .du-date-card input { font-size: 20px; }
    .du-result-card {
        align-items: flex-start;
        flex-direction: column;
    }
    .du-result-card strong { font-size: 25px; }
}

/* Đăng nhập — đơn giản, chặn public cho toàn web */
.login-card-small { width: min(520px, 100%); }
.login-brand {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1f5eff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    margin-bottom: 12px;
}
.login-card h1 { font-size: 30px; line-height: 1.08; margin-bottom: 8px; }
.login-role { justify-content: center; }
.login-role b { font-size: 26px; font-weight: 950; }
.role-yen { border-color: #93c5fd; background: #eff6ff; }
.role-du { border-color: #c4b5fd; background: #f5f3ff; }
.role-quanly { border-color: #fdba74; background: #fff7ed; }
.login-form { display: grid; gap: 14px; margin-top: 16px; }
.login-remember { align-items: center; }
.login-submit { width: 100%; min-height: 50px; font-size: 16px; }
.account-table { min-width: 900px; }

/* Hàng bể/vỡ — nhiều dòng giống thu nợ */
.hangbe-shell { width: min(1060px, 100%); }
.hangbe-date-card {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.hangbe-list { display: grid; gap: 10px; }
.hangbe-row {
    display: grid;
    grid-template-columns: 1.05fr .8fr .9fr 1fr 48px;
    gap: 10px;
    align-items: end;
    background: #fffaf4;
    border-color: #fed7aa;
}
.hangbe-row label { font-weight: 900; }
.hangbe-row label span { font-size: 14px; }
.hangbe-row input {
    border: 1.5px solid #d0d5dd;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 17px;
    font-weight: 850;
    color: #0b1f3a;
    background: #fff;
}
.hangbe-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.hangbe-summary div {
    background: #f8fbff;
    border: 1px solid #dbe7ff;
    border-radius: 16px;
    padding: 14px;
}
.hangbe-summary span { display: block; color: #667085; font-weight: 800; }
.hangbe-summary strong { font-size: 24px; font-weight: 950; color: #0b1f3a; }

@media (max-width: 900px) {
    .login-role-grid { grid-template-columns: 1fr; }
    .hangbe-date-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hangbe-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hangbe-row .yen-remove { width: 100%; grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .login-card { padding: 18px; border-radius: 18px; }
    .login-card h1 { font-size: 24px; }
    .hangbe-date-card,
    .hangbe-row,
    .hangbe-summary { grid-template-columns: 1fr; }
}

/* UX update F1 — ngày mặc định/hôm nay + màn tổng hợp tháng gọn hơn */
.date-pick-card .date-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.button-soft {
    background: #f8fbff;
    color: #1f3aa9;
    border-color: #d6e4ff;
}

.attention-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.attention-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    border-radius: 12px;
    padding: 11px 12px;
    border: 1px solid #fedf89;
    background: #fffaeb;
    color: #6f3d00;
}
.attention-item.danger {
    border-color: #fecdca;
    background: #fef3f2;
    color: #912018;
}
.attention-item em {
    color: inherit;
    opacity: .8;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
}
.month-table-scroll { max-height: 68vh; }
.month-data-table {
    min-width: 1180px;
    font-size: 13px;
}
.month-data-table th {
    top: 0;
    z-index: 2;
    background: #eef2ff;
    color: #111827;
    white-space: nowrap;
}
.month-data-table td {
    white-space: nowrap;
}
.row-status.status-ok { color: #027a48; background: #ecfdf3; border-color: #abefc6; }
.row-status.status-warning { color: #b54708; background: #fffaeb; border-color: #fedf89; }
.row-status.status-danger { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.negative { color: #b42318; font-weight: 900; }

@media (max-width: 1100px) {
    .attention-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .date-pick-card { grid-template-columns: 1fr !important; }
    .date-pick-card .date-actions { justify-content: stretch; }
    .date-pick-card .date-actions .button { flex: 1; }
    .attention-list { grid-template-columns: 1fr; }
}

.validation-summary {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    border-radius: 10px;
    font-weight: 700;
}
.validation-summary ul { margin: 0; padding-left: 18px; }
.setup-note {
    margin: 12px 0 16px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 10px;
    line-height: 1.45;
}
.field-validation-error {
    display: block;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

/* Danh sách thu nợ / hàng bể — chỉ giữ composition riêng; bề mặt dùng Global UI. */
.quick-filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.money-cell { font-weight: 900; color: var(--ui-text-strong); }
.empty-cell { text-align: center; color: var(--ui-text-muted); padding: 24px !important; }

@media (max-width: 960px) {
    .quick-filter-buttons { grid-column: 1 / -1; justify-content: stretch; }
    .quick-filter-buttons .button { flex: 1; }
}

/* Chuẩn bảng danh sách dùng chung: filter + sort + paging */
.standard-list-filter {
    grid-template-columns: minmax(260px, 1.1fr) minmax(260px, 1.4fr) 170px 160px 160px 135px auto;
}
.standard-list-filter label {
    min-width: 0;
}
.standard-list-filter input,
.standard-list-filter select {
    width: 100%;
}
.filter-search input {
    min-width: 0;
}
.standard-table-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.standard-data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 14px;
}
.standard-data-table th,
.standard-data-table td {
    padding: 12px 14px;
    border: 1px solid #d8e0ee;
    vertical-align: middle;
    background-clip: padding-box;
}
.standard-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5ff;
    color: #0b1f3a;
    font-weight: 900;
    text-align: left;
    white-space: nowrap;
}
.standard-data-table thead th a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.standard-data-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}
.standard-data-table tbody tr:hover td {
    background: #eef6ff;
}
.standard-data-table .numeric {
    text-align: right;
    white-space: nowrap;
}
.soft-warning-row td {
    background: #fffaf0 !important;
}
.clickable-row {
    cursor: pointer;
}
.table-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 18px 18px;
    border-top: 1px solid #d8e0ee;
    background: #fff;
}
.table-pager span {
    color: #344054;
    font-weight: 800;
}
.table-pager .disabled {
    opacity: .45;
    pointer-events: none;
}
@media (max-width: 1180px) {
    .standard-list-filter {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .standard-list-filter .quick-filter-buttons,
    .standard-list-filter .filter-search {
        grid-column: 1 / -1;
    }
}
@media (max-width: 760px) {
    .standard-list-filter {
        grid-template-columns: 1fr;
    }
    .standard-list-filter .quick-filter-buttons,
    .standard-list-filter .filter-search {
        grid-column: auto;
    }
    .standard-table-title,
    .table-pager {
        flex-direction: column;
        align-items: stretch;
    }
    }

/* V9 - chuẩn hóa lại table/list: không vỡ header, gọn hơn, có pager trên/dưới */
.standard-list-filter {
    display: grid;
    grid-template-columns: minmax(210px, .9fr) minmax(240px, 1.15fr) minmax(140px, .7fr) minmax(140px, .7fr) minmax(140px, .7fr) minmax(120px, .55fr) auto;
    gap: 12px;
    align-items: end;
}
.month-standard-filter {
    grid-template-columns: 120px 140px minmax(220px, 1.2fr) 170px 130px auto auto;
}
.standard-list-filter .quick-filter-buttons { align-self: end; }
.quick-filter-buttons .button { min-height: 44px; }
.standard-table-title { padding-bottom: 8px; }
.pager-summary { color: #475467; font-weight: 850; white-space: nowrap; }
.standard-data-table {
    table-layout: fixed;
    min-width: 0;
    width: 100%;
    font-size: 13.5px;
}
.standard-data-table th,
.standard-data-table td {
    padding: 10px 12px;
    line-height: 1.35;
    vertical-align: middle;
}
.standard-data-table thead th {
    position: static;
    white-space: normal;
    line-height: 1.2;
    background: #f3f6ff;
}
.standard-data-table thead th a { display: inline; }
.text-clip-cell {
    max-width: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.customer-cell { white-space: normal; }
.note-cell { color: #344054; }
.debt-table .col-date { width: 12%; }
.debt-table .col-customer { width: 30%; }
.debt-table .col-type { width: 13%; }
.debt-table .col-route { width: 15%; }
.debt-table .col-money { width: 14%; }
.debt-table .col-user { width: 8%; }
.debt-table .col-note { width: 8%; }
.broken-list-table .col-week { width: 10%; }
.broken-list-table .col-range { width: 15%; }
.broken-list-table .col-code { width: 21%; }
.broken-list-table .col-qty { width: 12%; }
.broken-list-table .col-money { width: 14%; }
.broken-list-table .col-status { width: 15%; }
.broken-list-table .col-note { width: 13%; }
.compact-month-table .col-date { width: 7%; }
.compact-month-table .col-status-wide { width: 14%; }
.compact-month-table .col-money { width: 9%; }
.compact-month-table .col-small { width: 6%; }
.month-table-scroll .standard-data-table { min-width: 1120px; }
.table-pager {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px;
}
.table-pager-top {
    border-top: 1px solid #d8e0ee;
    border-bottom: 0;
    background: #fbfdff;
}
.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #c7d7fe;
    color: #1648c6;
    background: #f8fbff;
    font-weight: 850;
    text-decoration: none;
}
.pager-link.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.pager-link.disabled { opacity: .45; pointer-events: none; }
.compact-month-status { gap: 16px; }
@media (max-width: 1180px) {
    .standard-list-filter,
    .month-standard-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .standard-list-filter .quick-filter-buttons,
    .standard-list-filter .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .standard-list-filter,
    .month-standard-filter { grid-template-columns: 1fr; }
    .standard-data-table { min-width: 920px; }
    .standard-table-title,
    .table-pager { flex-direction: column; align-items: stretch; }
    .pager-link { width: 100%; }
    .pager-summary { white-space: normal; }
}

/* V10 - pager gọn cùng chỗ chọn số dòng, theo chuẩn: Tổng | khoảng | [dòng] Trước 1 2 Sau */
.standard-table-title {
    align-items: flex-start;
}
.table-pager {
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 18px 14px;
}
.table-pager-top {
    padding-top: 10px;
    padding-bottom: 10px;
}
.pager-summary {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin-right: 4px;
    color: #344054;
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
}
.pager-page-size {
    margin: 0 4px 0 0;
}
.pager-page-size select {
    height: 38px;
    min-width: 112px;
    border: 1px solid #c7d7fe;
    border-radius: 12px;
    background: #fff;
    color: #0b1f3a;
    font-weight: 850;
    padding: 0 34px 0 12px;
}
.table-pager .pager-link {
    height: 38px;
    min-width: 40px;
}
@media (max-width: 760px) {
    .table-pager {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }
    .pager-summary {
        flex: 1 1 100%;
        white-space: normal;
    }
    .pager-page-size {
        flex: 1 1 auto;
    }
    .pager-page-size select {
        width: 100%;
    }
    .table-pager .pager-link {
        width: auto;
        flex: 0 0 auto;
    }
}

/* HR-G1 — Global human resources workspace. */
.hr-toolbar-card { padding: 14px 16px; margin-bottom: 14px; }
.hr-workspace { --ui-master-width: 350px; --ui-master-gap: 18px; }
.hr-list-card, .hr-detail-card { overflow: hidden; }
.hr-list-card .ui-section-header, .hr-detail-card > .ui-section-header { padding: 18px 20px 14px; }
.hr-employee-list { display: grid; gap: 8px; padding: 10px 12px 14px; max-height: calc(100vh - 275px); }
.hr-employee-card { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; gap: 11px; align-items: center; min-height: 68px; padding: 10px 12px; border: 1px solid var(--ui-border); border-radius: 14px; color: var(--ui-text-strong); text-decoration: none; background: #fff; }
.hr-employee-card:hover, .hr-employee-card.is-active { border-color: #8fb3ff; background: #f3f7ff; }
.hr-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #e8f0ff; color: #1f5eea; font-weight: 950; font-size: 18px; }
.hr-employee-main, .hr-employee-side { min-width: 0; display: grid; gap: 4px; }
.hr-employee-main small, .hr-employee-side small { color: var(--ui-text-muted); }
.hr-employee-side { justify-items: end; text-align: right; }
.hr-form-section { border-top: 1px solid var(--ui-border); }
.hr-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 18px 20px; }
.hr-form-grid label, .hr-version-form label, .hr-stop-form label { display: grid; gap: 6px; font-weight: 800; min-width: 0; }
.hr-form-grid input, .hr-form-grid select, .hr-form-grid textarea, .hr-version-form input, .hr-version-form select, .hr-version-form textarea, .hr-stop-form input { width: 100%; }
.hr-span-2 { grid-column: 1 / -1; }
.hr-check { display: flex !important; align-items: center; gap: 9px !important; min-height: 46px; padding: 9px 11px; border: 1px solid var(--ui-border); border-radius: 12px; background: #f8fafc; }
.hr-check input { width: auto !important; }
.hr-history-panel { border: 1px solid var(--ui-border); border-radius: 16px; overflow: hidden; background: #fff; }
.hr-history-panel .ui-section-header { padding: 14px 16px; background: #f8fbff; border-bottom: 1px solid var(--ui-border); }
.hr-stop-form { display: flex; align-items: end; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--ui-border); background: #fff8f7; }
:where(.hr-stop-form) .button-danger { min-height: 46px; border: 1px solid #f5b7b1; background: #fff; color: #b42318; }
@media (max-width: 1120px) { .hr-employee-list { max-height: none; grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .hr-form-grid, .hr-employee-list { grid-template-columns: 1fr; } .hr-stop-form { align-items: stretch; flex-direction: column; } }

/* HR-UX1 — Tabbed human resources workspace polish. */
.hr-page--ux1 .ui-page-header { margin-bottom: 14px; }
.hr-toolbar-card--ux1 { padding: 12px 14px; }
.hr-workspace--ux1 { --ui-master-width: 360px; --ui-master-gap: 18px; }
.hr-workspace--ux1 .hr-list-card,
.hr-detail-card--ux1 { border-color: #d9e4f7; }
.hr-list-header { background: linear-gradient(180deg, #fff, #f8fbff); }
.hr-workspace--ux1 .hr-employee-list { padding: 12px; gap: 10px; max-height: calc(100vh - 286px); }
.hr-workspace--ux1 .hr-employee-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.hr-workspace--ux1 .hr-employee-card.is-active {
    border-color: #77a2ff;
    background: linear-gradient(180deg, #f5f8ff, #eef5ff);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .08);
}
.hr-workspace--ux1 .hr-employee-main strong { font-size: 15px; font-weight: 900; }
.hr-workspace--ux1 .hr-employee-main small { line-height: 1.25; }
.hr-detail-card--ux1 { overflow: hidden; }
.hr-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-bottom: 1px solid var(--ui-border);
}
.hr-detail-title { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.hr-avatar--large { width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.hr-detail-title h2 { margin: 2px 0 5px; font-size: clamp(22px, 2vw, 29px); line-height: 1.08; letter-spacing: -.02em; }
.hr-detail-title p { margin: 0; color: var(--ui-text-muted); line-height: 1.45; }
.hr-summary-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 420px; }
.hr-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid #d7e2f5;
    border-radius: 999px;
    background: #fff;
    color: var(--ui-text-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.hr-detail-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-inline: 14px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}
.hr-detail-panel { padding: 16px 20px 20px; }

.hr-form-section--card {
    border: 1px solid var(--ui-border);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
}
.hr-subsection { border-bottom: 1px solid var(--ui-border); }
.hr-subsection:last-child { border-bottom: 0; }
.hr-subsection > header { padding: 16px 18px 0; }
.hr-subsection h3 { margin: 0 0 4px; font-size: 18px; font-weight: 950; letter-spacing: -.01em; }
.hr-subsection p { margin: 0; color: var(--ui-text-muted); }
.hr-form-section--card .hr-form-grid { padding: 16px 18px 18px; }
.hr-form-section--card .ui-action-bar { margin: 0; border-top: 1px solid var(--ui-border); background: #fbfdff; }
.hr-history-panel--single {
    border-radius: 18px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.hr-history-panel--single .ui-section-header { background: linear-gradient(180deg, #f8fbff, #f3f7ff); }
.hr-stop-form--ux1 {
    align-items: stretch;
    justify-content: space-between;
    padding: 18px;
    border: 1px solid #ffd2cc;
    border-radius: 18px;
    background: #fff8f7;
}
.hr-danger-copy { display: grid; gap: 4px; max-width: 520px; }
.hr-danger-copy strong { color: #b42318; font-size: 18px; }
.hr-danger-copy span { color: #7a271a; line-height: 1.45; }
.hr-empty-detail { min-height: 320px; }
@media (max-width: 1180px) {
    .hr-workspace--ux1 .hr-employee-list { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
    .hr-detail-hero { flex-direction: column; }
    .hr-summary-chips { justify-content: flex-start; max-width: none; }
    .hr-workspace--ux1 .hr-employee-list { grid-template-columns: 1fr; }
    .hr-detail-panel { padding: 14px; }
}

/* HF66 — Employee print handoff to the single shared Template Studio. */
.hr-print-template-handoff {
    display: grid;
    gap: 16px;
}
.hr-print-template-period {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    padding: 0 16px;
}
.hr-print-template-period label {
    display: grid;
    gap: 6px;
    min-width: min(100%, 260px);
    color: var(--ui-text-strong);
    font-size: 13px;
    font-weight: 900;
}
.hr-print-template-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    padding: 0 16px;
}
.hr-print-template-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #f8fbff);
}
.hr-print-template-option__copy {
    display: grid;
    gap: 7px;
    min-width: 0;
}
.hr-print-template-option h4,
.hr-print-template-option p {
    margin: 0;
}
.hr-print-template-option h4 {
    color: var(--ui-text-strong);
    font-size: 17px;
}
.hr-print-template-option p,
.hr-print-template-option small {
    overflow-wrap: anywhere;
}
.hr-print-template-option small {
    color: var(--ui-text-muted);
    line-height: 1.45;
}
.hr-print-template-option .button {
    white-space: nowrap;
}
.hr-print-template-note {
    margin: 0 16px 16px;
}
@media (max-width: 720px) {
    .hr-print-template-option {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .hr-print-template-option .button {
        width: 100%;
    }
}

/* F2-UI-HQA14 — Shared Salary Print Template UI */
.print-template-workspace {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.4fr);
    gap: 18px;
    align-items: start;
}

.print-template-list,
.print-template-editor,
.print-template-vars {
    overflow: hidden;
}

.print-template-form {
    display: grid;
    gap: 14px;
    padding: 16px 18px 18px;
}

.print-template-textarea {
    display: grid;
    gap: 8px;
}

.print-template-textarea > span,
.print-template-vars summary {
    color: var(--ui-text-strong);
    font-size: 13px;
    font-weight: 900;
}

.print-template-textarea textarea,
.print-template-preview pre,
.print-template-vars pre {
    width: 100%;
    margin: 0;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: #fbfdff;
    color: var(--ui-text-strong);
    font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    tab-size: 4;
}

.print-template-textarea textarea {
    min-height: 360px;
    padding: 14px;
    resize: vertical;
}

.print-template-preview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
    gap: 14px;
    padding: 0 18px 18px;
}

.print-template-preview {
    display: grid;
    gap: 8px;
}

.print-template-preview pre,
.print-template-vars pre {
    padding: 14px;
    overflow-x: auto;
}

.print-template-vars {
    padding: 14px 18px 18px;
}

.print-template-vars summary {
    cursor: pointer;
    margin-bottom: 10px;
}

@media (max-width: 980px) {
    .print-template-workspace,
    .print-template-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* UI-HQA15 — Global Responsive Layout + Print Template Share Mode */
@media (min-width: 1440px) {
    .hr-page--ux1 .ui-shell--wide,
    .print-template-page .ui-shell--wide,
    .salary-page .ui-shell--wide {
        width: min(1720px, 100%);
    }

    .hr-workspace--ux1 {
        grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    }
}

.print-template-workspace--fullhd {
    grid-template-columns: minmax(290px, .78fr) minmax(520px, 1.22fr) minmax(420px, 1fr);
    gap: 18px;
}

.print-template-preview-panel {
    overflow: hidden;
}

.print-template-preview-controls {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ui-border);
}

.print-template-preview-controls label {
    display: grid;
    gap: 6px;
    color: var(--ui-text-strong);
    font-size: 13px;
    font-weight: 900;
}

.print-template-preview--full {
    padding: 16px 18px 18px;
}

.print-template-preview--full pre {
    min-height: 520px;
    max-height: calc(100vh - 360px);
    overflow: auto;
}

.print-template-vars--wide {
    margin-top: 18px;
}

.print-template-vars--wide pre {
    columns: 2;
    column-gap: 34px;
    white-space: pre-wrap;
}

.print-template-assign-bar {
    align-items: end;
    border-bottom: 1px solid var(--ui-border);
    background: #fbfdff;
}

.salary-share-mode-tabs {
    margin-bottom: 0;
}

.salary-share-panel {
    margin-top: 0;
}

.salary-template-share-sheet {
    display: grid;
    gap: 18px;
}

.salary-template-share-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border: 1px solid #253555;
    border-radius: 20px;
    background: #111827;
    color: #fff;
}

.salary-template-share-heading h2 {
    margin: 4px 0 6px;
    font-size: 24px;
    line-height: 1.16;
}

.salary-template-share-heading p {
    margin: 0;
    color: #cbd5e1;
}

.salary-template-share-list {
    display: grid;
    gap: 18px;
}

.salary-template-share-card {
    max-width: 920px;
    width: 100%;
    margin-inline: auto;
}

.salary-template-share-card .salary-template-output {
    min-height: auto;
}

@media (max-width: 1360px) {
    .print-template-workspace--fullhd {
        grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
    }

    .print-template-preview-panel {
        grid-column: 1 / -1;
    }

    .print-template-preview--full pre {
        min-height: 360px;
        max-height: none;
    }
}

@media (max-width: 1080px) {
    .print-template-vars--wide pre {
        columns: 1;
    }
}

@media (max-width: 760px) {
    .print-template-workspace--fullhd {
        grid-template-columns: 1fr;
    }

    .print-template-preview-controls,
    .print-template-preview--full {
        padding-inline: 14px;
    }

    .print-template-textarea textarea,
    .print-template-preview pre,
    .print-template-vars pre,
    .salary-template-output {
        font-size: 12px;
        line-height: 1.42;
    }

    .salary-template-share-heading {
        flex-direction: column;
        padding: 16px;
    }

    .salary-template-share-heading .button {
        width: 100%;
    }

    .salary-template-share-card {
        border-radius: 18px;
    }
}

/* UI-HQA17 — Global Print Preview Workbench Refinement */
.print-template-topbar { margin-bottom: 0; }
.print-template-list-strip { overflow: hidden; }
.print-template-list-strip .ui-section-header { padding-bottom: 12px; }
.print-template-list-table {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}
.print-template-list-row {
    display: grid;
    grid-template-columns: 44px minmax(220px, 1.25fr) minmax(150px, .6fr) minmax(110px, .45fr) minmax(230px, .8fr);
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: #fff;
    color: var(--ui-text);
    text-decoration: none;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.print-template-list-row:hover,
.print-template-list-row.is-active {
    transform: translateY(-1px);
    border-color: #9dbbff;
    background: #f7faff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, .10);
}
.print-template-list-row__icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf4ff;
    color: var(--ui-primary);
    font-weight: 950;
}
.print-template-list-row__main,
.print-template-list-row__badges {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.print-template-list-row__main strong {
    color: var(--ui-text-strong);
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.print-template-list-row__main small,
.print-template-list-row__meta {
    color: var(--ui-text-muted);
    font-size: 12px;
    line-height: 1.35;
}
.print-template-list-row__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.print-template-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) 16px minmax(420px, .88fr);
    gap: 0;
    align-items: stretch;
    margin-top: 18px;
}
.print-template-workbench > .ui-card,
.print-template-workbench > .print-template-preview-panel,
.print-template-workbench > .print-template-form,
.print-template-workbench > .print-template-preview {
    min-width: 0;
}
.print-template-splitter {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 5px;
}
.print-template-splitter > span {
    width: 6px;
    min-height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #dce7f7, #f1f5fb 45%, #dce7f7);
    box-shadow: inset 0 0 0 1px rgba(126, 151, 184, .22);
}
.print-template-editor--workbench,
.print-template-preview-panel--workbench {
    height: 100%;
}
.print-template-editor--workbench .print-template-textarea textarea {
    min-height: 560px;
}
.print-template-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.print-template-preview-panel--workbench {
    overflow: hidden;
}
.print-template-preview-controls--workbench {
    border-bottom: 1px solid var(--ui-border);
}
.ui-print-preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.ui-print-preview-toolbar__group {
    display: inline-flex;
    gap: 6px;
    padding: 3px;
    border: 1px solid #d7e3f4;
    border-radius: 12px;
    background: #f7faff;
}
.ui-print-preview-toolbar .button {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
}
.ui-print-preview-toolbar .button.is-active,
.ui-print-preview-toolbar .button[aria-pressed="true"] {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}
.ui-print-preview {
    border: 1px solid var(--ui-border);
    border-radius: 18px;
    background: #fff;
    color: #071832;
    box-shadow: 0 16px 38px rgba(16, 24, 40, .08);
}
.ui-print-preview pre,
.print-template-preview.ui-print-preview pre,
.salary-template-output {
    font-variant-numeric: tabular-nums;
}
.ui-print-preview--light {
    background: #fff;
    color: #071832;
    border-color: #d7e1f1;
}
.ui-print-preview--light pre {
    background: #fbfdff;
    color: #071832;
    border-color: #d7e1f1;
}
.ui-print-preview--dark {
    background: #05070c;
    color: #f8fafc;
    border-color: #1f2937;
    box-shadow: 0 18px 46px rgba(2, 6, 23, .34);
}
.ui-print-preview--dark pre {
    background: #05070c;
    color: #f8fafc;
    border-color: #111827;
}
.print-template-preview-title {
    padding: 12px 14px 0;
}
.print-template-variable-search {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    max-width: 420px;
    color: var(--ui-text-strong);
    font-size: 13px;
    font-weight: 900;
}
.print-template-variable-search input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
}
.salary-template-share-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}
.salary-template-share-actions .ui-print-preview-toolbar {
    justify-content: flex-end;
}
.salary-template-share-card.ui-print-preview--light {
    background: #fff;
    color: #071832;
    border-color: #d7e1f1;
}
.salary-template-share-card.ui-print-preview--light .salary-dark-card__header {
    border-color: #d7e1f1;
    color: #071832;
}
.salary-template-share-card.ui-print-preview--light .salary-dark-card__header span,
.salary-template-share-card.ui-print-preview--light .salary-dark-card__header p {
    color: #667085;
}
.salary-template-share-card.ui-print-preview--light .salary-template-output {
    background: #fbfdff;
    color: #071832;
    border-color: #d7e1f1;
}
.salary-template-share-card.ui-print-preview--dark .salary-template-output {
    background: #05070c;
    color: #f8fafc;
    border-color: #111827;
}

@media (max-width: 1380px) {
    .print-template-list-row {
        grid-template-columns: 42px minmax(220px, 1fr) minmax(120px, .5fr) minmax(90px, .35fr);
    }
    .print-template-list-row__badges { grid-column: 2 / -1; justify-content: flex-start; }
    .print-template-workbench {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .print-template-splitter { display: none; }
    .print-template-editor--workbench .print-template-textarea textarea {
        min-height: 420px;
    }
}

@media (max-width: 860px) {
    .print-template-list-row {
        grid-template-columns: 40px minmax(0, 1fr);
        align-items: flex-start;
    }
    .print-template-list-row__meta,
    .print-template-list-row__badges { grid-column: 2; justify-content: flex-start; }
    .salary-template-share-actions {
        justify-items: stretch;
        width: 100%;
    }
    .salary-template-share-actions .ui-print-preview-toolbar {
        justify-content: stretch;
    }
    .salary-template-share-actions .button,
    .ui-print-preview-toolbar .button {
        flex: 1 1 auto;
    }
}

/* UI-HQA17-HF1 — Global table + print formatter alignment fix */
.print-template-list-scroll { max-height: 360px; }
.print-template-list-global-table { min-width: 980px; }
.print-template-list-global-table td small { color: var(--ui-text-muted); }
.button.button-small,
.button-small {
    min-height: var(--button-height-compact);
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 9px;
}
.ui-print-preview pre,
.print-template-preview.ui-print-preview pre,
.salary-template-output,
.salary-template-share-card pre {
    white-space: pre;
    overflow-x: auto;
    tab-size: 4;
}
.ui-print-preview pre::-webkit-scrollbar,
.print-template-preview.ui-print-preview pre::-webkit-scrollbar,
.salary-template-output::-webkit-scrollbar {
    height: 10px;
}
.ui-print-preview pre::-webkit-scrollbar-thumb,
.print-template-preview.ui-print-preview pre::-webkit-scrollbar-thumb,
.salary-template-output::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .55);
    border-radius: 999px;
}
@media (max-width: 768px) {
    .ui-print-preview pre,
    .print-template-preview.ui-print-preview pre,
    .salary-template-output,
    .salary-template-share-card pre {
        white-space: pre-wrap;
        overflow-wrap: normal;
    }
}

/* UI-HQA17-HF3 — template row select + cleaner global table selection */
.print-template-list-global-table tbody tr.print-template-select-row {
    cursor: pointer;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.print-template-list-global-table tbody tr.print-template-select-row:hover td {
    background: #f8fbff;
}
.print-template-list-global-table tbody tr.print-template-select-row:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .26);
    outline-offset: -3px;
}
.print-template-list-global-table tbody tr.is-selected-row td {
    background: #eef6ff;
    box-shadow: none;
}
.print-template-list-global-table tbody tr.is-selected-row td:first-child {
    box-shadow: inset 4px 0 0 #2563eb;
}
.print-template-list-global-table tbody tr.is-selected-row .button-small {
    border-color: rgba(37, 99, 235, .42);
    background: #fff;
}
.print-template-editor .ui-action-bar .button[disabled] {
    opacity: .68;
    cursor: not-allowed;
}

/* UI-HQA17-HF4: template delete/archive row actions */
.ui-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-action-form {
    display: inline-flex;
    margin: 0;
}

.ui-muted-hint {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.86rem;
}

.print-template-row-actions .button-danger {
    background: #fff7f5;
    border-color: #ffd1cc;
    color: #b42318;
}

.print-template-row-actions .button-danger:hover,
.print-template-row-actions .button-danger:focus-visible {
    background: #fee4e2;
    border-color: #fda29b;
}


/* R4B-P0D-HF72 — Human resources workspace uses the Global master/detail shell. */
.hr-list-card .ui-master-pane__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hr-employee-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}
.hr-employee-flags .ui-badge {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 10px;
}
.hr-employee-salary {
    color: var(--ui-text-strong);
    font-size: 12px;
    white-space: nowrap;
}
.hr-detail-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: min(100%, 280px);
}
.hr-current-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 8px;
    color: var(--ui-text-muted);
    font-size: 12px;
    font-weight: 750;
}
.hr-current-summary span {
    position: relative;
}
.hr-current-summary span + span::before {
    content: "•";
    position: absolute;
    left: -9px;
    color: #9aabc2;
}
.hr-profile-health {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #f0d59f;
    background: #fff9eb;
}
.hr-profile-health > strong { color: #9a5b00; }
.hr-profile-health > span { display: flex; flex-wrap: wrap; gap: 7px; }
.hr-profile-health a.ui-badge { text-decoration: none; }
.hr-readonly-status {
    display: grid;
    align-content: center;
    gap: 3px;
    min-height: 46px;
    padding: 9px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: #f8fafc;
}
.hr-readonly-status span,
.hr-readonly-status small { color: var(--ui-text-muted); }
.hr-form-action-dock {
    position: sticky;
    bottom: 0;
    z-index: 6;
    box-shadow: 0 -12px 24px rgba(16, 36, 64, .08);
}
.hr-danger-disclosure {
    margin: 0 20px 20px;
    border-color: #f4c5bf;
    box-shadow: none;
}
.hr-danger-disclosure > .ui-disclosure__summary {
    background: linear-gradient(180deg, #fffaf9, #fff4f2);
}
.hr-danger-disclosure > .ui-disclosure__summary strong { color: #b42318; }
@media (max-width: 780px) {
    .hr-detail-actions { justify-items: start; min-width: 0; }
    .hr-profile-health { align-items: flex-start; flex-direction: column; }
    .hr-danger-disclosure { margin-inline: 14px; }
}


/* R4B-P0D-HF73 — Effective-state-first HR assignment and salary history. */
.hr-effective-workspace {
    display: grid;
    gap: 16px;
}
.hr-current-state-card {
    overflow: hidden;
    border: 1px solid #cbdcf7;
    border-radius: 18px;
    background: linear-gradient(180deg, #f9fcff 0%, #f2f7ff 100%);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.hr-current-state-card.is-empty {
    border-style: dashed;
    border-color: #efc77f;
    background: #fffaf0;
}
.hr-current-state-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px 12px;
}
.hr-current-state-card__header h3 {
    margin: 3px 0 0;
    color: var(--ui-text-strong);
    font-size: 21px;
    line-height: 1.2;
}
.hr-current-state-empty { min-height: 112px; padding-top: 4px; }
.hr-current-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}
.hr-current-facts > div,
.hr-salary-summary-grid > div,
.hr-salary-live-summary > div {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid #dce6f5;
    border-radius: 13px;
    background: rgba(255, 255, 255, .88);
}
.hr-current-facts span,
.hr-salary-summary-grid span,
.hr-salary-live-summary span {
    color: var(--ui-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.hr-current-facts strong,
.hr-salary-summary-grid strong,
.hr-salary-live-summary strong {
    color: var(--ui-text-strong);
    font-size: 15px;
    line-height: 1.3;
}
.hr-salary-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}
.hr-salary-summary-grid > div.is-primary {
    border-color: #a8c6ff;
    background: #edf4ff;
}
.hr-salary-summary-grid > div.is-primary strong { color: #164fbd; font-size: 18px; }
.hr-salary-summary-grid > div.is-warning {
    border-color: #efc77f;
    background: #fff8e8;
}
.hr-salary-summary-grid > div.is-warning strong { color: #9a5b00; }
.hr-salary-summary-grid small { color: var(--ui-text-muted); line-height: 1.35; }
.hr-history-panel--single > .ui-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hr-history-table { min-width: 780px; }
.hr-history-table td { vertical-align: top; }
.hr-history-table td > small {
    display: block;
    margin-top: 3px;
    color: var(--ui-text-muted);
}
.hr-salary-history-table { min-width: 1040px; }
.hr-value-warning {
    color: #a15c00 !important;
    font-weight: 800;
}
.hr-inline-details { min-width: 142px; }
.hr-inline-details > summary {
    width: max-content;
    cursor: pointer;
    color: #215fc7;
    font-weight: 850;
    list-style: none;
}
.hr-inline-details > summary::-webkit-details-marker { display: none; }
.hr-inline-details > summary::after { content: " +"; }
.hr-inline-details[open] > summary::after { content: " −"; }
.hr-inline-details > div {
    display: grid;
    gap: 5px;
    min-width: 290px;
    margin-top: 9px;
    padding: 10px 11px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: #f8fbff;
    color: var(--ui-text-muted);
    font-size: 12px;
    line-height: 1.4;
}
.hr-inline-details strong { color: var(--ui-text-strong); }
.hr-version-disclosure {
    box-shadow: none;
    border-color: #cbdcf0;
}
.hr-version-form {
    display: grid;
    gap: 0;
}
.hr-form-block {
    padding: 0 0 16px;
    border-bottom: 1px solid var(--ui-border);
}
.hr-form-block + .hr-form-block { padding-top: 16px; }
.hr-form-block > header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.hr-form-block > header h4 {
    margin: 0 0 3px;
    color: var(--ui-text-strong);
    font-size: 16px;
}
.hr-form-block > header p {
    margin: 0;
    color: var(--ui-text-muted);
    line-height: 1.4;
}
.hr-form-block__index {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #e6efff;
    color: #235ec9;
    font-size: 12px;
    font-weight: 950;
}
.hr-form-grid--compact { padding: 0; gap: 12px; }
.hr-version-form__actions {
    margin: 16px -18px -18px;
    border-radius: 0;
    background: #f8fbff;
}
.hr-salary-live-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #cbdcf7;
    border-radius: 14px;
    background: #f5f9ff;
}
.hr-salary-live-summary > p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--ui-text-muted);
    font-size: 12px;
}
.hr-salary-live-summary.is-warning {
    border-color: #efc77f;
    background: #fff9eb;
}
.hr-salary-live-summary.is-warning [data-hr-unallocated] { color: #9a5b00; }
.hr-salary-live-summary.is-danger {
    border-color: #efb3af;
    background: #fff4f2;
}
.hr-salary-live-summary.is-danger strong,
.hr-salary-live-summary.is-danger p { color: #b42318; }
.hr-conditional-field[hidden] { display: none !important; }

@media (max-width: 980px) {
    .hr-current-facts,
    .hr-salary-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .hr-current-state-card__header,
    .hr-history-panel--single > .ui-section-header { align-items: flex-start; flex-direction: column; }
    .hr-current-facts,
    .hr-salary-summary-grid,
    .hr-salary-live-summary { grid-template-columns: 1fr; }
    .hr-salary-live-summary > p { grid-column: auto; }
    .hr-version-form__actions { margin-inline: -18px; }
}

/* R4B-P0D-HF83 — Legal identity, BHXH and payment workspace inside Global HR. */
.hr-internal-name,
.hr-legal-alias {
    color: var(--ui-text-muted);
}
.hr-legal-alias {
    margin-top: 2px !important;
}
.hr-legal-workspace {
    display: grid;
    gap: 16px;
}
.hr-legal-scope-form {
    display: grid;
    gap: 14px;
    padding: 0 18px 18px;
}
.hr-capability-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.hr-legal-scope-form > .hr-span-2 {
    display: grid;
    gap: 6px;
    font-weight: 800;
}
.hr-legal-scope-form > .hr-span-2 input {
    width: 100%;
}
.hr-legal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.hr-legal-grid .hr-current-state-card {
    min-height: 220px;
}
.hr-legal-grid .hr-current-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-bank-current {
    display: grid;
    gap: 7px;
    padding: 4px 18px 20px;
}
.hr-bank-number {
    color: var(--ui-text-strong);
    font-size: clamp(24px, 2.1vw, 31px);
    line-height: 1.05;
    letter-spacing: .025em;
    overflow-wrap: anywhere;
}
.hr-bank-current span {
    color: var(--ui-text-strong);
    font-weight: 800;
}
.hr-bank-current small {
    color: var(--ui-text-muted);
}
.hr-legal-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}
.hr-legal-history-grid .ui-data-shell {
    min-width: 0;
}
.hr-legal-history-grid table {
    min-width: 560px;
}
.hr-legal-history-grid caption {
    padding: 10px 12px;
    color: var(--ui-text-strong);
    font-weight: 900;
    text-align: left;
    background: #f8fbff;
}
.hr-bhxh-policy-card {
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}
.hr-bhxh-rates {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    padding: 0 18px 18px;
}
.hr-bhxh-rates > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #dce6f5;
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
}
.hr-bhxh-rates span {
    color: var(--ui-text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.hr-bhxh-rates strong {
    color: var(--ui-text-strong);
    font-size: 16px;
}
@media (max-width: 1080px) {
    .hr-capability-grid,
    .hr-bhxh-rates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-legal-grid,
    .hr-legal-history-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .hr-capability-grid,
    .hr-bhxh-rates { grid-template-columns: 1fr; }
    .hr-legal-scope-form { padding-inline: 14px; }
    .hr-legal-grid .hr-current-facts { grid-template-columns: 1fr; }
}

/* HF87B — dữ liệu pháp lý theo tháng; chỉ thuộc màn Doanh nghiệp & BHXH. */
.dn-blocker-list { margin: 8px 0 0 20px; padding: 0; }
.dn-blocker-list li + li { margin-top: 4px; }

/* HF97.11A.2 — salary history reads compactly; component editing lives in a dedicated full-width workspace. */
.hr-history-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hr-salary-component-editor {
    display: grid;
    gap: 14px;
    margin: 14px 18px 18px;
    padding: 18px;
    border: 1px solid #b8cff4;
    border-radius: 16px;
    background: #f8fbff;
    scroll-margin-top: 92px;
}

.hr-salary-component-editor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hr-salary-component-editor__header h4 {
    margin: 3px 0 4px;
    color: var(--ui-text-strong);
    font-size: 18px;
}

.hr-salary-component-editor__header p {
    max-width: 820px;
    margin: 0;
    color: var(--ui-text-muted);
    line-height: 1.45;
}

.hr-salary-component-editor__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-salary-component-editor__preserved {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.hr-salary-component-editor__preserved > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface);
}

.hr-salary-component-editor__preserved span {
    color: var(--ui-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.hr-salary-component-editor__preserved strong {
    overflow-wrap: anywhere;
    color: var(--ui-text-strong);
}

.hr-salary-component-editor__actions {
    margin: 0;
}

@media (max-width: 900px) {
    .hr-salary-component-editor__preserved {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .hr-salary-component-editor {
        margin-inline: 10px;
        padding: 14px;
    }
    .hr-salary-component-editor__header {
        flex-direction: column;
    }
    .hr-salary-component-editor__grid,
    .hr-salary-component-editor__preserved {
        grid-template-columns: 1fr;
    }
}

/* HF97.11B.2 — Global employee template quick assignment inside the shared HR source. */
.hr-print-template-option--quick {
    grid-template-columns: 1fr;
    align-items: stretch;
}
.hr-print-template-option__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.hr-print-template-current {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #d9e4f2;
    border-radius: 12px;
    background: #fff;
}
.hr-print-template-current strong {
    color: var(--ui-text-strong);
    font-size: 15px;
}
.hr-print-template-quick-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, .45fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    background: #f7fbff;
}
.hr-print-template-quick-form label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--ui-text-strong);
    font-size: 12px;
    font-weight: 900;
}
.hr-print-template-quick-form select,
.hr-print-template-quick-form input {
    width: 100%;
    min-width: 0;
}
.hr-print-template-option__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
@media (max-width: 900px) {
    .hr-print-template-quick-form {
        grid-template-columns: 1fr 1fr;
    }
    .hr-print-template-quick-form .button {
        grid-column: 1 / -1;
        width: 100%;
    }
}
@media (max-width: 620px) {
    .hr-print-template-option__heading {
        flex-direction: column;
    }
    .hr-print-template-quick-form {
        grid-template-columns: 1fr;
    }
    .hr-print-template-quick-form .button {
        grid-column: auto;
    }
    .hr-print-template-option__actions .button {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* Module 1 Thu nợ — consume Global searchable-combobox; no local dropdown owner. */
.yen-debt-customer-field {
    min-width: 0;
    display: grid;
    gap: 7px;
    font-weight: 900;
    color: #182230;
}
.yen-debt-customer-field > span { font-size: 15px; }
.yen-debt-customer-field .ui-search-combobox { width: 100%; min-width: 0; }
.yen-debt-customer-field .ui-search-combobox__input { font-size: 18px; }
.yen-debt-other-wrap { min-width: 0; }
.yen-debt-other-wrap[hidden] { display: none !important; }
.yen-debt-other-wrap > input { width: 100%; }
/* Hàng bể mobile: giữ Từ ngày / Đến ngày trên cùng một hàng để giảm chiều cao toolbar. */
.hangbe-date-range-pair { display: contents; }
@media (max-width: 640px) {
    .ui-toolbar--horizontal > .hangbe-date-range-pair {
        flex: 1 1 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        min-width: 0;
    }
    .hangbe-date-range-pair > label {
        min-width: 0;
        margin: 0;
    }
    .hangbe-date-range-pair > label > input {
        width: 100%;
        min-width: 0;
    }
}
/* Module 1 entry follow-up rhythm: ui-stack is the single vertical-spacing owner.
   Only the legacy toolbar margin is neutralized when it participates in this flow. */
.module1-entry-followup-flow > .module1-entry-followup-flow__toolbar {
    margin-bottom: 0;
}

