
.loader-label {
    color: var(--primary);
    text-align: center;
    margin-top: 18px;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    display: inline-block;
    vertical-align: middle;
}

.loader-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 4px solid var(--primary);
    border-top: 4px solid var(--surface);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.section-block-local {
    display: none !important;
}
:root {
    --bg: #101216;
    --surface: #181c22;
    --surface-2: #202630;
    --line: #303744;
    --text: #f4f7fb;
    --muted: #9aa6b5;
    --primary: #2dd4bf;
    --primary-dark: #0f766e;
    --blue: #60a5fa;
    --danger: #fb7185;
    --ok: #4ade80;
    --nav-height: 68px;
    --container: 1520px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

@media (min-width: 1280px) {
    html {
        font-size: 18px;
    }

    .nav-content,
    main {
        padding-left: 36px;
        padding-right: 36px;
    }
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.hidden {
    display: none !important;
}

.glass-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--nav-height);
    background: rgba(16, 18, 22, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.nav-content {
    max-width: var(--container);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo,
.nav-link {
    color: var(--text);
    text-decoration: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #06110f;
    font-size: 0.82rem;
}

.logo span span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links .nav-link {
    display: none !important;
}

.nav-link {
    color: var(--muted);
    font-weight: 600;
}

.nav-link:hover {
    color: var(--primary);
}

main {
    max-width: var(--container);
    margin: 0 auto;
    padding: 16px 24px 48px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.page-head h1 {
    margin: 4px 0 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.1;
}

.page-head h2 {
    margin: 4px 0 0;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    line-height: 1.15;
}

.eyebrow,
.muted,
small {
    color: var(--muted);
}

.eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    margin-bottom: 8px;
}

.btn-primary,
.btn-danger,
.btn-secondary,
.download-logs-btn,
.speed-btn,
.icon-btn,
.play-btn {
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-primary {
    width: 100%;
    padding: 12px 18px;
    background: var(--primary);
    border-color: var(--primary);
    color: #06110f;
    font-weight: 800;
}

.btn-secondary {
    padding: 9px 14px;
    background: var(--surface-2);
}

.btn-danger {
    padding: 9px 14px;
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.4);
    color: var(--danger);
    font-weight: 800;
}

.download-logs-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.42);
    color: var(--blue);
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
}

button:hover {
    border-color: var(--primary);
}

.login-container {
    min-height: calc(100vh - 64px);
    display: grid;
    place-items: center;
}

.login-box {
    width: min(420px, 100%);
    padding: 28px;
}

.login-box h1 {
    margin: 0 0 6px;
}

.login-box p {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-box label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-box input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
}

.login-box input:focus {
    border-color: var(--primary);
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-head {
    margin-bottom: 18px;
}

.section-block + .section-block {
    margin-top: 36px;
}

.section-head {
    margin-bottom: 16px;
}

.section-block-cloud .department-card {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(45, 212, 191, 0.05)), var(--surface);
}

.empty-panel {
    min-height: 140px;
    padding: 22px;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.department-card,
.computer-card,
.employee-card,
.row-button {
    text-align: left;
    background: var(--surface);
}

.department-card {
    min-height: 180px;
    padding: 22px;
    display: grid;
    align-content: space-between;
}

.department-code {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.department-card strong {
    color: var(--primary);
}

.list-panel {
    overflow: hidden;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.employee-card {
    position: relative;
    min-height: 260px;
    padding: 18px;
    display: grid;
    gap: 8px;
    align-content: start;
    border: 1px solid var(--line);
    cursor: pointer;
}

.employee-card-top {
    position: relative;
}

.employee-card-preview-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(32, 38, 48, 0.95), rgba(24, 28, 34, 0.98));
    border: 1px solid rgba(96, 165, 250, 0.16);
}

.employee-card-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-card-menu-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(48, 55, 68, 0.9);
    background: rgba(16, 18, 22, 0.72);
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    display: grid;
    place-items: center;
    z-index: 2;
}

.employee-card-menu-trigger:hover {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(24, 28, 34, 0.96);
}

.employee-card-menu {
    position: absolute;
    top: 50px;
    right: 10px;
    min-width: 174px;
    padding: 8px;
    display: grid;
    gap: 4px;
    z-index: 3;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.employee-card-menu button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.employee-card-menu button:hover {
    background: rgba(96, 165, 250, 0.12);
}

.employee-card-menu button.danger {
    color: var(--danger);
}

.employee-card-menu button.danger:hover {
    background: rgba(251, 113, 133, 0.12);
}

.employee-card strong {
    margin-top: 8px;
    overflow-wrap: anywhere;
    font-size: 1.12rem;
}

.employee-card small {
    color: #b7d4fb;
}

.employee-card-caption {
    padding-right: 38px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.employee-card-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.employee-card-loading .loader-spinner {
    width: 14px;
    height: 14px;
    margin: 0;
    border-width: 2px;
    flex: 0 0 auto;
}

.employee-card-arrow {
    position: absolute;
    right: 16px;
    bottom: 14px;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
}

.computer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logs-preview {
    margin-top: 16px;
    padding: 18px;
}

.logs-preview-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.logs-preview-head h2 {
    margin: 4px 0 0;
    font-size: 1.15rem;
}

.logs-list {
    display: grid;
    gap: 8px;
}

.metrics-panel {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.metric-row {
    display: grid;
    grid-template-columns: 190px repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.metric-row time,
.metric-row span {
    min-width: 0;
}

.metric-row time {
    color: var(--muted);
    font-size: 0.82rem;
}

.metric-row span {
    display: grid;
    gap: 3px;
    color: var(--text);
    font-weight: 700;
}

.metric-row strong {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.log-row {
    min-height: 44px;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.log-level {
    width: fit-content;
    min-width: 52px;
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(96, 165, 250, 0.14);
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.log-level-error,
.log-level-critical {
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
}

.log-level-warn,
.log-level-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.log-message {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-row time {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.row-button {
    width: 100%;
    min-height: 70px;
    padding: 16px 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.row-button:last-child {
    border-bottom: 0;
}

.row-button span:first-child {
    display: grid;
    gap: 4px;
}

.computer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.computer-card {
    min-height: 210px;
    padding: 18px;
    display: grid;
    gap: 10px;
    align-content: start;
    cursor: pointer;
}

.computer-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.agent-delete-btn {
    width: fit-content;
    margin-top: 4px;
    align-self: end;
}

.computer-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--blue);
    font-size: 1.4rem;
}

.status-badge {
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-online {
    background: rgba(74, 222, 128, 0.14);
    color: var(--ok);
}

.status-offline {
    background: rgba(154, 166, 181, 0.14);
    color: var(--muted);
}

.calendar-strip {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.date-cell {
    min-height: 70px;
    display: grid;
    gap: 4px;
    align-content: center;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
}

.date-cell.active {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.date-cell.empty-date {
    opacity: 0.36;
    cursor: not-allowed;
    background: #151a21;
    color: var(--muted);
}

.date-cell.empty-date:hover {
    border-color: var(--line);
}

.date-cell.audio-selectable-date {
    cursor: pointer;
}

.date-cell.audio-selectable-date:hover {
    border-color: var(--primary);
}

.log-date-cell {
    min-height: 58px;
}

.date-cell span {
    color: var(--muted);
    font-size: 0.78rem;
}

.player-shell {
    padding: 16px;
}

.embedded-activity-panel {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(48, 55, 68, 0.72);
}

.embedded-activity-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.embedded-activity-head h3 {
    margin: 3px 0 0;
    font-size: 1rem;
}

.embedded-activity-markers {
    position: relative;
    height: 20px;
    margin-bottom: 8px;
}

.embedded-activity-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.embedded-activity-marker i {
    display: block;
    width: 1px;
    height: 8px;
    margin: 0 auto 4px;
    background: rgba(154, 166, 181, 0.55);
}

.embedded-activity-track {
    position: relative;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(17, 22, 28, 0.96), rgba(11, 15, 20, 0.98));
    overflow: hidden;
    cursor: pointer;
}

.embedded-activity-track::before {
    content: "";
    position: absolute;
    inset: 50% 10px auto;
    height: 1px;
    background: rgba(154, 166, 181, 0.18);
    transform: translateY(-50%);
}

.embedded-activity-segment {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
    opacity: 0.92;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.embedded-activity-segment.at-active { background: linear-gradient(90deg, rgba(74, 222, 128, 0.82), rgba(34, 197, 94, 0.96)); }
.embedded-activity-segment.at-idle { background: linear-gradient(90deg, rgba(251, 191, 36, 0.74), rgba(245, 158, 11, 0.92)); }
.embedded-activity-segment.at-browser { background: linear-gradient(90deg, rgba(96, 165, 250, 0.8), rgba(59, 130, 246, 0.92)); }
.embedded-activity-segment.at-locked { background: linear-gradient(90deg, rgba(148, 163, 184, 0.65), rgba(100, 116, 139, 0.82)); }

.embedded-activity-frame-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    transform: translateX(-50%);
    background: #f8fafc;
    box-shadow: 0 0 10px rgba(248, 250, 252, 0.55);
    pointer-events: none;
}

.embedded-activity-frame-marker i {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f8fafc;
    transform: translateX(-50%);
}

.embedded-activity-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.embedded-legend-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid rgba(48, 55, 68, 0.72);
    border-radius: 10px;
    background: rgba(17, 22, 28, 0.72);
}

.embedded-legend-item strong {
    font-size: 0.8rem;
}

.embedded-legend-item small {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.embedded-activity-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.audio-track {
    padding: 16px;
    margin-bottom: 16px;
}

.audio-track-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.audio-track-head h2 {
    margin: 3px 0 0;
    font-size: 1.18rem;
}

.audio-status {
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(154, 166, 181, 0.14);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.audio-status-ready {
    background: rgba(45, 212, 191, 0.14);
    color: var(--primary);
}

.audio-status-error {
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
}

.audio-status-loading {
    background: rgba(96, 165, 250, 0.14);
    color: var(--blue);
}

.audio-time-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.audio-timeline {
    position: relative;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #11161c;
    overflow: hidden;
    cursor: pointer;
}

.audio-timeline::before {
    content: "";
    position: absolute;
    inset: 15px 0 auto;
    height: 2px;
    background: rgba(154, 166, 181, 0.25);
}

.audio-segment {
    position: absolute;
    top: 8px;
    height: 18px;
    border-radius: 6px;
    background: rgba(45, 212, 191, 0.32);
    border: 1px solid rgba(45, 212, 191, 0.38);
}

.audio-segment.active {
    background: rgba(45, 212, 191, 0.78);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(45, 212, 191, 0.25);
}

.audio-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-1px);
    background: var(--primary);
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.6);
    pointer-events: none;
}

.audio-playhead i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--primary);
}

.audio-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.audio-controls button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.audio-play-btn {
    min-width: 58px;
}

.audio-speed-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.audio-speed-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #06110f;
}

.audio-message,
.audio-current-info {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.audio-error {
    color: var(--danger);
}

.audio-retry-btn {
    margin-left: 8px;
}

.audio-hidden-player {
    display: none;
}

.audio-panel {
    padding: 16px;
    margin-bottom: 16px;
}

.audio-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.audio-panel-header h3 {
    margin: 3px 0 0;
    font-size: 1.15rem;
    line-height: 1.2;
}

.audio-status-chip {
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(154, 166, 181, 0.14);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.audio-status-chip.audio-status-ready {
    background: rgba(45, 212, 191, 0.14);
    color: var(--primary);
}

.audio-status-chip.audio-status-error {
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
}

.audio-status-chip.audio-status-loading {
    background: rgba(96, 165, 250, 0.14);
    color: var(--blue);
}

.audio-timeline-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.audio-range-time {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.audio-track-line {
    position: relative;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #11161c;
    cursor: pointer;
}

.audio-track-line.disabled {
    cursor: default;
    opacity: 0.7;
}

.audio-track-line::before {
    content: "";
    position: absolute;
    inset: 15px 0 auto;
    height: 2px;
    background: rgba(154, 166, 181, 0.25);
}

.audio-track-line .audio-segment {
    top: 8px;
    height: 18px;
}

.audio-hover-tooltip {
    position: absolute;
    top: -32px;
    left: 0;
    z-index: 2;
    padding: 5px 8px;
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 6px;
    background: #101216;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.12s;
    white-space: nowrap;
}

.audio-hover-tooltip.visible {
    opacity: 1;
}

.audio-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.audio-main-controls,
.audio-speed-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-speed-controls span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.audio-controls-row button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.audio-current-fragment {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.player-viewer {
    position: relative;
    height: min(62vh, 650px);
    min-height: 360px;
    display: grid;
    place-items: center;
    background: #050607;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.player-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.player-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 16px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    background: var(--bg);
    border: 0;
    border-radius: 0;
}

.player-shell:fullscreen .player-viewer {
    height: auto;
    min-height: 0;
}

.player-status {
    position: absolute;
    inset: auto 16px 16px;
    text-align: center;
    color: var(--muted);
    pointer-events: none;
}

.player-status:empty {
    display: none;
}

.player-meta {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-weight: 700;
}

#timeline {
    width: 100%;
    --timeline-track-empty: linear-gradient(90deg, rgba(103, 113, 128, 0.28) 0%, rgba(103, 113, 128, 0.28) 100%);
    --timeline-track-fill: var(--timeline-track-empty);
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    background: transparent;
    cursor: pointer;
}

#timeline::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: var(--timeline-track-fill);
}

#timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border: 2px solid #08120f;
    border-radius: 50%;
    background: #f5fbf8;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

#timeline::-moz-range-track {
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: var(--timeline-track-fill);
}

#timeline::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #08120f;
    border-radius: 50%;
    background: #f5fbf8;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.player-controls,
.speed-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.icon-btn,
.play-btn,
.speed-btn {
    min-width: 44px;
    height: 42px;
    background: var(--surface-2);
}

.play-btn {
    min-width: 64px;
    background: var(--primary);
    color: #06110f;
    border-color: var(--primary);
    font-weight: 900;
}

.speed-btn {
    padding: 0 14px;
    color: var(--muted);
}

.speed-btn.active {
    background: var(--text);
    color: var(--bg);
}

.audio-speed-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #06110f;
}

.empty,
.error-panel {
    padding: 20px;
    color: var(--muted);
}

.loader-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--bg);
    color: var(--primary);
    font-weight: 600;
    z-index: 100;
}

.loader {
    width: 28px;
    height: 28px;
    border: 3px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 820px) {
    main {
        padding: 22px 14px 36px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .department-grid,
    .employee-grid,
    .calendar-strip {
        grid-template-columns: 1fr;
    }

    .log-row {
        grid-template-columns: 1fr;
    }

    .metric-row {
        grid-template-columns: 1fr 1fr;
    }

    .metric-row time {
        grid-column: 1 / -1;
    }

    .player-viewer {
        min-height: 260px;
        height: 48vh;
    }

    .audio-time-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .audio-timeline-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .audio-controls-row {
        align-items: stretch;
        flex-direction: column;
    }

    .audio-controls {
        align-items: stretch;
    }

    .audio-controls > button,
    .audio-controls .speed-btn {
        flex: 1 1 auto;
    }
}

/* ── Nav active state ───────────────────────────────── */
.nav-link.active { color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 2px; }

/* ── KPI Cards ──────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; transition: transform 0.15s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.kpi-label { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; }
.kpi-online .kpi-value { color: var(--ok); }
.kpi-idle .kpi-value { color: #fbbf24; }
.kpi-offline .kpi-value { color: var(--muted); }
.kpi-error .kpi-value { color: var(--danger); }

/* ── Monitor Filters ────────────────────────────────── */
.monitor-filters { padding: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.monitor-input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); outline: none; min-width: 200px; font: inherit; }
.monitor-input:focus { border-color: var(--primary); }
.monitor-select { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); outline: none; font: inherit; cursor: pointer; }
.monitor-select:focus { border-color: var(--primary); }
.monitor-checkbox { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.monitor-checkbox input { accent-color: var(--primary); }
.monitor-refresh-hint { font-size: 0.78rem; }

/* ── Monitor Table ──────────────────────────────────── */
.monitor-table-wrap { overflow-x: auto; margin-bottom: 20px; }
.monitor-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.monitor-table th { padding: 12px 10px; text-align: left; color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.monitor-table td { padding: 12px 10px; border-bottom: 1px solid rgba(48, 55, 68, 0.5); white-space: nowrap; }
.monitor-row { cursor: pointer; transition: background 0.12s; }
.monitor-row:hover { background: var(--surface-2); }
.cell-truncate { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Status badges ──────────────────────────────────── */
.status-idle { background: rgba(251, 191, 36, 0.14); color: #fbbf24; }
.status-error-badge { background: rgba(251, 113, 133, 0.14); color: var(--danger); }

/* ── Activity Timeline ──────────────────────────────── */
.activity-timeline-panel { padding: 16px; margin-bottom: 16px; }
.activity-timeline-collapsible { border-radius: 14px; }
.activity-timeline-summary { list-style: none; cursor: pointer; }
.activity-timeline-summary::-webkit-details-marker { display: none; }
.activity-timeline-collapsible.is-static .activity-timeline-summary { cursor: default; }
.activity-timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.activity-timeline-head h3 { margin: 3px 0 0; font-size: 1.15rem; }
.activity-timeline-range { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.activity-timeline-track { position: relative; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #11161c; cursor: pointer; overflow: hidden; }
.activity-timeline-track::before { content: ""; position: absolute; inset: 17px 0 auto; height: 2px; background: rgba(154, 166, 181, 0.2); }
.at-block { position: absolute; top: 6px; height: 24px; border-radius: 4px; cursor: pointer; transition: opacity 0.12s; }
.at-block:hover { opacity: 0.65; z-index: 2; }
.at-active { background: rgba(74, 222, 128, 0.55); border: 1px solid rgba(74, 222, 128, 0.7); }
.at-idle { background: rgba(251, 191, 36, 0.35); border: 1px solid rgba(251, 191, 36, 0.55); }
.at-browser { background: rgba(96, 165, 250, 0.45); border: 1px solid rgba(96, 165, 250, 0.65); }
.at-locked { background: rgba(154, 166, 181, 0.3); border: 1px solid rgba(154, 166, 181, 0.5); }
.at-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.at-legend-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.at-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.at-swatch.at-active { background: rgba(74, 222, 128, 0.7); }
.at-swatch.at-idle { background: rgba(251, 191, 36, 0.55); }
.at-swatch.at-browser { background: rgba(96, 165, 250, 0.6); }
.at-swatch.at-locked { background: rgba(154, 166, 181, 0.5); }
.activity-timeline-toggle-hint { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.activity-timeline-toggle-hint .toggle-chevron { transition: transform 0.2s ease; }
.activity-timeline-collapsible[open] .activity-timeline-toggle-hint .toggle-chevron { transform: rotate(90deg); }
.activity-timeline-expanded { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ── Metrics Charts ─────────────────────────────────── */
.metrics-charts-section { margin-bottom: 20px; }
.metrics-charts-head { margin-bottom: 14px; }
.metrics-charts-head h3 { margin: 3px 0 0; font-size: 1.15rem; }
.metrics-charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metrics-chart-card { padding: 14px; }
.metrics-chart-card h4 { margin: 0 0 8px; font-size: 0.92rem; color: var(--muted); }
.metrics-svg { width: 100%; height: auto; display: block; }
.metrics-chart-legend { margin-top: 8px; display: flex; gap: 14px; font-size: 0.78rem; font-weight: 700; }

/* ── Detail Logs ────────────────────────────────────── */
.detail-logs-section { padding: 16px; margin-bottom: 16px; }
.detail-logs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.detail-logs-head h3 { margin: 3px 0 0; font-size: 1.15rem; }
.detail-logs-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

/* ── Responsive additions ───────────────────────────── */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .metrics-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .monitor-filters { flex-direction: column; }
    .monitor-input { min-width: 100%; }
    .activity-timeline-range { grid-template-columns: 1fr; gap: 8px; }
}

/* ── Phase 1: UI Overhaul Additions ──────────────────── */

/* Status badge variants */
.status-active { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.status-locked { background: rgba(251, 191, 36, 0.14); color: #fbbf24; }
.status-unknown { background: rgba(154, 166, 181, 0.14); color: var(--muted); }

/* KPI card color additions */
.kpi-active .kpi-value { color: var(--ok); }
.kpi-locked .kpi-value { color: #fbbf24; }

/* Problem / warning badges */
.problem-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 800;
}
.warning-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.14);
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Offline row mute */
.row-offline { opacity: 0.55; }

/* Page subtitle */
.page-subtitle {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 4px 0 0;
}

/* Agent detail header meta strip */
.agent-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.meta-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.meta-value {
    font-weight: 600;
    font-size: 0.92rem;
}

@media (max-width: 600px) {
    .agent-header-meta { gap: 10px 16px; }
}

/* ═══════════════════════════════════════════════════════
   Phase 2 — Management Dashboard Styles
   ═══════════════════════════════════════════════════════ */

/* ── Section wrappers ──────────────────────────────── */
.management-section {
    margin-bottom: 24px;
}
.workday-section {
    margin-bottom: 8px;
}
.workday-section-title,
.technical-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 16px;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.workday-section-title::after,
.technical-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.workday-section-title { color: var(--primary); }
.technical-section-title { color: var(--muted); }

/* ── KPI grid — 5-column variant for overview ──────── */
.kpi-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1024px) { .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); } }

/* ── Attention Panel ───────────────────────────────── */
.attention-panel {
    margin-bottom: 24px;
}
.attention-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.attention-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--danger);
}
.attention-panel-header .attention-count {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 800;
}
.attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.attention-card {
    background: var(--surface);
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s, transform 0.12s;
    cursor: default;
}
.attention-card:hover {
    border-color: rgba(251, 113, 133, 0.6);
    transform: translateY(-1px);
}
.attention-card-name {
    font-weight: 700;
    font-size: 1rem;
}
.attention-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.attention-fatal-badge {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(251, 113, 133, 0.16);
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0;
}
.attention-card-reason {
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 600;
}
.attention-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: var(--muted);
    font-size: 0.78rem;
}
.attention-card-action {
    margin-top: 4px;
}
.attention-card-action a {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.12s;
}
.attention-card-action a:hover {
    background: rgba(251, 113, 133, 0.2);
}

/* ── Quick Filter Bar ──────────────────────────────── */
.quick-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.quick-filter-chip {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.quick-filter-chip:hover {
    border-color: var(--primary);
    color: var(--text);
}
.quick-filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #06110f;
}
.quick-filter-chip .chip-count {
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    font-size: 0.72rem;
}
.quick-filter-chip.active .chip-count {
    background: rgba(0,0,0,0.15);
}

/* ── Screenshot Mode Tabs ──────────────────────────── */
.screenshot-mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    background: var(--surface-2);
    border-radius: 10px;
    border: 1px solid var(--line);
    width: fit-content;
}
.screenshot-mode-tab {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.screenshot-mode-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}
.screenshot-mode-tab.active {
    background: var(--primary);
    color: #06110f;
}

/* ── Screenshot Grid ───────────────────────────────── */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.screenshot-thumb-card {
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
}
.screenshot-thumb-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.screenshot-thumb-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #050607;
}
.screenshot-thumb-meta {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--muted);
}
.screenshot-thumb-meta .thumb-time {
    font-weight: 700;
    color: var(--text);
}
.screenshot-grid-footer {
    text-align: center;
    margin: 12px 0;
}
.screenshot-grid-footer button {
    padding: 10px 28px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s;
}
.screenshot-grid-footer button:hover {
    border-color: var(--primary);
}
.screenshot-grid-info {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 10px 0 0;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--line);
}

/* ── Technical Section (Collapsible) ───────────────── */
.technical-section {
    margin-top: 8px;
}
.technical-section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.technical-section-toggle:hover {
    border-color: var(--primary);
    color: var(--text);
}
.technical-section-toggle .toggle-chevron {
    transition: transform 0.2s;
    font-size: 0.7rem;
}
.technical-section-toggle.expanded .toggle-chevron {
    transform: rotate(90deg);
}
.technical-section-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}
.technical-section-content.expanded {
    max-height: 5000px;
    opacity: 1;
    margin-top: 16px;
}

/* ── Activity Segment List ─────────────────────────── */
.activity-segment-list {
    margin-top: 16px;
    max-height: 480px;
    overflow-y: auto;
}
.activity-segment-list.activity-segment-preview {
    margin-top: 12px;
    max-height: none;
    overflow: visible;
}
.activity-segment-list.activity-segment-preview .activity-segment-row {
    cursor: default;
}
.activity-segment-list.activity-segment-expanded {
    margin-top: 12px;
}
.activity-segment-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.activity-segment-list-header h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 700;
}
.activity-segment-list-header .muted {
    font-size: 0.78rem;
}
.activity-segment-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) minmax(0, 2fr) 70px;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: background 0.1s;
}
.activity-segment-row:hover {
    background: var(--surface-2);
}
.activity-segment-row + .activity-segment-row {
    border-top: 1px solid rgba(48, 55, 68, 0.4);
}
.seg-time {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.seg-process {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seg-window {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seg-duration {
    color: var(--muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.seg-idle-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.14);
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 700;
}
.seg-locked-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(154, 166, 181, 0.14);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}
.activity-segment-more {
    padding: 8px 12px;
    color: var(--muted);
    font-size: 0.78rem;
    font-style: italic;
}

/* ── Agent header improvements ─────────────────────── */
.agent-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 18px;
    margin-bottom: 16px;
}
.agent-meta-grid .meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── Employee summary header ───────────────────────── */
.employee-summary-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.employee-summary-header .agent-name-large {
    font-size: 1.6rem;
    font-weight: 800;
}

/* ── Summary cards split ───────────────────────────── */
.summary-split {
    margin-bottom: 20px;
}
.summary-split-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
.summary-split-row-tech {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    max-width: 480px;
}
@media (max-width: 820px) {
    .summary-split-row { grid-template-columns: repeat(2, 1fr); }
    .summary-split-row-tech { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
    .activity-segment-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Overview active table sort indicator ──────────── */
.overview-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.overview-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.overview-section-header .muted {
    font-size: 0.82rem;
}

/* ── Audio improved labels ─────────────────────────── */
.audio-availability {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.audio-availability.audio-available {
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.2);
    color: var(--primary);
}
.audio-availability.audio-unavailable {
    background: rgba(154, 166, 181, 0.06);
    border: 1px solid rgba(154, 166, 181, 0.15);
    color: var(--muted);
}

/* ── Responsive: screenshot grid ───────────────────── */
@media (max-width: 600px) {
    .screenshot-grid { grid-template-columns: repeat(2, 1fr); }
    .attention-grid { grid-template-columns: 1fr; }
    .quick-filter-bar { gap: 6px; }
    .quick-filter-chip { padding: 5px 12px; font-size: 0.78rem; }
}

/* ── Phase 3: Technical Monitoring Styles ─────────── */

/* Health Badges */
.health-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.health-ok {
    background: rgba(45, 212, 191, 0.12);
    color: var(--ok);
    border: 1px solid rgba(45, 212, 191, 0.2);
}
.health-warning {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}
.health-critical {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
    border: 1px solid rgba(251, 113, 133, 0.25);
    animation: pulse-ping 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.health-offline {
    background: rgba(154, 166, 181, 0.1);
    color: var(--muted);
    border: 1px solid rgba(154, 166, 181, 0.15);
}
.health-unknown {
    background: rgba(154, 166, 181, 0.06);
    color: var(--muted);
    border: 1px solid rgba(154, 166, 181, 0.1);
}

@keyframes pulse-ping {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.98); }
}

/* Critical Panel */
.attention-ok {
    border-color: rgba(45, 212, 191, 0.2) !important;
}
.attention-ok .success-icon {
    font-size: 1.5rem;
    color: var(--ok);
    margin-right: 12px;
}
.attention-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.attention-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.attention-header .warning-icon {
    font-size: 1.6rem;
    color: var(--danger);
    animation: warning-bounce 1s infinite alternate;
}
@keyframes warning-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

.critical-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.critical-agent-card {
    background: var(--surface-2);
    border: 1px solid rgba(251, 113, 133, 0.25);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s, border-color 0.15s;
}
.critical-agent-card:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 113, 133, 0.45);
}
.critical-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}
.critical-card-body {
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}
.critical-reasons-list {
    margin: 4px 0 0;
    padding-left: 16px;
    color: var(--text);
}
.reason-item {
    line-height: 1.4;
    margin-bottom: 4px;
}
.reason-item.r-critical {
    color: var(--danger);
    font-weight: 600;
}
.reason-item.r-warning {
    color: #f59e0b;
}
.reason-item.r-offline {
    color: var(--muted);
}
.critical-card-btn {
    width: 100%;
    text-align: center;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px;
}
.extra-critical-alert {
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--danger);
    font-weight: 600;
    text-align: center;
}

/* Technical Dashboards split grid */
.tech-dashboards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .tech-dashboards-grid { grid-template-columns: 1fr; }
}

.tech-sub-section {
    padding: 16px;
}
.tech-sub-header {
    margin-bottom: 14px;
}
.tech-sub-header h3 {
    margin: 0 0 2px;
    font-size: 1.05rem;
}
.tech-split-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
}
@media (max-width: 500px) {
    .tech-split-container { grid-template-columns: 1fr; }
}

.tech-split-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}
.tech-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.82rem;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(48, 55, 68, 0.35);
}
.tech-stat-label {
    color: var(--muted);
}
.tech-stat-value {
    font-weight: 700;
    text-align: right;
}
.font-sm {
    font-size: 0.78rem;
}
.tech-split-table-wrap {
    max-height: 180px;
    overflow-y: auto;
}
.compact-tech-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.compact-tech-table th {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    padding: 6px 4px;
    text-align: left;
}
.compact-tech-table td {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(48, 55, 68, 0.25);
    white-space: nowrap;
}
.compact-tech-table tr {
    cursor: pointer;
    transition: background 0.1s;
}
.compact-tech-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.compact-tech-table .empty {
    text-align: center;
    color: var(--muted);
    padding: 12px;
}

/* Main tech table customizations */
.tech-row td {
    vertical-align: middle;
}
.tech-queue-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tech-reasons-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 250px;
}
.compact-reason-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.compact-reason-badge.level-critical {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
    border: 1px solid rgba(251, 113, 133, 0.2);
}
.compact-reason-badge.level-warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.15);
}
.compact-reason-badge.level-offline {
    background: rgba(154, 166, 181, 0.08);
    color: var(--muted);
    border: 1px solid rgba(154, 166, 181, 0.12);
}

/* Agent detail view reasons panel */
.agent-technical-reasons {
    background: rgba(251, 113, 133, 0.06) !important;
    border: 1px solid rgba(251, 113, 133, 0.25) !important;
    padding: 14px 18px !important;
    margin-bottom: 20px;
}
.agent-technical-reasons .reasons-title {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--danger);
    margin-bottom: 8px;
}
.agent-technical-reasons .reasons-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.82rem;
}
.agent-technical-reasons .reason-item {
    margin-bottom: 4px;
}

/* Metrics diagnostic bar */
.metrics-latest-bar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    background: var(--surface-2);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.metric-latest-item {
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.metric-latest-item .m-label {
    color: var(--muted);
}
.metric-latest-item .m-value {
    color: var(--text);
    font-weight: 700;
}

/* SVG Chart Value Badges */
.chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.chart-header-row h4 {
    margin: 0;
}
.chart-current-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(45, 212, 191, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(45, 212, 191, 0.15);
}

/* ==========================================
   Phase 4: Employee Activity Dashboard Styles
   ========================================== */

/* Activity status badge styles */
.activity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    white-space: nowrap;
}

.activity-badge-active {
    background: rgba(74, 222, 128, 0.12);
    color: var(--ok);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.activity-badge-idle {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.activity-badge-offline {
    background: rgba(154, 166, 181, 0.12);
    color: var(--muted);
    border: 1px solid rgba(154, 166, 181, 0.3);
}

.activity-badge-stale {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.activity-badge-suspicious {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
    border: 1px solid rgba(251, 113, 133, 0.3);
}

.activity-badge-unknown {
    background: rgba(48, 55, 68, 0.2);
    color: var(--muted);
    border: 1px solid var(--line);
}

/* KPI Widgets Grid for Activity */
.kpi-grid-activity {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-grid-activity .kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-grid-activity .kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.kpi-grid-activity .kpi-icon {
    font-size: 2rem;
    line-height: 1;
    opacity: 0.85;
}

.text-ok { color: var(--ok); }
.text-warning { color: #f59e0b; }
.text-primary { color: var(--primary); }
.text-blue { color: var(--blue); }

/* Activity Table Interactive Row Styling */
.activity-row:hover {
    background: rgba(45, 212, 191, 0.04) !important;
}

/* Activity detail view custom classes */
.activity-detail-layout {
    animation: fadeIn 0.3s ease;
}

.apps-bar-list, .sites-bar-list {
    margin-top: 8px;
}

.app-bar-row, .site-bar-row {
    margin-bottom: 14px;
}

.app-bar-row:last-child, .site-bar-row:last-child {
    margin-bottom: 0;
}

.vertical-timeline-container {
    animation: fadeIn 0.4s ease;
}

.timeline-event-item {
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.timeline-event-item:hover {
    transform: translateX(2px);
    border-color: rgba(45, 212, 191, 0.3);
}

.idle-diagnostics-table th, .idle-diagnostics-table td {
    padding: 12px;
}

.idle-diagnostics-table tr:hover {
    background: rgba(245, 158, 11, 0.03) !important;
}

.date-badge-btn {
    transition: all 0.15s ease;
}

.date-badge-btn:hover {
    border-color: var(--primary) !important;
    transform: translateY(-1px);
}

.tab-btn:hover {
    color: var(--text) !important;
}

/* ==========================================
   Phase 5: Screenshots & Video Timeline Styles
   ========================================== */

.screenshots-header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.screenshots-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Upper Filters Panel */
.screenshots-filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 18px 24px;
    margin-bottom: 20px;
    align-items: end;
}
.screenshots-filter-panel .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.screenshots-filter-panel label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.screenshots-filter-panel .time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.screenshots-filter-panel .time-input {
    width: 100px;
    text-align: center;
}
.screenshots-filter-panel .time-sep {
    color: var(--muted);
    font-size: 0.85rem;
}

/* KPI Summary Cards */
.screenshot-kpi-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.screenshot-kpi-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.screenshot-kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}
.screenshot-kpi-card .kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.screenshot-kpi-card .kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.screenshot-kpi-card.active-badge-kpi .kpi-value {
    color: var(--primary);
}
.screenshot-kpi-card.idle-badge-kpi .kpi-value {
    color: #f59e0b;
}
.screenshot-kpi-card.locked-badge-kpi .kpi-value {
    color: var(--muted);
}

@media (max-width: 820px) {
    .screenshot-kpi-summary { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* 3-Column Grid Layout */
.screenshots-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .screenshots-layout-grid {
        grid-template-columns: 240px 1fr;
    }
    .screenshot-metadata-column {
        grid-column: span 2;
    }
}
@media (max-width: 820px) {
    .screenshots-layout-grid {
        grid-template-columns: 1fr;
    }
    .screenshot-sidebar, .screenshot-metadata-column {
        grid-column: span 1;
    }
}

/* Left Sidebar - Employee list */
.screenshot-sidebar h3, .screenshot-metadata-column h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.screenshot-agent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}
.screenshot-agent-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.screenshot-agent-card:hover {
    border-color: rgba(45, 212, 191, 0.4);
    transform: translateX(2px);
    background: rgba(45, 212, 191, 0.03);
}
.screenshot-agent-card.active {
    border-color: var(--primary);
    background: rgba(45, 212, 191, 0.08);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.1);
}
.screenshot-agent-card .agent-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.screenshot-agent-card .agent-name {
    font-size: 0.95rem;
    font-weight: 700;
}
.screenshot-agent-card .agent-host {
    font-size: 0.78rem;
    color: var(--muted);
}
.screenshot-agent-card .agent-group-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
}
.screenshot-agent-card.active .agent-group-badge {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(45, 212, 191, 0.25);
    color: var(--primary);
}

/* Central Screenshot Viewer Container */
.screenshot-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #090b0e;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    margin-bottom: 20px;
}
.screenshot-image-container .image-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.screenshot-image-container .screenshot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease-in-out;
}
.image-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 16px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: #fff;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.screenshot-image-container .image-wrapper:hover .image-overlay-info {
    opacity: 1;
    transform: translateY(0);
}
.image-overlay-info .overlay-clock {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.image-overlay-info .overlay-proc {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Horizontal Scrollable Timeline */
.screenshot-timeline-container {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
}
.timeline-track {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 6px 0;
    min-width: max-content;
}
.timeline-dot-item {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    user-select: none;
    transition: all 0.12s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.timeline-dot-item .dot-monitor-badge {
    opacity: 0.6;
    color: inherit;
}
/* dot colors */
.timeline-dot-item.active {
    background: rgba(13, 148, 136, 0.2);
    color: #2dd4bf;
    border-color: rgba(13, 148, 136, 0.4);
}
.timeline-dot-item.idle {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}
.timeline-dot-item.locked {
    background: rgba(154, 166, 181, 0.15);
    color: #9aa6b5;
    border-color: rgba(154, 166, 181, 0.3);
}

.timeline-dot-item:hover {
    transform: scale(1.15);
    z-index: 10;
}
.timeline-dot-item.active:hover {
    background: rgba(13, 148, 136, 0.45);
    border-color: #2dd4bf;
}
.timeline-dot-item.idle:hover {
    background: rgba(245, 158, 11, 0.45);
    border-color: #fbbf24;
}
.timeline-dot-item.locked:hover {
    background: rgba(154, 166, 181, 0.35);
    border-color: #f4f7fb;
}

.timeline-dot-item.selected {
    transform: scale(1.15);
    border-width: 2px;
    box-shadow: 0 0 10px currentColor;
    z-index: 5;
}
.timeline-dot-item.active.selected {
    background: #0d9488;
    color: #06110f;
    border-color: #f4f7fb;
}
.timeline-dot-item.idle.selected {
    background: #f59e0b;
    color: #06110f;
    border-color: #f4f7fb;
}
.timeline-dot-item.locked.selected {
    background: #9aa6b5;
    color: #06110f;
    border-color: #f4f7fb;
}

/* Playback Control Bar */
.screenshot-playback-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    gap: 16px;
}
.stepper-controls, .speed-controls, .loop-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-playback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.12s ease;
}
.btn-playback:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}
.btn-playback:active {
    transform: scale(0.95);
}
.btn-playback.play-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #06110f;
    border-color: var(--primary);
    font-size: 1.2rem;
}
.btn-playback.play-toggle-btn:hover {
    background: #5eead4;
    border-color: #5eead4;
    color: #06110f;
    box-shadow: 0 0 12px rgba(45,212,191,0.3);
}

.btn-speed {
    padding: 7px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.12s ease;
}
.btn-speed:hover {
    color: var(--text);
    border-color: var(--muted);
}
.btn-speed.active {
    background: rgba(45, 212, 191, 0.15);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-loop {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.12s ease;
}
.btn-loop:hover {
    color: var(--text);
    border-color: var(--muted);
}
.btn-loop.active {
    background: rgba(96, 165, 250, 0.15);
    color: var(--blue);
    border-color: var(--blue);
}

@media (max-width: 600px) {
    .screenshot-playback-bar {
        justify-content: center;
        flex-direction: column;
        gap: 12px;
    }
}

/* Unified structure + monitoring dashboard */
.unified-hero {
    min-height: 142px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.unified-hero h1 {
    margin: 6px 0 4px;
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.page-subtitle {
    margin: 0;
    color: #b7d4fb;
    font-size: 1rem;
}

.hero-pill,
.section-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: #b7d4fb;
    font-weight: 700;
    white-space: nowrap;
}

.hero-pill.mini {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.section-link {
    color: var(--primary);
    text-decoration: none;
}

.sv-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
}

.sv-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.unified-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.unified-kpi-card {
    min-height: 108px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    text-align: left;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.04), rgba(45, 212, 191, 0.02)), var(--surface);
}

.unified-kpi-card:hover {
    border-color: rgba(45, 212, 191, 0.55);
    transform: translateY(-2px);
}

.kpi-icon-wrap {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 10px;
    background: rgba(45, 212, 191, 0.08);
    color: var(--primary);
}

.unified-kpi-card .kpi-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.unified-kpi-card .kpi-value {
    color: var(--text);
    font-size: 2rem;
}

.unified-kpi-card.kpi-active .kpi-value { color: var(--ok); }
.unified-kpi-card.kpi-idle .kpi-value { color: #fbbf24; }
.unified-kpi-card.kpi-locked .kpi-value { color: #a78bfa; }
.unified-kpi-card.kpi-offline .kpi-value { color: var(--muted); }
.unified-kpi-card.kpi-error .kpi-value { color: var(--danger); }

.tiny-spark {
    width: 91px;
    height: 34px;
    opacity: 0.9;
}

.section-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 12px;
}

.section-title-row h3 {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.department-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.department-dashboard-card {
    min-height: 206px;
    padding: 20px;
    display: grid;
    gap: 18px;
    color: var(--text);
    text-decoration: none;
    background: linear-gradient(160deg, rgba(45, 212, 191, 0.08), rgba(96, 165, 250, 0.04) 42%, rgba(24, 28, 34, 0.95));
}

.department-dashboard-card:hover {
    border-color: rgba(45, 212, 191, 0.55);
    transform: translateY(-2px);
}

.department-card-top,
.department-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.department-card-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue);
}

.department-health {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.department-health.ok {
    background: rgba(74, 222, 128, 0.12);
    color: var(--ok);
}

.department-health.warn {
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
}

.department-dashboard-card .department-code {
    font-size: clamp(2.3rem, 4vw, 3.3rem);
    line-height: 0.92;
}

.department-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(154, 166, 181, 0.18);
}

.department-progress span {
    display: block;
    height: 100%;
    min-width: 6px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--blue));
}

.department-card-stats {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: #b7d4fb;
    font-size: 0.82rem;
    font-weight: 800;
}

.department-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dept-matrix {
    padding: 16px;
    margin-bottom: 24px;
}

.dept-matrix-table-wrap {
    width: 100%;
}

.compact-dashboard-table th,
.compact-dashboard-table td {
    padding: 10px 12px;
}

.metric-ok {
    color: var(--ok);
    font-weight: 800;
}

.metric-warn {
    color: #fbbf24;
    font-weight: 800;
}

@media (min-width: 1180px) {
    body.route-overview {
        height: 100vh;
        overflow: hidden;
    }

    body.route-overview #content {
        height: calc(100vh - var(--nav-height));
        overflow: hidden;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-bottom: 16px;
    }

    body.route-overview .unified-kpi-grid,
    body.route-overview .department-dashboard-grid {
        flex: 0 0 auto;
    }

    body.route-overview .dept-matrix {
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    body.route-overview .dept-matrix .section-title-row {
        margin-top: 0;
        flex: 0 0 auto;
    }

    body.route-overview .dept-matrix-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }
}

.attention-panel {
    padding-top: 2px;
}

.attention-card {
    position: relative;
    overflow: hidden;
}

.attention-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--danger);
}

.attention-panel-header h3::before {
    content: "";
}

.compact-row {
    margin-top: 0;
}

.unified-activity-panel,
.unified-screen-panel,
.unified-usage-card {
    padding: 18px;
    margin-bottom: 18px;
}

.unified-activity-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7px, 1fr));
    gap: 4px;
    min-height: 42px;
    align-items: stretch;
    padding: 10px;
    border: 1px solid rgba(48, 55, 68, 0.72);
    border-radius: 8px;
    background: #11161c;
}

.activity-bar {
    min-width: 6px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.78);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.14);
}

.activity-bar.idle {
    background: rgba(251, 191, 36, 0.78);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.12);
}

.activity-bar.locked {
    background: rgba(154, 166, 181, 0.56);
    box-shadow: none;
}

.unified-usage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.usage-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(110px, 1fr) 42px;
    gap: 12px;
    align-items: center;
    min-height: 38px;
    color: #b7d4fb;
}

.usage-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usage-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(154, 166, 181, 0.16);
}

.usage-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--blue));
}

.usage-row strong {
    text-align: right;
    color: var(--text);
}

.compact-empty {
    margin: 0;
}

.unified-date-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.unified-date-chip {
    min-height: 58px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.unified-date-chip.active {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.65);
}

.unified-date-chip small {
    grid-column: 2;
    color: var(--muted);
}

.unified-screen-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
    align-items: stretch;
}

.screen-preview {
    min-height: 260px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(48, 55, 68, 0.75);
    border-radius: 8px;
    background: #050607;
}

.screen-preview img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

.screen-side {
    display: grid;
    gap: 10px;
}

.screen-stat {
    display: grid;
    gap: 6px;
    align-content: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.screen-stat .sv-icon {
    color: var(--primary);
}

.screen-stat strong {
    font-size: 1.7rem;
    line-height: 1;
}

.screen-stat span:last-child {
    color: var(--muted);
    font-size: 0.82rem;
}

.unified-workstation-panel {
    padding: 18px;
    margin-bottom: 18px;
}

.workstation-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.workstation-head h3 {
    margin: 4px 0 0;
    font-size: 1.55rem;
}

.workstation-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.workstation-select {
    min-width: 260px;
    min-height: 38px;
}

.workstation-date-strip {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) minmax(220px, 1.2fr);
}

.workstation-date-strip .unified-date-chip {
    cursor: pointer;
    text-align: left;
}

.workstation-date-select {
    min-height: 58px;
}

.overview-metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 16px;
}

.overview-metric-card {
    min-height: 166px;
    padding: 14px;
    display: grid;
    align-content: start;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.04), rgba(17, 22, 28, 0.94));
}

.metric-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

.overview-metric-card strong {
    font-size: 1.9rem;
    line-height: 1;
}

.overview-metric-card.ok strong { color: var(--ok); }
.overview-metric-card.warn strong { color: #fbbf24; }
.overview-metric-card.warn-soft strong { color: #fbbf24; }
.overview-metric-card.danger strong { color: var(--danger); }

.overview-metric-card .tiny-spark {
    width: 100%;
    max-width: 120px;
}

.metric-card-sub {
    min-height: 32px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.workstation-screen-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.workstation-screen-grid .screen-stat {
    min-height: 82px;
}

.workstation-screen-grid .screen-stat span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.workstation-screen-grid .screen-stat strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
}

.compact-hero {
    min-height: 116px;
}

.problem-section {
    margin-bottom: 18px;
}

.problem-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.problem-card {
    min-height: 150px;
    padding: 16px;
    border: 1px solid rgba(251, 113, 133, 0.42);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(251, 113, 133, 0.06), rgba(17, 22, 28, 0.96));
    cursor: pointer;
}

.problem-card:hover {
    border-color: rgba(251, 113, 133, 0.72);
    transform: translateY(-2px);
}

.problem-card-head,
.problem-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.problem-card p {
    color: #b7d4fb;
    min-height: 42px;
}

.problem-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: #b7d4fb;
    font-size: 0.8rem;
    font-weight: 700;
}

.problem-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ordinary-errors-panel {
    padding: 16px;
}

/* User/computer detail dashboard */
.detail-dashboard-head {
    min-height: 92px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.detail-dashboard-head h1 {
    margin: 4px 0 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.detail-date-rail {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.detail-date-rail-card {
    padding: 16px 18px;
    border: 1px solid rgba(45, 212, 191, 0.16);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 12px 28px rgba(4, 12, 18, 0.18);
    background:
        radial-gradient(circle at top right, rgba(45, 212, 191, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(20, 26, 34, 0.98), rgba(15, 20, 27, 1));
}

.detail-date-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-date-rail-current {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-date-rail-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.detail-date-rail-current strong {
    font-size: 1.08rem;
    line-height: 1.2;
}

.detail-kpi-grid > .detail-date-rail {
    min-width: 0;
    margin-bottom: 0;
}

.detail-date-rail-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.detail-date-rail-nav {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(66, 76, 94, 0.82);
    border-radius: 10px;
    background: rgba(28, 34, 44, 0.9);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.detail-date-rail-nav:hover {
    border-color: rgba(45, 212, 191, 0.72);
    color: var(--primary);
}

.detail-date-ribbon-shell {
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.detail-date-ribbon-shell::before,
.detail-date-ribbon-shell::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 4px;
    width: 28px;
    z-index: 1;
    pointer-events: none;
}

.detail-date-ribbon-shell::before {
    left: 0;
    background: linear-gradient(90deg, rgba(15, 20, 27, 0.92), rgba(15, 20, 27, 0));
}

.detail-date-ribbon-shell::after {
    right: 0;
    background: linear-gradient(270deg, rgba(15, 20, 27, 0.92), rgba(15, 20, 27, 0));
}

.detail-date-ribbon {
    max-width: 100%;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.38) transparent;
}

.detail-date-ribbon::-webkit-scrollbar {
    height: 6px;
}

.detail-date-ribbon::-webkit-scrollbar-track {
    background: transparent;
}

.detail-date-ribbon::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.42);
    border-radius: 999px;
}

.detail-date-chip {
    min-height: 74px;
    padding: 12px 14px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 4px;
    border: 1px solid rgba(66, 76, 94, 0.88);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(31, 37, 47, 0.96), rgba(25, 31, 39, 0.98));
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.detail-date-ribbon-chip {
    flex: 0 0 112px;
    scroll-snap-align: start;
}

.detail-date-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.38);
    background: linear-gradient(180deg, rgba(36, 42, 54, 0.98), rgba(28, 34, 43, 1));
    box-shadow: 0 12px 26px rgba(6, 14, 20, 0.22);
}

.detail-date-chip.active {
    border-color: rgba(45, 212, 191, 0.84);
    background:
        radial-gradient(circle at top right, rgba(45, 212, 191, 0.1), transparent 32%),
        linear-gradient(180deg, rgba(24, 40, 48, 1), rgba(18, 28, 35, 1));
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.16), 0 10px 24px rgba(5, 16, 18, 0.2);
}

.detail-date-chip.active .detail-date-chip-day,
.detail-date-chip.active .detail-date-chip-meta {
    color: #eefcf8;
}

.detail-date-chip-day {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}

.detail-date-chip-meta {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: capitalize;
}

.detail-date-chip.empty-date {
    opacity: 0.72;
    cursor: pointer;
}

.detail-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 220px)) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    align-items: stretch;
}

.detail-kpi-card {
    min-height: 152px;
    padding: 14px;
    display: grid;
    align-content: start;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.04), rgba(17, 22, 28, 0.96));
}

.detail-kpi-head {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.detail-kpi-card strong {
    font-size: 1.85rem;
    line-height: 1;
}

.detail-kpi-card.ok strong { color: var(--ok); }
.detail-kpi-card.warn strong { color: #fbbf24; }
.detail-kpi-card.danger strong { color: var(--danger); }
.detail-kpi-card small {
    color: var(--muted);
    font-weight: 700;
}

.detail-kpi-card .tiny-spark {
    width: 100%;
    max-width: 120px;
}

.detail-day-summary {
    min-height: 152px;
    padding: 16px 18px;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 10px;
    background:
        radial-gradient(circle at top right, rgba(45, 212, 191, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(96, 165, 250, 0.04), rgba(17, 22, 28, 0.96));
}

.detail-day-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-day-summary-tools {
    min-width: min(100%, 380px);
    display: grid;
    justify-items: end;
    gap: 10px;
}

.detail-day-summary-head h3 {
    margin: 4px 0 0;
    font-size: 1.1rem;
}

.detail-date-select-inline {
    width: min(100%, 380px);
}

.detail-day-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.detail-day-summary-item {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(48, 55, 68, 0.8);
    border-radius: 10px;
    background: rgba(17, 22, 28, 0.75);
}

.detail-day-summary-item span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.detail-day-summary-item strong {
    font-size: 1rem;
    line-height: 1.2;
}

.detail-activity-strip-panel,
.detail-usage-card,
.detail-screen-panel,
.detail-current-state {
    padding: 18px;
    margin-bottom: 18px;
}

.detail-usage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.detail-usage-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(110px, 1fr) 82px;
}

.detail-media-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.detail-screen-panel .player-shell-content {
    min-height: 420px;
    overflow: hidden;
    border-radius: 8px;
}

.detail-audio-wrap {
    display: grid;
    gap: 18px;
}

.detail-audio-wrap .audio-panel {
    margin-bottom: 0;
}

.detail-current-state {
    display: grid;
    gap: 10px;
}

.detail-current-state div {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(70px, 0.35fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.detail-current-state span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-current-state strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-collapse {
    padding: 0;
    overflow: hidden;
    margin-bottom: 18px;
}

.detail-collapse summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 18px;
    cursor: pointer;
    list-style: none;
}

.detail-collapse summary::-webkit-details-marker {
    display: none;
}

.detail-collapse summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 900;
}

.detail-collapse summary::after {
    content: "▾";
    color: var(--muted);
    transition: transform 0.18s ease;
}

.detail-collapse[open] summary::after {
    transform: rotate(180deg);
}

.detail-collapse summary strong {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.85rem;
}

.detail-collapse-body {
    padding: 0 18px 18px;
}

.detail-collapse-body > .panel {
    margin-bottom: 0;
}

@media (max-width: 1080px) {
    .unified-kpi-grid,
    .department-dashboard-grid,
    .overview-metric-grid,
    .problem-grid,
    .detail-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workstation-date-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-date-ribbon-chip {
        flex-basis: 104px;
    }

    .detail-day-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-day-summary-tools {
        min-width: 0;
        width: 100%;
        justify-items: stretch;
    }

}

@media (max-width: 720px) {
    .unified-hero,
    .section-title-row,
    .workstation-head,
    .detail-dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .unified-kpi-grid,
    .department-dashboard-grid,
    .overview-metric-grid,
    .problem-grid,
    .workstation-date-strip,
    .detail-kpi-grid,
    .detail-usage-grid,
    .detail-media-grid {
        grid-template-columns: 1fr;
    }

    .unified-kpi-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .detail-date-rail-card {
        padding: 14px 14px 12px;
    }

    .detail-date-rail-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-day-summary-grid {
        grid-template-columns: 1fr;
    }

    .tiny-spark {
        display: none;
    }

    .hero-pill,
    .section-link {
        white-space: normal;
    }

    .unified-usage-grid,
    .unified-screen-grid,
    .workstation-screen-grid {
        grid-template-columns: 1fr;
    }

    .usage-row {
        grid-template-columns: 1fr;
    }
}
