@font-face {
  font-family: Nunito;
  src: url("/assets/nunito.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #40384b;
  --muted: #887f96;
  --line: #e4dfed;
  --line-strong: #d4cae3;
  --canvas: #f7f5fb;
  --surface: #fff;
  --surface-soft: #f3f1f8;
  --navy: #4d4566;
  --navy-soft: #5c5277;
  --primary: #663399;
  --primary-dark: #51307d;
  --primary-soft: #eeebf7;
  --accent: #7569b3;
  --green: #51a480;
  --amber: #c98b43;
  --red: #c46170;
  --shadow: 0 12px 34px rgba(66, 45, 89, 0.075);
  --heading-font: Arial, "Segoe UI", ui-sans-serif, sans-serif;
  --mono:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  --sans:
    Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--canvas);
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 15px 17px;
  border-right: 1px solid var(--line);
  background: #fff;
  color: #554a62;
  overflow-y: auto;
}
.brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: -0.35px;
  color: #523c77;
}
.brand-title b,
.login-brand b {
  color: #000;
  font-weight: 700;
}
.brand-logo-slot {
  width: 80px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand:has(.brand-logo-slot:not([hidden])) .brand-title,
.login-brand:has(.brand-logo-slot:not([hidden])) > span:last-child {
  display: block;
  color: #000;
}
.login-brand > span:last-child b {
  display: block;
}
.workspace-label {
  margin: 39px 11px 12px;
  color: #9a8bac;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.15px;
}
.nav-list {
  display: grid;
  gap: 3px;
}
.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  padding: 11px 12px;
  background: transparent;
  color: #73677f;
  text-align: left;
  font-family: var(--heading-font);
  font-weight: 700;
  transition:
    color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.nav-link:hover {
  background: #f3f0f8;
  color: #563e80;
}
.nav-link.is-active {
  background: #7569b3;
  color: #fff;
  box-shadow: 0 6px 15px rgba(26, 16, 58, 0.18);
}

.nav-badge {
  min-width: 18px;
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 10px;
  background: #eee9f7;
  color: #5d4386;
  font: 900 10px/1.4 var(--mono);
  text-align: center;
}
.nav-link.is-active .nav-badge {
  background: rgba(255, 255, 255, 0.23);
  color: #fff;
}
.nav-icon,
.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}
.nav-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}
.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 9px;
  color: #81758e;
  font-size: 12px;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(201, 139, 67, 0.14);
}
.status-dot.is-online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(81, 164, 128, 0.14);
}
.status-dot.is-offline {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(196, 97, 112, 0.14);
}
.status-dot.is-muted {
  background: #aaa2ba;
  box-shadow: none;
}
.account-row {
  display: grid;
  grid-template-columns: 31px 1fr 30px;
  gap: 8px;
  align-items: center;
  padding: 12px 7px 0;
  border-top: 1px solid #e8e3ef;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ece8f5;
  color: #663399;
  font-size: 12px;
  font-weight: 800;
}
.account-copy {
  min-width: 0;
  display: grid;
  line-height: 1.2;
}
.account-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #584b64;
  font-size: 12px;
}
.account-copy span {
  margin-top: 3px;
  overflow: hidden;
  color: #94899f;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-content {
  min-width: 0;
  padding: 0 36px 48px;
}
.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  min-width: 132px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.topbar .eyebrow {
  margin: 0;
}
.topbar .system-strip {
  min-width: 0;
  flex: 1 1 360px;
  margin: 0;
  padding: 6px 9px;
  border-radius: 6px;
}
.topbar .system-strip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar h1 {
  font-size: 20px;
}
.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 1.1px;
}
.topbar h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.45px;
}
.topbar h1 {
  font-size: 20px;
  line-height: 1.1;
}
.topbar-meta,
.toolbar-actions,
.filter-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar-meta {
  color: var(--muted);
  font-size: 12px;
}
.view {
  display: none;
  padding-top: 18px;
}
.view.is-active {
  display: block;
}
.mobile-menu {
  display: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 35px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
.button-primary {
  background: var(--primary);
  color: #fff;
}
.button-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(81, 48, 125, 0.22);
}
.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: #615775;
}
.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  border-color: #bcafcf;
  color: var(--primary);
  background: #faf9fd;
}
.button-quiet {
  border-color: transparent;
  background: transparent;
  color: #756b83;
}
.button-wide {
  width: 100%;
  min-height: 41px;
}
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}
.text-button:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.plus {
  font-size: 17px;
  font-weight: 400;
  line-height: 0.5;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
}
.icon-button:hover:not(:disabled) {
  background: rgba(81, 48, 125, 0.08);
}
.sidebar .icon-button:hover:not(:disabled) {
  background: #f2eff8;
}
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.global-message {
  margin-top: 17px;
  padding: 10px 13px;
  border: 1px solid #ecced4;
  border-radius: 8px;
  background: #fff7f8;
  color: #9e4d5a;
  font-size: 12px;
}
.global-message.is-info {
  border-color: #d6cfeb;
  background: #f5f2fb;
  color: #5b4d82;
}
.system-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 0;
  padding: 7px 10px;
  border: 1px solid #dfd9ee;
  border-radius: 8px;
  background: #fbfaff;
  color: #6e657b;
  font-size: 12px;
}
.system-strip.is-offline {
  border-color: #ecd5d9;
  background: #fff9fa;
  color: #97525d;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(58, 37, 83, 0.02);
}
.metric-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.metric-card strong {
  color: #463950;
  font-size: 30px;
  letter-spacing: -1px;
}
.metric-card small {
  color: #978e9f;
  font-size: 11px;
}
.metric-card.metric-primary {
  border-color: #d5cde9;
  background: linear-gradient(135deg, #fbfaff, #edeaf7);
}
.metric-card.metric-primary strong {
  color: var(--primary);
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(58, 37, 83, 0.015);
}
.panel-chart,
.panel-top {
  display: flex;
  flex-direction: column;
}
.panel-heading {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #f0edf5;
}
.panel h2,
.section-toolbar h2 {
  font-size: 18px;
  line-height: 1.25;
}
.quiet-label {
  color: #91869f;
  font: 11px var(--mono);
}
.hour-chart {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 7px;
  min-height: 190px;
  padding: 22px 18px 18px;
}
.hour-bar {
  min-width: 12px;
  flex: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}
.hour-bar i {
  display: block;
  width: 100%;
  min-height: 3px;
  max-width: 25px;
  border-radius: 3px 3px 1px 1px;
  background: #b7aed7;
}
.hour-bar.is-max i {
  background: var(--primary);
}
.hour-bar span {
  color: #91869f;
  font: 9px var(--mono);
}
.hour-bar b {
  position: static;
  min-height: 12px;
  color: #6c6078;
  font: 500 9px var(--mono);
}
.top-list {
  display: grid;
  align-content: start;
  gap: 0;
  margin: 0;
  padding: 5px 18px 13px;
  list-style: none;
  counter-reset: top;
}
.top-list li {
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  border-bottom: 1px solid #f1eef6;
  color: #5f566a;
  font-size: 12px;
}
.top-list li:last-child {
  border-bottom: 0;
}
.top-list li::before {
  counter-increment: top;
  content: counter(top, decimal-leading-zero);
  color: #a398ae;
  font: 10px var(--mono);
}
.top-list li.empty-mini {
  display: block;
  padding-top: 17px;
  border: 0;
}
.top-list li.empty-mini::before {
  content: none;
}
.top-list strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.top-list b {
  color: var(--primary);
  font: 12px var(--mono);
}
.recent-panel {
  margin-top: 14px;
}
.recent-events {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.recent-event {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px 17px;
  border-right: 1px solid #f0edf5;
}
.recent-event:last-child {
  border-right: 0;
}
.event-thumb {
  width: 74px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #efedf4;
  color: #8e849c;
  font-size: 10px;
}
.event-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-event > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.plate {
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 6px;
  border: 1px solid #d4cddd;
  border-radius: 4px;
  background: #fff;
  color: #463950;
  font: 700 14px/1.25 var(--mono);
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.recent-event span:not(.plate) {
  overflow: hidden;
  color: #776d83;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.recent-event time {
  color: #9c92a5;
  font-size: 10px;
}
.empty-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  text-align: center;
  color: #746a7f;
}
.empty-state.compact {
  grid-column: 1 / -1;
  min-height: 148px;
}
.empty-symbol {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 8px;
  border: 1px solid #cfc5df;
  border-radius: 50%;
  color: var(--accent);
  font-size: 16px;
}
.empty-state h3 {
  color: #54485f;
  font-size: 14px;
}
.empty-state p {
  max-width: 390px;
  margin: 5px 0 0;
  font-size: 12px;
}
.empty-action {
  margin-top: 13px;
}
.empty-mini {
  color: #988da2;
  font-size: 12px;
}
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.section-toolbar-compact {
  min-height: 0;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.monitor-panel {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.monitor-panel-heading {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0edf5;
}
.monitor-panel-heading h3 {
  color: #50435d;
  font-size: 16px;
}
.monitor-note {
  margin: 2px 0 0;
  color: #93899d;
  font-size: 10px;
  font-weight: 700;
}
.monitor-panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.monitor-state,
.monitor-frame-status {
  color: #887d94;
  font-size: 10px;
  font-weight: 800;
}
.monitor-retry {
  min-height: 29px;
  padding: 5px 8px;
}
.monitor-wall-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #ebe7f1;
}
.monitor-screen {
  min-width: 0;
  padding: 7px;
  background: #fff;
}
.monitor-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.monitor-screen-head > label {
  min-width: 0;
  overflow: hidden;
  color: #655a70;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monitor-screen-head > div {
  display: flex;
  align-items: center;
  gap: 3px;
}
.monitor-frame-status {
  max-width: 150px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monitor-fullscreen {
  width: 27px;
  height: 27px;
  color: #6a5c78;
}
.monitor-camera-select {
  height: 29px;
  margin-bottom: 5px;
  font-size: 11px;
}
.monitor-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
  background: #312b3a;
}
.monitor-frame > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* One reusable paint surface per screen; the RAF updates pixels, never media nodes. */
.vehicle-body-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.monitor-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: rgba(244, 240, 248, 0.76);
  text-align: center;
  font-size: 11px;
}
.anpr-hud {
  position: absolute;
  z-index: 2;
  inset: 7px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 5px;
  pointer-events: none;
  color: #273038;
  text-shadow: none;
}
.anpr-badge {
  width: max-content;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  background: rgba(246, 248, 247, 0.8);
  color: #273038;
  font: 900 8px/1 var(--mono);
  letter-spacing: 0.65px;
  backdrop-filter: blur(4px);
}
.anpr-hud-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  justify-content: end;
  gap: 3px;
  margin: 0;
}
.anpr-hud-stats > div {
  min-width: 33px;
  padding: 3px 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 3px;
  background: rgba(246, 248, 247, 0.78);
  text-align: center;
  backdrop-filter: blur(3px);
}
.anpr-hud dt,
.anpr-hud dd {
  margin: 0;
}
.anpr-hud dt {
  color: rgba(39, 48, 56, 0.86);
  font: 700 6px/1.1 var(--mono);
  letter-spacing: 0.2px;
}
.anpr-hud dd {
  margin-top: 2px;
  font: 800 8px/1 var(--mono);
}
.anpr-hud-latest {
  display: grid;
  grid-column: 1 / -1;
  justify-self: start;
  width: max-content;
  min-width: min(125px, 100%);
  max-width: 100%;
  gap: 1px;
  padding: 4px 5px;
  border-left: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 2px;
  background: rgba(246, 248, 247, 0.8);
  backdrop-filter: blur(3px);
}
.anpr-hud-latest > span {
  color: rgba(39, 48, 56, 0.86);
  font: 700 6px/1.1 var(--mono);
  letter-spacing: 0.25px;
}
.anpr-hud-latest strong {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font: 900 13px/1.2 var(--mono);
  letter-spacing: 0.45px;
}
.anpr-hud-latest small {
  color: rgba(39, 48, 56, 0.92);
  font: 700 7px/1.1 var(--mono);
}
.anpr-hud-latest .anpr-hud-model {
  overflow: hidden;
  color: rgba(39, 48, 56, 0.94);
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 8px/1.1 var(--mono);
}
.anpr-hud-latest .anpr-hud-model[hidden] { display: none; }
.anpr-hud.is-idle {
  opacity: 0.7;
}
.monitor-frame figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  padding: 13px 9px 7px;
  background: linear-gradient(transparent, rgba(22, 18, 27, 0.68));
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  text-align: right;
}
.monitor-screen.is-unavailable .monitor-camera-select {
  border-color: #dfbfc6;
}
.monitor-screen.is-fullscreen {
  position: fixed;
  z-index: 70;
  inset: 12px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #d7cde5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(24, 17, 39, 0.38);
}
.monitor-screen.is-fullscreen .monitor-frame {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}
body.monitor-fullscreen-fallback {
  overflow: hidden;
}
.monitor-screen:fullscreen {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: #fff;
}
.monitor-screen:fullscreen .monitor-frame {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}
.filter-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.filter-panel label,
.form-grid label,
.camera-modal > label,
.login-card label,
.security-form label {
  display: grid;
  gap: 6px;
  color: #655a70;
  font-size: 11px;
  font-weight: 800;
}
.filter-actions {
  padding-bottom: 0;
}
.filter-note {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #958b9f;
  font-size: 10px;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #473b53;
  padding: 6px 9px;
  font-size: 12px;
  transition:
    border-color 0.14s,
    box-shadow 0.14s;
}
input::placeholder {
  color: #afa6b7;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #9c8ac1;
  box-shadow: 0 0 0 3px rgba(117, 105, 179, 0.12);
}
textarea {
  min-height: 92px;
  height: auto;
  resize: vertical;
  line-height: 1.4;
}
.table-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.table-scroll {
  overflow-x: auto;
}
.events-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.events-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: #867b92;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.events-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0edf5;
  color: #5a5065;
  font-size: 12px;
  vertical-align: middle;
}
.events-table tbody tr:last-child td {
  border-bottom: 0;
}
.events-table tbody tr:hover {
  background: #fcfbfe;
}
.events-table .event-thumb {
  width: 74px;
  height: 47px;
}
.event-vehicle-model {
  display: block;
  max-width: 180px;
  margin-top: 3px;
  overflow: hidden;
  color: #3f304d;
  font: 700 10px/1.35 Arial, "Segoe UI", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-vehicle-model {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}
.recent-vehicle-model[hidden] { display: none; }
.confidence {
  color: #6d5799;
  font: 12px var(--mono);
}
.time-cell {
  color: #6d6378;
  white-space: nowrap;
}
.camera-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-empty[hidden] {
  display: none;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: #756b81;
  font-size: 12px;
}
.pagination > div {
  display: flex;
  gap: 4px;
}
.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(315px, 1fr));
  gap: 14px;
}
.camera-grid > .empty-state {
  grid-column: 1 / -1;
  border: 1px dashed #cbbfde;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}
.camera-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.camera-card.is-disabled {
  opacity: 0.7;
}
.camera-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px 13px;
}
.camera-card h3 {
  max-width: 235px;
  overflow: hidden;
  color: #4c4058;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.camera-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15px;
  white-space: nowrap;
}
.source-badge-warnax {
  background: #edf8f2;
  color: #3d8062;
}
.camera-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: #786e83;
  font-size: 11px;
}
.camera-status .status-dot {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
}
.camera-actions {
  display: flex;
  gap: 1px;
}
.camera-card-body {
  display: grid;
  gap: 0;
  padding: 0 16px 11px;
}
.stream-mask {
  overflow: hidden;
  margin-bottom: 12px;
  color: #81768c;
  font: 11px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.warnax-stream-info {
  margin-bottom: 12px;
  color: #567d6a;
  font-size: 11px;
  font-weight: 800;
}
.camera-detail {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid #f0edf5;
  color: #82788d;
  font-size: 11px;
}
.camera-detail strong {
  max-width: 190px;
  overflow: hidden;
  color: #5b5066;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.camera-error {
  margin: 0 16px 14px;
  padding: 7px 9px;
  border-radius: 5px;
  background: #fff6f7;
  color: #9e5360;
  font-size: 11px;
}
.camera-card-footer {
  display: flex;
  gap: 7px;
  padding: 11px 16px;
  border-top: 1px solid #eeeaf4;
  background: #fdfcff;
}
.camera-card-footer .button {
  flex: 1;
}
.integration-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 14px;
}
.integration-intro {
  min-height: 262px;
  padding: 24px;
}
.lock-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  margin-bottom: 17px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 23px;
}
.integration-intro h3 {
  font-size: 18px;
}
.integration-intro > p {
  margin: 8px 0 17px;
  color: #756b80;
  font-size: 13px;
}
.callout {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-left: 3px solid #aa9ac9;
  border-radius: 0 4px 4px 0;
  background: #f7f5fb;
  color: #72687d;
  font-size: 12px;
}
.callout strong {
  color: var(--primary);
}
.code-panel {
  overflow: hidden;
}
.copy-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.copy-button:hover {
  color: var(--primary-dark);
}
.code-panel pre {
  margin: 0;
  padding: 23px;
  overflow-x: auto;
  background: #443b55;
  color: #f0edfa;
  font: 12px/1.7 var(--mono);
}
.code-note {
  margin: 0;
  padding: 11px 17px;
  color: #887d92;
  font-size: 11px;
}
.permissions-panel {
  margin-top: 14px;
  padding: 17px 19px;
}
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.permissions-grid div {
  display: grid;
  gap: 4px;
  padding-right: 13px;
  border-right: 1px solid #ebe7f1;
}
.permissions-grid div:last-child {
  border-right: 0;
}
.permissions-grid strong {
  color: #564a61;
  font-size: 12px;
}
.permissions-grid span {
  color: #7b7185;
  font-size: 11px;
}
.permissions-grid code {
  color: #62438c;
  font: 11px var(--mono);
}
.users-panel {
  overflow: hidden;
}
.users-heading,
.user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(110px, 0.6fr) minmax(
      90px,
      0.45fr
    ) minmax(120px, 0.55fr);
  gap: 13px;
  align-items: center;
}
.users-heading {
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  color: #8a7f97;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}
.users-list {
  min-height: 1px;
}
.user-row {
  min-height: 66px;
  padding: 10px 17px;
  border-bottom: 1px solid #f0edf5;
}
.user-row:last-child {
  border-bottom: 0;
}
.user-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.user-identity strong {
  overflow: hidden;
  color: #51445d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-identity span {
  overflow: hidden;
  color: #93899d;
  font: 11px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-badge,
.status-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 900;
}
.role-badge {
  background: #eeebf7;
  color: #65568d;
}
.status-badge {
  background: #f0eef4;
  color: #756b80;
}
.status-badge.is-enabled {
  background: #edf8f2;
  color: #3f8465;
}
.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.self-note {
  color: #978c9f;
  font-size: 11px;
}
.security-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1fr);
  gap: 34px;
  padding: 26px;
}
.security-panel h3 {
  color: #50435d;
  font-size: 19px;
}
.security-panel > div > p:last-child {
  margin: 7px 0 0;
  color: #7f7489;
  font-size: 12px;
}
.security-form {
  display: grid;
  gap: 13px;
  align-content: start;
  max-width: 430px;
}
.form-hint {
  margin: -7px 0 0;
  color: #948a9d;
  font-size: 10px;
}
.form-error {
  margin: 2px 0 0;
  color: #ad5364;
  font-size: 11px;
}
.form-error[hidden] {
  display: none;
}
.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(50, 42, 66, 0.61);
  backdrop-filter: blur(3px);
}
.login-card {
  width: min(100%, 390px);
  padding: 30px;
  border: 1px solid #ded7ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 17, 39, 0.24);
}
.login-brand {
  margin-bottom: 30px;
  color: #554761;
  font-size: 21px;
}
.login-card h2 {
  font-size: 22px;
}
.login-card > p:not(.form-error):not(.login-note) {
  margin: 7px 0 20px;
  color: #766b80;
  font-size: 13px;
}
.login-card label {
  margin-top: 12px;
}
.login-card .button {
  margin-top: 20px;
}
.login-note {
  margin: 15px 0 0;
  color: #91879a;
  font-size: 10px;
  line-height: 1.45;
}
.camera-modal {
  width: min(100%, 730px);
  max-height: calc(100vh - 38px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 17, 39, 0.26);
}
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 20px;
}
.modal-header {
  border-bottom: 1px solid var(--line);
}
.modal-header h2 {
  font-size: 19px;
}
.modal-body {
  overflow-y: auto;
  padding: 18px 20px 12px;
}
.modal-body > label {
  margin-top: 15px;
}
.modal-body > label:first-of-type {
  margin-top: 0;
}

.camera-location-fields {
  display: grid;
  gap: 10px;
  margin: 15px 0 0;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaff;
}
.camera-location-fields legend {
  padding: 0 4px;
  color: #655a70;
  font-size: 11px;
  font-weight: 800;
}
.camera-location-fields > label {
  display: grid;
  gap: 6px;
  color: #655a70;
  font-size: 11px;
  font-weight: 800;
}
.camera-location-fields > small {
  color: #8d8298;
  font-size: 10px;
  font-weight: 650;
}
.location-coordinates {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.source-picker {
  margin: 15px 0 0;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaff;
}
.source-picker legend {
  padding: 0 4px;
  color: #655a70;
  font-size: 11px;
  font-weight: 800;
}
.source-picker-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.source-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #655a70;
  cursor: pointer;
}
.source-choice:has(input:checked) {
  border-color: #aa9ac9;
  background: #f5f2fb;
  color: #53367d;
}
.source-choice input {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--primary);
}
.source-choice span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.source-choice strong {
  font-size: 11px;
  line-height: 1.25;
}
.source-choice small,
.source-picker-hint {
  color: #8d8298;
  font-size: 10px;
  font-weight: 650;
}
.source-picker-hint {
  min-height: 14px;
  margin: 8px 0 0;
}
.modal-body > label.camera-source-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #655a70;
  font-size: 11px;
  font-weight: 800;
}
.camera-source-field textarea {
  font: 11px/1.4 var(--mono);
}
.camera-source-field .source-example {
  overflow-wrap: anywhere;
  color: #84798f;
  font-weight: 600;
}
.source-example code {
  color: #5f4387;
  font: 10px/1.4 var(--mono);
}
.form-grid {
  display: grid;
  gap: 12px;
}
.two-columns {
  grid-template-columns: 1fr 160px;
}
.three-columns {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}
.switch-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}
.switch input {
  position: absolute;
  opacity: 0;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #c6bece;
  transition: 0.15s;
}
.switch i::after {
  position: absolute;
  content: "";
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: 0.15s;
}
.switch input:checked + i {
  background: var(--primary);
}
.switch input:checked + i::after {
  transform: translateX(14px);
}
.modal-body small {
  color: #93899c;
  font-weight: 600;
}
.saved-stream {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f6f4f9;
  color: #81768b;
  font-size: 11px;
}
.saved-stream code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #594e65;
  font: 11px var(--mono);
}
.settings-details {
  margin-top: 15px;
  padding: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.settings-details summary {
  padding: 11px 0;
  color: #594e65;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.details-note {
  margin: 0;
  color: #83788d;
  font-size: 11px;
}
.roi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 11px;
}
.roi-grid label {
  display: grid;
  gap: 5px;
  color: #6f6579;
  font: 11px var(--mono);
}
.probe-area {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #d8d0e8;
  border-radius: 7px;
  background: #faf9fd;
}
.probe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.probe-head > div:first-child {
  display: grid;
  gap: 2px;
}
.probe-head strong {
  color: #534861;
  font-size: 12px;
}
.probe-head span {
  color: #82788d;
  font-size: 11px;
}
.probe-head > div:last-child {
  display: flex;
  gap: 6px;
}
.camera-preview {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 5px;
  background: #ebe8f0;
}
.camera-preview img {
  display: block;
  width: 100%;
  max-height: 250px;
  object-fit: contain;
}
.modal-footer {
  border-top: 1px solid var(--line);
}
.modal-footer > span {
  overflow: hidden;
  color: #93899d;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.modal-footer > div {
  display: flex;
  gap: 8px;
}
.user-modal {
  width: min(100%, 680px);
}
body.modal-open {
  overflow: hidden;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.event-thumb[role="button"] {
  cursor: pointer;
}
.event-thumb[role="button"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.event-modal {
  width: min(1100px, 96vw);
}
.event-gallery {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(180px, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.event-scene,
.event-plate-image {
  min-height: 70px;
  overflow: hidden;
  border-radius: 8px;
  background: #ece9f0;
}
.event-scene img,
.event-plate-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
#eventMeta {
  line-height: 1.7;
}
@media (max-width: 1080px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .recent-events {
    grid-template-columns: repeat(2, 1fr);
  }
  .recent-event:nth-child(2) {
    border-right: 0;
  }
  .recent-event:nth-child(-n + 2) {
    border-bottom: 1px solid #f0edf5;
  }
  .filter-panel {
    grid-template-columns: repeat(3, 1fr);
  }
  .filter-actions {
    grid-column: auto;
  }
  .integration-layout {
    grid-template-columns: 1fr;
  }
  .security-panel {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .monitor-wall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .anpr-hud dt {
    font-size: 7px;
  }
  .anpr-hud dd {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: 254px;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.17);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .main-content {
    padding: 0 16px 34px;
  }

  .topbar {
    min-height: 74px;
    flex-wrap: wrap;
    padding: 7px 0;
  }
  .topbar-title {
    margin-right: auto;
  }
  .topbar .system-strip {
    flex-basis: 100%;
    order: 4;
  }
  .mobile-menu {
    display: grid;
  }
  .topbar-meta #refreshLabel {
    display: none;
  }
  .topbar h1 {
    font-size: 21px;
  }
  .view {
    padding-top: 20px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .section-toolbar {
    align-items: flex-start;
  }
  .toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions {
    grid-column: 1 / -1;
  }
  .permissions-grid {
    grid-template-columns: 1fr;
  }
  .permissions-grid div {
    padding: 0 0 11px;
    border-right: 0;
    border-bottom: 1px solid #ebe7f1;
  }
  .permissions-grid div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }
  .three-columns {
    grid-template-columns: 1fr 1fr;
  }
  .users-heading {
    display: none;
  }
  .user-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .user-row > :nth-child(2),
  .user-row > :nth-child(3) {
    grid-column: 1;
  }
  .user-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
  }
  .user-actions .button {
    white-space: nowrap;
  }
}
@media (max-width: 510px) {
  .topbar-meta .button {
    padding-left: 8px;
    padding-right: 8px;
  }
  .metrics-grid,
  .recent-events {
    grid-template-columns: 1fr;
  }
  .monitor-wall-grid {
    grid-template-columns: 1fr;
  }
  .recent-event {
    border-right: 0;
    border-bottom: 1px solid #f0edf5;
  }
  .recent-event:last-child {
    border-bottom: 0;
  }
  .filter-panel {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    grid-column: auto;
  }
  .section-toolbar {
    flex-direction: column;
  }
  .toolbar-actions {
    justify-content: flex-start;
  }
  .two-columns,
  .three-columns {
    grid-template-columns: 1fr;
  }
  .source-picker-options {
    grid-template-columns: 1fr;
  }
  .roi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .probe-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .camera-modal {
    max-height: calc(100vh - 18px);
  }
  .modal-backdrop {
    padding: 9px;
  }
  .modal-header,
  .modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .modal-body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .modal-footer > span {
    display: none;
  }
  .modal-footer {
    justify-content: flex-end;
  }
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
  .event-gallery {
    grid-template-columns: 1fr;
  }
  .user-row {
    padding-left: 13px;
    padding-right: 13px;
  }
  .security-panel {
    padding: 20px;
  }
}

/* Preserved compact resource toolbar and page identity from concurrent update. */
.resource-worker,.resource-stat{flex-shrink:0;white-space:nowrap}
.resource-stat{padding:2px 5px;border:1px solid #ded5e9;border-radius:4px;background:#fff;color:#58446f;font-weight:800;font-variant-numeric:tabular-nums}
.topbar{min-height:46px;padding:6px 0;gap:9px}
.view{padding-top:8px}
.page-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:7px 10px}
.page-title .eyebrow{margin:0;font-size:20px;font-family:var(--heading-font);font-weight:700}
.page-title h1{margin:0;font-size:13px;line-height:1.2;font-family:var(--heading-font);font-weight:700}
.page-title-host{min-width:0}
.view>.section-toolbar{min-height:30px;margin-bottom:8px}
.monitor-panel-heading{min-height:44px;padding:8px 12px;gap:10px}
@media(max-width:600px){.page-title h1{font-size:12px}.page-title .eyebrow{font-size:16px}}

.monitor-screen:is(:fullscreen,.is-fullscreen) .anpr-hud-latest strong{font-size:20px}
.monitor-screen:is(:fullscreen,.is-fullscreen) .anpr-hud-latest{min-width:180px;padding:8px 10px}
.monitor-screen:is(:fullscreen,.is-fullscreen) .anpr-hud-latest>span{font-size:9px}
.monitor-screen:is(:fullscreen,.is-fullscreen) .anpr-hud-latest small{font-size:10px}

.vehicle-body-outline {
  position: absolute;
  z-index: 1;
  border: 1px solid #8ce4ae;
  pointer-events: none;
  background: transparent;
}
.vehicle-body-outline[hidden] { display: none; }
.vehicle-body-outline.is-stationary { border-color: #e6c27d; }
.vehicle-body-outline > span {
  position: absolute;
  bottom: 100%;
  left: 0;
  max-width: 100%;
  padding: 2px 4px;
  color: white;
  background: rgba(24, 29, 30, .72);
  font: 600 9px/1.3 var(--mono);
  white-space: nowrap;
}

.camera-roi-editor { margin: 12px 0; padding: 12px; border: 1px solid #ded7eb; border-radius: 7px; background: #faf8fd; }
.camera-roi-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.camera-roi-editor p, .camera-roi-editor small { font-size: 12px; color: #6c6576; }
.camera-roi-stage { position: relative; width: 100%; margin: 8px 0; }
.camera-roi-stage img { display: block; width: 100%; height: auto; }
.camera-roi-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; pointer-events: auto; }
.camera-roi-stage rect { stroke: #4ce59f; stroke-width: .3; fill: rgba(76, 229, 159, .08); pointer-events: none; }

.overview-analytics-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 14px; margin-top: 14px; }
.overview-analytics-row > div { min-width: 0; }
.overview-analytics-row .panel { display: flex; flex-direction: column; height: 100%; margin: 0; padding: 0; }
.overview-analytics-row .panel-heading { min-height: 59px; padding: 12px 14px 9px; gap: 8px; }
.overview-analytics-row h2 { font-size: 14px; line-height: 1.2; }
.overview-analytics-row .text-button { font-size: 10px; white-space: nowrap; }
.overview-analytics-row .section-kicker { font-size: 9px; margin-bottom: 4px; }
.overview-analytics-row .traffic-metrics, .overview-analytics-row .seatbelt-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 0 12px; }
.osago-overview-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0 12px; }
.overview-analytics-row .traffic-metric, .overview-analytics-row .seatbelt-metric, .osago-overview-metric { min-width: 0; min-height: 63px; padding: 7px 5px; }
.overview-analytics-row .traffic-metric strong, .overview-analytics-row .seatbelt-metric strong, .osago-overview-metric strong { display: block; margin: 5px 0 0; color: #463950; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.2; font-variant-numeric: tabular-nums; }
.overview-analytics-row .traffic-metric span, .overview-analytics-row .seatbelt-metric span, .osago-overview-metric span { display: block; overflow-wrap: anywhere; color: #776685; font-size: 10px; }
.overview-analytics-row .seatbelt-metric small { display: none; }
.overview-analytics-row .traffic-note, .overview-analytics-row .seatbelt-help, .osago-overview-note { min-height: 35px; margin: 8px 14px 12px; color: #897b96; font-size: 10px; line-height: 1.5; }
.osago-overview-metric { border: 1px solid #e7e2ee; border-top: 3px solid #51a480; border-radius: 5px; background: #fff; }
.osago-overview-uninsured { border-top-color: #c46170; }
.osago-overview-pending { border-top-color: #c98b43; }
@media (max-width: 1050px) { .overview-analytics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .overview-analytics-row { grid-template-columns: minmax(0, 1fr); } }

.camera-roi-stage polygon { fill: #42b99530; stroke: #52d1a7; stroke-width: .35; vector-effect: non-scaling-stroke; }
.camera-roi-stage polyline { fill: none; stroke: #52d1a7; stroke-width: .4; vector-effect: non-scaling-stroke; stroke-dasharray: 4 2; }
.camera-roi-stage circle { fill: #fff; stroke: #249274; stroke-width: .35; }
.camera-roi-stage [data-roi-points] { pointer-events: none; }
.camera-roi-toolbar { flex-wrap: wrap; }

.timezone-control { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; color: var(--muted); }
.timezone-control select { max-width: 170px; min-height: 30px; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--surface); color: var(--ink); font: 11px var(--heading-font); }
@media (max-width: 900px) { .topbar-meta { flex-wrap: wrap; justify-content: flex-end; } .timezone-control select { max-width: 145px; } }

/* Shared registration footer: user-provided records, never a floating overlay. */
.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-content > .topbar,
.main-content > .global-message {
  flex-shrink: 0;
}
.main-content > .view.is-active {
  flex: 1 0 auto;
}
.registration-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  margin-top: 24px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-strong);
  color: #6d6279;
  font-family: var(--heading-font);
}
.registration-footer-item {
  display: flex;
  flex: 1 1 335px;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.registration-footer-item:first-child {
  padding-left: 0;
  border-left: 0;
}
.registration-footer-logo {
  display: block;
  flex: 0 0 148px;
  width: 148px;
  height: 50px;
  object-fit: contain;
}
.registration-footer-record {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}
.registration-footer-record strong {
  color: var(--primary-dark);
  font-size: inherit;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
}
@media (max-width: 760px) {
  .registration-footer {
    gap: 14px;
    margin-top: 20px;
    padding-top: 16px;
  }
  .registration-footer-item {
    flex-basis: 100%;
    padding-left: 12px;
    gap: 14px;
  }
  .registration-footer-logo {
    flex-basis: 112px;
    width: 112px;
    height: 42px;
  }
}

/* A shared bottom rail: account and registration records share one baseline. */
:root { --footer-height: 72px; }
.sidebar { padding-bottom: 0; }
.account-row { min-height: var(--footer-height); padding: 12px 7px; border-top-color: var(--line-strong); }
.main-content { padding-bottom: calc(var(--footer-height) + 24px); }
.registration-footer {
  position: fixed;
  z-index: 15;
  left: 254px;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  margin: 0;
  padding: 10px 36px;
  flex-wrap: nowrap;
  gap: 24px;
  border-top: 1px solid var(--line-strong);
  background: var(--canvas);
}
.registration-footer-item { flex: 1 1 0; }
@media (min-width: 761px) and (max-width: 1150px) {
  .registration-footer { padding-inline: 24px; gap: 16px; }
  .registration-footer-logo { flex-basis: 112px; width: 112px; height: 42px; }
  .registration-footer-item { gap: 12px; padding-left: 16px; }
  .registration-footer-record { font-size: 10px; line-height: 1.35; }
}
@media (max-width: 760px) {
  :root { --footer-height: 136px; }
  .registration-footer { left: 0; padding: 8px 16px; flex-direction: column; align-items: stretch; gap: 8px; }
  .registration-footer-item { flex: 1 1 0; min-height: 0; padding-left: 0; border-left: 0; gap: 12px; }
  .registration-footer-logo { flex-basis: 100px; width: 100px; height: 40px; }
  .registration-footer-record { font-size: 10px; line-height: 1.35; gap: 3px; }
  .registration-footer-record strong { font-size: inherit; }
  .sidebar .account-row { min-height: 72px; }
}

/* Stable header: refreshing changes digits, not layout or control opacity. */
#refreshLabel { display: inline-block; width: 208px; min-width: 208px; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#manualRefresh { flex: 0 0 auto; }
.timezone-caption { flex: 0 0 auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font: 11px/1.4 var(--heading-font); white-space: nowrap; }
.timezone-caption:hover:not(:disabled) { color: var(--primary); }
.timezone-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: var(--surface); }
.timezone-dialog::backdrop { background: rgba(50,42,66,.62); backdrop-filter: blur(3px); }
.timezone-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 10px; }
.timezone-dialog h2 { font-size: 17px; }
.timezone-dialog-body { padding: 16px; }
.timezone-dialog .timezone-control { display: grid; width: 100%; gap: 8px; }
.timezone-dialog-body p { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
@media (min-width: 761px) and (max-width: 900px) { :root { --footer-height: 104px; } .registration-footer-logo { flex-basis: 90px; width: 90px; height: 40px; } }

/* Do not extend the sidebar divider alongside the lower status/account area. */
.sidebar { border-right: 0; }
@media (min-width: 761px) {
  .sidebar::after { content: ""; position: absolute; right: 0; top: 0; bottom: calc(var(--footer-height) + 64px); width: 1px; background: var(--line); pointer-events: none; }
}

/* Time preferences use a single centered heading/action row. */
.timezone-dialog header.warnax-dialog-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 56px; padding: 12px 16px; gap: 12px; }
.timezone-dialog header.warnax-dialog-header::before { height: 100%; }
.timezone-dialog header.warnax-dialog-header h2 { grid-column: 1; grid-row: 1; margin: 0; font-size: 17px; line-height: 1.3; }
.timezone-dialog header.warnax-dialog-header #timezoneClose { display: inline-flex; align-items: center; justify-content: center; grid-column: 2; grid-row: 1; align-self: center; min-height: 30px; height: 30px; padding: 0 12px; margin: 0; line-height: 1; }

/* Footer separator begins at the same inset as the working content. */
.registration-footer { border-top: 0; }
.registration-footer::before { content: ""; position: absolute; top: 0; left: 36px; right: 36px; height: 1px; background: var(--line-strong); pointer-events: none; }

@media (max-width: 760px) { .registration-footer::before { left: 16px; right: 16px; } }

/* Wall status reflects media playback, not just the ANPR worker's health. */
.monitor-frame-status[data-stream-state] {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  max-width: 130px;
  min-height: 20px;
  padding: 3px 7px;
  box-sizing: border-box;
  border: 1px solid #e5e0ec;
  border-radius: 5px;
  color: #7a7088;
  background: #f6f4f9;
  font: 700 9px/1.2 Arial, "Segoe UI", sans-serif;
  letter-spacing: .02em;
  white-space: nowrap;
}
.monitor-frame-status[data-stream-state="playing"] {
  border-color: #237451;
  color: #fff;
  background: #237451;
  letter-spacing: .08em;
}
.monitor-frame-status[data-stream-state="playing"]::before {
  content: "";
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #baf3d4;
  box-shadow: 0 0 0 2px #ffffff18;
}
.monitor-frame-status[data-stream-state="buffering"],
.monitor-frame-status[data-stream-state="connecting"] { border-color: #ead6ac; color: #8b6828; background: #fff8e9; }
.monitor-frame-status[data-stream-state="unavailable"] { border-color: #ebcbd2; color: #ab4356; background: #fff2f4; }

/* Match the known model in ANPR event details to the OSAGO detail header. */
.event-modal .warnax-dialog-header .event-detail-model {
  grid-column: 1 / -1;
  grid-row: 3;
  display: block;
  min-width: 0;
  color: #352442;
  font: 700 12px/1.4 Arial, "Segoe UI", sans-serif;
  letter-spacing: .105em;
  text-transform: uppercase;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.event-modal .warnax-dialog-header .event-detail-model[hidden] {
  display: none;
}

/* The four overview modules stay compact without changing their full-section layouts. */
.overview-analytics-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.overview-analytics-row .traffic-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.overview-analytics-row .seatbelt-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wanted-overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0 12px;
}
.wanted-overview-metric {
  min-width: 0;
  min-height: 63px;
  padding: 7px 5px;
  border-top: 2px solid #c46170;
  background: #fff9fa;
}
.wanted-overview-metric > span,
.wanted-overview-metric > small {
  display: block;
  overflow-wrap: anywhere;
  color: #776685;
  font-size: 10px;
  line-height: 1.25;
}
.wanted-overview-metric > strong {
  display: block;
  margin: 5px 0 0;
  color: #463950;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.wanted-overview-metric > small {
  margin-top: 3px;
  color: #978e9f;
  font-size: 9px;
}
.wanted-overview-note {
  min-height: 35px;
  margin: 8px 14px 12px;
  color: #897b96;
  font-size: 10px;
  line-height: 1.5;
}
@media (max-width: 1050px) {
  .overview-analytics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .overview-analytics-row {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Read-only body annotation for an already loaded saved JPEG. This is not the live HUD. */
.vehicle-snapshot-overlay-host {
  position: relative;
  overflow: hidden;
}
.vehicle-snapshot-overlay-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  pointer-events: none;
}

/* Compact overview: metrics and navigation remain, explanatory footers are omitted. */
.overview-analytics-row .wanted-overview-note,
.overview-analytics-row .osago-overview-note,
.overview-analytics-row .traffic-overview > .traffic-note,
.overview-analytics-row .seatbelt-overview > .seatbelt-help {
  display: none;
}
