/* costs.css — the cost report page only.
 *
 * Loaded after style.css and adds nothing to it: sidebar, panels, rows and the
 * .bom rows are the map tool's, so the summary here looks exactly like the one
 * that used to sit in the map's sidebar. The figure strip uses the same class
 * names as the cable catalogue and the power visualiser, so the pages read as
 * one tool.
 */

#cost-stage {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  gap: 10px; padding: 10px; overflow: auto;
}
#cost-stage a { color: var(--accent); text-decoration: none; }
#cost-stage a:hover { text-decoration: underline; }
#side .hint a { color: var(--accent); }

#figs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; flex: 0 0 auto; }
.fig {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 11px 9px; min-width: 0;
}
.fig .lbl {
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-dim);
}
.fig .val {
  font-size: 21px; font-weight: 700; line-height: 1.15; margin-top: 2px;
  font-variant-numeric: tabular-nums; color: var(--accent);
}
.fig .sub {
  font-size: 10.5px; color: var(--ink-dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fig.warn { border-color: #6b5a24; }
.fig.warn .val { color: #ffd166; }

#body { display: flex; flex-direction: column; gap: 10px; }
#body[hidden] { display: none; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 14px 12px; min-width: 0;
}
.card h3 {
  margin: 0 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-dim);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card .bom { margin-top: 0; }

/* ---------- issues ---------- */

.igrp { margin-bottom: 12px; }
.igrp:last-child { margin-bottom: 0; }
.igrp .ih { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.igrp .ih .n {
  background: #3a3220; color: #ffd166; border-radius: 9px; padding: 0 7px;
  font-size: 11px; font-weight: 600;
}
.igrp.noTrench .ih .n, .igrp.none .ih .n { background: var(--panel-2); color: var(--ink-dim); }
.igrp.failed .ih .n { background: #3a2226; color: #ff6b6b; }
.iss .why2 { display: block; color: var(--ink-dim); font-size: 10.5px; white-space: normal; }
.iss .size { color: var(--accent); font-size: 11px; white-space: nowrap; }
.igrp .ih .m { margin-left: auto; color: var(--ink-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.igrp .why { color: var(--ink-dim); font-size: 11px; margin: 1px 0 4px; }

#cost-stage .iss {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 6px; margin: 0 -6px;
  border-radius: 4px; color: var(--ink); font-size: 12px;
}
#cost-stage .iss:hover { background: var(--panel-2); text-decoration: none; }
.iss .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iss .m { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: 11px; }
.iss .go { color: var(--accent); opacity: .5; }
.iss:hover .go { opacity: 1; }

.allgood {
  color: #9fe8cd; font-size: 12px; border-left: 2px solid #4be0a8;
  padding: 6px 10px; background: #141821; border-radius: 4px;
}

/* ---------- filter chips ---------- */

.chips { display: inline-flex; gap: 4px; margin-left: auto; letter-spacing: 0; text-transform: none; }
.chips button {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
  color: var(--ink-dim); font: inherit; font-size: 11px; font-weight: 500;
  padding: 2px 10px; cursor: pointer;
}
.chips button:hover { color: var(--ink); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- tables ---------- */

.tbl { overflow-x: auto; }
table.runs {
  width: 100%; border-collapse: collapse;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
table.runs th {
  text-align: right; padding: 6px 8px; white-space: nowrap;
  font-size: 9.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-dim);
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
#trenches table.runs th { cursor: default; }
table.runs th:hover { color: var(--ink); }
table.runs th.on { color: var(--accent); }
table.runs td {
  padding: 4px 8px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid #21262f;
}
table.runs th.l, table.runs td.l { text-align: left; }
table.runs tr[data-href] { cursor: pointer; }
table.runs tr[data-href]:hover td { background: #171b23; }
table.runs td.bad { color: #ffd166; }
table.runs .dim, table.runs td.dim { color: var(--ink-dim); }
table.runs td.nothing { text-align: center; color: var(--ink-dim); padding: 14px; }

#temps .b.unused .nm, #temps .b.unused .e { color: var(--ink-dim); font-weight: 400; }

.empty {
  padding: 40px 12px; text-align: center; color: var(--ink-dim); font-size: 13px;
}

@media (max-width: 1100px) {
  #figs { grid-template-columns: repeat(3, 1fr); }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  #side { height: auto; max-height: 44%; }
  #figs { grid-template-columns: repeat(2, 1fr); }
  .chips { margin-left: 0; }
}
