:root {
  --bg-base: #f1f3f7;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --bg-chat: #f4f6fb;
  --msg-in-bg: #ffffff;
  --msg-in-text: #0f172a;
  --msg-out-bg: #dcf8c6;
  --msg-out-text: #0f172a;
}

body.dark-theme {
  --bg-base: #0b0f17;
  --bg-surface: #111827;
  --bg-card: #161f30;
  --bg-subtle: #1e293b;
  --border: #243044;
  --border-light: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --bg-chat: #0b0f17;
  --msg-in-bg: #1e293b;
  --msg-in-text: #f8fafc;
  --msg-out-bg: #064e3b;
  --msg-out-text: #f8fafc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--bg-base);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

/* ============================================================
   1. Р­РљР РђРќ Р‘Р›РћРљРР РћР’РљР РџРћ РџРђР РћР›Р® (AUTH GATE)
   ============================================================ */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 28px;
}

.auth-gate-header {
  margin-bottom: 24px;
  text-align: center;
}

.auth-gate-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-gate-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-gate-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.auth-gate-form input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.auth-gate-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-gate-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-bottom: 12px;
  display: none;
}

/* ============================================================
   2. Р“Р›РђР’РќР«Р™ РљРђР РљРђРЎ Р РќРђР’РР“РђР¦РРЇ
   ============================================================ */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.mobile-header {
  display: none;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.mobile-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.mobile-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.sidebar {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 110;
  transition: background 0.2s, border-color 0.2s;
}

.sidebar-brand {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav,
.nav-list {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
  font-weight: 600;
}

body.dark-theme .nav-item.active {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.account-state-pill {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  font-weight: 700;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 105;
}

/* ============================================================
   3. Р“Р›РћР‘РђР›Р¬РќРђРЇ Р’Р•Р РҐРќРЇРЇ РЁРђРџРљРђ
   ============================================================ */
.app-topbar {
  height: 54px;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 50;
  transition: background 0.2s, border-color 0.2s;
}

.app-topbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-page-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.topbar-page-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-slots-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 3px 4px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.topbar-slot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-slot-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.05);
}

body.dark-theme .topbar-slot-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* РРЅРґРёРєР°С‚РѕСЂ РѕРЅР»Р°Р№РЅР° СЃР»РѕС‚Р° */
.slot-dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
}

/* РђРєС‚РёРІРЅС‹Р№ РІС‹Р±СЂР°РЅРЅС‹Р№ СЃР»РѕС‚: СЃРёРЅРёР№ С„РѕРЅ, Р±РµР»С‹Р№ РєРѕРЅС‚СЂР°СЃС‚РЅС‹Р№ С‚РµРєСЃС‚ */
.topbar-slot-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.topbar-slot-btn.active .slot-dot-online {
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.topbar-slot-btn:not(.active) .slot-dot-online {
  opacity: 0.55;
}

.topbar-action-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
}

.topbar-action-btn svg {
  stroke: currentColor;
}

.topbar-action-btn:hover {
  background: var(--border);
  color: var(--text-main);
}

.theme-toggle-btn {
  width: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

/* ============================================================
   4. Р РђР‘РћР§РђРЇ РћР‘Р›РђРЎРўР¬ Р РўРРџРћР’Р«Р• Р­Р›Р•РњР•РќРўР«
   ============================================================ */
.main-viewport {
  flex: 1;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

/* РћР±С‹С‡РЅС‹Рµ РІРєР»Р°РґРєРё (РљРѕРЅС‚Р°РєС‚С‹, РћС‡РµСЂРµРґСЊ, РџР°СЂР°РјРµС‚СЂС‹ РР, РўР°СЂРёС„С‹ Рё С‚.Рґ.) */
.panel-section {
  display: none;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  overflow-y: auto;
  height: calc(100vh - 54px);
}

.panel-section.active {
  display: block;
}

/* РЎРµРєС†РёСЏ Р”РёР°Р»РѕРіРѕРІ вЂ” РїРѕР»РЅРѕСЂР°Р·РјРµСЂРЅР°СЏ Р‘Р•Р— Р”Р’РћР™РќР«РҐ РћРљРћРќ Рё РѕС‚СЃС‚СѓРїРѕРІ! */
.panel-section.panel-section-dialogues {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none;
  width: 100%;
  height: calc(100vh - 54px);
  overflow: hidden;
}

.panel-section.panel-section-dialogues.active {
  display: flex;
  flex-direction: column;
}

.section-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  display: none !important;
}

/* РљРЅРѕРїРєРё */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-main); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; border-color: var(--border-light); color: var(--text-main); }
.btn-outline-danger { background: transparent; border-color: rgba(239, 68, 68, 0.4); color: var(--danger); }
.btn-outline-danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-block { width: 100%; }

/* РљР°СЂС‚РѕС‡РєРё Рё РїРѕР»СЏ С„РѕСЂРј */
.config-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 20px;
}

.card-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-row input,
.form-row select,
.form-row textarea {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 0.88rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.4;
}

.label-with-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.value-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.custom-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-wrap input {
  display: none;
}

.checkbox-box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  flex-shrink: 0;
}

.custom-checkbox-wrap input:checked + .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox-wrap input:checked + .checkbox-box:after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-text {
  font-size: 0.84rem;
  color: var(--text-main);
}

.preview-output {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
}

/* ============================================================
   5. Р”РРђР›РћР“Р Р РћРљРќРћ Р§РђРўРђ (Р•Р”РРќРћР• РћРљРќРћ Р‘Р•Р— Р’Р›РћР–Р•РќРќРћРЎРўР)
   ============================================================ */
.dialogues-layout {
  display: flex;
  height: 100%;
  width: 100%;
  background: var(--bg-surface);
  border: none;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.dialogues-sidebar {
  width: 350px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bg-surface);
  height: 100%;
  transition: background 0.2s, border-color 0.2s;
}

/* РџРѕРёСЃРє РїРѕ РґРёР°Р»РѕРіР°Рј */
.dialogue-search-wrap {
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
}

.search-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-input-box input {
  width: 100%;
  padding: 9px 32px 9px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: all 0.2s;
}

.search-input-box input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-clear-search:hover {
  color: var(--text-main);
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
}

.btn-icon-square {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-icon-square:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* РљРЅРѕРїРєР° В«РўРµСЃС‚РѕРІС‹Р№ РґРёР°Р»РѕРіВ» */
.dialogue-new-chat-wrap {
  padding: 4px 14px 10px;
}

.btn-new-dialogue {
  width: 100%;
  padding: 10px 16px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}

.btn-new-dialogue:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.dialogue-new-chat-sub {
  display: none !important;
}

/* РўР°Р±Р»РµС‚РєРё С„РёР»СЊС‚СЂР°С†РёРё: РІ 2 Р°РєРєСѓСЂР°С‚РЅС‹Рµ СЃС‚СЂРѕРєРё РїРѕ 3 РєРЅРѕРїРєРё */
.status-filter-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
}

/* РљРЅРѕРїРєРё РїРµСЂРµРєР»СЋС‡РµРЅРёСЏ СЃР»РѕС‚РѕРІ РІ 1 Р°РєРєСѓСЂР°С‚РЅСѓСЋ РіРѕСЂРёР·РѕРЅС‚Р°Р»СЊРЅСѓСЋ СЃС‚СЂРѕРєСѓ */
.slot-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.slot-pills-row .pill {
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 0.78rem;
}

.pill {
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill:hover {
  background: var(--border);
  color: var(--text-main);
}

.pill.active {
  background: #2563eb;
  color: #ffffff;
}

.pill-intervention {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.contacts-scroll-area {
  flex: 1;
  overflow-y: auto;
}

/* РљР°СЂС‚РѕС‡РєРё РєРѕРЅС‚Р°РєС‚РѕРІ РІ СЃРїРёСЃРєРµ РґРёР°Р»РѕРіРѕРІ */
.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.contact-card:hover {
  background: var(--bg-subtle);
}

/* РђРєС‚РёРІРЅС‹Р№ РІС‹Р±СЂР°РЅРЅС‹Р№ РєРѕРЅС‚Р°РєС‚ РєР°Рє РЅР° СЂРµС„РµСЂРµРЅСЃРµ: СЃРёРЅРёР№ С„РѕРЅ */
.contact-card.selected {
  background: #2563eb !important;
  color: #ffffff !important;
}

.contact-card.selected .contact-card-name,
.contact-card.selected .contact-card-phone,
.contact-card.selected .contact-card-snippet,
.contact-card.selected .contact-time-badge {
  color: #ffffff !important;
}

.contact-card.selected .contact-card-snippet {
  opacity: 0.88;
}

.contact-card.selected .contact-badge {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.contact-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.contact-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-time-badge {
  font-size: 0.72rem;
  color: var(--text-faint);
  flex-shrink: 0;
  margin-left: 6px;
}

.contact-card-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.contact-card-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.contact-badge {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* рџ¤– РР Р°РєС‚РёРІРµРЅ */
.badge-active_ai {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
}
body.dark-theme .badge-active_ai {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

/* вЏі РћР¶РёРґР°РЅРёРµ РѕС‚РІРµС‚Р° */
.badge-sent_awaiting_reply {
  background: rgba(100, 116, 139, 0.12) !important;
  color: #334155 !important;
  border-color: rgba(100, 116, 139, 0.25) !important;
}
body.dark-theme .badge-sent_awaiting_reply {
  background: rgba(148, 163, 184, 0.18) !important;
  color: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
}

/* рџ‘¤ Р СѓС‡РЅРѕР№ СЂРµР¶РёРј */
.badge-manual_control {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #b45309 !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
body.dark-theme .badge-manual_control {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

/* вљЎ Р’РјРµС€Р°С‚РµР»СЊСЃС‚РІРѕ */
.badge-intervention {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #b91c1c !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
body.dark-theme .badge-intervention {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

/* вњ… Р—Р°РІРµСЂС€РµРЅ */
.badge-closed {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #047857 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
body.dark-theme .badge-closed {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

/* рџ“‹ Р’ РѕС‡РµСЂРµРґРё */
.badge-queued {
  background: rgba(139, 92, 246, 0.14) !important;
  color: #6d28d9 !important;
  border-color: rgba(139, 92, 246, 0.3) !important;
}
body.dark-theme .badge-queued {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #c4b5fd !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
}

/* рџ“Ё Р Р°РЅРµРµ РїРёСЃР°Р»Рё */
.badge-already_contacted {
  background: rgba(100, 116, 139, 0.12) !important;
  color: #475569 !important;
  border-color: rgba(100, 116, 139, 0.25) !important;
}

/* вќЊ РћС€РёР±РєР° */
.badge-failed {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #b91c1c !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.unread-badge {
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 1px 7px;
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   РћР‘Р›РђРЎРўР¬ РџР•Р Р•РџРРЎРљР (Р§РђРў)
   ============================================================ */
.chat-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  min-width: 0;
  height: 100%;
}

.chat-viewport-header {
  min-height: 72px;
  height: auto;
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 200px;
}

.chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.chat-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

.chat-profile-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 540px;
  flex-shrink: 0;
}

.chat-header-actions .btn {
  padding: 5px 10px;
  font-size: 0.76rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* РљРЅРѕРїРєР° СЂРµР¶РёРјР° РР / Р СѓС‡РЅРѕР№ */
.btn-mode-ai {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #059669 !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  cursor: pointer;
  transition: all 0.2s;
}

body.dark-theme .btn-mode-ai {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.2) !important;
}

.btn-mode-ai .mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.btn-mode-manual {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #d97706 !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  cursor: pointer;
  transition: all 0.2s;
}

body.dark-theme .btn-mode-manual {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.2) !important;
}

.btn-mode-manual .mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

/* РЎРѕРѕР±С‰РµРЅРёСЏ */
.chat-messages-container {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-chat);
  background-image: radial-gradient(var(--border) 1px, transparent 0);
  background-size: 24px 24px;
}

.chat-placeholder {
  margin: auto;
  font-size: 0.9rem;
  color: var(--text-faint);
  text-align: center;
}

.chat-date-divider {
  align-self: center;
  margin: 6px auto;
  padding: 4px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  user-select: none;
  pointer-events: none;
}

.chat-msg {
  max-width: 68%;
  padding: 10px 15px 8px 15px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* РЎРѕР±РµСЃРµРґРЅРёРє (РєР»РёРµРЅС‚/Р»РёРґ) - РЎР›Р•Р’Рђ (Р±РµР»С‹Рµ Р±Р°Р±Р±Р»С‹ РєР°Рє РЅР° СЂРµС„РµСЂРµРЅСЃРµ) */
.chat-msg.user {
  align-self: flex-start;
  background: var(--msg-in-bg);
  color: var(--msg-in-text);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}

/* РќР°С€ Р±РѕС‚ / РјРµРЅРµРґР¶РµСЂ - РЎРџР РђР’Рђ (РЅРµР¶РЅРѕ-Р·РµР»РµРЅС‹Рµ Р±Р°Р±Р±Р»С‹ РєР°Рє РЅР° СЂРµС„РµСЂРµРЅСЃРµ) */
.chat-msg.bot,
.chat-msg.manager {
  align-self: flex-end;
  background: var(--msg-out-bg);
  color: var(--msg-out-text);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom-right-radius: 4px;
}

.msg-sender-tag {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 3px;
  color: #2563eb;
}

body.dark-theme .msg-sender-tag {
  color: #38bdf8;
}

.msg-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.88rem;
}

.msg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-faint);
}

.msg-checkmarks {
  color: #10b981;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: -2px;
}

.msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.chat-msg:hover .msg-actions {
  opacity: 1;
}

.msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 1px 4px;
  font-size: 0.75rem;
  border-radius: 4px;
}

.msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

.msg-feedback-btn {
  background: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
  font-weight: 700;
  border-radius: 8px;
  padding: 2px 6px;
}

/* РќР°Р±РѕСЂ С‚РµРєСЃС‚Р° */
.chat-typing-row {
  display: none;
  padding: 8px 24px;
  font-size: 0.76rem;
  color: var(--text-muted);
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: #2563eb;
  border-radius: 50%;
  animation: pulse 1s infinite alternate;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* РџРѕР»Рµ РІРІРѕРґР° */
.chat-input-area {
  padding: 12px 20px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.chat-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: var(--bg-surface);
}

.chat-textarea-wrapper {
  flex: 1;
  display: flex;
  min-width: 0;
}

.chat-textarea-wrapper textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.92rem;
  resize: none;
  outline: none;
  padding: 6px 4px;
  min-height: 38px;
  max-height: 140px;
  line-height: 1.45;
  overflow-y: auto;
}

.btn-send-rect {
  height: 38px;
  padding: 0 20px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-send-rect:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-send-rect:active {
  transform: translateY(0);
}

.chat-input-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
  min-height: 16px;
}

/* ============================================================
   5. РўРђР РР¤Р« Р РђРќРђР›РРўРРљРђ
   ============================================================ */
.tariff-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

#tariffFilterPills {
  display: flex !important;
  flex-wrap: wrap !important;
  grid-template-columns: none !important;
  gap: 8px !important;
  padding: 0 !important;
  border-bottom: none !important;
  width: auto !important;
}

#tariffFilterPills .pill {
  flex: none !important;
  padding: 6px 14px !important;
  border-radius: 16px !important;
}

.tariff-search-input {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.85rem;
  min-width: 250px;
}

.mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.mode-multimodal { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.mode-direct_rail { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.mode-lcl { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.mode-air { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.mode-sea { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.mode-rail_vvo { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }

.tariff-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tariff-form-grid input,
.tariff-form-grid select {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 0.82rem;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  color: var(--text-faint);
  font-weight: 600;
}

.mt-12 {
  margin-top: 12px;
}

.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.stat-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main) !important;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* ============================================================
   6. РЎР›РћРўР« РђРљРљРђРЈРќРўРћР’, Р›РРњРРўР« Р РћР§Р•Р Р•Р”Р¬
   ============================================================ */
.account-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
}

.account-slot-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.account-slot-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-indicator-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.border-top-row {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.account-danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

/* РљР°СЂС‚РѕС‡РєРё РїРѕРґРєР»СЋС‡РµРЅРёСЏ 4 СЃР»РѕС‚РѕРІ */
.account-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.account-slot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  transition: border-color 0.2s;
  position: relative;
}

.account-slot-card.active-slot {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.slot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.slot-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.slot-status-pill {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  font-weight: 600;
}

.slot-status-pill.pill-auth {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.slot-phone-display {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  min-height: 20px;
}

.slot-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.active-tag {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-right: 6px;
}

.active-slot-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary, #3b82f6);
  border: 1px solid rgba(37, 99, 235, 0.3);
  letter-spacing: 0.02em;
}

/* РЎРµС‚РєР° Р»РёРјРёС‚РѕРІ 4 СЃР»РѕС‚РѕРІ РІ СЂР°Р·РґРµР»Рµ Р Р°СЃСЃС‹Р»РєР° */
.slot-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
  margin-bottom: 8px;
}

.slot-limit-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-limit-card.active-slot-limit {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.03);
}

.slot-limit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-limit-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.slot-limit-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.slot-limit-counter strong {
  color: var(--primary);
}

.slot-limit-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: -4px;
}

.slot-limit-slider {
  width: 100%;
  margin-top: 4px;
}

.slot-limit-footer {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-align: right;
}

.active-dot {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 4px;
}

/* РћС‡РµСЂРµРґСЊ Рё РєРѕРЅС‚Р°РєС‚С‹ */
.queue-badge-pill {
  margin-left: auto;
  font-size: 0.65rem;
  background: var(--bg-base);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.contacts-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contacts-toolbar input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  color: var(--text-main);
}

.quick-add-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-add-wrap input {
  width: 140px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  color: var(--text-main);
}

.queue-add-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.queue-add-box input {
  flex: 1;
  min-width: 180px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  color: var(--text-main);
}

/* ============================================================
   7. РђР”РђРџРўРР’РќРћРЎРўР¬ (РњРћР‘РР›Р¬РќР«Р• РЈРЎРўР РћР™РЎРўР’Рђ)
   ============================================================ */
@media (max-width: 820px) {
  .mobile-header {
    display: flex;
  }

  .app-container {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
    width: 260px;
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(260px);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .main-viewport {
    padding: 72px 16px 20px 16px;
    height: 100vh;
  }

  .settings-grid,
  .form-grid-two {
    grid-template-columns: 1fr;
  }

  .dialogues-layout {
    height: calc(100vh - 120px);
  }

  /* РџРµСЂРµРєР»СЋС‡РµРЅРёРµ СЃРїРёСЃРєР° С‡Р°С‚РѕРІ Рё РѕРєРЅР° РїРµСЂРµРїРёСЃРєРё РЅР° РјРѕР±РёР»СЊРЅС‹С… СЌРєСЂР°РЅР°С… */
  .dialogues-sidebar {
    width: 100%;
  }

  .chat-viewport {
    display: none;
  }

  .dialogues-layout.chat-open .dialogues-sidebar {
    display: none;
  }

  .dialogues-layout.chat-open .chat-viewport {
    display: flex;
    width: 100%;
  }

  .chat-back-btn {
    display: inline-flex;
  }
}

/* РџРѕРёСЃРє РїРѕ РґРёР°Р»РѕРіР°Рј Рё РїСЂРµРІСЊСЋ РїРѕСЃР»РµРґРЅРµРіРѕ СЃРѕРѕР±С‰РµРЅРёСЏ */
.dialogue-search-wrap { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dialogue-search-wrap input { width: 100%; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; color: var(--text-main); font-size: 0.8rem; }
.dialogue-search-wrap input:focus { outline: none; border-color: var(--primary); }

.contact-card-snippet { font-size: 0.72rem; color: var(--text-faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* РљРЅРѕРїРєР° СЃР±СЂРѕСЃР° РїСЂРѕРјРїС‚Р° Рё Р·Р°РіРѕР»РѕРІРєРё */
.label-with-actions { display: flex; justify-content: space-between; align-items: center; }
.btn-text { background: transparent; border: none; color: var(--text-faint); font-size: 0.72rem; cursor: pointer; text-decoration: underline; padding: 0; }
.btn-text:hover { color: var(--danger); }

/* РўР°Р№РјРµСЂ Р±Р»РѕРєРёСЂРѕРІРєРё */
.auth-gate-lock { color: var(--danger); font-size: 0.8rem; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; text-align: center; }

/* РљРЅРѕРїРєР° РєР°СЂР°РЅРґР°С€Р° РЅР° РѕС‚РІРµС‚Рµ Р±РѕС‚Р° */
.msg-feedback-btn { 
  background: rgba(59, 130, 246, 0.12); 
  border: 1px solid rgba(59, 130, 246, 0.25); 
  color: #38bdf8; 
  cursor: pointer; 
  font-size: 0.72rem; 
  font-weight: 600; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  padding: 3px 6px; 
  border-radius: 4px; 
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease; 
}
.msg-feedback-btn:hover { color: #fff; background: rgba(59, 130, 246, 0.3); border-color: rgba(59, 130, 246, 0.45); }

/* РњРѕРґР°Р»СЊРЅРѕРµ РѕРєРЅРѕ С„РёРґР±РµРєР° */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { width: 100%; max-width: 520px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.modal-body label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.modal-body input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--text-main); font-size: 0.88rem; box-sizing: border-box; }
.modal-body textarea { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--text-main); font-size: 0.88rem; resize: vertical; box-sizing: border-box; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg-card); }

.quoted-bot-msg { font-size: 0.8rem; color: var(--text-faint); background: var(--bg-base); border-left: 3px solid var(--primary); padding: 8px 12px; border-radius: 4px; max-height: 90px; overflow-y: auto; line-height: 1.4; }
.feedback-status-box { font-size: 0.8rem; padding: 10px 12px; border-radius: 6px; line-height: 1.4; margin-top: 6px; }
.feedback-status-box.loading { background: rgba(59, 130, 246, 0.1); color: var(--primary); border: 1px solid rgba(59, 130, 246, 0.3); }
.feedback-status-box.success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.feedback-status-box.error { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

.chat-actions-group { display: flex; flex-direction: column; gap: 6px; }

.slot-proxy-row { display: flex; gap: 6px; margin: 8px 0; }
.slot-proxy-input { flex: 1; background: var(--bg-base); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; color: var(--text-main); font-size: 0.72rem; }
.slot-proxy-input:focus { outline: none; border-color: var(--primary); }
.account-slot-card.flood-slot { border-color: var(--danger); background: rgba(239, 68, 68, 0.05); }
.pill-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.mt-8 { margin-top: 8px; }

/* Р’СЂРµРјСЏ СЃРѕРѕР±С‰РµРЅРёСЏ Рё РїР°РЅРµР»СЊ РґРµР№СЃС‚РІРёР№ РІРЅСѓС‚СЂРё РїСѓР·С‹СЂСЏ */
.msg-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; }
.msg-time { font-size: 0.65rem; color: var(--text-faint); user-select: none; }
.msg-actions { 
  display: inline-flex; 
  gap: 4px; 
  align-items: center; 
  opacity: 0; 
  transition: opacity 0.15s ease-in-out; 
}
.chat-msg:hover .msg-actions,
.chat-msg:focus-within .msg-actions { 
  opacity: 1; 
}
@media (hover: none), (max-width: 768px) {
  .msg-actions { opacity: 0.75; }
}
.msg-action-btn { 
  background: rgba(255, 255, 255, 0.06); 
  border: 1px solid rgba(255, 255, 255, 0.12); 
  color: var(--text-muted); 
  font-size: 0.78rem; 
  line-height: 1; 
  cursor: pointer; 
  padding: 3px 6px; 
  border-radius: 4px; 
  min-width: 22px; 
  min-height: 20px; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease; 
}
.msg-action-btn:hover { 
  color: #fff; 
  background: rgba(255, 255, 255, 0.2); 
  border-color: rgba(255, 255, 255, 0.3); 
}
.msg-delete-btn:hover { 
  color: #ef4444 !important; 
  background: rgba(239, 68, 68, 0.2) !important; 
  border-color: rgba(239, 68, 68, 0.4) !important; 
}


/* РљР°СЂС‚РѕС‡РєР° РґРёР°Р»РѕРіР° РІ СЃРїРёСЃРєРµ */
.contact-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.contact-time-badge { font-size: 0.65rem; color: var(--text-faint); }
.contact-card-mid { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

/* РљРЅРѕРїРєР° РІС‹С…РѕРґР° РѕС‚РєР»СЋС‡РµРЅР° */
.portal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  transition: all 0.15s ease;
}

.portal-nav-btn:hover {
  background: #2563eb;
  color: #ffffff !important;
  border-color: #2563eb;
}

.portal-nav-btn svg {
  stroke: currentColor;
}

/* 2. Р§РёСЃС‚Рѕ С‡РµСЂРЅС‹Р№ С†РІРµС‚ РІСЂРµРјРµРЅРё РЅР° СЃРёРЅРёС… СЃРѕРѕР±С‰РµРЅРёСЏС… РєР»РёРµРЅС‚Р° */
.chat-msg.user .msg-time {
  color: #000000 !important;
  font-weight: 600;
}

/* РљРЅРѕРїРєРё РґРµР№СЃС‚РІРёР№ РЅР° СЃРёРЅРёС… СЃРѕРѕР±С‰РµРЅРёСЏС… РєР»РёРµРЅС‚Р° */
.chat-msg.user .msg-action-btn {
  color: #000000;
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  opacity: 0.85;
}

.chat-msg.user .msg-action-btn:hover {
  color: #000000;
  opacity: 1;
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(0, 0, 0, 0.35);
}

.auth-status-box { padding: 10px 14px; border-radius: 6px; font-size: 0.8rem; line-height: 1.4; margin-top: 10px; }
.auth-status-box.info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #38bdf8; }
.auth-status-box.success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--success); }
.auth-status-box.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }

/* ============================================================
   РќР•РћР‘РҐРћР”РРњРћ Р’РњР•РЁРђРўР•Р›Р¬РЎРўР’Рћ (Р’Р«Р”Р•Р›Р•РќРР• Р—Р•Р›Р•РќР«Рњ Р Р РђР—Р”Р•Р›)
   ============================================================ */
.contact-card.needs-intervention {
  background: rgba(16, 185, 129, 0.13) !important;
  border-left: 4px solid #10b981 !important;
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.08);
}

.contact-card.needs-intervention:hover {
  background: rgba(16, 185, 129, 0.22) !important;
}

.contact-card.needs-intervention.selected {
  background: rgba(16, 185, 129, 0.28) !important;
  border-left: 5px solid #10b981 !important;
}

.contact-card.needs-intervention.selected .contact-card-name,
.contact-card.needs-intervention.selected .contact-card-phone,
.contact-card.needs-intervention.selected .contact-card-snippet,
.contact-card.needs-intervention.selected .contact-time-badge {
  color: #000000 !important;
}

.contact-card.needs-intervention.selected .contact-badge {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #000000 !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

body.dark-theme .contact-card.needs-intervention.selected .contact-card-name,
body.dark-theme .contact-card.needs-intervention.selected .contact-card-phone,
body.dark-theme .contact-card.needs-intervention.selected .contact-card-snippet,
body.dark-theme .contact-card.needs-intervention.selected .contact-time-badge {
  color: #f8fafc !important;
}

body.dark-theme .contact-card.needs-intervention.selected .contact-badge {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.intervention-badge-pill {
  background: #10b981;
  color: #0b0f17;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.pill-intervention {
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626 !important;
  background: rgba(239, 68, 68, 0.06);
}
.pill-intervention.active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}
body.dark-theme .pill-intervention {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.18);
}
body.dark-theme .pill-intervention.active {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.btn-success {
  background: var(--success, #10b981);
  color: #0b0f17;
  font-weight: 700;
}
.btn-success:hover {
  background: #059669;
  color: #ffffff;
}

.btn-outline-success {
  background: transparent;
  border: 1px solid #10b981;
  color: #10b981;
}
.btn-outline-success:hover {
  background: rgba(16, 185, 129, 0.15);
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid #f59e0b;
  color: #f59e0b;
}
.btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.15);
}

.intervention-total-chip {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.interventions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.interventions-toolbar input {
  flex: 1;
  min-width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.88rem;
}

.slot-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.slot-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.slot-chip-1 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.slot-chip-2 { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.slot-chip-3 { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.slot-chip-4 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }

.reason-tag {
  display: inline-block;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}


/* ============================================================
   РџРћР РўРђР›: Р’Р«Р‘РћР  Р РђР‘РћР§Р•Р“Рћ РРќРЎРўР РЈРњР•РќРўРђ (Р“Р›РћР‘РЈРЎ-Рњ TOOLS)
   ============================================================ */
.portal-view {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 100vh;
}

.portal-topbar {
  height: 60px;
  padding: 0 32px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-logo-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.portal-brand-text {
  display: flex;
  flex-direction: column;
}

.portal-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.portal-brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.portal-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portal-header {
  text-align: center;
  margin-bottom: 40px;
}

.portal-heading {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.portal-subheading {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
  width: 100%;
}

.portal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.portal-card:hover {
  transform: translateY(-3px);
  border-color: #2563eb;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.15), 0 8px 10px -6px rgba(37, 99, 235, 0.1);
}

body.dark-theme .portal-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.25);
}

.portal-card.active-card {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(37, 99, 235, 0.03) 100%);
}

.portal-card.placeholder-card {
  opacity: 0.92;
}

.portal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.portal-card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.icon-tg { background: rgba(37, 99, 235, 0.12); border-color: rgba(37, 99, 235, 0.25); }
.icon-email { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); }
.icon-bitrix { background: rgba(14, 165, 233, 0.12); border-color: rgba(14, 165, 233, 0.25); }
.icon-inbox { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.25); }
.icon-db { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); }

.portal-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.portal-card-badge.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.portal-card-badge.badge-dev {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.portal-card-body {
  flex: 1;
  margin-bottom: 8px;
}

.portal-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.portal-card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.portal-card-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.portal-card-btn-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
  transition: transform 0.15s;
}

.portal-card:hover .portal-card-btn-text {
  transform: translateX(4px);
}

.portal-card-btn-text.muted {
  color: var(--text-muted);
  font-weight: 600;
}

/* РљРЅРѕРїРєР° В«РџР°РЅРµР»СЊ РёРЅСЃС‚СЂСѓРјРµРЅС‚РѕРІВ» РІ С€Р°РїРєРµ Р±РѕС‚Р° */
.topbar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.topbar-back-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.topbar-back-btn svg {
  stroke: currentColor;
}

/* Р­РљР РђРќ-Р—РђР“Р›РЈРЁРљРђ Р”Р›РЇ РРќРЎРўР РЈРњР•РќРўРћР’ Р’ Р РђР—Р РђР‘РћРўРљР• */
.tool-placeholder {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}

.tool-placeholder-topbar {
  height: 60px;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.tool-placeholder-topbar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.tool-placeholder-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.tool-placeholder-card {
  max-width: 520px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.tool-placeholder-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  line-height: 1;
}

.tool-placeholder-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.tool-placeholder-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.tool-placeholder-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.tool-placeholder-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .portal-topbar { padding: 0 16px; }
  .portal-content { padding: 24px 16px 40px; }
  .portal-heading { font-size: 1.5rem; }
  .portal-grid { grid-template-columns: 1fr; gap: 14px; }
  .portal-card { padding: 18px; }
  .tool-placeholder-card { padding: 24px 18px; }
  .topbar-back-btn span { display: none; }
  .topbar-back-btn::after { content: "РџР°РЅРµР»СЊ"; }
}

/* ============================================================
   ПЕРЕГЕНЕРАЦИЯ СООБЩЕНИЙ И СТАТУС РЕДАКТИРОВАНИЯ
   ============================================================ */
.msg-regen-btn {
  color: var(--primary) !important;
  font-size: 0.85rem !important;
  padding: 2px 6px !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}

.msg-regen-btn:hover {
  transform: rotate(45deg);
  background: rgba(37, 99, 235, 0.12) !important;
}

.msg-regen-btn.spinning {
  animation: regenSpin 0.8s linear infinite !important;
  opacity: 0.6;
  pointer-events: none;
}

@keyframes regenSpin {
  100% { transform: rotate(360deg); }
}

.msg-edited-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 6px;
  user-select: none;
  opacity: 0.8;
}

.msg-flash-updated {
  animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
  0% { background-color: rgba(37, 99, 235, 0.25); }
  100% { background-color: transparent; }
}

/* ============================================================
   МАССОВЫЙ ИМПОРТ EXCEL (.XLSX) В ОЧЕРЕДЬ
   ============================================================ */
.excel-upload-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.excel-dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  background: var(--bg-subtle, rgba(0, 0, 0, 0.02));
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.excel-dropzone:hover,
.excel-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  transform: translateY(-1px);
}

.excel-dropzone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.excel-dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.excel-dropzone-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.excel-selected-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.excel-selected-file .file-icon {
  font-size: 1.2rem;
}

.excel-selected-file .file-name {
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  word-break: break-all;
}

.excel-selected-file .file-size {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.excel-selected-file .btn-remove-file {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s;
}

.excel-selected-file .btn-remove-file:hover {
  color: var(--danger, #ef4444);
}

.excel-actions {
  display: flex;
  gap: 10px;
}

.excel-import-report {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.excel-import-report.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--text-main);
}

.excel-import-report.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger, #ef4444);
}

.report-item {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.report-item.highlight {
  font-weight: 700;
  color: var(--primary);
  border-top: 1px dashed var(--border);
  margin-top: 6px;
  padding-top: 6px;
}

.import-divider {
  position: relative;
  text-align: center;
  margin: 18px 0 12px;
  border-top: 1px dashed var(--border);
}

.import-divider span {
  position: relative;
  top: -10px;
  background: var(--bg-surface);
  padding: 0 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
