/* ============================================================================
   TrustElevate — Business Portal (client-facing area)
   portal.css · light / airy shell built on the TrustElevate tokens.
   Pairs with colors_and_type.css + ds-components.css.
   Prefix: .cp-  (client portal)
   ============================================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--te-font-sans);
  color: var(--te-text);
  background: var(--cp-bg, #eef2f7);
  -webkit-font-smoothing: antialiased;
}
#root { height: 100%; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--te-ring); border-radius: 6px; }

/* accent is set by tweaks / tenant; defaults to teal */
:root {
  --cp-accent: var(--te-teal);
  --cp-accent-dark: var(--te-teal-dark);
  --cp-accent-soft: var(--te-teal-soft);
  --cp-bg: #eef2f7;
}

/* ============================================================ SHELL */
.cp-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas: "brand top" "side main";
  height: 100vh;
  min-height: 100vh;
}
.cp-brandcell {
  grid-area: brand;
  display: flex; align-items: center; gap: 11px;
  padding: 0 20px;
  background: var(--te-navy);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.cp-brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(150deg, var(--te-teal), var(--te-accent-sky)); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); flex: none; }
.cp-brand-mark svg { color: #fff; width: 19px; height: 19px; }
.cp-brand-word { color: #fff; font-weight: 700; font-size: 1.04rem; letter-spacing: -.01em; line-height: 1; }
.cp-brand-word b { color: var(--te-accent-sky); font-weight: 700; }
.cp-brand-word small { display: block; font-family: var(--te-font-dense); font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--te-side-muted); margin-top: 3px; }

/* ---- top bar ---- */
.cp-top {
  grid-area: top;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--te-border-alt);
}
.cp-top__crumb { font-family: var(--te-font-dense); font-size: .82rem; color: var(--te-text-muted); display: flex; align-items: center; gap: 7px; }
.cp-top__crumb b { color: var(--te-text); font-weight: 600; }
.cp-top__crumb svg { width: 14px; height: 14px; color: var(--te-border); }
.cp-top__spacer { flex: 1; }
.cp-top__help { display: inline-flex; align-items: center; gap: 7px; font-family: var(--te-font-dense); font-size: .83rem; font-weight: 500; color: var(--te-text-muted); text-decoration: none; padding: 7px 11px; border-radius: var(--te-radius-md); }
.cp-top__help:hover { background: var(--te-surface); color: var(--te-text); }
.cp-top__help svg { width: 15px; height: 15px; }
.cp-iconbtn { position: relative; width: 38px; height: 38px; border-radius: var(--te-radius-md); border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--te-text-muted); cursor: pointer; }
.cp-iconbtn:hover { background: var(--te-surface); color: var(--te-text); }
.cp-iconbtn svg { width: 18px; height: 18px; }
.cp-iconbtn .cp-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--te-gold); box-shadow: 0 0 0 2px #fff; }

/* account chip */
.cp-acct { display: flex; align-items: center; gap: 10px; padding: 5px 7px 5px 5px; border-radius: var(--te-radius-pill); border: 1px solid var(--te-border-alt); background: #fff; cursor: pointer; }
.cp-acct:hover { border-color: var(--te-text-muted); }
.cp-acct__av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; font-family: var(--te-font-dense); flex: none; }
.cp-acct__meta { line-height: 1.15; text-align: left; }
.cp-acct__meta .n { display: block; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.cp-acct__meta .r { display: block; font-size: .68rem; color: var(--te-text-muted); font-family: var(--te-font-dense); white-space: nowrap; }
.cp-acct svg { width: 15px; height: 15px; color: var(--te-text-muted); }

/* ---- sidebar ---- */
.cp-side {
  grid-area: side;
  background: #fff;
  border-right: 1px solid var(--te-border-alt);
  display: flex; flex-direction: column;
  padding: 16px 14px;
  overflow-y: auto;
}
.cp-tenant {
  display: flex; align-items: center; gap: 11px;
  padding: 12px; border-radius: var(--te-radius-lg);
  background: var(--te-surface); border: 1px solid var(--te-border-alt);
  margin-bottom: 16px;
}
.cp-tenant__logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1rem; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.cp-tenant__meta { min-width: 0; }
.cp-tenant__name { font-weight: 700; font-size: .92rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-tenant__id { font-family: var(--te-font-mono); font-size: .68rem; color: var(--te-text-muted); }

.cp-nav { display: flex; flex-direction: column; gap: 2px; }
.cp-nav__label { font-family: var(--te-font-dense); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--te-text-muted-alt); padding: 14px 12px 6px; }
.cp-navitem {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--te-radius-md);
  border: none; background: transparent; cursor: pointer;
  font-family: var(--te-font-sans); font-size: .9rem; font-weight: 500; color: var(--te-text); text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.cp-navitem:hover { background: var(--te-surface); }
.cp-navitem svg { width: 19px; height: 19px; color: var(--te-text-muted); flex: none; }
.cp-navitem.active { background: var(--cp-accent-soft); color: var(--cp-accent-dark); font-weight: 600; }
.cp-navitem.active svg { color: var(--cp-accent-dark); }
.cp-navitem__tail { margin-left: auto; }
.cp-navitem__count { font-family: var(--te-font-dense); font-size: .68rem; font-weight: 700; color: #fff; background: var(--te-gold); border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }
/* tiny progress ring for onboarding nav */
.cp-ring { --p: 0; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--cp-accent) calc(var(--p) * 1%), var(--te-border-alt) 0);
  display: grid; place-items: center; }
.cp-ring::after { content: ""; width: 15px; height: 15px; border-radius: 50%; background: #fff; }
.cp-navitem.active .cp-ring::after { background: var(--cp-accent-soft); }

.cp-side__foot { margin-top: auto; padding-top: 16px; }
.cp-side__card { border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-lg); padding: 13px 14px; background: var(--te-surface); }
.cp-side__card .t { font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.cp-side__card .t svg { width: 15px; height: 15px; color: var(--cp-accent-dark); }
.cp-side__card .d { font-size: .76rem; color: var(--te-text-muted); line-height: 1.45; margin: 6px 0 10px; }

/* ---- main ---- */
.cp-main { grid-area: main; overflow-y: auto; background: var(--cp-bg); }
.cp-main__inner { max-width: 1080px; margin: 0 auto; padding: 30px 32px 80px; }

/* ============================================================ PAGE HEADER */
.cp-head { margin-bottom: 24px; }
.cp-head__eyebrow { font-family: var(--te-font-dense); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--cp-accent-dark); }
.cp-head__row { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.cp-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.cp-head__sub { color: var(--te-text-muted); font-size: .95rem; line-height: 1.5; margin-top: 7px; max-width: 640px; }
.cp-head__actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* generic section + card */
.cp-card { background: #fff; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-lg); box-shadow: var(--te-shadow-sm); }
.cp-card__pad { padding: 20px 22px; }
.cp-sec-title { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.cp-sec-sub { font-size: .88rem; color: var(--te-text-muted); margin: 0; }

/* ============================================================ SIGN-IN */
.cp-auth {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 50% -10%, #18386a 0%, rgba(19,45,82,0) 60%),
    radial-gradient(680px 360px at 88% 6%, rgba(13,148,136,.22) 0%, rgba(13,148,136,0) 60%),
    radial-gradient(560px 400px at 6% 98%, rgba(56,189,248,.13) 0%, rgba(56,189,248,0) 60%),
    var(--te-navy);
}
.cp-auth::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(1000px 700px at 50% 30%, #000 0%, transparent 75%); }
.cp-auth__card { position: relative; z-index: 2; width: 100%; max-width: 452px; background: #fff; border-radius: var(--te-radius-lg); box-shadow: var(--te-shadow-pop); padding: 36px 38px 30px; overflow: hidden; }
.cp-auth__card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--te-teal), var(--te-accent-sky)); }
.cp-auth__brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 22px; }
.cp-auth__brand .cp-brand-mark { width: 38px; height: 38px; }
.cp-auth__brand .w { font-weight: 700; font-size: 1.2rem; color: var(--te-navy); letter-spacing: -.01em; }
.cp-auth__brand .w b { color: var(--te-teal-dark); }
.cp-auth__eyebrow { text-align: center; font-family: var(--te-font-dense); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--te-teal-dark); }
.cp-auth__title { text-align: center; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: 7px 0 0; }
.cp-auth__sub { text-align: center; color: var(--te-text-muted); font-size: .92rem; line-height: 1.55; margin: 9px 0 0; }
.cp-auth__invite { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-md); background: var(--te-surface); margin: 22px 0 6px; }
.cp-auth__invite .lg { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.cp-auth__invite .m { min-width: 0; text-align: left; }
.cp-auth__invite .m .n { font-weight: 600; font-size: .9rem; }
.cp-auth__invite .m .e { font-family: var(--te-font-dense); font-size: .8rem; color: var(--te-text-muted); }
.cp-auth__note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-family: var(--te-font-dense); font-size: .78rem; color: var(--te-text-muted-alt); }
.cp-auth__note svg { width: 15px; height: 15px; color: var(--te-teal-dark); }
.cp-auth__foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.cp-auth__foot a, .cp-auth__foot span.s { color: rgba(226,232,240,.7); text-decoration: none; font-size: .8rem; font-family: var(--te-font-dense); display: inline-flex; align-items: center; gap: 6px; }
.cp-auth__foot a:hover { color: #fff; }
.cp-auth__foot .pdot { width: 3px; height: 3px; border-radius: 50%; background: rgba(226,232,240,.3); }
.cp-sd { width: 7px; height: 7px; border-radius: 50%; background: var(--te-success); box-shadow: 0 0 0 3px rgba(24,173,0,.2); }

/* ============================================================ ONBOARDING — hero */
.cp-ob-hero { background: #fff; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-lg); box-shadow: var(--te-shadow-sm); padding: 22px 24px; margin-bottom: 22px; }
.cp-ob-hero__top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cp-ob-hero__pct { display: flex; align-items: baseline; gap: 2px; }
.cp-ob-hero__pct b { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-family: var(--te-font-dense); font-variant-numeric: tabular-nums; }
.cp-ob-hero__pct small { font-size: 1.1rem; font-weight: 700; color: var(--te-text-muted); }
.cp-ob-hero__lead { flex: 1; min-width: 200px; }
.cp-ob-hero__lead .l1 { font-size: .82rem; color: var(--te-text-muted); font-family: var(--te-font-dense); }
.cp-ob-hero__lead .l2 { font-size: 1.05rem; font-weight: 600; margin-top: 2px; }
.cp-ob-hero__lead .l2 b { color: var(--cp-accent-dark); }
.cp-meter { height: 9px; border-radius: 999px; background: var(--te-border-alt); overflow: hidden; margin-top: 16px; }
.cp-meter__fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cp-accent), var(--cp-accent-dark)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.cp-meter__fill.blocked { background: linear-gradient(90deg, var(--te-gold), #c98f29); }
.cp-ob-hero__stats { display: flex; gap: 26px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--te-border-alt); flex-wrap: wrap; }
.cp-ob-stat .v { font-size: 1.1rem; font-weight: 700; font-family: var(--te-font-dense); font-variant-numeric: tabular-nums; }
.cp-ob-stat .v.warn { color: #b25a13; }
.cp-ob-stat .l { font-size: .74rem; color: var(--te-text-muted); font-family: var(--te-font-dense); }

/* ---- onboarding layout: stepper + panel ---- */
.cp-ob-layout { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; }
@media (max-width: 920px) { .cp-ob-layout { grid-template-columns: 1fr; } }

.cp-stepper { background: #fff; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-lg); box-shadow: var(--te-shadow-sm); padding: 8px; position: sticky; top: 16px; }
.cp-step { display: flex; gap: 13px; padding: 11px 12px; border-radius: var(--te-radius-md); border: none; background: transparent; width: 100%; text-align: left; cursor: pointer; position: relative; }
.cp-step:hover { background: var(--te-surface); }
.cp-step.sel { background: var(--cp-accent-soft); }
.cp-step__rail { position: relative; display: flex; flex-direction: column; align-items: center; flex: none; }
.cp-step__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--te-font-dense); font-weight: 700; font-size: .8rem; flex: none; border: 2px solid var(--te-border); background: #fff; color: var(--te-text-muted); transition: all .15s; z-index: 1; }
.cp-step__dot svg { width: 15px; height: 15px; }
.cp-step:not(:last-child) .cp-step__rail::after { content: ""; position: absolute; top: 28px; bottom: -11px; width: 2px; background: var(--te-border-alt); }
.cp-step.is-done .cp-step__dot { background: var(--cp-accent); border-color: var(--cp-accent); color: #fff; }
.cp-step.is-done .cp-step__rail::after { background: var(--cp-accent); }
.cp-step.is-current .cp-step__dot { border-color: var(--cp-accent); color: var(--cp-accent-dark); box-shadow: 0 0 0 4px var(--cp-accent-soft); }
.cp-step.is-blocked .cp-step__dot { border-color: var(--te-gold); background: var(--te-gold-soft); color: #9a6c10; }
.cp-step__body { min-width: 0; padding-top: 2px; display: flex; flex-direction: column; gap: 1px; }
.cp-step__k { font-family: var(--te-font-dense); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--te-text-muted-alt); }
.cp-step__title { font-size: .9rem; font-weight: 600; letter-spacing: -.01em; }
.cp-step.sel .cp-step__title { color: var(--cp-accent-dark); }
.cp-step__meta { font-size: .74rem; color: var(--te-text-muted); font-family: var(--te-font-dense); margin-top: 1px; }
.cp-step__meta.blk { color: #9a6c10; font-weight: 600; }

/* ---- stage panel ---- */
.cp-stage { background: #fff; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-lg); box-shadow: var(--te-shadow-sm); overflow: hidden; }
.cp-stage__head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--te-border-alt); }
.cp-stage__badge { width: 38px; height: 38px; border-radius: 10px; background: var(--cp-accent-soft); color: var(--cp-accent-dark); display: grid; place-items: center; font-family: var(--te-font-dense); font-weight: 800; font-size: 1rem; flex: none; }
.cp-stage__title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.cp-stage__blurb { font-size: .88rem; color: var(--te-text-muted); line-height: 1.5; margin-top: 3px; }
.cp-stage__body { padding: 8px 22px 22px; }

/* blocker callout */
.cp-callout { display: flex; gap: 13px; padding: 16px; margin: 16px 0 6px; border-radius: var(--te-radius-md); background: var(--te-gold-soft); border: 1px solid #f0d9a8; }
.cp-callout__ic { width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--te-gold); display: grid; place-items: center; flex: none; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cp-callout__ic svg { width: 19px; height: 19px; }
.cp-callout__hd { font-weight: 700; font-size: .92rem; color: #8a5e0c; display: flex; align-items: center; gap: 9px; }
.cp-callout__who { font-family: var(--te-font-dense); font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.cp-callout__who.you { background: var(--te-gold); color: #3a2a07; }
.cp-callout__who.te { background: var(--te-navy); color: #fff; }
.cp-callout__reason { font-size: .86rem; color: #7a560e; line-height: 1.5; margin: 7px 0 0; }
.cp-callout__needs { font-size: .86rem; color: #6b4a0c; line-height: 1.5; margin-top: 8px; }
.cp-callout__needs b { color: #4d350a; }

/* self-serve origin adder */
.cp-origins { margin-top: 12px; }
.cp-origin-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-md); font-family: var(--te-font-mono); font-size: .8rem; }
.cp-origin-row + .cp-origin-row { margin-top: 7px; }
.cp-origin-row svg { width: 15px; height: 15px; color: var(--te-success); flex: none; }
.cp-origin-row .rm { margin-left: auto; border: none; background: transparent; color: var(--te-text-muted-alt); cursor: pointer; padding: 3px; border-radius: 5px; }
.cp-origin-row .rm:hover { color: var(--te-danger); background: var(--te-danger-soft); }
.cp-origin-add { display: flex; gap: 9px; margin-top: 10px; }

/* tasks */
.cp-tasks { display: flex; flex-direction: column; }
.cp-task { display: flex; gap: 13px; padding: 16px 2px; border-bottom: 1px solid var(--te-border-alt); }
.cp-task:last-child { border-bottom: none; }
.cp-task__check { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px solid var(--te-border); background: #fff; cursor: default; padding: 0; transition: all .15s; }
.cp-task__check .ring { width: 100%; height: 100%; border-radius: 50%; }
.cp-task__check svg { width: 15px; height: 15px; }
.cp-task.is-done .cp-task__check { background: var(--cp-accent); border-color: var(--cp-accent); color: #fff; }
.cp-task.is-blocked .cp-task__check { background: var(--te-gold-soft); border-color: var(--te-gold); color: #9a6c10; }
.cp-task__check.can { cursor: pointer; border-color: var(--cp-accent); }
.cp-task__check.can:hover { background: var(--cp-accent-soft); }
.cp-task.is-done .cp-task__title { color: var(--te-text-muted); }
.cp-task__body { flex: 1; min-width: 0; }
.cp-task__top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cp-task__title { font-weight: 600; font-size: .94rem; }
.cp-task__crit { font-size: .84rem; color: var(--te-text-muted); line-height: 1.5; margin-top: 3px; }
.cp-task__foot { display: flex; align-items: center; gap: 14px; margin-top: 9px; flex-wrap: wrap; }
.cp-how { display: inline-flex; align-items: center; gap: 6px; font-family: var(--te-font-dense); font-size: .8rem; font-weight: 600; color: var(--cp-accent-dark); text-decoration: none; }
.cp-how:hover { text-decoration: underline; }
.cp-how svg { width: 14px; height: 14px; }
.cp-task__wait { font-family: var(--te-font-dense); font-size: .78rem; color: var(--te-text-muted-alt); display: inline-flex; align-items: center; gap: 6px; }
.cp-task__wait svg { width: 13px; height: 13px; }

/* owner / tag pills */
.cp-owner { font-family: var(--te-font-dense); font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cp-owner.you { background: var(--cp-accent-soft); color: var(--cp-accent-dark); }
.cp-owner.te { background: #e8edf5; color: var(--te-navy); }
.cp-owner.both { background: var(--te-purple-soft); color: #7d20b8; }
.cp-tag { font-family: var(--te-font-dense); font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cp-tag.auto { background: var(--te-info-soft); color: #0a6c93; }
.cp-tag.blk { background: var(--te-gold-soft); color: #9a6c10; }
.cp-tag svg { width: 11px; height: 11px; }

/* integration pattern grid */
.cp-patterns { margin-top: 18px; }
.cp-patterns__hd { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--te-text-muted); font-family: var(--te-font-dense); margin-bottom: 11px; }
.cp-pat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .cp-pat-grid { grid-template-columns: 1fr; } }
.cp-pat { display: flex; gap: 11px; align-items: flex-start; text-align: left; padding: 13px; border-radius: var(--te-radius-md); border: 1.5px solid var(--te-border-alt); background: #fff; cursor: pointer; transition: all .14s; }
.cp-pat:hover { border-color: var(--cp-accent); }
.cp-pat.on { border-color: var(--cp-accent); background: var(--cp-accent-soft); }
.cp-pat__check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--te-border); display: grid; place-items: center; flex: none; margin-top: 1px; background: #fff; }
.cp-pat__check svg { width: 13px; height: 13px; color: #fff; }
.cp-pat.on .cp-pat__check { background: var(--cp-accent); border-color: var(--cp-accent); }
.cp-pat__label { font-weight: 600; font-size: .9rem; }
.cp-pat__desc { font-size: .8rem; color: var(--te-text-muted); line-height: 1.45; margin-top: 2px; }

/* secret display-once box */
.cp-secret { margin-top: 14px; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-md); overflow: hidden; }
.cp-secret__bar { display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: var(--te-navy); color: #fff; }
.cp-secret__bar svg { width: 15px; height: 15px; color: var(--te-accent-sky); }
.cp-secret__bar .t { font-family: var(--te-font-dense); font-size: .8rem; font-weight: 600; }
.cp-secret__val { display: flex; align-items: center; gap: 11px; padding: 14px; font-family: var(--te-font-mono); font-size: .84rem; word-break: break-all; background: #0e2748; color: #cfe6ff; }
.cp-secret__val .key { flex: 1; }
.cp-secret__warn { font-family: var(--te-font-dense); font-size: .78rem; color: #9a6c10; background: var(--te-gold-soft); padding: 9px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #f0d9a8; }
.cp-secret__warn svg { width: 14px; height: 14px; color: var(--te-gold); flex: none; }

/* notes + audit */
.cp-aux { margin-top: 18px; display: grid; gap: 18px; }
.cp-aux__title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--te-text-muted); font-family: var(--te-font-dense); padding: 16px 22px 0; }
.cp-audit-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 22px; }
.cp-audit-row:last-child { padding-bottom: 18px; }
.cp-ar-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.cp-ar-ic svg { width: 15px; height: 15px; }
.cp-ar-body { flex: 1; min-width: 0; }
.cp-ar-text { font-size: .86rem; line-height: 1.4; }
.cp-ar-text b { font-weight: 600; }
.cp-ar-time { font-family: var(--te-font-dense); font-size: .76rem; color: var(--te-text-muted-alt); white-space: nowrap; }

/* completed banner */
.cp-done-banner { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--te-radius-lg); background: linear-gradient(120deg, var(--te-navy), #14365f); color: #fff; margin-bottom: 22px; }
.cp-done-banner__ic { width: 48px; height: 48px; border-radius: 13px; background: rgba(13,148,136,.25); color: var(--te-accent-sky); display: grid; place-items: center; flex: none; }
.cp-done-banner__ic svg { width: 26px; height: 26px; }
.cp-done-banner h3 { margin: 0; font-size: 1.15rem; }
.cp-done-banner p { margin: 4px 0 0; font-size: .9rem; color: rgba(255,255,255,.8); line-height: 1.45; }

/* ============================================================ HOME dashboard */
.cp-welcome { display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: var(--te-radius-lg); background: linear-gradient(120deg, var(--te-navy), #143461); color: #fff; margin-bottom: 22px; position: relative; overflow: hidden; }
.cp-welcome::after { content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(56,189,248,.22), transparent 70%); }
.cp-welcome__lg { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.5rem; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.cp-welcome h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.cp-welcome p { margin: 5px 0 0; color: rgba(255,255,255,.82); font-size: .92rem; line-height: 1.5; max-width: 540px; }
.cp-welcome__cta { margin-left: auto; position: relative; z-index: 1; }

.cp-grid { display: grid; gap: 18px; }
.cp-grid--2 { grid-template-columns: 1fr 1fr; }
.cp-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cp-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .cp-grid--3, .cp-grid--4 { grid-template-columns: 1fr 1fr; } .cp-grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cp-grid--3, .cp-grid--4 { grid-template-columns: 1fr; } }

.cp-stat { background: #fff; border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-lg); box-shadow: var(--te-shadow-sm); padding: 18px 20px; }
.cp-stat__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 13px; }
.cp-stat__ic svg { width: 19px; height: 19px; }
.cp-stat__v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-family: var(--te-font-dense); font-variant-numeric: tabular-nums; line-height: 1; }
.cp-stat__l { font-size: .82rem; color: var(--te-text-muted); margin-top: 5px; }

/* next-step list on home */
.cp-nextlist { display: flex; flex-direction: column; }
.cp-nextrow { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--te-border-alt); }
.cp-nextrow:last-child { border-bottom: none; }
.cp-nextrow__ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--cp-accent-soft); color: var(--cp-accent-dark); }
.cp-nextrow__ic.te { background: #e8edf5; color: var(--te-navy); }
.cp-nextrow__ic svg { width: 16px; height: 16px; }
.cp-nextrow__body { flex: 1; min-width: 0; }
.cp-nextrow__t { display: block; font-weight: 600; font-size: .9rem; }
.cp-nextrow__s { display: block; font-size: .8rem; color: var(--te-text-muted); margin-top: 1px; }

/* ============================================================ REPORTS */
.cp-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 8px 4px 0; }
.cp-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.cp-chart__bar { width: 100%; max-width: 38px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--cp-accent), var(--cp-accent-dark)); transition: height .5s cubic-bezier(.2,.8,.2,1); position: relative; }
.cp-chart__bar.today { background: linear-gradient(180deg, var(--te-accent-sky), var(--cp-accent)); }
.cp-chart__lbl { font-family: var(--te-font-dense); font-size: .72rem; color: var(--te-text-muted); }
.cp-legend { display: flex; gap: 18px; margin-top: 6px; }
.cp-legend span { display: inline-flex; align-items: center; gap: 7px; font-family: var(--te-font-dense); font-size: .78rem; color: var(--te-text-muted); }
.cp-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* settings field rows */
.cp-frow { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--te-border-alt); align-items: flex-start; }
.cp-frow:last-child { border-bottom: none; }
.cp-frow__l { width: 200px; flex: none; }
.cp-frow__l .t { font-weight: 600; font-size: .88rem; }
.cp-frow__l .d { font-size: .78rem; color: var(--te-text-muted); margin-top: 2px; line-height: 1.4; }
.cp-frow__c { flex: 1; min-width: 0; }
.cp-kv { font-family: var(--te-font-mono); font-size: .82rem; color: var(--te-text); background: var(--te-surface); border: 1px solid var(--te-border-alt); border-radius: var(--te-radius-md); padding: 9px 12px; display: flex; align-items: center; gap: 10px; }
.cp-kv .copy { margin-left: auto; }

/* simple list (team) */
.cp-list-row { display: flex; align-items: center; gap: 13px; padding: 14px 22px; border-bottom: 1px solid var(--te-border-alt); }
.cp-list-row:last-child { border-bottom: none; }
.cp-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .82rem; font-family: var(--te-font-dense); flex: none; }
.cp-list-row__meta { flex: 1; min-width: 0; }
.cp-list-row__meta .n { font-weight: 600; font-size: .9rem; }
.cp-list-row__meta .e { font-family: var(--te-font-dense); font-size: .8rem; color: var(--te-text-muted); }

/* toast region reuse */
.te-toast-region { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }

/* responsive: collapse sidebar on small screens */
@media (max-width: 760px) {
  .cp-shell { grid-template-columns: 1fr; grid-template-rows: 64px 1fr; grid-template-areas: "top" "main"; }
  .cp-brandcell, .cp-side { display: none; }
  .cp-main__inner { padding: 22px 18px 70px; }
}
