/* ============================================================
   WebReach - Outreach Automation System
   Custom Styles
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --primary: #0d6efd;
  --sidebar-bg: #111827;
  --sidebar-text: #9ca3af;
  --sidebar-active: #ffffff;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  margin: 0;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand i { font-size: 1.4rem; color: #3b82f6; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.sidebar-nav .nav-link.active {
  color: var(--sidebar-active);
  background: rgba(59,130,246,0.15);
  border-left-color: #3b82f6;
}

.sidebar-nav .nav-link i { font-size: 1rem; width: 20px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px;
}

/* ---- Topbar ---- */
.topbar {
  background: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar h4 { font-size: 1.1rem; }

/* ---- KPI Cards ---- */
.kpi-card .card-body {
  padding: 20px;
}

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.bg-primary-soft { background: rgba(13,110,253,0.12); }
.bg-info-soft    { background: rgba(13,202,240,0.12); }
.bg-warning-soft { background: rgba(255,193,7,0.12); }
.bg-success-soft { background: rgba(25,135,84,0.12); }
.bg-danger-soft  { background: rgba(220,53,69,0.12); }

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  color: #111827;
}

.kpi-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

/* ---- Tables ---- */
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #6b7280;
}

.table td { font-size: 0.875rem; vertical-align: middle; }

/* ---- Badges ---- */
.badge { font-weight: 500; }

/* ---- Small buttons ---- */
.btn-xs {
  padding: 2px 8px;
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ---- Conversation thread ---- */
.conversation-thread {
  max-height: 600px;
  overflow-y: auto;
  background: #fafafa;
  border-radius: 0 0 8px 8px;
}

/* ---- Cards ---- */
.card { border-radius: 12px !important; }
.card-header { border-radius: 12px 12px 0 0 !important; }

/* ---- Forms ---- */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background: #2563eb; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* ---- Pagination ---- */
.page-link { border-radius: 6px !important; margin: 0 2px; font-size: 0.85rem; }

/* ---- Alerts ---- */
.alert { border-radius: 10px; border: none; }

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
}

/* ---- Spinner overlay ---- */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ---- Code font ---- */
code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #dc2626;
}
