/**
 * System Admin Console — admin-specific overrides.
 * Base styles (buttons, inputs, layout, typography) come from main.css + themes.css.
 */

/* Standalone page shell — mirrors how .screen works in the main app */
html, body { height: 100%; }
body { background: var(--bg-primary); font-family: 'Inter', sans-serif; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.settings-layout { height: 100%; }

/* ── Stats grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Section header (title + action button row) ─────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ── Dashboard subsections ──────────────────────────────────────────────── */
.dashboard-section { margin-bottom: 24px; }

/* ── Admin tables ───────────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead tr { border-bottom: 2px solid var(--border); }

.admin-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-hover, var(--bg-primary)); }

.admin-table code {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  font-family: 'Monaco', 'Courier New', monospace;
}

/* ── Status badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge-warning { background: rgba(234, 179,   8, 0.12); color: #d97706; }
.badge-danger  { background: rgba(239,  68,  68, 0.12); color: #dc2626; }

/* ── Audit log action badges ────────────────────────────────────────────── */
.action-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

.action-badge.action-admin_add,
.action-badge.action-account_unban  { background: #16a34a; }

.action-badge.action-admin_remove,
.action-badge.action-account_ban    { background: #dc2626; }

.action-badge.action-promo_batch_create { background: #0891b2; }
.action-badge.action-promo_code_revoke  { background: #d97706; }

/* ── Form layouts ───────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Copyable promo code ────────────────────────────────────────────────── */
.copy-code-btn {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.1s, color 0.1s;
}

.copy-code-btn:hover { background: var(--accent-muted, rgba(59,130,246,.12)); }

.copy-code-btn--copied {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
}

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.filter-section { margin-bottom: 16px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .form-row { grid-template-columns: 1fr; }
}
