/* --- equipamento: resumo -------------------------------------------------------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5);
}
.summary-grid .panel + .panel {
  margin-top: 0;
}
/* v5.18.0 (P04): «A tratar nesta máquina», a toda a largura, no topo do Resumo */
.summary-grid > .machine-work {
  grid-column: 1 / -1;
}
/* o selo dos discos críticos no separador Saúde */
.tabs .tab-alert {
  margin-left: var(--s-2);
  padding: 0 var(--s-2);
  font-size: var(--fs-1);
  vertical-align: 1px;
}
.stat-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}
.stat-strip > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-5) var(--s-5);
  border-left: 1px solid var(--line);
  min-width: 0;
}
.stat-strip > div:first-child {
  border-left: 0;
}
/* v5.17.0 (P02): só o rótulo de cada número; os selos dentro do <small> ficam com a sua cor. */
.stat-strip > div > span {
  color: var(--muted);
  font-size: var(--fs-1);
}
.stat-strip b {
  font-size: var(--fs-5);
}
.stat-strip small {
  color: var(--faint);
}
.spec-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--s-5);
  margin: 0;
}
.spec-sheet.one {
  grid-template-columns: 1fr;
}
/* v5.22.0: no formulário do equipamento, o hardware que vem dos componentes (só leitura). */
.spec-sheet.form-spec {
  margin-bottom: var(--s-4);
}
.spec-sheet > div {
  padding: var(--s-3) 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.spec-sheet dt {
  color: var(--faint);
  font-size: var(--fs-1);
}
.spec-sheet dd {
  margin: 1px 0 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.notes-panel {
  grid-column: 1 / -1;
}
.equipment-notes,
.maintenance-notes {
  white-space: pre-wrap;
  color: var(--ink);
}
.maintenance-notes {
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-4);
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--r-2) var(--r-2) 0;
}
.maintenance-notes .kicker {
  margin-bottom: var(--s-1);
}

/* --- componentes ---------------------------------------------------------------- */
.bay + .bay {
  margin-top: var(--s-5);
}
.bay h3,
.bay summary h3 {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  font-size: var(--fs-1);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.retired-group summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--s-3);
  cursor: pointer;
  list-style: none;
}
.retired-group summary::-webkit-details-marker {
  display: none;
}
.retired-group summary h3 {
  margin: 0;
}
/* v2.2: ecrã «Desativar equipamento» */
.deact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.deact-row:last-child {
  border-bottom: 0;
}
.deact-row .comp-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.deact-act {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.comp-list {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}
.comp-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(90px, 0.9fr) minmax(110px, 1fr) minmax(140px, 1.1fr) auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-4);
  border-top: 1px solid var(--line);
}
.comp-row:first-child {
  border-top: 0;
}
.comp-row.retired {
  opacity: 0.62;
}
.comp-row > div {
  min-width: 0;
}
.comp-name,
.comp-spec {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.comp-name small,
.comp-spec small {
  color: var(--muted);
}
.comp-name .tag {
  margin-top: 3px;
}
.comp-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.comp-act {
  display: flex;
  gap: var(--s-2);
}
.clip {
  min-height: var(--h-2);
  padding: var(--s-1) var(--s-3);
  gap: var(--s-1);
  border-color: transparent;
  background: none;
  color: var(--muted);
  font-size: var(--fs-1);
}
.clip:hover {
  color: var(--ink);
}
.clip span {
  font-weight: 750;
  color: var(--accent);
}
.comp-act .icon-btn {
  width: var(--h-2);
  min-height: var(--h-2);
}

/* --- v5.3.0 (fase 25): o que esta máquina relata ------------------------------------ */
.relatos-panel {
  grid-column: 1 / -1;
}
.relatos {
  list-style: none;
  margin: 0;
  padding: 0;
}
.relato {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 120px 120px auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--line);
}
.relato-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  color: var(--muted);
}
.relato-ico svg {
  width: 16px;
  height: 16px;
}
.relato-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.relato-main b,
.relato-main small {
  overflow-wrap: anywhere;
}
.relato-when code {
  font-size: var(--fs-1);
}
/* v5.11.0: o estado da próxima preventiva no Resumo e os campos de hardware por preencher */
.stat-strip small .pill {
  margin-left: var(--s-3);
  vertical-align: 1px;
}
.spec-empty {
  margin: 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-2);
}
.spec-empty + .spec-empty {
  padding-top: var(--s-1);
  border-top: 0;
}
/* v5.12.0: a ficha de um armazém (ícone de caixa e o que está guardado) */
.eq-avatar.store .ico {
  width: 22px;
  height: 22px;
}
.store-contents h3.kicker {
  margin: var(--s-1) 0 2px;
}
.store-contents h3.kicker ~ h3.kicker {
  margin-top: var(--s-4);
}
.store-pieces {
  display: grid;
}
.store-piece {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--line);
}
.store-pieces .store-piece:first-child {
  border-top: 0;
}
.store-piece-act {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex: none;
}

/* --- v6.7.0 (proposta 4.1): a linha do tempo ------------------------------------------- */
.timeline-year {
  margin: var(--s-4) 0 var(--s-2);
  font-size: var(--fs-2);
  color: var(--muted);
}
.timeline-year:first-child {
  margin-top: 0;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 96px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--line);
}
.timeline-when code {
  font-size: var(--fs-1);
}
.timeline-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  color: var(--muted);
}
.timeline-ico svg {
  width: 16px;
  height: 16px;
}
.timeline-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .timeline-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    row-gap: var(--s-1);
  }
  .timeline-ico {
    grid-row: 1 / span 2;
    align-self: start;
  }
  .timeline-main {
    grid-column: 2 / -1;
  }
  .timeline-when {
    grid-column: 2;
    grid-row: 2;
  }
  .timeline-go {
    grid-column: 3;
    grid-row: 2;
  }
}
