:root {
  --bg: #08090c;
  --bg-elev: #0e1015;
  --bg-elev-2: #15171f;
  --bg-elev-3: #1b1e28;
  --border: #21232c;
  --border-soft: #1a1c24;
  --text: #edeef2;
  --text-dim: #8b8f9c;
  --text-faint: #565a67;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --ease: cubic-bezier(.4,0,.2,1);
  --rail-w: 76px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(124,92,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34,211,238,.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

::selection { background: rgba(124,92,255,.35); }
.muted { color: var(--text-faint); }

/* ---------------- topbar (mobile) ---------------- */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(14,16,21,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #08090c; font-weight: 700;
}
.brand-title { font-size: 14px; font-weight: 700; }

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
  transition: background .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-elev-3); }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
}

.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 29;
}
.scrim.show { display: block; animation: fadeIn .18s var(--ease); }

/* ---------------- shell ---------------- */
.shell { display: flex; height: 100vh; overflow: hidden; }

.rail {
  width: var(--rail-w);
  min-width: var(--rail-w);
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 6px;
  z-index: 10;
}
.rail-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #08090c; font-weight: 700;
  margin-bottom: 18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, var(--shadow-md);
}
.rail-nav, .rail-actions {
  display: flex; flex-direction: column; gap: 4px;
  width: 100%; align-items: center;
}
.rail-spacer { flex: 1; }
.rail-actions { padding-top: 10px; border-top: 1px solid var(--border-soft); }

.rail-btn {
  width: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 2px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 9.5px; font-weight: 600; font-family: inherit;
  text-align: center;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.rail-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.rail-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.rail-btn.active { background: var(--bg-elev-2); color: var(--accent-2); }
.rail-btn.active::before {
  content: "";
  position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.rail-btn:disabled { opacity: .5; cursor: default; }

.main { flex: 1; overflow-y: auto; }
.main-inner { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; }

/* ---------------- page head ---------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 18px;
}
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 5px; letter-spacing: -.01em; }
.page-sub { color: var(--text-dim); font-size: 13.5px; }

/* ---------------- filter bar ---------------- */
.filterbar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.filterbar[hidden] { display: none; }

.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-spacer { flex: 1; }

.seg {
  display: flex;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px; gap: 2px;
}
.seg-btn {
  border: none; background: transparent;
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  padding: 7px 12px; border-radius: 7px;
  cursor: pointer; white-space: nowrap;
  transition: all .15s var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: linear-gradient(135deg, var(--accent), #6842ff);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.date-range { display: flex; align-items: center; gap: 8px; }
.date-range.hidden { display: none; }
.date-range input[type="date"] {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px; font-family: inherit;
  padding: 7px 10px; border-radius: 8px;
  cursor: pointer;
}
.date-range input[type="date"]:focus { outline: none; border-color: var(--accent); }
.date-dash { color: var(--text-faint); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 10px;
  min-width: 250px;
  transition: border-color .15s var(--ease);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }
.search-box input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: inherit;
  padding: 8px 0;
}
.search-box input::placeholder { color: var(--text-faint); }

.fsel {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px; font-family: inherit;
  padding: 7px 10px; border-radius: 8px;
  cursor: pointer;
  max-width: 200px;
}
.fsel:focus { outline: none; border-color: var(--accent); }
.fsel-sm { font-size: 12px; padding: 6px 9px; }

.chip-toggle {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  padding: 7px 12px; border-radius: 8px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.chip-toggle:hover { color: var(--text); }
.chip-toggle.active {
  border-color: rgba(248,113,113,.5);
  background: rgba(248,113,113,.12);
  color: var(--bad);
}

.filter-chips {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124,92,255,.12);
  border: 1px solid rgba(124,92,255,.28);
  color: var(--text);
  font-size: 11.5px; font-weight: 500;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
}
.fchip button {
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0 3px;
}
.fchip button:hover { color: var(--text); }
.chip-reset {
  background: none; border: none;
  color: var(--text-faint);
  font-size: 11.5px; font-family: inherit;
  cursor: pointer; text-decoration: underline;
  padding: 4px 6px;
}
.chip-reset:hover { color: var(--accent-2); }

/* ---------------- stat strip / cards ---------------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat-tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
}
.stat-tile-value { font-size: 22px; font-weight: 800; line-height: 1.15; }
.stat-tile-label { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.stat-card:hover { border-color: #2c303c; transform: translateY(-1px); }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1.05; }
.stat-label { font-size: 13px; color: var(--text-dim); margin-top: 6px; font-weight: 500; }
.stat-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 700;
}
.card p { line-height: 1.6; font-size: 14.5px; margin: 0; }
.card-note { margin-top: 10px !important; color: var(--text-dim); font-size: 13px !important; }
.card-danger { border-color: rgba(248,113,113,.3); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------------- table ---------------- */
.table-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.table-count { font-size: 12.5px; color: var(--text-dim); }
.table-scroll { overflow-x: auto; }

.calls-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.calls-table thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.calls-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  transition: background .12s var(--ease);
}
.calls-table tbody tr:last-child { border-bottom: none; }
.calls-table tbody tr:hover { background: var(--bg-elev-2); }
.calls-table td { padding: 11px 16px; vertical-align: middle; }

.cell-strong { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.td-date { white-space: nowrap; }
.td-phone { white-space: nowrap; }
.td-manager { color: var(--text-dim); white-space: nowrap; }
.td-type { color: var(--text-dim); text-transform: capitalize; }
.td-verdict { min-width: 190px; }
.td-score, .td-flags { text-align: right; white-space: nowrap; }
.row-busy { opacity: .75; }

.flag-badge {
  font-size: 11px;
  color: var(--bad);
  background: rgba(248,113,113,.12);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.score-pill {
  display: inline-block;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.score-good { background: rgba(52,211,153,.15); color: var(--good); }
.score-warn { background: rgba(251,191,36,.15); color: var(--warn); }
.score-bad { background: rgba(248,113,113,.15); color: var(--bad); }
.score-pending { background: rgba(139,143,156,.13); color: var(--text-faint); }

.verdict-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  text-transform: capitalize; white-space: nowrap;
}
.verdict-great { background: rgba(52,211,153,.18); color: var(--good); }
.verdict-good { background: rgba(34,211,238,.18); color: var(--accent-2); }
.verdict-warn { background: rgba(251,191,36,.18); color: var(--warn); }
.verdict-bad { background: rgba(248,113,113,.18); color: var(--bad); }
.verdict-pending { background: rgba(139,143,156,.13); color: var(--text-faint); }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.status-processing { background: rgba(124,92,255,.15); color: var(--accent); }
.status-pending { background: rgba(139,143,156,.13); color: var(--text-dim); }
.status-error { background: rgba(248,113,113,.15); color: var(--bad); }
.status-done { background: rgba(52,211,153,.15); color: var(--good); }

/* pagination */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 14px;
  border-top: 1px solid var(--border-soft);
}
.pg-btn {
  min-width: 32px; height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all .13s var(--ease);
}
.pg-btn:hover:not(:disabled) { color: var(--text); border-color: #333844; }
.pg-btn.active {
  background: linear-gradient(135deg, var(--accent), #6842ff);
  border-color: transparent; color: #fff;
}
.pg-btn:disabled { opacity: .35; cursor: default; }
.pg-dots { color: var(--text-faint); padding: 0 3px; }

/* ---------------- dashboard bits ---------------- */
.daychart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 130px;
  padding-top: 8px;
}
.daychart-col {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.daychart-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 5px 5px 2px 2px;
  opacity: .85;
  transition: opacity .15s var(--ease);
}
.daychart-col:hover .daychart-bar { opacity: 1; }
.daychart-label {
  font-size: 9.5px; color: var(--text-faint);
  margin-top: 6px; white-space: nowrap;
}

.verdict-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.verdict-summary-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px;
  border-radius: 10px;
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all .13s var(--ease);
}
.verdict-summary-item:hover { background: var(--bg-elev-3); }
.verdict-summary-item.picked { border-color: var(--accent); }
.verdict-summary-count { font-size: 24px; font-weight: 800; color: var(--text); }

.subscores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subscore { text-align: center; }
.subscore-bar {
  height: 6px; border-radius: 999px;
  background: var(--bg-elev-3);
  overflow: hidden;
  margin: 6px 0;
}
.subscore-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.subscore-label { font-size: 11.5px; color: var(--text-dim); }
.subscore-val { font-size: 12px; font-weight: 700; }

.breakdown-row {
  display: grid;
  grid-template-columns: 140px 1fr 28px;
  align-items: center; gap: 10px;
  margin-bottom: 9px; font-size: 13px;
}
.breakdown-label { color: var(--text-dim); text-transform: capitalize; }
.breakdown-bar { height: 8px; border-radius: 999px; background: var(--bg-elev-3); overflow: hidden; }
.breakdown-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.breakdown-val { text-align: right; font-weight: 700; }

.mgr-rows { display: flex; flex-direction: column; gap: 6px; }
.mgr-row {
  display: grid;
  grid-template-columns: 34px 1fr 140px 44px;
  align-items: center; gap: 12px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
  text-align: left;
  transition: all .13s var(--ease);
}
.mgr-row:hover { background: var(--bg-elev-3); border-color: var(--border); }
.mgr-row-score { font-weight: 800; font-size: 15px; text-align: right; }
.mgr-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08090c; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}

/* ---------------- managers ---------------- */
.manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.manager-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.manager-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.manager-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.manager-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08090c; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.manager-name { font-weight: 700; font-size: 14.5px; }
.manager-count { font-size: 12px; color: var(--text-dim); }
.manager-score { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.manager-score span { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.manager-verdicts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mini-verdict { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim); }
.manager-flags { margin-top: 10px; font-size: 11.5px; color: var(--bad); }

/* ---------------- detail ---------------- */
.back-btn {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  padding: 0 0 16px; display: block;
}
.back-btn:hover { color: var(--accent-2); }

.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px; gap: 20px;
}
.detail-title { font-size: 23px; font-weight: 700; margin: 0 0 6px; }
.detail-sub { color: var(--text-dim); font-size: 13.5px; }
.detail-verdict { margin-top: 10px; }
.detail-manager-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.detail-manager-label { font-size: 12.5px; color: var(--text-dim); }
.manager-select {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px; font-family: inherit;
  padding: 6px 9px; border-radius: 8px;
  cursor: pointer;
}
.manager-select:focus { outline: none; border-color: var(--accent); }

.score-big {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  font-size: 24px; font-weight: 800;
  flex-shrink: 0;
}
.score-big span { font-size: 10px; font-weight: 500; color: var(--text-dim); }

.call-verdict-note { font-size: 12.5px; color: var(--text-dim); }

/* color-scheme: dark уже отдаёт тёмный нативный плеер — инвертировать не нужно */
audio { width: 100%; margin-bottom: 22px; border-radius: 10px; }

.tag-list { display: flex; flex-direction: column; gap: 8px; }
.tag-item { font-size: 14px; line-height: 1.5; padding-left: 18px; position: relative; }
.tag-item::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
}
.strengths .tag-item::before { background: var(--good); }
.weaknesses .tag-item::before { background: var(--bad); }
.recommendations .tag-item::before { background: var(--accent-2); }
.redflags .tag-item::before { background: var(--warn); }

.transcript {
  white-space: pre-wrap;
  font-size: 13.5px; line-height: 1.7;
  color: var(--text-dim);
  max-height: 320px; overflow-y: auto;
}

.dialogue {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 460px; overflow-y: auto; padding-right: 4px;
}
.dlg-turn {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px; line-height: 1.55;
}
.dlg-speaker {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 3px; opacity: .7;
}
.dlg-manager {
  align-self: flex-start;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.dlg-manager .dlg-speaker { color: var(--accent-2); }
.dlg-client {
  align-self: flex-end;
  background: rgba(124,92,255,.12);
  border: 1px solid rgba(124,92,255,.25);
  border-top-right-radius: 4px;
}
.dlg-client .dlg-speaker { color: var(--accent); text-align: right; }
.dlg-client .dlg-text { text-align: right; }

.btn {
  display: inline-block; text-align: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 13.5px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.btn:hover { border-color: #333844; background: var(--bg-elev-3); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6842ff); border: none; color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-inline { width: auto; }

/* ---------------- misc ---------------- */
.empty-block {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 60px 20px;
  color: var(--text-faint);
}
.empty-mark { font-size: 36px; opacity: .3; }

.skeleton-wrap { display: flex; flex-direction: column; gap: 12px; }
.skeleton {
  height: 62px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 50%, var(--bg-elev) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.spin {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--text-faint);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

#content, #pageHead { animation: fadeUp .22s var(--ease); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #262a34; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2f3441; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .topbar { display: flex; }
  .shell { height: calc(100vh - 57px); }

  .rail {
    position: fixed;
    top: 57px; left: 0; bottom: 0;
    width: 200px; min-width: 200px;
    align-items: stretch;
    padding: 14px 10px;
    z-index: 30;
    transform: translateX(-110%);
    transition: transform .22s var(--ease);
    box-shadow: 8px 0 24px rgba(0,0,0,.4);
  }
  .rail.open { transform: translateX(0); }
  .rail-logo { display: none; }
  .rail-btn {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 11px;
    padding: 11px 12px;
    font-size: 13px;
    text-align: left;
  }
  .rail-btn.active::before { left: 0; }

  .main-inner { padding: 18px 15px 48px; }
  .page-title { font-size: 20px; }

  /* фильтры скрыты за кнопкой в шапке */
  .filterbar {
    display: none;
    padding: 12px;
  }
  .filterbar.open { display: flex; }

  /* пресеты периода — сеткой в 3 колонки, без горизонтального скролла */
  .seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .seg-btn { padding: 9px 6px; font-size: 12px; }
  .search-box { min-width: 0; width: 100%; }
  .date-range { width: 100%; }
  .date-range input[type="date"] { flex: 1; min-width: 0; }
  .filter-row-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fsel { max-width: none; width: 100%; }
  .chip-toggle { grid-column: 1 / -1; }

  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .subscores { grid-template-columns: 1fr 1fr; }

  .table-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .table-toolbar .fsel { width: 100%; max-width: none; }
  .breakdown-row { grid-template-columns: 100px 1fr 26px; }
  .manager-grid { grid-template-columns: 1fr 1fr; }

  /* таблица → карточки */
  .calls-table thead { display: none; }
  .calls-table, .calls-table tbody, .calls-table tr, .calls-table td { display: block; width: 100%; }
  .calls-table tbody tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }
  .calls-table td { padding: 0; }
  .td-date { grid-column: 1; grid-row: 1; }
  .td-score { grid-column: 2; grid-row: 1; text-align: right; }
  .td-phone { grid-column: 1; grid-row: 2; }
  .td-manager { grid-column: 2; grid-row: 2; text-align: right; font-size: 12px; }
  .td-type { grid-column: 1 / -1; grid-row: 3; font-size: 12px; }
  .td-verdict { grid-column: 1 / -1; grid-row: 4; min-width: 0; margin-top: 4px; }
  .td-flags { grid-column: 1 / -1; grid-row: 5; text-align: left; }
  .td-flags:empty { display: none; }

  .detail-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .detail-title { font-size: 19px; }
  .score-big { align-self: flex-start; width: 70px; height: 70px; font-size: 20px; }
  .dlg-turn { max-width: 92%; }

  .mgr-row { grid-template-columns: 32px 1fr 44px; }
  .mgr-row-bar { display: none; }
}

@media (max-width: 480px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .subscores { grid-template-columns: 1fr; }
  .manager-grid { grid-template-columns: 1fr; }
  .verdict-summary { grid-template-columns: 1fr 1fr; }
  .filter-row-selects { grid-template-columns: 1fr; }
}
