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

:root {
  --sidebar-width: 260px;
  --primary:       #FF4FA3;
  --primary-dark:  #E91E63;
  --primary-glow:  rgba(255, 79, 163, 0.25);
  --dark-bg:       #0D0816;
  --card-bg:       #160D22;
  --border-color:  #2A1540;
  --text-muted:    #8B7A9B;
}

body {
  background-color: var(--dark-bg);
  color: #F0E4F7;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, #160D22 0%, #0D0816 100%);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.4rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(255,79,163,0.1), rgba(233,30,99,0.06));
}

.sidebar-brand .brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(255,79,163,0.45);
}

.sidebar-brand h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar-brand small {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-section {
  padding: 1.1rem 0.9rem 0.4rem;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}

.sidebar .nav-link {
  color: #B89EC8;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}

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

.sidebar .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255,79,163,0.22), rgba(233,30,99,0.15));
  border: 1px solid rgba(255,79,163,0.35);
  font-weight: 600;
}

.sidebar .nav-link .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.page-body {
  padding: 1.5rem;
  flex: 1;
}

/* ── Stat Cards ────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.35rem;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

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

.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Content Cards ─────────────────────────────────────── */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
}

.content-card .card-header {
  background: linear-gradient(135deg, rgba(255,79,163,0.08), transparent);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.content-card .card-body {
  padding: 1.25rem;
}

/* ── Tables ────────────────────────────────────────────── */
.table {
  color: #F0E4F7;
  margin: 0;
}

.table thead th {
  background: rgba(255,79,163,0.06);
  border-color: var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
}

.table td {
  border-color: var(--border-color);
  padding: 0.75rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

.table tbody tr:hover td {
  background: rgba(255,79,163,0.04);
}

/* ── Forms ─────────────────────────────────────────────── */
.form-control, .form-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: #F0E4F7;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  -webkit-appearance: none;
}

.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,0.07);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #C4A0D4;
  margin-bottom: 0.4rem;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  font-weight: 600;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 3px 10px rgba(255,79,163,0.35);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff6bb5, #c2185b);
  border: none;
  box-shadow: 0 6px 20px rgba(255,79,163,0.5);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: #C4A0D4;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
}

.btn-outline-secondary:hover {
  background: rgba(255,79,163,0.08);
  color: #fff;
  border-color: var(--primary);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3em 0.65em;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
}

/* ── Status dots ────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
}

.status-dot.online     { background: #FF4FA3; box-shadow: 0 0 8px #FF4FA3; }
.status-dot.offline    { background: #ef4444; }
.status-dot.waiting    { background: #f59e0b; }
.status-dot.connecting { background: #a78bfa; animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── QR Code ────────────────────────────────────────────── */
.qr-container {
  background: #fff;
  padding: 1.5rem;
  border-radius: 16px;
  display: inline-block;
}

.qr-container img {
  max-width: 250px;
  display: block;
}

/* ── Login Page ─────────────────────────────────────────── */
.login-page {
  background: radial-gradient(ellipse at 60% 0%, rgba(255,79,163,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 10% 100%, rgba(233,30,99,0.08) 0%, transparent 50%),
              var(--dark-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(255,79,163,0.45);
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 0.875rem;
}

.alert-success { background: rgba(255,79,163,0.15); color: #f9a8d4; }
.alert-danger  { background: rgba(239,68,68,0.15);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.alert-info    { background: rgba(167,139,250,0.15);color: #c4b5fd; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5a2060; }

/* ══════════════════════════════════════════════════════════
   MOBILE — correções de overflow e layout
   ══════════════════════════════════════════════════════════ */

/* Previne scroll horizontal global */
html, body { overflow-x: hidden; max-width: 100vw; }

/* ── Sidebar mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* Backdrop escuro quando sidebar aberta */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}
.sidebar-backdrop.show { display: block; }

/* ── Top bar mobile ─────────────────────────────────────── */
@media (max-width: 640px) {
  .top-bar { padding: 0.7rem 1rem; gap: 0.5rem; }
  .top-bar-sub  { display: none !important; }
  .top-bar-title { font-size: 0.9rem; }
  .top-bar-user .d-none { display: none !important; }
  #wa-status-badge { display: none !important; }
}
/* Garante que o subtitle some no mobile mesmo em modo claro */
@media (max-width: 640px) {
  body.light-mode .top-bar-sub { display: none !important; }
}

/* ── Stat cards mobile ──────────────────────────────────── */
@media (max-width: 480px) {
  .stat-card { padding: 0.9rem; }

  .stat-card-inner { gap: 0.65rem; }

  .stat-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 1.05rem;
  }

  .stat-card .stat-value { font-size: 1.35rem; }
  .stat-card .stat-label { font-size: 0.72rem; }
  .stat-card .stat-sub   { display: none; }
}

/* ── Page body mobile ───────────────────────────────────── */
@media (max-width: 640px) {
  .page-body { padding: 1rem; }
}

/* ── Tabelas mobile ─────────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Força truncate em colunas de texto */
.table td, .table th {
  white-space: nowrap;
}

/* Coluna de mensagem pode quebrar */
.table td.text-wrap-col {
  white-space: normal;
  min-width: 120px;
  max-width: 200px;
}

@media (max-width: 640px) {
  .table td, .table th { padding: 0.55rem 0.65rem; font-size: 0.78rem; }
  .table thead th { font-size: 0.65rem; padding: 0.5rem 0.65rem; }
}

/* ── Content card header mobile ─────────────────────────── */
@media (max-width: 480px) {
  .content-card .card-header { padding: 0.75rem 1rem; font-size: 0.82rem; }
  .content-card .card-body   { padding: 0.85rem; }
}

/* ── Row/grid mobile ────────────────────────────────────── */
@media (max-width: 480px) {
  .row.g-3 { --bs-gutter-x: 0.6rem; --bs-gutter-y: 0.6rem; }
}

/* ── Login page mobile ──────────────────────────────────── */
@media (max-width: 480px) {
  .login-wrap { padding: 1.5rem 1.25rem; }
  .brand-title { font-size: 2rem; }
  .logo-icon   { width: 72px; height: 72px; margin-bottom: 1.1rem; }
}

/* ── Modal mobile ───────────────────────────────────────── */
@media (max-width: 640px) {
  .modal-dialog { margin: 0.5rem; }
  .modal-body   { padding: 1rem; }
}

/* ── Sidebar brand text overflow ────────────────────────── */
.sidebar-brand h6 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ── Messages list mobile ───────────────────────────────── */
@media (max-width: 640px) {
  /* hora badge + conteúdo empilhados em telas muito pequenas */
  .msg-row-inner { flex-wrap: wrap; }
}

/* ── Groups action buttons mobile ───────────────────────── */
@media (max-width: 640px) {
  .btn-sm { font-size: 0.72rem; padding: 0.25rem 0.55rem; }
}

/* ── Accordion mobile ───────────────────────────────────── */
@media (max-width: 640px) {
  .accordion-button { font-size: 0.82rem !important; }
}

textarea.form-control { min-height: 120px; resize: vertical; }

/* ── Media grid ─────────────────────────────────────────── */
.media-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.media-preview-item {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.media-preview-item img,
.media-preview-item video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.media-preview-item .remove-media {
  position: absolute;
  top: 2px; right: 2px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* ── Hour badge ─────────────────────────────────────────── */
.hour-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(255,79,163,0.2), rgba(233,30,99,0.15));
  border: 1px solid rgba(255,79,163,0.3);
  color: #f9a8d4;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ── Upload area ────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(255,79,163,0.05);
  color: var(--primary);
}
.upload-area input[type=file] { display: none; }

/* ── Stat card (horizontal) ──────────────────────────── */
.stat-card-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.15rem;
  letter-spacing: -0.02em;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.2;
}

.stat-card .stat-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  opacity: 0.7;
}

/* ── Status pills ─────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.success { background: rgba(37,211,102,.12); color: #25D366; }
.status-pill.danger  { background: rgba(239,68,68,.12);  color: #f87171; }
.status-pill.warning { background: rgba(245,158,11,.12); color: #f59e0b; }
.status-pill.muted   { background: rgba(255,255,255,.06);color: var(--text-muted); }
.status-pill.primary { background: rgba(255,79,163,.12); color: var(--primary); }
.status-pill.purple  { background: rgba(167,139,250,.12);color: #a78bfa; }

/* ── WA status badge (top bar) ───────────────────────── */
.wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── WA icon (dashboard card) ────────────────────────── */
.wa-status-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.wa-icon-online     { background: rgba(37,211,102,.12); color: #25D366; }
.wa-icon-offline    { background: rgba(239,68,68,.12);  color: #f87171; }
.wa-icon-connecting { background: rgba(99,102,241,.12); color: #818cf8; }

/* ── Sidebar user section ────────────────────────────── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan {
  font-size: 0.63rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  background: rgba(255,79,163,0.08);
  border: 1px solid rgba(255,79,163,0.2);
  border-radius: 9px;
  color: #FF4FA3;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  justify-content: center;
}
.btn-logout:hover {
  background: rgba(255,79,163,0.15);
  border-color: rgba(255,79,163,0.4);
}

/* ── Top bar components ──────────────────────────────── */
.top-bar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.top-bar-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,79,163,0.06);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(255,79,163,0.14);
  transform: scale(1.05);
}

.hamburger {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ── Card link ────────────────────────────────────────── */
.btn-link-primary {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s;
}
.btn-link-primary:hover { opacity: 0.7; color: var(--primary); }

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.empty-state i {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.6rem;
  opacity: 0.35;
}

/* ── Light mode additions ─────────────────────────────── */
body.light-mode .stat-card .stat-value { color: #1A0F1D; }
body.light-mode .sidebar-user { background: rgba(255,79,163,0.05); }
body.light-mode .btn-logout { background: rgba(255,79,163,0.06); }
body.light-mode .top-bar-title { color: #1A0F1D; }
body.light-mode .icon-btn { background: rgba(255,79,163,0.06); }
body.light-mode .hamburger { border-color: var(--border-color); color: #6B4F8A; }

/* ══════════════════════════════════════════════════════════
   MODO CLARO
   ══════════════════════════════════════════════════════════ */
body.light-mode {
  --dark-bg:      #F4EEF9;
  --card-bg:      #FFFFFF;
  --border-color: #E2D0EF;
  --text-muted:   #7B6890;
  background-color: var(--dark-bg);
  color: #1A0F1D;
}

/* Sidebar: mantém escura para contraste */
body.light-mode .sidebar {
  background: linear-gradient(180deg, #1E1030 0%, #0D0816 100%);
}

/* Top bar */
body.light-mode .top-bar {
  background: #FFFFFF;
  border-bottom-color: var(--border-color);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

body.light-mode .top-bar h4 { color: #1A0F1D; }

/* Cards */
body.light-mode .stat-card {
  background: #FFFFFF;
  border-color: var(--border-color);
  box-shadow: 0 2px 12px rgba(140,80,180,0.08);
}

body.light-mode .stat-card:hover {
  box-shadow: 0 8px 28px rgba(140,80,180,0.14);
}

body.light-mode .stat-card .stat-value { color: #1A0F1D; }
body.light-mode .stat-card .stat-label { color: var(--text-muted); }

body.light-mode .content-card {
  background: #FFFFFF;
  border-color: var(--border-color);
  box-shadow: 0 2px 12px rgba(140,80,180,0.07);
}

body.light-mode .content-card .card-header {
  background: linear-gradient(135deg, rgba(255,79,163,0.05), rgba(255,255,255,0));
  color: #1A0F1D;
}

/* Tabela */
body.light-mode .table { color: #1A0F1D; }

body.light-mode .table thead th {
  background: rgba(255,79,163,0.05);
  color: var(--text-muted);
}

body.light-mode .table td { border-color: var(--border-color); }

body.light-mode .table tbody tr:hover td {
  background: rgba(255,79,163,0.04);
}

/* Formulários */
body.light-mode .form-control,
body.light-mode .form-select {
  background: #F8F2FD;
  border-color: var(--border-color);
  color: #1A0F1D;
}

body.light-mode .form-control:focus,
body.light-mode .form-select:focus {
  background: #FFFFFF;
  color: #1A0F1D;
}

body.light-mode .form-control::placeholder { color: #B09CC0; }

body.light-mode .form-label { color: #6B4F8A; }

/* Input groups */
body.light-mode .input-group-text {
  background: #F0E4FA;
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* Outline button */
body.light-mode .btn-outline-secondary {
  border-color: var(--border-color);
  color: #6B4F8A;
}

body.light-mode .btn-outline-secondary:hover {
  background: rgba(255,79,163,0.08);
  color: var(--primary);
}

/* Alertas */
body.light-mode .alert-success { background: rgba(255,79,163,0.1); color: #b5006b; }
body.light-mode .alert-danger  { background: rgba(220,38,38,0.1);  color: #c00000; }
body.light-mode .alert-warning { background: rgba(217,119,6,0.1);  color: #92400e; }
body.light-mode .alert-info    { background: rgba(109,40,217,0.1); color: #4c1d95; }

/* Upload area */
body.light-mode .upload-area {
  border-color: #D8BFE8;
  color: var(--text-muted);
}

/* Hour badge */
body.light-mode .hour-badge {
  background: linear-gradient(135deg, rgba(255,79,163,0.12), rgba(233,30,99,0.08));
  color: #b5006b;
}

/* Scrollbar */
body.light-mode ::-webkit-scrollbar-thumb { background: #D8BFE8; }

/* Toggle button */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,79,163,0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255,79,163,0.18);
  transform: scale(1.05);
}

/* ════════════════════════════════════════════════════════
   DASHBOARD v2 — MOBILE-FIRST PREMIUM
═══════════════════════════════════════════════════════════ */

/* Root wrapper — forces white premium background */
.db2-root {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 1rem;
  background: #f8fafc;
  min-height: 100vh;
}
body.light-mode .db2-root { background: #f8fafc; }

/* ── Header ─────────────────────────────────────────────── */
.db2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem .75rem;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1rem;
}
.db2-header-left {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.db2-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF4FA3, #E91E63);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,79,163,.3);
}
.db2-greeting {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.db2-greeting-sub {
  font-size: .72rem;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.db2-greeting-name {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.db2-bell {
  position: relative;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
}
.db2-bell:hover { background: #fff0f7; border-color: #FF4FA3; color: #FF4FA3; }
.db2-bell-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #FF4FA3;
  border: 2px solid #fff;
}

/* ── Stat cards row ─────────────────────────────────────── */
.db2-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  padding: 0 1rem 1rem;
}
.db2-cards-3 {
  grid-template-columns: repeat(3, 1fr);
}
.db2-card {
  background: #fff;
  border-radius: 16px;
  padding: .875rem .6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  border: 1px solid #f1f5f9;
  text-align: center;
}
.db2-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.db2-card-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.db2-card-lbl {
  font-size: .62rem;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ── Section wrapper ────────────────────────────────────── */
.db2-section {
  padding: 0 1rem 1.25rem;
}
.db2-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.db2-section-title {
  font-size: .8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.db2-see-all {
  font-size: .75rem;
  font-weight: 600;
  color: #FF4FA3;
  text-decoration: none;
}
.db2-see-all:hover { text-decoration: underline; }

/* ── Activity list ──────────────────────────────────────── */
.db2-activity-list {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  border: 1px solid #f1f5f9;
}
.db2-activity-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid #f8fafc;
}
.db2-activity-item:last-child { border-bottom: none; }
.db2-activity-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.db2-activity-dot.dot-ok  { background: #f0fdf4; color: #22c55e; }
.db2-activity-dot.dot-err { background: #fff1f2; color: #f43f5e; }
.db2-activity-body {
  flex: 1;
  min-width: 0;
}
.db2-activity-main {
  font-size: .855rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db2-activity-msg {
  font-size: .76rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.db2-activity-time {
  font-size: .72rem;
  font-weight: 700;
  color: #cbd5e1;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.db2-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: .83rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

/* ── Ações rápidas ──────────────────────────────────────── */
.db2-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .625rem;
}
.db2-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: #334155;
  background: #fff;
  border-radius: 16px;
  padding: 1rem .5rem .875rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  border: 1px solid #f1f5f9;
  transition: all .18s;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
}
.db2-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255,79,163,.12);
  color: #FF4FA3;
}
.db2-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: none;
}

/* ── WhatsApp banner ────────────────────────────────────── */
.db2-wa-banner {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  text-decoration: none;
  transition: all .2s;
  border: 1.5px solid transparent;
}
.db2-wa-banner.wa-online {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #bbf7d0;
}
.db2-wa-banner.wa-offline {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: #fecdd3;
}
.db2-wa-banner:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.db2-wa-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.wa-online  .db2-wa-icon { background: #22c55e; color: #fff; }
.wa-offline .db2-wa-icon { background: #f43f5e; color: #fff; }
.db2-wa-text { flex: 1; }
.db2-wa-label {
  display: block;
  font-size: .855rem;
  font-weight: 800;
  color: #0f172a;
}
.db2-wa-sub {
  display: block;
  font-size: .75rem;
  color: #64748b;
  margin-top: 1px;
}
.db2-wa-arrow {
  color: #cbd5e1;
  font-size: .85rem;
}

/* ── Stats grid ─────────────────────────────────────────── */
.db2-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .625rem;
}
.db2-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: .9rem .5rem .8rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.db2-stat-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  background: rgba(255,255,255,.04);
}
.db2-stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}
.db2-stat-label {
  font-size: .62rem;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.3;
  text-align: center;
}

/* ── Activity list ───────────────────────────────────────── */
.db2-activity-list {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.db2-act-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f8fafc;
}
.db2-act-item:last-child { border-bottom: none; }
.db2-act-dot {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
}
.db2-act-dot.dot-ok  { background: rgba(34,197,94,.12); color: #22c55e; }
.db2-act-dot.dot-err { background: rgba(239,68,68,.12); color: #ef4444; }
.db2-act-info { flex: 1; min-width: 0; }
.db2-act-text { font-size: .78rem; font-weight: 600; color: #0f172a; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db2-act-sub  { font-size: .68rem; color: #94a3b8; display: block; }
.db2-act-time { font-size: .65rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.db2-empty    { padding: 1.25rem 1rem; font-size: .8rem; color: #94a3b8; text-align: center; }
.db2-section-link { font-size: .72rem; font-weight: 600; color: var(--primary, #FF4FA3); text-decoration: none; }
.db2-section-link:hover { opacity: .8; }

/* dark mode */
body:not(.light-mode) .db2-stat-card  { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .db2-stat-num   { color: #fff; }
body:not(.light-mode) .db2-activity-list { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .db2-act-item   { border-color: var(--border-color); }
body:not(.light-mode) .db2-act-text   { color: #fff; }

/* ── Dica do Dia ────────────────────────────────────────── */
.db2-tip-card {
  background: linear-gradient(135deg, #fff0f7 0%, #fdf2f8 100%);
  border: 1.5px solid #fce7f3;
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
}
.db2-tip-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 800;
  color: #FF4FA3;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .6rem;
}
.db2-tip-text {
  font-size: .82rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* ── Dark mode overrides for db2 ────────────────────────── */
body:not(.light-mode) .db2-root        { background: var(--dark-bg); }
body:not(.light-mode) .db2-header      { background: var(--card-bg); border-color: var(--border-color); }
body:not(.light-mode) .db2-greeting-name { color: #fff; }
body:not(.light-mode) .db2-bell        { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }
body:not(.light-mode) .db2-card        { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .db2-card-val    { color: #fff; }
body:not(.light-mode) .db2-card-icon[style*="background:#fff0f7"] { background: rgba(255,79,163,.1) !important; }
body:not(.light-mode) .db2-card-icon[style*="background:#f0fdf4"] { background: rgba(34,197,94,.1) !important; }
body:not(.light-mode) .db2-card-icon[style*="background:#fffbeb"] { background: rgba(245,158,11,.1) !important; }
body:not(.light-mode) .db2-card-icon[style*="background:#eff6ff"] { background: rgba(59,130,246,.1) !important; }
body:not(.light-mode) .db2-activity-list { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .db2-activity-item { border-color: var(--border-color); }
body:not(.light-mode) .db2-activity-main { color: #fff; }
body:not(.light-mode) .db2-action      { background: var(--card-bg); border-color: var(--border-color); color: var(--text-muted); box-shadow: none; }
body:not(.light-mode) .db2-wa-banner.wa-online  { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.2); }
body:not(.light-mode) .db2-wa-banner.wa-offline { background: rgba(244,63,94,.08); border-color: rgba(244,63,94,.2); }
body:not(.light-mode) .db2-wa-label    { color: #fff; }
body:not(.light-mode) .db2-tip-card    { background: rgba(255,79,163,.06); border-color: rgba(255,79,163,.15); }
body:not(.light-mode) .db2-tip-text    { color: var(--text-muted); }

/* ── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 380px) {
  .db2-cards-row  { gap: .375rem; }
  .db2-card       { padding: .75rem .4rem; }
  .db2-card-val   { font-size: 1.3rem; }
  .db2-card-lbl   { font-size: .58rem; }
  .db2-actions-grid { gap: .5rem; }
  .db2-action     { padding: .875rem .4rem .75rem; }
  .db2-action-icon { width: 40px; height: 40px; font-size: 1rem; }
}

/* ════════════════════════════════════════════════════════
   GROUPS PAGE (grp-*)
═══════════════════════════════════════════════════════════ */
.grp-page { max-width: 580px; margin: 0 auto; }

/* Alerts */
.grp-alert {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-radius: 12px;
  font-size: .83rem; font-weight: 600; margin-bottom: 1rem;
}
.grp-alert-ok  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.grp-alert-err { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
body:not(.light-mode) .grp-alert-ok  { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.2); color: #4ade80; }
body:not(.light-mode) .grp-alert-err { background: rgba(244,63,94,.08); border-color: rgba(244,63,94,.2); color: #fb7185; }

/* Top bar */
.grp-topbar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem; gap: .75rem;
}
.grp-page-title { font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.grp-page-sub   { font-size: .78rem; color: #94a3b8; margin-top: .1rem; }
body:not(.light-mode) .grp-page-title { color: #fff; }

/* List */
.grp-list { display: flex; flex-direction: column; gap: .625rem; }

/* Item */
.grp-item {
  display: flex; align-items: center;
  justify-content: space-between; gap: .875rem;
  background: #fff;
  border: 1.5px solid #f1f5f9;
  border-radius: 16px;
  padding: .875rem 1rem;
  transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.grp-item:hover { border-color: #fce7f3; box-shadow: 0 4px 16px rgba(255,79,163,.07); }
.grp-item-paused { opacity: .72; }
body:not(.light-mode) .grp-item { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .grp-item:hover { border-color: rgba(255,79,163,.25); }

.grp-item-left  { display: flex; align-items: center; gap: .875rem; flex: 1; min-width: 0; }
.grp-item-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Avatar */
.grp-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #FF4FA3, #E91E63);
  color: #fff; font-size: 1.1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(255,79,163,.25);
}
.grp-avatar-off {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
}
body:not(.light-mode) .grp-avatar-off { background: rgba(255,255,255,.1); }

.grp-info { min-width: 0; }
.grp-name {
  font-size: .9rem; font-weight: 700; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body:not(.light-mode) .grp-name { color: #fff; }
.grp-meta { margin-top: .2rem; }
.grp-badge-on, .grp-badge-off {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .7rem; font-weight: 700;
  padding: .18rem .55rem; border-radius: 99px;
}
.grp-badge-on  { background: #f0fdf4; color: #16a34a; }
.grp-badge-off { background: #f8fafc; color: #94a3b8; }
body:not(.light-mode) .grp-badge-on  { background: rgba(34,197,94,.12); color: #4ade80; }
body:not(.light-mode) .grp-badge-off { background: rgba(255,255,255,.06); color: #64748b; }

/* Toggle button */
.grp-toggle-btn {
  display: flex; align-items: center; gap: .4rem;
  background: none; border: none; cursor: pointer; padding: .2rem;
}
.grp-toggle-track {
  width: 42px; height: 24px; border-radius: 99px;
  display: flex; align-items: center;
  padding: 0 3px;
  transition: background .2s;
  position: relative;
}
.toggle-on  .grp-toggle-track { background: #FF4FA3; }
.toggle-off .grp-toggle-track { background: #e2e8f0; }
body:not(.light-mode) .toggle-off .grp-toggle-track { background: rgba(255,255,255,.15); }
.grp-toggle-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
  position: absolute; left: 3px;
}
.toggle-on .grp-toggle-thumb { transform: translateX(18px); }
.grp-toggle-lbl {
  font-size: .72rem; font-weight: 700;
  min-width: 42px;
}
.toggle-on  .grp-toggle-lbl { color: #FF4FA3; }
.toggle-off .grp-toggle-lbl { color: #94a3b8; }

/* Delete */
.grp-del-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1.5px solid #fee2e2; background: #fff1f2;
  color: #f43f5e; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.grp-del-btn:hover { background: #f43f5e; color: #fff; border-color: #f43f5e; }
body:not(.light-mode) .grp-del-btn { background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.2); }

/* Empty */
.grp-empty {
  text-align: center; padding: 3rem 1.5rem;
  background: #fff; border-radius: 20px;
  border: 1.5px dashed #e2e8f0;
}
body:not(.light-mode) .grp-empty { background: var(--card-bg); border-color: var(--border-color); }
.grp-empty-icon { font-size: 2.5rem; color: #FF4FA3; opacity: .35; margin-bottom: .875rem; }
.grp-empty-title { font-size: 1rem; font-weight: 800; color: #0f172a; margin-bottom: .35rem; }
body:not(.light-mode) .grp-empty-title { color: #fff; }
.grp-empty-sub { font-size: .82rem; color: #94a3b8; max-width: 280px; margin: 0 auto; }

/* Modal */
.grp-modal-backdrop {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 600px) { .grp-modal-backdrop { align-items: center; } }
.grp-modal {
  width: 100%; max-width: 500px; max-height: 90vh;
  background: #fff; border-radius: 24px 24px 0 0;
  overflow-y: auto; box-shadow: 0 -8px 40px rgba(0,0,0,.15);
}
@media (min-width: 600px) { .grp-modal { border-radius: 24px; } }
body:not(.light-mode) .grp-modal { background: var(--card-bg); }
.grp-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem .875rem;
  border-bottom: 1px solid #f1f5f9; position: sticky; top: 0;
  background: #fff; z-index: 1;
}
body:not(.light-mode) .grp-modal-header { background: var(--card-bg); border-color: var(--border-color); }
.grp-modal-title {
  font-size: .95rem; font-weight: 800; color: #0f172a;
  display: flex; align-items: center; gap: .4rem;
}
.grp-modal-title i { color: #FF4FA3; }
body:not(.light-mode) .grp-modal-title { color: #fff; }
.grp-modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid #e2e8f0; background: #f8fafc;
  color: #64748b; cursor: pointer; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.grp-modal-close:hover { border-color: #FF4FA3; color: #FF4FA3; background: #fff0f7; }
body:not(.light-mode) .grp-modal-close { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }
.grp-modal-body { padding: 1.1rem 1.25rem 1.5rem; }

/* Option card */
.grp-option-card {
  display: flex; align-items: flex-start; gap: .875rem;
  padding: .875rem 1rem; border-radius: 14px;
  border: 1.5px solid #e2e8f0; background: #f8fafc;
}
body:not(.light-mode) .grp-option-card { background: var(--dark-bg); border-color: var(--border-color); }
.grp-option-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.grp-option-body { flex: 1; min-width: 0; }
.grp-option-title { font-size: .85rem; font-weight: 700; color: #0f172a; }
body:not(.light-mode) .grp-option-title { color: #fff; }
.grp-option-sub { font-size: .75rem; color: #94a3b8; margin-top: .2rem; }
.grp-option-btn {
  padding: .45rem .875rem; border-radius: 8px; border: none;
  font-size: .78rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; align-self: center; flex-shrink: 0;
  transition: all .15s;
}
.grp-option-btn.green { background: #22c55e; color: #fff; }
.grp-option-btn.green:hover { background: #16a34a; }
.grp-option-btn.pink  { background: #FF4FA3; color: #fff; }
.grp-option-btn.pink:hover  { background: #E91E63; }
.grp-option-btn.blue  { background: #3b82f6; color: #fff; }
.grp-option-btn.blue:hover  { background: #2563eb; }

/* Invite input */
.grp-input {
  width: 100%; padding: .5rem .75rem;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: .82rem; font-family: inherit;
  background: #fff; color: #0f172a; outline: none;
  transition: border-color .2s;
}
.grp-input:focus { border-color: #FF4FA3; box-shadow: 0 0 0 3px rgba(255,79,163,.1); }
body:not(.light-mode) .grp-input { background: var(--card-bg); border-color: var(--border-color); color: #fff; }

/* WA group picker */
.grp-wa-list { display: flex; flex-direction: column; gap: .375rem; max-height: 220px; overflow-y: auto; }
.grp-wa-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .875rem; border-radius: 10px;
  border: 1.5px solid #f1f5f9; background: #fff;
  gap: .5rem; transition: border-color .15s;
}
.grp-wa-item:hover { border-color: #FF4FA3; }
body:not(.light-mode) .grp-wa-item { background: var(--dark-bg); border-color: var(--border-color); }
.grp-wa-name { font-size: .83rem; font-weight: 600; color: #0f172a; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:not(.light-mode) .grp-wa-name { color: #fff; }
.grp-wa-add {
  width: 28px; height: 28px; border-radius: 8px;
  background: #FF4FA3; color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.grp-wa-add:hover { background: #E91E63; }

.grp-loading {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: #94a3b8; padding: .75rem;
}
.grp-loading .spinner-border { width: .9rem; height: .9rem; border-width: 2px; color: #FF4FA3; }

/* ════════════════════════════════════════════════════════
   MESSAGES PAGE v2 (mf-*)
═══════════════════════════════════════════════════════════ */

/* Page wrapper */
.mf-page { max-width: 680px; margin: 0 auto; }

/* Top bar */
.mf-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .mf-topbar { gap: .5rem; }
  .btn-primary-neon { font-size: .78rem; padding: .5rem .8rem; }
  .mf-search-wrap { order: 3; min-width: 100%; }
}
.btn-primary-neon {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  background: linear-gradient(135deg, #FF4FA3, #E91E63);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255,79,163,.3);
  transition: all .2s;
}
.btn-primary-neon:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,79,163,.4); }
.mf-search-wrap {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.mf-search-icon {
  position: absolute;
  left: .875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .85rem;
  pointer-events: none;
}
.mf-search {
  width: 100%;
  padding: .55rem .875rem .55rem 2.25rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: .855rem;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.mf-search:focus { border-color: #FF4FA3; box-shadow: 0 0 0 3px rgba(255,79,163,.1); }
body:not(.light-mode) .mf-search { background: var(--card-bg); border-color: var(--border-color); color: #fff; }

/* Tabs */
.mf-tabs {
  display: flex;
  gap: .375rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.mf-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .875rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  text-decoration: none;
  transition: all .2s;
}
.mf-tab:hover { color: #FF4FA3; border-color: #FF4FA3; background: #fff0f7; }
.mf-tab.active { background: #FF4FA3; color: #fff; border-color: #FF4FA3; }
.mf-badge {
  display: inline-block;
  background: rgba(0,0,0,.08);
  padding: .05rem .4rem;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 700;
}
.mf-tab.active .mf-badge { background: rgba(255,255,255,.25); }
.mf-badge.green  { background: rgba(34,197,94,.12); color: #16a34a; }
.mf-badge.yellow { background: rgba(245,158,11,.12); color: #d97706; }
.mf-badge.blue   { background: rgba(59,130,246,.12); color: #2563eb; }
body:not(.light-mode) .mf-tab { background: var(--card-bg); border-color: var(--border-color); color: var(--text-muted); }
body:not(.light-mode) .mf-tab:hover { background: rgba(255,79,163,.08); border-color: var(--primary); }

/* Cards */
.mf-card {
  background: #fff;
  border: 1.5px solid #f1f5f9;
  border-radius: 16px;
  margin-bottom: .625rem;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.mf-card:hover { border-color: #fce7f3; box-shadow: 0 4px 16px rgba(255,79,163,.08); }
body:not(.light-mode) .mf-card { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .mf-card:hover { border-color: rgba(255,79,163,.25); }

.mf-card-main {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
}
.mf-card-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.mf-thumb-video {
  background: rgba(255,79,163,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF4FA3;
  font-size: 1.3rem;
}
.mf-thumb-empty {
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.2rem;
}
body:not(.light-mode) .mf-thumb-empty { background: rgba(255,255,255,.05); }

.mf-card-body { flex: 1; min-width: 0; }
.mf-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .3rem;
}
.mf-card-title {
  font-size: .875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  flex: 1;
}
body:not(.light-mode) .mf-card-title { color: #fff; }
.mf-card-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.mf-meta-item {
  font-size: .75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.mf-status-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-active  { background: #f0fdf4; color: #16a34a; }
.pill-paused  { background: #fffbeb; color: #d97706; }
.pill-auto    { background: #f5f3ff; color: #7c3aed; }

.mf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem .625rem;
  border-top: 1px solid #f8fafc;
}
body:not(.light-mode) .mf-card-footer { border-color: var(--border-color); }

.mf-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: #FF4FA3;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 6px;
  transition: background .15s;
}
.mf-detail-btn:hover { background: #fff0f7; }

.mf-card-actions { display: flex; gap: .375rem; }
.mf-act-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.mf-act-btn:hover { border-color: #FF4FA3; color: #FF4FA3; background: #fff0f7; }
.mf-act-btn.play:hover  { border-color: #22c55e; color: #22c55e; background: #f0fdf4; }
.mf-act-btn.pause:hover { border-color: #f59e0b; color: #f59e0b; background: #fffbeb; }
.mf-act-btn.danger:hover { border-color: #f43f5e; color: #f43f5e; background: #fff1f2; }
body:not(.light-mode) .mf-act-btn { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }

/* Detail expand */
.mf-detail-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  border-top: 0px solid #f1f5f9;
}
.mf-detail-expand.open {
  max-height: 400px;
  border-top-width: 1px;
}
body:not(.light-mode) .mf-detail-expand { border-color: var(--border-color); }
.mf-detail-content {
  padding: .875rem 1rem;
  font-size: .825rem;
  line-height: 1.65;
  color: #475569;
  white-space: pre-wrap;
}
body:not(.light-mode) .mf-detail-content { color: var(--text-muted); }
.mf-detail-media {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding: 0 1rem .875rem;
}
.mf-detail-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.mf-detail-vid {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: #64748b;
  background: #f8fafc;
  padding: .35rem .65rem;
  border-radius: 8px;
}

/* Empty state */
.mf-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: #fff;
  border-radius: 16px;
  border: 1.5px dashed #e2e8f0;
}
body:not(.light-mode) .mf-empty { background: var(--card-bg); border-color: var(--border-color); }
.mf-empty-icon {
  font-size: 2.5rem;
  color: #FF4FA3;
  opacity: .4;
  margin-bottom: .75rem;
}
.mf-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .35rem;
}
body:not(.light-mode) .mf-empty-title { color: #fff; }
.mf-empty-sub { font-size: .82rem; color: #94a3b8; max-width: 280px; margin: 0 auto; }

/* Pagination */
.mf-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 .5rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.mf-pag-info { font-size: .78rem; color: #94a3b8; }
.mf-pag-btns { display: flex; gap: .25rem; }
.mf-pag-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: all .15s;
}
.mf-pag-btn:hover { border-color: #FF4FA3; color: #FF4FA3; }
.mf-pag-btn.active { background: #FF4FA3; border-color: #FF4FA3; color: #fff; }
.mf-pag-btn.disabled { opacity: .35; pointer-events: none; }
body:not(.light-mode) .mf-pag-btn { background: var(--card-bg); border-color: var(--border-color); color: var(--text-muted); }

/* ════════════════════════════════════════════════════════
   WIZARD OVERLAY v2 (wiz-*)
═══════════════════════════════════════════════════════════ */
.wiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) { .wiz-overlay { align-items: center; } }

.wiz-shell {
  width: 100%;
  max-width: 520px;
  max-height: 96svh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
}
@media (min-width: 600px) {
  .wiz-shell {
    border-radius: 24px;
    max-height: 92svh;
  }
}
body:not(.light-mode) .wiz-shell { background: var(--card-bg); }

/* Header */
.wiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
body:not(.light-mode) .wiz-header { border-color: var(--border-color); }
.wiz-back-btn, .wiz-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .9rem;
  transition: all .15s;
}
.wiz-back-btn:hover, .wiz-close-btn:hover { border-color: #FF4FA3; color: #FF4FA3; background: #fff0f7; }
body:not(.light-mode) .wiz-back-btn,
body:not(.light-mode) .wiz-close-btn { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }
.wiz-header-title { font-size: .95rem; font-weight: 800; color: #0f172a; }
body:not(.light-mode) .wiz-header-title { color: #fff; }

/* Progress bar */
.wiz-progress-wrap {
  height: 3px;
  background: #f1f5f9;
  flex-shrink: 0;
}
body:not(.light-mode) .wiz-progress-wrap { background: var(--border-color); }
.wiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF4FA3, #E91E63);
  transition: width .35s cubic-bezier(.4,0,.2,1);
}

/* Step pills row */
.wiz-steps-row {
  display: flex;
  align-items: center;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  gap: .25rem;
}
body:not(.light-mode) .wiz-steps-row { border-color: var(--border-color); }
.wiz-step-pill {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}
.wiz-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: .7rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: all .25s;
  flex-shrink: 0;
}
.wiz-step-pill.active .wiz-step-num { background: #FF4FA3; color: #fff; box-shadow: 0 2px 8px rgba(255,79,163,.4); }
.wiz-step-pill.done .wiz-step-num { background: #22c55e; color: #fff; }
.wiz-step-lbl {
  font-size: .72rem;
  font-weight: 700;
  color: #94a3b8;
  transition: color .25s;
}
.wiz-step-pill.active .wiz-step-lbl { color: #FF4FA3; }
.wiz-step-pill.done .wiz-step-lbl { color: #22c55e; }
.wiz-step-line {
  flex: 1;
  height: 1.5px;
  background: #e2e8f0;
  min-width: 8px;
}
body:not(.light-mode) .wiz-step-line { background: var(--border-color); }

/* Quick time buttons */
.wiz-time-quick {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .25rem;
}
.wiz-time-btn {
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  padding: .4rem .75rem;
  border-radius: 50px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.wiz-time-btn:hover { border-color: #FF4FA3; color: #FF4FA3; background: #fff0f7; }
.wiz-time-btn.active { background: linear-gradient(135deg,#FF4FA3,#E91E63); color: #fff; border-color: transparent; }
body:not(.light-mode) .wiz-time-btn { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }
body:not(.light-mode) .wiz-time-btn:hover { border-color: #FF4FA3; color: #FF4FA3; background: rgba(255,79,163,.08); }
body:not(.light-mode) .wiz-time-btn.active { background: linear-gradient(135deg,#FF4FA3,#E91E63); color: #fff; border-color: transparent; }

/* Scrollable body */
.wiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.25rem .5rem;
  -webkit-overflow-scrolling: touch;
}

/* Panel */
.wiz-panel-title {
  font-size: .92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
body:not(.light-mode) .wiz-panel-title { color: #fff; }
.wiz-panel-title i { color: #FF4FA3; }
.wiz-field { margin-bottom: 1.1rem; }
.wiz-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: .4rem;
}
body:not(.light-mode) .wiz-label { color: #e2e8f0; }
.wiz-hint { font-size: .72rem; color: #94a3b8; display: block; margin-top: .3rem; }
.wiz-input, .wiz-textarea {
  width: 100%;
  padding: .65rem .875rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: .875rem;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.wiz-input:focus, .wiz-textarea:focus { border-color: #FF4FA3; box-shadow: 0 0 0 3px rgba(255,79,163,.1); }
body:not(.light-mode) .wiz-input,
body:not(.light-mode) .wiz-textarea { background: var(--dark-bg); border-color: var(--border-color); color: #fff; }
.wiz-textarea { resize: vertical; min-height: 120px; }

/* Radio group */
.wiz-radio-group { display: flex; gap: .625rem; }
.wiz-radio-opt { flex: 1; cursor: pointer; }
.wiz-radio-opt input[type="radio"] { display: none; }
.wiz-radio-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .7rem .5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 600;
  color: #64748b;
  transition: all .15s;
  text-align: center;
}
.wiz-radio-box i { font-size: 1.1rem; }
.wiz-radio-opt input:checked + .wiz-radio-box { border-color: #FF4FA3; background: #fff0f7; color: #FF4FA3; }
body:not(.light-mode) .wiz-radio-box { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }

/* Toggle */
.wiz-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  gap: 1rem;
}
body:not(.light-mode) .wiz-toggle-row { background: var(--dark-bg); border-color: var(--border-color); }
.wiz-toggle { position: relative; display: inline-flex; cursor: pointer; }
.wiz-toggle input { display: none; }
.wiz-toggle-track {
  width: 44px; height: 24px;
  border-radius: 99px;
  background: #e2e8f0;
  transition: background .2s;
  position: relative;
}
.wiz-toggle input:checked + .wiz-toggle-track { background: #FF4FA3; }
.wiz-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.wiz-toggle input:checked + .wiz-toggle-track .wiz-toggle-thumb { transform: translateX(20px); }

/* Upload area */
.wiz-upload-area {
  border: 2px dashed #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #f8fafc;
}
.wiz-upload-area:hover { border-color: #FF4FA3; background: #fff0f7; }
body:not(.light-mode) .wiz-upload-area { background: var(--dark-bg); border-color: var(--border-color); }
.wiz-upload-icon { font-size: 1.8rem; color: #FF4FA3; opacity: .6; display: block; margin-bottom: .4rem; }
.wiz-upload-text { font-size: .83rem; font-weight: 600; color: #475569; }
body:not(.light-mode) .wiz-upload-text { color: var(--text-muted); }
.wiz-upload-hint { font-size: .7rem; color: #94a3b8; margin-top: .25rem; }

.wiz-media-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .625rem; }
.wiz-media-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .6rem;
  font-size: .75rem;
  color: #64748b;
}
.wiz-media-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; padding: 0; }
.wiz-media-item i { font-size: 1.2rem; color: #FF4FA3; }

/* AI */
.wiz-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 700;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1.5px solid #e9d5ff;
  border-radius: 8px;
  padding: .35rem .75rem;
  cursor: pointer;
  transition: all .15s;
}
.wiz-ai-btn:hover { background: #ede9fe; }
.wiz-ai-btn i { color: #a855f7; }
.wiz-ai-loading {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: #94a3b8;
  padding: .75rem;
}
.wiz-ai-loading .spinner-border { width: 1rem; height: 1rem; border-width: 2px; color: #FF4FA3; }
.wiz-ai-result { margin-top: .75rem; }
.wiz-ai-content {
  background: rgba(168,85,247,.06);
  border: 1px solid rgba(168,85,247,.2);
  border-radius: 10px;
  padding: .75rem;
  font-size: .82rem;
  line-height: 1.6;
  color: #374151;
  margin-bottom: .5rem;
  white-space: pre-wrap;
}
body:not(.light-mode) .wiz-ai-content { color: var(--text-muted); }
.wiz-ai-use-btn {
  width: 100%;
  padding: .55rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #FF4FA3, #E91E63);
  color: #fff;
  border: none;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.wiz-ai-error { background: #fff1f2; border: 1px solid #fecdd3; border-radius: 8px; padding: .6rem .875rem; font-size: .8rem; color: #e11d48; }

/* Review */
.wiz-review-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}
body:not(.light-mode) .wiz-review-card { background: var(--dark-bg); border-color: var(--border-color); }
.wiz-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.wiz-review-row:last-child { border-bottom: none; }
body:not(.light-mode) .wiz-review-row { border-color: var(--border-color); }
.wiz-review-key { font-size: .8rem; color: #64748b; }
.wiz-review-val { font-size: .85rem; font-weight: 700; color: #0f172a; }
body:not(.light-mode) .wiz-review-val { color: #fff; }
.wiz-review-content {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: .875rem;
  font-size: .82rem;
  color: #475569;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.6;
}
body:not(.light-mode) .wiz-review-content { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }

/* Live preview strip */
.wiz-preview-strip {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: .5rem 1.25rem;
  flex-shrink: 0;
}
body:not(.light-mode) .wiz-preview-strip { background: var(--dark-bg); border-color: var(--border-color); }
.wiz-preview-inner {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .72rem;
}
.wiz-preview-label { font-weight: 800; color: #FF4FA3; text-transform: uppercase; font-size: .65rem; letter-spacing: .06em; }
.wiz-preview-time, .wiz-preview-status { font-weight: 700; color: #0f172a; }
body:not(.light-mode) .wiz-preview-time,
body:not(.light-mode) .wiz-preview-status { color: #fff; }
.wiz-preview-msg { color: #94a3b8; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-preview-dot { color: #cbd5e1; }

/* Fixed footer */
.wiz-footer {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .875rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: #fff;
}
body:not(.light-mode) .wiz-footer { background: var(--card-bg); border-color: var(--border-color); }
.wiz-btn-back {
  display: flex; align-items: center; gap: .3rem;
  padding: .65rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.wiz-btn-back:hover { border-color: #FF4FA3; color: #FF4FA3; }
body:not(.light-mode) .wiz-btn-back { background: var(--dark-bg); border-color: var(--border-color); color: var(--text-muted); }
.wiz-btn-next, .wiz-btn-save {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #FF4FA3, #E91E63);
  color: #fff;
  border: none;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,79,163,.3);
  transition: all .2s;
}
.wiz-btn-next:hover, .wiz-btn-save:hover { box-shadow: 0 6px 20px rgba(255,79,163,.45); transform: translateY(-1px); }

/* ════════════════════════════════════════════════════════
   PAGE HEADER (title + action button row)
═══════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.page-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin: .2rem 0 0;
}

/* ════════════════════════════════════════════════════════
   TAB PILLS (filter tabs)
═══════════════════════════════════════════════════════════ */
.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .18s;
  cursor: pointer;
}
.tab-pill:hover { color: #fff; background: rgba(255,255,255,.06); }
.tab-pill.active {
  color: var(--primary);
  background: rgba(255,79,163,.12);
  border-color: rgba(255,79,163,.25);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  color: inherit;
  font-size: .68rem;
  padding: 0 4px;
  font-weight: 700;
}
.tab-pill.active .tab-count { background: rgba(255,79,163,.25); }

/* ════════════════════════════════════════════════════════
   SEARCH INPUT
═══════════════════════════════════════════════════════════ */
.search-input-wrap {
  position: relative;
  min-width: 180px;
  max-width: 280px;
  flex: 1;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}
.search-input {
  padding-left: 34px !important;
  border-radius: 20px !important;
  font-size: .83rem;
}

/* ════════════════════════════════════════════════════════
   MESSAGE ROWS (list redesign)
═══════════════════════════════════════════════════════════ */
.msg-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background .15s;
}
.msg-row:last-child { border-bottom: none; }
.msg-row:hover { background: rgba(255,255,255,.025); }

.msg-time-col {
  min-width: 66px;
  text-align: center;
  flex-shrink: 0;
}
.msg-hour {
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}
.msg-freq {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.msg-content-col { min-width: 0; }
.msg-title-text {
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .15rem;
}
.msg-preview-text {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .3rem;
}
.msg-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  color: var(--text-muted);
  background: rgba(255,255,255,.05);
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 500;
}
.meta-badge.active { color: #25D366; background: rgba(37,211,102,.08); }
.meta-badge.paused { color: #f59e0b; background: rgba(245,158,11,.08); }

.msg-status-col { flex-shrink: 0; }
.msg-actions-col {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}

/* Action icon buttons inside rows */
.icon-btn-act {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn-act:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.icon-btn-act.danger:hover {
  background: rgba(239,68,68,.15);
  color: #f87171;
  border-color: rgba(239,68,68,.3);
}

/* ════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--border-color);
}
.pagination-info {
  font-size: .78rem;
  color: var(--text-muted);
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s;
  padding: 0 8px;
}
.page-btn:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.page-btn.active { background: rgba(255,79,163,.15); color: var(--primary); border-color: rgba(255,79,163,.35); }
.page-btn.disabled { opacity: .35; pointer-events: none; cursor: default; }

/* ════════════════════════════════════════════════════════
   WIZARD OVERLAY
═══════════════════════════════════════════════════════════ */
.dark-overlay-bg {
  background: var(--dark-bg);
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.wizard-step-line {
  width: 40px;
  height: 2px;
  background: var(--border-color);
  flex-shrink: 0;
  margin: 0 .25rem;
  transition: background .3s;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: all .25s;
  flex-shrink: 0;
}
.step-info {
  display: flex;
  flex-direction: column;
}
.step-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  transition: color .25s;
}
.step-sub {
  font-size: .68rem;
  color: var(--text-muted);
  opacity: .65;
  line-height: 1;
  margin-top: 2px;
}
.wizard-step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(255,79,163,.4);
}
.wizard-step.active .step-label { color: var(--primary); }
.wizard-step.done .step-num {
  background: rgba(37,211,102,.15);
  border-color: #25D366;
  color: #25D366;
}
.wizard-step.done .step-label { color: #25D366; }
.wizard-panel { animation: fadeInUp .2s ease both; }

/* Review rows in step 4 */
.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: .875rem;
}
.review-row:last-of-type { border-bottom: none; }
.review-row span:first-child { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════
   LIGHT MODE OVERRIDES (new components)
═══════════════════════════════════════════════════════════ */
body.light-mode .tab-pill { color: #6B7280; }
body.light-mode .tab-pill:hover { color: #1f2937; background: rgba(0,0,0,.05); }
body.light-mode .tab-pill.active { color: #b5006b; background: rgba(255,79,163,.1); }
body.light-mode .tab-count { background: rgba(0,0,0,.08); }
body.light-mode .tab-pill.active .tab-count { background: rgba(255,79,163,.2); }
body.light-mode .msg-row:hover { background: rgba(0,0,0,.02); }
body.light-mode .msg-hour { color: #111827; }
body.light-mode .msg-title-text { color: #111827; }
body.light-mode .icon-btn-act { background: rgba(0,0,0,.04); border-color: #e5e7eb; color: #6B7280; }
body.light-mode .icon-btn-act:hover { background: rgba(0,0,0,.08); color: #111827; }
body.light-mode .page-btn { background: #f9fafb; border-color: #e5e7eb; color: #6B7280; }
body.light-mode .page-btn:hover { background: #f3f4f6; color: #111827; }
body.light-mode .page-btn.active { background: rgba(255,79,163,.1); color: #b5006b; border-color: rgba(255,79,163,.3); }
body.light-mode .search-icon { color: #9ca3af; }
body.light-mode .dark-overlay-bg { background: #f9fafb; }
body.light-mode .meta-badge { background: rgba(0,0,0,.05); color: #6B7280; }

/* ════════════════════════════════════════════════════════
   MOBILE (messages page)
═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .msg-time-col { min-width: 54px; }
  .msg-hour { font-size: .82rem; }
  .msg-status-col { display: none; }
  .wizard-steps { gap: 0; }
  .wizard-step-line { width: 20px; }
  .step-info { display: none; }
  .page-title { font-size: 1.15rem; }
}

/* ════════════════════════════════════════════════════════
   WA — WhatsApp Status page (wa-* components)
═══════════════════════════════════════════════════════════ */

/* Green system banner */
.wa-banner-ok {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: .75rem 1.1rem;
  font-size: .88rem;
  color: #15803d;
}
.wa-banner-dot {
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
  animation: waPulse 2s infinite;
}
@keyframes waPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,.05); }
}

/* Page header */
.wa-page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
}
.wa-page-sub {
  font-size: .88rem;
  color: #6B7280;
}

/* Main status card */
.wa-status-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.wa-status-card-left {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  flex: 1;
}
.wa-status-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-online-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 99px;
  padding: .2rem .7rem;
}
.wa-session-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255,79,163,.08);
  border: 1px solid rgba(255,79,163,.2);
  color: #b5006b;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 99px;
  padding: .2rem .7rem;
}
.wa-info-line {
  font-size: .82rem;
  color: #6B7280;
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.wa-info-line.text-success { color: #15803d !important; }

/* Stat cards */
.wa-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem .75rem;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.wa-stat-icon { font-size: 1.3rem; margin-bottom: .3rem; }
.wa-stat-val  { font-size: 1.5rem; font-weight: 700; color: #111827; line-height: 1.1; }
.wa-stat-lbl  { font-size: .73rem; color: #9CA3AF; margin-top: .25rem; }

/* CTA button */
.wa-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(135deg, #FF4FA3 0%, #E91E63 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(233,30,99,.28);
  transition: transform .15s, box-shadow .15s;
}
.wa-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(233,30,99,.35);
}
.wa-cta-btn:active { transform: translateY(0); }

/* Secondary buttons */
.wa-sec-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: .65rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: background .15s, border-color .15s;
}
.wa-sec-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.wa-sec-btn--danger { color: #ef4444; }
.wa-sec-btn--danger:hover { background: #fef2f2; border-color: #fca5a5; }

/* Accordion */
.wa-accordion { --bs-accordion-border-radius: 12px; }
.wa-acc-item  {
  border: 1.5px solid #e5e7eb !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.wa-acc-btn {
  background: #fff !important;
  color: #374151 !important;
  font-weight: 600;
  font-size: .9rem;
  font-family: 'Poppins', sans-serif;
  padding: .9rem 1.1rem;
  box-shadow: none !important;
}
.wa-acc-btn:not(.collapsed) { color: #b5006b !important; }
.wa-acc-body { padding: 1rem 1.25rem; background: #fafafa; }
.wa-acc-label { font-size: .8rem; font-weight: 700; color: #374151; margin-bottom: .4rem; }
.wa-acc-list  { font-size: .82rem; color: #6B7280; line-height: 1.75; padding-left: 1.2rem; margin-bottom: 0; }
.wa-acc-list strong { color: #111827; }
.wa-acc-tip {
  margin-top: 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .78rem;
  color: #92400e;
}

/* Activity card */
.wa-activity-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.wa-activity-header {
  padding: .9rem 1.25rem;
  font-size: .85rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}
.wa-activity-body { padding: .5rem 0; }
.wa-event {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid #f9fafb;
}
.wa-event:last-child { border-bottom: none; }
.wa-event-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.wa-event-dot.ok  { background: #22c55e; }
.wa-event-dot.err { background: #ef4444; }
.wa-event-text {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex: 1;
  gap: .5rem;
  font-size: .83rem;
  color: #374151;
}
.wa-event-time { font-size: .75rem; color: #9CA3AF; white-space: nowrap; flex-shrink: 0; }
.wa-event-empty { padding: 1.25rem; font-size: .83rem; color: #9CA3AF; text-align: center; }

/* Connect card (disconnected state) */
.wa-connect-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.wa-connect-header {
  padding: .9rem 1.25rem;
  font-size: .88rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}
.wa-connect-body { padding: 1.4rem 1.25rem; }
.wa-method-label { font-size: .8rem; font-weight: 600; color: #6B7280; text-transform: uppercase; letter-spacing: .04em; }
.wa-method-warn  { font-size: .72rem; color: #f59e0b; margin-top: .4rem; }

/* QR display */
.wa-qr-wrap { width: 220px; border-radius: 12px; overflow: hidden; border: 2px solid #e5e7eb; padding: 8px; background: #fff; }
.wa-qr-img  { width: 100%; display: block; }

/* Pairing code */
.wa-pairing-box {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 14px;
  padding: 1.5rem 1rem;
  margin: 0 auto;
  max-width: 280px;
}
.wa-pairing-code {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: .45rem;
  color: #15803d;
}

/* Dark mode overrides */
body:not(.light-mode) .wa-banner-ok { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); color: #4ade80; }
body:not(.light-mode) .wa-status-card { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .wa-status-icon-wrap { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
body:not(.light-mode) .wa-online-badge { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #4ade80; }
body:not(.light-mode) .wa-page-title { color: #fff; }
body:not(.light-mode) .wa-page-sub   { color: var(--text-muted); }
body:not(.light-mode) .wa-info-line  { color: var(--text-muted); }
body:not(.light-mode) .wa-info-line.text-success { color: #4ade80 !important; }
body:not(.light-mode) .wa-stat-card  { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .wa-stat-val   { color: #fff; }
body:not(.light-mode) .wa-stat-lbl   { color: var(--text-muted); }
body:not(.light-mode) .wa-sec-btn    { background: rgba(255,255,255,.05); border-color: var(--border-color); color: #e5e7eb; }
body:not(.light-mode) .wa-sec-btn:hover { background: rgba(255,255,255,.09); border-color: #4b3660; }
body:not(.light-mode) .wa-sec-btn--danger { color: #f87171; }
body:not(.light-mode) .wa-sec-btn--danger:hover { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.3); }
body:not(.light-mode) .wa-acc-item   { border-color: var(--border-color) !important; }
body:not(.light-mode) .wa-acc-btn    { background: var(--card-bg) !important; color: #e5e7eb !important; }
body:not(.light-mode) .wa-acc-btn:not(.collapsed) { color: var(--primary) !important; }
body:not(.light-mode) .wa-acc-body   { background: rgba(255,255,255,.02); }
body:not(.light-mode) .wa-acc-label  { color: #e5e7eb; }
body:not(.light-mode) .wa-acc-list   { color: var(--text-muted); }
body:not(.light-mode) .wa-acc-list strong { color: #fff; }
body:not(.light-mode) .wa-acc-tip    { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.25); color: #fbbf24; }
body:not(.light-mode) .wa-activity-card   { background: var(--card-bg); border-color: var(--border-color); box-shadow: none; }
body:not(.light-mode) .wa-activity-header { background: rgba(255,255,255,.03); border-color: var(--border-color); color: #e5e7eb; }
body:not(.light-mode) .wa-event      { border-color: rgba(255,255,255,.04); }
body:not(.light-mode) .wa-event-text { color: #d1d5db; }
body:not(.light-mode) .wa-connect-card   { background: var(--card-bg); border-color: var(--border-color); }
body:not(.light-mode) .wa-connect-header { background: rgba(255,255,255,.03); border-color: var(--border-color); color: #e5e7eb; }
body:not(.light-mode) .wa-qr-wrap    { border-color: var(--border-color); background: #fff; }
body:not(.light-mode) .wa-pairing-box { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
body:not(.light-mode) .wa-pairing-code { color: #4ade80; }

/* ── Tutorial steps ──────────────────────────────────────────── */
.tut-steps { display: flex; flex-direction: column; gap: 1rem; }
.tut-step { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; border-radius: .75rem; background: rgba(255,79,163,.04); border: 1px solid rgba(255,79,163,.12); }
.tut-num { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; background: linear-gradient(135deg,#FF4FA3,#E91E63); color: #fff; font-weight: 700; font-size: .875rem; display: flex; align-items: center; justify-content: center; }
.tut-title { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.tut-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }
.tut-link { display: inline-flex; align-items: center; margin-top: .5rem; font-size: .78rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.tut-link:hover { text-decoration: underline; }
body:not(.light-mode) .tut-step { background: rgba(255,79,163,.06); border-color: rgba(255,79,163,.15); }

/* ════════════════════════════════════════════════════════
   MESSAGES PAGE — MOBILE-FIRST FIXES (no horizontal scroll)
═══════════════════════════════════════════════════════════ */

/* Global box-model safety net */
*, *::before, *::after { box-sizing: border-box; }

/* Overlay shells: never wider than viewport, never horizontal scroll */
.wiz-shell, .qs-shell {
  overflow-x: hidden;
  max-width: 100vw;
}
.wiz-body, .qs-body {
  overflow-x: hidden;
  min-width: 0;
}

/* All form fields inside overlays: full width, no overflow */
.wiz-input, .wiz-textarea,
.qs-caption, .qs-caption,
.wiz-field input[type="time"],
.wiz-field input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── Wizard step pills: shrink gracefully on narrow screens ── */
@media (max-width: 420px) {
  .wiz-steps-row { padding: .6rem .75rem; gap: .15rem; }
  .wiz-step-lbl  { display: none; }
  .wiz-step-pill { gap: 0; }
  .wiz-step-line { min-width: 6px; flex: 1; }
}

/* ── Day pills: wrap and shrink on tiny screens ── */
@media (max-width: 380px) {
  .day-pill label {
    width: 36px;
    height: 36px;
    font-size: .72rem;
  }
  .day-pill-row { gap: .25rem; }
}

/* ── Radio group: wrap on very small screens ── */
@media (max-width: 380px) {
  .wiz-radio-group { flex-wrap: wrap; }
  .wiz-radio-opt   { flex: 0 0 calc(50% - .35rem); }
}

/* ── Quick-time buttons: smaller on small screens ── */
@media (max-width: 380px) {
  .wiz-time-btn { font-size: .72rem; padding: .35rem .55rem; }
}

/* ── Wizard preview strip: truncate long text ── */
.wiz-preview-strip { overflow: hidden; }
.wiz-preview-msg   { max-width: 140px; }

/* ── QS tabs: equal-width buttons, no overflow ── */
.qs-tabs { flex-wrap: nowrap; overflow-x: auto; }
@media (max-width: 380px) {
  .qs-tab-btn { font-size: .68rem; padding: .4rem .1rem; }
}

/* ── Edit Modal: stack columns on small screens ── */
@media (max-width: 480px) {
  #editModal .modal-dialog { margin: .5rem; max-width: calc(100vw - 1rem); }
  #editModal .col-sm-6     { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  #editModal .modal-body   { padding: .875rem; }
}

/* ── mf-card: never overflow container ── */
.mf-card        { overflow: hidden; }
.mf-card-main   { overflow: hidden; }
.mf-card-body   { min-width: 0; overflow: hidden; }
.mf-card-title  { word-break: break-word; }

/* ── Topbar: ensure buttons never cause scroll ── */
.mf-topbar { flex-wrap: wrap; width: 100%; }
@media (max-width: 360px) {
  .btn-primary-neon,
  .btn-quick-send { font-size: .75rem; padding: .45rem .7rem; }
}

/* ── mf-tabs: wrap gracefully ── */
.mf-tabs { flex-wrap: wrap; }
@media (max-width: 360px) {
  .mf-tab { font-size: .75rem; padding: .4rem .65rem; }
}

/* ── Groups picker in wizard: not too tall on small screens ── */
@media (max-width: 480px) {
  .grp-pick-grid { max-height: 150px; }
  .qs-groups     { max-height: 150px; }
}

/* ── Wiz footer: handle 3 buttons on very small screens ── */
@media (max-width: 360px) {
  .wiz-footer     { padding: .625rem .875rem; gap: .4rem; }
  .wiz-btn-back   { padding: .55rem .75rem; font-size: .8rem; }
  .wiz-btn-next,
  .wiz-btn-save   { font-size: .82rem; padding: .6rem .75rem; }
}

/* ── Disparo Rápido shell: safe height and no overflow ── */
.qs-shell { overflow-x: hidden; }
.qs-body  { padding: 1rem 1rem; }
@media (max-width: 380px) {
  .qs-body { padding: .875rem .875rem; }
}

/* ── Upload zones in wizard: never overflow ── */
.wiz-upload-area { max-width: 100%; }
.rec-box { max-width: 100%; overflow: hidden; }

/* ── Rec buttons: wrap on small screens ── */
@media (max-width: 360px) {
  .rec-btn-use, .rec-btn-redo { font-size: .73rem; padding: .4rem .7rem; }
}

/* ── Inline flex rows with justify-content: space-between inside wizard body ── */
@media (max-width: 360px) {
  .wiz-field > div[style*="justify-content:space-between"],
  .wiz-field > div[style*="justify-content: space-between"] {
    flex-wrap: wrap;
    gap: .35rem;
  }
}

/* ── Page body: tighter padding on very small screens ── */
@media (max-width: 360px) {
  .page-body { padding: .75rem; }
}
