:root {
  --ink: #14120e;
  --panel: #221e17;
  --panel-2: #2b261d;
  --line: #3c3428;
  --text: #f4efe6;
  --muted: #b3a794;
  --amber: #e2a43a;
  --amber-2: #f0c27a;
  --danger: #d4654a;
  --ok: #8fb573;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Candara, sans-serif;
  color: var(--text);
  background: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber-2); }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(226, 164, 58, 0.16), transparent 60%),
    var(--ink);
}
.card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.brand { letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); font-size: 12px; margin: 0 0 8px; }
h1 { font-size: 32px; font-weight: 620; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 22px; line-height: 1.45; }
label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
input:focus, select:focus { outline: 2px solid rgba(226, 164, 58, 0.45); border-color: var(--amber); }
.row { display: flex; gap: 10px; align-items: center; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
button.primary, button.ghost, button.danger {
  border-radius: 999px;
  border: 0;
  padding: 10px 16px;
}
button.primary { background: var(--amber); color: #241804; font-weight: 680; }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.qr { width: 220px; height: 220px; background: white; border-radius: 12px; padding: 8px; }
.error { color: #ffb4a4; min-height: 1.2em; margin-top: 12px; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav {
  background: #100e0b;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
}
.nav button.active, .nav button:hover { background: var(--panel-2); color: var(--text); }
.main { padding: 22px 26px 40px; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.top h1 { font-size: 28px; }
.who { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cam {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.cam video-stream, .cam video, video-stream { display: block; width: 100%; aspect-ratio: 16/9; background: black; }
video-stream video { width: 100%; height: 100%; object-fit: contain; background: black; }
.cam header, .pad { padding: 12px 14px 14px; }
.cam header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ptz { display: flex; gap: 6px; padding: 0 14px 14px; }
.ptz button {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
}
.ptz button:active { background: var(--amber); color: #241804; border-color: var(--amber); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; }
.dot.off { background: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 560; font-size: 13px; }
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 8px 0 18px;
  align-items: end;
}
.form label { margin: 0 0 6px; }
.player {
  background: black;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.player video { width: 100%; max-height: 70vh; background: black; }
.note { color: var(--muted); font-size: 13px; }
select.company { width: 220px; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .nav { flex-direction: row; overflow: auto; }
}
