/* ─── Shared admin/owner console UI kit ──────────────────────────────────
   Used by admin.html, admin-social.html, admin-errors.html, daas-admin.html.
   Generic, reusable component classes only — page-specific layout/chrome
   (sidebars, headers, mobile nav) stays in each page's own <style> block. */

:root {
  /* Admin error red — matches badge-cancelled/btn-danger below. Distinct from
     design-system.css's --status-red (#F44336), which is a slightly different
     shade used on player-facing pages; kept separate rather than silently
     changing admin's existing color. */
  --admin-error: #D44545;
}

.hidden { display: none !important; }

/* ─── Card ───────────────────────────────────────── */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-gold); border-radius: 14px;
  padding: 24px; margin-bottom: 20px;
}
.card-title { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--white); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ─── Metric grid ────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.metric-card {
  background: var(--bg-surface); border: 1px solid var(--border-gold); border-radius: 14px; padding: 20px;
}
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-secondary); margin-bottom: 8px; }
.metric-value { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; color: var(--white); line-height: 1; }
.metric-value.green { color: var(--gold-primary); }
.metric-value.amber { color: var(--gold-primary); }
.metric-value.blue { color: var(--blue); }
.metric-sub { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* ─── Table ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border-gold); }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); background: rgba(201,168,76,0.04); border-bottom: 1px solid var(--border-gold); white-space: nowrap; }
td { padding: 12px 16px; font-size: 13px; color: var(--text-primary); border-bottom: 1px solid rgba(201,168,76,0.1); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,168,76,0.04); }
.clickable { cursor: pointer; }

/* ─── Empty / loading state (also used for "Loading…" rows) ─────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }

/* ─── Badges ─────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-active { background: rgba(201,168,76,0.15); color: var(--gold-primary); }
.badge-trial { background: rgba(201,168,76,0.12); color: var(--gold-primary); }
.badge-free { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.badge-cancelled { background: rgba(212,69,69,0.1); color: var(--admin-error); }
.badge-founder { background: rgba(201,168,76,0.15); color: var(--gold-primary); }
.badge-owner { background: rgba(201,168,76,0.2); color: var(--gold-primary); border: 1px solid rgba(201,168,76,0.3); }

/* Growth section pill badges (priority / reply status) — solid-color pill style,
   distinct from the translucent .badge-* above. Extracted verbatim from inline
   styles, not visually changed. The reply-status values previously borrowed the
   influencer pipeline's color map (keyed by new/contacted/replied/converted/pass),
   which has no entry for pending/approved/sent/skipped — every reply badge
   silently fell back to the same gray. These have correct, distinct mappings. */
.badge-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #fff; }
.badge-priority-high { background: #A32D2D; }
.badge-priority-medium { background: #BA7517; }
.badge-priority-low { background: #555; }
.badge-reply-pending { background: #BA7517; }
.badge-reply-approved { background: #185FA5; }
.badge-reply-sent { background: #1D9E75; }
.badge-reply-skipped { background: #555; }

/* ─── Toggle switches ────────────────────────────── */
.toggle-list { display: flex; flex-direction: column; gap: 1px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: rgba(201,168,76,0.03);
  border-radius: 8px; transition: background 0.15s;
}
.toggle-row:hover { background: rgba(201,168,76,0.06); }
.toggle-info { flex: 1; }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.toggle-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toggle {
  position: relative; width: 42px; height: 24px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: rgba(255,255,255,0.1);
  border-radius: 24px; cursor: pointer; transition: 0.2s;
}
.toggle-slider:before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: var(--text-secondary); border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--gold-deep); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); background: var(--gold-primary); }

/* ─── Form ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--border-gold);
  border-radius: 8px; padding: 10px 14px; font-size: 14px;
  color: var(--text-primary); font-family: 'Inter', sans-serif; outline: none; transition: border 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: rgba(201,168,76,0.5); }
.form-select option { background: var(--bg-surface); }
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Buttons (shared across all admin pages) ────── */
.btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--gold-primary); color: #000; }
.btn-primary:hover { background: #d4b45a; }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: rgba(212,69,69,0.15); color: var(--admin-error); border: 1px solid rgba(212,69,69,0.2); }
.btn-danger:hover { background: rgba(212,69,69,0.25); }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ─── Access denied screen (used by requireOwnerGate() in admin-shell-shared.js) ─── */
#access-denied {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  position: fixed; inset: 0; background: var(--bg-black); z-index: 999;
}
.access-card { text-align: center; padding: 48px; max-width: 400px; }
.access-icon { font-size: 48px; margin-bottom: 20px; }
.access-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.access-sub { color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
