/* ==========================================================================
   Маркеры v2 — Shadcn UI Kit Design System
   Референс: HR Dashboard (fa25688c022bc19d9aab83314a4d145a.jpg)
   Чистый светлый SaaS: теплый серый сайдбар #f8f8f7, белый холст #ffffff,
   двухслойные KPI-карточки, пастельные бейджи с точкой, SVG-иконки Lucide style.
   ========================================================================== */

:root {
  /* Типографика */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* Поверхности */
  --bg-sidebar: #f8f8f7;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-outer: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-input: #cbd5e1;
  --border-hover: #94a3b8;

  /* Текст */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  /* Кнопки Primary (глухой графитово-черный) */
  --btn-primary-bg: #141414;
  --btn-primary-hover: #262626;
  --btn-primary-text: #ffffff;

  /* Размеры и скругления */
  --radius-card: 12px;
  --radius-inner: 9px;
  --radius-btn: 8px;
  --radius-pill: 9999px;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.45;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   КАРКАС ПРИЛОЖЕНИЯ (APP SHELL)
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-app);
}

/* Затемнение фона под мобильным сайдбаром */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 39;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.sidebar-backdrop.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Левый сайдбар (240px, #f8f8f7) */
.app-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.sidebar-close-btn:hover {
  background: #ebebea;
  color: var(--text-primary);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px 6px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon-box {
  width: 26px;
  height: 26px;
  background: #141414;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-v2-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: #ebebea;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
}

/* Быстрый поиск в сайдбаре с бейджем ⌘K */
.sidebar-search {
  position: relative;
  margin-bottom: 16px;
}

.sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  display: flex;
}

.sidebar-search-input {
  width: 100%;
  height: 32px;
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: 7px;
  padding: 0 34px 0 30px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.sidebar-search-input:focus {
  border-color: #141414;
  box-shadow: 0 0 0 1px #141414;
}

.kbd-badge {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  pointer-events: none;
}

/* Секции навигации в сайдбаре */
.sidebar-section {
  margin-bottom: 18px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 0 8px 6px 8px;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar-nav-item:hover {
  background: #f0f0ef;
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: #e9ebee;
  color: #111827;
  font-weight: 600;
}

.sidebar-nav-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.85;
}

.sidebar-nav-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: #ebebea;
  padding: 1px 6px;
  border-radius: 9999px;
  font-variant-numeric: tabular-nums;
}

.sidebar-nav-badge.badge-danger-soft {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
}

/* Нижний блок сайдбара */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Основная рабочая область */
.app-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  min-height: 100vh;
}

/* Верхний топ-бар (50px, #ffffff) */
.app-topbar {
  height: 50px;
  background: #ffffff;
  border-bottom: 1px solid #f0f0ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

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

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 6px;
}

.context-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: #f8f8f7;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 7px;
  cursor: default;
}

.dot-orange {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #f97316;
  display: inline-block;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.digest-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  background: #f8f8f7;
  border: 1px solid var(--border-subtle);
  padding: 4px 9px;
  border-radius: 6px;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.user-name-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.topbar-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-input);
  background: #ffffff;
  transition: all 0.12s ease;
}

.topbar-logout-btn:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Контейнер контента страницы */
.app-content {
  flex: 1;
  padding: 22px 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Заголовки страницы */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ==========================================================================
   ДВУХСЛОЙНЫЕ KPI-КАРТОЧКИ (SHADCN HR DASHBOARD STYLE)
   ========================================================================== */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card-outer);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 4px;
  display: flex;
  flex-direction: column;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
}

.kpi-icon-container {
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.kpi-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.kpi-inner-card {
  background: #ffffff;
  border: 1px solid #f0f0ef;
  border-radius: var(--radius-inner);
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-value {
  font-size: 27px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-trend-line {
  font-size: 11.5px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-green {
  color: #16a34a;
  font-weight: 500;
}

.trend-red {
  color: #dc2626;
  font-weight: 500;
}

.trend-neutral {
  color: #6b7280;
  font-weight: 500;
}

/* ==========================================================================
   ОБЗОРНЫЕ ВИДЖЕТЫ 2-ГО РЯДА (DISTRIBUTION & ATTENDANCE OVERVIEW)
   ========================================================================== */

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.widget-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.widget-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
}

/* Плашки распределения по веткам (как 948 Fulltime / 250 Freelance) */
.dist-pill {
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dist-pill:last-child {
  margin-bottom: 0;
}

.dist-pill-our {
  background: #eefbf3;
  border: 1px solid #d1f4df;
}

.dist-pill-dev {
  background: #fdf6ec;
  border: 1px solid #fae8ce;
}

.dist-pill-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dist-number {
  font-size: 19px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: #111827;
}

.dist-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
}

.dist-tag-green {
  background: #dcfce7;
  color: #15803d;
}

.dist-tag-orange {
  background: #ffedd5;
  color: #c2410c;
}

.dist-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
}

/* Источники звонков (Attendance Overview style) */
.attend-stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.attend-large-num {
  font-size: 26px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}

.attend-trend {
  font-size: 12px;
  color: #16a34a;
  font-weight: 500;
}

.segmented-progress-bar {
  height: 8px;
  border-radius: 9999px;
  display: flex;
  background: #f3f4f6;
  overflow: hidden;
  margin-bottom: 12px;
}

.seg-our {
  background: #10b981;
}

.seg-dev {
  background: #f59e0b;
}

.seg-stranger {
  background: #ef4444;
}

.attend-legend-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.attend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  display: inline-block;
}

.dot-green {
  background-color: #10b981;
}

.dot-amber {
  background-color: #f59e0b;
}

.dot-red {
  background-color: #ef4444;
}

/* ==========================================================================
   ТАБЛИЦА ВСЕХ НОМЕРОВ (ALL EMPLOYEES STYLE)
   ========================================================================== */

.table-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.table-card-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
  flex-wrap: wrap;
}

.table-card-title-group {
  display: flex;
  flex-direction: column;
}

.table-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.table-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Тулбар фильтрации под шапкой */
.table-toolbar {
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 220px;
}

.search-input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  display: flex;
  pointer-events: none;
}

.search-input-field {
  width: 100%;
  height: 32px;
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: 7px;
  padding: 0 10px 0 32px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.search-input-field:focus {
  border-color: #141414;
  box-shadow: 0 0 0 1px #141414;
}

.filter-pills-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-input);
  background: #ffffff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.filter-pill-btn:hover {
  background: #f9fafb;
  border-color: var(--border-hover);
  color: #111827;
}

.filter-pill-btn.active {
  background: #141414;
  color: #ffffff;
  border-color: #141414;
  font-weight: 500;
}

.filter-pill-btn.pill-danger.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* Вспомогательная полоска доп. фильтров */
.table-sub-toolbar {
  padding: 8px 20px;
  background: #fafaf9;
  border-bottom: 1px solid #f0f0ef;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.sub-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-filter-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.sub-filter-link:hover {
  background: #ebebea;
  color: #111827;
}

.sub-filter-link.active {
  background: #e5e7eb;
  color: #111827;
  font-weight: 600;
}

/* Табличная разметка */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.shadcn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.shadcn-table th {
  padding: 10px 16px;
  background: #fafaf9;
  color: #6b7280;
  font-size: 11.5px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.shadcn-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  vertical-align: middle;
}

.shadcn-table tbody tr {
  transition: background 0.12s ease;
}

.shadcn-table tbody tr:hover {
  background: #fafaf9;
  cursor: pointer;
}

.shadcn-table tbody tr.row-leaked {
  background: #fef2f2 !important;
  border-left: 3.5px solid #ef4444 !important;
}

.shadcn-table tbody tr.row-leaked td:first-child {
  box-shadow: inset 3.5px 0 0 #ef4444;
}

.shadcn-table tbody tr.row-leaked:hover {
  background: #fee2e2 !important;
}

.row-leaked {
  background: #fef2f2 !important;
  border-left: 3.5px solid #ef4444 !important;
}

/* Колонки и ячейки таблицы */
.mono-phone {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: #111827;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.mono-phone:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Ответственный (Employee column как на референсе) */
.employee-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.employee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}

.employee-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.employee-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.employee-role-sub {
  font-size: 11px;
  color: #6b7280;
}

/* Ветка и объект */
.target-cell-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.target-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.target-title-text {
  font-weight: 500;
  color: #111827;
}

.target-note-text {
  font-size: 11.5px;
  color: #6b7280;
}

/* Точки риска (серые пилюли #f3f4f6 как Departments в референсе) */
.holes-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hole-pill {
  background: #f3f4f6;
  color: #374151;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.hole-pill.pill-clean {
  background: #dcfce7;
  color: #166534;
}

.hole-pill.pill-danger {
  background: #fee2e2;
  color: #991b1b;
}

.hole-pill.pill-muted {
  background: #f9fafb;
  color: #9ca3af;
  border: 1px dashed #e5e7eb;
}

/* Логи / Входящие */
.logs-summary-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logs-counters-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logs-count-badge {
  font-size: 11px;
  color: #4b5563;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
}

.incoming-count-badge {
  font-size: 11px;
  color: #166534;
  background: #dcfce7;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.logs-last-preview {
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* Пастельные бейджи статуса с точкой (как • Full-time) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}

.badge-clean {
  background: #f0fdf4;
  color: #15803d;
  border-color: #dcfce7;
}
.badge-clean .badge-dot {
  background: #22c55e;
}

.badge-active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}
.badge-active .badge-dot {
  background: #3b82f6;
}

.badge-waiting {
  background: #fffbeb;
  color: #b45309;
  border-color: #fef3c7;
}
.badge-waiting .badge-dot {
  background: #f59e0b;
}

.badge-leaked {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fee2e2;
}
.badge-leaked .badge-dot {
  background: #ef4444;
}

.badge-archived {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}
.badge-archived .badge-dot {
  background: #9ca3af;
}

.badge-our_kc {
  background: #f0fdf4;
  color: #166534;
  border-color: #dcfce7;
}
.badge-our_kc .badge-dot {
  background: #16a34a;
}

.badge-developer {
  background: #fff7ed;
  color: #c2410c;
  border-color: #ffedd5;
}
.badge-developer .badge-dot {
  background: #ea580c;
}

.row-arrow-link {
  color: var(--text-faint);
  text-decoration: none;
  font-size: 14px;
  padding: 4px;
  display: inline-block;
  transition: color 0.12s ease;
}

.shadcn-table tbody tr:hover .row-arrow-link {
  color: #111827;
}

/* ==========================================================================
   КНОПКИ И ФОРМЫ (SHADCN STYLE)
   ========================================================================== */

.btn {
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

.btn-outline {
  background: #ffffff;
  color: #374151;
  border-color: var(--border-input);
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: var(--border-hover);
  color: #111827;
}

.btn-secondary {
  background: #ffffff;
  color: #374151;
  border-color: var(--border-input);
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: var(--border-hover);
}

.btn-danger-outline {
  background: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 11.5px;
}

.btn-lg {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Поля форм */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
}

.form-input, .form-select, .form-textarea {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
}

.form-textarea {
  height: auto;
  min-height: 70px;
  padding: 8px 11px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #141414;
  box-shadow: 0 0 0 1px #141414;
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* Компактная раскрывающаяся панель добавления номера */
.panel-add-marker-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.panel-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-add-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.panel-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.panel-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Чекбоксы и радио-кнопки */
.checkbox-pills-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.checkbox-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f9fafb;
  border: 1px solid var(--border-input);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.checkbox-pill-item:hover {
  background: #f3f4f6;
}

.checkbox-pill-item.active {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

.checkbox-pill-item input[type="checkbox"] {
  accent-color: #141414;
}

/* ==========================================================================
   КАРТОЧКА НОМЕРА (MARKER DETAIL PAGE)
   ========================================================================== */

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  color: #111827;
}

.detail-main-header {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-phone-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.detail-phone-text {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}

.detail-target-info {
  font-size: 13px;
  color: #374151;
}

.detail-meta-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Сегментированные кнопки смены статуса */
.segmented-status-group {
  display: inline-flex;
  background: #f3f4f6;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.segmented-btn {
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: var(--font-sans);
}

.segmented-btn:hover {
  color: #111827;
}

.segmented-btn.active {
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.segmented-btn.btn-danger-seg.active {
  background: #fee2e2;
  color: #b91c1c;
}

.segmented-btn.btn-clean-seg.active {
  background: #dcfce7;
  color: #15803d;
}

/* Две карточки в ряд (Точки риска и Добавить звонок) */
.detail-two-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-panel-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}

.panel-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Радио-переключатель источника события в форме */
.radio-pills-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.radio-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-input);
  background: #ffffff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.radio-pill-item input[type="radio"] {
  accent-color: #141414;
}

.radio-pill-item:hover {
  background: #f9fafb;
}

/* Копирование номера */
.caller-copy-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
}

.caller-phone-text {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  color: #0f172a;
  white-space: nowrap;
}

.btn-copy-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
}

.btn-copy-icon:hover {
  color: #111827;
  background: #e2e8f0;
}

/* ==========================================================================
   ТОСТ УВЕДОМЛЕНИЙ
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #141414;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(6px);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ==========================================================================
   БЫСТРЫЕ ЧИПСЫ-ШАБЛОНЫ
   ========================================================================== */

.quick-chips-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 4px 0;
}

.quick-chips-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 2px;
}

.quick-chip-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.quick-chip-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.quick-chip-btn.chip-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.quick-chip-btn.chip-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ==========================================================================
   ГОЛОСОВАЯ ЗАПИСЬ (MEDIA RECORDER + GIGAAM UI)
   ========================================================================== */

.content-mic-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.content-with-mic {
  padding-right: 38px !important;
}

.inline-mic-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.inline-mic-btn:hover {
  background: #f1f5f9;
  transform: translateY(-50%) scale(1.1);
}

.inline-mic-btn.recording {
  animation: micPulse 1.2s infinite;
  background: #fee2e2;
  border-radius: 50%;
}

@keyframes micPulse {
  0% { transform: translateY(-50%) scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: translateY(-50%) scale(1.15); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: translateY(-50%) scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Панель активной записи с микрофона */
.voice-recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-btn);
  padding: 8px 12px;
  margin-bottom: 12px;
  gap: 12px;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-red-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { opacity: 0.3; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

.rec-title {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  letter-spacing: 0.05em;
}

.rec-timer-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #991b1b;
  margin-left: 4px;
}

/* Волна эквалайзера при записи */
.rec-eq-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  flex: 1;
  justify-content: center;
  max-width: 120px;
}

.rec-eq-wave span {
  display: inline-block;
  width: 3px;
  background: #ef4444;
  border-radius: 2px;
  animation: eqWave 0.9s infinite ease-in-out alternate;
}

.rec-eq-wave span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.rec-eq-wave span:nth-child(2) { height: 12px; animation-delay: 0.3s; }
.rec-eq-wave span:nth-child(3) { height: 16px; animation-delay: 0.15s; }
.rec-eq-wave span:nth-child(4) { height: 8px; animation-delay: 0.4s; }
.rec-eq-wave span:nth-child(5) { height: 14px; animation-delay: 0.25s; }
.rec-eq-wave span:nth-child(6) { height: 10px; animation-delay: 0.35s; }
.rec-eq-wave span:nth-child(7) { height: 5px; animation-delay: 0.05s; }

@keyframes eqWave {
  0% { transform: scaleY(0.3); opacity: 0.4; }
  100% { transform: scaleY(1.2); opacity: 1; }
}

.rec-btns-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Панель прикрепленного аудио перед отправкой */
.voice-attached-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-btn);
  padding: 6px 12px;
  margin-bottom: 12px;
}

.voice-icon {
  font-size: 14px;
}

.voice-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #166534;
  flex: 1;
}

.voice-btn-play {
  background: #ffffff;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.voice-btn-play:hover {
  background: #dcfce7;
}

.voice-btn-remove {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.voice-btn-remove:hover {
  color: #dc2626;
}

/* Аудиоплеер в строке лога */
.audio-inline-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 6px;
  vertical-align: middle;
}

.audio-play-btn {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  line-height: 1;
  padding-left: 2px;
  transition: transform 0.1s ease, background 0.1s ease;
}

.audio-play-btn:hover {
  transform: scale(1.1);
  background: #334155;
}

.audio-time-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #475569;
  font-weight: 500;
}

/* Бейджи расшифровки GigaAM и повторов */
.badge-gigaam-sm {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: -0.01em;
}

.badge-lavender-sm {
  background: #f5f3ff;
  border: 1px dashed #c4b5fd;
  color: #7c3aed;
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  animation: pulseLavender 1.5s infinite alternate;
}

@keyframes pulseLavender {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.badge-repeat {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.clickable-phone {
  cursor: pointer;
}

.clickable-phone:hover {
  text-decoration: underline;
  color: #2563eb;
}

.leaked-snapshot-badge {
  display: inline-block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 2px 6px;
  border-radius: 4px;
}

.leaked-snapshot-badge code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #991b1b;
}

.btn-icon-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.btn-icon-subtle:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* ==========================================================================
   МОДАЛЬНЫЕ ОКНА
   ========================================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
  padding: 20px;
  position: relative;
  animation: modalScaleIn 0.15s ease-out;
}

@keyframes modalScaleIn {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ==========================================================================
   МОБИЛЬНАЯ НАВИГАЦИЯ (НИЖНИЙ ТАБ-БАР)
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
}

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */

@media (max-width: 1024px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .detail-two-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    height: 48px;
    padding: 0 12px;
    gap: 8px;
  }
  .topbar-left {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }
  .topbar-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;
  }
  .context-switcher {
    padding: 4px 8px;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .context-switcher span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-right {
    gap: 8px;
    flex-shrink: 0;
  }
  .digest-timer-pill {
    padding: 3px 7px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .user-name-text {
    display: none;
  }
  .topbar-logout-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
  }
  .topbar-logout-btn span {
    display: none;
  }

  .app-sidebar {
    display: none;
  }
  .app-sidebar.open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    z-index: 50;
  }
  .sidebar-close-btn {
    display: inline-flex;
  }
  .kbd-badge {
    display: none;
  }
  .sidebar-nav-item {
    padding: 9px 12px;
    font-size: 13.5px;
  }

  .app-content {
    padding: 10px 10px calc(72px + env(safe-area-inset-bottom, 0px)) 10px !important;
  }

  /* Нижний фиксированный таб-бар */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    z-index: 35;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    justify-content: space-around;
    align-items: center;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 500;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: color 0.12s ease;
  }

  .mobile-nav-item svg {
    color: currentColor;
  }

  .mobile-nav-item.active {
    color: #0f172a;
    font-weight: 600;
  }

  .toast {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    right: 14px;
    text-align: center;
  }

  /* Предотвращение зума iOS при фокусе в поле ввода */
  .form-input, .form-select, .form-textarea, .sidebar-search-input, .search-input-field {
    font-size: 16px !important;
  }

  /* Сетки для мобильных */
  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .form-grid-2, .form-grid-3, .detail-two-cards-grid {
    grid-template-columns: 1fr !important;
  }

  .filter-pills-strip {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  .sub-toolbar-group {
    margin-left: 0 !important;
    flex-wrap: wrap;
  }

  .segmented-status-group {
    width: 100%;
    display: flex;
    overflow-x: auto;
  }

  .segmented-btn {
    flex: 1;
    white-space: nowrap;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hide-xs {
    display: none;
  }
}

/* ==========================================================================
   ПОШАГОВЫЙ КВИЗ (WIZARD) — SHADCN UI KIT
   ========================================================================== */

.quiz-outer-wrapper {
  max-width: 620px;
  margin: 0 auto;
  padding: 12px 0 40px 0;
}

.quiz-success-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.quiz-success-icon {
  width: 56px;
  height: 56px;
  background: #ecfdf5;
  color: #059669;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 14px;
}

.quiz-success-title {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.quiz-success-sub {
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 24px;
}

.quiz-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.quiz-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.draft-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #92400e;
  height: 36px;
  padding: 0 10px 0 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 8px;
  white-space: nowrap;
}

.draft-banner-text {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-reset-btn {
  border: none;
  background: #fef3c7;
  color: #b45309;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s ease;
}

.draft-reset-btn:hover {
  background: #fde68a;
  color: #78350f;
}

.quiz-stepper-header {
  margin-bottom: 20px;
}

.quiz-stepper-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.stepper-back-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.stepper-back-btn:hover {
  color: #0f172a;
}

.stepper-step-indicator {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.stepper-progress-track {
  height: 4px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.stepper-progress-fill {
  height: 100%;
  background: #18181b;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-step-pane {
  display: none;
}

.quiz-step-pane.active {
  display: block;
  animation: fadeInStep 0.18s ease-out;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-header {
  margin-bottom: 16px;
}

.step-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.step-subtitle {
  font-size: 13px;
  color: #64748b;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-hint {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.3;
}

.step-footer-actions {
  margin-top: 14px;
}

.quiz-big-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-big-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.quiz-big-card:hover {
  border-color: #0f172a;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.quiz-big-card.selected {
  border-color: #0f172a;
  background: #f8fafc;
  box-shadow: 0 0 0 1px #0f172a;
}

.big-card-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-call { background: #eff6ff; color: #2563eb; }
.icon-sms { background: #fdf2f8; color: #db2777; }
.icon-action { background: #fefce8; color: #ca8a04; }

.big-card-content {
  flex: 1;
  min-width: 0;
}

.big-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.big-card-desc {
  font-size: 12.5px;
  color: #64748b;
}

.big-card-arrow {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 14px 0;
  color: #94a3b8;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quiz-divider::before, .quiz-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.quiz-divider span {
  padding: 0 10px;
}

.quick-create-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

.quick-create-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
}

.markers-select-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.marker-select-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.marker-select-card:hover {
  border-color: #94a3b8;
}

.marker-select-card.selected {
  border-color: #0f172a;
  background: #f8fafc;
  box-shadow: 0 0 0 1px #0f172a;
}

.marker-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.marker-target-badge {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.branch-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-kc {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.badge-dev {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.marker-card-phone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.marker-mono-phone {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.marker-select-radio-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 11px;
  font-weight: bold;
}

.marker-select-card.selected .marker-select-radio-check {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.marker-legend-box {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #334155;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.35;
}

.legend-icon {
  display: inline-flex;
  align-items: center;
  color: #64748b;
  flex-shrink: 0;
  margin-top: 1px;
}

.empty-personal-markers {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.empty-icon { font-size: 28px; margin-bottom: 8px; }
.empty-title { font-size: 14.5px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.empty-desc { font-size: 12.5px; color: #64748b; margin-bottom: 10px; }

.colleagues-spoiler-box {
  margin: 12px 0 14px 0;
}

.spoiler-toggle-btn {
  background: none;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spoiler-toggle-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.colleagues-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-marker-cheat-sheet {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.cheat-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.cheat-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.cheat-phone {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

.cheat-legend-row {
  font-size: 12px;
  color: #334155;
  line-height: 1.35;
}

.cheat-legend-label {
  font-weight: 600;
  color: #0f172a;
  margin-right: 4px;
}

.category-grid-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.grid-2x2-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.category-tile {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-tile:hover {
  border-color: #0f172a;
  background: #f8fafc;
}

.category-tile.selected {
  border-color: #0f172a;
  background: #f8fafc;
  box-shadow: 0 0 0 1px #0f172a;
}

.category-tile.tile-danger.selected {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 1px #dc2626;
}

.tile-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
}

.tile-dev { background: #fff7ed; color: #ea580c; }
.tile-kc { background: #ecfdf5; color: #059669; }
.tile-stranger { background: #fef2f2; color: #dc2626; }
.tile-other { background: #f1f5f9; color: #475569; }

.tile-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.tile-subtitle {
  font-size: 11.5px;
  color: #64748b;
}

.action-subtypes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-subtype-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  text-align: left;
  transition: all 0.15s ease;
}

.subtype-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.action-subtype-btn:hover {
  border-color: #0f172a;
  background: #f8fafc;
}

.action-subtype-btn.selected {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.action-subtype-btn.selected .subtype-icon {
  color: #ffffff;
}

.action-subtype-btn.selected .subtype-badge {
  background: #ffffff;
  color: #0f172a;
}

.subtype-badge {
  margin-left: auto;
  font-size: 10.5px;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.summary-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.summary-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: #334155;
}

.voice-quiz-card {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  margin-bottom: 12px;
}

.voice-hero-btn {
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mic-pulsing-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.voice-hero-btn:hover .mic-pulsing-icon {
  transform: scale(1.06);
  background: #27272a;
}

.voice-hero-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}

.voice-hero-sub {
  font-size: 12px;
  color: #64748b;
}

.recording-active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recording-wave-animation {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 24px;
}

.wave-bar {
  width: 4px;
  height: 12px;
  background: #dc2626;
  border-radius: 2px;
  animation: wavePulse 1s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 22px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 16px; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; height: 24px; }
.wave-bar:nth-child(5) { animation-delay: 0.3s; height: 14px; }

@keyframes wavePulse {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.4); }
}

.recording-timer {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: #dc2626;
  margin: 8px 0 12px 0;
}

.recording-actions-row {
  display: flex;
  gap: 10px;
}

.btn-danger-record {
  background: #dc2626;
  color: #ffffff;
  border: none;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger-record:hover {
  background: #b91c1c;
}

.attached-ready {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.attached-badge {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attached-pulse {
  color: #059669;
}

.attached-player-row {
  display: flex;
  gap: 8px;
}

.btn-play-draft {
  background: #0f172a;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-play-draft:hover {
  background: #27272a;
}

.btn-delete-draft-voice {
  background: none;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.btn-delete-draft-voice:hover {
  background: #fef2f2;
}

.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quick-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: #475569;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.quick-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-black-submit {
  background: #0f172a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-black-submit:hover {
  background: #27272a;
  transform: translateY(-1px);
}

.quiz-footer-links {
  text-align: center;
  margin-top: 14px;
}

.link-to-cabinet {
  color: #64748b;
  font-size: 12.5px;
  text-decoration: none;
  font-weight: 500;
}

.link-to-cabinet:hover {
  color: #0f172a;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .quiz-outer-wrapper {
    padding: 0;
  }
  .quiz-container {
    padding: 14px 14px;
    border-radius: 14px;
  }
  .quiz-stepper-header {
    margin-bottom: 14px;
  }
  .step-header {
    margin-bottom: 12px;
  }
  .step-title {
    font-size: 18px;
  }
  .quiz-big-cards-grid {
    gap: 10px;
  }
  .quiz-big-card {
    padding: 12px 14px;
    gap: 12px;
  }
  .big-card-icon-box {
    width: 38px;
    height: 38px;
  }
  .big-card-title {
    font-size: 14.5px;
  }
  .big-card-desc {
    font-size: 12px;
  }
  .quiz-divider {
    margin: 14px 0 12px 0;
  }
  .grid-2x2-categories {
    gap: 8px;
    margin-bottom: 12px;
  }
  .category-tile {
    padding: 11px 12px;
  }
  .quick-chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .quick-chip {
    padding: 5px 10px;
    flex-shrink: 0;
  }
  .quiz-footer-links {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .action-subtypes-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}


