:root {
  --ink: #24311e;
  --muted: #626d59;
  --line: #dfe6d7;
  --green: #3c5e23;
  --lime: #93d63c;
  --soft: #f0f6e8;
  --amber: #86551a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: #f5f7f1;
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

aside {
  width: 268px;
  flex: 0 0 268px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px;
  background: white;
  border-right: 1px solid var(--line);
}

aside nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

aside nav a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

aside nav a span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

aside nav a:hover { background: var(--soft); }

aside nav a[aria-current="page"] {
  background: var(--ink);
  color: white;
}

aside nav a[aria-current="page"] span { color: #d7e3cc; }

.aside-foot {
  margin-top: auto;
  padding: 4px 8px 0;
  font-size: 12px;
  color: var(--muted);
}

.aside-foot form { margin: 12px 0 0; }

.aside-foot .who { margin-top: 10px; }

button, a, input, select { touch-action: manipulation; }

button, .button {
  border: 1px solid #7cbb4a;
  border-radius: 8px;
  background: var(--lime);
  color: #213016;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .button:hover { filter: brightness(0.93); }

button.sec {
  color: var(--ink);
  background: white;
  border-color: var(--line);
}

a { color: var(--green); }

:focus-visible {
  outline: 3px solid #db9e3c;
  outline-offset: 3px;
}

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -1px;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
}

.shell {
  flex: 1;
  min-width: 0;
  max-width: 1380px;
  padding: 28px 32px 50px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 8px;
  color: inherit;
  text-decoration: none;
}

.topline { margin-bottom: 24px; }

body.gate { display: block; }

body.gate .shell { margin: auto; }

body.gate .brand {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 0;
}

.brand img {
  display: block;
  width: 174px;
  height: auto;
}

.version, .badge {
  font-size: 11px;
  font-weight: 650;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--green);
  white-space: nowrap;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.hero p { margin-top: 10px; max-width: 680px; color: var(--muted); }

.eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 3px 14px #163e2504;
  margin-bottom: 24px;
}

.scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.score {
  padding: 16px;
  background: var(--soft);
  border-radius: 9px;
}

.score-title { font-size: 12px; font-weight: 600; }

.score-value {
  font-size: 36px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.score-before { font-size: 12px; color: var(--muted); }

.notice {
  border-radius: 8px;
  background: #fff5e6;
  color: var(--amber);
  padding: 12px;
  font-size: 13px;
  margin: 0 0 16px;
}

.bars { display: flex; flex-direction: column; gap: 10px; }

.bar {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  gap: 12px;
  align-items: center;
}

.bar-label { font-size: 14px; }

.bar-track {
  height: 10px;
  background: #e2eae3;
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--green);
  min-width: 2px;
}

.bar-value {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  min-width: 5.5rem;
  text-align: right;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 320px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chart-col {
  flex: 1 0 36px;
  min-width: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}

.chart.months .chart-col { flex-basis: 18px; min-width: 16px; }

.chart-total {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
}

.chart-plot {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.chart-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 0;
}

.seg { display: block; width: 100%; min-height: 1px; }

.chart-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.chart.months .chart-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 3.2rem;
  font-size: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  font-size: 12px;
}

.legend li { display: flex; align-items: center; gap: 6px; }

.legend span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.project-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.project-search label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-search input[type="search"] {
  flex: 1 1 240px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
}

.filter-row { display: flex; align-items: center; gap: 10px; }

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.segment { display: flex; }

.segment button,
.chips button {
  background: white;
  color: var(--ink);
  border-color: var(--line);
  border-radius: 0;
  padding: 6px 12px;
  font-size: 13px;
}

.segment button:hover,
.chips button:hover { filter: none; background: var(--soft); }

.segment button[aria-pressed="true"],
.chips button[aria-pressed="true"] {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.segment button:first-child { border-radius: 8px 0 0 8px; }

.segment button:last-child { border-radius: 0 8px 8px 0; }

.segment button + button { margin-left: -1px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chips button { border-radius: 999px; }

.filters .choice { min-width: 220px; }

.filters .choice-menu {
  max-height: 420px;
  max-width: 360px;
  padding: 8px 10px;
}

.filters .choice-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  white-space: nowrap;
}

.menu-group {
  margin: 10px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chart-empty { margin: 12px 0; color: var(--muted); }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 9px 5px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

th { font-weight: 600; color: var(--muted); vertical-align: bottom; }

button.sort {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

button.sort::after {
  content: "↕";
  font-size: 11px;
  color: var(--green);
  text-decoration: none;
}

button.sort:hover { filter: none; color: var(--green); }

th[aria-sort="ascending"] button.sort::after { content: "↑"; }

th[aria-sort="descending"] button.sort::after { content: "↓"; }

.sort-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.col-filters th { padding-top: 4px; font-weight: 400; vertical-align: top; }

.col-filters input[type="search"],
.col-filters input[type="text"],
.choice summary {
  width: 100%;
  min-width: 4.5rem;
  border: 1px solid #adbfb5;
  border-radius: 6px;
  padding: 5px 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: white;
}

.range { display: flex; gap: 4px; }

.range input { width: 4.2rem; min-width: 0; }

.choice { position: relative; text-align: left; }

.choice summary {
  display: block;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.choice summary::-webkit-details-marker { display: none; }

.choice summary::after { content: " ▾"; color: var(--muted); font-weight: 600; }

.choice[open] summary::after { content: " ▴"; }

.choice.is-active summary,
.col-filters input.is-active {
  border-color: var(--green);
  background: var(--soft);
}

.choice-menu {
  position: absolute;
  z-index: 4;
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: 280px;
  margin-top: 4px;
  max-height: 220px;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 3px 14px #163e2504;
}

.choice-menu label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.choice-menu input { accent-color: var(--green); margin-top: 2px; }

.table-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.table-status { margin: 0; font-size: 12px; color: var(--muted); }

button.clear-filters {
  padding: 4px 8px;
  font-size: 12px;
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

tr.filter-empty td {
  text-align: center;
  color: var(--muted);
  padding: 16px 8px;
}

th:first-child, td:first-child { text-align: left; }

table.mixed th, table.mixed td { text-align: left; }

table.mixed th.right, table.mixed td.right { text-align: right; }

td a { font-weight: 650; }

.caption, .prose { color: var(--muted); }

.caption { font-size: 12px; margin: 12px 0 0; }

.card h2 { margin-bottom: 4px; }

@media (max-width: 800px) {
  body { display: block; }
  aside {
    position: sticky;
    top: 0;
    z-index: 2;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 14px;
    padding: 16px 14px 12px;
  }
  aside nav {
    flex-direction: row;
    overflow-x: auto;
  }
  aside nav a { flex: 0 0 auto; min-width: 140px; }
  .aside-foot p:first-child { display: none; }
  .shell { padding: 20px 14px 40px; }
  .hero { display: block; }
  .card { padding: 18px; }
  .score-value { font-size: 30px; }
  .bar { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; }
}

/* Operational management overview. */
.overview-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding: 18px 0; border-top: 1px solid var(--line); }
.overview-filters label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
.overview-filters select { max-width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; font: inherit; background: white; color: var(--ink); }
.week-navigation { display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto; align-self: center; font-size: 12px; }
.overview-period { margin: 0 0 20px; font-size: 13px; font-weight: 650; }
.overview-period span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.overview-scores .score { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.overview-scores .score:hover { border-color: var(--green); background: var(--soft); }
.overview-scores .score-value { margin: 4px 0; }
.overview-section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.overview-attention { margin: 30px 0; }
.overview-attention > .caption { margin: 8px 0 16px; max-width: 850px; }
.signal { border-bottom: 1px solid var(--line); background: white; }
.signal:first-of-type { border-top: 1px solid var(--line); }
.signal summary { display: flex; gap: 18px; align-items: center; padding: 17px 18px; cursor: pointer; }
.signal summary:hover { background: var(--soft); }
.signal-number { display: grid; place-items: center; min-width: 42px; height: 42px; background: var(--soft); color: var(--green); font-size: 21px; font-weight: 700; border-radius: 8px; }
.signal[data-empty] .signal-number { background: transparent; color: var(--muted); }
.signal small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.signal-action { margin-left: auto; font-size: 12px; color: var(--green); white-space: nowrap; }
.signal-content { padding: 0 18px 18px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.overview .card { box-shadow: none; }
.overview .eyebrow { margin-bottom: 5px; }
.overview .caption { margin-bottom: 12px; }
.week-days { margin-top: 18px; }
.planning-day summary { display: grid; grid-template-columns: 48px minmax(60px, 1fr) 30px; align-items: center; gap: 16px; padding: 9px 0; cursor: pointer; }
.day-label { font-size: 13px; font-weight: 650; }
.day-label small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.day-track { height: 18px; background: var(--soft); border-radius: 3px; }
.day-track > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.day-content { padding-bottom: 15px; }
.overview-bars { display: flex; flex-direction: column; gap: 13px; margin: 24px 0; }
.overview-bar { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(60px, 1.2fr) 32px; align-items: center; gap: 12px; font-size: 13px; }
.overview-track { height: 8px; background: var(--soft); border-radius: 3px; }
.overview-track > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.overview-bar strong, .planning-day strong { text-align: right; font-variant-numeric: tabular-nums; }
.phase-list { margin: 18px 0; }
.phase-list details { border-bottom: 1px solid var(--line); }
.phase-list summary { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.phase-list details > p { margin-bottom: 12px; }
.long-total { color: var(--muted); margin: 14px 0; }
.long-total strong { color: var(--ink); font-size: 28px; margin-right: 6px; }
.overview-empty { margin-top: 20px; }
.overview-lists summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; }
.overview details > summary { list-style: none; }
.overview details > summary::-webkit-details-marker { display: none; }
.overview details > summary::after { content: "+"; color: var(--green); margin-left: 8px; }
.overview details[open] > summary::after { content: "−"; }
.planning-day summary::after { display: none; }
@media (max-width: 1050px) { .overview-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }
@media (max-width: 600px) {
  .overview-filters > div { width: 100%; }
  .overview-filters select { width: 100%; }
  .week-navigation { margin-left: 0; }
  .overview-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal summary { gap: 10px; padding: 14px 10px; }
  .signal-action { display: none; }
  .signal-number { min-width: 34px; height: 34px; }
  .signal-content { padding: 0 10px 14px; }
  .overview-bar { grid-template-columns: minmax(90px, 1fr) minmax(45px, 1fr) 28px; }
}

.overview-scores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.long-review, .other-products { margin: 16px 0; border-top: 1px solid var(--line); padding-top: 12px; }
.long-review summary, .other-products summary { cursor: pointer; font-size: 13px; font-weight: 600; }
@media (max-width: 1200px) { .overview-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
