/* ════════════════════════════════════════════════════════════════════
   QUẢN TRỊ NHÂN SỰ (/hrm)
   CSS tập trung (rule dự án: 100% ở wwwroot/css, không scoped/inline).
   Dùng token --ag-* / --mud-palette-* để hợp cả Dark/Light. Màu HEX chỉ
   dùng cho NGỮ NGHĨA (lương = xanh, nghỉ việc = đỏ/cam, tuyển mới = lam).
   Bắt chước design language phân hệ Kho (whs-*) sang prefix hrm-.
   ════════════════════════════════════════════════════════════════════ */

.hrm-page {
    --hrm-pos: #22c55e;      /* tốt / lương / tuyển mới (xanh lá) */
    --hrm-neg: #ef4444;      /* nghỉ việc / rủi ro (đỏ) */
    --hrm-warn: #f59e0b;     /* cảnh báo / sắp tới (cam) */
    --hrm-info: #38bdf8;     /* thông tin / headcount (lam) */
    --hrm-accent: #a78bfa;   /* nhấn phụ (tím) */
    --hrm-line: rgba(var(--ag-fg-rgb), 0.08);
}

.hrm-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Panel tab: chừa khoảng thở, không tràn ngang trên mobile. */
.hrm-panel {
    min-height: 340px;
    overflow-x: hidden;
}

/* ── Loading / Empty dùng chung ─────────────────────────────────────── */
.hrm-tab-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.hrm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 44px 16px;
    text-align: center;
    color: rgba(var(--ag-fg-rgb), 0.5);
}

.hrm-empty .mud-icon-root {
    font-size: 2.4rem;
    opacity: 0.7;
}

.hrm-empty--sm {
    padding: 22px 12px;
    font-size: 0.85rem;
}

/* ════════════════════════════════════════════════════════════════════
   TAB 1 — Tổng quan (scorecard + charts + sinh nhật)
   ════════════════════════════════════════════════════════════════════ */
.hrm-overview-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: rgba(var(--ag-fg-rgb), 0.6);
}

.hrm-overview-meta .mud-icon-root {
    font-size: 1rem;
}

.hrm-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hrm-score {
    position: relative;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(var(--ag-fg-rgb), 0.03);
    border: 1px solid var(--hrm-line);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.hrm-score:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--ag-fg-rgb), 0.18);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.hrm-score__top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.hrm-score__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(var(--ag-fg-rgb), 0.6);
    flex: 1 1 auto;
}

.hrm-score__value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.hrm-score__hint {
    margin-top: 4px;
    font-size: 0.74rem;
    color: rgba(var(--ag-fg-rgb), 0.45);
}

/* Accent theo tone — viền trái + màu số/icon. */
.hrm-tone-pos    { border-left: 3px solid var(--hrm-pos); }
.hrm-tone-pos .hrm-score__value,
.hrm-tone-pos .hrm-score__icon { color: var(--hrm-pos); }

.hrm-tone-neg    { border-left: 3px solid var(--hrm-neg); }
.hrm-tone-neg .hrm-score__value,
.hrm-tone-neg .hrm-score__icon { color: var(--hrm-neg); }

.hrm-tone-warn   { border-left: 3px solid var(--hrm-warn); }
.hrm-tone-warn .hrm-score__value,
.hrm-tone-warn .hrm-score__icon { color: var(--hrm-warn); }

.hrm-tone-info   { border-left: 3px solid var(--hrm-info); }
.hrm-tone-info .hrm-score__value,
.hrm-tone-info .hrm-score__icon { color: var(--hrm-info); }

.hrm-tone-accent { border-left: 3px solid var(--hrm-accent); }
.hrm-tone-accent .hrm-score__value,
.hrm-tone-accent .hrm-score__icon { color: var(--hrm-accent); }

/* Lưới biểu đồ: headcount (rộng) + giới tính (hẹp); xu hướng chiếm cả hàng. */
.hrm-chart-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.hrm-chart { min-width: 0; }

.hrm-chart__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.86rem;
    margin-bottom: 6px;
}

.hrm-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 240px;
    color: rgba(var(--ag-fg-rgb), 0.4);
    font-size: 0.85rem;
}

/* ── Widget Sinh nhật tháng này ─────────────────────────────────────── */
.hrm-bday-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.hrm-bday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background .14s ease;
}

.hrm-bday-item:hover {
    background: rgba(var(--ag-fg-rgb), 0.04);
}

.hrm-bday-item__main {
    flex: 1 1 auto;
    min-width: 0;
}

.hrm-bday-item__name {
    font-weight: 600;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrm-bday-item__sub {
    font-size: 0.74rem;
    color: rgba(var(--ag-fg-rgb), 0.5);
}

.hrm-bday-item__date {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    color: var(--hrm-accent);
}

.hrm-bday-item__day {
    font-size: 1.05rem;
    font-weight: 800;
}

.hrm-bday-item__mon {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

/* ════════════════════════════════════════════════════════════════════
   TAB 2 — Nhân sự (directory)
   ════════════════════════════════════════════════════════════════════ */
.hrm-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 4px;
}

.hrm-search {
    max-width: 260px;
}

.hrm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hrm-emp-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.hrm-emp-cell__main { min-width: 0; }

.hrm-emp-cell__name {
    font-weight: 600;
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrm-emp-cell__id {
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.72rem;
    color: rgba(var(--ag-fg-rgb), 0.5);
}

.hrm-table .hrm-mono {
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.82rem;
}

.hrm-salary { color: var(--hrm-pos); font-weight: 700; }
.hrm-muted  { color: rgba(var(--ag-fg-rgb), 0.4); }

.hrm-row-click { cursor: pointer; }

/* ════════════════════════════════════════════════════════════════════
   Bảng master-data dùng chung (Ca / OT / Nghỉ / Lễ)
   ════════════════════════════════════════════════════════════════════ */
.hrm-md-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.hrm-md-code {
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Hệ số OT hiển thị nổi bật (vd 1.5× / 2× / 3×). */
.hrm-multiplier {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.86rem;
    background: rgba(56, 189, 248, 0.12);
    color: var(--hrm-info);
    border: 1px solid rgba(56, 189, 248, 0.28);
}

.hrm-multiplier--hot {
    background: rgba(245, 158, 11, 0.14);
    color: var(--hrm-warn);
    border-color: rgba(245, 158, 11, 0.3);
}

.hrm-multiplier--max {
    background: rgba(239, 68, 68, 0.14);
    color: var(--hrm-neg);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Chip phẳng nhỏ gọn trong bảng. */
.hrm-chip-flat.mud-chip {
    height: 20px;
    font-size: 0.7rem;
    margin: 0;
}

/* ── Dialog (hồ sơ NV / master-data) ────────────────────────────────── */
.hrm-dialog-section {
    font-weight: 700;
    font-size: 0.82rem;
    color: rgba(var(--ag-fg-rgb), 0.55);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 8px 0 2px;
}

.hrm-profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.hrm-profile-head__main { min-width: 0; }

.hrm-profile-head__name {
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.2;
}

.hrm-profile-head__sub {
    font-size: 0.8rem;
    color: rgba(var(--ag-fg-rgb), 0.55);
}

/* ════════════════════════════════════════════════════════════════════
   Màu tiền/giờ ngữ nghĩa dùng chung (Phase 2/3/4)
   ════════════════════════════════════════════════════════════════════ */
.hrm-amount-pos { color: var(--hrm-pos); font-weight: 700; }
.hrm-amount-neg { color: var(--hrm-neg); font-weight: 600; }
.hrm-amount-ot  { color: var(--hrm-warn); font-weight: 700; }
.hrm-amount-net { color: var(--hrm-pos); font-weight: 800; }

/* Cắt gọn nội dung dài (lý do đơn) trong ô bảng. */
.hrm-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 260px;
    font-size: 0.82rem;
}

/* Sub-tabs (Đơn từ) + đôi nút duyệt/từ chối. */
.hrm-subtabs { margin-top: 4px; }

.hrm-approve-actions {
    display: inline-flex;
    gap: 2px;
    justify-content: center;
}

/* ════════════════════════════════════════════════════════════════════
   TAB — Chấm công (lưới NV × ngày)
   ════════════════════════════════════════════════════════════════════ */
.hrm-att-toolbar,
.hrm-req-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.hrm-att-score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Chú giải ký hiệu trạng thái. */
.hrm-att-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: rgba(var(--ag-fg-rgb), 0.6);
    margin-bottom: 8px;
}

.hrm-att-legend span { display: inline-flex; align-items: center; gap: 5px; }

.hrm-att-legend__hint {
    margin-left: auto;
    font-style: italic;
    color: rgba(var(--ag-fg-rgb), 0.4);
}

.hrm-att-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

/* Khung cuộn ngang cho lưới rộng. */
.hrm-att-scroll {
    overflow-x: auto;
    border: 1px solid var(--hrm-line);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.hrm-att-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 0.8rem;
}

.hrm-att-table th,
.hrm-att-table td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid var(--hrm-line);
    white-space: nowrap;
}

.hrm-att-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--mud-palette-surface, rgba(var(--ag-fg-rgb), 0.02));
    backdrop-filter: blur(4px);
    font-weight: 700;
    color: rgba(var(--ag-fg-rgb), 0.7);
}

/* Cột NV ghim trái (sticky cả header lẫn body). */
.hrm-att-sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--mud-palette-surface, rgba(var(--ag-fg-rgb), 0.02));
    text-align: left !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.hrm-att-table thead .hrm-att-sticky { z-index: 4; }

.hrm-att-th-emp { min-width: 150px; }
.hrm-att-th-sum { min-width: 46px; color: rgba(var(--ag-fg-rgb), 0.55); }

.hrm-att-th-day {
    min-width: 34px;
    line-height: 1.1;
}

.hrm-att-th-day--we { color: var(--hrm-neg); }

.hrm-att-th-day__num { display: block; font-size: 0.82rem; font-weight: 700; }
.hrm-att-th-day__dow { display: block; font-size: 0.6rem; opacity: 0.7; }

.hrm-att-emp { min-width: 150px; }
.hrm-att-emp__name {
    font-weight: 600;
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.hrm-att-emp__sub {
    font-size: 0.7rem;
    color: rgba(var(--ag-fg-rgb), 0.5);
}

/* Cột tổng hợp NV (bên cạnh tên). */
.hrm-att-sum { font-weight: 700; font-size: 0.82rem; }
.hrm-att-sum--work   { color: var(--hrm-pos); }
.hrm-att-sum--ot     { color: var(--hrm-warn); }
.hrm-att-sum--leave  { color: var(--hrm-info); }
.hrm-att-sum--absent { color: var(--hrm-neg); }

.hrm-att-cell-wrap { padding: 2px !important; }

/* Ô trạng thái 1 ngày — nút bấm để sửa. */
.hrm-att-cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: rgba(var(--ag-fg-rgb), 0.7);
    transition: transform .1s ease, box-shadow .1s ease;
}

.hrm-att-cell:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hrm-att-cell:focus-visible {
    outline: 2px solid var(--hrm-info);
    outline-offset: 1px;
}

.hrm-att-cell--present    { background: rgba(34, 197, 94, 0.16); color: var(--hrm-pos); border-color: rgba(34, 197, 94, 0.3); }
.hrm-att-cell--leave      { background: rgba(56, 189, 248, 0.16); color: var(--hrm-info); border-color: rgba(56, 189, 248, 0.3); }
.hrm-att-cell--holiday    { background: rgba(167, 139, 250, 0.16); color: var(--hrm-accent); border-color: rgba(167, 139, 250, 0.3); }
.hrm-att-cell--absent     { background: rgba(239, 68, 68, 0.16); color: var(--hrm-neg); border-color: rgba(239, 68, 68, 0.3); }
.hrm-att-cell--incomplete { background: rgba(245, 158, 11, 0.16); color: var(--hrm-warn); border-color: rgba(245, 158, 11, 0.3); }
.hrm-att-cell--off        { background: rgba(var(--ag-fg-rgb), 0.05); color: rgba(var(--ag-fg-rgb), 0.4); }
.hrm-att-cell--empty      { color: rgba(var(--ag-fg-rgb), 0.25); }

/* Badge OT nhỏ góc ô. */
.hrm-att-ot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 4px;
    background: var(--hrm-warn);
    color: #fff;
}

/* ════════════════════════════════════════════════════════════════════
   TAB — Bảng lương (master-detail)
   ════════════════════════════════════════════════════════════════════ */
.hrm-payroll {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    align-items: start;
}

.hrm-payroll__periods { min-width: 0; }
.hrm-payroll__detail  { min-width: 0; }

.hrm-period-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 2px;
}

/* Thẻ kỳ lương (nút chọn). */
.hrm-period {
    text-align: left;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--hrm-line);
    background: rgba(var(--ag-fg-rgb), 0.02);
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease, transform .14s ease;
}

.hrm-period:hover { border-color: rgba(var(--ag-fg-rgb), 0.2); transform: translateX(2px); }

.hrm-period:focus-visible { outline: 2px solid var(--hrm-info); outline-offset: 1px; }

.hrm-period--active {
    border-color: var(--hrm-info);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: inset 3px 0 0 var(--hrm-info);
}

.hrm-period__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.hrm-period__code {
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-weight: 700;
    font-size: 0.84rem;
}

.hrm-period__range {
    font-size: 0.74rem;
    color: rgba(var(--ag-fg-rgb), 0.55);
    margin-bottom: 6px;
}

.hrm-period__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    color: rgba(var(--ag-fg-rgb), 0.6);
}

.hrm-period__foot span { display: inline-flex; align-items: center; gap: 3px; }
.hrm-period__foot .mud-icon-root { font-size: 0.9rem; }
.hrm-period__net { color: var(--hrm-pos); font-weight: 700; }

/* Thanh hành động kỳ. */
.hrm-payroll__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--hrm-line);
    margin-bottom: 14px;
}

.hrm-payroll__bar-main { min-width: 0; }
.hrm-payroll__bar-code { font-weight: 800; font-size: 1rem; }
.hrm-payroll__bar-sub {
    font-size: 0.78rem;
    color: rgba(var(--ag-fg-rgb), 0.55);
}

/* ════════════════════════════════════════════════════════════════════
   Phiếu lương chi tiết (payslip — chứng từ)
   ════════════════════════════════════════════════════════════════════ */
.hrm-payslip { padding: 4px 2px; }

.hrm-payslip__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--hrm-line);
    margin-bottom: 14px;
}

.hrm-payslip__head-main { flex: 1 1 auto; min-width: 0; }
.hrm-payslip__name { font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.hrm-payslip__sub {
    font-size: 0.8rem;
    color: rgba(var(--ag-fg-rgb), 0.55);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Dải chỉ số công. */
.hrm-payslip__metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.hrm-payslip__metric {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(var(--ag-fg-rgb), 0.03);
    border: 1px solid var(--hrm-line);
}

.hrm-payslip__metric .mud-icon-root { color: rgba(var(--ag-fg-rgb), 0.5); }
.hrm-payslip__metric-val { font-weight: 800; font-size: 0.98rem; line-height: 1.1; }
.hrm-payslip__metric-lbl { font-size: 0.68rem; color: rgba(var(--ag-fg-rgb), 0.5); }

/* 2 khối thu nhập / khấu trừ. */
.hrm-payslip__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.hrm-payslip__block {
    border-radius: 12px;
    border: 1px solid var(--hrm-line);
    padding: 14px;
}

.hrm-payslip__block--earn   { border-top: 3px solid var(--hrm-pos); }
.hrm-payslip__block--deduct { border-top: 3px solid var(--hrm-neg); }

.hrm-payslip__block-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.86rem;
    margin-bottom: 10px;
}

.hrm-payslip__block--earn .hrm-payslip__block-title   { color: var(--hrm-pos); }
.hrm-payslip__block--deduct .hrm-payslip__block-title { color: var(--hrm-neg); }

.hrm-payslip__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.86rem;
    border-bottom: 1px dashed var(--hrm-line);
}

.hrm-payslip__line:last-child { border-bottom: none; }

.hrm-payslip__line--sum {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--hrm-line);
    border-bottom: none;
    font-weight: 700;
}

/* Dòng NET nổi bật. */
.hrm-payslip__net {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.35);
    margin-bottom: 16px;
}

.hrm-payslip__net-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--hrm-pos);
}

.hrm-payslip__net-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--hrm-pos);
}

.hrm-payslip__lines-title {
    font-weight: 700;
    font-size: 0.84rem;
    color: rgba(var(--ag-fg-rgb), 0.6);
    margin-bottom: 6px;
}

/* Preview thời lượng trong dialog OT/Nghỉ. */
.hrm-ot-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(var(--ag-fg-rgb), 0.03);
    font-size: 0.85rem;
}

.hrm-ot-preview__val { color: var(--hrm-warn); font-size: 1rem; }
.hrm-ot-preview__field { max-width: 90px; }

/* ════════════════════════════════════════════════════════════════════
   Responsive — không tràn ngang; scorecard + chart xếp dọc.
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .hrm-score-grid { grid-template-columns: repeat(2, 1fr); }
    .hrm-chart-grid { grid-template-columns: 1fr; }
    .hrm-att-score-grid { grid-template-columns: repeat(2, 1fr); }
    .hrm-payroll { grid-template-columns: 1fr; }
    .hrm-period-list { max-height: 280px; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
    .hrm-period { min-width: 230px; }
}

@media (max-width: 600px) {
    .hrm-score-grid { grid-template-columns: 1fr; }
    .hrm-search { max-width: 100%; flex: 1 1 100%; }
    .hrm-toolbar { gap: 6px; }
    .hrm-md-toolbar { flex-direction: column; align-items: stretch; }
    .hrm-att-score-grid { grid-template-columns: 1fr; }
    .hrm-payslip__metrics { grid-template-columns: repeat(2, 1fr); }
    .hrm-payslip__cols { grid-template-columns: 1fr; }
    .hrm-payslip__net-value { font-size: 1.25rem; }
    .hrm-att-legend__hint { margin-left: 0; flex-basis: 100%; }
}
