@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background-color: #f7f7f8;
  color: #111827;
  margin: 0;
  font-size: 14px;
}

/* ── Layout ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid #e5e7eb;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: #111827;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
}

.sidebar-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  padding: 8px 10px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #374151;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
  margin-bottom: 1px;
}

.sidebar-link i { font-size: 15px; opacity: 0.75; }

.sidebar-link:hover {
  background: #f3f4f6;
  color: #111827;
}

.sidebar-link.active {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
}

.sidebar-link.active i { opacity: 1; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid #e5e7eb;
}

/* ── Main content ── */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.4px;
  margin: 0 0 2px;
}

.page-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* ── Cards ── */
.vapi-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

/* ── Stat cards ── */
.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: #f0fdf4; color: #22c55e; }
.stat-icon.purple { background: #faf5ff; color: #a855f7; }
.stat-icon.orange { background: #fff7ed; color: #f97316; }
.stat-icon.teal   { background: #f0fdfa; color: #14b8a6; }
.stat-icon.dark   { background: #f9fafb; color: #374151; }

/* ── Tables ── */
.vapi-table {
  width: 100%;
  border-collapse: collapse;
}

.vapi-table th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.vapi-table td {
  padding: 11px 14px;
  color: #374151;
  font-size: 13.5px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.vapi-table tr:last-child td { border-bottom: none; }
.vapi-table tr:hover td { background: #f9fafb; }

/* ── Badges ── */
.vapi-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  gap: 5px;
}

.vapi-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-running   { background: #f0fdf4; color: #16a34a; }
.badge-draft     { background: #f9fafb; color: #6b7280; }
.badge-paused    { background: #fffbeb; color: #d97706; }
.badge-completed { background: #f0f9ff; color: #0369a1; }
.badge-scheduled { background: #faf5ff; color: #7c3aed; }
.badge-archived   { background: #f3f4f6; color: #9ca3af; }
.badge-cancelled  { background: #fef2f2; color: #dc2626; }

/* call_status badges */
.badge-registered         { background: #f0fdf4; color: #16a34a; }
.badge-agreed             { background: #f0f9ff; color: #0369a1; }
.badge-refused            { background: #fef2f2; color: #dc2626; }
.badge-callback_requested { background: #fffbeb; color: #d97706; }
.badge-voicemail          { background: #f9fafb; color: #6b7280; }
.badge-no_answer          { background: #fff7ed; color: #c2410c; }
.badge-failed             { background: #fef2f2; color: #dc2626; }
/* call technical status badges */
.badge-answered  { background: #f0fdf4; color: #16a34a; }
.badge-dialing   { background: #faf5ff; color: #7c3aed; }
.badge-failed    { background: #fef2f2; color: #dc2626; }
.badge-pending   { background: #f9fafb; color: #6b7280; }

/* ── Buttons ── */
.btn-vapi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-vapi-primary {
  background: #111827;
  color: #ffffff;
}
.btn-vapi-primary:hover { background: #1f2937; color: #fff; }

.btn-vapi-secondary {
  background: #ffffff;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.btn-vapi-secondary:hover { background: #f9fafb; color: #111827; }

.btn-vapi-success  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.btn-vapi-warning  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.btn-vapi-danger   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-vapi-info     { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }

.btn-vapi-success:hover { background: #dcfce7; color: #15803d; }
.btn-vapi-warning:hover { background: #fef3c7; color: #b45309; }
.btn-vapi-danger:hover  { background: #fee2e2; color: #b91c1c; }

/* ── Alert banner ── */
.vapi-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
}

.vapi-alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.vapi-alert-info    { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.vapi-alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

/* ── Forms ── */
.vapi-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vapi-input:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107,114,128,0.1);
}

.vapi-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 5px;
}

/* ── Modal ── */
.modal-content {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-header {
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 20px;
}

.modal-title { font-size: 15px; font-weight: 600; }
.modal-footer { border-top: 1px solid #e5e7eb; padding: 12px 20px; }

/* ── Progress / Funnel ── */
.funnel-row { margin-bottom: 14px; }
.funnel-label { font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 5px; }
.funnel-bar-wrap { background: #f3f4f6; border-radius: 6px; height: 10px; overflow: hidden; }
.funnel-bar-fill { height: 100%; border-radius: 6px; background: #111827; transition: width 0.4s ease; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }
