:root {
  --bg: #121418;
  --panel: #1b1f26;
  --card: #232833;
  --line: #343b48;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --accent: #d4a017;
  --accent-2: #f0c14b;
  --danger: #c45c4a;
  --ok: #6fbf73;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 28px 32px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.user-list { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.user-card {
  display: grid;
  grid-template-columns: 1fr 160px 180px auto;
  gap: 12px;
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.user-card h3 { margin: 0 0 4px; font-size: 16px; }
.user-card p { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 960px) {
  .user-card { grid-template-columns: 1fr; }
}
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: min(380px, 92vw); }
select {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.kicker { margin: 0; color: var(--accent); letter-spacing: 0.16em; font-size: 11px; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: 28px; font-weight: 650; }
h2 { margin: 0 0 12px; font-size: 18px; }

.tabs { display: flex; gap: 8px; }
.tab, button, .ghost {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.tab.is-on, button[type="submit"] {
  background: var(--accent);
  color: #1a1404;
  border-color: var(--accent);
  font-weight: 650;
}
.ghost { background: transparent; }

main { padding: 24px 32px 48px; }
.panel { display: none; }
.panel.is-on { display: block; }

.split { display: grid; grid-template-columns: 340px 1fr; gap: 28px; }
@media (max-width: 960px) {
  .top, main { padding-left: 16px; padding-right: 16px; }
  .split { grid-template-columns: 1fr; }
}

.card, .filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.form label, .filters label { display: block; margin: 12px 0; color: var(--muted); font-size: 13px; }
input {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.msg { margin: 12px 0 0; font-size: 13px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.people, .unknowns { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.person, .unk {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.person img, .unk img, .log img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #0d0f13;
  display: block;
}
.person .body, .unk .body { padding: 12px; }
.person h3, .unk h3 { margin: 0 0 6px; font-size: 16px; }
.thumbs { display: flex; gap: 6px; overflow: auto; }
.thumbs img { width: 48px; height: 48px; border-radius: 6px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 16px;
}
.filters label { margin: 0; min-width: 180px; }
.meta { color: var(--muted); font-size: 13px; }

.log { display: flex; flex-direction: column; gap: 10px; }
.log-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}
.log-item img { width: 120px; height: 80px; border-radius: 8px; }
.log-item h3 { margin: 0 0 4px; font-size: 15px; }
.log-item p { margin: 0; color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #3a3320;
  color: var(--accent-2);
  font-size: 11px;
}
.badge.unk { background: #3a2420; color: #e7b0a6; }

.assign { display: flex; gap: 6px; margin-top: 8px; }
.assign input { margin: 0; }
.assign button { white-space: nowrap; }

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  width: min(960px, 94vw);
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.65); }
.player-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
video { width: 100%; max-height: 70vh; background: #000; display: block; }

.empty { color: var(--muted); padding: 24px 4px; }

.live-toolbar { margin-bottom: 14px; }
.live-hint { margin: 0 0 12px; max-width: 72ch; }
.live-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.live-controls label { color: var(--muted); font-size: 13px; }
.live-controls select { width: auto; min-width: 72px; }
.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.live-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.live-tile {
  position: relative;
  background: #0d0f13;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  padding: 0;
  text-align: left;
  color: inherit;
  width: 100%;
}
.live-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0d0f13;
}
.live-tile .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.live-tile.is-off { opacity: 0.62; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-right: 6px;
}
.live-tile.is-off .live-dot { background: var(--danger); }
.live-one {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.live-one-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.live-one-bar strong { margin-right: auto; }
.live-one-stage { position: relative; background: #000; min-height: 42vh; }
.live-one-stage img {
  width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #000;
}
.live-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent-2);
  font-size: 13px;
}
@media (max-width: 960px) {
  .live-grid, .live-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .live-grid, .live-grid.cols-2 { grid-template-columns: 1fr; }
}
