/* Экран CRM фитнес-клуба. Рассчитан на запись экрана 1600×900 и крупнее:
   размеры шрифтов подняты, чтобы читалось с проектора. */

:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --accent: #16a34a;
  --accent-soft: #dcfce7;
  --warn: #f59e0b;
  --call: #ef4444;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font: 15px/1.45 -apple-system, "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── Шапка ──────────────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 22px;
  background: #0f172a;
  color: #fff;
  flex: 0 0 auto;
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--accent);
  display: grid; place-items: center;
  font-weight: 700; letter-spacing: .5px;
}

.brand-title { font-size: 17px; font-weight: 650; }
.brand-sub { font-size: 12.5px; color: #94a3b8; }

.call-box {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 8px 16px;
  min-width: 330px;
}
.call-box.live { border-color: rgba(239,68,68,.6); background: rgba(239,68,68,.12); }

.pulse { width: 11px; height: 11px; border-radius: 50%; background: #475569; }
.call-box.live .pulse { background: var(--call); animation: pulse 1.4s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.7); }
  70% { box-shadow: 0 0 0 9px rgba(239,68,68,0); }
}

.call-label { font-size: 12px; color: #cbd5e1; text-transform: uppercase; letter-spacing: .06em; }
.call-phone { font-size: 16px; font-weight: 620; font-variant-numeric: tabular-nums; }
.call-timer { margin-left: auto; font: 600 17px/1 var(--mono); font-variant-numeric: tabular-nums; }

.top-actions { display: flex; gap: 8px; }

.btn {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 9px 15px;
  border-radius: 10px;
  font: inherit; font-weight: 560;
  cursor: pointer;
  transition: .15s;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #15803d; }
.btn-ghost { background: transparent; }

/* ── Сетка ──────────────────────────────────────────────────────────── */

.grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 420px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.col { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column;
  min-height: 0;
  transition: box-shadow .3s, border-color .3s;
}
.card.grow { flex: 1 1 auto; overflow: hidden; }
.card.flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.src { margin-left: auto; font: 11.5px/1 var(--mono); color: var(--ink-3); }
.src.done { color: var(--accent); }

.empty { color: var(--ink-3); font-size: 13.5px; padding: 10px 0; }

/* ── Карточка клиента ───────────────────────────────────────────────── */

.client-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-soft); color: #166534;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.client-name { font-size: 17px; font-weight: 640; }
.client-meta { font: 13px var(--mono); color: var(--ink-2); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { text-align: right; font-weight: 540; }

.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge {
  font-size: 12px; font-weight: 580;
  padding: 4px 9px; border-radius: 999px;
  background: var(--accent-soft); color: #166534;
}
.badge.gray { background: #f1f5f9; color: var(--ink-2); }
.badge.warn { background: #fef3c7; color: #92400e; }

/* ── Семья, операции ────────────────────────────────────────────────── */

.linked, .op {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px;
}
.linked:first-child, .op:first-child { border-top: none; }
.linked .avatar { width: 34px; height: 34px; font-size: 13px; }
.linked-rel, .op-sub { color: var(--ink-3); font-size: 12.5px; }
.op-ico { font-size: 17px; }

/* ── Таблица записей ────────────────────────────────────────────────── */

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); font-weight: 600;
  padding: 0 10px 7px 0; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }
.tbl .when { font-weight: 620; }
.tbl tr.moved td { animation: flashrow 1.8s ease-out; }
@keyframes flashrow {
  0% { background: #bbf7d0; }
  100% { background: transparent; }
}

/* ── Расписание ─────────────────────────────────────────────────────── */

.sched { display: flex; flex-direction: column; gap: 10px; }
.sched-row { display: flex; align-items: center; gap: 10px; }
.sched-name { width: 130px; flex: 0 0 auto; font-size: 13px; }
.sched-name b { display: block; font-weight: 620; }
.sched-name span { color: var(--ink-3); font-size: 12px; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot {
  font: 12.5px var(--mono);
  padding: 5px 9px; border-radius: 8px;
  background: #f1f5f9; color: var(--ink-2);
  border: 1px solid transparent;
}
.slot.joint { background: var(--accent-soft); color: #166534; border-color: #86efac; font-weight: 600; }
.slot.taken { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.sched-note { font-size: 12.5px; color: var(--ink-3); }

/* ── Транскрипт ─────────────────────────────────────────────────────── */

.transcript-card { flex: 0 0 232px; }
.transcript { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }

.line { display: flex; gap: 9px; font-size: 14px; }
.line .who {
  flex: 0 0 74px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); padding-top: 3px;
}
.line .txt { background: #f8fafc; border-radius: 10px; padding: 7px 11px; }
.line.agent .txt { background: var(--accent-soft); }
.line.filler .txt { background: #fef3c7; color: #92400e; font-style: italic; }
.line.sys .txt { background: transparent; color: var(--ink-3); font-size: 12.5px; padding-left: 0; }

/* ── Лента инструментов ─────────────────────────────────────────────── */

.col-tools .card.grow { min-height: 0; }
.tools { overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding-right: 4px; }

.tool {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px;
  animation: slidein .25s ease-out;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tool.pending { border-color: var(--warn); background: #fffbeb; }
.tool.done { border-color: #bbf7d0; }

.tool-head { display: flex; align-items: center; gap: 8px; }
.tool-n { font: 11px var(--mono); color: var(--ink-3); }
.tool-name { font: 600 13.5px var(--mono); }
.tool-ms { margin-left: auto; font: 12px var(--mono); color: var(--accent); }
.tool.pending .tool-ms { color: var(--warn); }

.tool pre {
  font: 12px/1.4 var(--mono);
  background: #f8fafc; border-radius: 8px;
  padding: 7px 9px; margin-top: 7px;
  white-space: pre-wrap; word-break: break-word;
  max-height: 190px; overflow: auto;
  color: #334155;
}
.tool .args { background: #f1f5f9; }
.tool-label { font-size: 11px; color: var(--ink-3); margin-top: 7px; text-transform: uppercase; letter-spacing: .05em; }

/* ── Суфлёр ─────────────────────────────────────────────────────────── */

.cues { display: flex; flex-direction: column; gap: 5px; max-height: 210px; overflow-y: auto; }
.cue {
  display: flex; gap: 9px; align-items: flex-start;
  text-align: left; font: inherit; font-size: 13px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 10px; cursor: pointer; color: var(--ink);
}
.cue:hover { border-color: var(--accent); background: var(--accent-soft); }
.cue.used { opacity: .45; }
.cue kbd {
  flex: 0 0 auto; font: 11px var(--mono);
  background: #fff; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 5px;
}

/* ── Низ ────────────────────────────────────────────────────────────── */

.bottom {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 10px 22px;
  background: #fff; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.mic { display: flex; align-items: center; gap: 9px; }
.mic-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.mic-dot.on { background: var(--accent); }
.meter { width: 110px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
#meterFill { height: 100%; width: 0; background: var(--accent); transition: width .08s; }
.cfg { margin-left: auto; font: 12px var(--mono); color: var(--ink-3); }

/* ── Модалка с промптом ─────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: grid; place-items: center; padding: 40px; z-index: 20;
}
.modal-box {
  background: #fff; border-radius: 16px; width: min(940px, 100%);
  max-height: 100%; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: #0f172a; color: #fff;
}
.modal-head h2 { font-size: 15px; font-weight: 600; }
.modal-head .btn { margin-left: auto; }
.modal-box pre {
  overflow: auto; padding: 20px 24px;
  font: 13.5px/1.6 var(--mono); white-space: pre-wrap;
}
