:root {
  --bg: #05080b;
  --bg-2: #091018;
  --panel: rgba(15, 23, 31, 0.86);
  --panel-2: rgba(19, 31, 42, 0.74);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f6f8fb;
  --muted: #9ba8b5;
  --soft: #dce5ed;
  --cyan: #31d8f2;
  --green: #62d560;
  --amber: #ffb02e;
  --red: #ff5c5c;
  --blue: #4287f5;
  --violet: #8d68ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(49, 216, 242, 0.12), transparent 28%),
    radial-gradient(circle at 20% 98%, rgba(98, 213, 96, 0.1), transparent 30%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 12, 18, 0.94), rgba(3, 6, 9, 0.94));
}

.app-brand {
  min-height: 122px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0 12%, transparent 13%),
    conic-gradient(from 160deg, var(--cyan), var(--amber), var(--green), var(--cyan));
  box-shadow: 0 0 26px rgba(49, 216, 242, 0.5);
}

.app-brand strong,
.app-brand small {
  display: block;
}

.app-brand strong {
  font-size: 20px;
  line-height: 1.04;
}

.app-brand small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.app-nav {
  display: grid;
  gap: 6px;
  padding: 18px 12px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--soft);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item svg,
.topbar-actions svg,
.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nav-item:hover,
.nav-item.active {
  color: var(--cyan);
  border-color: rgba(49, 216, 242, 0.22);
  background: rgba(49, 216, 242, 0.1);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 18px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 18px rgba(98, 213, 96, 0.55);
}

.status-dot.warn {
  background: var(--amber);
}

.status-dot.bad {
  background: var(--red);
}

.main-panel {
  min-width: 0;
  padding: 18px 20px 34px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
}

.topbar p,
.section-head p,
.panel-heading p {
  margin: 0;
  color: var(--muted);
}

.topbar p {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

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

.primary-button,
.ghost-button,
.icon-button {
  border-radius: 8px;
  cursor: pointer;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  font-weight: 900;
}

.primary-button {
  color: #041017;
  border: 1px solid rgba(49, 216, 242, 0.65);
  background: linear-gradient(180deg, #5be5ff, #22bde6);
}

.ghost-button {
  color: var(--soft);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel,
.venue-card,
.campaign-card,
.advertiser-card,
.player-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)), var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

.metric {
  min-height: 120px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.metric-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--green);
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgba(98, 213, 96, 0.08);
}

.metric:nth-child(2) .metric-icon {
  color: var(--cyan);
  background: rgba(49, 216, 242, 0.08);
}

.metric:nth-child(3) .metric-icon {
  color: var(--amber);
  background: rgba(255, 176, 46, 0.08);
}

.metric:nth-child(4) .metric-icon {
  color: var(--blue);
  background: rgba(66, 135, 245, 0.08);
}

.metric-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.metric span,
.metric small {
  display: block;
}

.metric span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
}

.metric small {
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading,
.section-head,
.split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading p,
.section-head p {
  font-size: 13px;
}

select,
input {
  min-height: 38px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(5, 8, 11, 0.7);
  padding: 0 12px;
}

.schedule {
  display: grid;
  gap: 11px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 12px;
  align-items: center;
}

.schedule-label {
  min-width: 0;
}

.schedule-label strong,
.schedule-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-label strong {
  font-size: 13px;
}

.schedule-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-track {
  position: relative;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 16.66%),
    rgba(255, 255, 255, 0.04);
}

.timeline-fill {
  position: absolute;
  top: 9px;
  bottom: 9px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.player-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(49, 216, 242, 0.38);
  border-radius: 8px;
  background: #020304;
}

.ad-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 176, 46, 0.18), transparent 28%),
    linear-gradient(135deg, #15110a, #05080b 58%, #071520);
}

.ad-slide.alt {
  background:
    radial-gradient(circle at 72% 22%, rgba(49, 216, 242, 0.22), transparent 26%),
    linear-gradient(135deg, #061216, #081019 54%, #11140b);
}

.ad-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 5vw, 48px);
}

.ad-copy strong {
  max-width: 10ch;
  display: block;
  font-size: clamp(32px, 5vw, 68px);
  line-height: 0.9;
  text-transform: uppercase;
}

.ad-copy span {
  display: block;
  margin-top: 18px;
  color: var(--soft);
  font-size: clamp(15px, 1.6vw, 22px);
  font-weight: 800;
  text-transform: uppercase;
}

.ad-offer {
  align-self: flex-start;
  margin-top: 22px;
  padding: 10px 14px;
  color: #061017;
  border-radius: 6px;
  background: var(--green);
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 900;
}

.ad-art {
  display: grid;
  place-items: center;
  padding: 24px;
}

.ad-product {
  width: min(78%, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.95) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, rgba(255, 176, 46, 0.72) 0 40%, rgba(101, 53, 16, 0.95) 41% 55%, transparent 56%),
    repeating-conic-gradient(from 12deg, rgba(255, 255, 255, 0.15) 0 6deg, transparent 7deg 20deg);
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.48), inset 0 0 42px rgba(0, 0, 0, 0.38);
}

.player-frame .ad-copy {
  padding: clamp(18px, 3.2vw, 34px);
}

.player-frame .ad-copy strong {
  font-size: clamp(28px, 4.2vw, 52px);
}

.player-frame .ad-copy span {
  margin-top: 14px;
  font-size: clamp(13px, 1.3vw, 18px);
}

.player-frame .ad-offer {
  margin-top: 16px;
  font-size: clamp(16px, 1.65vw, 24px);
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.live-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-pill {
  color: var(--green);
  border: 1px solid rgba(98, 213, 96, 0.3);
  background: rgba(98, 213, 96, 0.1);
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-row,
.player-card,
.report-card {
  display: grid;
  gap: 8px;
}

.health-row {
  grid-template-columns: 1.2fr 0.7fr 0.7fr 0.4fr;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.health-row span:not(:first-child) {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  color: var(--green);
  background: rgba(98, 213, 96, 0.12);
}

.status-pill.scheduled {
  color: var(--amber);
  background: rgba(255, 176, 46, 0.12);
}

.status-pill.paused,
.status-pill.offline {
  color: var(--red);
  background: rgba(255, 92, 92, 0.12);
}

.status-pill.warning {
  color: var(--amber);
  background: rgba(255, 176, 46, 0.12);
}

.section-head {
  margin: 8px 0 18px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.venue-grid,
.campaign-board,
.advertiser-grid,
.player-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trivia-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
}

.trivia-live-panel {
  grid-row: span 2;
}

.trivia-stage {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(49, 216, 242, 0.34);
  border-radius: 8px;
  background: #020304;
}

.trivia-screen {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
  padding: clamp(18px, 3vw, 34px);
  background:
    radial-gradient(circle at 76% 16%, rgba(255, 176, 46, 0.24), transparent 28%),
    linear-gradient(135deg, #07131d, #05080b 56%, #151009);
}

.trivia-topline,
.trivia-join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trivia-topline span,
.trivia-join span,
.trivia-join small {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.trivia-screen strong {
  align-self: center;
  max-width: 13ch;
  font-size: clamp(30px, 4.6vw, 58px);
  line-height: 0.96;
}

.trivia-answer {
  justify-self: start;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
}

.trivia-answer.revealed {
  color: #061017;
  border-color: rgba(98, 213, 96, 0.74);
  background: var(--green);
}

.trivia-join {
  justify-content: flex-start;
}

.qr-mark {
  width: 58px;
  height: 58px;
  border: 6px solid #fff;
  background:
    linear-gradient(90deg, #fff 20%, #000 20% 35%, #fff 35% 48%, #000 48% 65%, #fff 65%),
    linear-gradient(#000 18%, transparent 18% 36%, #000 36% 55%, transparent 55% 72%, #000 72%);
  background-blend-mode: difference;
}

.trivia-screen p {
  margin: 0;
  color: var(--soft);
  font-weight: 800;
}

.trivia-controls {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.leaderboard,
.trivia-events,
.sponsor-grid {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.leaderboard-row span {
  color: var(--amber);
  font-weight: 900;
}

.leaderboard-row em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.trivia-event,
.sponsor-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.trivia-event span,
.sponsor-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.trivia-event h3,
.sponsor-card h3 {
  margin-top: 5px;
}

.trivia-event p,
.sponsor-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.venue-card,
.campaign-card,
.advertiser-card,
.player-card,
.report-card {
  min-height: 210px;
  padding: 20px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-top span,
.campaign-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.venue-card p,
.campaign-card p,
.advertiser-card p,
.player-card p,
.report-card p {
  color: var(--muted);
  line-height: 1.5;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.mini-stats div {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.mini-stats strong,
.mini-stats small {
  display: block;
}

.mini-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.campaign-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  color: #061017;
  background: var(--cyan);
}

dialog {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #091018;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--soft);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

label input,
label select {
  width: 100%;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
}

.player-body {
  overflow: hidden;
  background: #000;
}

.kiosk-player {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 52px;
  background: #000;
}

.kiosk-slide {
  position: relative;
  overflow: hidden;
}

.kiosk-slide .ad-slide {
  position: absolute;
}

.kiosk-footer {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 28px;
  color: var(--soft);
  background: #05080b;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.kiosk-footer strong {
  color: var(--cyan);
}

.kiosk-footer span:last-child {
  margin-left: auto;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .app-brand {
    min-height: auto;
  }

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

  .sidebar-status {
    margin: 0 12px 12px;
  }

  .dashboard-grid,
  .metrics-grid,
  .venue-grid,
  .campaign-board,
  .trivia-grid,
  .advertiser-grid,
  .player-grid,
  .report-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .main-panel {
    padding: 14px;
  }

  .topbar,
  .panel-heading,
  .section-head,
  .split-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .app-nav,
  .dashboard-grid,
  .metrics-grid,
  .venue-grid,
  .campaign-board,
  .trivia-grid,
  .advertiser-grid,
  .player-grid,
  .report-grid,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .health-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 12px;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .trivia-controls {
    grid-template-columns: 1fr;
  }
}
