:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-strong: #020812;
  --panel: #0d1726;
  --panel-2: #111e30;
  --panel-3: #15243a;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.32);
  --text: #eef6ff;
  --muted: #8fa2ba;
  --muted-2: #64748b;
  --cyan: #16d8f3;
  --cyan-2: #0891b2;
  --green: #19c77a;
  --amber: #f5b93c;
  --red: #ff4965;
  --blue: #3987ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-strong);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(8, 20, 36, 0.72), rgba(2, 8, 18, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(22, 216, 243, 0.13), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px);
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 23, 38, 0.92);
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-lockup,
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--bg-strong);
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.brand-mark i {
  font-size: 24px;
}

.brand-lockup strong,
.side-brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.brand-lockup span,
.side-brand span {
  color: var(--cyan);
}

.brand-lockup small,
.side-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.login-copy {
  margin: 34px 0 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.login-copy h1,
.view-head h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #091422;
  color: var(--text);
  outline: none;
}

.login-form input {
  height: 44px;
  padding: 0 12px;
}

.login-form input:focus,
.search-box input:focus {
  border-color: rgba(22, 216, 243, 0.72);
  box-shadow: 0 0 0 3px rgba(22, 216, 243, 0.12);
}

.login-form button[type="submit"] {
  height: 46px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #03111c;
  background: linear-gradient(135deg, var(--cyan), #26e1b7);
  font-weight: 850;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.login-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: 44px;
  overflow: hidden;
  padding: 48px clamp(28px, 6vw, 86px);
  background:
    linear-gradient(90deg, rgba(5, 4, 5, 0.96), rgba(8, 6, 7, 0.78) 46%, rgba(5, 4, 5, 0.96)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, #120907, #050506 52%, #0e120d);
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 22%, rgba(255, 185, 88, 0.13) 35%, transparent 49%),
    linear-gradient(74deg, transparent 0 56%, rgba(167, 33, 40, 0.18) 69%, transparent 82%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 84px);
  opacity: 0.84;
}

.login-shell::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34vh;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8)),
    repeating-linear-gradient(90deg, rgba(255, 185, 88, 0.22) 0 2px, transparent 2px 72px);
  transform: skewY(-4deg) translateY(38%);
  opacity: 0.48;
}

.cinema-stage,
.login-card {
  position: relative;
  z-index: 1;
}

.cinema-stage {
  min-height: 560px;
  display: grid;
  align-content: center;
  gap: 20px;
}

.cinema-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #f4d09b;
  font-size: 12px;
  font-weight: 900;
}

.cinema-topline span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(244, 208, 155, 0.24);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(18, 9, 7, 0.58);
}

.cinema-wall {
  display: grid;
  grid-template-columns: 1.3fr 0.82fr 0.82fr;
  grid-auto-rows: minmax(96px, 1fr);
  gap: 12px;
  transform: perspective(1100px) rotateY(-9deg) rotateX(3deg);
  transform-origin: left center;
}

.screen-panel {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid rgba(244, 208, 155, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 18, 16, 0.86), rgba(6, 5, 6, 0.92)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 7px);
  box-shadow:
    0 24px 62px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.screen-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 0 20%, rgba(255, 255, 255, 0.12) 30%, transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 18px);
  opacity: 0.62;
}

.screen-panel::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.screen-panel span,
.screen-panel strong {
  position: relative;
  z-index: 1;
  display: block;
}

.screen-panel span {
  padding: 16px 16px 0;
  color: rgba(255, 237, 209, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.screen-panel strong {
  padding: 4px 16px;
  color: #fff4df;
  font-size: 44px;
  line-height: 1;
}

.hero-feed {
  grid-row: span 2;
  min-height: 240px;
  background:
    linear-gradient(145deg, rgba(94, 19, 24, 0.7), rgba(13, 7, 7, 0.92) 56%),
    repeating-linear-gradient(135deg, rgba(255, 192, 100, 0.08) 0 2px, transparent 2px 14px);
}

.wide-feed {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(30, 72, 49, 0.5), rgba(10, 8, 8, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 12px);
}

.tone-red {
  background: linear-gradient(145deg, rgba(109, 21, 31, 0.68), rgba(8, 5, 6, 0.94));
}

.tone-gold {
  background: linear-gradient(145deg, rgba(142, 87, 31, 0.62), rgba(10, 7, 5, 0.94));
}

.tone-green {
  background: linear-gradient(145deg, rgba(25, 88, 57, 0.55), rgba(7, 8, 6, 0.94));
}

.tone-dark {
  background: linear-gradient(145deg, rgba(52, 38, 35, 0.7), rgba(4, 4, 4, 0.95));
}

.cinema-caption {
  max-width: 620px;
  padding-left: 4px;
}

.cinema-caption small,
.cinema-caption strong {
  display: block;
}

.cinema-caption small {
  color: #c79a68;
  font-weight: 900;
}

.cinema-caption strong {
  margin-top: 6px;
  color: #fff3e2;
  font-size: 44px;
  line-height: 1;
}

.login-card {
  width: min(440px, 100%);
  justify-self: end;
  border: 1px solid rgba(244, 208, 155, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(25, 18, 17, 0.94), rgba(8, 6, 7, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.045) inset;
  padding: 30px;
}

.login-shell .brand-mark {
  color: #120907;
  background: linear-gradient(135deg, #ffd188, #d23f3f 64%, #2fb06f);
}

.login-shell .brand-lockup span,
.login-shell .eyebrow {
  color: #f2b45f;
}

.login-shell .brand-lockup small {
  color: #d0a982;
}

.login-copy h1 {
  color: #fff4e2;
  font-size: 38px;
  line-height: 1.02;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.login-shell .login-form input {
  border-color: rgba(244, 208, 155, 0.22);
  background: rgba(8, 6, 7, 0.9);
  color: #fff4e2;
}

.login-shell .login-form input:focus {
  border-color: rgba(255, 194, 105, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 178, 82, 0.13);
}

.login-shell .login-form label {
  color: #d6b18a;
}

.login-shell .login-form button[type="submit"] {
  color: #140b07;
  background: linear-gradient(135deg, #ffc66f, #f05c3e 58%, #32c278);
  box-shadow: 0 18px 38px rgba(209, 63, 52, 0.22);
}

.login-shell .login-status {
  border-top-color: rgba(244, 208, 155, 0.18);
  color: #c9a27a;
}

.login-shell .online-dot {
  color: #34d47c;
}

@media (prefers-reduced-motion: no-preference) {
  .screen-panel::before {
    animation: monitorSweep 6s linear infinite;
  }

  .login-shell::before {
    animation: stageLight 8s ease-in-out infinite alternate;
  }
}

@keyframes monitorSweep {
  from {
    transform: translateX(-22%);
  }
  to {
    transform: translateX(22%);
  }
}

@keyframes stageLight {
  from {
    opacity: 0.62;
  }
  to {
    opacity: 0.96;
  }
}

.online-dot {
  color: var(--green);
  font-size: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(10, 22, 38, 0.94), var(--bg-strong)),
    var(--bg-strong);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: rgba(5, 12, 22, 0.94);
  overflow-y: auto;
}

.side-brand {
  min-height: 56px;
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-link {
  height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: transparent;
  color: #d7e3f3;
  text-align: left;
}

.nav-link i {
  width: 18px;
  color: var(--muted);
  font-size: 18px;
}

.nav-link:hover,
.nav-link.active {
  border-color: rgba(22, 216, 243, 0.22);
  background: rgba(22, 216, 243, 0.12);
  color: var(--text);
}

.nav-link.active i {
  color: var(--cyan);
}

.side-footer {
  margin-top: auto;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.88);
  backdrop-filter: blur(16px);
}

.search-box {
  position: relative;
  width: min(680px, 100%);
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  height: 44px;
  padding: 0 14px 0 42px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.icon-button,
.soft-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(17, 30, 48, 0.82);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.soft-button {
  min-height: 34px;
  padding: 0 12px;
  font-weight: 800;
}

.soft-button.primary {
  border-color: rgba(22, 216, 243, 0.55);
  background: rgba(22, 216, 243, 0.16);
  color: var(--cyan);
}

.icon-button:hover,
.soft-button:hover {
  border-color: rgba(22, 216, 243, 0.5);
  color: var(--cyan);
}

.admin-pill,
.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 30, 48, 0.72);
  color: var(--text);
  font-size: 13px;
}

.admin-pill {
  padding: 5px 12px 5px 5px;
}

.admin-pill span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cyan);
  color: #04111e;
  font-size: 12px;
  font-weight: 900;
}

.system-pill {
  min-height: 34px;
  padding: 0 12px;
}

.view {
  display: none;
  padding: 28px 24px 40px;
}

.view.active {
  display: block;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-grid.compact {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 30, 48, 0.9), rgba(10, 20, 35, 0.94));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.metric-card {
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.metric-card i {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(22, 216, 243, 0.13);
  color: var(--cyan);
  font-size: 22px;
}

.metric-card strong {
  display: block;
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1;
}

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

.metric-card span {
  margin-top: 5px;
  font-weight: 800;
}

.metric-card small {
  margin-top: 4px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 16px;
}

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

.panel.wide {
  min-height: 320px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 17, 30, 0.74);
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segmented-control button:last-child {
  border-right: 0;
}

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  height: 46px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: #a9bdd3;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #dce8f7;
}

tr:hover td {
  background: rgba(22, 216, 243, 0.035);
}

tr[data-open-channel] {
  cursor: pointer;
}

.channel-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-box {
  flex: 0 0 auto;
  width: 64px;
  height: 38px;
  border-radius: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.channel-cell strong {
  display: block;
}

.channel-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  color: #d8ffed;
  background: rgba(25, 199, 122, 0.16);
}

.badge.warn {
  color: #fff1c9;
  background: rgba(245, 185, 60, 0.16);
}

.badge.bad {
  color: #ffd7de;
  background: rgba(255, 73, 101, 0.17);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-action {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: rgba(10, 20, 35, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.mini-action.primary {
  border-color: rgba(22, 216, 243, 0.55);
  color: var(--cyan);
}

.mini-action.danger {
  border-color: rgba(255, 73, 101, 0.5);
  color: #ff9aac;
}

.mini-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.status-list,
.alert-list,
.event-list,
.source-grid,
.repair-grid,
.vod-grid,
.link-grid,
.channel-tile-grid,
.drawer-list {
  display: grid;
  gap: 10px;
}

.status-item,
.alert-item,
.event-item,
.source-card,
.repair-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.62);
  padding: 12px;
}

.status-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.status-item strong,
.alert-item strong,
.event-item strong,
.source-card strong,
.repair-card strong {
  display: block;
  margin-bottom: 3px;
}

.status-item small,
.alert-item small,
.event-item small,
.source-card small,
.repair-card small {
  color: var(--muted);
}

.alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.alert-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(245, 185, 60, 0.14);
  color: var(--amber);
}

.event-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.event-list.full .event-item {
  grid-template-columns: 180px 160px minmax(0, 1fr) auto;
}

.count-badge {
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-weight: 900;
  font-size: 12px;
}

.source-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.source-card {
  min-height: 126px;
}

.source-card header,
.repair-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cell-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  max-width: 320px;
  white-space: normal;
}

.uptime-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c7d6ea;
  background: rgba(8, 17, 30, 0.75);
  font-size: 11px;
  font-weight: 850;
}

.select-control {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 20, 35, 0.94);
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
}

.studio-form,
.drawer-form {
  display: grid;
  gap: 12px;
}

.studio-form label,
.drawer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.studio-form input,
.studio-form textarea,
.studio-form select,
.drawer-form input,
.drawer-form textarea,
.drawer-form select,
.inline-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.82);
  color: var(--text);
  outline: none;
}

.studio-form input,
.studio-form select,
.drawer-form input,
.drawer-form select,
.inline-form input {
  min-height: 38px;
  padding: 0 11px;
}

.studio-form textarea,
.drawer-form textarea {
  padding: 10px 11px;
  resize: vertical;
}

.studio-form input:focus,
.studio-form textarea:focus,
.drawer-form input:focus,
.drawer-form textarea:focus,
.inline-form input:focus {
  border-color: rgba(22, 216, 243, 0.72);
  box-shadow: 0 0 0 3px rgba(22, 216, 243, 0.12);
}

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

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-result {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.file-control {
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.5);
}

.file-control input {
  display: none;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.42);
}

.qr-card {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.qr-card img {
  width: 220px;
  height: 220px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020812;
  margin-bottom: 14px;
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #020812;
}

.player-status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(2, 8, 18, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.check-control {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.vod-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.vod-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  min-height: 150px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.62);
  padding: 12px;
}

.poster-box {
  width: 92px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 28px;
}

.poster-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vod-title-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.vod-info strong {
  display: block;
}

.vod-info small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.vod-info p {
  display: -webkit-box;
  min-height: 42px;
  margin: 8px 0 10px;
  overflow: hidden;
  color: #cbd8e8;
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-grid {
  grid-template-columns: 1fr;
}

.link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.62);
  padding: 12px;
}

.link-card strong,
.link-card small {
  display: block;
}

.link-card small {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.channel-tile-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.channel-tile {
  min-height: 118px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.62);
  padding: 12px;
  text-align: center;
}

.channel-tile.priority {
  border-color: rgba(22, 216, 243, 0.48);
  background: rgba(22, 216, 243, 0.1);
}

.channel-tile strong {
  font-size: 13px;
}

.channel-tile small {
  color: var(--muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(2, 8, 18, 0.62);
  backdrop-filter: blur(4px);
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 31;
  width: min(560px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #07111f;
  box-shadow: var(--shadow);
  padding: 18px;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2,
.drawer-list h3 {
  margin: 0;
}

.drawer-list h3 {
  margin-top: 16px;
  font-size: 15px;
}

.source-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(7, 15, 27, 0.62);
  padding: 12px;
}

.source-option.active {
  border-color: rgba(25, 199, 122, 0.45);
  background: rgba(25, 199, 122, 0.08);
}

.source-option strong,
.source-option small {
  display: block;
}

.source-option small {
  margin-top: 3px;
  color: var(--muted);
}

.drawer-form {
  display: grid;
  gap: 12px;
}

.drawer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drawer-form input,
.drawer-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #091422;
  color: var(--text);
  outline: none;
  padding: 10px 12px;
}

.drawer-form textarea {
  resize: vertical;
}

code {
  color: #b8f4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.source-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.source-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.source-stats strong {
  margin: 2px 0 0;
}

.repair-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(25, 199, 122, 0.1);
}

.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 185, 60, 0.1);
}

.status-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 73, 101, 0.1);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast-msg {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: rgba(8, 17, 30, 0.96);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.toast-msg.warn {
  border-left-color: var(--amber);
}

.toast-msg.bad {
  border-left-color: var(--red);
}

.toast-msg strong,
.toast-msg span {
  display: block;
}

.toast-msg span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1260px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

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

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

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

  .topbar,
  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .metric-grid,
  .metric-grid.compact {
    grid-template-columns: 1fr;
  }

  .vod-grid,
  .channel-tile-grid {
    grid-template-columns: 1fr;
  }

  .vod-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .poster-box {
    width: 76px;
  }

  .source-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .source-option .mini-action {
    grid-column: 1 / -1;
  }

  .event-item,
  .event-list.full .event-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 24px;
    padding: 28px;
  }

  .cinema-stage {
    min-height: 300px;
    order: 1;
  }

  .login-card {
    order: 2;
    justify-self: center;
  }

  .cinema-wall {
    grid-auto-rows: 72px;
    transform: none;
  }

  .hero-feed {
    min-height: 160px;
  }

  .cinema-caption strong {
    font-size: 30px;
  }
}

@media (max-width: 620px) {
  .login-shell {
    gap: 18px;
    padding: 18px;
  }

  .cinema-stage {
    min-height: 190px;
    gap: 12px;
  }

  .cinema-topline {
    display: none;
  }

  .cinema-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 58px;
    gap: 8px;
  }

  .screen-panel {
    min-height: 58px;
  }

  .screen-panel:nth-child(n+6) {
    display: none;
  }

  .screen-panel span {
    padding: 10px 10px 0;
    font-size: 10px;
  }

  .screen-panel strong {
    padding: 3px 10px;
    font-size: 28px;
  }

  .hero-feed {
    min-height: 124px;
  }

  .wide-feed {
    min-height: 58px;
  }

  .cinema-caption strong {
    font-size: 24px;
  }

  .cinema-caption {
    display: none;
  }

  .login-card {
    padding: 22px;
  }

  .login-copy {
    margin: 26px 0 18px;
  }

  .login-copy h1 {
    font-size: 31px;
  }
}

/* Cinematic login redesign */
.login-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: stretch;
  gap: clamp(32px, 6vw, 112px);
  overflow: hidden;
  padding: clamp(24px, 5vw, 76px);
  background: #050806;
}

.login-photo {
  position: absolute;
  z-index: -3;
  inset: 0;
  background: url("assets/control-room-login.png") center / cover no-repeat;
}

.login-shell::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 7, 5, 0.72) 0%, rgba(2, 7, 5, 0.32) 43%, rgba(2, 7, 5, 0.84) 74%, rgba(2, 7, 5, 0.97) 100%);
  opacity: 1;
  animation: none;
}

.login-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  height: auto;
  transform: none;
  background: linear-gradient(180deg, rgba(2, 7, 5, 0.32), transparent 34%, rgba(2, 7, 5, 0.82));
  opacity: 1;
}

.login-hero,
.login-card {
  position: relative;
  z-index: 1;
}

.login-hero {
  min-width: 0;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0;
}

.login-hero-top,
.login-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(246, 237, 221, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(243, 183, 103, 0.42);
  border-radius: 999px;
  background: rgba(8, 12, 9, 0.52);
  color: #f2b767;
}

.hero-status i {
  color: #51d68e;
}

.login-hero-copy {
  margin: auto 0;
  padding: 64px 0;
}

.hero-kicker {
  margin: 0 0 14px;
  color: #f0b46b;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-hero h1 {
  max-width: 620px;
  margin: 0;
  color: #fff8ec;
  font-size: 68px;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
}

.hero-caption {
  max-width: 420px;
  margin: 24px 0 0;
  color: rgba(246, 237, 221, 0.8);
  font-size: 17px;
  line-height: 1.5;
}

.login-hero-footer {
  color: rgba(246, 237, 221, 0.58);
}

.login-hero-footer span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-hero-footer i {
  color: #56d790;
}

.login-card {
  width: min(430px, 100%);
  align-self: center;
  justify-self: end;
  padding: 34px;
  border: 1px solid rgba(255, 237, 205, 0.2);
  border-radius: 8px;
  background: rgba(8, 12, 9, 0.77);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px) saturate(0.86);
}

.login-shell .brand-mark {
  color: #181006;
  background: #f1ac5d;
  box-shadow: none;
}

.login-shell .brand-lockup strong {
  color: #fff8ed;
}

.login-shell .brand-lockup span,
.login-shell .eyebrow {
  color: #efb36c;
}

.login-shell .brand-lockup small {
  color: rgba(246, 237, 221, 0.62);
}

.login-copy {
  margin: 46px 0 26px;
}

.login-copy h2 {
  margin: 0;
  color: #fff8ed;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.login-shell .login-form {
  gap: 16px;
}

.login-shell .login-form label {
  color: rgba(246, 237, 221, 0.76);
}

.login-shell .login-form input {
  height: 48px;
  border-color: rgba(255, 237, 205, 0.19);
  border-radius: 6px;
  background: rgba(2, 5, 3, 0.62);
  color: #fff8ed;
}

.login-shell .login-form input:focus {
  border-color: #f1ac5d;
  box-shadow: 0 0 0 3px rgba(241, 172, 93, 0.15);
}

.login-shell .login-form button[type="submit"] {
  height: 48px;
  margin-top: 4px;
  border-radius: 6px;
  color: #1b1107;
  background: #f1ac5d;
  box-shadow: 0 12px 30px rgba(236, 160, 72, 0.2);
  transition: background-color 160ms ease, transform 160ms ease;
}

.login-shell .login-form button[type="submit"]:hover {
  background: #f7bf7a;
  transform: translateY(-1px);
}

.login-shell .login-form button[type="submit"]:focus-visible {
  outline: 3px solid rgba(241, 172, 93, 0.35);
  outline-offset: 2px;
}

.login-shell .login-status {
  margin-top: 30px;
  padding-top: 18px;
  border-top-color: rgba(255, 237, 205, 0.16);
  color: rgba(246, 237, 221, 0.58);
}

.login-shell .online-dot {
  color: #54d790;
}

@media (max-width: 980px) {
  .login-shell {
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding: 30px;
  }

  .login-photo {
    background-position: 36% center;
  }

  .login-shell::before {
    background: linear-gradient(180deg, rgba(2, 7, 5, 0.5), rgba(2, 7, 5, 0.72) 54%, rgba(2, 7, 5, 0.94));
  }

  .login-hero {
    min-height: 290px;
    max-width: none;
  }

  .login-hero-copy {
    margin: auto 0 0;
    padding: 52px 0 0;
  }

  .login-hero h1 {
    max-width: 540px;
    font-size: 56px;
  }

  .login-card {
    width: min(500px, 100%);
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .login-shell {
    gap: 24px;
    padding: 20px;
  }

  .login-hero {
    min-height: 230px;
  }

  .login-hero-top,
  .login-hero-footer {
    font-size: 10px;
  }

  .login-hero-copy {
    padding-top: 40px;
  }

  .login-hero h1 {
    font-size: 42px;
  }

  .hero-caption {
    margin-top: 16px;
    font-size: 15px;
  }

  .login-hero-footer {
    display: none;
  }

  .login-card {
    width: 100%;
    padding: 24px;
  }

  .login-copy {
    margin: 34px 0 22px;
  }

  .login-copy h2 {
    font-size: 30px;
  }
}
