/* ══════════════════════════════════════════════════════════════════════════════
   CallAnalyzer — Визуальный стиль «Первый Бит»
   Палитра брендбука:
     #E50071 — основной корпоративный (Pantone 213)
     #BD0069 — тёмный акцент (Pantone 215)
     #000000 — текст / заголовки
     #FFFFFF — фон
   Шрифт: Arial (системный fallback от Suisse Int'l)
   Стиль: плоский, геометричный, без теней и градиентов
══════════════════════════════════════════════════════════════════════════════ */

/* ─── CSS-переменные бренда ─────────────────────────────────────────────── */
:root {
  --brand:       #E50071;
  --brand-dark:  #BD0069;
  --brand-light: #fce4f0;
  --brand-pale:  #fff0f7;
  --black:       #000000;
  --gray-900:    #111111;
  --gray-800:    #1a1a1a;
  --gray-700:    #2d2d2d;
  --gray-600:    #555555;
  --gray-500:    #777777;
  --gray-400:    #999999;
  --gray-300:    #cccccc;
  --gray-200:    #e5e5e5;
  --gray-100:    #f5f5f5;
  --gray-50:     #fafafa;
  --white:       #ffffff;
  --radius:      4px;   /* брендбук: геометрия, минимальные скругления */
  --radius-md:   6px;
  --radius-lg:   8px;
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  color: var(--black);
  background: var(--gray-100);
}

/* ─── Navigation ────────────────────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}
.nav-link.active {
  background: var(--brand);
  color: var(--white);
}
.nav-link.active:hover {
  background: var(--brand-dark);
}
.nav-link i { font-size: 15px; flex-shrink: 0; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--brand);
  color: var(--white);
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
  text-transform: uppercase;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #f399c4; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--black);
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-300);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-pale);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.btn-danger:hover { background: #fecaca; }

.btn-icon {
  padding: 6px 8px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--gray-500);
  transition: all 0.15s;
}
.btn-icon:hover {
  background: var(--brand-pale);
  color: var(--brand);
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 20px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 3px solid var(--brand);
  transition: border-color 0.15s;
}
.stat-card:hover {
  border-left-color: var(--brand-dark);
}
.stat-card .icon-wrap {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--brand-light) !important;
  color: var(--brand) !important;
}

/* ─── Score / Progress ──────────────────────────────────────────────────── */
.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-wrap {
  background: var(--gray-200);
  border-radius: 2px;
  height: 6px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Score colors */
.score-excellent { color: #059669; }
.score-good      { color: var(--brand); }
.score-average   { color: #d97706; }
.score-poor      { color: #dc2626; }

.bg-score-excellent { background: #d1fae5; }
.bg-score-good      { background: var(--brand-light); }
.bg-score-average   { background: #fef3c7; }
.bg-score-poor      { background: #fee2e2; }

.bar-excellent { background: #10b981; }
.bar-good      { background: var(--brand); }
.bar-average   { background: #f59e0b; }
.bar-poor      { background: #ef4444; }

/* ─── Table ─────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--black);
}
.data-table tr:hover td { background: var(--brand-pale); }
.data-table tr:last-child td { border-bottom: none; }

/* ─── Avatar ────────────────────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  background: var(--brand-light);
  color: var(--brand);
}

/* ─── Badge / Tag ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-blue   { background: var(--brand-light); color: var(--brand-dark); }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--black);
  transition: border-color 0.15s;
  background: var(--white);
}
.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(229,0,113,0.1);
}
.form-input::placeholder { color: var(--gray-400); }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group { margin-bottom: 16px; }

/* ─── Upload Zone ───────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-pale);
}
.upload-zone.has-file {
  border-color: #10b981;
  background: #f0fdf4;
}

/* ─── Analysis Result ───────────────────────────────────────────────────── */
.criteria-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.criteria-row:last-child { border-bottom: none; }
.criteria-label  { font-size: 13px; color: var(--gray-500); width: 160px; flex-shrink: 0; }
.criteria-bar    { flex: 1; }
.criteria-score  { font-size: 14px; font-weight: 700; width: 40px; text-align: right; flex-shrink: 0; }

/* ─── Transcript ────────────────────────────────────────────────────────── */
.transcript-block {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--black);
  max-height: 400px;
  overflow-y: auto;
}
.transcript-line { padding: 3px 6px; border-radius: 2px; }
.transcript-line:hover { background: var(--gray-100); }
.transcript-time { color: var(--gray-400); margin-right: 8px; }
.transcript-speaker { font-weight: 700; margin-right: 6px; }
.transcript-speaker.speaker-0 { color: var(--brand); }
.transcript-speaker.speaker-1 { color: #059669; }
.transcript-speaker.speaker-2 { color: #d97706; }

/* ─── Employee Card ─────────────────────────────────────────────────────── */
.employee-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
  border-top: 3px solid transparent;
}
.employee-card:hover {
  border-top-color: var(--brand);
  box-shadow: 0 4px 16px rgba(229,0,113,0.1);
  transform: translateY(-2px);
}

/* ─── Trend arrows ──────────────────────────────────────────────────────── */
.trend-up   { color: #10b981; }
.trend-down { color: #ef4444; }
.trend-flat { color: var(--gray-400); }

/* ─── Loading ───────────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  animation: slideIn 0.25s ease;
  max-width: 360px;
  border-left: 3px solid rgba(255,255,255,0.4);
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-success { background: #065f46; color: white; }
.toast-error   { background: #7f1d1d; color: white; }
.toast-info    { background: var(--brand-dark); color: white; }
.toast-warning { background: #78350f; color: white; }

/* ─── Tabs ──────────────────────────────────────────────────────────────── */
.tab-list {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-500);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tab-btn:hover { color: var(--black); }
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ─── Transcription service selector ───────────────────────────────────── */
.transcribe-option-card {
  display: block;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
}
.transcribe-option-card:hover {
  border-color: var(--brand-light);
  background: var(--brand-pale);
}
.transcribe-option-card.selected {
  border-color: var(--brand);
  background: var(--brand-pale);
  box-shadow: 0 0 0 3px rgba(229,0,113,0.1);
}

/* ─── Call result sections ──────────────────────────────────────────────── */
.call-section-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.call-section-num {
  width: 24px; height: 24px;
  border-radius: 2px;
  background: var(--brand);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* ─── Акцентная полоса сверху страницы ─────────────────────────────────── */
body::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--brand);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ─── Фокус-акцент (accessibility) ─────────────────────────────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
