/* Executive overview, using the shared CMMS theme tokens. */
.topbar.executive-active {
  background: repeating-radial-gradient(ellipse at 16% 115%, transparent 0 54px, var(--executive-contour) 55px 57px, transparent 58px 96px),
              repeating-radial-gradient(ellipse at 76% -90%, transparent 0 64px, var(--executive-contour) 65px 67px, transparent 68px 123px),
              var(--header-bg);
}
.topbar.executive-active .titleblock h1 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#executive-stamp { color: var(--on-dark-muted); font-size: var(--fs-sm); white-space: nowrap; }
#executive-stamp.fresh::before { content: '●'; color: var(--ok-signal); margin-right: .4em; }
.executive-stamp-compact { display: none; }
.executive { display: grid; gap: 16px; min-width: 0; }
.executive :is(b, .num) { font-variant-numeric: tabular-nums; }
.exec-filters, .exec-position, .exec-kpi, .exec-types a, .exec-parts {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1);
}
.exec-filters { padding: 8px 12px; }
.exec-filters summary { display: none; cursor: pointer; font-weight: 700; }
.exec-filters form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.exec-filters label { display: grid; gap: 2px; flex: 0 1 auto; min-width: 0; font-size: var(--fs-sm); color: var(--muted); }
.exec-filters select { max-width: min(180px, 100%); }
.exec-filters input, .exec-filters select, .exec-panel header select {
  min-width: 0; padding: 4px 8px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px;
}
.exec-filters input, .exec-filters select { height: 34px; }
.exec-filters select[name="site"] { width: 180px; }
.exec-filters select[name="work_centre"] { width: 165px; }
.exec-filters select[name="job_type"] { width: 127px; }
.exec-filters select[name="horizon"] { width: 82px; }
.exec-filters .exec-filter-search { flex: 1 1 164px; }
.exec-filters .btn { white-space: nowrap; min-height: 34px; }
.exec-position { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  border-left: 5px solid var(--accent-2); padding: 11px 15px; background: var(--accent-soft); }
.exec-position h2 { font-size: 19px; }
.exec-position a:not(.btn) { color: var(--ink); text-decoration: none; }
.exec-position a:not(.btn):hover { text-decoration: underline; }
.exec-position-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.exec-position-actions small { margin-right: 4px; }
.exec-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.exec-kpi { display: flex; flex-direction: column; min-width: 0; min-height: 122px; padding: 10px 11px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 7%, var(--surface)), var(--surface) 62%);
  border-top: 4px solid var(--tone); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.exec-kpi span, .exec-kpi small, .exec-types small, .exec-parts small { color: var(--muted); }
.exec-kpi b, .exec-types b, .exec-parts b, .exec-upcoming b, .exec-donut-total b {
  font: 700 clamp(23px, 2.3vw, 37px)/1.14 var(--font-display); color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.exec-headline-link { display: grid; color: inherit; }
.exec-safety-split { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.exec-safety-split a { display: flex; justify-content: space-between; gap: 4px; }
.exec-kpi b { color: var(--tone); margin: 5px 0; overflow-wrap: normal; word-break: normal; }
.exec-kpi .exec-drill { margin-top: auto; color: var(--ink); }
.notification-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 12px; }
.notification-metrics .exec-kpi { min-height: auto; }
.exec-types { display: grid; grid-template-columns: repeat(var(--type-count), minmax(0, 1fr)); gap: 10px; }
.exec-types a { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-left: 4px solid var(--accent-2); padding: 8px 12px; color: var(--ink); text-decoration: none; }
.exec-types small, .exec-parts small { display: block; }
.exec-types a span { min-width: 0; overflow-wrap: anywhere; }
.exec-types b, .exec-parts b { font-size: 25px; }
.exec-parts { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); overflow: hidden;
  border-left: 5px solid var(--accent-2); }
.exec-parts > div { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 10px 13px; border-right: 1px solid var(--line); }
.exec-parts > div:first-child { background: var(--accent-soft); }
.exec-parts > div:last-child { border-right: 0; }
.exec-parts strong { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; color: var(--muted); }
.exec-parts.exec-parts-compact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; }
.exec-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 3fr)) minmax(0, 4fr); gap: 16px; }
.exec-panel { min-width: 0; overflow: hidden; }
.exec-panel header { gap: 8px; flex-wrap: wrap; background: var(--surface-2); }
.exec-panel header small { color: var(--muted); }
.exec-panel header label { display: flex; align-items: center; gap: 4px; }
.exec-panel header select { min-width: 0; max-width: 130px; }
.exec-panel .body { min-width: 0; overflow-wrap: anywhere; }
.exec-wide { grid-column: 1 / -1; }
.exec-panel-top { align-self: start; }
.exec-group-table .data { min-width: 0; }
.exec-more summary { cursor: pointer; color: var(--accent); padding-block: 8px; }
.exec-unassigned { color: var(--warning); font-weight: 700; }
.exec-status { display: grid; grid-template-columns: minmax(86px, 1fr) minmax(126px, 1.4fr); gap: 12px; align-items: center; }
.exec-donut { position: relative; max-width: 180px; }
.exec-donut svg { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
.exec-stroke { fill: none; stroke: var(--tone); stroke-width: 12; }
.exec-donut svg a { pointer-events: stroke; }
.exec-donut svg a:hover .exec-stroke, .exec-donut svg a:focus-visible .exec-stroke { stroke-width: 15; }
.exec-donut-total { position: absolute; inset: 22%; display: grid; justify-items: center; align-content: center; text-decoration: none; }
.exec-donut-total b { font-size: clamp(17px, 2vw, 32px); }
.exec-donut-total small { color: var(--muted); font-size: clamp(9px, 1vw, 13px); }
.exec-legend, .exec-chart-key { display: grid; gap: 7px; list-style: none; padding: 0; margin: 0; }
.exec-legend a { display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; }
.exec-legend a b { margin-left: auto; }
.exec-chart-key { display: flex; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-bottom: 9px; }
.exec-chart-key li { display: flex; align-items: center; gap: 4px; }
.exec-dot { display: inline-block; vertical-align: middle; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 3px; background: var(--tone); }
.exec-upcoming { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.exec-upcoming a { display: grid; gap: 4px; background: var(--accent-soft); border-bottom: 3px solid var(--accent); border-radius: 9px;
  padding: 8px; color: var(--ink); text-decoration: none; }
.exec-upcoming b { font-size: clamp(18px, 2vw, 32px); }
.exec-months { display: grid; grid-template-columns: repeat(12, minmax(28px, 1fr)); gap: 4px; overflow: auto; }
.exec-month { min-width: 0; text-align: center; color: var(--muted); font-size: 10px; }
.exec-month span { display: inline-block; padding: 4px 0; }
.exec-month-track { position: relative; height: 101px; margin-top: 14px; }
.exec-month-count { position: absolute; bottom: var(--level); left: 0; width: 100%; color: var(--ink-strong);
  font-weight: 700; text-decoration: none; }
.exec-month-stack { position: absolute; inset: auto 2px 0; height: var(--level); display: flex; flex-direction: column-reverse; }
.exec-month-stack a { display: block; min-height: 1px; }
.exec-month-stack a, .exec-progress a { background: var(--tone); }
.exec-month-stack a:hover, .exec-progress a:hover { filter: brightness(1.2); }
.exec-priority { display: grid; gap: 8px; }
.exec-priority > div { display: grid; grid-template-columns: minmax(48px, auto) minmax(45px, 1fr) 3ch; align-items: center; gap: 6px; }
.exec-priority > div > a { text-align: right; }
.exec-progress { height: 11px; display: flex; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.exec-attention a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.exec-attention small { display: block; color: var(--muted); }
.exec-attention b { flex: none; }
.exec-custom-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.exec-danger { color: var(--danger); }
.t-danger { --tone: var(--danger); }
.t-warning { --tone: var(--warning); }
.t-neutral { --tone: var(--ink-strong); }
.t-muted { --tone: var(--line-strong); }
.t-quality { --tone: var(--quality); }
.t-blue { --tone: var(--accent); }
.t-teal { --tone: var(--accent-2); }
.chart-color-1 { --tone: var(--chart-1); }
.chart-color-2 { --tone: var(--chart-2); }
.chart-color-3 { --tone: var(--executive-chart-plum); }
.chart-color-4 { --tone: var(--executive-chart-olive); }
.chart-color-5 { --tone: var(--executive-chart-indigo); }
.chart-color-6 { --tone: var(--chart-6); }
.executive :is(.exec-kpi, .exec-types a, .exec-upcoming a, .exec-attention a, .exec-legend a):hover { text-decoration: underline; }

@media (max-width: 1360px) {
  .exec-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .exec-types { grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr)); }
}
@media (max-width: 1040px) {
  .exec-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #executive-stamp { white-space: normal; max-width: 140px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .topbar.executive-active .titleblock { position: absolute; }
  .topbar.executive-active #subtitle, #executive-stamp > span:first-child { display: none; }
  #executive-stamp .executive-stamp-compact { display: inline; }
}
@media (max-width: 768px) {
  .executive { gap: 12px; }
  .exec-filters summary { display: list-item; }
  .exec-filters[open] form { margin-top: 8px; }
  .exec-filters form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .exec-filters .exec-filter-search { grid-column: 1 / -1; }
  .exec-kpis, .exec-types, .exec-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exec-parts > div { border-bottom: 1px solid var(--line); }
  .exec-panels { grid-template-columns: minmax(0, 1fr); }
  #executive-stamp { grid-column: 2 / -1; max-width: none; }
}
