/* EVBro — Trip and charge history: compact rows that unfold, month separators and «Ver más» (features/history-list.js). */

.hist-list { display: flex; flex-direction: column; gap: 0.45rem; }

.hist-empty { padding: 1rem 0.25rem; color: var(--text-muted); font-size: 0.9rem; text-align: center; }
.hist-empty.is-error { color: var(--accent-red); }

.hist-month {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 0.75rem;
  margin: 0.85rem 0.15rem 0.15rem;
  font-size: 0.8rem; color: var(--text-muted);
}
.hist-month:first-child { margin-top: 0; }
.hist-month strong { font-size: 0.85rem; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.4px; }

.hist-row {
  background: var(--surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.hist-row[open] { background: var(--surface); }

.hist-row > summary {
  list-style: none;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "when big chev" "place small chev";
  align-items: center; column-gap: 0.6rem; row-gap: 0.1rem;
  min-height: 44px; padding: 0.6rem 0.75rem;
  cursor: pointer;
}
.hist-row > summary::-webkit-details-marker { display: none; }
.hist-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.hist-when { grid-area: when; min-width: 0; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-place { grid-area: place; min-width: 0; font-size: 0.9rem; color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-big { grid-area: big; justify-self: end; font-size: 0.95rem; color: var(--text-primary); white-space: nowrap; }
.hist-small { grid-area: small; justify-self: end; font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.hist-big.is-added { color: var(--accent-green); }
.hist-small.is-used { color: var(--accent-amber); }

.hist-chevron {
  grid-area: chev;
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform 0.15s ease; margin: 0 0.15rem 0.2rem;
}
.hist-row[open] .hist-chevron { transform: rotate(-135deg); margin-bottom: -0.2rem; }

.hist-detail { padding: 0 0.75rem 0.75rem; border-top: 1px solid var(--border-color); }
.hist-route { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.hist-route b { color: var(--text-primary); font-weight: 600; }

.hist-facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.55rem 0.9rem;
  margin: 0.65rem 0 0;
}
.hist-facts dt { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.hist-facts dd { margin: 0.1rem 0 0; font-size: 0.9rem; color: var(--text-primary); font-weight: 600; }

.hist-note { margin: 0.6rem 0 0; font-size: 0.78rem; color: var(--text-muted); }

.hist-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.hist-actions button { min-height: 44px; }
.hist-actions .is-danger { color: var(--accent-red); }

.hist-more { display: block; width: 100%; min-height: 44px; margin-top: 0.75rem; }
.hist-more[hidden] { display: none; }

/* Small tag in front of a row's place: AC / DC of a charge */
.hist-tag { display: inline-block; vertical-align: middle; margin-right: 6px; padding: 0 6px; border-radius: 6px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1.5; }
.hist-tag.is-ac { color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border-color); }
.hist-tag.is-dc { color: #fff; background: var(--accent-amber); }
