:root {
  --bg: #eef2f6;
  --ink: #0f1c2e;
  --muted: #5b6b7c;
  --card: #ffffff;
  --line: #d4dde8;
  --accent: #0d6e6a;
  --accent-soft: #d7efed;
  --navy: #0f1c2e;
  --missed: #b42318;
  --missed-bg: #fdeceb;
  --ok: #16794c;
  --ok-bg: #e6f6ee;
  --out: #1d4f91;
  --out-bg: #e8f0fa;
  --radius: 12px;
  --font: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 400px at 0% -10%, #d9e8f0 0%, transparent 55%),
    radial-gradient(800px 360px at 100% 0%, #dce8e6 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 48px; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.brand-name { font-weight: 800; letter-spacing: -.03em; }
.brand-sub { color: var(--muted); font-size: .82rem; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600;
  font-size: .9rem; cursor: pointer;
}
.btn:hover { border-color: #b8c5d4; }
.btn.active, .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.flash {
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
  background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e4cb;
}
.flash.err { background: var(--missed-bg); color: var(--missed); border-color: #f3c1bd; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.card .label { color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.card .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; }
.card.missed .value { color: var(--missed); }
.card.ok .value { color: var(--ok); }
.card.out .value { color: var(--out); }
h1 { font-size: 1.35rem; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 18px 0 10px; }
.muted { color: var(--muted); }
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  padding: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filters input, .filters select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font: inherit; background: #fff; min-width: 120px;
}
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
}
.st-missed { background: var(--missed-bg); color: var(--missed); }
.st-missed-out { background: #fff1e6; color: #9a4d00; }
.st-ok { background: var(--ok-bg); color: var(--ok); }
.st-out { background: var(--out-bg); color: var(--out); }
.st-muted { background: #eef1f5; color: var(--muted); }
.per-page { display: inline-flex; align-items: center; gap: 6px; }
.per-page select {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit;
}
/* Нативный <audio controls> нельзя сжимать по высоте — иначе пропадают play и scrubber */
.audio-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 260px;
}
audio,
audio.call-audio,
.call-audio {
  display: block;
  box-sizing: border-box;
  width: 300px;
  max-width: 100%;
  height: 54px;
  min-height: 54px;
  margin: 4px 0;
}
td.audio-cell {
  min-width: 300px;
  vertical-align: middle;
}
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.login-wrap {
  max-width: 440px; margin: 48px auto; padding: 0 16px;
}
.login-wrap .card { margin-top: 18px; }
.emp { font-weight: 600; }
.emp-ext { color: var(--muted); font-weight: 500; font-size: .85rem; }
a.phone-link { font-weight: 700; color: var(--accent); }
a.phone-link:hover { text-decoration: underline; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
@media (max-width: 700px) {
  th.hide-sm, td.hide-sm { display: none; }
  .brand-sub { display: none; }
  audio, audio.call-audio, .call-audio { width: 100%; min-width: 0; }
}
