/* ── Admin Panel ─────────────────────────────────────────────────────────── */

.adm-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.adm-header {
  margin-bottom: 16px;
}

.adm-config-warning {
  background: rgba(224,123,90,0.1);
  border: 1px solid rgba(224,123,90,0.35);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #e07b5a;
  margin-bottom: 20px;
  line-height: 1.5;
}

.adm-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Syne', sans-serif;
}

.adm-page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.adm-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.adm-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
}

.adm-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.adm-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Overview stats ─────────────────────────────────────────────────────── */

.adm-stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 700px) {
  .adm-stat-row { grid-template-columns: 1fr 1fr; }
}

.adm-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.adm-stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
  line-height: 1;
}

.adm-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Drop-off / heatmap bars ────────────────────────────────────────────── */

.adm-drop-row,
.adm-heat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.adm-drop-label,
.adm-heat-concept {
  font-size: 12px;
  color: var(--text);
  width: 160px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-drop-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.adm-drop-count {
  font-size: 12px;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.adm-heat-score {
  font-size: 12px;
  font-weight: 700;
  width: 48px;
  flex-shrink: 0;
}

.adm-heat-attempts {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Churn risk user list ───────────────────────────────────────────────── */

.adm-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.adm-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.adm-user-info {
  flex: 1;
  min-width: 140px;
}

.adm-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.adm-user-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.adm-user-pill {
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

.adm-pill-warning {
  color: #e07b5a;
  border-color: rgba(224,123,90,0.3);
  background: rgba(224,123,90,0.08);
}

.adm-pill-free {
  color: #6B8FD4;
  border-color: rgba(107,143,212,0.3);
  background: rgba(107,143,212,0.08);
}

.adm-pill-registered {
  color: var(--text-muted);
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.adm-user-concept {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  min-width: 100px;
  font-style: italic;
}

/* ── Nudge panel ────────────────────────────────────────────────────────── */

.adm-nudge-panel {
  background: var(--bg);
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.adm-nudge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.adm-nudge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.adm-nudge-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

.adm-nudge-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 5px;
  margin-top: 12px;
}

.adm-nudge-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ── Flagged messages ───────────────────────────────────────────────────── */

.adm-flag-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.adm-flag-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.adm-flag-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.adm-flag-email {
  font-size: 12px;
  color: var(--brand);
}

.adm-flag-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.adm-flag-reply {
  font-size: 11px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.adm-flag-reply:hover {
  text-decoration: underline;
}

.adm-flag-msg {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ── Composer / announcement ────────────────────────────────────────────── */

.adm-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adm-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
}

.adm-input:focus {
  outline: none;
  border-color: var(--brand);
}

.adm-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  min-height: 100px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.adm-textarea-tall {
  min-height: 140px;
}

.adm-textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.adm-announce-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.adm-announce-count-text {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.adm-btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.adm-btn-primary:hover { opacity: 0.85; }

.adm-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.adm-btn-ghost:hover {
  border-color: var(--brand);
  color: var(--text);
}

.adm-btn-sm {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(106,165,156,0.3);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.adm-btn-sm:hover { background: rgba(106,165,156,0.08); }

.adm-btn-danger {
  background: rgba(224,123,90,0.12);
  color: #e07b5a;
  border: 1px solid rgba(224,123,90,0.3);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.adm-btn-danger:hover { background: rgba(224,123,90,0.2); }

/* ── Recipient picker ───────────────────────────────────────────────────── */

.adm-recipient-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.adm-recipient-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.adm-recipient-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 14px;
  background: var(--panel);
}

.adm-recipient-scroll::-webkit-scrollbar { width: 4px; }
.adm-recipient-scroll::-webkit-scrollbar-track { background: transparent; }
.adm-recipient-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.adm-announce-count-text {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

/* ── Status messages ────────────────────────────────────────────────────── */

.adm-status { min-height: 20px; }

.adm-success {
  font-size: 13px;
  color: #6AA59C;
}

.adm-error {
  font-size: 13px;
  color: #e07b5a;
}

.adm-nudge-error {
  font-size: 13px;
  color: #e07b5a;
  padding: 8px 0;
}

/* ── Access denied ──────────────────────────────────────────────────────── */

.adm-denied {
  text-align: center;
  padding: 80px 20px;
}

.adm-denied-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.adm-denied-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.adm-back-link {
  font-size: 13px;
  color: var(--brand);
  text-decoration: none;
}

/* ── Nav admin button ───────────────────────────────────────────────────── */

.nav-admin-btn {
  font-size: 16px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}

.nav-admin-btn:hover {
  color: var(--brand);
  background: rgba(106,165,156,0.08);
}
