/* Executive intelligence: /insights, department insights, the Owner's control centre. Tokens from app.css only;
   the night hero keeps the brand night in both themes. */

/* ------------------------------------------------------------------ metric tiles */
.ins-group { margin-top: var(--s8); }
.ins-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.ins-group-head h2 { font-size: 19px; }
.ins-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--s3); align-items: start; }
.ins-tile { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s4) var(--s4) var(--s3); box-shadow: var(--shadow-1); color: var(--text); }
a.ins-tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.ins-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); min-height: 36px; }
.ins-tile-label { font: 500 13px/1.35 var(--font); color: var(--text-2); letter-spacing: 0; }
.ins-trend { flex: none; font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.ins-tile-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); }
.ins-value { font: 700 27px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-value small { font: 500 13px/1 var(--font); color: var(--muted); letter-spacing: 0; }
.ins-spark { color: var(--accent); flex: none; line-height: 0; opacity: .9; }
.ins-spark svg { display: block; width: 96px; height: 28px; }
.ins-tile-foot { font-size: 12.5px; min-height: 18px; }
.ins-chg { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.ins-chg.good { color: var(--good); } .ins-chg.bad { color: var(--danger); }
.ins-about { border-top: 1px solid var(--border); margin-top: var(--s1); padding-top: var(--s1); font-size: 12.5px; }
.ins-about summary { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; color: var(--muted); font-weight: 500; }
.ins-about summary:hover { color: var(--text); }
.ins-about[open] summary .icon { transform: rotate(180deg); }
.ins-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--s3); margin: var(--s2) 0; }
.ins-kv dt { color: var(--muted); } .ins-kv dd { margin: 0; color: var(--text-2); line-height: 1.45; min-width: 0; }
.ins-drill { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; min-height: 24px; }
.ins-plat-figs { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-2); }
.ins-plat-figs b { font: 700 17px/1.3 var(--font-display); color: var(--text); }
.ins-jump { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s6) 0 0; }
.ins-jump a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--s3); border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 500; }
.ins-jump a:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.ins-meter { display: block; margin-top: 6px; height: 5px; max-width: 280px; }
.ins-pct { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.ins-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ins-mini { display: flex; flex-direction: column; gap: 2px; padding: var(--s4) var(--s5); border-right: 1px solid var(--border); color: var(--text); min-width: 0; }
.ins-mini:last-child { border-right: 0; }
.ins-mini:hover { background: var(--surface-2); text-decoration: none; }
.ins-mini-label { font-size: 12.5px; color: var(--muted); }
.ins-mini-value { font: 700 22px/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ins-mini-value small { font: 500 12px/1 var(--font); color: var(--muted); }
.ins-mini .ins-chg { font-size: 12px; }

/* ------------------------------------------------------------------ movements and AI */
.ins-moves { margin-top: 0; }
.ins-move { align-items: flex-start !important; }
.ins-move-kind { flex: none; width: 128px; padding-top: 2px; }
.sig-sev { flex: none; width: 86px; }
.ins-move .title { font-weight: 500; color: var(--text); }
.ins-rule { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ins-rule summary { display: inline-flex; min-height: 24px; align-items: center; color: var(--muted); font-weight: 500; }
.ins-rule summary::before { content: "+"; width: 14px; font-weight: 600; }
.ins-rule[open] summary::before { content: "−"; }
.ins-rule p { margin: 2px 0 var(--s1); line-height: 1.5; max-width: 70ch; }
.ins-big { counter-reset: big; }
.ins-big > li { counter-increment: big; gap: var(--s3); min-height: 46px; }
.ins-big > li::before { content: counter(big); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 600 11.5px/1 var(--font); background: var(--surface-3); color: var(--muted); }
.ins-big .title { font-weight: 500; color: var(--text); }
.ins-big-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-explain { border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s3); }
.ins-explain .notice { margin-bottom: 0; }
.ins-explain-form { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.ins-ai { position: relative; border: 1.5px dashed color-mix(in srgb, var(--accent) 65%, transparent); border-radius: var(--r);
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 10px, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)) 10px 20px);
  padding: var(--s4); }
.ins-ai-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); color: var(--accent-text); font-size: 13.5px; }
.ins-ai-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--primary); color: #fff;
  font: 700 11px/1 var(--font); letter-spacing: .1em; }
.ins-ai-body { background: var(--surface); border-radius: var(--r-sm); padding: var(--s3) var(--s4); font-size: 14px; line-height: 1.55; }
.ins-ai-body p { margin: 0 0 var(--s2); } .ins-ai-body p:last-child { margin: 0; }
.ins-ai-sent { margin-top: var(--s3); font-size: 12.5px; color: var(--text-2); }
.ins-ai-sent summary { min-height: 24px; display: inline-flex; align-items: center; font-weight: 500; }
.ins-ai-sent ul { margin: var(--s2) 0 0; padding-left: var(--s5); }
.ins-ai-foot { margin: var(--s3) 0 0; font-size: 12px; color: var(--text-2); }
.ins-rag { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; border-bottom: 1px solid var(--border); padding-top: var(--s4); padding-bottom: var(--s4); }
.ins-budget { display: flex; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: var(--s4) 0 var(--s2); }
.ins-budget-actual { background: var(--violet); } .ins-budget-commit { background: var(--lavender); }

/* ------------------------------------------------------------------ the Owner's control centre */
.cc-hero { position: relative; overflow: hidden; isolation: isolate; color: #E9E4FA; border-radius: var(--r-xl); margin-bottom: var(--s6);
  padding: var(--s8) var(--s8) var(--s6); border: 1px solid #2E2B38; box-shadow: var(--shadow-2);
  background: radial-gradient(90% 120% at 100% 0%, rgba(109, 40, 217, .42) 0%, rgba(109, 40, 217, 0) 60%),
              radial-gradient(60% 90% at 0% 100%, rgba(217, 204, 255, .08) 0%, rgba(217, 204, 255, 0) 70%), var(--night); }
.cc-orbit { position: absolute; right: -90px; top: -110px; width: 420px; height: 420px; color: rgba(217, 204, 255, .07); z-index: -1; pointer-events: none; }
.cc-orbit svg { width: 100%; height: 100%; }
.cc-hero-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.cc-hero .kicker { color: var(--lavender); }
.cc-date { font-size: 13px; color: rgba(233, 228, 250, .66); }
.cc-bar { display: block; width: 44px; height: 4px; border-radius: 4px; margin: var(--s3) 0 var(--s4); background: linear-gradient(90deg, var(--lavender), var(--violet)); }
.cc-hero h1 { color: #fff; font-size: 32px; line-height: 1.12; letter-spacing: -.025em; }
.cc-summary { color: rgba(233, 228, 250, .84); font-size: 16px; margin: var(--s2) 0 var(--s6); max-width: 64ch; }
.cc-vitals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.cc-vital { display: flex; flex-direction: column; gap: 4px; padding: var(--s4); border-radius: var(--r-lg); min-width: 0; color: #fff;
  background: rgba(217, 204, 255, .06); border: 1px solid rgba(217, 204, 255, .12); }
.cc-vital:hover { background: rgba(217, 204, 255, .11); text-decoration: none; }
.cc-vital:focus-visible { box-shadow: 0 0 0 3px rgba(217, 204, 255, .5); }
.cc-vital-label { font-size: 12.5px; color: rgba(233, 228, 250, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-vital-value { font: 700 26px/1.15 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-vital-value small { font: 500 12.5px/1 var(--font); color: rgba(233, 228, 250, .6); letter-spacing: 0; }
.cc-vital-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 26px; font-size: 12px; }
.cc-spark { color: var(--lavender); line-height: 0; }
.cc-spark svg { width: 84px; height: 24px; display: block; }
.cc-hero .ins-chg { color: rgba(233, 228, 250, .7); }
.cc-hero .ins-chg.good { color: #86EFAC; } .cc-hero .ins-chg.bad { color: #FCA5A5; }
.cc-note { margin: var(--s4) 0 0; font-size: 12.5px; color: rgba(233, 228, 250, .6); }
.cc-note a { color: var(--lavender); }
.cc-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: var(--s5); align-items: start; }
.cc-main, .cc-side { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.cc-main > *, .cc-side > * { margin-top: 0 !important; }
.cc-count { margin-left: auto; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  font: 700 13px/1 var(--font); background: var(--accent-soft); color: var(--accent-text); }
.cc-warn-groups { display: flex; flex-direction: column; }
.cc-warn-group { border-bottom: 1px solid var(--border); }
.cc-warn-group:last-child { border-bottom: 0; }
.cc-warn-group > summary { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); min-height: 48px; }
.cc-warn-group > summary:hover { background: var(--surface-2); }
.cc-warn-group > summary .icon { color: var(--muted); transition: transform .15s; }
.cc-warn-group[open] > summary .icon { transform: rotate(180deg); }
.cc-warn-group .list { border-top: 1px solid var(--border); background: var(--surface-2); }
.cc-warn-group .list > li { padding-left: var(--s5); }
.cc-figs > li { min-height: 46px; }
.cc-fig-label { color: var(--text); font-weight: 500; font-size: 13.5px; }
.cc-fig-value { font: 700 16px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-fig-value small { font: 500 12px/1 var(--font); color: var(--muted); }
.cc-fig-chg { min-width: 84px; text-align: right; font-size: 12px; }
.cc-fig-note { font-size: 13px; color: var(--muted); }
.cc-runway { background: var(--surface-2); }
.cc-sub { min-height: 38px !important; font-size: 13px; padding-left: var(--s8) !important; }
.cc-plat-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.cc-demo { color: var(--warn); font-weight: 600; }

@media (max-width: 1280px) { .cc-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .cc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .cc-hero { padding: var(--s6) var(--s4) var(--s5); border-radius: var(--r-lg); }
  .cc-hero h1 { font-size: 25px; }
  .cc-summary { font-size: 14.5px; margin-bottom: var(--s4); }
  .cc-vitals { gap: var(--s2); }
  .cc-vital { padding: var(--s3); }
  .cc-vital-value { font-size: 20px; }
  .cc-vital-label { white-space: normal; line-height: 1.3; min-height: 2.6em; }
  .cc-spark svg { width: 56px; }
  .cc-orbit { width: 260px; height: 260px; right: -90px; top: -80px; }
  .ins-move-kind, .sig-sev { width: auto; }
  .ins-move, .cc-warn-group .list > li { flex-wrap: wrap; }
  .cc-warn-group > summary { padding: var(--s3) var(--s4); }
  .cc-fig-chg { min-width: 0; }
  .ins-tiles { grid-template-columns: minmax(0, 1fr); }
  .ins-mini { border-right: 0; border-bottom: 1px solid var(--border); padding: var(--s3) var(--s4); }
  .ins-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
