/* Historic reports fit the viewport; tables scroll only inside their panel. */
.access-history-panel{min-width:0;margin:24px 0;overflow:hidden}
.history-title{align-items:flex-start;gap:20px;flex-wrap:wrap}
.history-title h2{margin:4px 0 8px}.history-title p{margin:0;max-width:64ch}
.history-title>.btn{white-space:normal;max-width:100%;flex-shrink:0}
.access-history-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:14px;align-items:end;margin:24px 0 14px}
.access-history-filters .field{min-width:0;margin:0}.access-history-filters input,.access-history-filters select{width:100%;min-width:0;max-width:100%}
.access-history-filters label{font-size:.78rem}.history-filter-error{grid-column:1/-1;margin:0}
.guard-access-history .access-history-filters{grid-template-columns:repeat(3,minmax(0,1fr)) auto}
.history-export-note{line-height:1.6}.history-update-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:12px 0 18px;color:var(--muted);font-size:.76rem}
.history-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:16px 0 22px;border-top:1px solid var(--line)}
.history-counts>div{background:var(--paper,#f8f9fb);padding:16px;border-radius:12px;min-width:0}.history-counts span{font-size:.73rem;color:var(--muted);display:block}.history-counts strong{font-size:1.7rem;color:var(--ink);display:block;margin-top:8px;overflow-wrap:anywhere}
.history-figure{margin:0 0 16px;min-width:0}.history-chart{display:block;width:100%;height:auto;overflow:visible;min-width:0;font-family:inherit;font-size:11px}
.history-grid line{stroke:var(--line);stroke-width:1}.history-grid text,.history-x-label{fill:var(--muted)}
.history-line{fill:none;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}.history-entry-line{stroke:#147253}.history-exit-line{stroke:#ad7d24;stroke-dasharray:6 3}
.history-chart-point .history-hit{fill:transparent}.history-chart-point{outline:none;cursor:crosshair}.history-chart-point circle{opacity:0;stroke:#fff;stroke-width:1.5}.history-entry-point{fill:#147253}.history-exit-point{fill:#ad7d24}
.history-chart-point.selected .history-hit,.history-chart-point:hover .history-hit{fill:rgba(23,47,74,.06)}.history-chart-point.selected circle,.history-chart-point:focus circle{opacity:1}.history-chart-point:focus-visible .history-hit{stroke:var(--navy,#172f4a);stroke-width:1;fill:rgba(23,47,74,.09)}
.history-legend{display:flex;gap:22px;font-size:.78rem;padding:8px 0 12px}.history-legend>span{display:flex;align-items:center;gap:8px}.history-legend i{display:inline-block;width:22px;height:3px}.history-entry-key{background:#147253}.history-exit-key{background:repeating-linear-gradient(90deg,#ad7d24 0 6px,transparent 6px 9px)}
.history-selected-day{padding:12px;background:var(--paper,#f8f9fb);border-radius:8px;font-size:.82rem;min-height:42px;color:var(--ink);overflow-wrap:anywhere}
.history-daily{margin:18px 0 24px}.history-daily summary{cursor:pointer;font-size:.82rem;color:var(--navy,#172f4a);padding:8px 0}.history-daily .history-table-scroll{max-height:280px;border:1px solid var(--line);border-radius:8px;margin-top:8px}.history-daily table{min-width:320px}.history-daily th{text-align:left}
.history-table-scroll{overflow:auto;max-width:100%;min-width:0;overscroll-behavior:contain}.history-event-table{width:100%;min-width:620px}.history-event-table td{vertical-align:top;max-width:240px;overflow-wrap:anywhere}.history-event-table td>small{display:block;margin-top:5px}.history-event-table .pill{white-space:normal}
.history-movements-heading{margin-top:22px;gap:16px}.history-movements-heading h3{margin:0}.history-pagination{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:18px}.history-pagination span{font-size:.78rem;color:var(--muted)}
@media(max-width:1100px){.access-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.access-history-filters>.btn{justify-self:start}.guard-access-history .access-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:660px){.access-history-panel{margin:18px 0;padding:18px 16px}.history-title>.btn{width:100%;justify-content:center}.access-history-filters,.guard-access-history .access-history-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px}.access-history-filters>.btn{grid-column:1/-1;width:100%}.guard-access-history #access-history-filters>.field:first-child{grid-column:1/-1}.history-counts{gap:7px;padding-bottom:16px}.history-counts>div{padding:12px 9px}.history-counts strong{font-size:1.35rem}.history-counts span{font-size:.68rem;line-height:1.5}.history-update-row{font-size:.68rem;gap:8px}.history-update-row .btn{flex-shrink:0}.history-movements-heading{flex-wrap:wrap;gap:6px}.history-event-table{min-width:0;display:block}.history-event-table thead{display:none}.history-event-table tbody{display:block}.history-event-table tr{display:block;padding:16px 0;border-bottom:1px solid var(--line)}.history-event-table td{display:grid;grid-template-columns:90px minmax(0,1fr);border:0;padding:5px 0;max-width:none;width:auto;overflow-wrap:anywhere;font-size:.79rem}.history-event-table td::before{content:attr(data-label);font-size:.68rem;color:var(--muted);padding-top:2px}.history-event-table td>small{grid-column:2}.history-event-table td[data-label="Fecha y hora"]>br{display:none}.history-event-table td[data-label="Fecha y hora"]>.muted{grid-column:2}.history-event-table td .pill{justify-self:start}.history-event-table .event-direction{gap:6px}.history-pagination{justify-content:space-between;gap:8px}.history-pagination .btn{min-width:0}.history-daily table{min-width:0}.history-chart{font-size:12px}.history-selected-day{font-size:.75rem}.guard-mobile-nav[aria-label="Navegación de vigilancia"]{grid-template-columns:repeat(4,minmax(0,1fr))!important}.guard-mobile-nav>button{min-width:0;font-size:.64rem}}
@media(prefers-reduced-motion:reduce){.history-chart *{transition:none!important}}
