/* directors.css — the Directors view.
   Loaded last so it can win on specificity without !important.
   Inherits every colour from the existing :root palette in styles.css, so a
   theme change there carries through here automatically. */

/* ------------------------------------------------------------ KPI strip */
.dir-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.25rem;
  align-items: stretch;
}

.dir-kpi {
  padding: 0.7rem 0.9rem;
  border-left: 1px solid var(--border);
}
.dir-kpi:first-child { border-left: 0; }

.dir-kpi-val {
  font-size: 1.85rem;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.dir-kpi:first-child .dir-kpi-val { color: var(--blue); }

/* The period reads as a label, not a headline number. */
#dir-kpi-range { font-size: 0.95rem; font-weight: 500; padding-top: 0.55rem; }

.dir-kpi-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* --------------------------------------------------------------- notes */
.dir-notes { margin: 0.6rem 0 0; }

.dir-note {
  margin: 0 0 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text);
  background: color-mix(in srgb, var(--warn) 11%, transparent);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* --------------------------------------------------------------- tables */
.dir-card { margin-top: 0.9rem; }

.dir-table { width: 100%; border-collapse: collapse; }

.dir-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
}

.dir-table td { vertical-align: middle; }

.dir-table .num { text-align: right; }

.dir-hours {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.dir-hours::after {
  content: " h";
  font-weight: 400;
  font-size: 0.78em;
  color: var(--muted);
}

.dir-share {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  width: 3.5rem;
  white-space: nowrap;
}

/* Name cell carries the proportional bar as a background layer. */
.dir-name { position: relative; padding-right: 1rem; }

.dir-label { position: relative; z-index: 1; }

.dir-teams {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.05rem;
}

.dir-unassigned { color: var(--warn); }

.dir-bar {
  position: absolute;
  left: 0;
  bottom: 0.15rem;
  height: 2px;
  background: var(--blue);
  opacity: 0.55;
  border-radius: 1px;
  z-index: 0;
  pointer-events: none;
}

.dir-row.dir-clickable { cursor: pointer; }
.dir-row.dir-clickable:hover { background: var(--row); }
.dir-row.dir-clickable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.dir-caret {
  display: inline-block;
  width: 1rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.dir-foot td {
  border-top: 2px solid var(--border);
  border-bottom: 0;
  font-weight: 650;
  padding-top: 0.55rem;
}

/* ----------------------------------------------------- expanded detail */
.dir-sub-row > td { padding: 0 0 0.5rem 2rem; background: var(--row-head); }

.dir-sub { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dir-sub th {
  position: static;
  background: transparent;
  font-size: 0.64rem;
  padding-top: 0.4rem;
}
.dir-sub td, .dir-sub th { border-bottom: 1px solid var(--border); }
.dir-sub tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- tools */
.dir-tools {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

/* ------------------------------------------------------------ advanced */
details.rep-advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.6rem 0 0;
  background: var(--row-head);
}

details.rep-advanced > summary {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  user-select: none;
  list-style: none;
}
details.rep-advanced > summary::-webkit-details-marker { display: none; }
details.rep-advanced > summary::before {
  content: "▸ ";
  font-size: 0.7rem;
}
details.rep-advanced[open] > summary::before { content: "▾ "; }
details.rep-advanced > summary:hover { color: var(--text); }
details.rep-advanced > .row { padding: 0 0.75rem 0.7rem; }

/* --------------------------------------------------------------- print */
@media print {
  .dir-tools,
  details.rep-advanced,
  #rep-controls .tabs,
  #rep-controls .row { display: none !important; }

  body.dir-active .dir-kpi-val { color: #000; }

  .dir-card { break-inside: avoid; page-break-inside: avoid; }
  .dir-table th { position: static; }
  .dir-bar { display: none; }
  .dir-sub-row { display: none; }
}
