.hr-page {
    min-height: 100vh;
    padding: 18px;
    background: #f5f6f8;
    color: #17233a;
    font-family: "Segoe UI", system-ui, sans-serif;
    box-sizing: border-box;
}

.hr-page *, .hr-page *::before, .hr-page *::after { box-sizing: border-box; }

.hr-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
    padding: 2px 0 12px;
    border-bottom: 2px solid #d9a600;
}

.hr-header h1 { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 750; letter-spacing: 0; }
.hr-header p { margin: 5px 0 0; color: #657087; font-size: 13px; }

.hr-view-tabs { display: flex; align-items: center; gap: 4px; }
.hr-view-tabs a {
    color: #526078;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    padding: 8px 12px;
    border-bottom: 3px solid transparent;
}
.hr-view-tabs a:hover, .hr-view-tabs a.active { color: #17233a; border-bottom-color: #d9a600; }

.hr-filter-bar {
    display: grid;
    grid-template-columns: minmax(120px, .65fr) minmax(240px, 1.35fr) minmax(260px, 1.5fr) auto auto;
    align-items: end;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
}

.hr-filter-field { min-width: 0; }
.hr-filter-field label {
    display: block;
    margin-bottom: 5px;
    color: #566177;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}
.hr-filter-context { display: flex; gap: 10px; align-self: center; color: #6a7488; font-size: 12px; white-space: nowrap; }
.hr-filter-context span + span::before { content: "|"; color: #c3c9d3; margin-right: 10px; }
.hr-filter-actions, .hr-directory-actions { display: flex; align-items: center; gap: 7px; }

.hr-btn, .hr-icon-btn, .hr-link-btn {
    border: 0;
    font: inherit;
    cursor: pointer;
}
.hr-btn:disabled, .hr-icon-btn:disabled { opacity: .55; cursor: wait; }
.hr-btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}
.hr-btn-primary { color: #fff; background: #1e2d4a; }
.hr-btn-primary:hover { background: #2b3e62; }
.hr-btn-secondary { color: #1e2d4a; background: #fff; border: 1px solid #aeb7c6; }
.hr-btn-secondary:hover { border-color: #1e2d4a; }
.hr-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #aeb7c6;
    border-radius: 4px;
    color: #1e2d4a;
    background: #fff;
    font-size: 17px;
}
.hr-icon-btn:hover { border-color: #1e2d4a; }
.hr-link-btn { background: transparent; color: #1e2d4a; font-size: 12px; font-weight: 700; white-space: nowrap; }

.hr-sf-control { width: 100%; }
.hr-page .e-input-group, .hr-page .e-control-wrapper { border-radius: 4px !important; }

.hr-loading-line { height: 3px; overflow: hidden; background: #e4e8ef; }
.hr-loading-line span { display: block; width: 38%; height: 100%; background: #d9a600; animation: hr-loading 1s ease-in-out infinite alternate; }
@keyframes hr-loading { from { transform: translateX(-25%); } to { transform: translateX(185%); } }

.hr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.hr-kpi {
    min-width: 0;
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    text-align: left;
    color: #17233a;
    background: #fff;
    border: 1px solid #d9dee7;
    border-top: 3px solid #d9a600;
    border-radius: 6px;
    cursor: pointer;
}
.hr-kpi:hover { border-color: #9da8b9; box-shadow: 0 3px 10px rgba(23, 35, 58, .08); }
.hr-kpi > span:last-child { min-width: 0; }
.hr-kpi small { display: block; margin-bottom: 4px; color: #657087; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.hr-kpi strong { display: block; font-size: 24px; line-height: 1.1; font-weight: 750; overflow-wrap: anywhere; }
.hr-kpi-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; color: #fff; border-radius: 4px; font-size: 18px; }
.hr-kpi-icon.navy { background: #1e2d4a; }
.hr-kpi-icon.teal { background: #168f8a; }
.hr-kpi-icon.coral { background: #d56a5d; }
.hr-kpi-icon.gold { background: #b88900; }
.hr-kpi-icon.red { background: #bb3f4a; }
.hr-kpi-icon.violet { background: #76569b; }
.hr-kpi-icon.green { background: #3f7f5f; }

.hr-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hr-panel {
    min-width: 0;
    padding: 14px;
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    overflow: hidden;
}
.hr-panel-wide { grid-column: span 1; }
.hr-panel-full { grid-column: 1 / -1; }
.hr-panel-heading { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.hr-panel-heading h2 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 750; letter-spacing: 0; }
.hr-panel-heading p { margin: 3px 0 0; color: #727c8e; font-size: 11px; }
.hr-panel-heading > i { color: #707b8e; }

.hr-rate-cell { position: relative; min-height: 24px; display: flex; align-items: center; justify-content: flex-end; overflow: hidden; background: #edf0f4; }
.hr-rate-cell span { position: absolute; inset: 0 auto 0 0; background: #d7a300; opacity: .65; }
.hr-rate-cell strong { position: relative; z-index: 1; padding: 0 7px; font-size: 12px; }

.hr-state {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #5d687c;
    background: #fff;
    border: 1px solid #d9dee7;
}
.hr-state > i { font-size: 26px; color: #9a7410; }
.hr-state div { display: flex; flex-direction: column; gap: 4px; }
.hr-state strong { color: #17233a; }
.hr-state span { font-size: 13px; }
.hr-state-error > i { color: #bb3f4a; }

.hr-directory-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
}
.hr-directory-actions { align-self: end; }
.hr-directory-summary {
    display: flex;
    align-items: stretch;
    gap: 1px;
    margin-top: 12px;
    background: #d9dee7;
    border: 1px solid #d9dee7;
}
.hr-directory-summary > div { min-width: 120px; display: flex; flex-direction: column; padding: 10px 14px; background: #fff; }
.hr-directory-summary strong { font-size: 20px; line-height: 1.1; }
.hr-directory-summary span { margin-top: 3px; color: #6b7587; font-size: 11px; text-transform: uppercase; }
.hr-directory-summary .hr-btn { align-self: center; margin-left: auto; margin-right: 10px; }
.hr-directory-grid { margin-top: 12px; background: #fff; border: 1px solid #d9dee7; overflow: hidden; }
.hr-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #6e788a; }
.hr-empty i { font-size: 30px; color: #9aa4b5; }
.hr-empty strong { color: #27344c; }
.hr-empty span { font-size: 13px; }
.hr-status, .hr-bad-hire { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 3px 7px; border-radius: 3px; font-size: 11px; font-weight: 750; }
.hr-status.active { color: #266145; background: #dcefe5; }
.hr-status.inactive { color: #8b3038; background: #f6dde0; }
.hr-bad-hire.yes { color: #8b3038; background: #f6dde0; }
.hr-bad-hire.no { color: #536074; background: #e9edf2; }

@media (max-width: 1200px) {
    .hr-filter-bar { grid-template-columns: 130px minmax(210px, 1fr) minmax(220px, 1fr) auto; }
    .hr-filter-context { grid-column: 1 / -1; }
    .hr-directory-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 900px) {
    .hr-page { padding: 12px; }
    .hr-header { align-items: flex-start; flex-direction: column; gap: 8px; }
    .hr-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-filter-actions { align-self: end; }
    .hr-chart-grid { grid-template-columns: 1fr; }
    .hr-panel-full, .hr-panel-wide { grid-column: auto; }
    .hr-directory-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-directory-summary { overflow-x: auto; }
}

@media (max-width: 560px) {
    .hr-header h1 { font-size: 21px; }
    .hr-view-tabs { width: 100%; }
    .hr-view-tabs a { flex: 1; text-align: center; }
    .hr-filter-bar, .hr-directory-filters { grid-template-columns: 1fr; }
    .hr-filter-actions, .hr-directory-actions { width: 100%; }
    .hr-filter-actions .hr-btn, .hr-directory-actions .hr-btn { flex: 1; }
    .hr-filter-context { flex-wrap: wrap; }
    .hr-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-kpi { min-height: 96px; align-items: flex-start; flex-direction: column; }
    .hr-kpi strong { font-size: 20px; }
}
