/* Общие стили и переменные */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --secondary-color: #6b7280;
  --accent-color: #e5e7eb;
  --success-color: #22c55e;
  --error-color: #ef4444;
  --info-color: #06b6d4;
  --bg-primary: #f9fafb;
  --bg-secondary: #f3f4f6;
  --bg-white: #ffffff;
  --bg-dark: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-white: #ffffff;
  --border-color: #d1d5db;
  --border-light: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --transition: all 0.2s ease-in-out;
  --transition-fast: all 0.1s ease-in-out;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 6px;
}

.status-label {
  font-weight: 600;
  color: #555;
}

.status-value {
  color: #333;
  font-family: monospace;
}

.email-conversation {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-section {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.message-section h3 {
  margin: 0;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  font-size: 16px;
}

.message-content {
  padding: 16px;
  background: white;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.no-data {
  color: #999;
  font-style: italic;
  margin: 0;
}

.loading-text {
  color: #666;
  text-align: center;
  padding: 20px;
}

#aiEmailAnalysisContent {
  padding: 16px;
  line-height: 1.6;
}

/* Расширение поля title */
.title-cell {
  min-width: 200px;
  max-width: 300px;
  width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Опционально: показывать полный текст при наведении */
.title-cell:hover {
  white-space: normal;
  overflow: visible;
  word-wrap: break-word;
  position: relative;
  z-index: 1;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 5px;
  border-radius: 4px;
}

/* Focus Styles */
button:focus,
.nav-item:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

#importSheetModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: none;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1000;
}

#importSheetModal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

#importSheetModal h2 {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  margin: 0;
  padding: 24px 32px;
  border-radius: 16px 16px 0 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
}

/* Основной контент */
#importSheetModal form {
  padding: 32px;
}

.table-type-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background: #f8fafc;
  padding: 4px;
  border-radius: 12px;
}

.table-type-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-type-btn:hover {
  color: #475569;
  background: white;
}

.table-type-btn.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Icons (using Unicode symbols) */
.icon-dashboard::before {
  content: "⊞";
}
.icon-users::before {
  content: "👥";
}
.icon-projects::before {
  content: "📋";
}
.icon-analytics::before {
  content: "📊";
}
.icon-settings::before {
  content: "⚙️";
}
.icon-help::before {
  content: "❓";
}
.icon-search::before {
  content: "🔍";
}
.icon-messages::before {
  content: "💬";
}
.icon-calendar::before {
  content: "📅";
}
.icon-files::before {
  content: "📁";
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Контейнер авторизации */
#authContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-secondary);
  padding: 24px;
  position: relative;
}

/* Основной контент */
#mainContent {
  display: none;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

/* sidebar styles moved to shared.css */

.search-provider-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.provider-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.provider-tab {
  padding: 12px 24px;
  background: #2d3748;
  border: 2px solid #4a5568;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.provider-tab.active {
  background: #63b3ed;
  border-color: #63b3ed;
  color: #1a202c;
}

.provider-tab:hover:not(.active) {
  background: #4a5568;
  border-color: #63b3ed;
}

.provider-tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.provider-tab-btn.active {
  border-bottom-color: #007bff;
  color: #007bff;
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.search-provider-content {
  display: none;
}

.search-provider-content.active {
  display: block;
}


.content-header {
  background: white;
  padding: 15px 30px;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Page Management */
.page {
  display: none;
  padding: 30px;
  min-height: calc(100vh - 80px);
}

.page.active {
  display: block;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h1 {
  margin: 0 0 5px 0;
  font-size: 28px;
  font-weight: 700;
  color: #2d3748;
}

.page-header p {
  margin: 0;
  color: #718096;
  font-size: 16px;
}

.nav-text {
  font-size: 14px;
  font-weight: 500;
}

#mainContent.authenticated {
  opacity: 1;
  transform: translateY(0);
}

/* Форма авторизации */
.auth-box {
  background: var(--bg-white);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-light);
  animation: slideUp 0.5s ease-out;
}

.auth-box h1 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
}

.auth-box p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 15px;
}

/* Поля ввода */
.auth-box input,
.auth-box select,
dialog input,
dialog select,
dialog textarea {
  width: 100%;
  color: black;
  padding: 14px 16px;
  margin: 10px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-white);
  transition: var(--transition);
  outline: none;
}

.auth-box input:focus,
.auth-box select:focus,
dialog input:focus,
dialog select:focus,
dialog textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.close-btn {
  width: 100%;
  padding: 14px 16px;
  background: var(--error-color);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.close-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* Кнопки */
.auth-box button,
dialog button:not(.close-btn):not(.report-tab-btn) {
  width: 100%;
  padding: 14px 16px;
  background: var(--primary-color);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.auth-box button:hover,
dialog button:not(.close-btn):not(.report-tab-btn):hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Ошибки авторизации */
#authError {
  display: none;
  color: var(--error-color);
  margin-top: 12px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--error-color);
  font-size: 14px;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: var(--text-white);
  z-index: 1000;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  max-width: 320px;
}

.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  display: none;
}

.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  display: none;
}

#importSheetModal {
  animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.notification.success {
  background: var(--success-color);
}
.notification.error {
  background: var(--error-color);
}
.notification.show {
  animation: slideInRight 0.3s ease-out;
}

/* Заголовок текущей компании */
#currentCompany {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  padding: 12px 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#currentCompany button {
  padding: 6px 12px;
  background: var(--error-color);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

#currentCompany button:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* Call Options Modal */
#callOptionsModal {
  max-width: 500px;
  width: 90%;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
}

#callOptionsModal h2 {
  margin: 0 0 15px;
  font-size: 20px;
  color: var(--text-primary);
}

#callOptionsModal form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#callOptionsModal label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#callOptionsModal select {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: black;
  font-size: 15px;
  background: var(--bg-white);
  transition: var(--transition);
}

#callOptionsModal select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#callOptionsModal button[type="submit"] {
  background: var(--primary-color);
  color: var(--text-white);
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

#callOptionsModal button[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

#apolloSearchModal {
  background: #1a202c;
  color: #ffffff;
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.search-sections {
  display: grid;
  gap: 20px;
}

.search-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  height: calc(100vh - 200px);
}

.search-panel {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e2e8f0;
  overflow-y: auto;
}

.search-sections {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.search-section {
  background: #2d3748;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #4a5568;
}

.section-header {
  padding: 15px 20px;
  background: #4a5568;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.3s ease;
}

.section-header:hover {
  background: #5a6578;
}

.section-header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 18px;
}

.toggle-icon.expanded {
  transform: rotate(180deg);
}

.section-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.section-content.expanded {
  padding: 20px;
  max-height: 500px;
}

.results-panel {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.search-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}

#googleSheetIdInput,
#sheetNameSelect {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#googleSheetIdInput:focus,
#sheetNameSelect:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#sheetNameSelect:disabled {
  background-color: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.load-sheets-btn {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-sheets-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.sheet-status {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.info-box {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.info-box code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: "Monaco", "Menlo", monospace;
  font-size: 12px;
}

input,
select {
  padding: 12px 15px;
  background: #1a202c;
  border: 2px solid #4a5568;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

input::placeholder {
  color: #a0aec0;
}

input:focus,
select:focus {
  outline: none;
  border-color: #63b3ed;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #63b3ed;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
}

.form-actions {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.button-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.form-actions button {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary {
  background: #63b3ed;
  color: #1a202c;
}

.primary:hover {
  background: #4299e1;
  transform: translateY(-2px);
}

.secondary {
  background: transparent;
  color: #63b3ed;
  border: 2px solid #63b3ed;
}

#progressContainer {
  width: 100%;
  max-width: 600px;
  margin: 10px auto;
  position: relative;
}

#progressLabel {
  display: none;
  font-size: 14px;
  color: #ffffff;
  text-align: center;
  margin-bottom: 5px;
}

.secondary:hover {
  background: #63b3ed;
  color: #1a202c;
}

.form-actions button.primary {
  background: #4299e1;
  color: white;
}

.form-actions button.primary:hover {
  background: #3182ce;
}

.form-actions button.secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.form-actions button.secondary:hover {
  background: #cbd5e0;
}

.progress-container {
  margin-top: 20px;
}

#apolloPageProgressBar,
#coresignalPageProgressBar {
  width: 100%;
  height: 30px;
  background-color: #2d3748;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#apolloSearchResults {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
}

.results-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
}

.results-count {
  font-size: 14px;
  color: #718096;
}

.results-count strong {
  color: #4299e1;
  font-weight: 600;
}

.results-table-wrapper {
  flex: 1;
  overflow: auto;
  margin-bottom: 20px;
}

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

.results-table-wrapper th {
  background: #f7fafc;
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  color: #4a5568;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
}

.results-table-wrapper td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.results-table-wrapper tr:hover {
  background: #f8f9fa;
}

.results-table-wrapper tr.no-results td {
  text-align: center;
  color: #718096;
  padding: 40px;
  font-style: italic;
}

.results-table-wrapper input[type="checkbox"] {
  margin: 0;
}

.results-body {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.apollo-result-item {
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 8px;
  background: white;
}

.results-actions {
  display: flex;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.results-actions {
  display: flex;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.results-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.results-actions button.primary {
  background: #4299e1;
  color: white;
}

.results-actions button.primary:hover:not(:disabled) {
  background: #3182ce;
}

.results-actions button.primary:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

.results-actions button.secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.analytics-placeholder,
.settings-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: white;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
  color: #718096;
  font-size: 16px;
}

.results-actions button.secondary:hover {
  background: #cbd5e0;
}

#progressBar {
  display: none;
  width: 100%;
  height: 30px;
  background-color: #2d3748;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.progress-fill {
  width: 0%;
  height: 100%;
  background-color: #63b3ed;
  transition: width 0.3s ease;
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
#progressLabel {
  display: none;
  font-size: 14px;
  color: #ffffff;
  text-align: center;
  margin-bottom: 5px;
}
#transferToWebhookButton {
  display: none;
  padding: 10px 20px;
  background-color: #3182ce;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 10px 0;
}
#transferToWebhookButton:hover {
  background-color: #2b6cb0;
}

.unlock-email-btn {
  margin-left: 10px;
  padding: 5px 10px;
  background: #ff9800;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.unlock-email-btn:hover {
  background: #fb8c00;
}
.apollo-result-item {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 5px;
}

.results-section {
  margin-top: 20px;
  display: none;
}

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

.results-count {
  color: #a0aec0;
}

.results-body {
  background: #2d3748;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  min-height: 100px;
}

.results-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}
#apolloSearchResults {
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 4px;
}

.checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.checkboxes label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #495057;
  cursor: pointer;
}

/* Блок поиска */
.search-box {
  background: var(--bg-white);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.search-box:hover {
  box-shadow: var(--shadow-md);
}

.search-box h2 {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}

.search-box p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
}

.search-box input {
  padding: 10px 14px;
  margin: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
  background: var(--bg-white);
  min-width: 180px;
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.search-box button {
  padding: 10px 16px;
  margin: 6px;
  background: var(--primary-color);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.search-box button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.result-item {
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
}

.details {
  margin-top: 10px;
  padding-left: 20px;
}

.result-item button {
  margin-top: 5px;
  padding: 5px 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.result-item button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Таблица */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
  z-index: 10;
}

tbody tr:hover {
  background: var(--bg-primary);
}

.buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

/* Кнопки действий */
.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
#paginationDiv {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
#paginationDiv button {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background-color: #ffffff;
  color: #2d3748;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}
#paginationDiv button:disabled {
  background-color: #edf2f7;
  color: #a0aec0;
  cursor: not-allowed;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.action-buttons button {
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-call,
.btn-email,
.btn-report,
.btn-email-report {
  background: var(--primary-color);
  color: var(--text-white);
}

.link {
  color: var(--primary-color);
}

.action-buttons button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Статусы */
.status-confirmed {
  color: var(--success-color);
  font-weight: 500;
}
.status-confirmed::before {
  content: "✓";
  margin-right: 3px;
}
.status-pending {
  color: #f59e0b;
  font-weight: 500;
}
.status-pending::before {
  content: "⏳";
  margin-right: 3px;
}
.status-failed {
  color: var(--error-color);
  font-weight: 500;
}
.status-failed::before {
  content: "✗";
  margin-right: 3px;
}

/* Модальные окна */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  max-height: 80vh;
  width: 90%;
  max-width: 550px;
  overflow-y: auto;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--bg-white);
  padding: 24px;
  display: none;
}

dialog[open] {
  display: block;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.btn-clear-unfit {
  background: #f44336;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin: 2px;
  font-size: 12px;
}

.btn-clear-unfit:hover {
  background: #d32f2f;
}

.filter-employees-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 6px;
  font-size: 14px;
}

dialog#sendEmailModal {
  width: 40%;
}

.remove-employees-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 6px;
  font-size: 14px;
}

.remove-employees-btn:hover {
  background: #d32f2f;
}

.remove-range-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 6px;
  font-size: 14px;
}

.remove-range-btn:hover {
  background: #d32f2f;
}

#rangeRemoveModal input[type="number"] {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#rangeRemoveModal button {
  background: #2196f3;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
}

#rangeRemoveModal button:hover {
  background: #1976d2;
}

#rangeRemoveModal button[type="button"] {
  background: #f44336;
}

#rangeRemoveModal button[type="button"]:hover {
  background: #d32f2f;
}

.filter-employees-btn:hover {
  background: #1976d2;
}

/* Вкладки отчета */
.report-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 15px;
}

.report-tab-btn {
  padding: 10px 20px;
  border: none;
  background: #f7fafc;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.report-tab-btn.active {
  background: #3b82f6;
  color: white;
}

.report-tab-btn:hover {
  background: #e2e8f0;
}

.report-tab-btn.active:hover {
  background: #2563eb;
}

.report-content {
  display: none;
}

.report-content.active {
  display: block;
}

/* Стили для аудио плеера */
.audio-player {
  width: 100%;
  margin: 20px 0;
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Пагинация */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  gap: 10px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
}

.pagination button:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

#pageInfo {
  padding: 8px 16px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Загрузка */
#loadingDiv {
  display: none;
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
}

#loadingDiv.show {
  display: block;
}

/* Статистика */
#statsDiv {
  margin: 16px 0;
  padding: 12px 20px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

dialog#emailAnalysisModal {
  width: 80%;
  max-width: 900px;
  border: none;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: #fff;
}
dialog#emailAnalysisModal h2 {
  margin: 0 0 15px;
  font-size: 24px;
  color: #333;
}

#callProgressModal {
  max-width: 600px;
  width: 90%;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
  color: #63b3ed;
}

.provider-selection {
  margin-bottom: 25px;
  text-align: center;
}

#callProgressModal h2 {
  margin: 0 0 15px;
  font-size: 20px;
  color: #333;
}

#callProgressModal .progress-bar {
  background: #e9ecef;
  border-radius: 4px;
  height: 10px;
  margin: 10px 0;
}

#callProgressModal .progress {
  background: #4caf50;
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.3s ease;
}

#callProgressModal .log-container {
  max-height: 200px;
  overflow-y: auto;
  background: #f8f9fa;
  padding: 10px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 10px;
}

.report-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.report-tab-btn {
  padding: 8px 16px;
  border: none;
  background: #f1f3f5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
}
.report-tab-btn.active {
  background: #4caf50;
  color: #fff;
}
.report-content {
  display: none;
}
.report-content.active {
  display: block;
}
#resultAnalysisContent {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
  color: #495057;
  min-height: 100px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}
th {
  background: #f1f3f5;
  font-weight: bold;
  color: #495057;
}
.status-confirmed {
  color: #4caf50;
  font-weight: bold;
}
.status-failed {
  color: #f44336;
  font-weight: bold;
}
.status-pending {
  color: #ffc107;
  font-weight: bold;
}
button[onclick="closeEmailAnalysisModal()"] {
  margin-top: 15px;
  padding: 8px 16px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.user-info {
  margin-bottom: 15px;
}

/* Адаптивность */
@media (max-width: 1200px) {
  #mainContent {
    padding: 16px;
  }
  .search-box {
    padding: 20px;
  }
  .search-box input {
    min-width: 140px;
  }
}

@media (max-width: 768px) {
  .auth-box {
    padding: 24px 16px;
    margin: 16px;
  }
  #mainContent {
    padding: 12px;
  }
  .search-box {
    padding: 16px;
  }
  .search-box input,
  .search-box button {
    width: 100%;
    margin: 4px 0;
  }
  table {
    font-size: 11px;
  }
  th,
  td {
    padding: 6px 4px;
  }
  .action-buttons {
    flex-direction: column;
    gap: 3px;
  }
  .action-buttons button {
    width: 100%;
    padding: 5px 6px;
    font-size: 10px;
  }
  .pagination {
    flex-wrap: wrap;
    gap: 6px;
  }
  .pagination button {
    padding: 6px 10px;
    font-size: 11px;
  }
  #currentCompany {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  dialog {
    width: 95%;
    max-width: none;
    padding: 16px;
  }
  .notification {
    right: 8px;
    left: 8px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .auth-box {
    padding: 20px 12px;
  }
  .auth-box h1 {
    font-size: 22px;
  }
  .search-box h2 {
    font-size: 16px;
  }
  .search-box p {
    font-size: 13px;
  }
}

/* Утилиты */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.font-bold {
  font-weight: 700;
}
.font-semibold {
  font-weight: 600;
}
.font-medium {
  font-weight: 500;
}
.text-sm {
  font-size: 12px;
}
.text-base {
  font-size: 14px;
}
.text-lg {
  font-size: 15px;
}
.text-xl {
  font-size: 16px;
}
.mb-2 {
  margin-bottom: 6px;
}
.mb-4 {
  margin-bottom: 12px;
}
.mb-6 {
  margin-bottom: 20px;
}
.p-2 {
  padding: 6px;
}
.p-4 {
  padding: 12px;
}
.p-6 {
  padding: 20px;
}
