.hr-modal-content {
    width: min(96vw, 1380px);
    height: min(calc(100dvh - 72px), 900px);
    min-height: 580px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #151824;
    color: #edf1f7;
    font-family: var(--ui-font-family);
}

.hr-header {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 13px 18px;
    background: #0e1320;
    border-bottom: 2px solid #54d2b0;
}

.hr-header h2 {
    margin: 0;
    color: #72e4c5;
    font-size: 16px;
}

.hr-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #c4ced8;
    cursor: pointer;
}

.hr-close:focus-visible,
.hr-command-button:focus-visible,
.hr-back-button:focus-visible,
.hr-load-more:focus-visible {
    outline: 2px solid #72e4c5;
    outline-offset: 2px;
}

.hr-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.hr-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 32%) minmax(0, 1fr);
}

.hr-shell-embedded {
    display: block;
    min-height: 100%;
}

.hr-shell-embedded .hr-agent-detail {
    width: 100%;
    max-height: none;
}

.hr-agent-list,
.hr-agent-detail {
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.hr-agent-list {
    border-right: 1px solid #293445;
    background: #101622;
}

.hr-agent-detail {
    background: #171d2a;
}

.hr-panel-placeholder {
    margin: 18px;
    padding: 18px;
    border: 1px dashed #3a485d;
    border-radius: 9px;
    background: #151d2a;
    color: #9eacbb;
    font-size: 12px;
    line-height: 1.6;
}

.hr-roster-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 15px;
    border-bottom: 1px solid #293445;
    background: rgba(14, 19, 32, 0.96);
    backdrop-filter: blur(8px);
}

.hr-roster-header > div {
    display: grid;
    gap: 3px;
}

.hr-eyebrow {
    color: #7f91a6;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hr-icon-button {
    width: 32px;
    height: 32px;
    border: 1px solid #34445a;
    border-radius: 7px;
    background: #172131;
    color: #b9c8d8;
    cursor: pointer;
}

.hr-icon-button:hover,
.hr-icon-button:focus-visible {
    border-color: #54d2b0;
    color: #72e4c5;
    outline: none;
}

.hr-agent-rows {
    display: grid;
    padding: 8px;
    gap: 6px;
}

.hr-agent-row {
    position: relative;
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #151d2a;
    color: #e4ebf3;
    text-align: left;
    cursor: pointer;
}

.hr-agent-row:hover,
.hr-agent-row:focus-visible,
.hr-agent-row.is-selected {
    border-color: #3e776c;
    background: #182a2c;
    outline: none;
}

.hr-agent-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #243348;
    color: #8fe8d0;
    font-size: 9px;
    font-weight: 800;
}

.hr-agent-row-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.hr-agent-row-copy strong,
.hr-agent-row-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-agent-row-copy strong {
    font-size: 12px;
}

.hr-agent-row-copy small {
    color: #8291a3;
    font-size: 9px;
}

.hr-attention-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #a45d39;
    color: #fff3e7;
    font-size: 9px;
    font-weight: 800;
}

.hr-state-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 160px;
    padding: 3px 7px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-tone-success { color: #72e4a5; }
.hr-tone-warning { color: #f2c36c; }
.hr-tone-danger { color: #ff8e96; }
.hr-tone-neutral { color: #a9b8c8; }

.hr-overview {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.hr-overview section {
    min-width: 0;
    padding: 15px;
    border: 1px solid #29384a;
    border-radius: 10px;
    background: #131b28;
}

.hr-overview section > h3 {
    margin: 0 0 12px;
    font-size: 12px;
    color: #dce6ef;
}

.hr-command-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.hr-command-panel h3 {
    margin: 0 0 4px;
    color: #dce6ef;
    font-size: 12px;
}

.hr-command-panel p {
    margin: 0;
    color: #8190a2;
    font-size: 9px;
}

.hr-command-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.hr-schedule-panel {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.3fr);
    align-items: end;
    gap: 16px;
}

.hr-schedule-panel h3 {
    margin: 0 0 4px;
    color: #dce6ef;
    font-size: 12px;
}

.hr-schedule-panel p {
    margin: 0;
    color: #8190a2;
    font-size: 9px;
}

.hr-schedule-form {
    display: grid;
    grid-template-columns: repeat(7, minmax(82px, 1fr)) auto;
    align-items: end;
    gap: 10px;
}

.hr-schedule-form label {
    min-width: 0;
    display: grid;
    gap: 5px;
    color: #9fb0c4;
    font-size: 9px;
}

.hr-schedule-form input[type="time"],
.hr-schedule-form input[type="text"],
.hr-schedule-form input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 6px 8px;
    border: 1px solid #34485f;
    border-radius: 7px;
    background: #0d1622;
    color: #dce6ef;
    font: inherit;
    font-size: 10px;
    color-scheme: dark;
    outline: none;
}

.hr-schedule-form input[type="time"]:focus,
.hr-schedule-form input[type="text"]:focus,
.hr-schedule-form input[type="number"]:focus {
    border-color: #57d7ff;
    box-shadow: 0 0 0 2px rgba(87, 215, 255, .14);
}

.hr-schedule-form .hr-schedule-enabled {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
}

.hr-schedule-form .hr-schedule-enabled input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #43e3c2;
}

.hr-schedule-save {
    min-height: 34px;
    white-space: nowrap;
}

.hr-selection-backdrop { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; padding: 24px; background: rgba(3, 8, 18, .78); }
.hr-selection-dialog { width: min(620px, 92vw); max-height: min(720px, 86vh); overflow: auto; padding: 22px; border: 1px solid var(--hr-border, #33465d); border-radius: 16px; background: #111b2a; box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.hr-selection-dialog > header, .hr-selection-dialog > footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hr-selection-dialog > header p { margin: 6px 0 0; color: #9fb0c4; }
.hr-selection-dialog > footer { justify-content: flex-end; margin-top: 18px; }
.hr-record-dialog { width: min(960px, 94vw); }
.hr-record-dialog-body { margin-top: 14px; }
.hr-record-dialog .hr-record-card { margin: 0; }
.hr-selection-all { display: block; margin: 20px 0 10px; padding-bottom: 10px; border-bottom: 1px solid #2b3b50; }
.hr-selection-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.hr-selection-list label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #26384d; border-radius: 10px; }
.hr-selection-list span { display: grid; gap: 2px; }
.hr-selection-list small { color: #8fa2b8; }

.hr-command-button,
.hr-back-button {
    padding: 7px 10px;
    border: 1px solid #3d6d63;
    border-radius: 7px;
    background: #18302f;
    color: #83dec5;
    font-size: 9px;
    cursor: pointer;
}

.hr-command-button.danger {
    border-color: #754950;
    background: #342126;
    color: #ffadb2;
}

.hr-command-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.hr-command-message {
    padding: 10px 12px;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: 10px;
}

.hr-command-message.success {
    background: #173026;
    color: #7cdda7;
}

.hr-command-message.running {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2f2a18;
    color: #f2ca6b;
}

.hr-command-message.running::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: hr-command-spin 0.8s linear infinite;
}

@keyframes hr-command-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hr-command-message.running::before {
        animation: none;
    }
}

.hr-command-message.error {
    background: #352126;
    color: #ffa0a8;
}

.hr-overview-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-left: 3px solid currentColor !important;
}

.hr-overview-hero h3 {
    margin: 4px 0;
    color: #f2f6fa;
    font-size: 18px;
}

.hr-overview-hero p {
    margin: 0;
    color: #8f9eae;
    font-size: 10px;
}

.hr-overview-hero .hr-next-report-time {
    margin-top: 4px;
    color: #b6c6d8;
}

.hr-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 8px;
}

.hr-metric {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid #2b3a4d;
    border-radius: 8px;
    background: #182230;
}

.hr-metric-value {
    color: currentColor;
    font-size: 20px;
    font-weight: 750;
}

.hr-metric-label {
    overflow: hidden;
    color: #9aa9b9;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-activity-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hr-activity-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #253143;
    color: #c6d0da;
    font-size: 10px;
}

.hr-activity-list li:last-child {
    border-bottom: 0;
}

.hr-activity-list time {
    color: #718195;
    font-size: 8px;
}

.hr-activity-detail {
    grid-column: 2 / -1;
    color: #ff9ea8;
    font-size: 9px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.hr-degraded-banner,
.hr-empty-state,
.hr-inline-empty {
    padding: 12px;
    border: 1px solid #5c4930;
    border-radius: 8px;
    background: #292319;
    color: #e8c98e;
    font-size: 10px;
}

.hr-degraded-banner {
    display: grid;
    gap: 4px;
}

.hr-empty-state {
    margin: 18px;
}

.hr-empty-state h3 {
    margin: 0 0 7px;
}

.hr-empty-state p {
    margin: 0;
    color: #bca980;
}

.hr-detail-view {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.hr-back-button {
    width: fit-content;
    border-color: #34445a;
    background: #172131;
    color: #aebdcd;
}

.hr-detail-view > section {
    min-width: 0;
    border: 1px solid #29384a;
    border-radius: 10px;
    background: #131b28;
}

.hr-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-left: 3px solid #54d2b0 !important;
}

.hr-detail-hero h3 {
    margin: 4px 0 6px;
    color: #f0f5fa;
    font-size: 19px;
}

.hr-detail-hero p {
    max-width: 720px;
    margin: 0;
    color: #a8b5c3;
    font-size: 11px;
    line-height: 1.55;
}

.hr-detail-statuses {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.hr-detail-metadata {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: #29384a !important;
}

.hr-detail-metadata > div {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 11px;
    background: #151e2b;
}

.hr-detail-metadata span {
    color: #8190a2;
    font-size: 8px;
    text-transform: uppercase;
}

.hr-detail-metadata strong {
    overflow: hidden;
    color: #dce5ee;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-detail-section {
    padding: 15px;
}

.hr-detail-section > h4 {
    margin: 0 0 12px;
    color: #dce6ef;
    font-size: 12px;
}

.hr-history-list,
.hr-detail-list,
.hr-evidence-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hr-history-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid #29384a;
    border-radius: 7px;
    background: #29384a;
}

.hr-history-list li {
    display: grid;
    grid-template-columns: minmax(100px, 0.7fr) minmax(100px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px;
    background: #18212f;
    color: #b9c5d1;
    font-size: 9px;
}

.hr-history-list strong {
    overflow: hidden;
    color: #e2e9f0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-history-list time {
    color: #75859a;
    font-size: 8px;
}

.hr-record-list {
    display: grid;
    gap: 10px;
}

.hr-record-date-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #2a3a4e;
    border-radius: 7px;
    background: #141d2a;
    color: #aebbc8;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.hr-record-date-button:hover,
.hr-record-date-button:focus-visible {
    border-color: #41d6c3;
    background: #172635;
    outline: none;
    transform: translateY(-1px);
}

.hr-record-date-button strong {
    color: #edf3f8;
    font-size: 10px;
}

.hr-record-date-button span {
    color: #76869a;
    font-size: 8px;
}

.hr-record-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #2a3a4e;
    border-radius: 8px;
    background: #17212f;
}

.hr-record-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.hr-record-card > header > div {
    display: grid;
    gap: 3px;
}

.hr-record-card header strong {
    color: #edf3f8;
    font-size: 11px;
}

.hr-record-card header small,
.hr-record-card footer {
    color: #76869a;
    font-size: 8px;
}

.hr-record-card details {
    margin-top: 8px;
    border: 1px solid #29384a;
    border-radius: 6px;
    background: #121a26;
}

.hr-record-card summary {
    padding: 8px;
    color: #aebbc8;
    font-size: 9px;
    cursor: pointer;
}

.hr-record-card pre {
    max-height: 260px;
    margin: 0;
    padding: 10px;
    overflow: auto;
    border-top: 1px solid #29384a;
    color: #cad5df;
    font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.hr-record-card > footer {
    margin-top: 9px;
    text-align: right;
}

.hr-assessment-card > p {
    margin: 9px 0;
    color: #bdc8d3;
    font-size: 10px;
    line-height: 1.6;
}

.hr-workload-line,
.hr-runtime-diagnosis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    background: #121a26;
    color: #8d9caf;
    font-size: 9px;
}

.hr-report-grid,
.hr-assessment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 9px 0;
}

.hr-report-grid > div,
.hr-assessment-grid > div {
    min-width: 0;
    padding: 8px;
    border: 1px solid #29384a;
    border-radius: 6px;
}

.hr-report-grid h5,
.hr-assessment-grid h5 {
    margin: 0 0 7px;
    color: #98a9ba;
    font-size: 9px;
}

.hr-report-grid p {
    margin: 0;
    color: #c4ced8;
    font-size: 9px;
    line-height: 1.5;
}

.hr-detail-list {
    display: grid;
    gap: 5px;
}

.hr-detail-list li {
    padding-left: 10px;
    border-left: 2px solid #3c695f;
    color: #c4ced8;
    font-size: 9px;
    line-height: 1.5;
}

.hr-evidence-list {
    display: grid;
    gap: 7px;
    padding: 9px;
    border-top: 1px solid #29384a;
}

.hr-evidence-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    color: #aebbc8;
    font-size: 9px;
}

.hr-evidence-list code {
    color: #72cdb6;
    font-size: 8px;
}

.hr-muted {
    color: #748498;
    font-size: 9px;
}

.hr-load-more {
    display: block;
    min-width: 120px;
    margin: 12px auto 0;
    padding: 7px 12px;
    border: 1px solid #3d6d63;
    border-radius: 7px;
    background: #18302f;
    color: #83dec5;
    font-size: 9px;
    cursor: pointer;
}

.hr-load-more:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (max-width: 760px) {
    .hr-modal-content {
        width: 100vw;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        border-radius: 0;
    }

    .hr-header {
        padding: 11px 12px;
    }

    .hr-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(180px, 38%) minmax(0, 1fr);
    }

    .hr-agent-list {
        border-right: 0;
        border-bottom: 1px solid #293445;
    }

    .hr-detail-metadata,
    .hr-report-grid,
    .hr-assessment-grid {
        grid-template-columns: 1fr;
    }

    .hr-history-list li {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }

    .hr-detail-hero {
        flex-direction: column;
    }

    .hr-detail-statuses {
        justify-content: flex-start;
    }

    .hr-command-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .hr-schedule-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .hr-schedule-form {
        justify-content: flex-start;
    }

    .hr-command-actions {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hr-modal-content,
    .hr-modal-content * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
