/* ============================================================================
   scene-exec.css · Executive dashboard + the self-contained SVG chart styles
   (mc-* classes emitted by charts.js). The chairman's masterpiece view.
   ========================================================================== */
.exec { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; background: var(--softer); padding: 20px 24px 40px; }
#execRoot { max-width: 1360px; margin: 0 auto; }

.exec__head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.exec__title h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(20px, 1.2rem + .8vw, 28px); letter-spacing: -.02em; }
.exec__title p { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.exec__controls { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.exec__sel { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px 6px 11px; box-shadow: var(--shadow-sm); }
.exec__sel .mi { width: 15px; height: 15px; color: var(--mint-700); }
.exec__sel select { border: none; background: transparent; outline: none; font-size: 12.5px; font-weight: 600; color: var(--text-1); cursor: pointer; -webkit-appearance: none; appearance: none; }
.exec__sel--model select { color: var(--mint-ink); }

/* ---- hero (wow, at-a-glance) ---- */
.exec-hero { display: grid; grid-template-columns: 1.15fr 1fr auto; gap: 22px; align-items: center; color: #fff; border-radius: var(--r-lg); padding: 20px 26px; margin-bottom: 14px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 14% 18%, #12362a, #0a1712 72%); box-shadow: 0 10px 40px rgba(4,190,140,.15), var(--shadow); animation: lab-up .5s cubic-bezier(.2,.7,.2,1) backwards; }
.exec-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(4,190,140,.22), transparent 70%); pointer-events: none; }
.exec-hero__eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8fe6c9; display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.exec-hero__eyebrow .live-dot { background: #8fe6c9; }
.exec-hero__big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.exec-hero__big b { font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 3.2vw, 52px); letter-spacing: -.02em; line-height: 1; }
.exec-hero__delta { margin-left: 10px; font-size: 12.5px; font-weight: 700; color: #04150f; background: var(--mint); padding: 5px 12px; border-radius: 999px; align-self: center; }
.exec-hero__subline { font-size: 12.5px; color: #9fb3aa; margin-top: 9px; }
.exec-hero__spark { position: relative; min-width: 0; }
.exec-hero__sparklab { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-bottom: 2px; }
.exec-hero__spark .mc { max-height: 92px; }
.exec-hero__spark .mc-lab, .exec-hero__spark .mc-val { fill: rgba(255,255,255,.7); }
.exec-hero__pulse { display: flex; gap: 16px; }
.exec-pulse { text-align: center; min-width: 50px; }
.exec-pulse b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 27px; line-height: 1; }
.exec-pulse.crit b { color: #ff8f7d; } .exec-pulse.warn b { color: #f6c86a; } .exec-pulse.ok b { color: #6fe0b6; }
.exec-pulse span { font-size: 9.5px; color: #9fb3aa; text-transform: uppercase; letter-spacing: .04em; }

/* control bar (title + filters) */
.exec__bar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---- store health heatmap (whole portfolio at a glance) ---- */
.exec-heatwrap { margin-bottom: 14px; }
.exec-heat { display: flex; flex-direction: column; gap: 7px; }
.exec-heat__row { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 12px; }
.exec-heat__brand { font-family: var(--font-display); font-weight: 800; font-size: 11.5px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-heat__tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.exec-tile { width: 76px; height: 46px; border-radius: 9px; padding: 5px 8px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .12s, box-shadow .12s; border: 1px solid transparent; animation: lab-up .4s cubic-bezier(.2,.7,.2,1) backwards; }
.exec-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.exec-tile.ok { background: var(--mint-tint); border-color: #cdeede; }
.exec-tile.warn { background: var(--warn-soft); border-color: #f0dca2; }
.exec-tile.crit { background: var(--danger-soft); border-color: #f3c4bf; }
.exec-tile__h { font-family: var(--font-display); font-weight: 800; font-size: 14px; line-height: 1; }
.exec-tile.ok .exec-tile__h { color: var(--mint-ink); } .exec-tile.warn .exec-tile__h { color: #92590b; } .exec-tile.crit .exec-tile__h { color: #b42318; }
.exec-tile__n { font-size: 9px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-heat__legend { display: flex; gap: 16px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.exec-leg { font-size: 10.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; }
.exec-leg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.exec-leg.crit::before { background: var(--danger); } .exec-leg.warn::before { background: var(--warn); } .exec-leg.ok::before { background: var(--mint); }

/* KPI row */
.exec__kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.exec-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; box-shadow: var(--shadow-sm); animation: lab-up .45s cubic-bezier(.2,.7,.2,1) backwards; }
.exec-kpi b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.01em; line-height: 1.1; }
.exec-kpi b.up { color: var(--ok); } .exec-kpi b.down { color: var(--danger); }
.exec-kpi span { font-size: 11px; color: var(--text-soft); }

/* chart cards */
.exec__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.exec-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px 16px; box-shadow: var(--shadow-sm); }
.exec-card__h { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; margin-bottom: 8px; }
.exec-card__h--sm { font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.exec-empty { color: var(--text-soft); text-align: center; padding: 30px; font-family: var(--font-mono); }

/* ---- SVG chart primitives (charts.js) ---- */
.mc { width: 100%; height: auto; display: block; overflow: visible; animation: mc-in .5s ease; }
@keyframes mc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mc-axis { stroke: var(--line); stroke-width: 1; }
.mc-bar { fill: var(--mint); transition: opacity .2s; }
.mc-bar.is-hl { filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); }
.mc-bar.is-risk { fill: var(--danger) !important; }
.mc-bar.is-dim { opacity: .38; }
.mc-val { font-family: var(--font-mono); font-size: 11px; font-weight: 600; fill: var(--text-2); }
.mc-lab { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-soft); }
.mc-hlab { font-size: 11.5px; font-weight: 600; fill: var(--text-1); }
.mc-htrack { fill: var(--soft); }
.mc-hbar { fill: var(--mint); }
.mc-hval { font-family: var(--font-mono); font-size: 11px; font-weight: 600; fill: var(--text-2); }
.mc-donut { position: relative; width: 44px; height: 44px; }
.mc-donut svg { width: 100%; height: 100%; }
.mc-donut__bg { fill: none; stroke: var(--soft); stroke-width: 4; }
.mc-donut__fg { fill: none; stroke-width: 4.5; stroke-linecap: round; transition: stroke-dasharray .9s cubic-bezier(.16,1,.3,1); }
.mc-donut__c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mc-donut__c b { font-family: var(--font-display); font-weight: 800; font-size: 13px; }
.mc-donut__c span { font-family: var(--font-mono); font-size: 7px; text-transform: uppercase; color: var(--text-soft); }

/* ---- lower: table + side panels ---- */
.exec__lower { display: grid; grid-template-columns: 1fr 380px; gap: 14px; align-items: start; }
.exec-card--table { padding: 8px; }
.exec-table-wrap { overflow-x: auto; max-height: 560px; overflow-y: auto; border-radius: 12px; }
.exec-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.exec-table thead th { position: sticky; top: 0; background: #036b4d; color: #fff; font-weight: 700; text-align: left; padding: 9px 11px; white-space: nowrap; z-index: 1; }
.exec-table thead th:last-child, .exec-table td:last-child { text-align: right; }
.exec-table td { padding: 9px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.exec-table tbody tr:hover { background: var(--mint-tint-2); }
.exec-table .exec-num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
.exec-table .is-down { color: var(--danger); } .exec-table .is-up { color: var(--ok); }
.exec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.exec-issue { display: block; font-size: 10.5px; color: var(--text-soft); }
.exec-sev { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; }
.exec-sev.crit { background: var(--danger-soft); color: #b42318; } .exec-sev.warn { background: var(--warn-soft); color: #92590b; } .exec-sev.ok { background: var(--mint-tint); color: var(--mint-ink); }

.exec-side { display: flex; flex-direction: column; gap: 14px; }
.exec-ai__h { display: flex; align-items: center; gap: 8px; }
.exec-ai__h .mi { width: 17px; height: 17px; color: var(--mint-700); }
.exec-ai__h b { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; }
.exec-ai__live { margin-left: auto; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mint-ink); }
.exec-ai__live:not(:empty)::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); margin-right: 5px; animation: mt-pulse 2s infinite; }
.exec-ai__hint { font-size: 11.5px; color: var(--text-dim); margin: 5px 0 9px; line-height: 1.45; }
.exec-ai__body { font-size: 13px; line-height: 1.55; color: var(--text-1); max-height: 300px; overflow-y: auto; }
.exec-ai__body:empty { display: none; }
.exec-ai__stream { white-space: pre-wrap; }
.exec-ai__stream:not(.is-streaming) { white-space: normal; }
.exec-ai__stream.is-streaming::after { content: ''; display: inline-block; width: 6px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--mint); border-radius: 1px; animation: caret-blink .9s steps(2) infinite; }
.exec-ai__body p { margin: 0 0 8px; } .exec-ai__body p:last-child { margin: 0; }
.exec-ai__body ul, .exec-ai__body ol { margin: 0 0 8px; padding-left: 20px; } .exec-ai__body ul { list-style: disc; } .exec-ai__body ol { list-style: decimal; }
.exec-ai__body li { margin: 3px 0; } .exec-ai__body strong { font-weight: 700; color: var(--mint-ink); }
.exec-ai__form { display: flex; gap: 8px; margin-top: 10px; }
.exec-ai__form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; font-size: 12.5px; outline: none; }
.exec-ai__form input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(4,190,140,.12); }

.exec-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 9px 15px; border-radius: 999px; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.exec-btn--primary { background: var(--mint); color: #fff; } .exec-btn--primary:hover { background: var(--mint-hover); transform: translateY(-1px); }
.exec-btn--dark { background: var(--ink); color: #fff; width: 100%; margin-top: 10px; } .exec-btn--dark:hover { background: #000; }

/* forecast stages (MiroFish-style) */
.exec-fc__stages { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.exec-stage { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-soft); padding: 4px 0; }
.exec-stage .mi { width: 14px; height: 14px; flex: none; }
.exec-stage.is-active { color: var(--text-1); font-weight: 600; }
.exec-stage.is-active .mi { color: var(--mint-700); animation: nlq-spin .8s linear infinite; }
.exec-stage.is-done { color: var(--mint-ink); }
.exec-stage.is-done .mi { color: var(--mint-700); }
.exec-fc__chart { margin: 6px 0; }

/* clickable store affordances (drill-in) */
.exec-tile { cursor: pointer; }
.exec-tile:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.exec-row { cursor: pointer; transition: background .12s; }
.exec-row:hover { background: var(--softer); }

/* ============================== What-if simulation studio ============================== */
.exec-sim { padding: 16px 18px 18px; }
.sim__h { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.sim__h .mi { width: 18px; height: 18px; color: var(--mint-700); flex: none; }
.sim__h b { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; }
.sim__hint { font-size: 11.5px; color: var(--text-soft); flex: 1 1 200px; min-width: 0; }
.sim__reset { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; transition: color .15s, border-color .15s; }
.sim__reset .mi { width: 12px; height: 12px; }
.sim__reset:hover { color: var(--text-1); border-color: var(--mint); }
.sim__scen { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.sim-scen { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; transition: transform .12s, background .15s, color .15s, box-shadow .15s; }
.sim-scen:hover { transform: translateY(-1px); color: var(--text-1); }
.sim-scen.is-on { background: var(--mint); color: #fff; border-color: var(--mint); box-shadow: 0 4px 12px rgba(4,190,140,.22); }
.sim__body { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 22px; align-items: start; }
.sim__levers { display: flex; flex-direction: column; gap: 15px; }
.sim-lever { display: block; }
.sim-lever__lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.sim-lever__val { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--mint-ink); }
.sim-range { width: 100%; accent-color: var(--mint); height: 22px; cursor: pointer; }
.sim__out { min-width: 0; }
.sim__stats { display: flex; gap: 10px; margin-bottom: 12px; }
.sim-stat { flex: 1; background: var(--softer); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 11px 13px; }
.sim-stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; line-height: 1.1; }
.sim-stat b.up { color: var(--ok); } .sim-stat b.down { color: var(--danger); }
.sim-stat span { display: block; font-size: 10.5px; color: var(--text-soft); margin-top: 2px; }
.sim-d { display: inline-block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--soft); color: var(--text-soft); }
.sim-d.up { background: var(--ok-soft); color: var(--ok); } .sim-d.down { background: var(--danger-soft); color: #b42318; }
.sim__proj { margin-bottom: 12px; }
.sim__proj .mc-bars { margin-top: 4px; }
.sim__ai { min-height: 20px; }
.sim__ai-wait { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-soft); }
.sim__ai-wait .mi { width: 14px; height: 14px; color: var(--mint-700); animation: nlq-spin 1s linear infinite; }
.sim__ai-txt { display: block; font-size: 13px; line-height: 1.55; color: var(--text-1); padding: 11px 13px; background: var(--mint-tint-2); border-radius: 11px; border-left: 3px solid var(--mint); }
.sim__ai-txt.is-streaming::after { content: '▍'; color: var(--mint); animation: mv-blink 1s steps(2) infinite; }

/* ============================== Forecast what-if signal chips ============================== */
.fc-factors { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 6px 0 4px; }
.fc-factors__lab { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-soft); margin-right: 2px; }
.fc-fac { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--softer); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; transition: transform .12s, background .15s, color .15s, border-color .15s; }
.fc-fac .mi { width: 13px; height: 13px; }
.fc-fac:hover { transform: translateY(-1px); color: var(--text-1); }
.fc-fac.is-on { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.fc-fac.is-on .mi { color: var(--info); }

/* ============================== Store drill-in popover ============================== */
.exec-drill { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 20px; }
.exec-drill__scrim { position: absolute; inset: 0; background: rgba(6,16,12,.55); backdrop-filter: blur(3px); animation: exec-drill-fade .2s ease; }
.exec-drill__card { position: relative; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 22px 22px; overflow: hidden; animation: exec-drill-in .28s cubic-bezier(.16,1,.3,1); }
.exec-drill__card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent, var(--mint)); }
.exec-drill__x { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-soft); border-radius: 8px; }
.exec-drill__x .mi { width: 18px; height: 18px; } .exec-drill__x:hover { color: var(--text-1); background: var(--soft); }
.exec-drill__top { display: flex; align-items: center; gap: 9px; }
.exec-drill__brand { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--accent, var(--mint-ink)); }
.exec-drill__name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.01em; margin: 3px 0 14px; }
.exec-drill__reg { font-size: 12px; font-weight: 500; color: var(--text-soft); }
.exec-drill__body { display: flex; align-items: center; gap: 18px; }
.exec-drill__body .mc-donut { width: 68px; height: 68px; flex: none; }
.exec-drill__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; flex: 1; min-width: 0; }
.exec-drill__stats b { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; line-height: 1.1; }
.exec-drill__stats b.up { color: var(--ok); } .exec-drill__stats b.down { color: var(--danger); }
.exec-drill__stats span { display: block; font-size: 10.5px; color: var(--text-soft); }
.exec-drill__stars { color: #e0a800; letter-spacing: 1px; }
.exec-drill__issue { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding: 10px 12px; border-radius: 11px; background: var(--danger-soft); font-size: 12.5px; color: #b42318; }
.exec-drill__issue .mi { width: 15px; height: 15px; flex: none; color: var(--danger); }
.exec-drill__act { margin-top: 16px; }
.exec-drill__act .exec-btn { width: 100%; }
@keyframes exec-drill-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes exec-drill-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) {
  .exec__kpis { grid-template-columns: repeat(3, 1fr); }
  .exec__grid { grid-template-columns: 1fr; }
  .exec__lower { grid-template-columns: 1fr; }
  .exec-hero { grid-template-columns: 1fr; gap: 14px; }
  .exec-hero__pulse { gap: 22px; }
  .sim__body { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 560px) {
  .exec__kpis { grid-template-columns: repeat(2, 1fr); }
  .exec { padding: 14px; }
  .exec-heat__row { grid-template-columns: 1fr; }
  .exec-heat__brand { text-align: left; }
}
