/* ==========================================================================
   CFP Super Admin — design system aligned with coaching.cfpweightloss.com
   Teal · navy · cream · DM Sans + Fraunces
   ========================================================================== */

:root {
  --color-teal-900: #0a4f52;
  --color-teal-800: #0b5f63;
  --color-teal-700: #0d7377;
  --color-teal-600: #14919b;
  --color-teal-500: #1aa6b0;
  --color-teal-100: #e6f6f7;
  --color-teal-50: #f0fafa;

  --color-navy-900: #0b1c2c;
  --color-navy-800: #12263a;
  --color-navy-700: #1a334d;
  --color-navy-100: #e8eef4;

  --color-cream: #f7f4ef;
  --color-cream-dark: #ebe6dc;
  --color-white: #ffffff;
  --color-sand: #faf8f5;

  --color-gold: #c9a227;
  --color-gold-soft: #f5edd0;

  --color-text: #1a2a36;
  --color-text-muted: #5a6b78;
  --color-text-light: #7a8a96;
  --color-border: #e2e8ed;
  --color-border-soft: #eef2f5;

  --color-danger: #b42318;
  --color-danger-soft: #fef3f2;
  --color-success: #067647;
  --color-success-soft: #ecfdf3;
  --color-warn: #b54708;
  --color-warn-soft: #fffaeb;

  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;

  --sidebar-w: 268px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(11, 28, 44, 0.05);
  --shadow: 0 4px 16px rgba(11, 28, 44, 0.07);
  --shadow-md: 0 8px 30px rgba(11, 28, 44, 0.1);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--color-teal-700); text-decoration: none; }
a:hover { color: var(--color-teal-900); }
.hidden { display: none !important; }
.muted { color: var(--color-text-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* Safe Mode banner -------------------------------------------------------- */
.safe-mode-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(90deg, #b54708, #c47a0a);
  color: #fff;
  box-shadow: 0 2px 12px rgba(181, 71, 8, 0.35);
}
.safe-mode-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.55rem 1.1rem;
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.875rem;
}
.safe-mode-banner-inner strong {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.18);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.safe-mode-banner-inner .btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.safe-mode-banner-inner .btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s, color 0.2s, box-shadow 0.2s;
  background: var(--color-white);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn:hover { border-color: var(--color-teal-600); color: var(--color-teal-800); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--color-teal-700);
  border-color: var(--color-teal-700);
  color: #fff;
  box-shadow: 0 6px 18px rgba(13, 115, 119, 0.22);
}
.btn-primary:hover { background: var(--color-teal-800); border-color: var(--color-teal-800); color: #fff; }
.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(0.95); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:hover { background: var(--color-navy-100); color: var(--color-navy-900); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-block { width: 100%; }
.icon-btn {
  border: none;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-muted);
}
.icon-btn:hover { background: var(--color-navy-100); color: var(--color-navy-900); }

/* Login ------------------------------------------------------------------ */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(13, 115, 119, 0.12), transparent),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(201, 162, 39, 0.1), transparent),
    var(--color-cream);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-shell { width: min(100%, 420px); }
.login-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-soft);
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-teal-700);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.login-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--color-navy-900);
  margin-bottom: 0.5rem;
}
.login-sub { color: var(--color-text-muted); margin-bottom: 1.4rem; font-size: 0.95rem; }
.login-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field > span { font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted); }
.field input, .field textarea, .field select,
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  background: var(--color-sand);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--color-teal-600);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.15);
  background: #fff;
}
.textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.login-foot {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--color-text-light);
  text-align: center;
}

.alert {
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: var(--color-success-soft); color: var(--color-success); }
.alert-error { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-info { background: var(--color-teal-50); color: var(--color-teal-900); }

/* App shell -------------------------------------------------------------- */
.app-body { background: var(--color-cream); }
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--color-navy-900);
  color: #d8e2ec;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--color-teal-600), var(--color-teal-900));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  letter-spacing: 0.04em;
}
.sidebar-brand strong { display: block; color: #fff; font-size: 0.95rem; }
.brand-sub { font-size: 0.72rem; color: #8fa3b5; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.65rem;
}
.nav-category { margin-bottom: 0.55rem; }
.nav-category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  color: #8fa3b5;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}
.nav-category-btn:hover { color: #c5d4e0; }
.nav-chevron { transition: transform 0.2s var(--ease); font-size: 0.7rem; }
.nav-category.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-category.collapsed .nav-items { display: none; }
.nav-items { display: grid; gap: 0.15rem; margin-top: 0.15rem; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: #c5d4e0;
  font-weight: 500;
  font-size: 0.92rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-link.active {
  background: rgba(26, 166, 176, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--color-teal-500);
}
.nav-link.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.nav-link.active .nav-dot { background: var(--color-teal-500); opacity: 1; }

.sidebar-footer {
  padding: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 0.65rem;
}
.user-chip {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-teal-700);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.user-email { font-size: 0.78rem; color: #fff; word-break: break-all; }
.user-role { font-size: 0.7rem; color: #8fa3b5; text-transform: capitalize; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.5rem 0.85rem;
  border-bottom: 1px solid var(--color-border-soft);
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title h1 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--color-navy-900);
  line-height: 1.2;
}
.topbar-title .muted { font-size: 0.88rem; margin-top: 0.15rem; }
.topbar-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sidebar-toggle { display: none; }

.main-content {
  padding: 1.25rem 1.5rem 2.5rem;
  flex: 1;
}

/* Panels / cards --------------------------------------------------------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-grid; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: 1rem; }
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.2rem;
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.card-header h2, .card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy-900);
}
.card-sub { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 0.15rem; }

.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-light);
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--color-navy-900);
  margin-top: 0.25rem;
  line-height: 1.15;
}
.stat-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.3rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-ok { background: var(--color-success-soft); color: var(--color-success); }
.badge-warn { background: var(--color-warn-soft); color: var(--color-warn); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-neutral { background: var(--color-navy-100); color: var(--color-navy-700); }
.badge-teal { background: var(--color-teal-100); color: var(--color-teal-900); }

.stack { display: grid; gap: 0.75rem; }
.row { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.divider { height: 1px; background: var(--color-border-soft); margin: 0.85rem 0; }

/* Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border-soft); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}
table.data th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-light);
  background: var(--color-sand);
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
table.data td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--color-border-soft);
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--color-teal-50); }
.ep-title { font-weight: 600; color: var(--color-navy-900); }
.ep-meta { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.15rem; }

/* Toolbar / filters ------------------------------------------------------ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.9rem;
}
.toolbar .input { max-width: 280px; }
.toolbar .select { max-width: 160px; }

/* Interval control ------------------------------------------------------- */
.interval-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  background: var(--color-teal-50);
  border: 1px solid var(--color-teal-100);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.interval-box label { display: grid; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--color-teal-900); }
.interval-box input { width: 100px; }

/* Modal ------------------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 28, 44, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 50;
}
.modal {
  width: min(100%, 760px);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--color-border-soft);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.modal-header h2 { font-size: 1.05rem; color: var(--color-navy-900); }
.modal-body { padding: 1.1rem 1.15rem 1.4rem; }
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.45rem 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.detail-grid dt { color: var(--color-text-light); font-weight: 600; }
.detail-grid dd { word-break: break-word; }
.script-box {
  background: var(--color-sand);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.55;
  max-height: 280px;
  overflow: auto;
}
.audio-player { width: 100%; margin: 0.5rem 0 1rem; }

/* Toast ------------------------------------------------------------------ */
.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  z-index: 60;
  width: min(360px, calc(100vw - 2rem));
}
.toast {
  background: var(--color-navy-900);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  animation: slideIn 0.25s var(--ease);
}
.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-danger); }
@keyframes slideIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.loading-panel, .empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted);
}
.section-gap { margin-top: 1.25rem; }
.help-text { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 0.35rem; }

.coming-soon {
  text-align: center;
  padding: 3rem 1rem;
}
.coming-soon h2 {
  font-family: var(--font-serif);
  color: var(--color-navy-900);
  margin-bottom: 0.4rem;
}

/* Apple Podcast artwork -------------------------------------------------- */
.artwork-layout {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .artwork-layout { grid-template-columns: 1fr; }
}
.artwork-preview-frame {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-sand);
  box-shadow: var(--shadow-sm);
}
.artwork-preview-frame--sm { max-width: 160px; }
.artwork-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.artwork-empty {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--color-text-light);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}
.artwork-meta {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
}
.artwork-meta > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.35rem;
}
.artwork-meta dt {
  color: var(--color-text-light);
  font-weight: 600;
}
.artwork-pending-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 720px) {
  .artwork-pending-row { grid-template-columns: 1fr; }
}

/* Simulated Apple Podcasts show card */
.apple-pod-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: linear-gradient(160deg, #1c1c1e 0%, #2c2c2e 100%);
  color: #f5f5f7;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  max-width: 360px;
  box-shadow: 0 12px 32px rgba(11, 28, 44, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.apple-pod-card__art {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #3a3a3c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.apple-pod-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.apple-pod-card__body { min-width: 0; }
.apple-pod-card__show {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}
.apple-pod-card__author {
  font-size: 0.8rem;
  color: #a1a1a6;
  margin-bottom: 0.35rem;
}
.apple-pod-card__meta {
  font-size: 0.72rem;
  color: #8e8e93;
  letter-spacing: 0.01em;
}

/* System Health traffic lights ------------------------------------------- */
.health-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}
.health-dot.health-green {
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.2);
}
.health-dot.health-yellow {
  background: #f79009;
  box-shadow: 0 0 0 3px rgba(247, 144, 9, 0.22);
}
.health-dot.health-red {
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.22);
  animation: healthPulse 1.4s ease infinite;
}
@keyframes healthPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.health-pill.health-green {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}
.health-pill.health-yellow {
  background: #fffaeb;
  color: #b54708;
  border: 1px solid #fedf89;
}
.health-pill.health-red {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.health-hero {
  padding: 1.35rem 1.35rem 1.15rem;
}
.health-hero.health-green-border {
  border-color: #abefc6;
  background: linear-gradient(180deg, #f6fffb 0%, #fff 48%);
}
.health-hero.health-yellow-border {
  border-color: #fedf89;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 48%);
}
.health-hero.health-red-border {
  border-color: #fecdca;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 48%);
}
.health-hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.health-hero__title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.4rem;
}
.health-hero__heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--color-navy-900);
  font-weight: 700;
}
.health-hero__summary {
  font-size: 0.92rem;
  max-width: 42rem;
  line-height: 1.45;
}
.health-metrics {
  margin-top: 0.25rem;
}
.health-metric {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}
.health-metric__value {
  margin-top: 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--color-navy-900);
  line-height: 1.2;
}

.dash-ep-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}
.dash-ep-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border-soft);
}
.dash-ep-list li:last-child { border-bottom: none; }
.dash-ep-list .ep-title {
  display: block;
  font-weight: 600;
  color: var(--color-navy-900);
  font-size: 0.92rem;
}
.dash-ep-list .ep-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.log-grid {
  display: grid;
  gap: 1rem;
}
.log-block__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-navy-900);
}
.log-pre {
  margin: 0;
  background: var(--color-navy-900);
  color: #e8eef4;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  line-height: 1.45;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Stripe Revenue tab ------------------------------------------------------ */
.stripe-tab {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: calc(100vh - 9rem);
}

.stripe-tab__header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.stripe-tab__title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--color-navy-900);
  margin: 0.15rem 0 0.4rem;
}

.stripe-tab__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stripe-tab__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.stripe-frame-wrap {
  flex: 1;
  min-height: min(72vh, 820px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stripe-admin-iframe {
  width: 100%;
  flex: 1;
  min-height: min(72vh, 820px);
  border: 0;
  background: var(--color-sand);
  display: block;
}

/* Native Stripe catalog (no iframe / no second password) ----------------- */
.stripe-tab--native {
  min-height: auto;
}

.stripe-status-msg {
  min-height: 1.25em;
  font-size: 0.9rem;
  margin: 0;
}

.stripe-status-msg.is-ok {
  color: #067647;
  font-weight: 600;
}

.stripe-status-msg.is-error {
  color: #b42318;
  font-weight: 600;
}

.stripe-table-card {
  padding: 0;
  overflow: hidden;
}

.stripe-table-wrap {
  overflow-x: auto;
}

.stripe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stripe-table th,
.stripe-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--color-border-soft, #eef2f5);
  text-align: left;
  vertical-align: middle;
}

.stripe-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-sand, #faf8f5);
}

.stripe-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8ed);
  display: block;
  background: #f7f4ef;
}

.stripe-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9aa8b5;
  font-size: 0.8rem;
  border-style: dashed;
}

.stripe-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stripe-form h3 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-navy-900);
}

.stripe-form-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .stripe-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stripe-span-2 {
    grid-column: 1 / -1;
  }
}

.stripe-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-navy-800);
}

.stripe-form-grid input,
.stripe-form-grid select,
.stripe-form-grid textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--color-border, #e2e8ed);
  border-radius: 10px;
  background: #fff;
}

.stripe-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  margin-top: 1.4rem;
}

.stripe-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stripe-img-preview {
  margin-top: 0.25rem;
}

.stripe-img-preview img {
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8ed);
  object-fit: cover;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.badge-ok {
  background: #e8f7ef;
  color: #067647;
}

.badge-warn {
  background: #fef3f2;
  color: #b42318;
}
