:root {
  --bg: #d7dde6;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(33, 43, 54, 0.12);
  --text: #17212b;
  --muted: #5b6776;
  --perimeter: #ef6c00;
  --entry: #1565c0;
  --indoor: #2e7d32;
  --ptz: #8e24aa;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.35), transparent 30%),
    linear-gradient(135deg, #dbe1e8 0%, #ccd5df 100%);
  color: var(--text);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 100vh;
  gap: 20px;
  padding: 20px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(12px);
}

.sidebar__header,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.38);
  box-shadow: 0 16px 40px rgba(23, 33, 43, 0.12);
  border-radius: 22px;
}

.sidebar__header {
  padding: 24px 24px 20px;
}

.sidebar__header h1 {
  margin: 4px 0 10px;
  font-size: 30px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  color: #2c4d7f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
}

.panel {
  padding: 18px 18px 16px;
}

.panel--compact {
  margin-bottom: 8px;
}

.panel__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel__title h2 {
  margin: 0;
  font-size: 18px;
}

.panel__title span {
  color: var(--muted);
  font-size: 13px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button-grid button {
  border: 1px solid rgba(40, 61, 84, 0.12);
  background: linear-gradient(180deg, #ffffff, #eef3f7);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.button-grid button:hover,
.camera-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(23, 33, 43, 0.10);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 14px;
  color: var(--text);
}

.check input {
  width: 17px;
  height: 17px;
}

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

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

.swatch.perimeter { background: var(--perimeter); }
.swatch.entry { background: var(--entry); }
.swatch.indoor { background: var(--indoor); }
.swatch.ptz { background: var(--ptz); }

.camera-list {
  display: grid;
  gap: 10px;
  max-height: 44vh;
  overflow: auto;
  padding-right: 4px;
}

.camera-item {
  border: 1px solid rgba(23, 33, 43, 0.08);
  background: rgba(255,255,255,0.86);
  border-radius: 16px;
  padding: 12px 13px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.camera-item.is-active {
  border-color: rgba(30, 95, 180, 0.45);
  box-shadow: 0 16px 28px rgba(21, 101, 192, 0.16);
  background: rgba(241, 247, 255, 0.96);
}

.camera-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camera-item__id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.camera-item__meta {
  flex: 1;
}

.camera-item__meta strong {
  display: block;
  font-size: 14px;
}

.camera-item__meta small,
.camera-item__stats {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notes {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.notes li + li {
  margin-top: 8px;
}

.viewer-wrap {
  position: relative;
  min-width: 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(23, 33, 43, 0.16);
  border: 1px solid rgba(255,255,255,0.45);
  background:
    linear-gradient(180deg, rgba(250,250,252,0.6), rgba(219,227,235,0.8));
}

#viewer {
  width: 100%;
  height: calc(100vh - 40px);
}

.hud {
  position: absolute;
  inset: 18px 18px auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

.hud__badge,
.selection-pill {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.44);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(23, 33, 43, 0.10);
  color: var(--text);
  backdrop-filter: blur(8px);
}

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

.hud__badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2e7d32, #1b5e20);
}

.selection-pill {
  color: var(--muted);
}

@media (max-width: 1400px) {
  .app-shell {
    grid-template-columns: 360px 1fr;
  }
}
