/* ========================================
   АСУБ CRM - Main Styles
   ======================================== */

:root {
  --bg-main: #E7F7FF;
  --bg-sidebar: #D2E7F6;
  --text-main: #000926;
  --card-bg: #FFFFFF;
  --card-border: rgba(0, 9, 38, 0.06);
  --border-light: rgba(0, 9, 38, 0.08);
  --primary: #2563eb;
  --primary-light: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  min-width: 300px;
  max-width: 400px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--primary); }

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: #64748b; }
.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
}
.toast-close:hover { color: #64748b; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ========== APP LAYOUT ========== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 200px;
  background-color: var(--bg-sidebar);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: width 0.3s ease;
  overflow: hidden;
  position: relative;
}

.sidebar.collapsed {
  width: 60px;
  padding: 16px 8px;
}

.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }

.sidebar-toggle {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: #667eea;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  gap: 8px;
}

.sidebar-toggle:hover { background: #5a67d8; }
.sidebar.collapsed .sidebar-toggle { padding: 10px 0; }
.sidebar.collapsed .sidebar-toggle .toggle-text { display: none; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  position: relative;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sidebar-ai {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  margin-top: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.sidebar-ai:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.sidebar-ai-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-ai-text {
  font-weight: 600;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-ai-text { display: none; }
.sidebar.collapsed .sidebar-ai { justify-content: center; padding: 12px 8px; }
.sidebar-ai.active { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nav-item--active { background: #FFFFFF; }
.nav-item:hover { background: rgba(255, 255, 255, 0.7); }

.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.nav-label {
  font-size: 14px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ========== AUTH ========== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 9, 38, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-overlay.hidden { display: none; }

.auth-modal {
  background: #fff;
  border-radius: 20px;
  width: 420px;
  max-width: 95%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}

.auth-tab {
  flex: 1;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  border: none;
  background: transparent;
  transition: all 0.2s;
}

.auth-tab:hover { background: var(--bg-main); }
.auth-tab.active {
  background: var(--bg-main);
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.auth-form { padding: 24px; display: none; }
.auth-form.active { display: block; }
.auth-form h3 { margin: 0 0 20px; font-size: 20px; text-align: center; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}
.auth-error.show { display: block; }

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.2s;
}
.user-info:hover { background: rgba(0, 9, 38, 0.05); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-name { font-size: 14px; font-weight: 500; }
.user-logout { font-size: 12px; color: var(--danger); cursor: pointer; }
.user-logout:hover { text-decoration: underline; }

/* ========== MAIN ========== */
.main {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.main-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.main-subtitle { font-size: 13px; opacity: 0.8; }

.main-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 20px;
  align-items: flex-start;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 14px 14px 12px;
  border: 1px solid var(--card-border);
}

.card-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  margin-bottom: 6px;
}

.card-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-meta { font-size: 12px; opacity: 0.8; }

.section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px 16px 12px;
  border: 1px solid var(--card-border);
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 15px;
}

.section-subtitle { font-size: 12px; opacity: 0.8; }

/* ========== AI PANEL ========== */
.ai-panel {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 16px 16px 12px;
  border: 1px solid var(--card-border);
}

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

.ai-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 15px;
}

.ai-toggle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 9, 38, 0.12);
  background: #F4FAFF;
  color: var(--text-main);
  cursor: pointer;
}

.ai-toggle:hover { background: #E7F7FF; }
.ai-panel-body { font-size: 13px; }

/* ========== LISTS ========== */
.status-list,
.clients-list,
.calls-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.status-item,
.client-item,
.call-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #F4FAFF;
}

/* Screen visibility controlled by JS inline styles */
.screen {
  display: none;
}

/* ========== DEALS (KANBAN) ========== */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.deal-column {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deal-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 4px;
}

.deal-column-count {
  background: rgba(0, 9, 38, 0.06);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
}

.deal-card {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  padding: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.deal-card:hover {
  border-color: rgba(0, 9, 38, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.deal-name { font-weight: 600; margin-bottom: 4px; }
.deal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 4px;
}
.deal-amount { font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.deal-status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  text-transform: uppercase;
}

/* ========== TELEPHONY ========== */
.calling-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.calling-card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  padding: 16px;
  text-align: center;
}

.dialpad-btn {
  padding: 16px 8px;
  font-size: 20px;
  font-weight: 600;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}

.dialpad-btn:hover { background: #f1f5f9; transform: scale(1.05); }
.dialpad-btn:active { background: #e2e8f0; transform: scale(0.98); }

.calling-value { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.calling-label { font-size: 11px; opacity: 0.8; text-transform: uppercase; }

.calling-progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 9, 38, 0.08);
  margin-top: 10px;
  overflow: hidden;
}

.calling-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ========== CLIENTS ========== */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contact-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.contact-card:hover {
  border-color: rgba(0, 9, 38, 0.4);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 10px;
}

.contact-name { font-weight: 600; margin-bottom: 4px; }
.contact-company { font-size: 12px; opacity: 0.8; margin-bottom: 6px; }
.contact-info { font-size: 12px; opacity: 0.9; line-height: 1.5; }

/* ========== MESSENGER ========== */
.messenger-grid {
  display: grid;
  grid-template-columns: 280px minmax(0,1fr);
  gap: 16px;
  height: 520px;
}

.messenger-sidebar {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.messenger-sidebar-search { padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.messenger-sidebar-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-family: inherit;
}

.messenger-list {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messenger-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.messenger-item:hover { background: #F4FAFF; }
.messenger-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(14,165,233,0.12));
  border-left: 3px solid var(--primary);
}

.messenger-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.messenger-info { flex: 1; min-width: 0; }
.messenger-name { font-weight: 600; margin-bottom: 2px; }
.messenger-preview {
  font-size: 11px;
  opacity: 0.8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.messenger-chat {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.messenger-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-bubble { display: flex; margin-bottom: 4px; }
.message-bubble.own { justify-content: flex-end; }
.message-text-bubble {
  max-width: 60%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.message-bubble:not(.own) .message-text-bubble { background: #F4FAFF; }
.message-bubble.own .message-text-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFFFFF;
}

.messenger-input {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
}

.messenger-input input {
  flex: 1;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFFFFF;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== MODALS ========== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.modal--active, .modal.active { display: flex; }

.modal-content {
  background: #FFFFFF;
  border-radius: 20px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 9, 38, 0.06);
}

.modal-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.modal-close { font-size: 22px; cursor: pointer; opacity: 0.6; }
.modal-close:hover { opacity: 1; }

.modal-body {
  padding: 20px 24px 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  font-size: 13px;
}

.modal-section-title {
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.7;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* ========== AI CHAT WIDGET ========== */
.ai-widget {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 210px;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  flex-direction: column;
  z-index: 10000;
  transition: left 0.3s ease;
}

.ai-widget.open { 
  display: flex; 
}

.ai-widget.collapsed { left: 70px; width: 340px; }

.ai-widget-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.ai-widget-header button {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.8;
}
.ai-widget-header button:hover { opacity: 1; }

.ai-widget-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.ai-msg-user {
  align-self: flex-end;
  background: #667eea;
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-msg-bot {
  align-self: flex-start;
  background: white;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ai-widget-input {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  background: white;
}

.ai-widget-input input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 12px 16px;
  outline: none;
  font-size: 14px;
}
.ai-widget-input input:focus { border-color: #667eea; }

.ai-widget-input button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-widget-input button:hover { background: #5a67d8; }

/* ========== IN PROGRESS SCREEN (NEW) ========== */
.inprogress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.lead-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lead-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.lead-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.lead-card-name { font-weight: 600; font-size: 16px; }
.lead-card-company { font-size: 12px; opacity: 0.7; }
.lead-card-phone { font-size: 14px; margin: 8px 0; }
.lead-card-source { font-size: 11px; opacity: 0.6; }

.lead-card-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.lead-card-status.new { background: #dbeafe; color: #1d4ed8; }
.lead-card-status.in_progress { background: #d1fae5; color: #047857; }
.lead-card-status.contacted { background: #d1fae5; color: #047857; }
.lead-card-status.callback { background: #fef3c7; color: #b45309; }
.lead-card-status.qualified { background: #e0e7ff; color: #4338ca; }

.lead-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.lead-action-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.lead-action-btn.call { background: var(--success); color: white; }
.lead-action-btn.call:hover { background: #059669; }
.lead-action-btn.reject { background: #fee2e2; color: var(--danger); }
.lead-action-btn.reject:hover { background: #fecaca; }
.lead-action-btn.deal { background: var(--primary); color: white; }
.lead-action-btn.deal:hover { background: #1d4ed8; }
.lead-action-btn.callback { background: var(--warning); color: white; }
.lead-action-btn.callback:hover { background: #d97706; }

/* ========== SUPERVISOR SCREEN (NEW) ========== */
.supervisor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.supervisor-panel {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.supervisor-panel-header {
  padding: 16px;
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(14,165,233,0.05));
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.supervisor-panel-title {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.supervisor-panel-body {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.control-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.control-table th {
  text-align: left;
  padding: 10px 8px;
  background: #f8fafc;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.8;
}

.control-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
}

.control-table tr:hover td { background: #f8fafc; }

.ai-log-item {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 3px solid #667eea;
}

.ai-log-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.ai-log-user { font-weight: 600; }
.ai-log-time { opacity: 0.6; }
.ai-log-query { font-size: 13px; margin-bottom: 4px; }
.ai-log-response { font-size: 12px; opacity: 0.8; }

.chat-preview-item {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-preview-item:hover { background: #e0f2fe; }

.chat-preview-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.chat-preview-name { font-weight: 600; font-size: 14px; }
.chat-preview-time { font-size: 11px; opacity: 0.6; }
.chat-preview-last { font-size: 13px; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .main-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deals-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .contacts-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .messenger-grid { grid-template-columns: 1fr; height: auto; }
  .modal-body { grid-template-columns: 1fr; }
  .supervisor-grid { grid-template-columns: 1fr; }
}
