/* ============================================================ EXECUTIVE DASHBOARD
   Namespace: .exec-*  (executive.html)
   Kompaktowy overview dla zarządu — KPI + alerty + lista projektów. */

.exec-dash {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Nagłówek */
.exec-dash__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.exec-dash__title {
  font-family: var(--f-head);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--c-fg);
  margin: 0;
}
.exec-dash__subtitle {
  font-size: .85rem;
  color: var(--c-fg-muted);
  margin: .25rem 0 0;
}
.exec-dash__actions { flex-shrink: 0; }

/* Sekcje */
.exec-section {
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--sh-sm);
}
.exec-section__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--f-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-fg);
  margin: 0 0 1rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--c-border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.exec-section__icon { font-size: 1.1rem; }
.exec-section__count {
  font-size: .72rem;
  font-weight: 600;
  background: var(--a-teal-12);
  color: var(--c-accent);
  padding: .1rem .45rem;
  border-radius: var(--r-sm);
  margin-left: auto;
}

.exec-empty {
  font-size: .85rem;
  color: var(--c-fg-muted);
  text-align: center;
  padding: 1.5rem 0;
}


/* Grupy etapów — "w toku" */
.exec-stage-group { margin-bottom: 1.25rem; }
.exec-stage-group:last-child { margin-bottom: 0; }
.exec-stage-group__head {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--c-fg-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.exec-stage-group__count {
  font-size: .65rem;
  font-weight: 600;
  background: var(--a-teal-08);
  color: var(--c-accent);
  padding: .05rem .35rem;
  border-radius: var(--r-sm);
}
.exec-stage-group__items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Wiersz projektu — podwyższona czytelność */
.exec-row {
  display: grid;
  grid-template-columns: 4px 1fr auto auto 80px auto auto;
  align-items: center;
  gap: .6rem;
  padding: .7rem .9rem;
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
  font-size: .82rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.exec-row:hover {
  background: var(--c-bg-elev);
  border-color: var(--c-accent);
  box-shadow: 0 2px 8px rgba(13,148,136,.08);
  transform: translateX(3px);
  text-decoration: none;
}
.exec-row__cat {
  width: 4px;
  height: 28px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.exec-row__title {
  font-weight: 600;
  color: var(--c-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.exec-row__veto {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #b91c1c;
  background: rgba(220, 38, 38, .12);
  padding: .08rem .35rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme=dark] .exec-row__veto { color: #fca5a5; background: rgba(220, 38, 38, .2); }
.exec-row__changes {
  font-size: .72rem;
  font-weight: 500;
  color: var(--c-fg-muted);
  white-space: nowrap;
}
.exec-row__progress {
  height: 4px;
  background: var(--c-border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.exec-row__bar {
  height: 100%;
  background: var(--c-accent);
  border-radius: var(--r-sm);
  transition: width .4s ease;
}
.exec-row__date {
  font-size: .72rem;
  color: var(--c-fg-muted);
  white-space: nowrap;
}
.exec-row__arrow {
  font-size: .72rem;
  color: var(--c-accent);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}
.exec-row:hover .exec-row__arrow { opacity: 1; transform: translateX(2px); }
.exec-row__detail {
  font-size: .72rem;
  color: var(--c-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Ukończone — subtelniejszy styl */
.exec-completed { display: flex; flex-direction: column; gap: 4px; }
.exec-row--done {
  grid-template-columns: 4px 1fr 1fr auto auto;
  opacity: .65;
  background: var(--c-bg);
  border-color: transparent;
  box-shadow: none;
}
.exec-row--done:hover {
  opacity: 1;
  border-color: var(--c-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ── Źródła legislacyjne ── */
.exec-sources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.exec-source {
  background: var(--c-bg-elev, var(--c-surface));
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 1rem 1.15rem;
  transition: border-color var(--t-fast, .15s);
}
.exec-source:hover {
  border-color: var(--c-accent);
}
.exec-source__head {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .65rem;
}
.exec-source__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: .1rem;
}
.exec-source__title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--c-fg, #1e293b);
  line-height: 1.25;
}
.exec-source__base {
  font-size: .72rem;
  color: var(--c-text-muted, #64748b);
  font-family: var(--f-mono, monospace);
}
.exec-source__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.exec-source__links li {
  font-size: .78rem;
  line-height: 1.4;
}
.exec-source__links a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t-fast, .15s);
}
.exec-source__links a:hover {
  color: var(--c-accent);
  text-decoration: underline;
}
.exec-source__tpl {
  color: var(--c-text-muted, #64748b);
}
.exec-source__tpl-tag {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--c-border, #e2e8f0);
  color: var(--c-text-muted, #64748b);
  padding: .1rem .35rem;
  border-radius: var(--r-sm);
  margin-left: .3rem;
  vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 880px) {
  .exec-row {
    grid-template-columns: 4px 1fr auto auto;
  }
  .exec-row__progress,
  .exec-row__changes { display: none; }
  .exec-row--done { grid-template-columns: 4px 1fr auto auto; }
  .exec-row--done .exec-row__detail { display: none; }
  .exec-sources { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .exec-dash__header { flex-direction: column; align-items: flex-start; }
  .exec-sources { grid-template-columns: 1fr; }
}

/* ── Pipeline Health ── */
.exec-pipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.exec-pipe-card {
  display: flex;
  align-items: stretch;
  gap: .75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card, 12px);
  padding: .875rem 1rem;
  transition: border-color .15s;
}
.exec-pipe-card:hover {
  border-color: var(--c-teal-light, #ccfbf1);
}
.exec-pipe-card__status {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.exec-pipe-card__status--fresh  { background: var(--c-chip-active); }
.exec-pipe-card__status--aging  { background: var(--c-amber); }
.exec-pipe-card__status--stale  { background: var(--c-red); }
.exec-pipe-card__body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.exec-pipe-card__label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.exec-pipe-card__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-slate, #1e293b);
}
.exec-pipe-card__ts {
  font-size: .75rem;
  color: var(--c-text-muted, #64748b);
}
@media (max-width: 600px) {
  .exec-pipe-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .exec-pipe-grid { grid-template-columns: 1fr; }
}


/* ── Analityka — divider ── */
.exec-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: .5rem 0;
}
.exec-divider::before,
.exec-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}
.exec-divider__label {
  font-family: var(--f-head);
  font-size: .82rem;
  font-weight: 700;
  color: var(--c-fg-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Chart containery */
.exec-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}
.exec-chart-wrap--wide { height: auto; min-height: 280px; }
.exec-chart-wrap--sq { height: 240px; }

.exec-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.exec-section--chart {
  padding: 1rem 1.25rem;
}
.exec-section--chart .exec-section__head {
  font-size: .85rem;
  margin-bottom: .5rem;
  padding-bottom: .4rem;
}

/* Velocity KPI cards */
.exec-velocity-kpis {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.exec-vel-kpi {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: .6rem 1rem;
  flex: 1 1 140px;
  min-width: 0;
}
.exec-vel-kpi__v {
  font-family: var(--f-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exec-vel-kpi__l {
  font-size: .68rem;
  color: var(--c-fg-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Responsive — analityka */
@media (max-width: 700px) {
  .exec-chart-grid { grid-template-columns: 1fr; }
  .exec-chart-wrap--sq { height: 220px; }
  .exec-velocity-kpis { flex-direction: column; }
}

/* ── Print ── */
@media print {
  @page { margin: 2cm; }
  .exec-dash { gap: 1rem; }
  .exec-dash__actions { display: none !important; }
  .exec-section { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .exec-row { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .exec-row:hover { transform: none; box-shadow: none; }
  .exec-row__arrow { display: none; }
  .exec-row__bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .exec-source { break-inside: avoid; }
  .exec-pipe-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .exec-pipe-card__status { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .exec-divider::before, .exec-divider::after { background: #ccc; }
  .exec-chart-grid { grid-template-columns: 1fr 1fr; }
  .exec-chart-wrap { page-break-inside: avoid; }
  .exec-vel-kpi { border: 1px solid #ccc; box-shadow: none; }
  canvas { max-height: 350px !important; }
  a { color: #000; text-decoration: underline; }
}

/* ── Utility classes (zastępują inline style="…") ── */
.u-size-24     { width: 24px !important; height: 24px !important; }
.u-va-base     { vertical-align: -.1em; }
.u-skel-line   { height: 1.6em; margin-bottom: 1rem; }
.u-skel-h1     { height: 2.4em; }
