/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --black: #0a0a0a;

  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;

  --red-500: #ef4444;
  --red-50: #fef2f2;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --transition: 150ms ease;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Header ──────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

.badge {
  background: var(--teal-50);
  color: var(--teal-700);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
}

/* ─── Card ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

/* ─── Assignment List ─────────────────────────────────────── */
.assignment-list {
  min-height: 120px;
}

.assignment-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.assignment-row:last-child { border-bottom: none; }
.assignment-row:hover { background: var(--gray-50); }

.phone-number {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

.phone-country {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
  margin-top: 2px;
}

.assignment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--teal-500);
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--teal-600);
  color: var(--white);
}
.btn-primary:hover { background: var(--teal-700); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: 6px 12px;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn-danger {
  background: transparent;
  color: var(--red-500);
  padding: 6px 12px;
}
.btn-danger:hover { background: var(--red-50); }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

/* ─── Form Elements ───────────────────────────────────────── */
.select, .input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select:focus, .input:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.select-sm {
  padding: 6px 10px;
  font-size: 0.8125rem;
  width: auto;
}

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

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease-out;
  padding: 24px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.2s ease-out;
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
}

/* ─── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: slideUp 0.2s ease-out;
}

.toast.error {
  background: var(--red-500);
}

.toast.success {
  background: var(--teal-600);
}

/* ─── Utilities ───────────────────────────────────────────── */
.text-muted { color: var(--gray-400); font-size: 0.8125rem; }
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--gray-400);
  font-size: 0.875rem;
}

/* ─── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .assignment-row { grid-template-columns: 1fr; gap: 8px; }
}
