/* ============================================================
   Red Oak | MirrorWeb Communications Supervision
   Modern redesign — Inter font, slate palette, clean whites
   Brand colors are injected as CSS variables from tenant settings:
     --brand-primary  (default #37006E)
     --brand-cta      (default #54117B)
     --brand-accent   (default #a2212e)
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #F1F5F9;
  color: #1E293B;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-accent); text-decoration: none; }
a:hover { color: var(--brand-accent); filter: brightness(0.8); }

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.84em;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  padding: 1px 6px;
  color: #334155;
}

/* ── Sticky top wrapper (header + admin banner together) ───── */
.site-sticky-top {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: static;
  background: #fff;
  box-shadow: 0 1px 0 #E2E8F0, 0 2px 16px rgba(15,23,42,0.07);
}

.header-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-cta) 50%, var(--brand-accent) 100%);
}

.logo-bar {
  background: #ffffff;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logos {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo { height: 36px; width: auto; display: block; }
.logo-redoak    { height: 36px; }
.logo-mirrorweb { height: 32px; }

.logo-partnership {
  font-size: 1rem;
  font-weight: 300;
  color: #CBD5E1;
  line-height: 1;
  margin: 0 0.1rem;
  user-select: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-product-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
  white-space: nowrap;
}

/* Remove old co-badge and badge-logo rules — replaced above */
.co-badge { display: none; }
.badge-logo { display: none; }

/* Slim accent bar below logos */
.tagline-bar {
  background: #1E293B;
  padding: 0.45rem 2rem;
  border-top: 1px solid #334155;
}

.header-tagline {
  max-width: 860px;
  margin: 0 auto;
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
}

/* ── Admin context banner ─────────────────────────────────── */
.admin-context-banner {
  width: 100%;
  padding: 0.6rem 2rem;
}
.admin-context-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}
.admin-context-visit {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(0,0,0,0.18);
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.admin-context-visit:hover {
  background: rgba(0,0,0,0.32);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
  filter: none;
}
/* Bar itself is transparent inside the banner */
.admin-context-inner .admin-tenant-bar {
  display: contents;
}
.admin-context-inner .admin-tenant-bar .admin-tenant-label { display: none; }
.admin-context-pill {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.2);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-context-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
  opacity: 0.95;
}
.admin-context-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tenant picker (admin header dropdown) ────────────────── */
.tenant-picker { position: relative; }

.tenant-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  background: rgba(0,0,0,0.18);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  min-width: 160px;
  max-width: 300px;
}
.tenant-picker-trigger:hover {
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.55);
}

/* Shared swatch style — used in trigger and options */
.tps {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  overflow: hidden;
}
.tps img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.tenant-picker-name,
.tenant-picker-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-picker-chevron {
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform 0.2s;
}
.tenant-picker[data-open] .tenant-picker-chevron { transform: rotate(180deg); }

.tenant-picker-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  min-width: 230px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.16);
  z-index: 9999;
  padding: 0.3rem;
}

.tenant-picker-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.48rem 0.65rem;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 0.83rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s;
}
.tenant-picker-option:hover    { background: #f1f5f9; }
.tenant-picker-option.is-active {
  background: #f8fafc;
  font-weight: 700;
}
.tenant-picker-option .tps {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

/* ── Stepper ──────────────────────────────────────────────── */
.stepper {
  background: #1E293B;
  border-bottom: none;
  padding: 0;
}

.stepper ol {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  list-style: none;
  display: flex;
  gap: 0;
  height: 2.75rem;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  font-size: 0.75rem;
  color: #64748B;
  position: relative;
  white-space: nowrap;
  font-weight: 500;
  flex: 0 0 auto;
}

.step + .step::before {
  content: "›";
  color: #475569;
  margin: 0 0.35rem;
  font-size: 1rem;
  line-height: 1;
}

.step.active {
  color: #ffffff;
  font-weight: 600;
}
.step.active .step-num {
  background: var(--brand-accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(162,33,46,0.35);
}

.step.done { color: #4ADE80; font-weight: 500; }
.step.done .step-num {
  background: #16A34A;
  color: #fff;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #334155;
  color: #64748B;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.step-label { font-size: 0.75rem; }

/* ── Card badge pill ──────────────────────────────────────── */
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(162,33,46,0.06);
  color: var(--brand-accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(162,33,46,0.18);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Scope selector grid ──────────────────────────────────── */
.scope-section { margin-bottom: 1.5rem; }
.scope-section > .fieldset-legend { margin-bottom: 0.65rem; }

.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.scope-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 0.9rem 0.9rem 0.9rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: #ffffff;
}

.scope-card:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.scope-radio {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  accent-color: var(--brand-accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.scope-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.scope-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0.1rem 0 0;
  transition: color 0.15s;
}

.scope-desc {
  font-size: 0.77rem;
  color: #64748B;
  line-height: 1.45;
  margin: 0;
}

/* Selected scope card */
.scope-card:has(input:checked) {
  border-color: var(--brand-accent);
  background: linear-gradient(135deg, #fff8f8 0%, #fff1f2 100%);
  box-shadow: 0 0 0 3px rgba(162,33,46,0.07);
}
.scope-card:has(input:checked) .scope-title { color: var(--brand-accent); }
.scope-card:has(input:checked) .scope-icon-box {
  background: var(--brand-accent);
  color: #ffffff;
}

/* ── Full-width button variant ────────────────────────────── */
.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2.5rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(15,23,42,0.04),
    0 4px 16px rgba(15,23,42,0.06),
    0 12px 40px rgba(15,23,42,0.04);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 540px;
  position: relative;
  overflow: hidden;
}

/* Red gradient accent strip — sits flush at the top of every card */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-accent) 0%, #e05565 55%, rgba(162,33,46,0.25) 100%);
  pointer-events: none;
}

.card-wide { max-width: 760px; }
.card-domains { max-width: 1100px; }

.card-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.success-icon { color: #16A34A; }

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 0.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.card-subtitle {
  color: #64748B;
  font-size: 0.925rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

/* ── Info / warn banners ──────────────────────────────────── */
.info-banner, .warn-banner {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.info-banner {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E3A5F;
}

.warn-banner {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  color: #78350F;
}

.info-icon { font-size: 1.05rem; flex-shrink: 0; margin-top: 2px; }

/* ── Form elements ────────────────────────────────────────── */
.fieldset {
  border: none;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.fieldset-legend {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0F172A;
  margin-bottom: 0.65rem;
  display: block;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: #fff;
}

.radio-card:hover {
  border-color: #93C5FD;
  background: #F8FBFF;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--brand-accent);
  flex-shrink: 0;
}

.radio-card:has(input:checked) {
  border-color: var(--brand-accent);
  background: #FFF5F5;
  box-shadow: 0 0 0 3px rgba(162,33,46,0.08);
}

.radio-card input[type="radio"]:checked ~ .radio-card-body strong {
  color: var(--brand-accent);
}

.radio-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.radio-card-body strong {
  font-size: 0.925rem;
  color: #0F172A;
  font-weight: 600;
}

.radio-desc {
  font-size: 0.82rem;
  color: #64748B;
  line-height: 1.45;
}

/* Recipient block */
.recipient-block {
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}

.recipient-block.hidden { display: none; }

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.text-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1E293B;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
}

.text-input:focus {
  border-color: #2c67b2;
  box-shadow: 0 0 0 3px rgba(44,103,178,0.12);
}
.text-input.input-error { border-color: var(--brand-accent); }

.field-hint {
  font-size: 0.77rem;
  color: #94A3B8;
  margin-top: 0.4rem;
  line-height: 1.5;
}

.field-required { color: var(--brand-accent); margin-left: 2px; }

.field-error {
  font-size: 0.78rem;
  color: var(--brand-accent);
  margin-top: 0.35rem;
  font-weight: 500;
}

.ndr-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1E293B;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}
.ndr-input:focus {
  border-color: #2c67b2;
  box-shadow: 0 0 0 3px rgba(44,103,178,0.12);
}
.ndr-input.input-error { border-color: var(--brand-accent); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  font-family: inherit;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-accent);
  color: #fff;
  border-color: var(--brand-accent);
  box-shadow: 0 1px 2px rgba(162,33,46,0.2), 0 4px 12px rgba(162,33,46,0.15);
  position: relative;
  overflow: hidden;
}
/* Shimmer sweep on all primary buttons */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0)    0%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0)    100%
  );
  transform: skewX(-15deg);
  transition: left 0.45s ease;
  pointer-events: none;
}
.btn-primary:hover:not(:disabled)::after { left: 130%; }

.btn-primary:hover:not(:disabled) {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  filter: brightness(0.9);
  color: #fff;
  box-shadow: 0 6px 20px rgba(162,33,46,0.28), 0 2px 6px rgba(162,33,46,0.18);
  transform: translateY(-2px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(162,33,46,0.2);
}
/* Arrow spring — works for both span.btn-arrow and svg.btn-arrow-icon */
.btn-primary .btn-arrow,
.btn-primary .btn-arrow-icon {
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-primary:hover:not(:disabled) .btn-arrow,
.btn-primary:hover:not(:disabled) .btn-arrow-icon {
  transform: translateX(5px);
}

.btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #CBD5E1;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
.btn-secondary:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: #94A3B8;
  color: #1E293B;
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid #E2E8F0;
  color: #64748B;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-ghost:hover { background: #F8FAFC; border-color: #CBD5E1; color: #374151; }

.btn-arrow { font-size: 0.9rem; }

.action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.action-row-spaced {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-saved {
  background: #16A34A !important;
  border-color: #16A34A !important;
  color: #fff !important;
  cursor: default;
  box-shadow: none !important;
}

.btn-error {
  background: var(--brand-accent) !important;
  border-color: var(--brand-accent) !important;
  color: #fff !important;
}

/* ── Security note ────────────────────────────────────────── */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #F1F5F9;
  font-size: 0.78rem;
  color: #94A3B8;
}

.lock-icon { font-size: 0.95rem; flex-shrink: 0; }

/* ── Pre-flight review ────────────────────────────────────── */
.review-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #F1F5F9;
}

.review-section:last-of-type { border-bottom: none; }

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-icon { font-size: 0.9rem; }

.rule-list, .change-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.rule-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.rule-detail { color: #64748B; font-size: 0.8rem; }

.badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-preserve { background: #DCFCE7; color: #166534; }
.badge-exists   { background: #E0F2FE; color: #0C4A6E; }

.change-item {
  padding: 0.9rem 1rem;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 0.875rem;
  background: #fff;
}

.change-item.skippable {
  background: #F8FAFC;
  opacity: 0.7;
}

.change-header {
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.change-tag {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #2c67b2;
  color: #fff;
  padding: 2px 7px;
  border-radius: 5px;
}

.change-detail { color: #475569; line-height: 1.55; }
.change-detail.muted { color: #2c67b2; font-style: italic; }

.change-props {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 0.25rem;
  color: #475569;
}

.change-props li { font-size: 0.83rem; }

.empty-note { font-size: 0.84rem; color: #94A3B8; font-style: italic; }

/* ── Progress page ────────────────────────────────────────── */
.progress-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.5rem 0;
}

.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 0.5rem;
  border-bottom: 1px solid #F1F5F9;
  border-radius: 8px;
  transition: background 0.2s;
}

.progress-step:last-child { border-bottom: none; }

.step-status-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
  line-height: 1.5;
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.step-name  { font-weight: 600; font-size: 0.9rem; color: #1E293B; }
.step-detail { font-size: 0.8rem; color: #64748B; word-break: break-all; }

/* State colours */
.progress-step.running  { background: #F0F7FF; padding-left: 0.75rem; }
.progress-step.running  .step-name { color: #2c67b2; }
.progress-step.done     .step-name { color: #15803D; }
.progress-step.error    .step-name { color: var(--brand-accent); }

.step-spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid #CBD5E1;
  border-top-color: #2c67b2;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Error block ──────────────────────────────────────────── */
.error-block {
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #881337;
}

.error-block.hidden { display: none; }
.error-title { font-weight: 700; margin-bottom: 0.4rem; font-size: 0.95rem; }

/* ── Complete page ────────────────────────────────────────── */
.summary-section { margin-bottom: 1.75rem; }

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1rem;
}

.summary-table th,
.summary-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #F1F5F9;
}

.summary-table th {
  width: 40%;
  color: #64748B;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.82rem;
}

.summary-table td { color: #1E293B; word-break: break-all; }

.setup-token {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #2c67b2;
  background: #EFF6FF;
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.token-cell {
  white-space: nowrap;
  min-width: 220px;
}

.token-copy-btn {
  background: none;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  color: #64748B;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
  transition: all 0.15s;
  font-family: inherit;
}
.token-copy-btn:hover { background: #EFF6FF; color: #2c67b2; border-color: #93C5FD; }
.token-copy-btn.copied { color: #16A34A; border-color: #86EFAC; background: #F0FDF4; }

.step-log {
  margin-top: 0.75rem;
  font-size: 0.82rem;
}

.step-log summary {
  cursor: pointer;
  color: #2c67b2;
  font-weight: 600;
  padding: 0.3rem 0;
  font-size: 0.84rem;
}

.log-list { list-style: none; padding: 0.75rem 0 0; display: flex; flex-direction: column; gap: 0.4rem; }

.log-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

.log-icon { flex-shrink: 0; }
.log-msg   { color: #334155; }
.log-detail { color: #94A3B8; font-size: 0.78rem; }

.next-steps {
  padding-top: 1.5rem;
  border-top: 1px solid #F1F5F9;
  margin-bottom: 0.5rem;
}

.next-steps p { font-size: 0.875rem; color: #475569; margin-bottom: 1rem; line-height: 1.6; }

.next-steps-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  counter-reset: steps;
}
.next-steps-list > li {
  display: flex;
  gap: 0.85rem;
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.6;
  counter-increment: steps;
}
.next-steps-list > li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #2c67b2;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}

/* ── Admin pages: strip all main-content / page-layout constraints ── */
body.is-admin .main-content {
  padding: 0;
  display: block;
  justify-content: unset;
}
body.is-admin .page-layout {
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
  justify-content: flex-start;
}
body.is-admin .card-domains,
body.is-admin .card-wide {
  max-width: none;
}

/* ── Page layout (sidebar + card) ────────────────────────── */
.page-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* When no sidebar is present, center the card horizontally */
.page-layout:not(:has(.ken-sidebar)) {
  justify-content: center;
}

.page-layout .card-wide {
  flex: 1;
  min-width: 0;
}

/* Without a sidebar the card should stay at its natural max-width */
.page-layout:not(:has(.ken-sidebar)) .card-wide {
  flex: 0 1 760px;
}

/* BD card logo header */
.bd-logo-img {
  height: 32px;
  width: auto;
  display: block;
  margin-bottom: 0.25rem;
}

/* ── Ken / BD sidebar — uses per-tenant brand colours ──────── */
/*   --brand-primary → header/card gradient start               */
/*   --brand-cta     → gradient end, blockquote border          */
/*   Heading:  #2E3D62  (navy)                                  */
/* ────────────────────────────────────────────────────────────*/
.ken-sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* ── BD card ─────────────────────────────────────────────── */
.bd-card {
  background: #ffffff;
  border: 1px solid #d8c8e8;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(55,0,110,0.04),
    0 4px 16px rgba(55,0,110,0.08);
  overflow: hidden;
  position: sticky;
  top: 5rem;
}

/* Purple gradient header — mirrors the Tailwind preview */
.bd-card-header {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-cta) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: none;
}

.bd-logo-img {
  height: 30px;
  width: auto;
  display: block;
  /* brighten the logo on the dark purple background */
  filter: brightness(0) invert(1);
}

.bd-id strong {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  line-height: 1.3;
  display: block;
  text-align: center;
  font-family: "Montserrat", "Inter", sans-serif;
  letter-spacing: 0.01em;
}

.bd-description {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.65;
  border-left: 3px solid var(--brand-cta);
  padding: 0.9rem 1.25rem 1.1rem 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bd-description p { margin: 0; }

/* ── Ken card ────────────────────────────────────────────── */
.ken-card {
  background: #ffffff;
  border: 1px solid #d8c8e8;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(55,0,110,0.04),
    0 4px 16px rgba(55,0,110,0.08);
  overflow: hidden;
  position: sticky;
  top: 5rem;
}

/* Cetera purple gradient header for Ken card too */
.ken-header {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-cta) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: none;
}

.ken-cetera-logo {
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.ken-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.2), 0 4px 12px rgba(0,0,0,0.3);
}

.ken-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.ken-id strong {
  font-size: 0.875rem;
  color: #ffffff;
  font-weight: 700;
  font-family: "Montserrat", "Inter", sans-serif;
}

.ken-id span {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.35;
}

.ken-quote {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.65;
  border-left: 3px solid var(--brand-cta);
  padding: 0.9rem 1.1rem 1rem 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ken-quote p { margin: 0; }

.ken-sign-off {
  margin-top: 0.25rem;
  font-style: italic;
  color: #2E3D62;
  font-size: 0.82rem;
}

/* ── BD legacy sidebar (kept for compatibility) ───────────── */
.bd-sidebar { width: 280px; flex-shrink: 0; }

@media (max-width: 900px) {
  .page-layout { flex-direction: column; }
  .ken-sidebar { width: 100%; }
  .ken-card { position: static; }
  .bd-sidebar { width: 100%; order: 3 !important; }
  .bd-card { position: static; }
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #1E293B;
  color: rgba(255,255,255,0.35);
  text-align: center;
  font-size: 0.73rem;
  padding: 1rem;
  margin-top: auto;
}

.site-footer a { color: rgba(255,255,255,0.55); }
.site-footer a:hover { color: rgba(255,255,255,0.9); }

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Pill / tag input ─────────────────────────────────────── */
.pill-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.4rem 0.7rem;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.pill-box:focus-within {
  border-color: #2c67b2;
  box-shadow: 0 0 0 3px rgba(44,103,178,0.12);
}
.pill-box.pill-box-error { border-color: var(--brand-accent); background: #FFF1F2; }
.pill-placeholder {
  position: absolute;
  left: 0.75rem;
  color: #94A3B8;
  font-size: 0.88rem;
  pointer-events: none;
  user-select: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  border-radius: 999px;
  padding: 0.2rem 0.5rem 0.2rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #93C5FD;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  transition: color 0.15s;
}
.pill-remove:hover { color: var(--brand-accent); }
.pill-text-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1E293B;
  min-width: 200px;
  flex: 1;
  padding: 0.2rem 0;
}
kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid #CBD5E1;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #F8FAFC;
  font-size: 0.75rem;
  font-family: monospace;
  color: #475569;
}

/* ── Preflight existing & new rules blocks ────────────────── */
.existing-rules-block {
  margin: 0.75rem 0 0.5rem;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}
.existing-rules-label,
.new-rules-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
  padding: 0.5rem 0.9rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  margin: 0;
}
.existing-rule-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid #F8FAFC;
  transition: background 0.12s;
}
.existing-rule-row:last-child { border-bottom: none; }
.existing-rule-row:hover { background: #F8FAFC; }
.rule-checkbox { width: 15px; height: 15px; accent-color: var(--brand-accent); flex-shrink: 0; }
.existing-rule-email { font-size: 0.875rem; color: #1E293B; }
.new-rules-block {
  margin-top: 0.75rem;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  overflow: hidden;
  background: #EFF6FF;
}
.new-rules-block .new-rules-label {
  background: #DBEAFE;
  border-bottom-color: #BFDBFE;
  color: #1D4ED8;
}
.new-rules-block .change-props {
  padding: 0.5rem 1rem 0.75rem;
  margin: 0;
}
.badge-add {
  display: inline-block;
  background: #2c67b2;
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  margin-right: 0.3rem;
  vertical-align: middle;
}

/* ── Preflight specific scope block ──────────────────────── */
.scope-specific-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0.6rem 0.9rem;
  background: #F8FAFC;
  border-left: 3px solid #2c67b2;
  border-radius: 0 8px 8px 0;
}
.scope-specific-note { font-size: 0.82rem; color: #475569; font-weight: 400; }

/* ── Domain dashboard (admin report) ─────────────────────── */
.domain-dashboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 1px solid #E2E8F0;
  border-left: 4px solid var(--brand-accent);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.domain-dash-left { flex: 1; min-width: 200px; }
.domain-dash-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  display: block;
  margin-bottom: 0.4rem;
}
.domain-dash-numbers {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.domain-dash-complete { font-size: 2rem; font-weight: 800; color: #15803D; line-height: 1; }
.domain-dash-sep      { color: #CBD5E1; font-size: 1.5rem; }
.domain-dash-total    { font-size: 1.5rem; color: #334155; font-weight: 700; }
.domain-dash-pct      { margin-left: 0.5rem; font-size: 0.95rem; color: #64748B; font-weight: 500; }
.domain-dash-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.domain-dash-bar {
  height: 100%;
  background: linear-gradient(90deg, #15803D, #22C55E);
  border-radius: 999px;
  transition: width 0.6s ease;
  min-width: 4px;
}
.domain-dash-sub { font-size: 0.78rem; color: #64748B; }
.domain-dash-btn { white-space: nowrap; }

/* ── Domain status page ───────────────────────────────────── */
.domain-full-track {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  margin: 1.25rem 0 1.5rem;
}
.domain-full-bar {
  height: 100%;
  background: linear-gradient(90deg, #15803D, #22C55E);
  border-radius: 999px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.add-domain-details {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.add-domain-summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: #2c67b2;
  background: #F8FAFC;
  list-style: none;
  user-select: none;
}
.add-domain-summary::-webkit-details-marker { display: none; }
.add-domain-summary:hover { background: #F1F5F9; }
.add-domain-form { padding: 1rem 1.25rem 0.5rem; }
.add-domain-fields {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.add-domain-field    { flex: 1; min-width: 180px; }
.add-domain-field-sm { flex: 0 0 120px; min-width: 100px; }
.add-domain-field-lg { flex: 2; min-width: 200px; }

.domain-filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.domain-search { flex: 1; min-width: 200px; max-width: 320px; }
.domain-filter-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid #E2E8F0;
  background: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  color: #64748B;
  transition: all 0.12s;
  font-family: inherit;
}
.filter-btn:hover { background: #F1F5F9; border-color: #CBD5E1; }
.filter-btn.active {
  background: #1E293B;
  color: #fff;
  border-color: #1E293B;
}

.badge-pending { background: #FEF3C7; color: #92400E; }

/* ── Inline domain edit ───────────────────────────────────── */
.action-link-edit { color: #2c67b2; margin-right: 0.5rem; }
.action-link-edit:hover { color: #1a4a8a; }

.inline-edit-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.inline-edit-domain {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1E293B;
  min-width: 160px;
}

.inline-edit-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inline-edit-input {
  padding: 0.35rem 0.65rem;
  border: 1.5px solid #2c67b2;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1E293B;
  background: #fff;
  font-family: inherit;
}
.inline-edit-sm     { width: 70px; }
.inline-edit-lg     { width: 220px; }
.inline-edit-select { width: 160px; cursor: pointer; }

.inline-edit-save {
  padding: 0.35rem 0.9rem;
  font-size: 0.83rem;
  align-self: flex-end;
}

.action-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  transition: background 0.12s;
  white-space: nowrap;
  font-family: inherit;
}
.action-link-success { color: #15803D; }
.action-link-success:hover { background: #F0FDF4; }
.action-link-muted { color: #64748B; }
.action-link-muted:hover { background: #F1F5F9; }

/* ── Waitroom ─────────────────────────────────────────────── */
.waitroom-card { max-width: 560px; margin: 0 auto; text-align: center; }
.waitroom-icon { font-size: 2.75rem; margin-bottom: 0.5rem; transition: all 0.3s ease; }
.waitroom-position-wrap { margin: 1.75rem 0 1.25rem; }
.waitroom-position-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.waitroom-num {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--brand-accent);
  line-height: 1;
  transition: all 0.4s ease;
  letter-spacing: -0.04em;
}
.waitroom-num-label { font-size: 1.1rem; color: #64748B; font-weight: 500; }
.waitroom-eta { font-size: 0.925rem; color: #475569; min-height: 1.4em; transition: opacity 0.3s ease; }
.waitroom-progress-track {
  height: 5px;
  background: #E2E8F0;
  border-radius: 999px;
  margin: 1.5rem 0 1.25rem;
  overflow: hidden;
}
.waitroom-progress-bar {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, var(--brand-accent), #C0394A);
  border-radius: 999px;
  transition: width 0.8s ease;
}
.waitroom-dots { display: flex; justify-content: center; gap: 0.5rem; }
.waitroom-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-accent);
  opacity: 0.3;
  animation: waitPulse 1.4s ease-in-out infinite;
}
.waitroom-dot:nth-child(2) { animation-delay: 0.25s; }
.waitroom-dot:nth-child(3) { animation-delay: 0.5s; }
@keyframes waitPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
  40%           { opacity: 1;   transform: scale(1.35); }
}

/* ── Admin ghost link ─────────────────────────────────────── */
.admin-ghost-link {
  position: fixed;
  bottom: 14px;
  right: 18px;
  font-size: 11px;
  opacity: 0.04;
  text-decoration: none;
  color: #1E293B;
  transition: opacity 0.3s ease;
  user-select: none;
  z-index: 999;
}
.admin-ghost-link:hover { opacity: 0.2; }

/* ── Admin login ──────────────────────────────────────────── */
.admin-login-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem;
}
.admin-login-card { width: 100%; max-width: 380px; text-align: center; }
.admin-lock-icon  { font-size: 2.5rem; margin-bottom: 0.25rem; }
.pin-input-wrap   { display: flex; justify-content: center; margin-top: 1.25rem; }
.pin-input {
  font-size: 2rem;
  font-family: "Inter", monospace;
  letter-spacing: 0.45em;
  text-align: center;
  width: 220px;
  padding: 0.6rem 0.75rem;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #1E293B;
}
.pin-input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(162,33,46,0.12); }
.pin-input.input-error { border-color: var(--brand-accent); background: #FFF1F2; }

.error-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: #881337;
  text-align: left;
}

/* ── Admin report ─────────────────────────────────────────── */
.admin-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-report-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
  width: 100%;
}
.stat-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.stat-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 2px 8px rgba(15,23,42,0.06);
}

/* Full-width on smaller viewports */
@media (max-width: 1024px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
}
.stat-card.stat-success { border-color: #BBF7D0; background: #F0FDF4; }
.stat-card.stat-fail    { border-color: #FECDD3; background: #FFF1F2; }
.stat-num { font-size: 2rem; font-weight: 800; color: #1E293B; line-height: 1; letter-spacing: -0.03em; }
.stat-card.stat-success .stat-num { color: #15803D; }
.stat-card.stat-fail    .stat-num { color: var(--brand-accent); }
.stat-label {
  font-size: 0.72rem;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}
.report-table th {
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}
.report-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #F8FAFC;
  color: #334155;
  vertical-align: middle;
}
.report-table tbody tr {
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover {
  background: #F0FEFB;
  box-shadow: inset 4px 0 0 var(--brand-accent);
}
.report-table tbody tr:active {
  background: #ECFDFA;
}
.td-mono  { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.78rem; }
.td-muted { color: #94A3B8; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: #DCFCE7; color: #166534; }
.badge-fail    { background: #FFE4E6; color: #9F1239; }
.badge-gsuite  { background: #E8F0FE; color: #1557B0; font-size: 0.68rem; font-weight: 700;
                 padding: 0.1rem 0.5rem; margin-left: 0.4rem; vertical-align: middle; border-radius: 999px; }
.badge-m365    { background: #EFF6FF; color: #1D4ED8; font-size: 0.68rem; font-weight: 700;
                 padding: 0.1rem 0.5rem; margin-left: 0.4rem; vertical-align: middle; border-radius: 999px; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748B;
  font-size: 0.925rem;
}

/* ── NDR detected banner ──────────────────────────────────── */
.ndr-detected-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.25rem;
}
.ndr-detected-icon    { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.05rem; }
.ndr-detected-body    { flex: 1; }
.ndr-detected-label   { font-size: 0.875rem; color: #334155; margin-bottom: 0.3rem; }
.ndr-detected-address { font-size: 1rem; font-weight: 700; color: #1D4ED8; margin-bottom: 0.6rem; }
.ndr-detected-question { font-size: 0.875rem; font-weight: 600; color: #1E293B; margin-bottom: 0.55rem; }
.ndr-detected-choices { display: flex; gap: 0.65rem; flex-wrap: wrap; }

.ndr-choice-card {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid #BFDBFE;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.855rem;
  color: #334155;
  transition: all 0.12s;
  user-select: none;
}
.ndr-choice-card:hover { border-color: #2c67b2; background: #F0F7FF; }
.ndr-choice-card.ndr-choice-selected {
  border-color: #2c67b2;
  background: #EFF6FF;
  color: #1D4ED8;
  font-weight: 600;
}
.ndr-choice-card input[type="radio"] { accent-color: #2c67b2; }
.ndr-choice-label { pointer-events: none; }

/* ── Admin tenant switcher bar ────────────────────────────── */
.admin-tenant-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 1rem 1.5rem 0;
}

.admin-tenant-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.admin-tenant-select {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-tenant-select:focus {
  outline: none;
  border-color: #37006e;
  box-shadow: 0 0 0 3px rgba(55,0,110,0.12);
}

.admin-tenant-rename-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0.25rem;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.admin-tenant-rename-btn:hover { color: #37006e; }

.admin-tenant-rename-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-tenant-rename-input {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  background: #fff;
  border: 1.5px solid #37006e;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  width: 260px;
  box-shadow: 0 0 0 3px rgba(55,0,110,0.10);
}
.admin-tenant-rename-input:focus { outline: none; }

.admin-tenant-rename-save {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: #37006e;
  border: none;
  border-radius: 7px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.admin-tenant-rename-save:hover { background: #54117b; }

.admin-tenant-rename-cancel {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
}
.admin-tenant-rename-cancel:hover { color: #1e293b; }

/* ── Admin two-column layout ──────────────────────────────── */
.admin-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.admin-main {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  max-width: none;
}

.admin-sidebar {
  flex: 1 0 400px;   /* grow to fill all remaining space */
  min-width: 400px;
  max-width: none;
}

/* ── Tenant Settings two-column grid ─────────────────────── */
.ts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.ts-col { min-width: 0; }
.ts-grid-uploads { align-items: flex-start; }

@media (max-width: 900px) {
  .ts-grid { grid-template-columns: 1fr; }
  .admin-sidebar { flex: 0 0 320px; width: 320px; }
}

.sidebar-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 16px rgba(15,23,42,0.06);
}

.sidebar-title { font-size: 1rem; font-weight: 700; color: #0F172A; margin-bottom: 0.4rem; }

.sidebar-hint {
  font-size: 0.79rem;
  color: #64748B;
  line-height: 1.5;
  margin-bottom: 1.1rem;
}

.sidebar-field { margin-bottom: 1.1rem; }

.sidebar-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 7px;
  font-size: 0.875rem;
  color: #1E293B;
  background: #F8FAFC;
  transition: all 0.15s;
  font-family: inherit;
}
.sidebar-input:focus {
  outline: none;
  border-color: #2c67b2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44,103,178,0.1);
}

.sidebar-textarea {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 7px;
  font-size: 0.875rem;
  color: #1E293B;
  background: #F8FAFC;
  resize: vertical;
  font-family: inherit;
  transition: all 0.15s;
}
.sidebar-textarea:focus {
  outline: none;
  border-color: #2c67b2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44,103,178,0.1);
}

.sidebar-jfa-current { font-size: 0.79rem; color: #64748B; margin-bottom: 0.4rem; }
.sidebar-save-btn { width: 100%; justify-content: center; margin-top: 0.5rem; }

/* ── Google Workspace instructions page ───────────────────── */
.gsuite-paths { display: flex; gap: 1.5rem; margin-top: 1.75rem; align-items: stretch; }

.gsuite-path {
  flex: 1;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.gsuite-path-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #E2E8F0;
}

.gsuite-path-icon  { font-size: 1.75rem; display: block; margin-bottom: 0.5rem; }
.gsuite-path-title { font-size: 1rem; font-weight: 700; color: #0F172A; margin-bottom: 0.3rem; }
.gsuite-path-sub   { font-size: 0.83rem; color: #64748B; line-height: 1.5; }
.gsuite-path-links { display: flex; flex-direction: column; gap: 0.75rem; }

.gsuite-link-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: #334155;
  transition: all 0.15s;
}
.gsuite-link-card:hover {
  border-color: #2c67b2;
  box-shadow: 0 2px 12px rgba(44,103,178,0.1);
  color: #1E293B;
  transform: translateY(-1px);
}

.gsuite-link-icon { font-size: 1.3rem; flex-shrink: 0; }
.gsuite-link-card div { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.gsuite-link-card strong { font-size: 0.875rem; }
.gsuite-link-card span  { font-size: 0.77rem; color: #64748B; }
.gsuite-link-arrow { font-size: 1rem; color: #94A3B8; flex-shrink: 0; }
.gsuite-path-note  { font-size: 0.79rem; color: #64748B; line-height: 1.5; margin-top: auto; padding-top: 1rem; }

.gsuite-divider {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: #94A3B8;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
  padding: 0 0.25rem;
}

@media (max-width: 680px) {
  .gsuite-paths { flex-direction: column; }
  .gsuite-divider { flex-direction: row; gap: 0.5rem; }
  .gsuite-divider::before, .gsuite-divider::after {
    content: ''; flex: 1; height: 1px; background: #E2E8F0;
  }
}

/* ── CMS editor ──────────────────────────────────────────── */
.cms-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #E2E8F0;
}
.cms-section:last-child { border-bottom: none; margin-bottom: 0; }

.cms-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.cms-section-title { font-size: 1rem; font-weight: 700; color: #0F172A; }

.cms-preview {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.5rem;
}

.cms-field {
  font: inherit;
  color: inherit;
  background: rgba(44, 103, 178, 0.05);
  border: 1.5px dashed rgba(44, 103, 178, 0.3);
  border-radius: 5px;
  width: 100%;
  resize: vertical;
  padding: 3px 6px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s;
  display: block;
}
.cms-field:focus {
  background: #fff;
  border-color: #2c67b2;
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(44,103,178,0.1);
}
input.cms-field { resize: none; }

/* ── Microsoft connect button ─────────────────────────────── */
.btn-ms {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
}
.ms-logo { flex-shrink: 0; }

/* ── Recipient picker ─────────────────────────────────────── */
.recipient-picker { position: relative; }
.picker-search { width: 100%; box-sizing: border-box; }
.picker-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(15,23,42,0.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
}
.picker-item {
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.1s;
}
.picker-item:hover { background: #F0F7FF; }
.picker-item-selected { background: #EFF6FF; }
.picker-item-selected:hover { background: #DBEAFE; }
.picker-check {
  margin-left: auto;
  color: #2c67b2;
  font-weight: 700;
  display: none;
  flex-shrink: 0;
}
.picker-item-selected .picker-check { display: block; }
.picker-pill-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  cursor: text;
  transition: all 0.15s;
}
.picker-pill-box:focus-within { border-color: #2c67b2; box-shadow: 0 0 0 3px rgba(44,103,178,0.1); }
.picker-pill-box .pill { margin: 0; }
.picker-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #EFF6FF;
  color: #1D4ED8;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.picker-item-group .picker-label { color: #2c67b2; }

/* ── Preflight loading spinner ────────────────────────────── */
.preflight-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  gap: 0.75rem;
}
.preflight-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: #2c67b2;
  border-radius: 50%;
  animation: preflight-spin 0.8s linear infinite;
}
@keyframes preflight-spin { to { transform: rotate(360deg); } }
.preflight-loading-msg { font-size: 0.925rem; font-weight: 600; color: #2c67b2; margin: 0; }
.preflight-loading-sub { font-size: 0.82rem; color: #64748B; margin: 0; }

/* ── Email compose modal ──────────────────────────────────── */
.email-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.email-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(15,23,42,0.2), 0 1px 3px rgba(15,23,42,0.1);
  width: 100%;
  max-width: 740px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.email-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #F1F5F9;
  background: #F8FAFC;
}
.email-modal-title  { font-weight: 700; font-size: 1rem; color: #0F172A; }
.email-modal-close  {
  background: none; border: none; font-size: 1.4rem; line-height: 1;
  color: #64748B; cursor: pointer; padding: 0 0.2rem;
}
.email-modal-close:hover { color: #0F172A; }
.email-modal-meta {
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
  background: #FAFBFD;
  font-size: 0.845rem;
}
.email-meta-row     { display: flex; gap: 0.6rem; padding: 0.15rem 0; }
.email-meta-label   { font-weight: 600; color: #64748B; min-width: 3.5rem; }
.email-meta-value   { color: #1E293B; }
.email-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 55vh;
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.65;
}
.email-modal-body p { margin: 0 0 0.75rem; }
.email-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.845rem;
}
.email-detail-table th,
.email-detail-table td { padding: 5px 10px; text-align: left; vertical-align: top; }
.email-detail-table th {
  background: #F1F5F9;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
  width: 36%;
}
.email-detail-table td { color: #1E293B; word-break: break-all; }
.email-recipients-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0F172A;
  margin: 1.25rem 0 0.5rem;
}
.email-recipients-count { font-weight: 400; color: #64748B; font-size: 0.82rem; }
.email-recipients-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.email-recipients-table thead tr { background: #2c67b2; color: #fff; }
.email-recipients-table th,
.email-recipients-table td { padding: 5px 10px; text-align: left; border-bottom: 1px solid #F1F5F9; }
.email-recipients-table tbody tr:nth-child(even) { background: #F8FAFC; }
.email-modal-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #F1F5F9;
  background: #FAFBFD;
  flex-wrap: wrap;
}

/* ── NDR screen — compact review summary ──────────────────── */
.ndr-summary {
  background: #F0F7FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
}
.ndr-summary-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #2c67b2;
  margin-bottom: 0.65rem;
}
.ndr-summary-list  { display: flex; flex-direction: column; gap: 0.4rem; }
.ndr-summary-row   { display: flex; gap: 0.75rem; font-size: 0.875rem; align-items: baseline; }
.ndr-summary-row dt { font-weight: 600; color: #1E293B; min-width: 10rem; flex-shrink: 0; }
.ndr-summary-row dd { color: #334155; }
.ndr-summary-row code { background: #DBEAFE; border-radius: 3px; padding: 0 4px; font-size: 0.82rem; }

/* ── Completion tracker (complete screen) ─────────────────── */
.completion-tracker { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem 0; }
.completion-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.completion-step-done    { background: #F0FDF4; border-color: #BBF7D0; }
.completion-step-pending { background: #FFFBEB; border-color: #FCD34D; }
.completion-num { font-size: 1.3rem; line-height: 1; flex-shrink: 0; margin-top: 0.1rem; }
.completion-num-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #F59E0B;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.completion-body { flex: 1; }
.completion-body strong { font-size: 0.925rem; color: #0F172A; }
.completion-body p { font-size: 0.845rem; color: #475569; margin-top: 0.2rem; }
.btn-email-action { font-size: 1rem; padding: 0.65rem 1.4rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-tagline { display: none; }
  .stepper ol { overflow-x: auto; padding-bottom: 0.5rem; }
  .step-label { display: none; }
  .card { padding: 1.5rem 1.25rem; border-radius: 12px; }
  .action-row-spaced { flex-direction: column-reverse; }
  .btn { width: 100%; justify-content: center; }
  .admin-report-header { flex-direction: column; align-items: flex-start; }
  .stat-row { flex-direction: column; }
  .admin-layout { flex-direction: column; padding: 1rem; }
  .admin-sidebar { width: 100%; flex: none; }
}

/* ── Header tenant switcher ───────────────────────────────── */
.header-tenant-switcher {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Override the standalone bar styles when inside the header */
.header-tenant-switcher .admin-tenant-bar {
  width: auto;
  padding: 0;
  justify-content: center;
}

/* ── Color picker row ─────────────────────────────────────── */
.color-picker-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.35rem;
}

.color-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.color-picker-item input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: none;
}

.color-picker-item label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
}

/* ── Asset upload ─────────────────────────────────────────── */
.sidebar-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.25rem 0;
}

.asset-preview {
  margin-bottom: 0.5rem;
}

.asset-thumb {
  max-height: 56px;
  max-width: 140px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  object-fit: contain;
  background: #f8fafc;
  padding: 4px;
}

.asset-thumb-round {
  border-radius: 50%;
  max-height: 56px;
  max-width: 56px;
}

.asset-upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.asset-file-input {
  font-size: 0.78rem;
  flex: 1;
  min-width: 0;
}

.asset-feedback {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

/* ── Maintenance mode card ────────────────────────────────── */
.maintenance-card {
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
}
.maintenance-card.maintenance-on {
  background: #FFF7ED;
  border-color: #FED7AA;
}
.maintenance-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.maintenance-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0F172A;
}
.maintenance-card.maintenance-on .maintenance-title {
  color: #92400E;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: #EA580C; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Admin shell (left nav + main) ───────────────────────── */
.admin-shell {
  display: flex;
  align-items: stretch;
  width: 100%;
  position: relative;          /* anchor for the full-height bg strip */
  min-height: calc(100vh - var(--sticky-bar-h, 110px));
}

/* Full-height brand-color strip that fills the nav column to the bottom */
.admin-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 230px;
  height: 100%;
  background: var(--brand-primary);
  pointer-events: none;
  z-index: 0;
}

/* Left nav — sticky inside the colored column */
.admin-nav {
  width: 230px;
  flex-shrink: 0;
  align-self: flex-start;      /* shrink to content height so sticky works */
  position: sticky;
  top: var(--sticky-bar-h, 110px);   /* clears the header + banner */
  max-height: calc(100vh - var(--sticky-bar-h, 110px));
  overflow-y: auto;
  background: var(--brand-primary);
  display: flex;
  flex-direction: column;
  z-index: 1;                  /* above the ::before strip */
}

.admin-nav-inner {
  flex: 1;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-nav-footer {
  padding: 1rem 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

/* Tenant chip */
.admin-nav-tenant {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.6rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  margin-bottom: 1rem;
}

.admin-nav-swatch {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,0.2);
}

.admin-nav-swatch-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1); /* always white on colored bg */
  padding: 4px;
}

.admin-nav-tenant-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.admin-nav-tenant-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-nav-tenant-slug {
  font-size: 0.68rem;
  font-family: 'SFMono-Regular', Consolas, monospace;
  color: rgba(255,255,255,0.5);
}

/* Nav section label */
.admin-nav-section {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.25rem;
}

/* Nav links list */
.admin-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.admin-nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  filter: none;
}

.admin-nav-link.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 600;
}

/* SVG icon inside nav link */
.admin-nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.8;
}
.admin-nav-link:hover .admin-nav-icon,
.admin-nav-link.active .admin-nav-icon { opacity: 1; }

.admin-nav-signout { color: rgba(255,255,255,0.45); font-size: 0.82rem; }
.admin-nav-signout:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.08); }

.admin-nav-user {
  padding: 0.6rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.25rem;
}
.admin-nav-user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-nav-user-email {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav section label + divider */
.admin-nav-section-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  padding: 0.6rem 1rem 0.25rem;
  user-select: none;
}
.admin-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0.5rem 1rem 0.6rem;
}

/* Sub-nav (e.g. Audit Log under Tenants) */
.admin-subnav {
  list-style: none;
  margin: 0;
  padding: 0 0 0.25rem 0;
}
.admin-subnav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem 0.45rem 2.75rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.admin-subnav-link::before {
  content: '';
  position: absolute;
  left: 1.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: background 0.15s;
}
.admin-subnav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.admin-subnav-link:hover::before,
.admin-subnav-link.active::before { background: rgba(255,255,255,0.9); }
.admin-subnav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}
.admin-subnav-link .admin-nav-icon {
  width: 13px;
  height: 13px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Main content area beside left nav */
.admin-shell-main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem;
  background: #F1F5F9;
}

/* Responsive: collapse nav on small screens */
@media (max-width: 768px) {
  .admin-nav { display: none; }
  .admin-shell-main { padding: 1rem; }
}
