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

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  --sidebar-w: 240px;

  /* Background layers */
  --bg:      #080d17;
  --bg-2:    #0d1623;
  --bg-3:    #111f30;
  --bg-4:    #172236;

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-glow:  rgba(255,255,255,0.12);

  /* Accent palette */
  --cyan:    #00d4ff;
  --purple:  #8b5cf6;
  --green:   #22c55e;
  --orange:  #f97316;
  --pink:    #ec4899;
  --teal:    #14b8a6;

  /* Primary = green (WA brand) */
  --primary:       #22c55e;
  --primary-hover: #16a34a;
  --primary-glow:  rgba(34,197,94,0.18);

  /* Text */
  --text:   #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;

  /* Misc */
  --radius:    14px;
  --radius-sm: 10px;
  --transition: 0.15s ease;
  --shadow-glow: 0 0 20px rgba(0,212,255,0.06), 0 4px 16px rgba(0,0,0,0.4);
}

/* ── Reset ──────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.sidebar nav { flex: 1; }

.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-icon { width: 38px; height: 38px; flex-shrink: 0; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name-row { display: flex; align-items: baseline; line-height: 1; }
.brand-uni  { color: rgba(255,255,255,0.65); font-size: 1.1rem; font-weight: 300; letter-spacing: 1.5px; }
.brand-dot  { color: var(--cyan); font-size: 1.25rem; font-weight: 900; }
.brand-haq  { color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.5px; }
.brand-tagline {
  font-size: 0.62rem;
  color: var(--text-3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 3px;
}

.nav-section { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #5a7a96;
  padding: 10px 8px 6px;
}

.nav-group { margin-bottom: 4px; }
.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.nav-group-header:hover { background: var(--bg-3); }
.nav-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #cbd5e1;
}
.nav-group-chevron {
  font-size: 0.7rem;
  color: #5a7a96;
  transition: transform var(--transition);
}
.nav-group-items {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.25s ease;
  padding-top: 2px;
}
.nav-group-items.collapsed { max-height: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #a0b4c8;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
  margin-bottom: 2px;
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-3); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(0,212,255,0.08));
  color: var(--cyan);
  font-weight: 600;
  border: 1px solid rgba(0,212,255,0.15);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.connected { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.6); animation: pulse 2s infinite; }
.status-dot.disconnected { background: #ef4444; }
.status-dot.connecting { background: #f59e0b; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
#nav-status-text { font-size: 0.78rem; color: #a0b4c8; font-weight: 500; }

/* ── Main ─────────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.page-header h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.page-header-sub { font-size: 0.8rem; color: #7a95b0; margin-top: 1px; }
.page-content { padding: 28px 32px; }

.count-badge {
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.25);
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-glow); }
.card h2 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #7a95b0;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ── Dashboard ─────────────────────────────────────────────── */
.wa-status-card {
  background: linear-gradient(135deg, #0d1b2e 0%, #0a1628 50%, #0d1f35 100%);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0,212,255,0.12);
  margin-bottom: 20px;
  box-shadow: 0 0 40px rgba(0,212,255,0.04);
}
.wa-status-left { display: flex; align-items: center; gap: 16px; }
.wa-icon-wrap {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(0,212,255,0.1));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  border: 1px solid rgba(34,197,94,0.2);
}
.wa-title { font-weight: 700; font-size: 1.05rem; color: #fff; }
.wa-label { font-size: 0.82rem; color: rgba(255,255,255,0.4); margin-top: 3px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
}
.badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:0.8; }
.badge.connected    { background: rgba(34,197,94,0.12);  color: var(--green);  border: 1px solid rgba(34,197,94,0.25); }
.badge.disconnected,.badge.qr { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge.connecting   { background: rgba(245,158,11,0.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--orange), #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--green), var(--teal)); }
.stat-card:hover { border-color: var(--border-glow); transform: translateY(-1px); }

.stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.stat-card:nth-child(1) .stat-num { color: var(--cyan); }
.stat-card:nth-child(2) .stat-num { color: var(--purple); }
.stat-card:nth-child(3) .stat-num { color: var(--orange); }
.stat-card:nth-child(4) .stat-num { color: var(--green); }

.stat-label { font-size: 0.78rem; color: #a0b4c8; margin-top: 5px; font-weight: 500; }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-card:nth-child(1) .stat-icon { background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.15); }
.stat-card:nth-child(2) .stat-icon { background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.15); }
.stat-card:nth-child(3) .stat-icon { background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.15); }
.stat-card:nth-child(4) .stat-icon { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.15); }

/* ── Two-col ─────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
thead { background: var(--bg-3); }
th {
  text-align: left; padding: 10px 14px;
  color: var(--text-3); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-3); }
.empty-row { text-align: center; color: var(--text-3) !important; padding: 40px !important; font-size: 0.88rem !important; }
.contact-row td:nth-child(2) { font-weight: 600; color: var(--text); }
.contact-row td:nth-child(3) { font-family: monospace; font-size: 0.83rem; color: var(--cyan); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: white; border: none;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 0.86rem; font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(34,197,94,0.35); }

.btn-secondary {
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--border);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.86rem; font-weight: 500; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--border-glow); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,0.1); color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.86rem; font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.35); }

.btn-blast {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: white; border: none;
  padding: 7px 14px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px rgba(34,197,94,0.3);
  transition: all var(--transition);
}
.btn-blast:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(34,197,94,0.4); }

.btn-del {
  background: none; border: none; color: var(--text-3);
  cursor: pointer; padding: 5px 8px; border-radius: 7px;
  transition: all var(--transition); font-size: 0.9rem;
}
.btn-del:hover { background: rgba(239,68,68,0.1); color: #f87171; }

.btn-icon {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  padding: 5px 12px; border-radius: 7px;
  font-size: 0.82rem; font-family: inherit;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--border-glow); color: var(--text); }

.btn-link-danger { background:none; border:none; color:#f87171; cursor:pointer; font-size:0.82rem; padding:0; font-family:inherit; }

/* ── Forms ───────────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 0.82rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field-hint { font-size: 0.78rem; color: var(--text-3); }

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.86rem; }
.radio-group label {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; color: var(--text-2); font-weight: 500;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  background: var(--bg-3);
}
.radio-group label:has(input:checked) {
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.08);
  color: var(--green);
}

.input-field {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  font-size: 0.86rem; outline: none; width: 100%; max-width: 360px;
  font-family: inherit; color: var(--text);
  background: var(--bg-3);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-field:focus {
  border-color: rgba(34,197,94,0.5);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
.input-field option { background: var(--bg-2); }

textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.86rem; font-family: inherit; resize: vertical;
  outline: none; color: var(--text); background: var(--bg-3); line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea:focus { border-color: rgba(34,197,94,0.5); box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }

.schedule-form { display: flex; flex-direction: column; gap: 22px; }

.days-row { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.83rem; }
.days-row label {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg-3); color: var(--text-2);
  transition: all var(--transition);
}
.days-row label:has(input:checked) { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.08); color: var(--green); }

/* Step labels */
.step-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #000; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; flex-shrink: 0;
}

/* ── Pick list ───────────────────────────────────────────── */
.pick-list {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 220px; overflow-y: auto; background: var(--bg-3);
}
.pick-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 0.86rem; transition: background var(--transition);
}
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: var(--bg-4); }
.pick-item label { cursor: pointer; flex: 1; }
.pick-item .pick-name { font-weight: 600; color: var(--text); }
.pick-item .pick-sub { color: var(--text-3); font-size: 0.78rem; margin-top: 2px; }
.empty-pick { color: var(--text-3); font-size: 0.86rem; padding: 20px; text-align: center; }

/* ── Templates ───────────────────────────────────────────── */
.tmpl-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.tmpl-item:last-child { border-bottom: none; }
.tmpl-num {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000; font-weight: 800; font-size: 0.7rem;
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.tmpl-body { flex: 1; }
.tmpl-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.tmpl-text { font-size: 0.8rem; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.tmpl-meta { font-size: 0.75rem; color: var(--cyan); margin-top: 4px; display: flex; gap: 10px; }
.tmpl-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Schedule card ───────────────────────────────────────── */
.schedule-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  transition: all var(--transition);
}
.schedule-card:hover { border-color: var(--border-glow); background: var(--bg-4); }
.sch-info { flex: 1; font-size: 0.84rem; color: var(--text-2); line-height: 1.8; }
.sch-title { font-weight: 600; color: var(--text); font-size: 0.9rem; margin-bottom: 6px; }
.sch-detail { display: flex; flex-wrap: wrap; gap: 6px; }
.sch-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px;
  font-size: 0.74rem; color: var(--text-2); font-weight: 500;
}
.sch-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
}
.sch-status.active { background: rgba(34,197,94,0.1); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.sch-status.done { background: var(--bg-2); color: var(--text-3); border: 1px solid var(--border); }
.sch-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ── Queue & Log ─────────────────────────────────────────── */
.queue-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; transition: background var(--transition);
}
.queue-item:last-child { border-bottom: none; }
.queue-item:hover { background: var(--bg-3); }
.queue-name { font-weight: 600; color: var(--text); }
.queue-phone { color: var(--cyan); font-size: 0.78rem; font-family: monospace; }
.queue-time { font-size: 0.78rem; color: var(--text-3); text-align: right; }

.log-entry { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.log-entry:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; margin-top: 6px; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.log-dot.failed { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.log-body { flex: 1; }
.log-time { font-size: 0.75rem; color: #7a95b0; margin-bottom: 2px; }
.log-result { font-weight: 600; font-size: 0.86rem; color: #f1f5f9; }
.log-preview { font-size: 0.8rem; color: #a0b4c8; margin-top: 2px; }

/* ── Rotation preview ────────────────────────────────────── */
.rotation-preview {
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(0,212,255,0.04));
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 8px;
  font-size: 0.83rem; color: var(--green); line-height: 1.9;
}

.gap-preview {
  font-size: 0.82rem; color: var(--cyan); font-weight: 600;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 4px 10px; border-radius: 7px;
}

/* ── Info hint box ───────────────────────────────────────── */
.info-box {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: rgba(0,212,255,0.8);
  margin-bottom: 14px;
}

/* ── QR section ──────────────────────────────────────────── */
#qr-section {
  background: var(--bg-2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 28px; text-align: center; margin-bottom: 20px;
}
#qr-img { width: 200px; height: 200px; border: 2px solid var(--border); border-radius: var(--radius-sm); margin-top: 14px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--bg-4); color: var(--text);
  padding: 12px 22px; border-radius: 10px;
  font-size: 0.86rem; font-weight: 500;
  opacity: 0; transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999; pointer-events: none; max-width: 380px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); border: 1px solid var(--border);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #052e16; border-color: rgba(34,197,94,0.3); color: #86efac; }
.toast.error { background: #1c0a0a; border-color: rgba(239,68,68,0.3); color: #fca5a5; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }

@media (max-width: 900px) {
  :root { --sidebar-w: 68px; }
  .brand-text, .nav-item span:not(.nav-icon), .sidebar-footer span, .nav-section-label { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-logo { justify-content: center; padding: 16px 0; }
  .page-header { padding: 16px 20px; }
  .page-content { padding: 20px; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .page-content { padding: 14px; }
  .wa-status-card { flex-direction: column; align-items: flex-start; gap: 14px; }
}
