/* Admin dashboard styles — owner-only internal tool */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────────────── */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

/* ── Header ─────────────────────────────────────────────────────── */
.admin-header {
  border-bottom: 1px solid #1e293b;
  margin-bottom: 36px;
  padding: 18px 0;
}
.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-logo { font-size: 20px; }
.admin-title { font-size: 17px; font-weight: 700; color: #f1f5f9; }
.admin-badge {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  background: #1e1b4b;
  border: 1px solid #3730a3;
  border-radius: 20px;
  padding: 2px 9px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.admin-updated { font-size: 12px; color: #475569; }

/* ── Main ───────────────────────────────────────────────────────── */
.admin-main { display: flex; flex-direction: column; gap: 40px; }

/* ── Section ────────────────────────────────────────────────────── */
.admin-section { display: flex; flex-direction: column; gap: 16px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Stat card grid ─────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 18px 20px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: #475569; }
.stat-card.highlight {
  border-color: #4338ca;
  background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card.highlight .stat-value { color: #a5b4fc; }
.stat-sub { font-size: 12px; color: #475569; }

/* ── Chart card ─────────────────────────────────────────────────── */
.chart-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 20px 22px;
}
.chart-header {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* ── Table ──────────────────────────────────────────────────────── */
.table-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead tr {
  border-bottom: 1px solid #334155;
  background: #172033;
}
.admin-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.admin-table td {
  padding: 11px 16px;
  color: #cbd5e1;
  border-bottom: 1px solid #1e293b;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #243044; }

/* ── Plan badges ────────────────────────────────────────────────── */
.plan-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: capitalize;
}
.plan-free    { background: #1e293b; color: #64748b; border: 1px solid #334155; }
.plan-starter { background: #1c3a5f; color: #60a5fa; border: 1px solid #1d4ed8; }
.plan-pro     { background: #1b2a40; color: #a78bfa; border: 1px solid #6d28d9; }

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  font-size: 14px;
  color: #475569;
}

/* ── Mobile pulse strip (hidden on desktop) ─────────────────────── */
.mobile-pulse {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}
.pulse-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  display: block;
}
.pulse-card:active { border-color: #6366f1; background: #1e1b4b; }
.pulse-card.highlight { border-color: #4338ca; background: linear-gradient(135deg,#1e1b4b 0%,#1e293b 100%); }
.pulse-value {
  font-size: 34px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
  margin-bottom: 6px;
}
.pulse-card.highlight .pulse-value { color: #a5b4fc; }
.pulse-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pulse-tap-hint {
  font-size: 10px;
  color: #475569;
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* ── Mobile chart replacement hint ──────────────────────────────── */
.mobile-chart-hint {
  display: none;
  background: rgba(99,102,241,0.05);
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}
.mobile-chart-hint strong { color: #818cf8; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Charts are unreadable on mobile — hide them, show hint instead */
  .chart-card { display: none; }
  .mobile-chart-hint { display: block; }

  /* Pulse strip appears only on mobile */
  .mobile-pulse { display: grid; }

  /* Stat cards: make tappable feel obvious */
  .stat-card { cursor: pointer; -webkit-tap-highlight-color: rgba(99,102,241,0.08); }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
  .admin-table th:last-child,
  .admin-table td:last-child { display: none; }
}
@media (max-width: 380px) {
  .card-grid { grid-template-columns: 1fr; }
  .mobile-pulse { grid-template-columns: 1fr 1fr; }
}

/* ── Filter Bar ──────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  background: #1a2744;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group-dim { opacity: 0.5; }

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

/* Date range button group */
.filter-btn-group {
  display: flex;
  gap: 4px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 3px;
}

.filter-btn {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  font-family: inherit;
}
.filter-btn:hover { background: #1e293b; color: #cbd5e1; }
.filter-btn.active {
  background: #4338ca;
  color: #fff;
  font-weight: 600;
}

/* Campaign dropdown */
.filter-select {
  font-size: 12px;
  font-family: inherit;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}
.filter-select:hover, .filter-select:focus { border-color: #4338ca; }

/* Status chips */
.filter-chip-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-chip {
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: #64748b;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  text-transform: capitalize;
}
.filter-chip:hover { background: #1e293b; color: #cbd5e1; border-color: #475569; }
.filter-chip.active {
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
  border-color: #4338ca;
  font-weight: 600;
}

/* "No campaigns" placeholder */
.filter-empty {
  font-size: 11px;
  color: #334155;
  font-style: italic;
}

/* Clear filters button */
.filter-clear {
  font-size: 11px;
  font-family: inherit;
  color: #475569;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.filter-clear:hover { color: #ef4444; border-color: #ef4444; }

@media (max-width: 768px) {
  .filter-bar { padding: 12px 14px; gap: 14px; }
  .filter-btn { padding: 4px 9px; font-size: 11px; }
  .filter-label { display: none; }
}
