:root {
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  color: #1f1f1f;
  background: #f3f3f3;
  font-synthesis: none;
  --accent: #0067c0;
  --accent-hover: #005a9e;
  --accent-soft: #e8f2fb;
  --surface: #ffffff;
  --surface-alt: #f8f8f8;
  --border: #d9d9d9;
  --border-soft: #e8e8e8;
  --text: #1f1f1f;
  --muted: #666666;
  --danger: #c42b1c;
  --danger-soft: #fbeae8;
  --warning: #8a4b08;
  --warning-soft: #fff4ce;
  --success: #0f6b3e;
  --success-soft: #e7f4ec;
  --sidebar-width: 242px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: #f3f3f3; color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f3f3f3; }
.login-panel { width: min(390px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 30px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.login-brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; }
.login-brand { margin-bottom: 28px; }
.login-brand h1 { margin: 0; font-size: 23px; font-weight: 600; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.brand-mark { width: 44px; height: 44px; border-radius: 7px; display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 24px; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 5px; font-size: 19px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; background: #f8f8f8; border-right: 1px solid var(--border); z-index: 20; }
.sidebar-brand { height: 64px; padding: 0 16px; border-bottom: 1px solid var(--border-soft); }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 14px; font-weight: 600; }
.sidebar-brand span { color: var(--muted); font-size: 11px; margin-top: 1px; }
.nav-list { padding: 10px 8px; display: grid; gap: 2px; overflow-y: auto; }
.nav-item { width: 100%; min-height: 38px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #303030; text-align: left; font-size: 13px; }
.nav-item i { font-size: 18px; color: #555; }
.nav-item:hover { background: #ededed; }
.nav-item.active { background: #e7e7e7; border-color: #dedede; }
.nav-item.active::before { content: ""; position: absolute; width: 3px; height: 18px; margin-left: -11px; border-radius: 3px; background: var(--accent); }
.nav-item.active i { color: var(--accent); }
.nav-divider { height: 1px; background: var(--border-soft); margin: 8px 7px; }
.nav-count { min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--danger); font-size: 10px; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 10px; border-top: 1px solid var(--border-soft); }
.profile-card { display: flex; align-items: center; gap: 9px; padding: 8px; margin-bottom: 6px; }
.profile-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e5e5e5; color: #555; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; font-weight: 600; }
.profile-copy span { margin-top: 2px; font-size: 11px; color: var(--muted); }

.content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 0 26px 36px; }
.content-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.content-header h1 { margin: 0; font-size: 22px; font-weight: 600; }
.content-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #999; }
.status-chip.online { color: var(--success); border-color: #b9dbc8; background: var(--success-soft); }
.status-chip.online .status-dot { background: var(--success); }

.page-section { display: none; animation: page-in .15s ease-out; }
.page-section.active { display: block; }
@keyframes page-in { from { opacity: .4; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.toolbar, .section-intro, .panel-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.toolbar { min-height: 60px; margin-bottom: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.toolbar-title strong, .toolbar-title span { display: block; }
.toolbar-title strong { font-size: 13px; }
.toolbar-title span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.toolbar-controls, .inline-controls, .filter-actions, .dialog-actions, .live-actions { display: flex; align-items: center; gap: 8px; }
.compact-field { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.compact-field input, .compact-field select, .inline-controls input { min-height: 32px; }
.section-intro { margin-bottom: 16px; }
.section-intro h2 { margin: 0; font-size: 18px; font-weight: 600; }
.section-intro p { margin: 4px 0 0; color: var(--muted); font-size: 12px; max-width: 740px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { min-height: 112px; display: flex; align-items: center; gap: 13px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.metric-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 5px; background: #ededed; color: #4b4b4b; font-size: 20px; }
.metric-card.attention .metric-icon { background: var(--warning-soft); color: var(--warning); }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 11px; }
.metric-card strong { margin: 3px 0 2px; font-size: 25px; line-height: 1.1; font-weight: 600; }
.metric-card small { color: #777; font-size: 10.5px; }

.layout-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 14px; margin-bottom: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 14px; overflow: hidden; }
.panel-header { min-height: 58px; padding: 13px 15px; border-bottom: 1px solid var(--border-soft); }
.panel-header h2 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.search-panel { overflow: visible; }

.button, .icon-button { border: 1px solid transparent; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 500; }
.button { min-height: 32px; padding: 0 12px; font-size: 12px; }
.button i { font-size: 16px; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { color: var(--text); background: #f3f3f3; border-color: #cfcfcf; }
.button.secondary:hover, .button.ghost:hover, .button.tertiary:hover { background: #e9e9e9; }
.button.tertiary, .button.ghost { color: var(--text); background: transparent; border-color: transparent; }
.button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: #a92518; }
.button.full { width: 100%; }
.icon-button { width: 32px; height: 32px; padding: 0; background: transparent; color: #444; font-size: 18px; }
.icon-button:hover { background: #e9e9e9; }

.field { display: grid; gap: 5px; font-size: 11px; color: #4a4a4a; }
.field small { color: var(--muted); font-size: 10.5px; }
input, select, textarea { width: 100%; border: 1px solid #bfbfbf; border-radius: 3px; background: #fff; color: var(--text); outline: none; }
input, select { min-height: 34px; padding: 0 9px; }
textarea { resize: vertical; padding: 8px 9px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input::placeholder, textarea::placeholder { color: #8b8b8b; }
.form-stack { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { min-height: 18px; color: var(--danger); font-size: 11px; }
.form-message { min-height: 18px; color: var(--success); font-size: 11px; }
.form-message.error { color: var(--danger); }
.input-with-suffix { display: grid; grid-template-columns: 1fr auto; }
.input-with-suffix input { border-radius: 3px 0 0 3px; }
.input-with-suffix span { min-width: 54px; display: grid; place-items: center; border: 1px solid #bfbfbf; border-left: 0; border-radius: 0 3px 3px 0; background: #f3f3f3; color: var(--muted); }
.switch-field { min-height: 34px; display: flex; align-items: center; gap: 8px; color: #444; font-size: 11px; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 34px; height: 18px; padding: 2px; border-radius: 10px; background: #8a8a8a; transition: .15s; }
.switch::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .15s; }
.switch-field input:checked + .switch { background: var(--accent); }
.switch-field input:checked + .switch::after { transform: translateX(16px); }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: middle; font-size: 11.5px; }
.data-table th { color: #5f5f5f; background: #fafafa; font-weight: 600; white-space: nowrap; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-main { display: block; color: var(--text); font-weight: 500; }
.cell-sub { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.empty-row td { padding: 28px 12px; color: var(--muted); text-align: center; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 7px; border: 1px solid #d5d5d5; border-radius: 11px; background: #f6f6f6; color: #555; font-size: 10.5px; white-space: nowrap; }
.status-badge.warning { border-color: #ead9a2; background: var(--warning-soft); color: var(--warning); }
.status-badge.danger { border-color: #efc3be; background: var(--danger-soft); color: var(--danger); }
.status-badge.success { border-color: #badbc8; background: var(--success-soft); color: var(--success); }
.status-badge.neutral { color: #555; }

.bar-list { min-height: 238px; padding: 14px 15px; display: grid; align-content: start; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 92px; align-items: center; gap: 10px; font-size: 11px; }
.bar-label { color: #4f4f4f; }
.bar-track { height: 8px; overflow: hidden; border-radius: 2px; background: #ececec; }
.bar-fill { height: 100%; min-width: 2px; border-radius: 2px; background: var(--accent); }
.bar-value { color: var(--muted); text-align: right; white-space: nowrap; }
.empty-state { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 26px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 238px; }
.empty-state i { font-size: 28px; color: #888; }
.empty-state strong { color: #4b4b4b; font-size: 13px; }
.empty-state span { font-size: 11px; }

.notice { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 5px; font-size: 11.5px; }
.notice.neutral { background: #fafafa; color: #555; }
.review-grid { display: grid; gap: 10px; }
.review-card { display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(240px, .9fr) auto; align-items: center; gap: 16px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.review-card.priority { border-left: 4px solid var(--warning); padding-left: 11px; }
.review-main strong { display: block; font-size: 13px; font-weight: 600; }
.review-main span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.review-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

.filter-grid { display: grid; grid-template-columns: 1.1fr 1.2fr .8fr .8fr 1fr; gap: 10px; align-items: end; padding: 15px; }
.filter-grid .switch-field { grid-column: span 2; }
.filter-actions { justify-content: flex-end; grid-column: -3 / -1; }
.calls-table { min-width: 1320px; }
.calls-table th:nth-child(6),
.calls-table td:nth-child(6),
.recording-audio-cell { min-width: 430px; width: 38vw; }
.recording-audio-wrap { width: 100%; min-width: 380px; max-width: 760px; }
.recording-audio-wrap .audio-player { display: block; width: 100%; min-width: 380px; height: 40px; }
.audio-player { height: 32px; max-width: 100%; }
.audio-player.wide { width: 100%; height: 40px; margin: 4px 0 12px; }
@media (max-width: 720px) {
  .calls-table th:nth-child(6),
  .calls-table td:nth-child(6),
  .recording-audio-cell { min-width: 340px; width: 340px; }
  .recording-audio-wrap,
  .recording-audio-wrap .audio-player { min-width: 320px; }
}

.live-layout { grid-template-columns: minmax(300px, .75fr) minmax(380px, 1.25fr); }
.live-layout .panel { margin-bottom: 0; }
.live-layout .form-stack, .live-session-panel > .live-state, .live-session-panel > .live-actions { margin: 15px; }
.live-state { min-height: 114px; display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--border-soft); border-radius: 5px; background: #fafafa; }
.live-state-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; background: #e9e9e9; font-size: 20px; color: #555; }
.live-state strong, .live-state span { display: block; }
.live-state strong { font-size: 13px; }
.live-state span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.live-state.active .live-state-icon { background: var(--success-soft); color: var(--success); }
.live-actions { justify-content: flex-end; }

.notification-list { display: grid; gap: 8px; }
.notification-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: start; gap: 11px; padding: 12px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; }
.notification-item.unread { border-left: 3px solid var(--accent); padding-left: 11px; }
.notification-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #ededed; color: #555; font-size: 17px; }
.notification-copy strong { display: block; font-size: 12px; }
.notification-copy p { margin: 3px 0 0; color: #555; font-size: 11px; }
.notification-time { color: var(--muted); font-size: 10.5px; white-space: nowrap; }

.settings-layout { grid-template-columns: minmax(340px, .85fr) minmax(280px, .45fr); }
.settings-layout .panel { margin-bottom: 0; }
.settings-layout .form-stack { padding: 15px; }
.storage-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 15px; }
.storage-summary div { padding: 14px; border: 1px solid var(--border-soft); border-radius: 5px; background: #fafafa; }
.storage-summary span, .storage-summary strong { display: block; }
.storage-summary span { color: var(--muted); font-size: 11px; }
.storage-summary strong { margin-top: 5px; font-size: 20px; font-weight: 600; }
.password-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)) auto; gap: 10px; align-items: end; padding: 15px; }
.password-grid .form-message { grid-column: 1 / -1; }

.dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 1px solid #bdbdbd; border-radius: 7px; background: var(--surface); color: var(--text); box-shadow: 0 14px 36px rgba(0,0,0,.18); }
.dialog::backdrop { background: rgba(0,0,0,.28); }
.dialog.small-dialog { width: min(420px, calc(100vw - 28px)); }
.dialog.review-dialog { width: min(620px, calc(100vw - 28px)); }
.dialog-body { padding: 17px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-header h2 { margin: 0; font-size: 17px; font-weight: 600; }
.dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.dialog-actions { justify-content: flex-end; margin-top: 17px; }
.activation-code { padding: 18px; border: 1px solid var(--border); border-radius: 5px; background: #fafafa; text-align: center; font-family: "Cascadia Mono", Consolas, monospace; font-size: 30px; letter-spacing: 7px; font-weight: 600; }
.muted-text { color: var(--muted); font-size: 11px; text-align: center; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; display: flex; align-items: start; gap: 9px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 5px; background: #fff; box-shadow: 0 7px 20px rgba(0,0,0,.13); font-size: 11.5px; }
.toast.error { border-left: 3px solid var(--danger); }
.toast.success { border-left: 3px solid var(--success); }
.mobile-only, .sidebar-backdrop { display: none; }

@media (max-width: 1150px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-grid .switch-field { grid-column: span 1; }
  .filter-actions { grid-column: span 2; }
  .review-card { grid-template-columns: 1fr 1fr; }
  .review-card > :last-child { grid-column: 1 / -1; justify-self: end; }
  .password-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.28); }
  .sidebar-backdrop.open { display: block; }
  .content { margin-left: 0; padding: 0 16px 28px; }
  .mobile-only { display: inline-flex; }
  .layout-two, .live-layout, .settings-layout { grid-template-columns: 1fr; }
  .settings-layout .panel { margin-bottom: 14px; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .review-card { grid-template-columns: 1fr; }
  .review-card > :last-child { grid-column: auto; justify-self: stretch; }
}
@media (max-width: 600px) {
  .content-header { min-height: 66px; }
  .content-header p { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .toolbar, .section-intro, .panel-header { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { width: 100%; flex-wrap: wrap; }
  .filter-grid, .form-row, .password-grid { grid-template-columns: 1fr; }
  .filter-grid .switch-field, .filter-actions { grid-column: auto; }
  .filter-actions { justify-content: stretch; }
  .filter-actions .button { flex: 1; }
  .bar-row { grid-template-columns: 62px 1fr; }
  .bar-value { grid-column: 2; text-align: left; }
  .notification-item { grid-template-columns: 32px 1fr; }
  .notification-time { grid-column: 2; }
}

/* v1.4: detailed team view and paged audit */
.field-note { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f7f9fb; }
.table-open { width: 28px; height: 28px; font-size: 16px; }
.pagination { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 13px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.employee-detail-dialog { width: min(1080px, calc(100vw - 36px)); }
.employee-detail-dialog .dialog-body { max-height: calc(100vh - 44px); overflow-y: auto; }
.detail-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.detail-metric { min-height: 82px; display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto 1fr; column-gap: 7px; padding: 11px; border: 1px solid var(--border-soft); border-radius: 5px; background: #fafafa; }
.detail-metric i { grid-row: 1 / 3; align-self: start; color: #5b5b5b; font-size: 18px; }
.detail-metric span { color: var(--muted); font-size: 10.5px; }
.detail-metric strong { align-self: end; font-size: 17px; font-weight: 600; }
.detail-period-note { margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(420px, 1.2fr); gap: 12px; }
.detail-section { margin-top: 12px; border: 1px solid var(--border-soft); border-radius: 5px; overflow: hidden; }
.detail-section h3 { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); background: #fafafa; font-size: 12px; font-weight: 600; }
.compact-table th, .compact-table td { padding-top: 8px; padding-bottom: 8px; }
.detail-table-scroll { max-height: 280px; overflow: auto; }

@media (max-width: 1150px) {
  .detail-metric-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination > div { width: 100%; justify-content: space-between; }
  .detail-metric-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}


/* v1.4.2: centrally managed recording applications */
.recording-apps-panel { margin-top: 14px; }
.panel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.recording-apps-list { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 8px; padding: 15px; }
.recording-app-item { min-height: 52px; display: grid; grid-template-columns: auto 30px 1fr; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 5px; background: #fafafa; cursor: pointer; }
.recording-app-item:hover { border-color: #c5c5c5; background: #f6f6f6; }
.recording-app-item input { margin: 0; }
.recording-app-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; background: #ececec; color: #555; font-size: 15px; }
.recording-app-item strong, .recording-app-item small { display: block; }
.recording-app-item strong { font-size: 11.5px; font-weight: 600; }
.recording-app-item small { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.recording-apps-unknown { margin: 0 15px 15px; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 5px; background: #fafafa; }
.recording-apps-unknown strong, .recording-apps-unknown small { display: block; }
.recording-apps-unknown small { margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 400; }
@media (max-width: 1200px) { .recording-apps-list { grid-template-columns: repeat(3, minmax(170px, 1fr)); } }
@media (max-width: 820px) { .recording-apps-list { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }
@media (max-width: 520px) { .recording-apps-list { grid-template-columns: 1fr; } }

/* v1.5 — журналы удаления и компактные служебные формы */
.compact-filter-grid { grid-template-columns: 1.2fr .8fr .8fr auto; }
.compact-notice { margin: 0; padding: 10px 12px; display: grid; gap: 3px; }
.compact-notice strong { font-size: 12px; font-weight: 600; }
.compact-notice span { font-size: 11px; color: var(--muted); }
.deletion-log-controls { justify-content: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.deletion-log-controls .compact-field { min-width: 190px; }
@media (max-width: 820px) {
  .compact-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .compact-filter-grid { grid-template-columns: 1fr; }
}

/* v1.6.2: active calls and per-user activity page */
.active-calls-list { padding: 14px; display: grid; gap: 12px; }
.active-call-team { border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden; background: #fff; }
.active-call-team > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: #f7f7f7; border-bottom: 1px solid var(--border-soft); }
.active-call-team > header strong, .active-call-team > header span { display: block; }
.active-call-team > header div > span { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.active-call-items { display: grid; }
.active-call-card { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 16px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.active-call-card:last-child { border-bottom: 0; }
.active-call-card > div:first-child strong, .active-call-card > div:first-child span, .active-call-card > div:first-child small { display: block; }
.active-call-card > div:first-child span, .active-call-card > div:first-child small { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.active-call-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.active-call-actions time { min-width: 76px; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
#page-userProfile .section-intro > div { display: grid; gap: 4px; }
#page-userProfile #backToUsers { justify-self: start; margin-bottom: 4px; }
@media (max-width: 760px) {
  .active-call-card { grid-template-columns: 1fr; }
  .active-call-actions { justify-content: space-between; }
}

/* v1.6.2 analytics/live/UI refinement */
.admin-dashboard-only[hidden], .supervisor-dashboard-only[hidden] { display: none !important; }

/* Compact logs: one event should never dominate the page. */
.log-table { table-layout: fixed; min-width: 820px; }
.log-table th, .log-table td { padding: 6px 9px; line-height: 1.25; vertical-align: middle; }
.log-table th:nth-child(1) { width: 145px; }
.log-table th:nth-child(2) { width: 190px; }
.log-table th:nth-child(3) { width: 155px; }
.log-table th:nth-child(4) { width: 105px; }
.log-table th:last-child { width: auto; }
.nowrap-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.compact-detail { display: block; max-width: min(42vw, 520px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #505050; }
.log-table .cell-sub { margin-top: 1px; line-height: 1.2; }
.log-table .status-badge { min-height: 20px; padding-inline: 6px; font-size: 10px; }
.pagination { min-height: 42px; padding: 6px 10px; }
.pagination .button { min-height: 28px; padding-inline: 8px; }

.compact-notification-list { gap: 5px; }
.compact-notification-list .notification-item { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; min-height: 52px; padding: 7px 9px; border-radius: 4px; }
.compact-notification-list .notification-item.unread { padding-left: 7px; }
.compact-notification-list .notification-icon { width: 28px; height: 28px; font-size: 14px; }
.notification-copy { min-width: 0; }
.notification-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-copy p { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.compact-action { min-height: 26px; padding: 0 7px; font-size: 10.5px; }

/* Long-term user analysis. */
.profile-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.profile-metric { min-height: 96px; padding: 13px 14px; }
.profile-metric > div { min-width: 0; }
.profile-metric strong { font-size: 21px; }
.status-text.success { color: var(--success); }
.status-text.warning { color: var(--warning); }
.status-text.neutral { color: var(--muted); }
.profile-password-panel .password-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)) auto; }

/* Admin analytics tables and team selection. */
.team-controls { flex-wrap: wrap; justify-content: flex-end; }
.team-controls .compact-field { min-width: 230px; }
#dashboardTeamsTable td:last-child, #dashboardPlatformTable td:last-child { white-space: nowrap; }

/* Active calls are inserted/removed without abrupt jumps. */
.active-call-card { transform-origin: top; transition: opacity .17s ease, transform .17s ease, max-height .17s ease, padding .17s ease; max-height: 100px; }
.active-call-card.entering { animation: active-call-enter .22s ease-out both; }
.active-call-card.leaving { opacity: 0; transform: translateY(-5px) scaleY(.96); max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
@keyframes active-call-enter { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
.active-call-empty { min-height: 108px !important; }

@media (max-width: 1120px) {
  .profile-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-password-panel .password-grid { grid-template-columns: 1fr 1fr; }
  .profile-password-panel .password-grid button { justify-self: start; }
}
@media (max-width: 700px) {
  .profile-metric-grid { grid-template-columns: 1fr; }
  .profile-password-panel .password-grid { grid-template-columns: 1fr; }
  .compact-notification-list .notification-item { grid-template-columns: 28px minmax(0, 1fr); }
  .notification-meta { grid-column: 2; justify-content: space-between; }
  .compact-detail { max-width: 360px; }
}
/* v1.7: desktop release publishing */
.releases-panel { margin-top: 18px; }
.release-upload-grid { display: grid; grid-template-columns: 180px minmax(260px, 1fr); gap: 12px 16px; align-items: end; padding: 15px; border-bottom: 1px solid var(--border-soft); }
.release-notes-field, .release-flags, .release-upload-grid .form-message { grid-column: 1 / -1; }
.release-flags { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 12px; }
.release-upload-grid > .button { justify-self: start; }
.release-table-scroll { margin-top: 0; }
.release-download { display: inline-flex; align-items: center; gap: 5px; color: var(--text); text-decoration: none; font-weight: 600; }
.release-download:hover { text-decoration: underline; }
.release-hash { font-size: 10px; white-space: nowrap; }
.compact-switch { min-width: 40px; padding: 0; }
.compact-switch > span:last-child { display: none; }
.danger-text { color: var(--danger); }
@media (max-width: 760px) {
  .release-upload-grid { grid-template-columns: 1fr; }
  .release-notes-field, .release-flags, .release-upload-grid .form-message { grid-column: 1; }
  .release-flags { grid-template-columns: 1fr; }
}


/* v1.7.5: server management and consistent card spacing */
.server-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.server-metric-grid .metric-card strong { font-size: 14px; overflow-wrap: anywhere; }
.server-control-body { display: grid; gap: 12px; justify-items: start; padding: 15px; }
.server-control-body .notice { width: 100%; margin: 0; }
.server-control-body .notice strong,
.server-control-body .notice span { display: block; }
.server-control-body .notice span { margin-top: 3px; color: var(--muted); }
.server-control-body .form-message { min-height: 18px; }
@media (max-width: 900px) {
  .server-metric-grid { grid-template-columns: 1fr; }
}

/* v1.7.2: calmer active-call typography */
.active-call-team > header div > span { display: block; }
.active-call-team-name,
.active-call-name {
  display: block;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 400;
  margin-top: 0 !important;
}
.active-call-card > div:first-child span,
.active-call-card > div:first-child small { display: block; }
.active-call-actions time { font-weight: 400; }

/* v1.7.2: concise employee preview + separate full details */
.employee-summary-dialog { width: min(820px, calc(100vw - 28px)); }
.employee-summary-dialog .dialog-body { max-height: calc(100vh - 44px); overflow-y: auto; }
.compact-metric-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
.compact-metric-grid .detail-metric { min-height: 68px; }
.employee-preview-section { margin-top: 8px; }
@media (max-width: 700px) {
  .compact-metric-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

/* v1.7.2: releases are a standalone, ordered administration page */
#page-releases .releases-panel { margin-top: 0; }
.release-version-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.release-version { font-size: 13px; font-weight: 600; }
.release-notes { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-switch { min-width: 76px; gap: 7px; }
.release-switch > span:last-child { display: inline; color: var(--muted); font-size: 10.5px; }

/* v1.7.4: global call filters and upload tracking */
.global-call-filters {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 48px;
  margin: -10px 0 16px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.global-call-filter-title { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.global-call-filter-title > i { color: var(--accent); font-size: 19px; }
.global-call-filter-title strong, .global-call-filter-title small { display: block; }
.global-call-filter-title strong { font-size: 12px; }
.global-call-filter-title small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.filter-check { display: inline-flex; align-items: center; gap: 7px; color: #444; font-size: 11px; white-space: nowrap; cursor: pointer; }
.filter-check input { width: 15px; min-height: 15px; accent-color: var(--accent); }
.upload-state { min-width: 155px; display: grid; gap: 5px; }
.upload-state .status-badge { justify-self: start; }
.upload-progress { width: 100%; height: 6px; overflow: hidden; border-radius: 5px; background: #e5e5e5; }
.upload-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.review-card .upload-state { max-width: 220px; }
@media (max-width: 900px) {
  .global-call-filters { align-items: flex-start; flex-wrap: wrap; }
  .global-call-filter-title { width: 100%; }
}
@media (max-width: 560px) {
  .global-call-filters { gap: 10px; }
  .filter-check { width: 100%; white-space: normal; }
}
