/* Платформа ТСТ ГРУП — кастомні стилі */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.transcript-line {
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
}

.transcript-line.manager {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  margin-right: auto;
}

.transcript-line.client {
  background: #f8fafc;
  border-left: 3px solid #64748b;
  margin-left: auto;
}

.transcript-line .speaker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.transcript-line .speaker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  flex: 1;
}

.transcript-line .speaker-toggle,
.transcript-line .line-delete {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
}

.transcript-line:hover .speaker-toggle,
.transcript-line:hover .line-delete {
  opacity: 1;
}

.transcript-line .speaker-toggle:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #3b82f6;
}

.transcript-line .line-delete:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
}

.transcript-line .line-text {
  outline: none;
  min-height: 18px;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.transcript-line .line-text:focus {
  background: white;
  box-shadow: 0 0 0 2px #f59e0b;
}

.hint-card {
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid;
  font-size: 13px;
  animation: slideIn 0.3s ease-out;
}

.hint-card.tech { background: #eff6ff; border-color: #3b82f6; }
.hint-card.upsell { background: #ecfdf5; border-color: #10b981; }
.hint-card.request { background: #fef3c7; border-color: #f59e0b; }
.hint-card.history { background: #faf5ff; border-color: #a855f7; }

.hint-card .hint-title {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.8;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.action-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s;
}

.action-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.action-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fef3c7;
  color: #d97706;
}

.action-card .icon.high { background: #fee2e2; color: #dc2626; }
.action-card .icon.medium { background: #fef3c7; color: #d97706; }
.action-card .icon.low { background: #e0f2fe; color: #0284c7; }

.action-card .approve {
  background: #10b981;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-left: auto;
  white-space: nowrap;
}

.action-card .approve:hover { background: #059669; }
.action-card .preview-btn {
  font-size: 11px;
  color: #64748b;
  text-decoration: underline;
}

.action-card.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.action-card.completed .approve {
  background: #94a3b8;
  cursor: default;
}

#cmd-voice-btn.active {
  background: #ef4444 !important;
  color: white !important;
  animation: pulse 1s infinite;
}

/* Кнопка Оплати — підсвічування коли є нові */
#payments-btn.has-new {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%) !important;
  color: white !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
  animation: payments-glow 2s ease-in-out infinite;
}

@keyframes payments-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.9), 0 0 30px rgba(6, 182, 212, 0.4); }
}

/* Бейдж "live" для реальних дзвінків у списку розмов */
.badge-live {
  font-size: 9px;
  background: #d1fae5; /* emerald-100 */
  color: #065f46; /* emerald-800 */
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}

/* Рація — кнопка видалення повідомлення (стук / голос) */
.delete-msg-btn {
  color: #94a3b8; /* slate-400 */
  transition: color 0.15s;
  cursor: pointer;
}
.delete-msg-btn:hover {
  color: #ef4444; /* red-500 */
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Аудіо-плеєр у рації ──────────────────────────────────────── */
.audio-progress {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: #e2e8f0; /* slate-200 */
  outline: none;
  cursor: pointer;
}
.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981; /* emerald-500 */
  cursor: pointer;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #10b981;
  transition: transform 0.1s;
}
.audio-progress::-webkit-slider-thumb:active {
  transform: scale(1.3);
}
.audio-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: none;
  cursor: pointer;
}
/* Заповнена частина (Chrome/Edge) через background-gradient динамічно */

/* ── Waveform canvas ─────────────────────────────────────────── */
#ptt-waveform {
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════════════════════════════
   ТЕМНА ТЕМА — overrides для Tailwind-утиліт під html.dark
   Перемикається в Налаштуваннях профілю (⚙️ у хедері)
   ═══════════════════════════════════════════════════════════════ */
html.dark body { background-color: #0f172a; color: #cbd5e1; }

/* Поверхні */
html.dark .bg-white { background-color: #1e293b !important; }
html.dark .bg-slate-50 { background-color: #16213a !important; }
html.dark .bg-slate-100 { background-color: #283549 !important; }
html.dark .bg-slate-200 { background-color: #334155 !important; }
html.dark .bg-amber-50 { background-color: #2d2510 !important; }
html.dark .bg-emerald-50 { background-color: #0e2a1f !important; }
html.dark .bg-blue-50 { background-color: #14233f !important; }
html.dark .bg-red-50 { background-color: #2d1517 !important; }

/* Текст */
html.dark .text-slate-900 { color: #f1f5f9 !important; }
html.dark .text-slate-800 { color: #e2e8f0 !important; }
html.dark .text-slate-700 { color: #cbd5e1 !important; }
html.dark .text-slate-600 { color: #94a3b8 !important; }
html.dark .text-slate-500 { color: #7c8ba1 !important; }
html.dark .text-amber-900 { color: #fcd34d !important; }
html.dark .text-amber-800 { color: #fbbf24 !important; }
html.dark .text-amber-700 { color: #f59e0b !important; }
html.dark .text-emerald-900 { color: #6ee7b7 !important; }
html.dark .text-emerald-800 { color: #34d399 !important; }
html.dark .text-emerald-700 { color: #10b981 !important; }

/* Рамки */
html.dark .border-slate-100 { border-color: #283549 !important; }
html.dark .border-slate-200 { border-color: #334155 !important; }
html.dark .border-slate-300 { border-color: #475569 !important; }
html.dark .border-amber-200 { border-color: #57430f !important; }
html.dark .border-emerald-200 { border-color: #14532d !important; }

/* Hover-стани */
html.dark .hover\:bg-slate-100:hover { background-color: #334155 !important; }
html.dark .hover\:bg-slate-200:hover { background-color: #3e4f66 !important; }
html.dark .hover\:bg-amber-50\/40:hover { background-color: rgba(120, 90, 20, 0.18) !important; }
html.dark .hover\:bg-emerald-50\/40:hover { background-color: rgba(16, 90, 60, 0.18) !important; }

/* Форми */
html.dark input, html.dark select, html.dark textarea {
  background-color: #16213a;
  color: #e2e8f0;
  border-color: #475569;
}
html.dark input::placeholder, html.dark textarea::placeholder { color: #5b6c84; }
html.dark input[type="date"] { color-scheme: dark; }

/* Транскрипт */
html.dark .transcript-line.manager { background: #14233f; }
html.dark .transcript-line.client { background: #16213a; }
html.dark .transcript-line .line-text:focus { background: #1e293b; }

/* Hint cards */
html.dark .hint-card.tech { background: #14233f; }
html.dark .hint-card.upsell { background: #0e2a1f; }
html.dark .hint-card.request { background: #2d2510; }
html.dark .hint-card.history { background: #241634; }

/* Action cards */
html.dark .action-card { background: #1e293b; border-color: #334155; }
html.dark .action-card .icon { background: #2d2510; }
html.dark .action-card.completed { background: #0e2a1f; border-color: #14532d; }

/* Бейджі live */
html.dark .badge-live { background: #0e2a1f; color: #34d399; }

/* Аудіо-плеєр */
html.dark .audio-progress { background: #334155; }

/* Скролбари */
html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: #16213a; }
html.dark ::-webkit-scrollbar-thumb { background: #3e4f66; border-radius: 5px; }

/* ── Тумблер доступу до платформи (Налаштування → Доступи) ────── */
.toggle-track {
  display: inline-block;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: #cbd5e1;        /* вимкнено — сірий */
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track.toggle-on { background: #10b981; }  /* увімкнено — зелений */
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.toggle-track.toggle-on .toggle-thumb { transform: translateX(15px); }
html.dark .toggle-track { background: #475569; }
html.dark .toggle-track.toggle-on { background: #10b981; }

/* ── Бічна панель ─────────────────────────────────────────────── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #cbd5e1;
  transition: background 0.15s, color 0.15s;
}
.sidebar-item:hover { background: #1e293b; color: #fff; }
#cmd-voice-btn.sidebar-item { color: #fbbf24; }       /* мікрофон — акцент */
#cmd-voice-btn.sidebar-item:hover { background: #422f0c; }

/* Прихована панель */
#app-sidebar.sidebar-hidden { transform: translateX(-100%); }

/* Зсув контенту коли панель закріплена */
body.sidebar-pinned #global-search-bar,
body.sidebar-pinned #main-layout,
body.sidebar-pinned #simple-workspace { margin-left: 13rem; }

/* Відкріплена панель поверх контенту — затемнення не потрібне, лише тінь */
