:root {
  --bg: #111024;
  --dark: #080711;
  --panel: #17152b;
  --panel-2: #211b3d;
  --ink: #f8fafc;
  --muted: #aaa3c7;
  --line: rgba(255, 255, 255, .12);
  --purple: #7c3dff;
  --pink: #ff4d9a;
  --green: #28e68a;
  --gold: #ffd166;
  --danger: #ff5c7a;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(160deg, var(--dark) 0%, var(--bg) 44%, #180d2d 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-weight: 800;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--purple), var(--pink), #ff7b4a);
  box-shadow: 0 12px 30px rgba(255, 77, 154, .18);
}

button.ghost { background: transparent; }
button.danger { color: white; border-color: rgba(255, 92, 122, .45); background: rgba(255, 92, 122, .14); }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(100%, 420px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(150deg, rgba(124, 61, 255, .16), rgba(255, 77, 154, .08), rgba(255, 123, 74, .08)),
    rgba(23, 21, 43, .94);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  display: block;
  margin: 0 auto 14px;
  border: 1px solid rgba(255, 255, 255, .18);
}

.login-card h1 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 34px;
  line-height: 38px;
  font-weight: 950;
}

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

.login-status {
  min-height: 20px;
  margin: 0;
  color: var(--pink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.locked .shell,
.signed-in .login-screen {
  display: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 7, 17, .98), rgba(17, 16, 36, .96)),
    var(--dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .18);
  background: var(--dark);
}

.brand strong { display: block; font-size: 20px; }
.brand span { display: block; color: var(--muted); font-size: 13px; }

.nav {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}

.nav.active {
  border-color: rgba(255, 77, 154, .48);
  background: linear-gradient(135deg, rgba(124, 61, 255, .28), rgba(255, 77, 154, .14));
}

.workspace {
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 950;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; }
h2 { margin-bottom: 12px; }
p { color: var(--muted); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

#connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 18px currentColor;
}

#connection-dot.connected { background: var(--green); }

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
  background:
    linear-gradient(150deg, rgba(124, 61, 255, .08), rgba(255, 77, 154, .04)),
    rgba(23, 21, 43, .9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.auth-panel {
  border-color: rgba(255, 209, 102, .28);
}

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

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

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

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

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: rgba(8, 7, 17, .38);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(255, 77, 154, .48);
  box-shadow: 0 0 0 3px rgba(255, 77, 154, .09);
}

textarea { resize: vertical; }

.media-tools {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  align-items: end;
  gap: 12px;
}

.file-input {
  min-height: 48px;
}

.upload-status {
  min-height: 48px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .045);
  font-size: 13px;
  font-weight: 800;
}

.image-preview {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .045);
}

.image-preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.view { display: none; }
.view.active { display: block; }

.editor {
  display: grid;
  gap: 12px;
}

.panel-subsection {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
}

.panel-subsection h3 {
  margin: 0 0 12px;
}

.list, .cards {
  display: grid;
  gap: 10px;
}

.row, .card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .045);
}

.zone-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 7, 17, .88), rgba(124, 61, 255, .28), rgba(255, 77, 154, .18)),
    rgba(23, 21, 43, .92);
}

.zone-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--zone-image);
  background-size: cover;
  background-position: center;
  opacity: .24;
}

.zone-card > * {
  position: relative;
  z-index: 1;
}

.zone-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.zone-emoji {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(8, 7, 17, .44);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 25px;
}

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

.row h3, .card h3 { margin: 0 0 6px; }
.row p, .card p { margin-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(124, 61, 255, .22);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.badge.live { background: rgba(40, 230, 138, .18); color: var(--green); }
.badge.hidden, .badge.rejected, .badge.reported { background: rgba(255, 92, 122, .18); color: var(--danger); }
.badge.draft, .badge.scheduled { background: rgba(255, 209, 102, .16); color: var(--gold); }

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

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

.checklist span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .05);
}

.checklist.editable label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
}

.checklist.editable input {
  width: auto;
  min-width: 18px;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid.two, .grid.three, .cards, .checklist { grid-template-columns: 1fr; }
}
