/* Outbound Calls Allowlist */

.outbound-calls-container {
  max-width: 1400px;
  margin: 0 auto;
}

.tab-nav {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-200);
}

.tab-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-500);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--text-900);
}

.tab-btn.active {
  color: var(--brand-800);
  border-bottom-color: var(--brand-800);
}

.tab-panel.hidden {
  display: none;
}

.outbound-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-200);
}

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

.outbound-summary,
.outbound-meta {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--brand-800) 7%, var(--white));
}

.outbound-meta {
  font-size: 12px;
  color: var(--text-600);
}

.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat-chip {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-50);
  border: 1px solid var(--border-200);
}

.stat-chip strong {
  font-weight: 700;
}

.stat-chip.stat-initiated {
  background: #fef3c7;
  color: #92400e;
  border-color: #fbbf24;
}

.stat-chip.stat-answered {
  background: #dbeafe;
  color: #1e40af;
  border-color: #60a5fa;
}

.stat-chip.stat-completed {
  background: #d1fae5;
  color: #065f46;
  border-color: #34d399;
}

.stat-chip.stat-failed {
  background: #fee2e2;
  color: #991b1b;
  border-color: #f87171;
}

.stat-chip.stat-no-answer {
  background: #e5e7eb;
  color: #4b5563;
  border-color: #9ca3af;
}

.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface-50);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-200);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 220px;
}

.filter-group label {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-600);
}

.filter-group input,
.filter-group select,
.allowed-form input,
.allowed-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-300);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-900);
}

.filter-group input:focus,
.filter-group select:focus,
.allowed-form input:focus,
.allowed-form textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand-800) 40%, var(--border-200));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-800) 12%, transparent);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.allowed-table {
  width: 100%;
  border-collapse: collapse;
}

.allowed-table thead {
  background: var(--surface-50);
}

.allowed-table th,
.allowed-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-200);
  vertical-align: top;
}

.allowed-table tbody tr:hover {
  background: var(--surface-50);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-active {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-dispatch {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.status-inactive {
  background: #e5e7eb;
  color: #4b5563;
}

.status-badge.status-initiated {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.status-answered {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.status-no_answer {
  background: #e5e7eb;
  color: #4b5563;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  color: var(--text-600);
  padding: 16px;
}

.context-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-200);
}

.pagination-bar #pageInfo {
  font-size: 13px;
  color: var(--text-600);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: min(900px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-200);
}

.modal-title {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-500);
}

.allowed-form {
  padding: 24px;
}

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

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

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-row {
    flex-direction: column;
  }

  .tab-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}
