/* ============================================================
   Sweetcheeks CRM — Component Styles
   Pink/Purple brand palette
   ============================================================ */

:root {
  --sc-pink:       #E91E8F;
  --sc-pink-light: #FFECF8;
  --sc-plum:       #4A174B;
  --sc-plum-dark:  #2D0A30;
  --sc-gold:       #D4AF37;
  --sc-muted:      #7B4A8B;
  --sc-border:     rgba(233,30,143,0.15);
  --sc-radius:     12px;
  --sc-shadow:     0 6px 30px rgba(45,10,48,0.12);
}

/* ── Shared utility ── */
.sc-crm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all 0.22s ease;
}
.sc-crm-btn--primary {
  background: var(--sc-pink);
  color: #fff !important;
  border-color: var(--sc-pink);
  box-shadow: 0 6px 24px rgba(233,30,143,0.30);
}
.sc-crm-btn--primary:hover {
  background: #d0187f;
  border-color: #d0187f;
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(233,30,143,0.40);
}
.sc-crm-btn--outline {
  background: transparent;
  border-color: var(--sc-pink);
  color: var(--sc-pink) !important;
}
.sc-crm-btn--outline:hover { background: var(--sc-pink-light); }
.sc-crm-btn--lg { padding: 16px 36px; font-size: 1rem; }
.sc-crm-link { background: none; border: none; cursor: pointer; color: var(--sc-pink); text-decoration: underline; font-size: inherit; padding: 0; }
.sc-crm-link--muted { color: var(--sc-muted); }

/* ── Step wizard layout ── */
.sc-crm-step-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.sc-crm-step-card {
  background: #fff;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  padding: 40px 44px;
  box-shadow: var(--sc-shadow);
  text-align: center;
}
.sc-crm-step-card--wide { max-width: 640px; text-align: left; }
.sc-crm-step-icon { font-size: 2.8rem; margin-bottom: 10px; }
.sc-crm-step-card h2 { color: var(--sc-plum-dark); margin: 0 0 8px; font-size: 1.5rem; }
.sc-crm-step-card .sc-crm-subtitle { color: var(--sc-muted); margin-bottom: 28px; line-height: 1.7; }

/* ── Step indicator ── */
.sc-crm-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 28px;
}
.sc-crm-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sc-crm-step__bubble {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #EDCAE8;
  color: var(--sc-plum);
  font-weight: 700;
  font-size: 0.85rem;
}
.sc-crm-step--active .sc-crm-step__bubble { background: var(--sc-pink); color: #fff; }
.sc-crm-step--done   .sc-crm-step__bubble { background: var(--sc-plum); color: #fff; }
.sc-crm-step__label { font-size: 0.72rem; color: var(--sc-muted); white-space: nowrap; }
.sc-crm-step--active .sc-crm-step__label { color: var(--sc-pink); font-weight: 600; }
.sc-crm-step__line {
  flex: 1;
  height: 2px;
  background: #EDCAE8;
  min-width: 40px;
  margin: 0 2px;
  transform: translateY(-10px);
}
.sc-crm-step__line--done { background: var(--sc-plum); }

/* ── OTP digit grid ── */
.sc-crm-otp-grid {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0 20px;
}
.sc-crm-otp-digit {
  width: 52px;
  height: 60px;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid #EDCAE8;
  border-radius: 10px;
  color: var(--sc-plum-dark);
  background: #FFF0F8;
  transition: border-color 0.2s;
}
.sc-crm-otp-digit:focus {
  outline: none;
  border-color: var(--sc-pink);
  box-shadow: 0 0 0 3px rgba(233,30,143,0.12);
}
.sc-crm-otp-digit.sc-filled { border-color: var(--sc-pink); background: #fff; }
.sc-crm-resend { font-size: 0.85rem; color: var(--sc-muted); margin-top: 16px; }

/* ── Success state ── */
.sc-crm-success { text-align: center; padding: 16px 0; }
.sc-crm-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sc-pink), var(--sc-plum));
  color: #fff; font-size: 1.8rem; font-weight: 700;
  margin-bottom: 12px;
}

/* ── Form fields ── */
.sc-crm-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #EDCAE8;
  border-radius: var(--sc-radius);
  font-size: 0.95rem;
  color: var(--sc-plum-dark);
  background: #FFF0F8;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sc-crm-input:focus {
  outline: none;
  border-color: var(--sc-pink);
  box-shadow: 0 0 0 3px rgba(233,30,143,0.10);
  background: #fff;
}
.sc-crm-textarea { resize: vertical; min-height: 100px; }
.sc-crm-field-row { margin-bottom: 18px; }
.sc-crm-field-row label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--sc-plum-dark); margin-bottom: 6px; }
.sc-field-hint { font-size: 0.78rem; color: var(--sc-muted); margin-top: 4px; }

/* ── Communication channel picker ── */
.sc-crm-comm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0 24px;
}
.sc-crm-comm-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 2px solid #EDCAE8;
  border-radius: var(--sc-radius);
  cursor: pointer;
  transition: all 0.2s;
  background: #FFF0F8;
}
.sc-crm-comm-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.sc-crm-comm-card--active,
.sc-crm-comm-card:has(input:checked) {
  border-color: var(--sc-pink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(233,30,143,0.12);
}
.sc-crm-comm-card__label { font-weight: 600; color: var(--sc-plum-dark); font-size: 0.9rem; }
.sc-crm-comm-card--active .sc-crm-comm-card__label,
.sc-crm-comm-card:has(input:checked) .sc-crm-comm-card__label { color: var(--sc-pink); }

/* ── Toggle switches ── */
.sc-crm-toggle-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.sc-crm-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.sc-crm-toggle input { display: none; }
.sc-crm-toggle__slider {
  position: relative;
  width: 42px; height: 24px;
  background: #EDCAE8;
  border-radius: 50px;
  flex-shrink: 0;
  transition: background 0.22s;
}
.sc-crm-toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.22s;
  box-shadow: 0 2px 6px rgba(45,10,48,0.18);
}
.sc-crm-toggle input:checked + .sc-crm-toggle__slider { background: var(--sc-pink); }
.sc-crm-toggle input:checked + .sc-crm-toggle__slider::before { transform: translateX(18px); }
.sc-crm-toggle__label { font-size: 0.9rem; color: var(--sc-plum-dark); }

/* ── Messages ── */
.sc-crm-message { padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-top: 8px; }
.sc-crm-message--success { background: #e8f8e8; color: #1a5c1a; border: 1px solid #b8e6b8; }
.sc-crm-message--error   { background: #fde8f0; color: #8b0035; border: 1px solid #f4bccf; }
.sc-crm-message--info    { background: var(--sc-pink-light); color: var(--sc-plum); border: 1px solid var(--sc-border); }

.sc-crm-banner { padding: 16px 20px; border-radius: var(--sc-radius); margin-bottom: 24px; }
.sc-crm-banner--warning { background: #fff3cd; border: 1px solid #ffc107; color: #856404; }
.sc-crm-notice--info { background: var(--sc-pink-light); border: 1px solid var(--sc-border); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }

/* ── Verification badges ── */
.sc-crm-verify-status { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.sc-crm-verify-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 50px; font-size: 0.82rem; font-weight: 600;
}
.sc-crm-verify-badge--ok  { background: #e8f8e8; color: #1a5c1a; }
.sc-crm-verify-badge--no  { background: #fde8f0; color: #8b0035; }
.sc-crm-verified-badge { background: #e8f8e8; color: #1a5c1a; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; margin-left: 6px; }
.sc-crm-verify-link { font-size: 0.78rem; color: var(--sc-pink); margin-left: 6px; }

/* ── Prefs sections ── */
.sc-crm-prefs-section { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid #FFF0F8; }
.sc-crm-prefs-section h3 { color: var(--sc-plum-dark); margin: 0 0 14px; font-size: 1rem; }
.sc-crm-prefs-section:last-of-type { border-bottom: 0; }
.sc-crm-popia-note { font-size: 0.8rem; color: var(--sc-muted); background: var(--sc-pink-light); border: 1px solid var(--sc-border); border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; }
.sc-crm-skip { margin-top: 20px; font-size: 0.85rem; text-align: center; }

/* ── Account section wrappers ── */
.sc-crm-account-section { padding: 4px 0; }
.sc-crm-account-section h2 { color: var(--sc-plum-dark); margin-bottom: 20px; }

/* ────────────────────────────────────────────────
   ADMIN CRM STYLES
   ──────────────────────────────────────────────── */
.sc-crm-wrap { max-width: 1400px; }
.sc-crm-page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-crm-export-btn { margin-left: auto; }
.sc-crm-logo { font-size: 1.4rem; }

.sc-crm-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.sc-crm-search-input, .sc-crm-select {
  padding: 8px 12px;
  border: 2px solid #EDCAE8;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--sc-plum-dark);
  background: #FFF0F8;
}
.sc-crm-search-input { min-width: 220px; }
.sc-crm-search-input:focus, .sc-crm-select:focus { outline: none; border-color: var(--sc-pink); }

/* ── Admin table ── */
.sc-crm-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--sc-radius); overflow: hidden; box-shadow: var(--sc-shadow); }
.sc-crm-table thead tr { background: var(--sc-plum); }
.sc-crm-table thead th { color: #fff; padding: 12px 14px; text-align: left; font-size: 0.85rem; font-weight: 600; border: none; }
.sc-crm-table tbody tr { border-bottom: 1px solid #FFF0F8; transition: background 0.15s; }
.sc-crm-table tbody tr:hover { background: var(--sc-pink-light); }
.sc-crm-table tbody td { padding: 10px 14px; font-size: 0.85rem; color: var(--sc-plum-dark); vertical-align: middle; }

/* ── Dots / badges ── */
.sc-crm-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; margin: 0 2px; }
.sc-crm-dot--green { background: #d4edda; color: #155724; }
.sc-crm-dot--red   { background: #f8d7da; color: #721c24; }
.sc-crm-dot--grey  { background: #f0f0f0; color: #888; }

.sc-crm-badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.sc-crm-badge--email     { background: #d0e8ff; color: #0a3d7a; }
.sc-crm-badge--whatsapp  { background: #dcf8c6; color: #075e54; }
.sc-crm-badge--sms       { background: #fff3cd; color: #856404; }
.sc-crm-badge--phone     { background: #e8d4ff; color: #4a0080; }
.sc-crm-badge--new       { background: #cce5ff; color: #004085; }
.sc-crm-badge--processing { background: #fff3cd; color: #856404; }
.sc-crm-badge--completed  { background: #d4edda; color: #155724; }
.sc-crm-badge--cancelled  { background: #f8d7da; color: #721c24; }

.sc-crm-wa-link { font-size: 1.1rem; text-decoration: none; }
.sc-crm-verify-col { white-space: nowrap; }

/* ── Customer detail layout ── */
.sc-crm-detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; margin-top: 20px; }
.sc-crm-card { background: #fff; border: 1px solid #EDCAE8; border-radius: var(--sc-radius); padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(45,10,48,0.06); }
.sc-crm-card h3 { color: var(--sc-plum-dark); margin: 0 0 16px; font-size: 1rem; border-bottom: 2px solid #FFF0F8; padding-bottom: 8px; }

.sc-crm-info-table { width: 100%; border-collapse: collapse; }
.sc-crm-info-table th { text-align: left; padding: 8px 0; color: var(--sc-muted); font-size: 0.8rem; font-weight: 600; width: 42%; }
.sc-crm-info-table td { padding: 8px 0; color: var(--sc-plum-dark); font-size: 0.88rem; border-bottom: 1px solid #FFF0F8; }

.sc-crm-verify-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #FFF0F8; }
.sc-crm-verify-row strong { font-size: 0.9rem; }
.sc-crm-verify-row small { color: var(--sc-muted); flex: 1; }

.sc-crm-note { background: #FFF0F8; border: 1px solid var(--sc-border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.sc-crm-note p { margin: 0 0 4px; font-size: 0.88rem; color: var(--sc-plum-dark); }
.sc-crm-note small { color: var(--sc-muted); font-size: 0.78rem; }
.sc-crm-add-note { margin-top: 14px; }
.sc-crm-add-note .sc-crm-input { margin-bottom: 10px; }

.sc-crm-orders-table td, .sc-crm-orders-table th { font-size: 0.85rem; }
.sc-crm-empty { color: var(--sc-muted); font-style: italic; font-size: 0.88rem; }

/* ── Modal ── */
.sc-crm-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(45,10,48,0.55);
  display: flex; align-items: center; justify-content: center;
}
.sc-crm-modal__inner {
  background: #fff;
  border-radius: var(--sc-radius);
  padding: 32px;
  min-width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(45,10,48,0.30);
}
.sc-crm-modal__inner h3 { margin: 0 0 16px; color: var(--sc-plum-dark); }
.sc-crm-modal__actions { display: flex; gap: 10px; margin-top: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sc-crm-step-card { padding: 24px 20px; }
  .sc-crm-otp-digit { width: 42px; height: 52px; font-size: 1.4rem; }
  .sc-crm-comm-grid { grid-template-columns: 1fr 1fr; }
  .sc-crm-detail-grid { grid-template-columns: 1fr; }
  .sc-crm-step-wrap { padding: 16px 8px 40px; }
}
@media (max-width: 480px) {
  .sc-crm-comm-grid { grid-template-columns: 1fr; }
  .sc-crm-otp-grid { gap: 6px; }
  .sc-crm-otp-digit { width: 38px; height: 46px; }
}
