:root {
  --bg: #121212;
  --bg-soft: #181818;
  --panel: #1c1c1c;
  --panel-strong: #242424;
  --ink: #ffffff;
  --muted: #a0a0a0;
  --muted-strong: #d7d7d7;
  --line: #303030;
  --accent: #ff6a00;
  --accent-2: #c2132c;
  --brand-solid: #e33a15;
  --danger: #ff4d5e;
  --ok: #35d07f;
  --shadow: 0 22px 60px rgba(0, 0, 0, .32);
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Montserrat, system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  background: rgba(18, 18, 18, .96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--ink);
}

.brand:hover { text-decoration: none; }

.brand-logo {
  display: block;
  width: auto;
  max-width: 42vw;
  height: 38px;
}

.brand-subtitle {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.topbar nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-strong);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  text-decoration: none;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto;
}

.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(18, 18, 18, .96), rgba(18, 18, 18, .9) 48%, rgba(18, 18, 18, .68)),
    url("../img/qscreen-hero.svg") center/cover no-repeat;
  color: #fff;
  padding: 70px 36px 64px;
  overflow: hidden;
}

.hero.has-hero-media {
  background: #121212;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 18, 18, .92), rgba(18, 18, 18, .78) 56%, rgba(18, 18, 18, .54));
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .58;
  z-index: 0;
}

.hero-inner {
  position: relative;
  width: min(760px, 100%);
  z-index: 2;
}

.hero-logo {
  display: block;
  width: min(360px, 78%);
  height: auto;
  margin: 0 0 36px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0 0 22px;
  color: #fff;
  font-size: 5rem;
  line-height: 1.01;
  font-weight: 800;
  overflow-wrap: normal;
}

.hero h1 span {
  display: inline-block;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0 0 24px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero p:not(.eyebrow):not(.tagline) {
  max-width: 690px;
  margin: 0 0 30px;
  color: var(--muted-strong);
  font-size: 1.12rem;
}

.hero-panel-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(720px, 100%);
  margin-top: 46px;
}

.hero-signal {
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: rgba(28, 28, 28, .78);
}

.hero-signal strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.hero-signal span {
  color: var(--muted);
  font-size: .92rem;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel,
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}

.panel::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: var(--gradient);
  opacity: .85;
}

.panel h1,
.panel h2,
.card h2,
.card h3 {
  margin-top: 0;
  color: #fff;
}

.panel h1 {
  margin-bottom: 8px;
  font-size: 1.8rem;
  line-height: 1.15;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.panel h2,
.card h2,
.card h3 {
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: anywhere;
}

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

.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--gradient);
  color: #fff;
  font: inherit;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  white-space: normal;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  text-decoration: none;
  filter: brightness(1.07);
}

.button.secondary,
button.secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
}

.button.secondary:hover,
button.secondary:hover {
  background: rgba(255, 255, 255, .07);
}

.button.danger,
button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.check-row input {
  width: auto;
  min-height: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151515;
  color: #fff;
  font: inherit;
  font-size: .95rem;
  text-transform: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(255, 106, 0, .38);
  outline-offset: 1px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--panel-strong);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

td {
  color: var(--muted-strong);
  font-size: .9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

td a {
  overflow-wrap: anywhere;
}

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

.flash {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 13px 15px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted-strong);
}

.flash.success {
  border-color: rgba(53, 208, 127, .34);
  color: var(--ok);
}

.flash.error {
  border-color: rgba(255, 77, 94, .34);
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #2b2b2b;
  color: var(--muted-strong);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badge.brand {
  background: rgba(227, 58, 21, .14);
  color: var(--brand-solid);
}

.badge.online {
  background: rgba(53, 208, 127, .14);
  color: var(--ok);
}

.badge.offline {
  background: rgba(255, 77, 94, .14);
  color: var(--danger);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.nav-list a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-list a:hover {
  background: var(--panel-strong);
  color: #fff;
  text-decoration: none;
}

.nav-list a.active {
  border-color: transparent;
  background: var(--gradient);
  color: #fff;
}

.media-preview {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.login-wrap {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 30px 18px;
}

.login-wrap .panel {
  width: min(440px, 100%);
}

.stat-value {
  margin: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 800;
}

.display-body {
  background: #05070a;
  color: #fff;
  overflow: hidden;
}

.display-stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #05070a;
}

.display-stage img,
.display-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070a;
}

.display-wait {
  text-align: center;
  padding: 32px;
}

.display-wait h1 {
  margin: 0;
  font-size: 4rem;
  font-weight: 800;
}

.display-status {
  position: fixed;
  left: 14px;
  bottom: 12px;
  color: rgba(255, 255, 255, .58);
  font-size: .75rem;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .topbar nav {
    width: 100%;
  }

  .hero h1 { font-size: 3.8rem; }
  .hero-panel-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 68px;
    padding: 10px 16px;
  }

  .topbar nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .brand-logo { height: 30px; }
  .brand-subtitle { display: none; }

  .container {
    width: min(100% - 24px, 1180px);
    margin: 20px auto;
  }

  .panel,
  .card {
    padding: 18px;
  }

  .panel h1 { font-size: 1.45rem; }
  .panel h2,
  .card h2,
  .card h3 { font-size: 1.15rem; }

  .nav-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 12px 4px;
  }

  .hero {
    min-height: calc(100vh - 68px);
    padding: 46px 20px;
  }

  .hero-logo {
    width: min(320px, 88%);
    margin-bottom: 28px;
  }

  .hero h1 { font-size: 2.5rem; }
  .tagline { font-size: 1rem; }
  .hero p:not(.eyebrow):not(.tagline) { font-size: 1rem; }
  table { display: block; overflow-x: auto; }
}

@media (max-width: 440px) {
  .hero h1 { font-size: 2.1rem; }
  .button,
  button,
  input[type="submit"] {
    width: 100%;
  }
}
