/* ==========================================================================
   BizConnect - "Meet. Connect. Save. Share."
   Modern, clean SaaS-style theme (Bootstrap 5 + custom styles)
   ========================================================================== */

:root {
  --bc-primary:       #4f46e5;
  --bc-primary-dark:  #4338ca;
  --bc-primary-soft:  #eef2ff;
  --bc-accent:        #0ea5e9;
  --bc-whatsapp:      #25d366;
  --bc-whatsapp-dark: #1eb457;
  --bc-danger:        #dc2626;
  --bc-success:       #16a34a;
  --bc-ink:           #0f172a;
  --bc-slate:         #64748b;
  --bc-muted:         #94a3b8;
  --bc-border:        #e2e8f0;
  --bc-bg:            #f1f5f9;
  --bc-card:          #ffffff;
  --bc-radius:        14px;
  --bc-shadow:        0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --bc-shadow-lg:     0 12px 32px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bc-bg);
  color: var(--bc-ink);
  font-size: 15px;
  line-height: 1.6;
}

a { text-decoration: none; }

/* ---- Brand -------------------------------------------------------------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--bc-primary), var(--bc-accent));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.brand-text {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--bc-ink);
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--bc-slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---- Top navbar --------------------------------------------------------- */
.bc-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bc-border);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.bc-navbar .nav-link {
  color: var(--bc-slate);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  margin-right: 0.15rem;
}

.bc-navbar .nav-link:hover { color: var(--bc-primary); }

.bc-navbar .nav-link.active {
  color: var(--bc-primary);
  background: var(--bc-primary-soft);
}

/* ---- Cards -------------------------------------------------------------- */
.card {
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  box-shadow: var(--bc-shadow);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--bc-border);
  font-weight: 700;
}

.card-title { font-weight: 700; letter-spacing: -0.01em; }

/* ---- Stat cards --------------------------------------------------------- */
.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  box-shadow: var(--bc-shadow);
  background: var(--bc-card);
  padding: 1.25rem 1.4rem;
  height: 100%;
}

.stat-card .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.25rem;
}

.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--bc-ink);
  line-height: 1.1;
}

.stat-card .stat-label {
  color: var(--bc-slate);
  font-size: 0.85rem;
  font-weight: 600;
}

.bg-icon-indigo  { background: #eef2ff; color: #4f46e5; }
.bg-icon-green   { background: #ecfdf5; color: #059669; }
.bg-icon-blue    { background: #eff6ff; color: #2563eb; }
.bg-icon-amber   { background: #fffbeb; color: #d97706; }
.bg-icon-whatsapp{ background: #e7f9ef; color: #128c4b; }

.text-whatsapp { color: #128c4b; }

/* ---- Buttons ------------------------------------------------------------ */
.btn { border-radius: 10px; font-weight: 600; }

.btn-primary {
  background: var(--bc-primary);
  border-color: var(--bc-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--bc-primary-dark);
  border-color: var(--bc-primary-dark);
}

.btn-whatsapp {
  background: var(--bc-whatsapp);
  border-color: var(--bc-whatsapp);
  color: #fff;
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
  background: var(--bc-whatsapp-dark);
  border-color: var(--bc-whatsapp-dark);
  color: #fff;
}

.btn-outline-light-wa {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn-outline-light-wa:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

.btn-soft {
  background: var(--bc-primary-soft);
  color: var(--bc-primary);
}
.btn-soft:hover { background: #e0e7ff; color: var(--bc-primary-dark); }

/* ---- Forms -------------------------------------------------------------- */
.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--bc-border);
  padding: 0.6rem 0.85rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--bc-primary);
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.12);
}

.form-label { font-weight: 600; font-size: 0.88rem; color: var(--bc-ink); }

.required-dot { color: var(--bc-danger); }

.form-text { font-size: 0.8rem; }

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

.alert-dismissible .btn-close { font-size: 0.8rem; }

/* ---- Tables ------------------------------------------------------------- */
.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bc-slate);
  border-bottom-width: 1px;
  font-weight: 700;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  border-color: var(--bc-border);
}

.contact-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: var(--bc-primary);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.contact-name { font-weight: 700; color: var(--bc-ink); }
.contact-sub { font-size: 0.8rem; color: var(--bc-slate); }

.phone-mono { font-variant-numeric: tabular-nums; }

/* ---- Login / auth pages -------------------------------------------------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(79, 70, 229, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(14, 165, 233, 0.16), transparent 55%),
    var(--bc-bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--bc-border);
  border-radius: 20px;
  box-shadow: var(--bc-shadow-lg);
  background: #fff;
}

.auth-card .card-body { padding: 2.2rem 2.2rem 1.6rem; }

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.6rem;
}

.auth-brand .brand-mark { width: 52px; height: 52px; font-size: 24px; border-radius: 15px; }
.auth-brand .brand-text { font-size: 1.5rem; margin-top: 0.75rem; }
.auth-brand .brand-tagline { margin-top: 0.2rem; }

/* ---- Empty states ------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--bc-slate);
}
.empty-state .empty-icon {
  font-size: 3rem;
  color: var(--bc-muted);
  opacity: 0.5;
}
.empty-state h4 { color: var(--bc-ink); font-weight: 700; margin-top: 0.75rem; }

/* ---- WhatsApp callout / message preview --------------------------------- */
.wa-preview {
  background: #e7f9ef;
  border: 1px solid #b7ecd0;
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: #14532d;
}

/* ---- Detail list (view contact / profile) -------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.9rem 1.2rem;
}

.detail-grid .d-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bc-muted);
  padding-top: 0.1rem;
}

.detail-grid .d-value {
  color: var(--bc-ink);
  font-weight: 500;
  word-break: break-word;
}

/* ---- Footer ------------------------------------------------------------- */
.bc-footer {
  color: var(--bc-muted);
  font-size: 0.82rem;
  padding: 1.4rem 0 2rem;
  text-align: center;
}

/* ---- Misc helpers ------------------------------------------------------- */
.page-heading h1 { font-weight: 800; letter-spacing: -0.02em; }
.page-heading .lead { color: var(--bc-slate); }

.badge-soft {
  background: var(--bc-primary-soft);
  color: var(--bc-primary-dark);
  font-weight: 600;
}

.pagination .page-link {
  border-radius: 9px;
  margin: 0 2px;
  color: var(--bc-slate);
  border-color: var(--bc-border);
}
.pagination .page-item.active .page-link {
  background: var(--bc-primary);
  border-color: var(--bc-primary);
}

.search-box .input-group-text { border-radius: 10px 0 0 10px; border-color: var(--bc-border); }
.search-box .form-control { border-radius: 0 10px 10px 0; border-left: 0; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 767.98px) {
  .detail-grid { grid-template-columns: 1fr; gap: 0.25rem 0; }
  .detail-grid .d-value { margin-bottom: 0.9rem; }
  .stat-card .stat-value { font-size: 1.6rem; }
  .table-responsive { border-radius: var(--bc-radius); }
}

@media (max-width: 575.98px) {
  .btn { width: 100%; }
  .btn + .btn { margin-top: 0.4rem; }
  .d-flex .btn + .btn { margin-top: 0; }
}

/* ==========================================================================
   BizConnect extras - plans, connection status, wizard
   ========================================================================== */

/* ---- Plan badges -------------------------------------------------------- */
.plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-badge-free {
  background: #e2e8f0;
  color: #475569;
}

.plan-badge-premium {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

/* ---- Connection / status badges ------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-connected { background: #dcfce7; color: #15803d; }
.status-not_connected { background: #e2e8f0; color: #475569; }
.status-error { background: #fee2e2; color: #b91c1c; }
.status-active { background: #dcfce7; color: #15803d; }
.status-expired { background: #fee2e2; color: #b91c1c; }
.status-cancelled { background: #e2e8f0; color: #475569; }

.status-icon-connected {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.25rem;
  background: #dcfce7; color: #15803d;
}
.status-icon-not_connected {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.25rem;
  background: #e2e8f0; color: #475569;
}
.status-icon-error {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.25rem;
  background: #fee2e2; color: #b91c1c;
}

.bg-icon-danger { background: #fee2e2; color: #b91c1c; }
.bg-icon-slate  { background: #e2e8f0; color: #475569; }

/* ---- Plan comparison cards ----------------------------------------------- */
.plan-compare {
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.plan-compare-active {
  border-color: var(--bc-primary);
  background: var(--bc-primary-soft);
}

/* ---- Setup wizard steps -------------------------------------------------- */
.setup-steps {
  list-style: none;
  counter-reset: setup;
  padding-left: 0;
}

.setup-steps li {
  position: relative;
  padding: 0 0 1.4rem 3rem;
  border-left: 2px solid var(--bc-border);
  margin-left: 1.15rem;
}

.setup-steps li:last-child {
  border-left: 2px solid transparent;
  padding-bottom: 0;
}

.setup-steps li::before {
  counter-increment: setup;
  content: counter(setup);
  position: absolute;
  left: -1.15rem;
  top: 0;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--bc-primary-soft);
  color: var(--bc-primary-dark);
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bc-primary);
}

.step-title {
  display: block;
  font-weight: 700;
  color: var(--bc-ink);
}

.step-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--bc-slate);
}
