/* CCTV data screens: Entry/Exit log (cl-), Person search (cs-), Footfall analytics (ca-) */

/* ── shared filter bar ─────────────────────────────────────────── */
.cl-filter-row, .cs-filter-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.cl-f, .cs-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cl-f > span, .cs-f > span { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.cl-f .select, .cs-f .select { min-width: 170px; }
.cl-custom .input, .cs-f .input[type='datetime-local'] { height: 32px; font-size: 13px; }
.cl-custom[hidden] { display: none; }
[data-theme='dark'] .cl-custom .input, [data-theme='dark'] .cs-f .input { color-scheme: dark; }

/* ── Entry / Exit log ─────────────────────────────────────────── */
.cl-snap { display: inline-flex; }
.cl-snap .avatar { width: 34px; height: 34px; }
.cl-person { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--border-strong); }
.cl-person:hover, .cl-person:focus-visible { color: var(--brand); border-bottom-color: var(--brand); }
.cl-conf { font-variant-numeric: tabular-nums; }
.cl-conf.low { color: var(--warning); font-weight: 600; }
.cl-conf.low::after { content: ' low'; font-size: var(--fs-xs); font-weight: 500; }
.cl-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--success); padding: 0 8px; height: 24px; border-radius: 99px; background: color-mix(in srgb, var(--success) 10%, transparent); }
.cl-live.paused { color: var(--text-3); background: var(--surface-2); }
.cl-live.paused .dot { animation: none; background: var(--text-3); }
.cl-window { font-variant-numeric: tabular-nums; }
.cl-filters .card-b { padding-top: 14px; padding-bottom: 14px; }

/* ── Person search ────────────────────────────────────────────── */
.cs-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.cs-picker { position: sticky; top: 12px; }
.cs-tabs { padding: 0 12px; border-bottom: 1px solid var(--border); }
.cs-tabs .tabs { border-bottom: 0; margin: 0; }
.cs-pane { padding: 12px; gap: 10px; }
.cs-list { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 330px); min-height: 220px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.cs-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.cs-person:hover { background: var(--surface-2); }
.cs-person.active { background: var(--brand-50); border-color: var(--brand-100); }
.cs-person-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cs-person-t b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-person-t .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-person .badge { flex: none; }
.cs-more { text-align: center; padding: 10px; }
.cs-snaps { max-height: calc(100vh - 330px); overflow: auto; }
.cs-snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.cs-snap { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: inherit; cursor: pointer; font: inherit; }
.cs-snap:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cs-snap.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100); }
.cs-snap-t { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cs-snap-b { font-size: 10.5px; color: var(--text-3); }
.cs-dpdp { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: var(--fs-xs); color: var(--text-3); }
.cs-dpdp .ico { flex: none; margin-top: 1px; color: var(--brand); }
.cs-dpdp b { color: var(--text-2); }

.cs-id-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cs-id-t { flex: 1; min-width: 200px; }
.cs-id-t h2 { font-size: 18px; margin: 0; }
.cs-id-win { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cs-flag { margin-top: 12px; }
.cs-summary { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cs-summary.none { color: var(--text-2); }
.cs-sep { color: var(--text-3); }
.cs-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: stretch; }
.cs-tabs .tab { font-size: 13px; padding-left: 8px; padding-right: 8px; }
.cs-types { margin-top: 10px; }
.cs-lane { height: 230px; }

.cs-day { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 650; color: var(--text-2); position: sticky; top: 0; z-index: 1; }
.cs-ev { display: grid; grid-template-columns: 26px 110px minmax(130px, 1.2fr) minmax(130px, 1.3fr) minmax(100px, 1fr) auto; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cs-ev:last-child { border-bottom: 0; }
.cs-ev:hover { background: var(--surface-2); }
.cs-ev > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-ev-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--slate-100); color: var(--slate-600); }
.cs-ev.g-move .cs-ev-ico { background: var(--brand-50); color: var(--brand); }
.cs-ev.g-face .cs-ev-ico { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.cs-ev.g-zone .cs-ev-ico { background: color-mix(in srgb, var(--c4) 12%, transparent); color: var(--c4); }
.cs-ev.g-restricted .cs-ev-ico { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
[data-theme='dark'] .cs-ev-ico { background: #1e2a26; color: var(--text-2); }
.cs-ev-cam .mono { font-size: 12px; }
.cs-events .cs-more { border-top: 1px solid var(--border); }

/* ── Footfall analytics ──────────────────────────────────────── */
.ca-note { align-items: center; }
.ca-peak { height: 270px; }
.ca-src { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ca-body .card .chart .col { padding: 6px 0; }

@media (max-width: 1100px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-picker { position: static; }
  .cs-list, .cs-snaps { max-height: 360px; }
  .cs-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cs-ev { grid-template-columns: 26px 1fr auto; }
  .cs-ev-cam, .cs-ev-zone { display: none !important; }
  .cs-id-win { align-items: flex-start; text-align: left; }
  .cl-f .select, .cs-f .select { min-width: 140px; }
}
