:root {
  --bg: #0A0E17;
  --surface: #121826;
  --surface-2: #1A2333;
  --border: #26304A;
  --text: #E7EAF3;
  --text-muted: #8B93A8;
  --accent: #2FD98A;
  --accent-dim: #1D9E63;
  --accent-soft: rgba(47, 217, 138, 0.12);
  --danger: #F0576B;
  --warn: #F5A623;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  background: radial-gradient(circle at top left, #101828 0%, #0A0E17 45%, #060810 100%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
.font-mono { font-family: var(--font-mono); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

/* Card */
.panel {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(18,24,38,0.7) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.panel-glow {
  position: relative;
  overflow: hidden;
}
.panel-glow::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 220px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  pointer-events: none;
}

/* Nav item */
.nav-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.88rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, opacity .15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #06140D;
  box-shadow: 0 8px 24px -8px rgba(47, 217, 138, 0.55);
}
.btn-accent:hover:not(:disabled) { box-shadow: 0 10px 28px -6px rgba(47, 217, 138, 0.7); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: #212C42; }

.btn-danger {
  background: rgba(240, 87, 107, 0.12);
  color: var(--danger);
  border-color: rgba(240, 87, 107, 0.3);
}
.btn-danger:hover { background: rgba(240, 87, 107, 0.2); }

.btn-icon { padding: 0.5rem; border-radius: 9px; }

/* Inputs */
.field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: #5B6478; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { resize: vertical; min-height: 90px; }

.label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; display: block; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem; border-radius: 999px;
}
.badge-pending { background: rgba(245, 166, 35, 0.14); color: var(--warn); }
.badge-sent { background: var(--accent-soft); color: var(--accent); }

/* Table */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.87rem; }
.data-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 600; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.data-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid rgba(38,48,74,0.6); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,0.015); }

/* Checkbox */
input[type="checkbox"].chk {
  appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--border);
  border-radius: 5px; background: var(--surface-2); cursor: pointer; position: relative; flex-shrink: 0;
}
input[type="checkbox"].chk:checked {
  background: var(--accent); border-color: var(--accent);
}
input[type="checkbox"].chk:checked::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 9px;
  border: solid #06140D; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* WhatsApp double-check ripple — signature motif for the send flow */
.wa-ticks { display: inline-flex; }
.wa-ticks svg { filter: drop-shadow(0 0 6px rgba(47,217,138,0.5)); }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(47,217,138,0.45); }
  100% { box-shadow: 0 0 0 14px rgba(47,217,138,0); }
}
.pulse { animation: pulse-ring 1.6s ease-out infinite; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.35s ease both; }

/* Toast */
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 0.75rem 1.1rem; border-radius: 12px;
  font-size: 0.85rem; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6);
  z-index: 100; max-width: 92vw;
}

/* Progress bar for bulk send */
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width 0.3s ease; }

/* Mobile bottom nav */
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
