/* Executive module — brief, scorecard, cash & risks (plugin_modules/executive).
   Built on tokens.css only, so light/dark follow the shell. */

.xc { display: flex; flex-direction: column; gap: var(--space-5, 20px); max-width: 1200px; }
.xc-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.xc-head__date { font-size: var(--text-sm); color: var(--text-subtle); }
.xc-head h1 { margin: 2px 0 0; font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.01em; }
.xc-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.xc-seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px; }
.xc-seg a { font-size: var(--text-sm); padding: 7px 14px; border-radius: var(--radius-pill); color: var(--text-muted); text-decoration: none; min-height: 22px; }
.xc-seg a.is-active { background: var(--brand); color: var(--on-brand); }
.xc-seg a:not(.is-active):hover { background: var(--surface-hover); }
.xc-select { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-muted); }
.xc-select select { font: inherit; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); min-height: 40px; }

/* the one dark band: today in a sentence */
.xc-brief { background: #10261f; color: #fff; border-radius: var(--radius-lg); padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: center; }
.xc-brief p { margin: 0; flex: 1 1 420px; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.4; font-weight: 500; }
.xc-brief__counts { display: flex; gap: 28px; }
.xc-brief__counts div { display: flex; flex-direction: column; gap: 2px; }
.xc-brief__counts strong { font-family: var(--font-mono); font-size: 26px; font-weight: 500; }
.xc-brief__counts span { font-size: var(--text-xs); color: #b9c8c1; }
.xc-brief__counts .is-crit strong { color: #f2b8ae; }
.xc-brief__counts .is-warn strong { color: #f1d08f; }

.xc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.xc-grid--wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.xc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
a.xc-card:hover { border-color: var(--line-strong); }
.xc-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-muted); }
.xc-card__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(20px, 2vw, 28px); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-card__caption { font-size: var(--text-xs); color: var(--text-subtle); }
.xc-card__caption .is-up { color: var(--ok-fg); font-weight: 600; }
.xc-card__caption .is-down { color: var(--crit-fg); font-weight: 600; }
.xc-card svg.xc-spark { width: 100%; height: 40px; }
.xc-spark polyline { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }

.xc-pill { font-size: 11px; font-weight: 600; border-radius: var(--radius-pill); padding: 2px 8px; white-space: nowrap; }
.xc-pill--critical, .xc-pill--crit { color: var(--crit-fg); background: var(--crit-bg); }
.xc-pill--warning, .xc-pill--warn { color: var(--warn-fg); background: var(--warn-bg); }
.xc-pill--ok { color: var(--ok-fg); background: var(--ok-bg); }
.xc-pill--none { color: var(--text-muted); background: var(--neutral-bg); }

.xc-meter { position: relative; height: 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); margin: 15px 0; }
.xc-meter > span { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: var(--radius-pill); }
.xc-meter > i { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); }
.xc-meter--thin { height: 8px; margin: 0; }
.xc-tone-crit { background: var(--crit); } .xc-tone-warn { background: var(--warn); } .xc-tone-ok { background: var(--ok); }

.xc-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.xc-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.xc-panel--main { flex: 3 1 460px; } .xc-panel--side { flex: 2 1 340px; }
.xc-panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.xc-panel h2, .xc h2.xc-h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); }
.xc-panel__hint { font-size: var(--text-xs); color: var(--text-subtle); }
.xc-empty { margin: 0; font-size: var(--text-sm); color: var(--text-subtle); }
.xc-note { margin: auto 0 0; font-size: var(--text-sm); color: var(--text-muted); background: var(--surface-sunken); border-radius: var(--radius-md); padding: 10px 12px; }

.xc-decisions { display: flex; flex-direction: column; }
.xc-decision { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.xc-decision:first-child { border-top: 0; }
.xc-decision__kind { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 4px 8px; width: 84px; text-align: center; flex: none; }
.xc-kind-signature, .xc-kind-behalf { color: var(--info-fg); background: var(--info-bg); }
.xc-kind-approval { color: var(--warn-fg); background: var(--warn-bg); }
.xc-kind-delegation { color: var(--ok-fg); background: var(--ok-bg); }
.xc-decision__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xc-decision__body strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xc-decision__body span { font-size: var(--text-xs); color: var(--text-subtle); }

.xc-target { display: flex; flex-direction: column; gap: 6px; }
.xc-target__line { display: flex; justify-content: space-between; gap: 10px; font-size: var(--text-base); }
.xc-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.xc-fg-crit { color: var(--crit-fg); } .xc-fg-warn { color: var(--warn-fg); } .xc-fg-ok { color: var(--ok-fg); }

.xc-risk__eyebrow { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.xc-risk strong { font-size: var(--text-md); }
.xc-risk p { margin: 0; font-size: var(--text-sm); color: var(--text-muted); line-height: 1.5; }
.xc-risk a { margin-top: auto; font-size: var(--text-sm); font-weight: 600; }
.xc-eyebrow-crit { color: var(--crit-fg); } .xc-eyebrow-warn { color: var(--warn-fg); } .xc-eyebrow-info { color: var(--info-fg); }

.xc-foot { font-size: var(--text-xs); color: var(--text-subtle); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.xc-foot .is-warn { color: var(--warn-fg); }

/* scorecard */
.xc-area { padding: 0; overflow: hidden; gap: 0; }
.xc-area__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; gap: 8px; }
.xc-area__head h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); }
.xc-area--critical .xc-area__head { background: var(--crit-bg); }
.xc-area--warning .xc-area__head { background: var(--warn-bg); }
.xc-area--ok .xc-area__head { background: var(--ok-bg); }
.xc-area--none .xc-area__head { background: var(--surface-sunken); }
.xc-area dl { margin: 0; padding: 6px 18px 14px; }
.xc-area dl div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.xc-area dl div:last-child { border-bottom: 0; }
.xc-area dt { font-size: var(--text-sm); color: var(--text-muted); }
.xc-area dd { margin: 0; text-align: end; }
.xc-area dd small { display: block; font-size: var(--text-xs); color: var(--text-subtle); }

.xc-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 200px; border-bottom: 1px solid var(--line); }
.xc-bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.xc-bar > span { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 1px; }
.xc-bar.is-current > span { background: var(--brand-tint-strong); }
.xc-bar.is-below > span { background: var(--warn); }
.xc-bar > i { position: absolute; inset-inline-start: -3px; inset-inline-end: -3px; height: 2px; background: var(--text); }
.xc-bar-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; font-size: 11px; color: var(--text-subtle); text-align: center; }
.xc-legend { display: flex; gap: 16px; font-size: var(--text-xs); color: var(--text-muted); }
.xc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.xc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--brand); }
.xc-legend i.is-line { width: 14px; height: 2px; background: var(--text); }
.xc-legend i.is-warn { background: var(--warn); }

.xc-table-wrap { overflow-x: auto; }
.xc-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); min-width: 420px; }
.xc-table th { text-align: start; font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.xc-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.xc-table tr:last-child td { border-bottom: 0; }
.xc-table .num { text-align: end; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* cash & risks */
.xc-card--dark { background: #10261f; border-color: #10261f; color: #fff; }
.xc-card--dark .xc-card__top, .xc-card--dark .xc-card__caption { color: #b9c8c1; }
.xc-card--dark .xc-card__value { color: #fff; }
.xc-forecast svg { width: 100%; height: 180px; display: block; }
.xc-forecast .area { fill: var(--brand-tint); }
.xc-forecast .line { fill: none; stroke: var(--brand); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.xc-forecast .zero { stroke: var(--crit); stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.xc-ageing { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-sunken); }
.xc-age-not_due { background: var(--ok); } .xc-age-d30 { background: var(--signal); } .xc-age-d90 { background: var(--warn); }
.xc-age-d180 { background: var(--crit); } .xc-age-older { background: #7d2219; }
.xc-ageing-legend { margin: 0; display: flex; flex-direction: column; font-size: var(--text-sm); }
.xc-ageing-legend div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.xc-ageing-legend div:last-child { border-bottom: 0; }
.xc-ageing-legend dt { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.xc-ageing-legend dt i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.xc-ageing-legend dd { margin: 0; font-family: var(--font-mono); text-align: end; }
.xc-ageing-legend dd + dd { min-width: 9em; }
.xc-signal { background: var(--surface-sunken); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.xc-signal span { font-size: var(--text-sm); color: var(--text-muted); }
.xc-signal.is-warn { background: var(--warn-bg); }

@media (max-width: 720px) {
  .xc-brief { padding: 18px; }
  .xc-brief p { font-size: var(--text-lg); }
  .xc-decision { flex-wrap: wrap; }
  .xc-bars { gap: 3px; } .xc-bar-labels { gap: 3px; font-size: 9px; }
}
