:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.admin-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px;
}

.admin-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.text-link {
  color: #126c60;
  font-weight: 700;
  text-decoration: none;
}

.admin-section {
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 18px;
}

.admin-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) auto auto;
}

.admin-form label {
  color: #52606d;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.admin-form input[type="text"],
.admin-form input[type="password"] {
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  font-size: 16px;
  min-height: 42px;
  padding: 9px 11px;
}

.checkbox-label {
  align-items: center;
  color: #17202a;
  display: flex !important;
  min-height: 42px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #dce2e8;
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #52606d;
  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.danger {
  background: #c62828;
}

.camera-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #dce2e8;
  display: flex;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

#status {
  color: #52606d;
  font-size: 14px;
  margin-top: 6px;
}

.actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.camera-select {
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  font-size: 14px;
  max-width: 220px;
  min-height: 40px;
  padding: 8px 10px;
}

.topbar-link {
  margin-right: 6px;
}

button {
  background: #126c60;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  min-width: 82px;
  padding: 11px 16px;
}

button:disabled {
  background: #a7b1ba;
  cursor: not-allowed;
}

.video-wrap {
  align-items: center;
  background: #0f1419;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 360px;
  overflow: hidden;
  position: relative;
}

video {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.overlay-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.alert-banner {
  background: #c62828;
  border-radius: 6px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  left: 24px;
  padding: 14px 18px;
  position: absolute;
  right: 24px;
  top: 24px;
}

.results-panel {
  background: #ffffff;
  border-left: 1px solid #dce2e8;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
}

.results {
  display: grid;
  gap: 10px;
}

.empty {
  color: #667684;
  font-size: 14px;
}

.read {
  border: 1px solid #dce2e8;
  border-left: 5px solid #8aa0b3;
  border-radius: 8px;
  padding: 12px;
}

.read.match {
  border-left-color: #c62828;
  background: #fff5f5;
}

.plate-thumb {
  background: #101820;
  border-radius: 4px;
  display: block;
  height: auto;
  margin-bottom: 10px;
  max-height: 96px;
  object-fit: contain;
  width: 100%;
}

.plate {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.meta {
  color: #52606d;
  font-size: 13px;
  margin-top: 6px;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(220px, 1fr);
    height: 100vh;
    overflow: hidden;
  }

  .results-panel {
    border-left: 0;
    border-top: 1px solid #dce2e8;
    height: auto;
    min-height: 0;
    overflow-y: auto;
  }

  .camera-panel {
    height: auto;
    min-height: 0;
  }

  .video-wrap {
    flex: 0 0 auto;
    height: min(54vh, 460px);
    min-height: 240px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .actions {
    align-items: stretch;
    flex-wrap: wrap;
    width: 100%;
  }

  .camera-select {
    max-width: none;
    width: 100%;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
