/* =====================================================================
   WellnessPlace Pro — Affiliate console design layer
   Loaded after the shell's inline styles and the shared wellness system.
   ===================================================================== */
:root {
  --ap-ink: #0f1f1b;
  --ap-muted: #64748b;
  --ap-line: #e6ece9;
  --ap-surface: #ffffff;
  --ap-canvas: #f3f6f5;
  --ap-deep: #032b23;
  --ap-radius: 18px;
  --ap-shadow: 0 1px 2px rgba(15, 31, 27, .04), 0 10px 28px rgba(15, 31, 27, .06);
  --ap-shadow-lg: 0 24px 60px rgba(3, 43, 35, .18);
  --accent: #10b981;
  --sidebar-width: 260px !important;
  --sidebar-collapsed-width: 72px !important;

}

body {
  --ap-hero: radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 42%),
             radial-gradient(circle at 0% 120%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 46%),
             linear-gradient(135deg, color-mix(in srgb, var(--accent) 78%, #04201a) 0%, color-mix(in srgb, var(--accent) 34%, #03261f) 55%, color-mix(in srgb, var(--accent) 12%, #021510) 100%);
  background: var(--ap-canvas); color: var(--ap-ink); font-family: 'Manrope', system-ui, sans-serif; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 420px at 100% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
              radial-gradient(700px 380px at 0% 100%, rgba(16, 185, 129, .06), transparent 70%);
  transition: background .4s ease;
}

/* ------------------------------------------------------------ sidebar -- */
.sidebar {
  background: radial-gradient(120% 40% at 0% 0%, rgba(20, 184, 166, .18), transparent 60%),
              linear-gradient(185deg, #03382f 0%, #022a23 45%, #01180f 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.sidebar .sidebar-header { padding: 20px 18px 16px; }
.sidebar .sidebar-header img { border-radius: 12px; background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.sidebar .brand-title { font-size: .95rem; letter-spacing: .14em; }

.ap-nav-search { padding: 12px 14px 4px; position: relative; }
.ap-nav-search input {
  width: 100%; height: 38px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .07); color: #fff; padding: 0 12px 0 34px; font-size: .84rem; font-weight: 600; outline: none;
  transition: border-color .2s, background .2s;
}
.ap-nav-search input::placeholder { color: rgba(255, 255, 255, .45); }
.ap-nav-search input:focus { border-color: rgba(52, 211, 153, .6); background: rgba(255, 255, 255, .1); }
.ap-nav-search > i { position: absolute; left: 26px; top: 50%; transform: translateY(-15%); color: rgba(255, 255, 255, .45); font-size: .8rem; }
.ap-nav-search kbd { position: absolute; right: 22px; top: 50%; transform: translateY(-15%); font: 700 .62rem 'Manrope', sans-serif; color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); border-radius: 6px; padding: 2px 6px; box-shadow: none; }
.sidebar.collapsed .ap-nav-search { display: none; }

.sidebar .sidebar-nav { padding: 6px 0 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.sidebar .sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 6px; }
.sidebar .sidebar-nav li { margin: 0 0 2px; }
.sidebar .sidebar-nav li.ap-nav-group {
  padding: 16px 22px 6px; font-size: .62rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, .42); display: flex; align-items: center; gap: 8px;
}
.sidebar .sidebar-nav li.ap-nav-group::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .07); }
.sidebar.collapsed .sidebar-nav li.ap-nav-group { padding: 10px 0 4px; justify-content: center; font-size: 0; }
.sidebar.collapsed .sidebar-nav li.ap-nav-group::after { flex: 0 0 22px; }

.sidebar .sidebar-nav li a {
  margin: 0 10px; padding: 7px 10px; border-radius: 12px; border-left: 0 !important; gap: 11px;
  font-size: .87rem; font-weight: 700; color: rgba(255, 255, 255, .74); position: relative;
}
.sidebar .sidebar-nav li a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: none; }
.sidebar .sidebar-nav li a.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--ic, #10b981) 26%, transparent), rgba(255, 255, 255, .04));
  color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ic, #10b981) 40%, transparent);
}
.sidebar .sidebar-nav li a.active::before {
  content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ic, #10b981);
}
.ap-nav-ico {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ic, #10b981) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ic, #10b981) 32%, transparent);
  transition: transform .2s ease, background .2s ease;
}
.sidebar .sidebar-nav li a .ap-nav-ico i { width: auto; font-size: .86rem; color: color-mix(in srgb, var(--ic, #10b981) 72%, #fff); }
.sidebar .sidebar-nav li a:hover .ap-nav-ico { transform: scale(1.06); background: color-mix(in srgb, var(--ic, #10b981) 32%, transparent); }
.sidebar .sidebar-nav li a.active .ap-nav-ico { background: var(--ic, #10b981); box-shadow: 0 6px 16px color-mix(in srgb, var(--ic, #10b981) 45%, transparent); }
.sidebar .sidebar-nav li a.active .ap-nav-ico i { color: #fff; }
.sidebar.collapsed .sidebar-nav li a { padding: 7px; margin: 0 9px; justify-content: center; }
.sidebar.collapsed .sidebar-nav li a .ap-nav-ico i { font-size: .95rem; }
.ap-nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff;
  font-size: .66rem; font-weight: 900; display: inline-grid; place-items: center;
}
.sidebar.collapsed .ap-nav-badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; font-size: .58rem; padding: 0 4px; }
.sidebar .sidebar-nav li.ap-hide { display: none; }
.ap-nav-empty { padding: 12px 24px; color: rgba(255, 255, 255, .5); font-size: .8rem; }
.sidebar .user-panel { background: rgba(0, 0, 0, .25); }

/* ------------------------------------------------------------- topbar -- */
.top-navbar { padding: 10px 22px !important; gap: 14px; background: rgba(255, 255, 255, .82) !important; box-shadow: 0 1px 0 var(--ap-line), 0 10px 30px rgba(15, 31, 27, .05) !important; }
.top-navbar .logo-area.ap-pagehead { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; margin-left: 4px; }
.ap-pagehead .ap-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
.ap-pagehead > div { min-width: 0; }
.ap-pagehead small { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-muted); line-height: 1.2; }
.top-navbar .ap-pagehead h4 { margin: 0; font-size: 1.08rem !important; letter-spacing: -.01em !important; text-transform: none !important; color: var(--ap-ink) !important; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-search-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 14px; border-radius: 12px;
  border: 1px solid var(--ap-line); background: #f8faf9; color: var(--ap-muted); font-weight: 700; font-size: .84rem; min-width: 210px; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.ap-search-btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--ap-line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.ap-search-btn kbd { margin-left: auto; background: #fff; color: var(--ap-muted); border: 1px solid var(--ap-line); box-shadow: none; font: 800 .66rem 'Manrope', sans-serif; padding: 2px 6px; border-radius: 6px; }
.top-navbar .tour-trigger { padding: .62rem 1rem; box-shadow: none; }
.top-navbar .notification-nav-link { box-shadow: none; border-color: var(--ap-line); }
.top-navbar .notification-nav-link i { color: #ef4444; }
@media (max-width: 1100px) { .ap-search-btn { min-width: 0; } .ap-search-btn span, .ap-search-btn kbd { display: none; } }
@media (max-width: 640px) {
  .ap-pagehead small { display: none; }
  .ap-pagehead .ap-ico { flex-basis: 34px; width: 34px; height: 34px; }
  .top-navbar .ap-pagehead h4 { font-size: .95rem !important; }
  .top-navbar .tour-trigger span { display: none; }
  .ap-search-btn { width: 42px; padding: 0; justify-content: center; }
}

/* ------------------------------------------------------- shared atoms -- */
.ap-ico {
  --c: var(--accent); width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
  color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--c) 32%, transparent);
}
.ap-ico--lg { width: 46px; height: 46px; border-radius: 14px; font-size: 1.15rem; }

/* ----------------------------------------------------- insights band -- */
.ap-insights {
  max-width: 1280px; margin: 0 auto 22px; padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, .72);
  border: 1px solid var(--ap-line); box-shadow: var(--ap-shadow); backdrop-filter: blur(10px);
  animation: apReveal .45s .25s both;
}
.ap-insights.is-placed { margin-top: 22px; }
@keyframes apReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ap-insights-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ap-insights-head .ap-ico { --c: var(--accent); }
.ap-insights-head small { display: block; color: var(--ap-muted); font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ap-insights-title { margin: 0; font-size: 1.12rem !important; font-weight: 800; color: var(--ap-ink) !important; letter-spacing: -.01em; }
.ap-collapse { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ap-line); background: #fff; color: var(--ap-muted); cursor: pointer; transition: transform .25s; }
.ap-insights.is-collapsed .ap-collapse { transform: rotate(180deg); }
.ap-insights.is-collapsed .ap-insights-body { display: none; }
.ap-insights.is-collapsed .ap-insights-head { margin-bottom: 0; }

.ap-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ap-kpi {
  --c: var(--accent); display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: #fff;
  border: 1px solid var(--ap-line); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.ap-kpi::after { content: ''; position: absolute; inset: auto -30px -40px auto; width: 110px; height: 110px; border-radius: 50%; background: color-mix(in srgb, var(--c) 9%, transparent); }
.ap-kpi:hover { transform: translateY(-2px); box-shadow: var(--ap-shadow); }
.ap-kpi .ap-ico { --c: inherit; background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 62%, #000)); }
.ap-kpi small { display: block; color: var(--ap-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.ap-kpi strong { display: block; font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 1.55rem; line-height: 1.15; color: var(--ap-ink); margin-top: 2px; }
.ap-kpi p { margin: 4px 0 0; font-size: .74rem; color: var(--ap-muted); font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ap-delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-weight: 800; font-size: .7rem; }
.ap-delta--up { background: #dcfce7; color: #15803d; }
.ap-delta--down { background: #fee2e2; color: #b91c1c; }
.ap-delta--flat { background: #f1f5f9; color: #475569; }

.ap-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-flow: dense; gap: 12px; }
.ap-card { --c: var(--accent); background: #fff; border: 1px solid var(--ap-line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.ap-card--wide { grid-column: span 2; }
@media (max-width: 760px) { .ap-card--wide { grid-column: auto; } }
.ap-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ap-card-head .ap-ico { --c: inherit; width: 30px; height: 30px; border-radius: 9px; font-size: .78rem; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); box-shadow: none; }
.ap-card-title { margin: 0; font-size: .9rem !important; font-weight: 800; color: var(--ap-ink) !important; }
.ap-card-head em { margin-left: auto; font-style: normal; font-size: .7rem; color: var(--ap-muted); font-weight: 700; }
.ap-bars { width: 100%; height: 150px; display: block; overflow: visible; }
.ap-bar { transition: opacity .2s; transform-origin: bottom; animation: apGrow .7s cubic-bezier(.2, .8, .2, 1) both; transform-box: fill-box; }
.ap-bars:hover .ap-bar { opacity: .55; }
.ap-bars .ap-bar:hover { opacity: 1; }
@keyframes apGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.ap-axis { font: 700 9px 'Manrope', sans-serif; fill: #94a3b8; }
.ap-donut-wrap { display: flex; align-items: center; gap: 16px; }
.ap-donut { width: 128px; height: 128px; flex: 0 0 128px; }
.ap-donut circle { transition: stroke-width .2s; }
.ap-donut circle:hover { stroke-width: 17; }
.ap-donut-num { font: 800 18px 'Space Grotesk', sans-serif; fill: var(--ap-ink); }
.ap-donut-cap { font: 700 8px 'Manrope', sans-serif; fill: #94a3b8; text-transform: uppercase; letter-spacing: .08em; }
.ap-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; min-width: 0; }
.ap-legend li { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: #334155; }
.ap-legend li i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.ap-legend li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-legend li b { font-family: 'Space Grotesk', sans-serif; color: var(--ap-ink); }
.ap-ring-solo { display: grid; place-items: center; padding: 4px 0; }
.ap-ring { width: 132px; height: 132px; }
.ap-ring .ap-ring-arc { animation: apRing 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes apRing { from { stroke-dasharray: 0 999; } }
.ap-ring-num { font: 800 20px 'Space Grotesk', sans-serif; fill: var(--ap-ink); }
.ap-ring-cap { font: 700 8px 'Manrope', sans-serif; fill: #94a3b8; text-transform: uppercase; letter-spacing: .08em; }
.ap-funnel { display: grid; gap: 9px; }
.ap-funnel-row { display: grid; grid-template-columns: 72px 1fr 44px; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; color: #334155; }
.ap-funnel-row b { text-align: right; font-family: 'Space Grotesk', sans-serif; color: var(--ap-ink); }
.ap-funnel-track, .ap-hbar-track { height: 12px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.ap-funnel-track i, .ap-hbar-track i { display: block; height: 100%; border-radius: inherit; animation: apWidth .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes apWidth { from { width: 0; } }
.ap-hbars { display: grid; gap: 10px; }
.ap-hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; font-weight: 700; color: #334155; margin-bottom: 4px; }
.ap-hbar-top b { font-family: 'Space Grotesk', sans-serif; color: var(--ap-ink); }
.ap-hbar-track { height: 8px; }
.ap-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ap-checks li { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 11px; background: #f8fafc; color: #64748b; font-size: .82rem; font-weight: 700; }
.ap-checks li i { color: #cbd5e1; }
.ap-checks li.ok { background: #ecfdf5; color: #065f46; }
.ap-checks li.ok i { color: #10b981; }
.ap-empty { display: flex; align-items: center; gap: 10px; padding: 18px; min-height: 110px; line-height: 1.45; border-radius: 12px; background: #f8fafc; color: var(--ap-muted); font-size: .82rem; font-weight: 700; }
.ap-empty i { color: var(--accent); }

/* --------------------------------------------- page heroes per workspace -- */
.content-wrapper :is(
  .template-hero, .consult-hero, .dl-hero, .nc-hero, .realm-hero, .territory-hero, .mc-hero, .ah-hero, .pr-hero,
  .ai-hero, .sub-hero, .training-hero, .recommendations-hero, .request-page-header, .member-page-header,
  .testimonial-page-header, .prospects-header, .links-hero, .blogs-hero, .tools-hero, .dept-hero, .bridge-hero,
  .ads-hero, .profile-header, .wa-hero, .page-hero, .hero-panel, .storefront-hero, .notify-hero,
  .page-header, .bridge-header, .recommendations-hero, .container > header:first-child
) {
  background: var(--ap-hero) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent) !important;
  box-shadow: var(--ap-shadow-lg) !important;
  position: relative; isolation: isolate; overflow: hidden;
}
.content-wrapper :is(
  .template-hero, .consult-hero, .dl-hero, .nc-hero, .realm-hero, .territory-hero, .mc-hero, .ah-hero, .pr-hero,
  .ai-hero, .sub-hero, .training-hero, .recommendations-hero, .request-page-header, .member-page-header,
  .testimonial-page-header, .prospects-header, .links-hero, .blogs-hero, .tools-hero, .dept-hero, .bridge-hero,
  .ads-hero, .profile-header, .wa-hero, .page-hero, .hero-panel, .storefront-hero, .notify-hero,
  .page-header, .bridge-header, .recommendations-hero, .container > header:first-child
)::before {
  content: ''; position: absolute; z-index: -1; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  border: 36px solid color-mix(in srgb, var(--accent) 22%, transparent); pointer-events: none;
}

/* Light, centred page headers become full workspace heroes. */
.content-wrapper :is(.page-header, .bridge-header) {
  max-width: 1280px; margin: 0 auto 22px !important; padding: clamp(22px, 3vw, 34px) !important; border-radius: 24px; text-align: left !important; color: #fff;
}
.content-wrapper :is(.page-header, .bridge-header) :is(h1, h2) { color: #fff !important; font-family: 'Manrope', sans-serif !important; font-weight: 800 !important; letter-spacing: -.02em; font-size: clamp(1.5rem, 2.6vw, 2.1rem) !important; margin-bottom: 6px; }
.content-wrapper :is(.page-header, .bridge-header) :is(h1, h2) i { color: color-mix(in srgb, var(--accent) 60%, #fff) !important; }
.content-wrapper :is(.page-header, .bridge-header) :is(p, .text-muted, .page-subtitle) { color: rgba(255, 255, 255, .78) !important; font-weight: 600; }
.content-wrapper :is(.page-header, .bridge-header) form { margin-top: 16px; max-width: 560px; }
.content-wrapper :is(.page-header, .bridge-header) input[type=search] { background: rgba(255, 255, 255, .96) !important; border: 0 !important; border-radius: 14px !important; }

/* --------------------------------------------------- component polish -- */
.content-wrapper .card { border: 1px solid var(--ap-line); border-radius: var(--ap-radius); box-shadow: var(--ap-shadow); }
.content-wrapper .card-header { background: #fff; border-bottom: 1px solid var(--ap-line); font-weight: 800; }
.content-wrapper .btn { border-radius: 12px; font-weight: 800; letter-spacing: .01em; transition: transform .15s, box-shadow .2s, filter .2s; }
.content-wrapper .btn:hover { transform: translateY(-1px); }
.content-wrapper .btn-primary, .content-wrapper .btn-success {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #fff), color-mix(in srgb, var(--accent) 70%, #022)); border-color: transparent;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent);
}
.content-wrapper .btn-primary:hover, .content-wrapper .btn-success:hover { filter: brightness(1.05); }
.content-wrapper .form-control, .content-wrapper .custom-select {
  border-radius: 12px; border: 1px solid #dbe4e0; min-height: 44px; font-weight: 600; color: var(--ap-ink); background-color: #fbfdfc;
  transition: border-color .2s, box-shadow .2s;
}
.content-wrapper .form-control:focus, .content-wrapper .custom-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); background: #fff; }
.content-wrapper .input-group-text { border-radius: 12px 0 0 12px; background: #eef4f1; border-color: #dbe4e0; font-weight: 800; color: var(--ap-muted); }
.content-wrapper label { font-weight: 700; color: #334155; }
.content-wrapper .table { background: #fff; border-radius: 14px; overflow: hidden; }
.content-wrapper .table thead th, .content-wrapper table thead th {
  background: #f6f9f8; color: var(--ap-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--ap-line) !important; border-top: 0 !important;
}
.content-wrapper .table td { vertical-align: middle; border-top-color: #eef2f0; }
.content-wrapper .table-hover tbody tr:hover, .content-wrapper table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, #fff); }
.content-wrapper .badge { border-radius: 999px; padding: .38em .7em; font-weight: 800; letter-spacing: .02em; }
.content-wrapper .badge-success { background: #dcfce7; color: #166534; }
.content-wrapper .badge-warning { background: #fef3c7; color: #92400e; }
.content-wrapper .badge-danger { background: #fee2e2; color: #991b1b; }
.content-wrapper .badge-info { background: #e0f2fe; color: #075985; }
.content-wrapper .badge-secondary, .content-wrapper .badge-light { background: #f1f5f9; color: #475569; }
.content-wrapper .alert { border-radius: 14px; border: 0; font-weight: 600; box-shadow: var(--ap-shadow); }
.content-wrapper .pagination .page-link { border-radius: 10px; margin: 0 3px; border-color: var(--ap-line); color: var(--ap-ink); font-weight: 700; }
.content-wrapper .pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); }
.content-wrapper .nav-tabs, .content-wrapper .nav-pills { gap: 6px; border: 0; }
.content-wrapper .nav-pills .nav-link.active { background: var(--accent); }
.content-wrapper .modal-content { border: 0; border-radius: 20px; box-shadow: var(--ap-shadow-lg); }

/* Unstyled native controls inside workspaces get a consistent baseline. */
.content-wrapper :where(button:not([class]), input[type=submit]:not([class]), input[type=button]:not([class])) {
  border: 0; border-radius: 11px; padding: 9px 16px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #fff), color-mix(in srgb, var(--accent) 70%, #022));
}
.content-wrapper :where(input:not([type]):not([class]), input[type=text]:not([class]), input[type=email]:not([class]), input[type=tel]:not([class]), input[type=url]:not([class]), input[type=number]:not([class]), select:not([class]), textarea:not([class])) {
  border: 1px solid #dbe4e0; border-radius: 11px; padding: 9px 12px; background: #fbfdfc; font-weight: 600; color: var(--ap-ink);
}
.content-wrapper :where(input:not([class]), select:not([class]), textarea:not([class])):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }

/* Downline tree (previously plain boxes). */
.content-wrapper .tree-card ul { list-style: none; padding-left: 28px; margin: 10px 0 0; border-left: 2px dashed color-mix(in srgb, var(--accent) 35%, #e2e8f0); }
.content-wrapper .tree-card li { position: relative; margin: 8px 0; }
.content-wrapper .tree-card li::before { content: ''; position: absolute; left: -28px; top: 22px; width: 24px; border-top: 2px dashed color-mix(in srgb, var(--accent) 35%, #e2e8f0); }
.content-wrapper .tree-card span { display: inline-flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--ap-line); box-shadow: var(--ap-shadow); }
.content-wrapper .tree-card > div > span { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); color: #fff; border: 0; }
.content-wrapper .tree-card > div > span small { color: rgba(255, 255, 255, .8); }

/* ---------------------------------------------------- command palette -- */
.ap-palette { position: fixed; inset: 0; z-index: 3000; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(2, 26, 21, .45); backdrop-filter: blur(6px); }
.ap-palette.is-open { display: flex; animation: apFade .15s ease; }
@keyframes apFade { from { opacity: 0; } }
.ap-palette-box { width: min(620px, 100%); background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(2, 26, 21, .35); overflow: hidden; }
.ap-palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--ap-line); }
.ap-palette-input i { color: var(--ap-muted); }
.ap-palette-input input { flex: 1; border: 0; outline: none; font-size: 1.02rem; font-weight: 700; color: var(--ap-ink); background: transparent; }
.ap-palette-input kbd { background: #f1f5f9; color: var(--ap-muted); box-shadow: none; font: 800 .66rem 'Manrope', sans-serif; }
.ap-palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.ap-palette-list .ap-pl-group { padding: 10px 12px 4px; font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; }
.ap-palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ap-ink); text-decoration: none; }
.ap-palette-list a .ap-ico { width: 34px; height: 34px; border-radius: 10px; font-size: .85rem; }
.ap-palette-list a strong { display: block; font-size: .9rem; }
.ap-palette-list a small { display: block; color: var(--ap-muted); font-size: .76rem; font-weight: 600; }
.ap-palette-list a i.fa-arrow-right { margin-left: auto; color: #cbd5e1; opacity: 0; }
.ap-palette-list a.is-active, .ap-palette-list a:hover { background: #f1f7f5; text-decoration: none; }
.ap-palette-list a.is-active i.fa-arrow-right { opacity: 1; }
.ap-palette-empty { padding: 26px; text-align: center; color: var(--ap-muted); font-weight: 700; }

/* Floating PWA buttons stay compact so they don't cover content. */
@media (min-width: 769px) {
  .content-wrapper { padding-bottom: 90px; }
}

/* Bar chart axis + footer (kept outside the stretched SVG). */
.ap-bars { height: 132px; }
.ap-axis-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: .68rem; font-weight: 700; color: #94a3b8; }
.ap-bars-foot { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--ap-line); font-size: .74rem; color: var(--ap-muted); font-weight: 700; }
.ap-bars-foot b { color: var(--ap-ink); font-family: 'Space Grotesk', sans-serif; }
.ap-target { display: inline-flex; align-items: center; gap: 6px; }
.ap-target i { width: 16px; border-top: 2px dashed #f59e0b; }

/* Shell hardening: page stylesheets must not reshape the sidebar user panel. */
.sidebar .user-panel .user-info { display: block !important; margin: 0 !important; align-items: initial; min-width: 0; }
.sidebar .user-panel .user-info .name { display: block; color: #fff; }
.sidebar .user-panel .user-info .status { display: flex; align-items: center; gap: 6px; }
.sidebar .user-panel .user-info .status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.sidebar.collapsed .user-panel .user-info { display: none !important; }

/* Page-level fixed dialogs must sit above the shell sidebar and top bar. */
.content-wrapper :is([class$="-modal"], [class*="-modal "], [class$="-overlay"], [class*="-overlay "]):not(.modal) { z-index: 2000 !important; }

/* Outline buttons sitting on dark workspace heroes stay legible. */
.content-wrapper :is(.training-hero, .template-hero, .realm-hero, .territory-hero, .dl-hero, .nc-hero, .sub-hero, .ai-hero, .dept-hero, .consult-hero, .page-header, .bridge-header, .recommendations-hero, .container > header:first-child)
  :is(.btn-outline-primary, .btn-outline-success, .btn-outline-secondary, .btn-outline-info, .btn-outline-dark, .btn-outline-danger):not(.active):not(:hover) {
  color: #fff !important; background: rgba(255, 255, 255, .08) !important; border-color: rgba(255, 255, 255, .28) !important;
}
.content-wrapper :is(.training-hero, .template-hero, .realm-hero, .territory-hero, .dl-hero, .sub-hero, .ai-hero, .dept-hero, .page-header, .bridge-header, .container > header:first-child)
  :is(.btn-outline-primary, .btn-outline-success, .btn-outline-secondary, .btn-outline-info, .btn-outline-dark, .btn-outline-danger):not(.active):hover {
  color: var(--ap-ink) !important; background: #fff !important; border-color: #fff !important;
}
.ap-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Run Ads header: give the compact banner real hero spacing. */
.content-wrapper .request-page-header { max-width: 1280px; margin: 0 auto 22px !important; padding: clamp(22px, 3vw, 34px) !important; border-radius: 24px !important; text-align: left !important; }
.content-wrapper .request-page-header :is(p, small, .subtitle, span) { color: rgba(255, 255, 255, .82) !important; }
.content-wrapper .request-page-header :is(h1, h2) { font-size: clamp(1.5rem, 2.6vw, 2.1rem) !important; margin-bottom: 6px !important; }
.content-wrapper .request-page-header > * { text-align: left !important; margin-left: 0 !important; }

/* Compact phone top bar and insight band. */
@media (max-width: 480px) {
  .top-navbar .tour-trigger { display: none !important; }
  .ap-pagehead .ap-ico { display: none; }
  .top-navbar .ap-pagehead h4 { font-size: 1rem !important; }
  .ap-insights { padding: 12px; border-radius: 18px; }
  .ap-insights-head .ap-ico--lg { width: 38px; height: 38px; font-size: .95rem; }
  .ap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ap-kpi { padding: 11px; gap: 9px; flex-direction: column; }
  .ap-kpi .ap-ico { width: 32px; height: 32px; border-radius: 10px; font-size: .8rem; }
  .ap-kpi strong { font-size: 1.3rem; }
  .ap-card-head em { display: none; }
  .ap-donut-wrap { flex-direction: column; align-items: stretch; }
  .ap-donut { margin: 0 auto; }
}

/* ===================================================================
   Design layer v2 (2026-11-19)
   Sections load closed like chapters: title, description, an icon
   preview and a count invite the first tap. Additive only; without
   JavaScript every section stays open, exactly as before.
   =================================================================== */

/* ---- insights band: whole header is the control ------------------ */
.ap-insights-head { cursor: pointer; border-radius: 16px; transition: background-color .2s; margin: -6px -6px 14px; padding: 6px; }
.ap-insights-head:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ap-insights.is-collapsed .ap-insights-head { margin-bottom: -6px; }
.ap-insights-head > div { min-width: 0; flex: 1 1 auto; }
.ap-collapse:focus-visible, .ap-fold-btn:focus-visible, .ap-fold-all:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.ap-insights-summary { display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-insights.is-collapsed .ap-insights-summary { display: flex; }
.ap-sum-chip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--accent)) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 22%, transparent);
  font-size: .74rem; color: var(--ap-muted); white-space: nowrap; max-width: 100%;
}
.ap-sum-chip b { color: var(--ap-ink); font-weight: 800; font-size: .82rem; }

/* ---- page bar: "This page · N sections  [Open all]" --------------- */
.ap-fold-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 12px; grid-column: 1 / -1; }
.ap-fold-bar span { font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-muted); }
.ap-fold-all {
  border: 1px solid var(--ap-line); background: #fff; color: var(--ap-ink); border-radius: 999px; padding: 7px 14px;
  font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; min-height: 38px;
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .35);
}
.ap-fold-all i { transition: transform .25s; }
.ap-fold-all[aria-expanded="true"] i { transform: rotate(180deg); }

/* ---- a foldable section ------------------------------------------- */
.ap-fold { position: relative !important; }
.ap-fold > .ap-fold-lead { cursor: pointer; text-align: left !important; }
.ap-fold .ap-fold-title { padding-right: 150px; }
.ap-fold .ap-fold-lead p, .ap-fold .ap-fold-lead > div { text-align: left !important; }
.ap-fold-meta {
  position: absolute; top: 14px; right: 14px; z-index: 2; display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.ap-fold-peek { display: flex; transition: gap .25s; }
.ap-peek-ico {
  width: 26px !important; height: 26px !important; min-width: 0 !important; border-radius: 9px !important; display: grid !important; place-items: center;
  font-size: .72rem !important; margin: 0 0 0 -7px !important; padding: 0 !important; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .14);
  background: #eef6f2; color: var(--accent); transition: margin .25s, transform .25s; position: static !important;
}
.ap-peek-ico:first-child { margin-left: 0 !important; }
.ap-peek-ico i, .ap-peek-ico svg { font-size: .72rem !important; width: auto; height: 1em; margin: 0 !important; }
.ap-fold:hover .ap-peek-ico { margin-left: -2px !important; }
.ap-fold:hover .ap-peek-ico:first-child { margin-left: 0 !important; }
.ap-fold-count {
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--ap-ink, #0f172a); color: #fff; font-size: .74rem; font-weight: 800;
}
.ap-fold-btn {
  width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--ap-line); background: #fff; color: var(--ap-muted);
  display: grid; place-items: center; cursor: pointer; transition: background-color .2s, border-color .2s;
}
.ap-fold-btn i { transition: transform .25s; }
.ap-fold.is-folded .ap-fold-btn i { transform: rotate(180deg); }
.ap-fold:hover .ap-fold-btn { background: color-mix(in srgb, var(--accent) 9%, #fff); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.ap-fold:not(.is-folded) .ap-fold-peek { display: none; }

/* closed: only the lead and the controls remain */
.ap-fold.is-folded > :not(.ap-fold-lead):not(.ap-fold-meta) { display: none !important; }
.ap-fold.is-folded { min-height: 64px; padding-bottom: 14px !important; }
.ap-fold.is-folded > .ap-fold-lead { margin-bottom: 0 !important; border-bottom: 0 !important; padding-bottom: 0 !important; }
.ap-fold.is-folded > .ap-fold-lead:last-of-type, .ap-fold.is-folded > .ap-fold-lead p:last-child { margin-bottom: 0 !important; }

/* open: content unfolds */
.ap-fold:not(.is-folded) > :not(.ap-fold-lead):not(.ap-fold-meta) { animation: apUnfold .32s ease both; }
@keyframes apUnfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* sections whose heading sits in a header row (dashboard groups, panels) */
.ap-fold > header.ap-fold-lead, .ap-fold > .panel-title.ap-fold-lead, .ap-fold > .daily-guidance-heading.ap-fold-lead { padding-right: 150px; }
.ap-fold > header.ap-fold-lead .ap-fold-title, .ap-fold > .panel-title.ap-fold-lead .ap-fold-title, .ap-fold > .daily-guidance-heading.ap-fold-lead .ap-fold-title { padding-right: 0; }
.ap-fold > header.ap-fold-lead, .ap-fold > .daily-guidance-heading.ap-fold-lead { display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: flex-start !important; gap: 3px; }
.ap-fold > header.ap-fold-lead > *, .ap-fold > .daily-guidance-heading.ap-fold-lead > * { max-width: 100%; margin-left: 0 !important; }

@media (max-width: 575px) {
  .ap-fold .ap-fold-title { padding-right: 84px; }
  .ap-fold > header.ap-fold-lead, .ap-fold > .panel-title.ap-fold-lead, .ap-fold > .daily-guidance-heading.ap-fold-lead { padding-right: 84px; }
  .ap-fold-meta { top: 12px; right: 12px; gap: 6px; }
  .ap-fold-peek { display: none; }
  .ap-fold.is-folded .ap-fold-lead p { font-size: .82rem; }
}

/* ---- testimonials: list page hero and detail page ----------------- */
body[data-ap-page="testimonial"] .content-wrapper .container {
  width: auto !important; max-width: min(100%, 900px) !important; box-sizing: border-box;
}
body[data-ap-page="testimonial"] .content-wrapper .container > header {
  padding: 16px 18px !important; border-radius: 18px; gap: 10px; overflow: hidden;
}
body[data-ap-page="testimonial"] .content-wrapper .container > header h1 { color: #fff !important; margin: 0; }
body[data-ap-page="testimonial"] .content-wrapper .container > header .back-btn {
  color: #fff !important; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 8px 14px; min-height: 40px;
}
@media (max-width: 575px) {
  body[data-ap-page="testimonial"] .content-wrapper .container > header h1 { font-size: 1.6rem !important; text-align: left; width: 100%; }
  body[data-ap-page="testimonial"] header nav.testimonial-nav { display: flex; gap: 6px; width: 100%; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
  body[data-ap-page="testimonial"] header nav.testimonial-nav a {
    flex: 1 1 0; text-align: center; padding: 10px 8px !important; margin: 0 !important; border-radius: 999px !important;
    font-size: .88rem !important; min-height: 42px; display: grid; place-items: center; box-shadow: none !important;
  }
  body[data-ap-page="testimonial"] .search-form { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 6px; width: 100%; }
  body[data-ap-page="testimonial"] .search-form input { flex: 1 1 auto; width: auto !important; min-width: 0; height: 46px; margin: 0 !important; }
  body[data-ap-page="testimonial"] .search-form button { flex: 0 0 auto; width: auto !important; height: 46px; padding: 0 16px !important; margin: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-fold-btn, .ap-fold-btn i, .ap-fold-all i, .ap-insights-head, .ap-peek-ico, .ap-fold-peek { transition: none; }
  .ap-fold:not(.is-folded) > :not(.ap-fold-lead):not(.ap-fold-meta) { animation: none; }
}

/* territories carry their own icon in the top-right corner: controls sit bottom-right */
article.territory.ap-fold > .ap-fold-meta { top: auto; bottom: 14px; }
article.territory.ap-fold .ap-fold-title { padding-right: 0; }
article.territory.ap-fold.is-folded > .ap-fold-lead:last-of-type { padding-right: 60px; }
