:root {
    --black: #0a0a0a;
    --ink: #202020;
    --muted: #6c6c6c;
    --line: #dedede;
    --surface: #ffffff;
    --canvas: #f3f3f1;
    --soft: #e8e8e5;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Jost", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    height: 76px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.brand img { width: 86px; height: 54px; object-fit: contain; display: block; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.connection-pill[data-state="connected"] .connection-dot { background: var(--black); box-shadow: 0 0 0 4px #dedede; }
.connection-pill[data-state="offline"] .connection-dot { background: #555; }
.text-button { border: 0; padding: 4px; background: transparent; color: var(--ink); font-weight: 600; }
.text-button:hover { text-decoration: underline; }

.dashboard { width: min(1420px, 90vw); margin: 0 auto; padding: 55px 0 72px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 700; color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2.1rem, 4vw, 4.2rem); line-height: .98; letter-spacing: -.055em; color: var(--black); }
h2 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: -.035em; }
.last-updated { margin: 0; color: var(--muted); font-size: .8rem; }

.stats-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card { min-height: 160px; padding: 24px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat-card-primary { color: #fff; background: var(--black); border-color: var(--black); }
.stat-card > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.stat-card-primary > span, .stat-card-primary small { color: #aaa; }
.stat-card strong { margin: auto 0 4px; font-size: 3rem; line-height: 1; letter-spacing: -.06em; }
.stat-card small { color: var(--muted); font-size: .75rem; }

.panel { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.panel-heading { min-height: 92px; padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 5px; }
.live-indicator { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--soft); border-radius: 999px; font-size: .75rem; font-weight: 700; }
.live-indicator i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--black); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.active-calls { min-height: 210px; padding: 20px; display: grid; gap: 12px; }
.empty-state { min-height: 170px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 12px 0 4px; color: var(--ink); }
.empty-state p { margin-bottom: 0; font-size: .85rem; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--black); }
.active-call-card { padding: 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.call-avatar { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--black); font-size: .82rem; font-weight: 700; }
.call-main h3 { margin: 7px 0 2px; font-size: 1.18rem; }
.call-main p { margin: 0; font-size: .82rem; color: var(--muted); }
.call-meta { display: grid; grid-template-columns: auto auto; gap: 4px 14px; font-size: .78rem; text-align: right; }
.call-meta span { color: var(--muted); }

.logs-heading { border-bottom: 0; }
.filters { padding: 0 26px 20px; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(130px, .35fr) repeat(2, minmax(160px, .45fr)) auto; gap: 10px; }
.filters label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.filters input, .filters select { min-height: 43px; width: 100%; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; color: var(--ink); outline: none; }
.filters input:focus, .filters select:focus { border-color: #777; background: #fff; }
.search-field { align-self: end; }
.filter-button, .primary-button { min-height: 43px; align-self: end; padding: 0 20px; color: #fff; background: var(--black); border: 1px solid var(--black); border-radius: 9px; font-weight: 700; }
.filter-button:hover, .primary-button:hover { background: #292929; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th { padding: 14px 18px; color: var(--muted); background: #f7f7f5; text-align: left; text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; }
td { padding: 17px 18px; border-top: 1px solid #e9e9e7; white-space: nowrap; }
.number-cell { color: var(--black); font-weight: 700; }
.table-empty { height: 120px; text-align: center; color: var(--muted); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: var(--soft); color: #505050; text-transform: capitalize; font-size: .68rem; font-weight: 700; }
.status-chip.ringing { color: #fff; background: var(--black); }
.status-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.direction-chip { display: inline-flex; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; text-transform: capitalize; font-size: .66rem; font-weight: 700; }
.direction-chip.outbound { color: #fff; background: var(--black); border-color: var(--black); }

.login-page { min-height: 100vh; background: var(--black); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.login-card { width: min(430px, 100%); padding: 42px; background: #fff; border-radius: 18px; }
.login-logo { width: 100px; height: 80px; object-fit: contain; margin-bottom: 36px; }
.login-copy h1 { font-size: 2.5rem; margin-bottom: 12px; }
.login-copy > p:last-child { color: var(--muted); font-size: .9rem; }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.login-form input { height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.login-form input:focus { border-color: var(--black); }
.login-form .primary-button { margin-top: 4px; }
.form-error { margin: 0; padding: 10px 12px; background: var(--soft); border-radius: 8px; font-size: .78rem; }

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filters { grid-template-columns: 1fr 1fr; }
    .search-field { grid-column: 1 / -1; }
    .filter-button { width: 100%; }
}
@media (max-width: 620px) {
    .topbar { padding: 0 20px; }
    .connection-pill span:last-child { display: none; }
    .dashboard { width: calc(100% - 28px); padding-top: 34px; }
    .page-heading { display: block; }
    .last-updated { margin-top: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { min-height: 132px; padding: 18px; }
    .stat-card strong { font-size: 2.35rem; }
    .filters { grid-template-columns: 1fr; }
    .search-field { grid-column: auto; }
    .active-call-card { grid-template-columns: auto 1fr; }
    .call-meta { grid-column: 1 / -1; text-align: left; }
    .login-card { padding: 30px; }
}

/* Application workspace */
.workspace-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 18px 20px; display: flex; flex-direction: column; background: var(--black); color: #fff; }
.sidebar-brand { min-height: 112px; padding: 0; display: grid; place-items: center; border-bottom: 1px solid #2b2b2b; }
.sidebar-brand img { width: 142px; height: 96px; display: block; object-fit: contain; filter: invert(1) brightness(2.4); }
.sidebar-nav { display: grid; gap: 7px; margin-top: 25px; }
.sidebar-nav a { min-height: 47px; padding: 0 14px; display: flex; align-items: center; gap: 13px; border-radius: 10px; color: #a8a8a8; text-decoration: none; font-size: .9rem; font-weight: 600; transition: .18s ease; }
.sidebar-nav a:hover { color: #fff; background: #181818; }
.sidebar-nav a.active { color: var(--black); background: #fff; }
.sidebar-nav-group { display: grid; gap: 5px; }
.sidebar-subnav { display: grid; gap: 2px; margin-left: 36px; }
.sidebar-subnav a { min-height: 31px; padding: 0 10px; border-radius: 7px; color: #858585; font-size: .72rem; }
.sidebar-subnav a.active { color: #fff; background: #242424; }
.nav-icon { width: 22px; font-size: 1.12rem; text-align: center; }
.sidebar-user { margin-top: auto; padding: 18px 12px 0; display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; border-top: 1px solid #2b2b2b; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { overflow: hidden; color: #fff; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { margin-top: 1px; color: #7d7d7d; font-size: .67rem; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--black); background: #fff; border: 1px solid #d3d3d3; font-size: .75rem; font-weight: 700; }
.workspace-main { min-width: 0; }
.workspace-topbar { min-height: 76px; padding: 0 3vw; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.workspace-topbar h2 { font-size: 1rem; letter-spacing: -.01em; }
.mobile-brand { display: none; }
.workspace-content { width: min(1460px, calc(100% - 6vw)); margin: 0 auto; padding: 46px 0 72px; }
.dashboard-meta { min-height: 28px; margin-bottom: 18px; display: flex; justify-content: flex-end; align-items: center; }

.agent-performance-section { margin: 30px 0; }
.agent-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.agent-section-heading .eyebrow { margin-bottom: 4px; }
.agent-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agent-card { min-height: 178px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.agent-card-head { display: flex; align-items: center; gap: 12px; }
.agent-avatar { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--black); font-size: .72rem; font-weight: 700; }
.agent-card-head h3 { margin: 0; font-size: .95rem; }
.agent-card-head span { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; }
.agent-card-head .agent-dids { margin-top: 5px; color: #4f4f4f; font-size: .7rem; font-weight: 600; }
.agent-metrics { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.agent-metrics div { min-width: 0; padding: 11px 9px; background: var(--canvas); border-radius: 10px; }
.agent-metrics span, .agent-metrics strong { display: block; }
.agent-metrics span { color: var(--muted); font-size: .61rem; }
.agent-metrics strong { margin-top: 4px; color: var(--black); font-size: 1.05rem; }
.agent-metrics small { display: block; margin-top: 3px; color: var(--muted); font-size: .54rem; text-transform: uppercase; letter-spacing: .04em; }
.agent-empty { grid-column: 1 / -1; min-height: 110px; display: grid; place-items: center; padding: 24px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 16px; text-align: center; font-size: .78rem; }

.stats-grid-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid-six .stat-card { min-height: 146px; }
.stats-grid-six .stat-card strong { font-size: 2.65rem; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 14px; }
.compact-heading { min-height: 82px; }
.chart-note { color: var(--muted); font-size: .73rem; }
.hourly-chart { height: 245px; padding: 30px 24px 20px; display: grid; grid-template-columns: repeat(24, minmax(8px, 1fr)); gap: 6px; align-items: end; }
.hour-column { height: 100%; display: grid; grid-template-rows: 16px 1fr 18px; gap: 6px; align-items: end; min-width: 0; text-align: center; }
.hour-column { position: relative; cursor: help; }
.hour-column::after { content: attr(data-tooltip); position: absolute; z-index: 12; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: 220px; padding: 7px 9px; color: #fff; background: var(--black); border-radius: 7px; opacity: 0; pointer-events: none; transform: translate(-50%, 5px); transition: opacity .15s ease, transform .15s ease; font-size: .65rem; font-weight: 600; line-height: 1.35; }
.hour-column:hover::after { opacity: 1; transform: translate(-50%, 0); }
.hour-column strong { min-height: 16px; color: var(--muted); font-size: .56rem; font-weight: 600; }
.hour-column span { overflow: hidden; color: var(--muted); font-size: .54rem; }
.hour-bar { position: relative; height: 100%; overflow: hidden; background: #f0f0ee; border-radius: 5px; }
.hour-bar i { position: absolute; right: 0; bottom: 0; left: 0; display: block; min-height: 2px; background: var(--black); border-radius: 5px; transition: height .35s ease; }
.direction-trend-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.trend-card { min-height: 214px; padding: 25px 28px 20px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.trend-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.trend-card-head span, .trend-card-head strong { display: block; }
.trend-card-head > div > span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.trend-card-head strong { margin-top: 3px; color: var(--black); font-size: 2.45rem; line-height: 1; letter-spacing: -.055em; }
.trend-pill { padding: 6px 10px; color: var(--muted); background: var(--canvas); border-radius: 999px; font-size: .68rem; font-weight: 700; }
.trend-sparkline { position: relative; height: 104px; margin-top: 20px; }
.trend-sparkline svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sparkline-path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sparkline-path.inbound { stroke: var(--black); }
.sparkline-path.outbound { stroke: #858581; }
.sparkline-point { fill: transparent; stroke: transparent; stroke-width: 10; cursor: help; vector-effect: non-scaling-stroke; }
.sparkline-point:hover { fill: #fff; stroke: var(--black); stroke-width: 3; }
.sparkline-point.outbound:hover { stroke: #858581; }
.chart-tooltip { position: absolute; z-index: 20; width: max-content; max-width: 220px; padding: 7px 9px; color: #fff; background: var(--black); border-radius: 7px; opacity: 0; pointer-events: none; transform: translate(-50%, -100%); transition: opacity .12s ease; font-size: .66rem; font-weight: 600; line-height: 1.3; }
.chart-tooltip.visible { opacity: 1; }
.outcome-content { min-height: 245px; padding: 26px; display: grid; grid-template-columns: 148px 1fr; gap: 28px; align-items: center; }
.outcome-donut { --answer-rate: 0deg; width: 148px; height: 148px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--black) var(--answer-rate), #dededb 0); position: relative; }
.outcome-donut::after { content: ""; position: absolute; width: 102px; height: 102px; border-radius: 50%; background: #fff; }
.outcome-donut span { position: relative; z-index: 1; font-size: 1.55rem; font-weight: 700; letter-spacing: -.04em; }
.outcome-legend { display: grid; gap: 11px; }
.outcome-legend p { margin: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: .78rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.answered-dot { background: var(--black); }
.missed-dot { background: #d7d7d4; }
.busiest-line { margin-top: 10px !important; padding-top: 15px; grid-template-columns: 1fr auto !important; border-top: 1px solid var(--line); color: var(--muted); }
.busiest-line strong { color: var(--black); }
.secondary-link { color: var(--black); text-decoration: none; font-size: .78rem; font-weight: 700; }
.secondary-link:hover { text-decoration: underline; }
.time-kind { margin-left: 3px; color: #9b9b9b; font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; }
.labelled-number { display: grid; gap: 5px; }
.labelled-number > strong { color: var(--black); font-size: .82rem; }
.label-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .69rem; font-weight: 500; }
.label-button, .recording-button { min-height: 29px; padding: 0 10px; border: 1px solid #cfcfcb; border-radius: 7px; color: var(--black); background: #fff; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.label-button:hover, .recording-button:hover { border-color: var(--black); }
.label-button:disabled { opacity: .45; cursor: wait; }
.label-icon-button { width: 25px; min-width: 25px; min-height: 25px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; font-size: .88rem; line-height: 1; }
.date-time-stack { display: grid; gap: 2px; }
.date-time-stack strong { color: var(--black); font-size: .79rem; }
.date-time-stack span { color: var(--muted); font-size: .7rem; }
.recording-player { display: block; width: 190px; height: 34px; }
.unavailable { color: #aaa; }

/* Users and forms */
.notice { margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .8rem; }
.success-notice { border-left: 4px solid var(--black); }
.error-notice { background: #ececea; }
.user-form { padding: 24px; }
.create-user-form { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 16px; align-items: end; }
.create-user-form > .permission-fieldset { grid-column: span 2; }
.user-form label, .user-edit-grid label { display: grid; gap: 6px; color: var(--muted); font-size: .69rem; font-weight: 600; }
.user-form input, .user-form select, .user-form textarea, .user-edit-grid input, .user-edit-grid select, .user-edit-grid textarea { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; color: var(--ink); outline: none; }
.user-form textarea, .user-edit-grid textarea { min-height: 70px; padding-top: 10px; padding-bottom: 10px; resize: vertical; font: inherit; }
.user-form input:focus, .user-form select:focus, .user-form textarea:focus, .user-edit-grid input:focus, .user-edit-grid select:focus, .user-edit-grid textarea:focus { border-color: #777; background: #fff; }
.did-assignment-field { grid-column: span 2; }
.did-assignment-field small { color: #999; font-size: .62rem; font-weight: 500; }
.permission-fieldset { min-height: 43px; margin: 0; padding: 9px 12px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 9px; }
.permission-fieldset legend { padding: 0 4px; color: var(--muted); font-size: .62rem; font-weight: 600; }
.check-label { display: inline-flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 7px !important; color: var(--ink) !important; font-size: .72rem !important; }
.check-label input { width: 15px !important; min-height: 15px !important; accent-color: var(--black); }
.active-check { align-self: center; }
.user-list-section { margin-top: 36px; }
.section-heading { margin-bottom: 16px; }
.user-list-panel { margin-top: 0; box-shadow: 0 12px 28px rgba(0, 0, 0, .055); }
.user-list-table td:last-child, .user-list-table th:last-child { width: 86px; text-align: center; }
.user-list-name { display: flex; align-items: center; gap: 10px; }
.user-list-name .user-avatar { width: 34px; height: 34px; }
.did-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.did-chip-list > span:not(.unavailable) { padding: 4px 7px; color: #414141; background: var(--canvas); border-radius: 6px; font-size: .65rem; font-weight: 600; }
.edit-user-button { border: 1px solid #cfcfcb; color: var(--black); background: #fff; }
.edit-user-button:hover { border-color: var(--black); background: var(--canvas); }
.user-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.user-edit-card { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.user-card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.user-card-head strong, .user-card-head span { display: block; }
.user-card-head strong { font-size: .9rem; }
.user-card-head span { color: var(--muted); font-size: .68rem; }
.user-state { padding: 5px 8px; border-radius: 99px; background: var(--soft); color: var(--muted) !important; font-weight: 700; }
.user-state.active { color: #fff !important; background: var(--black); }
.user-edit-grid { margin: 18px 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.user-card-actions { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; }
.secondary-button { min-height: 39px; padding: 0 16px; color: var(--black); background: #fff; border: 1px solid var(--black); border-radius: 8px; font-weight: 700; }
.reports-panel { margin-top: 0; }
.report-filter-panel { position: relative; z-index: 100; margin-top: 0; margin-bottom: 30px; overflow: visible; }
.report-tabs { margin: -12px 0 24px; display: flex; gap: 8px; }
.report-tabs a { min-height: 38px; padding: 0 15px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; text-decoration: none; font-size: .75rem; font-weight: 700; }
.report-tabs a:hover { color: var(--black); border-color: #aaa; }
.report-tabs a.active { color: #fff; background: var(--black); border-color: var(--black); }
.overview-filters { grid-template-columns: repeat(2, minmax(185px, .55fr)) minmax(230px, .7fr) auto; justify-content: start; }
.did-multi-filter { position: relative; display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.multi-select-menu { position: relative; }
.multi-select-menu summary { min-height: 43px; padding: 0 36px 0 13px; display: flex; align-items: center; position: relative; list-style: none; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fafafa; cursor: pointer; font-size: .78rem; font-weight: 500; }
.multi-select-menu summary::-webkit-details-marker { display: none; }
.multi-select-menu summary::after { content: '⌄'; position: absolute; right: 13px; color: var(--muted); font-size: .9rem; }
.multi-select-menu[open] summary { border-color: #777; background: #fff; }
.multi-select-options { position: absolute; z-index: 120; top: calc(100% + 6px); right: 0; left: 0; max-height: 230px; padding: 7px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 35px rgba(0, 0, 0, .14); }
.multi-select-options label { padding: 8px 7px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; border-radius: 6px; color: var(--ink); cursor: pointer; font-size: .72rem; }
.multi-select-options label:hover { background: var(--canvas); }
.multi-select-options input { width: 15px; min-height: 15px; accent-color: var(--black); }
.filter-loading { display: block; padding: 8px; color: var(--muted); font-size: .7rem; }
.report-overview-heading { margin: 0 2px 14px; display: flex; align-items: end; justify-content: space-between; }
.report-overview-heading .eyebrow { margin-bottom: 4px; }
.report-stats { margin-bottom: 24px; }
.report-analytics { margin-bottom: 0; }
.report-analytics .panel { margin-top: 0; }
.report-direction-trends { margin-top: 14px; margin-bottom: 30px; }
.pagination-bar { min-height: 70px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.pagination-bar p { margin: 0; color: var(--muted); font-size: .72rem; }
.pagination-buttons { display: flex; align-items: center; gap: 5px; }
.pagination-buttons button { min-width: 34px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-size: .7rem; font-weight: 700; }
.pagination-buttons button:hover:not(:disabled), .pagination-buttons button.active { color: #fff; background: var(--black); border-color: var(--black); }
.pagination-buttons button:disabled { color: #aaa; background: #f3f3f1; cursor: not-allowed; }

/* Card depth and interaction */
.stat-card, .agent-card, .trend-card, .active-call-card { box-shadow: 0 8px 22px rgba(0, 0, 0, .055); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.stat-card:hover, .agent-card:hover, .trend-card:hover, .active-call-card:hover { position: relative; z-index: 2; transform: scale(1.015); box-shadow: 0 16px 34px rgba(0, 0, 0, .11); border-color: #c8c8c4; }
.stat-card-primary:hover { border-color: var(--black); }
.priority-live-panel { margin-top: 0; margin-bottom: 30px; box-shadow: 0 12px 30px rgba(0, 0, 0, .07); }
.report-agent-section { margin-top: 4px; }
.performance-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.performance-heading-actions { display: flex; align-items: center; gap: 18px; }
.display-button { min-width: 112px; }
.performance-summary-cards { margin-bottom: 30px; }
.performance-display-header { display: none; }
.performance-agent-card { min-height: 290px; color: var(--ink); text-decoration: none; }
.performance-agent-card .agent-card-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.agent-card-arrow { margin-left: auto; color: var(--muted); font-size: 1.2rem !important; transition: transform .18s ease; }
.performance-agent-card:hover .agent-card-arrow { color: var(--black); transform: translateX(3px); }
.performance-metrics { margin-top: 17px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.performance-metrics div { min-width: 0; padding: 10px; background: var(--canvas); border-radius: 9px; }
.performance-metrics span, .performance-metrics strong, .performance-metrics small { display: block; }
.performance-metrics span { color: var(--muted); font-size: .59rem; }
.performance-metrics strong { margin-top: 3px; color: var(--black); font-size: 1rem; }
.performance-metrics small { margin-top: 2px; color: var(--muted); font-size: .5rem; text-transform: uppercase; }
.agent-last-activity { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .65rem; }
.agent-last-activity strong { color: var(--ink); font-size: .68rem; text-align: right; }
.agent-detail-heading { align-items: center; }
.back-button { display: inline-flex; align-items: center; text-decoration: none; }
.agent-detail-filters { grid-template-columns: minmax(190px, .6fr) repeat(2, minmax(185px, .55fr)) auto; justify-content: start; }
.agent-detail-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px; }
.agent-activity-panel { margin-top: 0; }

/* External performance display */
.performance-display-mode { background: var(--canvas); }
.performance-display-mode .workspace-shell { display: block; }
.performance-display-mode .sidebar, .performance-display-mode .workspace-topbar { display: none; }
.performance-display-mode .workspace-content { width: 100%; max-width: none; padding: 24px 28px 38px; }
.performance-display-mode .workspace-content > .page-heading,
.performance-display-mode .workspace-content > .report-tabs,
.performance-display-mode .workspace-content > .report-filter-panel { display: none; }
.performance-display-mode .performance-display-header { min-height: 88px; margin-bottom: 22px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 26px rgba(0, 0, 0, .06); }
.performance-display-header > div:first-child { display: flex; align-items: center; gap: 17px; }
.performance-display-header img { width: 92px; height: 58px; object-fit: contain; }
.performance-display-header .eyebrow { margin-bottom: 3px; }
.performance-display-header h1 { font-size: 2rem; }
.display-header-tools { display: flex; align-items: center; gap: 16px; }
.display-header-tools > span { color: var(--muted); font-size: .83rem; font-weight: 600; }
.performance-display-mode .performance-summary-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.performance-display-mode .performance-summary-cards .stat-card { min-height: 175px; }
.performance-display-mode .performance-summary-cards .stat-card strong { font-size: clamp(2.5rem, 4vw, 4rem); }
.performance-display-mode .performance-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.performance-display-mode .report-overview-heading { margin-top: 8px; }

/* In-app dialogs */
.app-dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 28px 80px rgba(0, 0, 0, .28); }
.app-dialog::backdrop { background: rgba(0, 0, 0, .48); backdrop-filter: blur(3px); }
.dialog-form { padding: 26px; }
.dialog-heading { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.dialog-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; font-size: 1.25rem; line-height: 1; }
.dialog-close:hover { background: var(--canvas); }
.dialog-copy { margin: -10px 0 18px; color: var(--muted); font-size: .8rem; }
.dialog-input { display: grid; gap: 6px; color: var(--muted); font-size: .69rem; font-weight: 600; }
.dialog-input input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; outline: none; }
.dialog-input input:focus { border-color: #777; background: #fff; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.dialog-actions .primary-button { min-width: 120px; }
.dialog-error { margin: 12px 0 0; padding: 9px 11px; color: #333; background: var(--soft); border-radius: 7px; font-size: .72rem; }
.label-dialog { width: min(470px, calc(100% - 28px)); }
.user-edit-dialog .user-edit-grid { margin-top: 0; }

@media (max-width: 1180px) {
    .workspace-shell { grid-template-columns: 205px minmax(0, 1fr); }
    .stats-grid-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-grid { grid-template-columns: 1fr; }
    .direction-trend-grid { grid-template-columns: 1fr; }
    .create-user-form { grid-template-columns: 1fr 1fr; }
    .create-user-form > .permission-fieldset { grid-column: 1 / -1; }
    .did-assignment-field { grid-column: 1 / -1; }
    .overview-filters { grid-template-columns: 1fr 1fr; }
    .overview-filters .filter-button { width: 100%; }
    .performance-card-grid { grid-template-columns: 1fr; }
    .agent-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-detail-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
    .workspace-shell { display: block; }
    .sidebar { position: sticky; z-index: 20; width: 100%; height: auto; padding: 10px 14px; display: grid; grid-template-columns: auto 1fr; align-items: center; }
    .sidebar-brand { min-height: 0; padding: 0 14px 0 0; border: 0; border-right: 1px solid #2b2b2b; }
    .sidebar-brand img { width: 70px; height: 48px; }
    .sidebar-nav { margin: 0 0 0 12px; display: flex; gap: 5px; overflow-x: auto; }
    .sidebar-nav a { min-height: 38px; padding: 0 10px; white-space: nowrap; }
    .sidebar-nav-group { display: flex; gap: 5px; }
    .sidebar-subnav { display: flex; gap: 5px; margin: 0; }
    .sidebar-subnav a { min-height: 38px; }
    .nav-icon { display: none; }
    .sidebar-user { display: none; }
    .workspace-topbar { padding: 0 18px; }
    .workspace-content { width: calc(100% - 28px); padding-top: 32px; }
    .user-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .workspace-topbar h2 { display: none; }
    .mobile-brand { display: block; font-weight: 700; }
    .stats-grid-six { grid-template-columns: 1fr 1fr; }
    .agent-card-grid { grid-template-columns: 1fr; }
    .hourly-chart { gap: 3px; padding-right: 12px; padding-left: 12px; }
    .hour-column span { display: none; }
    .outcome-content { grid-template-columns: 120px 1fr; gap: 18px; padding: 20px; }
    .outcome-donut { width: 120px; height: 120px; }
    .outcome-donut::after { width: 82px; height: 82px; }
    .create-user-form, .user-edit-grid { grid-template-columns: 1fr; }
    .create-user-form > .permission-fieldset { grid-column: auto; }
    .did-assignment-field { grid-column: auto; }
    .permission-fieldset { flex-wrap: wrap; }
    .pagination-bar { align-items: flex-start; flex-direction: column; }
    .pagination-buttons { width: 100%; overflow-x: auto; }
    .overview-filters { grid-template-columns: 1fr; }
    .user-list-table th:nth-child(2), .user-list-table td:nth-child(2), .user-list-table th:nth-child(3), .user-list-table td:nth-child(3) { display: none; }
    .dialog-form { padding: 20px; }
    .dialog-actions { width: 100%; }
    .dialog-actions button { flex: 1; }
    .performance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-detail-filters, .agent-detail-stats { grid-template-columns: 1fr; }
    .agent-detail-heading .back-button { margin-top: 16px; }
    .performance-heading-actions { margin-top: 16px; align-items: flex-start; flex-direction: column; }
    .performance-display-mode .performance-summary-cards, .performance-display-mode .performance-card-grid { grid-template-columns: 1fr; }
    .performance-display-mode .performance-display-header { align-items: flex-start; flex-direction: column; }
}
