/* ============================================================
   WhatsApp Blast Dashboard — Light Theme Modern
   Inspired by Watzap UI patterns
   ============================================================ */

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

:root {
  /* Surfaces */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #f1f4f9;
  --border: #e6e9ef;
  --border-strong: #d4d9e2;
  --border-hover: #c8cfdb;

  /* Text */
  --text: #1a1f2e;
  --text-2: #4a5468;
  --text-dim: #7a8499;
  --text-muted: #a3acbd;

  /* Brand colors */
  --primary: #25d366;
  --primary-dark: #128c4e;
  --primary-light: #d4f5dc;
  --primary-soft: #ecfaf0;

  /* Aliases */
  --accent: var(--primary);
  --accent-hover: var(--primary-dark);
  --accent-soft: var(--primary-soft);

  /* Color tokens (synced dari blast — adaptive light/dark) */
  --purple: #a855f7;
  --purple-bg: #f5e9ff;
  --purple-text: #6b21a8;
  --purple-border: rgba(168, 85, 247, 0.28);

  --amber: #f59e0b;
  --amber-bg: #fef5e7;
  --amber-text: #92520a;
  --amber-border: rgba(245, 158, 11, 0.32);

  --red: #ef4444;
  --red-bg: #fee8e8;
  --red-text: #991b1b;
  --red-border: rgba(239, 68, 68, 0.28);

  --blue: #3b82f6;
  --blue-bg: #e8f0fe;
  --blue-text: #1e40af;
  --blue-border: rgba(59, 130, 246, 0.28);

  --gray-bg: #f1f5f9;
  --gray-text: #475569;
  --gray-border: #e2e8f0;

  /* Accent (sidebar gradient inspired by Watzap) */
  --grad-start: #6366f1;   /* indigo */
  --grad-mid: #a855f7;     /* purple */
  --grad-end: #ec4899;     /* pink */
  --gradient-sidebar: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  --gradient-active: linear-gradient(135deg, #25d366 0%, #16a34a 100%);

  /* Status */
  --success: #25d366;
  --success-bg: #ecfaf0;
  --success-text: #0d6c30;
  --warning: #f59e0b;
  --warning-bg: #fef5e7;
  --warning-text: #92520a;
  --danger: #ef4444;
  --danger-bg: #fee8e8;
  --danger-text: #991b1b;
  --info: #3b82f6;
  --info-bg: #e8f0fe;
  --info-text: #1e40af;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  flex-shrink: 0;
}

.sidebar-brand {
  background: var(--gradient-sidebar);
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text { flex: 1; min-width: 0; }
.brand-name { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.7rem; opacity: 0.8; margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.625rem;
  overflow-y: auto;
}

.nav-section {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.875rem 0.75rem 0.4rem;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nav-item svg {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.15s;
}

.nav-item:hover svg { color: var(--text-2); }

.nav-item.active {
  background: var(--gradient-active);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.nav-item.active svg { color: white; }

.nav-item span:first-of-type { flex: 1; }

.nav-badge {
  background: rgba(37, 211, 102, 0.15);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.nav-tag {
  font-size: 0.625rem;
  padding: 0.1rem 0.4rem;
  background: var(--warning-bg);
  color: var(--warning-text);
  border-radius: 999px;
  font-weight: 600;
}

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

.user-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-sidebar);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-dim); }

.logout-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.logout-icon:hover { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
}

.topbar-menu {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: none;
}

.topbar-menu:hover { background: var(--surface-3); }

.topbar-title h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-title p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.topbar-title { flex: 1; }

.user-switcher {
  display: flex;
  align-items: center;
}

.user-switcher select {
  background: linear-gradient(135deg, #fef5e7 0%, #fef9e7 100%);
  border: 1px solid #f59e0b;
  color: var(--warning-text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.625rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin: 0;
  width: auto;
  min-width: 200px;
}

.user-switcher select:hover {
  background: linear-gradient(135deg, #fde9b8 0%, #fef3c7 100%);
}

.topbar-clock {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.875rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.topbar-clock svg { color: var(--primary); }
.topbar-clock span {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}
.topbar-clock small {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* NOW button beside time inputs */
.input-with-btn {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.input-with-btn .input {
  flex: 1;
  margin-bottom: 0;
}

.btn-now {
  background: var(--gradient-active);
  color: white;
  border: none;
  padding: 0.55rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
}

.btn-now:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.35);
}

.btn-now:active { transform: scale(0.96); }

@media (max-width: 600px) {
  .topbar-clock small { display: none; }
  .topbar-clock span { font-size: 0.78rem; }
}

/* ============================================================
   SECTIONS (page content)
   ============================================================ */
.section {
  display: none;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-green { background: var(--primary-soft); color: var(--primary); }
.stat-icon-blue { background: var(--info-bg); color: var(--info); }
.stat-icon-orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon-red { background: var(--danger-bg); color: var(--danger); }
.stat-icon-purple { background: #f3eafd; color: #8b5cf6; }

.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0.1rem 0; letter-spacing: -0.01em; }
.stat-meta { font-size: 0.72rem; color: var(--text-muted); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.card-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.625rem;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
}

.quick-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.quick-icon { font-size: 1.1rem; }
.quick-label { font-weight: 500; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-active);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
.btn-block { width: 100%; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-2);
  transition: all 0.15s;
  font-family: inherit;
}

.btn-icon:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-icon.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.input,
input.input,
select.input,
textarea.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 0.5rem;
}

textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }

.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.input-sm { padding: 0.35rem 0.6rem; font-size: 0.78rem; width: auto; margin: 0; }

.hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.hint code {
  background: var(--surface-3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  color: var(--primary-dark);
  font-size: 0.78rem;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead {
  background: var(--surface-3);
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.875rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.col-num { text-align: right; }
.col-action { width: 1%; white-space: nowrap; }

.empty-row {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem 1rem !important;
  font-style: italic;
}

/* Number cell with phone + sessionId */
.number-cell {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.number-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.number-info-row { display: flex; flex-direction: column; }
.number-phone { font-weight: 600; font-size: 0.875rem; }
.number-session { font-size: 0.72rem; color: var(--text-dim); }

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
}

.pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-success { background: var(--success-bg); color: var(--success-text); }
.pill-warning { background: var(--warning-bg); color: var(--warning-text); }
.pill-danger { background: var(--danger-bg); color: var(--danger-text); }
.pill-info { background: var(--info-bg); color: var(--info-text); }

.pill-warning::before, .pill-info::before { animation: pillPulse 1.5s ease-in-out infinite; }
@keyframes pillPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   STEPS (broadcast wizard)
   ============================================================ */
.step-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.875rem;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--gradient-active);
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-head h3 {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.step-counter {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--surface);
  padding: 0.15rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.tab-content { display: block; }
.tab-content.hidden { display: none; }

/* File drop zone */
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  color: var(--text-dim);
}

.file-drop:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.file-drop.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(1.005);
}

.file-drop-text { font-size: 0.875rem; color: var(--text); font-weight: 500; }
.file-drop-hint { font-size: 0.75rem; }

.link-small {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--info);
  font-weight: 500;
}
.link-small:hover { text-decoration: underline; }

/* Contact preview */
.contact-preview {
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-header {
  padding: 0.5rem 0.75rem;
  background: var(--surface-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 500;
}

.preview-table {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.78rem;
}

.preview-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.preview-row:last-child { border-bottom: none; }
.preview-row.invalid { color: var(--danger); }

/* Pool grid */
.pool-actions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.625rem;
}

.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.pool-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.85rem;
}

.pool-item:hover { border-color: var(--border-hover); }
.pool-item.checked { border-color: var(--primary); background: var(--primary-soft); }

.pool-item input[type='checkbox'] {
  width: auto;
  accent-color: var(--primary);
  cursor: pointer;
}

.pool-item-info { flex: 1; min-width: 0; }
.pool-item-name { font-weight: 500; font-size: 0.825rem; }
.pool-item-phone { font-size: 0.7rem; color: var(--text-dim); }

/* Campaign summary */
.campaign-summary {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.summary-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-2);
  min-width: 200px;
}
.summary-text strong { color: var(--text); }

.active-campaign {
  margin-top: 0.875rem;
  padding: 1rem;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
}

.campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}

.progress-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 0.625rem;
  flex-wrap: wrap;
}

.progress-stats strong { color: var(--text); }

.progress-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-active);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ============================================================
   ACTIVITY LOG
   ============================================================ */
.log-container {
  background: #0c1525;
  border: 1px solid #1f2a44;
  border-radius: var(--radius);
  font-family: 'SF Mono', Monaco, 'Consolas', monospace;
  font-size: 0.78rem;
  height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  scroll-behavior: smooth;
}

.log-container .empty-row {
  color: #5f6a85;
  background: transparent;
}

.log-entry {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.625rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  animation: logSlideIn 0.25s ease-out;
  margin-bottom: 0.1rem;
  color: #d1d8ec;
}

@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-entry:hover { background: rgba(255, 255, 255, 0.04); }

.log-time {
  color: #5f6a85;
  font-size: 0.72rem;
  white-space: nowrap;
}

.log-type {
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  height: fit-content;
  white-space: nowrap;
}

.log-entry.success .log-type { background: rgba(37, 211, 102, 0.15); color: #4ade80; }
.log-entry.error .log-type { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.log-entry.warning .log-type { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.log-entry.info .log-type { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }

.log-entry.banned-alert {
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid var(--danger);
  animation: bannedFlash 1.5s ease-in-out 2;
}

@keyframes bannedFlash {
  0%, 100% { background: rgba(239, 68, 68, 0.12); }
  50% { background: rgba(239, 68, 68, 0.25); }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.modal-subtitle {
  font-size: 0.825rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.875rem;
}

.modal-qr { text-align: center; max-width: 380px; }

.qr-container {
  position: relative;
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  margin: 0.875rem 0;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}

.qr-container img {
  width: 100%;
  max-width: 280px;
  display: block;
  animation: qrFadeIn 0.4s ease-out;
}

@keyframes qrFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.qr-container img[src=''] { display: none; }

.qr-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdfa 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  border-radius: var(--radius);
  gap: 1rem;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.qr-placeholder.hidden { display: none; }

.loader-ring {
  width: 56px;
  height: 56px;
  border: 4px solid #e0f2fe;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.5, 0.1, 0.5, 1) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}

.dots span {
  animation: dotJump 1.4s infinite;
  display: inline-block;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotJump {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.qr-success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: var(--radius);
  color: #059669;
  font-weight: 600;
}
.qr-success.hidden { display: none; }

.checkmark { width: 80px; height: 80px; margin-bottom: 0.75rem; }
.checkmark svg circle {
  stroke: #059669; stroke-width: 2;
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: drawCircle 0.6s ease-in-out forwards;
}
.checkmark svg path {
  stroke: #059669; stroke-width: 4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: drawCheck 0.4s 0.4s ease-in-out forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  font-size: 0.825rem;
  z-index: 200;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.hidden { display: none; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar-menu { display: flex; align-items: center; justify-content: center; }
}

/* ============================================================
   RAWAT-SPECIFIC: Sliders, toggles, day chips, campaign cards
   ============================================================ */

/* Range sliders */
.slider-group {
  margin-bottom: 1rem;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

.slider-label strong { color: var(--primary-dark); }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.4);
  transition: transform 0.15s;
  border: 3px solid white;
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.4);
}

.slider:hover::-webkit-slider-thumb,
.slider:focus::-webkit-slider-thumb { transform: scale(1.15); }

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-strong);
  transition: 0.3s;
  border-radius: 999px;
}

.toggle-slider::before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gradient-active);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-info { flex: 1; }
.toggle-info strong { display: block; font-size: 0.85rem; color: var(--text); }
.toggle-info small { font-size: 0.75rem; color: var(--text-dim); }

/* Schedule */
.schedule-times {
  display: flex;
  gap: 0.75rem;
}

.time-input { flex: 1; }
.time-input label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.day-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  user-select: none;
}

.day-chip input { display: none; }
.day-chip:hover { border-color: var(--border-hover); }
.day-chip:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Fallback for browsers without :has support */
.day-chip.checked {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Campaign cards (active list) */
.campaigns-list {
  display: grid;
  gap: 0.875rem;
}

.campaign-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  transition: border-color 0.15s;
}

.campaign-card:hover { border-color: var(--border-hover); }
.campaign-card.status-running { border-left: 3px solid var(--primary); }
.campaign-card.status-paused { border-left: 3px solid var(--warning); }
.campaign-card.status-stopped { border-left: 3px solid var(--text-muted); opacity: 0.7; }

.campaign-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.campaign-name {
  font-size: 1rem;
  font-weight: 600;
}

.campaign-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.campaign-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.625rem;
}

.campaign-stat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.campaign-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
}

.campaign-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.1rem;
}

.campaign-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.campaign-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.campaign-detail span { display: flex; align-items: center; gap: 0.25rem; }
.campaign-detail strong { color: var(--text-2); }

@media (max-width: 600px) {
  .schedule-times { flex-direction: column; }
  .days-grid { grid-template-columns: repeat(4, 1fr); }

  .section { padding: 1rem; }
  .card { padding: 1rem; }
  .stat-grid { gap: 0.625rem; grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 0.875rem; }
  .stat-value { font-size: 1.25rem; }
  .pool-grid { grid-template-columns: 1fr; }
  .data-table th:nth-child(3),
  .data-table td:nth-child(3) { display: none; }
  .progress-stats { gap: 0.75rem; }
}


/* ============================================================
   THEME TOGGLE BUTTON (inline in topbar)
   ============================================================ */
.theme-toggle-inline {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.theme-toggle-inline:hover {
  transform: scale(1.08) rotate(15deg);
  border-color: var(--primary);
}
.theme-toggle-inline .theme-icon-light { display: none; }
[data-theme="dark"] .theme-toggle-inline .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-toggle-inline .theme-icon-light { display: inline; }

/* ============================================================
   DARK THEME OVERRIDES (light by default)
   ============================================================ */
[data-theme="dark"] {
  --bg: #050810;
  --surface: #0f1626;
  --surface-2: #161f33;
  --surface-3: #1f2a44;
  --border: #1f2a44;
  --border-strong: #2c3a5c;
  --border-hover: #3a4a6e;
  --text: #e8eef9;
  --text-2: #b8c2d6;
  --text-dim: #8b97b1;
  --text-muted: #5f6a85;
  --primary-soft: rgba(37, 211, 102, 0.12);
  --primary-light: rgba(37, 211, 102, 0.18);
  --success-bg: rgba(37, 211, 102, 0.12);
  --success-text: #4ade80;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-text: #fbbf24;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-text: #fca5a5;
  --info-bg: rgba(59, 130, 246, 0.12);
  --info-text: #93c5fd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Color tokens dark overrides (synced dari blast) */
  --purple-bg: rgba(168, 85, 247, 0.14);
  --purple-text: #d8b4fe;
  --purple-border: rgba(168, 85, 247, 0.32);

  --amber-bg: rgba(245, 158, 11, 0.14);
  --amber-text: #fbbf24;
  --amber-border: rgba(245, 158, 11, 0.32);

  --red-bg: rgba(239, 68, 68, 0.14);
  --red-text: #fca5a5;
  --red-border: rgba(239, 68, 68, 0.32);

  --blue-bg: rgba(59, 130, 246, 0.14);
  --blue-text: #93c5fd;
  --blue-border: rgba(59, 130, 246, 0.32);

  --gray-bg: rgba(148, 163, 184, 0.12);
  --gray-text: #cbd5e1;
  --gray-border: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .sidebar { background: var(--surface); border-right-color: var(--border); }
[data-theme="dark"] .nav-item:hover { background: var(--surface-2); }
[data-theme="dark"] .nav-badge { background: var(--primary-soft); color: #4ade80; }
[data-theme="dark"] .user-card { background: var(--surface-2); }
[data-theme="dark"] .topbar { background: var(--surface); border-bottom-color: var(--border); }
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .quick-btn { background: var(--surface-2); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .quick-btn:hover { background: var(--surface-3); border-color: var(--primary); }
[data-theme="dark"] .data-table thead { background: var(--surface-2); }
[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td { border-bottom-color: var(--border); }
[data-theme="dark"] .data-table tbody tr:hover { background: var(--surface-2); }
[data-theme="dark"] .number-avatar { background: var(--primary-soft); color: #4ade80; }
[data-theme="dark"] .step-box { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .step-counter { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .input,
[data-theme="dark"] input.input,
[data-theme="dark"] select.input,
[data-theme="dark"] textarea.input {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
[data-theme="dark"] .pool-item { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .pool-item.checked { background: var(--primary-soft); border-color: var(--primary); }
[data-theme="dark"] .campaign-summary { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
[data-theme="dark"] .btn-secondary:hover { background: var(--surface-3); border-color: var(--border-hover); }
[data-theme="dark"] .btn-icon { background: transparent; border-color: var(--border); color: var(--text-2); }
[data-theme="dark"] .btn-icon:hover { background: var(--surface-2); }
[data-theme="dark"] .modal-content { background: var(--surface); border: 1px solid var(--border); }
[data-theme="dark"] .toast { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .qr-container { background: white; border-color: var(--border); }
[data-theme="dark"] .qr-success { background: var(--surface); }
[data-theme="dark"] .qr-placeholder { background: linear-gradient(135deg, #161f33 0%, #1f2a44 50%, #2c3a5c 100%); }
[data-theme="dark"] .loader-text { color: var(--text-2); }
[data-theme="dark"] .empty-row { color: var(--text-dim); }
[data-theme="dark"] .hint code { background: var(--surface-2); color: #4ade80; }

/* Rawat-specific dark */
[data-theme="dark"] .toggle-row { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .day-chip { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-2); }
[data-theme="dark"] .day-chip:has(input:checked),
[data-theme="dark"] .day-chip.checked { background: var(--primary-soft); border-color: var(--primary); color: #4ade80; }
[data-theme="dark"] .stat-icon-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
[data-theme="dark"] .campaign-card { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .campaign-stat { background: var(--surface); }
[data-theme="dark"] .topbar-clock { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .topbar-clock span { color: var(--text); }
[data-theme="dark"] .user-switcher select {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-color: #b45309;
  color: #fbbf24;
}

/* ============================================================
   FIX: Theme toggle icon swap (force display rules)
   ============================================================ */
.theme-toggle-inline .theme-icon-dark,
.theme-toggle-inline .theme-icon-light {
  line-height: 1;
}
.theme-toggle-inline .theme-icon-dark { display: inline !important; }
.theme-toggle-inline .theme-icon-light { display: none !important; }

[data-theme="dark"] .theme-toggle-inline .theme-icon-dark { display: none !important; }
[data-theme="dark"] .theme-toggle-inline .theme-icon-light { display: inline !important; }

/* External link nav item */
.nav-external .nav-arrow {
  margin-left: auto;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.nav-external:hover .nav-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Dark theme override */
[data-theme="dark"] .topbar-clock {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-2);
}
[data-theme="dark"] .topbar-clock span { color: var(--text); }

/* ============================================================
   HEALTH BADGES & DETAIL MODAL
   ============================================================ */
.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.health-pill:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.health-healthy { background: rgba(34, 197, 94, 0.12); color: #15803d; border-color: rgba(34, 197, 94, 0.3); }
.health-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.3); }
.health-risk { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }

/* Dark theme variants */
[data-theme="dark"] .health-healthy { background: rgba(34, 197, 94, 0.2); color: #4ade80; border-color: rgba(34, 197, 94, 0.4); }
[data-theme="dark"] .health-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border-color: rgba(245, 158, 11, 0.4); }
[data-theme="dark"] .health-risk { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }

/* Health detail modal */
.modal-large { max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-header h2 { margin: 0; font-size: 1.1rem; }
.modal-close {
  background: transparent; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--text-dim); padding: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.health-hero {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem; border-radius: 14px; margin-bottom: 1rem;
}
.health-hero-healthy { background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04)); border: 1px solid rgba(34, 197, 94, 0.25); }
.health-hero-warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04)); border: 1px solid rgba(245, 158, 11, 0.25); }
.health-hero-risk { background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04)); border: 1px solid rgba(239, 68, 68, 0.25); }
.health-hero-emoji { font-size: 2.5rem; line-height: 1; }
.health-hero-label { font-size: 1.25rem; font-weight: 700; }
.health-hero-desc { font-size: 0.825rem; color: var(--text-dim); margin-top: 0.2rem; }

.health-info-grid, .health-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.625rem;
}
.info-block, .health-stat {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
}
.info-label, .health-stat-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.info-value { font-size: 0.875rem; font-weight: 600; margin-top: 0.2rem; word-break: break-all; }
.info-value.mono { font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 0.825rem; }
.health-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; margin-top: 0.3rem; }

.modal-content h3 {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .health-info-grid, .health-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Spin-text preview */
.template-help { margin-top: 0.5rem; }
.template-help .hint { margin: 0.3rem 0; }
.template-help code {
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8em;
  border: 1px solid var(--border);
}
.spin-preview {
  margin-top: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}
.spin-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.spin-preview-list { display: flex; flex-direction: column; gap: 0.4rem; }
.spin-sample {
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  border-left: 3px solid #25D366;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Log filter status & search highlight */
.log-filter-status {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  padding: 0.5rem 0.875rem;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 0.5rem;
  border-radius: 4px;
}
.log-message mark {
  background: rgba(245, 158, 11, 0.35);
  color: inherit;
  padding: 0 0.15rem;
  border-radius: 2px;
  font-weight: 600;
}
.card-actions { flex-wrap: wrap; gap: 0.5rem; }

/* ============================================================
   ANALYTICS DASHBOARD
   ============================================================ */
.analytics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.range-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}
.range-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.875rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  font-family: inherit;
}
.range-btn:hover { color: var(--text); }
.range-btn.active {
  background: var(--surface);
  color: var(--primary, #25D366);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.analytics-info {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.analytics-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.analytics-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.analytics-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.analytics-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.15rem;
  line-height: 1;
}

.analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
}
.analytics-card h3 {
  margin: 0 0 0.875rem 0;
  font-size: 0.95rem;
}
.analytics-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.analytics-row-2col > .analytics-card { margin-bottom: 0; }
@media (max-width: 800px) {
  .analytics-row-2col { grid-template-columns: 1fr; }
}

.chart-wrap { position: relative; }

/* HEATMAP */
.heatmap-grid { overflow-x: auto; }
.heatmap-table {
  display: inline-block;
  min-width: 100%;
  font-size: 0.7rem;
}
.heatmap-row {
  display: grid;
  grid-template-columns: 60px repeat(24, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.heatmap-cell {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
}
.heatmap-day {
  font-weight: 600;
  font-size: 0.7rem;
  background: transparent;
  color: var(--text-dim);
  justify-content: flex-start;
  padding-left: 0.25rem;
}
.heatmap-hour-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  background: transparent;
}
.heatmap-data {
  font-size: 0.65rem;
  font-weight: 600;
  color: #14532d;
  cursor: default;
}
[data-theme="dark"] .heatmap-data { color: #ecfdf5; }
.heatmap-legend {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.legend-gradient {
  width: 120px;
  height: 8px;
  background: linear-gradient(90deg, var(--surface-2), rgba(34, 197, 94, 0.95));
  border-radius: 4px;
}

/* LEADERBOARD */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.leaderboard-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.leaderboard-table th.num,
.leaderboard-table td.num { text-align: right; }
.leaderboard-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table small { color: var(--text-dim); font-size: 0.72rem; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--surface-2);
  color: var(--text-2);
}
.rank-1 { background: #fef08a; color: #713f12; }
.rank-2 { background: #e2e8f0; color: #334155; }
.rank-3 { background: #fde68a; color: #78350f; }
[data-theme="dark"] .rank-1 { background: #ca8a04; color: #fef9c3; }
[data-theme="dark"] .rank-2 { background: #475569; color: #f8fafc; }
[data-theme="dark"] .rank-3 { background: #b45309; color: #fef3c7; }

/* Card Analytics gradient (login dashboard) */
.shortcut-card.grad-cyan .card-icon { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }

/* Cycle cooldown banner */
.cycle-cooldown-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  margin: 0.625rem 0;
  font-size: 0.85rem;
  color: var(--text);
}
[data-theme="dark"] .cycle-cooldown-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(180, 83, 9, 0.12));
  border-color: rgba(251, 191, 36, 0.4);
}
.cycle-progress-bar {
  margin-top: 0.5rem;
  height: 6px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.15);
  overflow: hidden;
}
.cycle-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ============================================================
   DAILY CAP PRESETS + BADGE
   ============================================================ */
.cap-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.cap-preset-btn {
  flex: 1;
  min-width: 110px;
  padding: 0.625rem 0.875rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cap-preset-btn:hover {
  border-color: var(--primary, #25D366);
  color: var(--text);
}
.cap-preset-btn.active {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(22, 163, 74, 0.06));
  border-color: var(--primary, #25D366);
  color: var(--primary-dark, #128c4e);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.cap-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cap-very-safe { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.cap-recommended { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.cap-medium { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.cap-aggressive { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.cap-unlimited { background: rgba(168, 85, 247, 0.15); color: #9333ea; }
[data-theme="dark"] .cap-very-safe { background: rgba(34, 197, 94, 0.25); color: #86efac; }
[data-theme="dark"] .cap-recommended { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
[data-theme="dark"] .cap-medium { background: rgba(245, 158, 11, 0.25); color: #fbbf24; }
[data-theme="dark"] .cap-aggressive { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
[data-theme="dark"] .cap-unlimited { background: rgba(168, 85, 247, 0.25); color: #c4b5fd; }

/* Daily Cap Banner di campaign card */
.daily-cap-banner {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  margin: 0.625rem 0;
  font-size: 0.85rem;
}
.daily-cap-banner.approaching {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}
.daily-cap-banner.at-cap {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}
.cap-stat-ok { color: #16a34a; font-weight: 600; }
.cap-stat-soft { color: #d97706; font-weight: 600; }
.cap-stat-warn { color: #dc2626; font-weight: 600; }
[data-theme="dark"] .cap-stat-ok { color: #4ade80; }
[data-theme="dark"] .cap-stat-soft { color: #fbbf24; }
[data-theme="dark"] .cap-stat-warn { color: #fca5a5; }

/* ============================================================
   TEMPLATE ANALYSIS
   ============================================================ */
.template-analysis {
  margin-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.analysis-item {
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.analysis-item small { color: var(--text-2); }
.analysis-item code {
  background: var(--surface-2);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-size: 0.78em;
}
.analysis-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #166534;
}
.analysis-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
}
.analysis-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #991b1b;
}
[data-theme="dark"] .analysis-success { color: #86efac; }
[data-theme="dark"] .analysis-warning { color: #fcd34d; }
[data-theme="dark"] .analysis-error { color: #fca5a5; }

/* ============================================================
   CAMPAIGN DETAIL MODAL
   ============================================================ */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
  padding: 0.25rem 0;
}
.detail-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.125rem;
}
.detail-section h3 {
  margin: 0 0 0.875rem 0;
  font-size: 0.95rem;
  color: var(--text);
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.625rem;
}
.detail-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
}
.detail-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.detail-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.2rem;
  letter-spacing: -0.02em;
}

.detail-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
  font-size: 0.88rem;
}
.detail-label {
  color: var(--text-dim);
  margin-right: 0.4rem;
}

.detail-pool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}
.detail-pool-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.detail-pool-name {
  font-weight: 600;
  color: var(--text);
}
.detail-pool-sent {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.detail-templates-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.detail-template-item {
  display: flex;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.detail-template-num {
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 24px;
}
.detail-template-text {
  font-family: inherit;
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.detail-banner {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}
.detail-banner-warn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text);
}

.campaign-status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.campaign-status-pill.status-running {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.campaign-status-pill.status-paused {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}
.campaign-status-pill.status-stopped {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
[data-theme="dark"] .campaign-status-pill.status-running { background: rgba(34, 197, 94, 0.25); color: #4ade80; }
[data-theme="dark"] .campaign-status-pill.status-paused { background: rgba(245, 158, 11, 0.25); color: #fbbf24; }
[data-theme="dark"] .campaign-status-pill.status-stopped { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }

/* ============================================================
   PROXY BADGE & MODAL
   ============================================================ */
.proxy-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.proxy-on {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(22, 163, 74, 0.1));
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.proxy-off {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
[data-theme="dark"] .proxy-on { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

.proxy-test-loading {
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.85rem;
  color: var(--text-2);
}
.proxy-test-success {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #166534;
  font-size: 0.85rem;
  line-height: 1.6;
}
.proxy-test-fail {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #991b1b;
  font-size: 0.88rem;
}
[data-theme="dark"] .proxy-test-success { color: #86efac; }
[data-theme="dark"] .proxy-test-fail { color: #fca5a5; }

/* ============================================================
   COUNTDOWN BANNER (live tick di Log Aktivitas)
   ============================================================ */
.countdown-banner {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.06), rgba(59, 130, 246, 0.04));
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 0.875rem;
}
[data-theme="dark"] .countdown-banner {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.08), rgba(59, 130, 246, 0.06));
  border-color: rgba(34, 197, 94, 0.3);
}
.countdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}
.countdown-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.countdown-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.countdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.countdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.countdown-item-main {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}
.countdown-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.countdown-info {
  flex: 1;
  min-width: 0;
}
.countdown-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.countdown-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}
.countdown-time {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary, #25D366);
  flex-shrink: 0;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.countdown-soon .countdown-time {
  color: #d97706;
  animation: pulseSoon 1s ease-in-out infinite;
}
.countdown-urgent {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}
.countdown-urgent .countdown-time {
  color: #dc2626;
  animation: pulseUrgent 0.6s ease-in-out infinite;
}
@keyframes pulseSoon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes pulseUrgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@media (max-width: 600px) {
  .countdown-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .countdown-time {
    align-self: flex-end;
  }
}

/* ============================================================
   POOL TABLE: ROW INACTIVE + ACTIONS + HEALTH PERCENT (v9.17)
   ============================================================ */
.row-inactive {
  background: var(--surface-2) !important;
  opacity: 0.78;
}
.row-inactive td {
  background: transparent !important;
}
.row-inactive .number-phone,
.row-inactive .number-session {
  color: var(--text-dim) !important;
}

/* ============================================================
   POOL TABLE: ROW INACTIVE + ACTIONS + HEALTH PERCENT (v9.17/18)
   ============================================================ */
.row-inactive {
  background: var(--surface-2) !important;
  opacity: 0.78;
}
.row-inactive td {
  background: transparent !important;
}
.row-inactive .number-phone,
.row-inactive .number-session {
  color: var(--text-dim) !important;
}

/* Action button group — selalu 1 baris di desktop */
.action-btns-row {
  display: inline-flex;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
/* Normalize semua tombol di action row jadi tinggi sama */
.action-btns-row .btn,
.action-btns-row .btn-icon {
  height: 30px;
  min-width: 30px;
  padding: 0 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.action-btns-row .btn-icon {
  padding: 0;
  width: 30px;
}
.action-btns-row .btn-sm {
  padding: 0 0.6rem;
  font-size: 0.76rem;
}

.col-action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

/* === Mobile responsive: stack table jadi card-list === */
@media (max-width: 768px) {
  /* Sembunyikan header table di mobile */
  table.pool-table thead,
  #numbersTable thead {
    display: none;
  }
  table.pool-table,
  table.pool-table tbody,
  #numbersTable,
  #numbersTable tbody {
    display: block;
  }
  table.pool-table tr,
  #numbersTable tr {
    display: block;
    margin-bottom: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  table.pool-table td,
  #numbersTable td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border: none;
    text-align: right;
  }
  /* Label otomatis di kiri tiap cell pakai data attribute */
  table.pool-table td::before,
  #numbersTable td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-dim);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: auto;
    text-align: left;
  }
  /* First cell (nomor info) full width tanpa label */
  table.pool-table td:first-child,
  #numbersTable td:first-child {
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.7rem;
    margin-bottom: 0.4rem;
    justify-content: flex-start;
    text-align: left;
  }
  table.pool-table td:first-child::before,
  #numbersTable td:first-child::before {
    display: none;
  }
  /* Action buttons pas di mobile — center align di bawah */
  .action-btns-row {
    justify-content: flex-end;
  }
  .row-inactive {
    border-color: rgba(245, 158, 11, 0.35) !important;
  }
}

@media (max-width: 480px) {
  .action-btns-row {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .action-btns-row .btn,
  .action-btns-row .btn-icon {
    flex: 1 1 auto;
  }
}

/* === Search bar di pool === */
.pool-toolbar {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.875rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px dashed var(--border);
}
.pool-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}
.pool-search-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 0.95rem;
}
.pool-search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.15s;
}
.pool-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}
.pool-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: none;
  border-radius: 99px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1;
}
.pool-search-clear:hover {
  background: var(--surface-3);
  color: var(--text);
}
.pool-toolbar-stats {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-left: auto;
}
.pool-toolbar-stats strong {
  color: var(--text);
  font-weight: 700;
}
@media (max-width: 600px) {
  .pool-toolbar-stats {
    flex-basis: 100%;
    margin-left: 0;
    text-align: right;
  }
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  font-weight: 600;
}
.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}
[data-theme="dark"] .btn-warning {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #422006;
}

.health-pill .health-percent {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.health-no-data {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px dashed var(--border);
}
.health-no-data .health-percent {
  font-style: italic;
  font-weight: 500;
}

/* === WARMING MODE TOGGLE (v9.21 conversation flows) === */
.mode-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
  margin: 0.5rem 0;
}
.mode-option {
  cursor: pointer;
  position: relative;
}
.mode-option input { display: none; }
.mode-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface);
  transition: all 0.15s;
  position: relative;
}
.mode-option:hover .mode-card {
  border-color: var(--primary);
}
.mode-option input:checked + .mode-card {
  border-color: var(--primary);
  background: rgba(37, 211, 102, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}
.mode-card-recommended {
  border-color: rgba(245, 158, 11, 0.4);
}
.mode-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.mode-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; }
.mode-desc { font-size: 0.82rem; color: var(--text-2); line-height: 1.4; }
.mode-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

.info-box-natural {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.08), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 10px;
  padding: 0.875rem 1rem;
}

.flows-by-slot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.flow-slot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.flow-slot-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.flow-slot-card.current-slot {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.05), rgba(37, 211, 102, 0.02));
  box-shadow: 0 0 0 1px var(--primary);
}
.flow-slot-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}
.flow-slot-emoji { font-size: 1.5rem; flex-shrink: 0; }
.flow-slot-name {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.flow-slot-hours {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}
.flow-slot-count-badge {
  margin-left: auto;
  background: var(--surface-2);
  color: var(--text);
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.flow-slot-card.current-slot .flow-slot-count-badge {
  background: var(--primary);
  color: white;
}
.flow-slot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-2);
}
.flow-slot-list li {
  padding: 0.2rem 0.4rem;
  background: var(--surface-2);
  border-radius: 5px;
}
.flow-slot-empty {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 0.5rem 0;
}
.flows-empty {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: left;
}
.flows-empty pre { white-space: pre-wrap; word-break: break-all; margin: 0.4rem 0; }

@media (max-width: 600px) {
  .mode-toggle-group { grid-template-columns: 1fr; }
}

/* === CAMPAIGN PROGRESS BAR (di countdown banner) === */
.campaign-progress {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.campaign-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.campaign-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease-out;
}
.progress-fill-start { background: linear-gradient(90deg, #94a3b8, #64748b); }
.progress-fill-mid   { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.progress-fill-near  { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-fill-done  { background: linear-gradient(90deg, #22c55e, #16a34a); }
.campaign-progress-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.campaign-progress-cycles {
  margin-top: 0.4rem;
}
.cycles-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: rgba(37, 211, 102, 0.1);
  color: var(--primary, #16a34a);
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* === Toggle row utility === */
.toggle-row {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

/* === FLOW ACTIONS (upload, AI prompt) === */
.flow-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.875rem 0 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.flow-actions .btn { flex: 0 1 auto; }

/* Flow item with delete button */
.flow-slot-list li {
  padding: 0.2rem 0.4rem;
  background: var(--surface-2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.flow-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-item-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.3rem;
  border-radius: 4px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: all 0.15s;
}
.flow-slot-card:hover .flow-item-delete {
  opacity: 1;
}
.flow-item-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

@media (max-width: 600px) {
  .flow-actions { flex-direction: column; }
  .flow-actions .btn { width: 100%; }
}

/* === PASTE FLOW JSON SECTION (v9.24) === */
.paste-flow-section {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
}
.paste-flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.paste-flow-textarea {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.4;
}
.paste-flow-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
  flex-wrap: wrap;
}
.paste-flow-preview {
  margin-top: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.paste-flow-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.paste-flow-list li {
  padding: 0.25rem 0.45rem;
  background: var(--surface);
  border-radius: 4px;
  color: var(--text-2);
}
.paste-flow-list li code {
  font-size: 0.75rem;
  background: var(--surface-2);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  color: var(--text);
}

.flows-status {
  font-size: 0.82rem;
  margin-left: auto;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
}
.flows-status-ok { color: var(--text); }
.flows-status-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* === WARMING STATS PILLS (v9.29) === */
.warming-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.stat-pill-active {
  background: rgba(37, 211, 102, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.35);
  animation: pulseActive 2s ease-in-out infinite;
}
.stat-pill-idle {
  background: var(--surface-2);
  color: var(--text-dim);
}
.stat-pill-done {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.25);
}
.stat-pill-cycle {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.25);
}

@keyframes pulseActive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === DELAY OVERRIDE SECTION (v9.31) === */
.delay-override-section {
  margin-top: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.delay-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.delay-mode-option {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.delay-mode-option:hover { border-color: var(--primary); }
.delay-mode-option input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.delay-mode-option input:checked ~ div .hint {
  color: var(--text-2);
}
.delay-mode-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(37, 211, 102, 0.04);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

/* Duplicate paste warning */
.paste-flow-warn {
  margin-top: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1.5;
}
:root[data-theme="dark"] .paste-flow-warn { color: #fbbf24; }

/* === AUTO-PAUSE BANNER (v9.33) === */
.auto-pause-banner {
  margin: 0.625rem 0;
  padding: 0.625rem 0.875rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1.5;
}
:root[data-theme="dark"] .auto-pause-banner { color: #fbbf24; }

.campaign-card.status-auto_paused {
  border-left: 3px solid #f59e0b;
}

/* === LOG CODES REFERENCE (v9.36) === */
.log-codes-ref {
  flex: 1;
  min-width: 0;
}
.log-codes-ref details {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}
.log-codes-ref summary {
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.log-codes-ref summary::-webkit-details-marker { display: none; }
.log-codes-ref summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.log-codes-ref details[open] summary::before {
  transform: rotate(90deg);
}
.log-codes-ref details[open] {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.4rem;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px dashed var(--border);
}
.code-item {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  background: var(--surface-2);
  border-radius: 6px;
}
.code-item code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 60px;
  text-align: center;
}
.code-action {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.74rem;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 768px) {
  .codes-grid { grid-template-columns: 1fr; }
  .code-item { flex-wrap: wrap; }
  .code-action { width: 100%; padding-left: 70px; }
}

/* ════════════════════════════════════════════════════════════════════════
 * v9.38 — MOBILE-FIRST RESPONSIVE OVERLAY (full mobile redesign)
 * Strategy: override existing CSS dengan mobile-first base
 * Breakpoints: 0-639px = mobile, 640-1023px = tablet, 1024+ = desktop
 * ════════════════════════════════════════════════════════════════════════ */

/* ───── BASE MOBILE (default for phones) ───── */
@media (max-width: 1023px) {
  /* Body text size — prevent iOS zoom on input focus */
  html { font-size: 14px; }
  input, select, textarea, .input { font-size: 16px !important; min-height: 44px; }

  /* App layout: stack vertical on mobile */
  .app {
    display: block !important;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Sidebar: slide-in drawer dari kiri */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: min(280px, 80vw);
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    box-shadow: 2px 0 16px rgba(0,0,0,0.15);
    overflow-y: auto;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
  }

  /* Main content: full width on mobile */
  .main {
    margin-left: 0 !important;
    width: 100%;
    padding: 0;
  }

  /* Topbar: simpler on mobile */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 56px;
  }
  .topbar-menu {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text);
  }
  .topbar-menu:active {
    background: var(--surface-3, var(--border));
  }
  .topbar-title h1 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
  }
  .topbar-title p {
    font-size: 0.75rem;
    margin: 0;
    color: var(--text-dim);
  }
  .topbar-clock { display: none; } /* hidden on mobile, save space */

  /* User switcher: compact */
  .user-switcher {
    margin-left: auto;
  }
  .user-switcher select {
    font-size: 0.78rem !important;
    min-height: 36px;
    padding: 0.3rem 0.5rem;
    max-width: 130px;
  }

  /* Section padding */
  .section {
    padding: 0.875rem;
  }

  /* Cards full width with proper margins */
  .card {
    margin: 0 0 0.875rem 0;
    border-radius: 12px;
  }
  .card-header {
    flex-wrap: wrap;
    padding: 0.875rem;
    gap: 0.625rem;
  }
  .card-header h2 {
    font-size: 1rem;
  }
  .card-subtitle {
    font-size: 0.78rem;
  }
  .card-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
  .card-actions .input,
  .card-actions select.input {
    flex: 1;
    min-width: 0;
  }

  /* Stats grid: stack vertical on mobile */
  .stats-grid,
  .dashboard-stats,
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.625rem !important;
  }
  .stat-card,
  .dashboard-stat {
    padding: 0.875rem;
  }
  .stat-card-value,
  .dashboard-stat-value {
    font-size: 1.5rem !important;
  }
  .stat-card-label,
  .dashboard-stat-label {
    font-size: 0.74rem !important;
  }

  /* === Pool Nomor: TABLE → CARD VIEW on mobile === */
  .pool-table,
  .numbers-table {
    display: none !important;
  }
  .pool-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0;
  }
  .pool-mobile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem;
  }
  .pool-mobile-card-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px dashed var(--border);
  }
  .pool-mobile-card .nomor-cell {
    flex: 1;
    min-width: 0;
  }
  .pool-mobile-card .nomor-phone {
    font-weight: 700;
    font-size: 0.95rem;
    word-break: break-all;
  }
  .pool-mobile-card .nomor-id {
    font-size: 0.74rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
  }
  .pool-mobile-card .pool-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
  }
  .pool-mobile-card .pool-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }
  .pool-mobile-card .pool-stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .pool-mobile-card .pool-stat-value {
    font-weight: 700;
  }
  .pool-mobile-card .pool-actions-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
  }
  .pool-mobile-card .pool-actions-row > * {
    flex: 1;
    min-width: 80px;
    min-height: 40px;
    font-size: 0.82rem;
  }

  /* Hide pool-mobile-cards on desktop */

  /* Activity log: compact toolbar */
  .log-codes-ref {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .log-codes-ref summary {
    font-size: 0.82rem;
  }

  /* Log container: smaller font, more readable */
  .log-list,
  #logList,
  .log-container {
    font-size: 0.74rem;
    padding: 0.625rem;
    max-height: 60vh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .log-entry {
    padding: 0.4rem 0;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .log-time {
    font-size: 0.7rem;
    flex-shrink: 0;
  }
  .log-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
  }
  .log-message {
    font-size: 0.74rem;
    word-break: break-word;
    flex: 1 1 100%;
    line-height: 1.4;
  }

  /* Campaign cards: stack stats */
  .campaign-card {
    padding: 0.875rem;
  }
  .campaign-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .campaign-card-head .pill {
    align-self: flex-start;
  }
  .campaign-name {
    font-size: 1rem;
  }
  .campaign-meta {
    font-size: 0.78rem;
    line-height: 1.4;
  }
  .campaign-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .campaign-stat {
    padding: 0.625rem;
  }
  .campaign-stat-label {
    font-size: 0.7rem;
  }
  .campaign-stat-value {
    font-size: 1.2rem;
  }
  .campaign-meta-row {
    flex-wrap: wrap;
    gap: 0.4rem 0.625rem;
    font-size: 0.78rem;
  }
  .campaign-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .campaign-actions .btn {
    flex: 1;
    min-width: 80px;
    min-height: 40px;
    font-size: 0.85rem;
  }

  /* Wizard form: mobile-friendly */
  .wizard {
    padding: 0;
  }
  .wizard-step {
    padding: 0.875rem;
    margin-bottom: 0.875rem;
  }
  .wizard-step-header {
    margin-bottom: 0.875rem;
  }
  .wizard-step-number {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .wizard-step-title {
    font-size: 1rem;
  }
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
  .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .form-row > * {
    width: 100%;
  }

  /* Mode switcher: stack vertical */
  .mode-options {
    grid-template-columns: 1fr !important;
  }
  .mode-option {
    padding: 0.875rem;
  }

  /* Pool selector: full width */
  .pool-selector {
    grid-template-columns: 1fr !important;
  }
  .pool-checkbox-list {
    max-height: 300px;
    grid-template-columns: 1fr !important;
  }

  /* Buttons: bigger touch target */
  .btn {
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
  .btn-sm {
    min-height: 36px;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }
  .btn-icon {
    min-width: 40px;
    min-height: 40px;
  }

  /* Modals: full screen on mobile */
  .modal-overlay,
  .modal-backdrop {
    padding: 0 !important;
  }
  .modal,
  .modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .modal-header {
    padding: 0.875rem;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
    border-bottom: 1px solid var(--border);
  }
  .modal-body {
    padding: 0.875rem;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    padding: 0.875rem;
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    width: 100%;
  }

  /* Charts: limit height, allow horizontal scroll */
  .chart-container,
  .recharts-wrapper {
    max-width: 100%;
    overflow-x: auto;
  }
  canvas {
    max-width: 100%;
    height: auto !important;
  }

  /* Filter banner */
  .filter-banner {
    flex-wrap: wrap;
    font-size: 0.78rem;
    padding: 0.5rem 0.75rem;
  }

  /* Countdown banner */
  .countdown-banner {
    padding: 0.75rem;
  }
  .countdown-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .countdown-item-info {
    width: 100%;
  }
  .countdown-time {
    font-size: 1.5rem;
    text-align: right;
  }

  /* Warming stats pills: compact on mobile */
  .warming-stats-row {
    gap: 0.3rem;
  }
  .stat-pill {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }

  /* Codes grid: 1 column on mobile */
  .codes-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hide nav-arrow icon on mobile (cross-app link) */
  .nav-arrow {
    display: inline-block;
  }

  /* Tables overflow: horizontal scroll fallback */
  .table-wrapper,
  .data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ───── SMALL MOBILE (< 480px) — extra compactness ───── */
@media (max-width: 479px) {
  .stats-grid,
  .dashboard-stats {
    grid-template-columns: 1fr !important;
  }
  .campaign-stats {
    grid-template-columns: 1fr 1fr;
  }
  .topbar-title h1 {
    font-size: 0.95rem;
  }
  .topbar-title p {
    font-size: 0.7rem;
  }
  .user-switcher select {
    max-width: 100px;
    font-size: 0.7rem !important;
  }
  .section {
    padding: 0.625rem;
  }
  .card-header {
    padding: 0.75rem;
  }
  .pool-mobile-card {
    padding: 0.75rem;
  }
}

/* ───── DESKTOP (≥ 1024px) — restore full layout ───── */
@media (min-width: 1024px) {
  /* Restore desktop layout (override mobile-first base) */
  .app {
    display: flex !important;
  }
  /* Hide mobile cards on desktop */
  .pool-mobile-cards {
    display: none !important;
  }
  /* Show sidebar permanently di desktop, restore sticky behavior */
  .sidebar {
    position: sticky !important;
    top: 0 !important;
    transform: none !important;
    z-index: 50 !important;
    width: var(--sidebar-w) !important;
    height: 100vh;
  }
  body.sidebar-open::before {
    display: none;
  }
  /* Hide hamburger button */
  .topbar-menu {
    display: none !important;
  }
  /* Restore main margin (was 0 in mobile) */
  .main {
    margin-left: 0 !important;
    flex: 1;
  }
  /* Restore topbar styling */
  .topbar-clock { display: flex !important; }
}

/* === POOL STATUS BADGES (v9.42) === */
.pool-status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-dim);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pool-status-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.pool-status-offline {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.pool-item-offline {
  opacity: 0.65;
  border-style: dashed !important;
}
.pool-item-offline.checked {
  opacity: 0.85;
  border-style: solid !important;
}

/* === APP FOOTER (v9.43) === */
.app-footer {
  margin-top: 2rem;
  padding: 1.25rem 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.app-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  text-align: center;
}
.app-footer-warning {
  display: inline-block;
  padding: 0.625rem 1rem;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  color: #b91c1c;
  font-size: 0.85rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 100%;
}
:root[data-theme="dark"] .app-footer-warning {
  color: #fca5a5;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.12));
  border-color: rgba(239, 68, 68, 0.4);
}
.app-footer-credit {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}
.app-footer-credit strong {
  color: var(--primary);
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 639px) {
  .app-footer { padding: 1rem 0.625rem; margin-top: 1.25rem; }
  .app-footer-warning { font-size: 0.78rem; padding: 0.5rem 0.75rem; }
  .app-footer-credit { font-size: 0.78rem; }
}

/* === APP-FOOTER-LOGIN modifier — sticky bottom across pages === */
.app-footer.app-footer-login {
  position: sticky;
  bottom: 0;
  margin-top: auto; /* push to bottom dalam flex column */
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 10;
}
[data-theme="dark"] .app-footer.app-footer-login {
  background: rgba(15, 22, 38, 0.95);
}
.app-footer.app-footer-login .app-footer-inner {
  max-width: 1100px;
  gap: 0.4rem;
}
.app-footer.app-footer-login .app-footer-warning {
  padding: 0.4rem 0.875rem;
  font-size: 0.78rem;
}
.app-footer.app-footer-login .app-footer-credit {
  font-size: 0.78rem;
}
@media (max-width: 639px) {
  .app-footer.app-footer-login { padding: 0.5rem 0.625rem; }
  .app-footer.app-footer-login .app-footer-warning { font-size: 0.7rem; padding: 0.3rem 0.625rem; }
  .app-footer.app-footer-login .app-footer-credit { font-size: 0.72rem; }
}

/* === POOL BREAKDOWN INFO (v9.44) === */
.pool-breakdown {
  margin: 0.5rem 0 0.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
}
.pool-breakdown-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.625rem;
  align-items: center;
  line-height: 1.6;
}
.pool-bd-on { color: #16a34a; font-weight: 600; }
.pool-bd-off { color: #d97706; font-weight: 600; }
.pool-bd-banned { color: #dc2626; font-weight: 600; }

@media (max-width: 639px) {
  .pool-breakdown { padding: 0.5rem 0.625rem; font-size: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Status Activity Section (Phase 5A.2)
   ═══════════════════════════════════════════════════════════════ */

.info-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-left: 3px solid #3b82f6;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-2);
}
[data-theme="dark"] .info-callout {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}
.info-callout svg { color: #3b82f6; flex-shrink: 0; margin-top: 0.1rem; }
.info-callout strong { color: var(--text); }
.info-callout em { font-style: italic; }

.card-section {
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
@media (max-width: 639px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.form-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 150ms ease;
}
.form-toggle:hover { border-color: var(--primary); }
.form-toggle input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.toggle-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.toggle-sub { font-size: 0.78rem; color: var(--text-dim); line-height: 1.4; }

.status-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.status-media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 150ms ease, transform 150ms ease;
}
.status-media-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.status-media-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.status-media-info {
  padding: 0.5rem 0.65rem;
  font-size: 0.74rem;
  color: var(--text-2);
}
.status-media-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.status-media-actions {
  display: flex;
  gap: 0.3rem;
  padding: 0 0.5rem 0.5rem;
}
.status-media-actions button {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 5px;
  cursor: pointer;
  transition: all 150ms ease;
}
.status-media-actions button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.status-media-actions button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.625rem;
}
.stat-card-mini {
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* Group Activity invite list */
.group-invite-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: border-color 150ms ease;
}
.group-invite-row:hover { border-color: var(--primary); }
.group-invite-info { flex: 1; min-width: 0; }
.group-invite-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.group-invite-code {
  font-family: 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}
.group-invite-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   HELP MODAL — Panduan (synced dari blast/style.css)
   ═══════════════════════════════════════════════════════════════ */

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: rgba(37, 211, 102, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s;
}
.help-btn:hover {
  background: rgba(37, 211, 102, 0.2);
  transform: translateY(-1px);
}
@media (max-width: 639px) {
  .help-btn-label { display: none; }
  .help-btn { padding: 0.4rem; }
}

/* Help modal — override modal-large defaults untuk layout flex column proper */
.modal-help {
  max-width: 860px !important;
  max-height: 92vh !important;
  width: 100%;
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;          /* reset padding modal-content biar tabs full-bleed */
  overflow: hidden !important;     /* parent gak scroll; help-body yang scroll */
}
.modal-help .modal-header {
  padding: 1.25rem 1.5rem 0.75rem;
  margin: 0;
  flex-shrink: 0;
}

.help-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-shrink: 0;
}
.help-tabs::-webkit-scrollbar { height: 4px; }
.help-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.help-tab {
  padding: 0.5rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s;
}
.help-tab:hover { background: var(--surface); color: var(--text); }
.help-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.help-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  line-height: 1.65;
  min-height: 0; /* fix flex overflow di Firefox */
}
.modal-help .modal-actions {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem 1.25rem !important;
  border-top: 1px solid var(--border);
  margin: 0 !important;
}

.help-pane { display: none; }
.help-pane.active { display: block; animation: fadeInHelp 0.2s; }

@keyframes fadeInHelp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.help-pane h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--text);
}
.help-pane h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.98rem;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
}
.help-pane p { margin: 0.5rem 0; font-size: 0.92rem; color: var(--text-2); }
.help-pane ul, .help-pane ol {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.5rem;
  font-size: 0.9rem;
}
.help-pane li { margin: 0.3rem 0; color: var(--text-2); }
.help-pane code {
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'SF Mono', Menlo, monospace;
  color: var(--accent);
}
.help-pane strong { color: var(--text); }
.help-pane em { color: var(--text-2); }

.help-card {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.88rem;
  line-height: 1.55;
}
.help-card-green { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); }
.help-card-blue  { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.3); }
.help-card-red   { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); }
.help-card-gray  { background: var(--surface-2); }

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.help-tip {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #92400e;
}
[data-theme="dark"] .help-tip { color: #fbbf24; }

.help-ol { counter-reset: helpStep; list-style: none; padding-left: 0; }
.help-ol li {
  counter-increment: helpStep;
  padding-left: 2.2rem;
  position: relative;
  margin: 0.5rem 0;
}
.help-ol li::before {
  content: counter(helpStep);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
}

.help-faq {
  margin: 0.4rem 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
}
.help-faq summary {
  cursor: pointer;
  padding: 0.3rem 0;
  user-select: none;
  font-size: 0.92rem;
}
.help-faq summary:hover { color: var(--accent); }
.help-faq[open] summary { margin-bottom: 0.4rem; color: var(--accent); }
.help-faq p {
  margin: 0.3rem 0 0.5rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.help-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.help-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: none;
}

/* Modern modal shadow */
.modal-content {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 30px -5px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .modal-content {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Focus rings for keyboard accessibility (Windows tab nav) */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mobile: ensure touch targets ≥44x44px (iOS HIG / WCAG 2.5.5) */
@media (pointer: coarse) {
  .btn:not(.btn-sm),
  .chip,
  .help-tab,
  .nav-item {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 38px;
  }
  .lead-item {
    padding: 1rem;
  }
}

/* Mobile sidebar slide transition smoother */
@media (max-width: 1023px) {
  .sidebar {
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Help modal tab text — no wrap (parent .help-tabs sudah handle overflow) */
.help-tab {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Selection highlight */
::selection {
  background: rgba(37, 211, 102, 0.25);
  color: var(--text);
}

/* AI reasoning callout (replaces inline-styled div) */
.ai-reasoning {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  background: var(--purple-bg);
  border-left: 3px solid var(--purple);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-2);
}
.ai-reasoning strong {
  color: var(--purple-text);
}

/* Lead detail grid — semantic background */
.lead-detail-grid {
  background: var(--surface-2);
  color: var(--text-2);
}
.lead-detail-grid strong {
  color: var(--text);
}

/* Chat bubble — pakai theme tokens */
.msg-thread {
  background: var(--surface-2);
  border-color: var(--border);
}
.msg-out .msg-bubble {
  background: var(--primary-soft);
  border-color: rgba(37, 211, 102, 0.25);
}
.msg-in .msg-bubble {
  background: var(--surface);
  border-color: var(--border);
}
.msg-header {
  color: var(--text-dim);
}
.msg-bubble {
  color: var(--text);
}

/* btn-ghost — subtle tertiary button variant */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
