/* =============================================================================
   Matrícula V3 · Web — Historial (movimientos + alertas)
   ============================================================================= */

.hist-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.hist-head { padding: 22px 28px 0; flex: 0 0 auto; }
.hist-head h2 { font-size: 24px; margin: 0 0 4px; }
.hist-head p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; max-width: 720px; }

.hist-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hist-search {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 13px; min-width: 240px;
}
.hist-filters { display: flex; gap: 6px; }
.hist-chip {
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--panel); color: var(--ink-soft); border: 1.5px solid var(--line);
  padding: 7px 13px; border-radius: 16px; transition: background .12s, color .12s, border-color .12s;
}
.hist-chip:hover { color: var(--ink); }
.hist-chip.active { background: var(--titlebar); color: var(--yellow); border-color: var(--titlebar); }
.hist-count { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }

/* Lista */
.hist-list-wrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hist-list { flex: 1; overflow-y: auto; padding: 0 28px 40px; }
.hist-day {
  position: sticky; top: 0; z-index: 1; background: var(--panel-2);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); padding: 10px 4px 6px; border-bottom: 1px solid var(--line-soft);
}

.hist-row {
  display: grid; grid-template-columns: 78px 92px 1fr 1.1fr auto; align-items: center; gap: 12px;
  padding: 10px 8px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .1s;
}
.hist-row:hover { background: var(--panel); }
.hist-row.is-unread { cursor: default; }
.hist-row.open { background: var(--panel); }
.hist-time { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.hist-kind {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; text-align: center;
}
.hist-kind.checkpoint { background: #e4eef6; color: #2c5778; }
.hist-kind.access { background: #e6f0e3; color: #356b2f; }
.hist-plate { font-family: var(--mono); font-size: 17px; font-weight: 800; letter-spacing: 1px; color: var(--ink); }
.hist-plate.unread { font-size: 13px; font-weight: 700; letter-spacing: .5px; color: var(--ink-soft); }
.hist-lane { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; min-width: 0; }
.hist-dir { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 4px; flex: 0 0 auto; }
.hist-dir.entra { background: #e6f0e3; color: #356b2f; }
.hist-dir.sale { background: #f6e7e4; color: #9a3b2c; }
.hist-badges { display: flex; gap: 6px; justify-content: flex-end; }
.hist-alert { color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 12px; white-space: nowrap; }

/* Timeline desplegado de una matrícula */
.hist-detail { background: var(--panel); border-left: 3px solid var(--yellow); margin: 0 0 4px; padding: 8px 14px 12px; }
.hist-detail-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 6px 0; }
.hist-detail-row { display: grid; grid-template-columns: 130px 92px 1fr auto; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }

/* Pill "↑ nuevos" (reaprovecha estilo del de alertas) */
.hist-new-pill {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: var(--titlebar); color: var(--yellow); border: none;
  padding: 7px 18px; border-radius: 20px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.28); letter-spacing: .3px;
}
.hist-new-pill:hover { background: #000; }

.hist-empty { text-align: center; color: var(--ink-soft); padding: 48px 24px; }
.hist-empty .big { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

@media (max-width: 760px) {
  .hist-row { grid-template-columns: 64px 1fr auto; }
  .hist-row .hist-kind { display: none; }
  .hist-list { padding: 0 14px 30px; }
}

/* Foto de la matrícula desplegada (traída bajo demanda por el addon) */
.hist-photos { display: flex; gap: 10px; padding: 6px 0 12px; flex-wrap: wrap; }
.hist-photo {
  height: 150px; max-width: 100%; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: #000; cursor: zoom-in; transition: transform .12s;
}
.hist-photo:hover { transform: scale(1.02); }
.hist-photo-load { padding: 12px 0; color: var(--ink-soft); font-size: 13px; font-style: normal; }
