:root {
  --bg: #07111f;
  --surface: rgba(12, 21, 41, 0.86);
  --surface-soft: rgba(18, 31, 58, 0.72);
  --line: rgba(147, 181, 255, 0.16);
  --text: #f5f8ff;
  --muted: #9fb0d5;
  --pink: #ff0f88;
  --violet: #8929ff;
  --blue: #16b4ff;
  --green: #41ffb2;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 30px 90px rgba(2, 8, 24, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 15, 136, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(22, 180, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #030816 0%, #07111f 45%, #0a1631 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 40px 40px;
}

.hidden {
  display: none !important;
}

.admin-shell {
  position: relative;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 24px 18px 64px;
}

.login-panel,
.dashboard {
  position: relative;
  z-index: 1;
}

.login-panel {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  gap: 24px;
}

.admin-logo {
  width: 220px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.28));
}

.login-card,
.glass-card,
.admin-panel,
.nav-chip,
.session-pill,
.playlist-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 520px);
  padding: 32px;
  border-radius: var(--radius-xl);
}

.eyebrow,
.card-kicker {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--muted);
}

.login-card h1,
.dashboard-topbar h1,
.admin-panel h2,
.glass-card h2 {
  font-family: "Syne", sans-serif;
  margin: 8px 0 0;
}

.login-text,
.glass-card p,
.playlist-card p,
.global-message,
.form-message {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

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

.full-row {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 0.92rem;
  color: #d5def7;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  color-scheme: dark;
}

textarea {
  resize: vertical;
}

select option {
  color: var(--text);
  background: #15233f;
}

.button-primary,
.ghost-button,
.ghost-link,
.nav-chip {
  min-height: 48px;
  border-radius: 999px;
  font: inherit;
}

.button-primary {
  border: 0;
  color: var(--text);
  background: linear-gradient(135deg, var(--pink), var(--violet) 50%, var(--blue));
  font-weight: 700;
  cursor: pointer;
}

.ghost-button,
.nav-chip,
.ghost-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.ghost-button {
  padding: 0 16px;
  cursor: pointer;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  text-decoration: none;
}

.dashboard-topbar,
.topbar-actions,
.overview-grid,
.dashboard-nav,
.panel-heading,
.playlist-meta {
  display: flex;
  gap: 16px;
}

.dashboard-topbar {
  align-items: center;
  justify-content: space-between;
}

.topbar-actions {
  align-items: center;
  flex-wrap: wrap;
}

.session-pill {
  padding: 10px 16px;
  border-radius: 999px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.glass-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.dashboard-nav {
  flex-wrap: wrap;
  margin-top: 28px;
}

.nav-chip {
  padding: 0 16px;
  cursor: pointer;
}

.nav-chip.active {
  background: linear-gradient(135deg, rgba(255, 15, 136, 0.22), rgba(22, 180, 255, 0.18));
}

.panel-grid {
  margin-top: 28px;
}

.admin-panel {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.panel-heading {
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-row input {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.track-picker-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.picker-grid {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.picker-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.picker-option input {
  width: auto;
  margin-top: 4px;
}

.picker-option strong {
  display: block;
  margin-bottom: 4px;
}

.table-actions button,
.playlist-card button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 12px;
  min-height: 40px;
  padding: 0 12px;
  cursor: pointer;
}

.card-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.playlist-card {
  padding: 18px;
  border-radius: var(--radius-md);
}

.playlist-card strong {
  display: inline-block;
  margin-bottom: 6px;
}

.playlist-card.active {
  border-color: rgba(65, 255, 178, 0.28);
  box-shadow: 0 0 0 1px rgba(65, 255, 178, 0.15) inset, var(--shadow);
}

.playlist-meta {
  justify-content: space-between;
  align-items: center;
}

.playlist-meta > div {
  flex: 1;
}

.card-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d8e3ff;
  font-size: 0.84rem;
}

.swatch {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-right: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.pill-active {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(65, 255, 178, 0.12);
  color: var(--green);
}

.global-message,
.form-message {
  margin-top: 18px;
  min-height: 24px;
}

.ui-help,
.guide-card,
.timeline-shell,
.planner-shell,
.step-card,
.asset-sidebar,
.show-editor,
.inspector-panel {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.ui-help,
.timeline-shell,
.planner-shell {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.ui-help strong,
.guide-card strong,
.timeline-head h3 {
  display: block;
  margin-bottom: 8px;
}

.expert-shell {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
  padding: 14px 16px 4px;
}

.expert-shell summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.ui-help p,
.guide-card p,
.field-hint,
.timeline-caption,
.timeline-row-meta,
.timeline-bar small {
  color: var(--muted);
}

.field-hint {
  font-size: 0.82rem;
  line-height: 1.5;
}

.compact-form {
  margin-top: 18px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.planner-steps,
.studio-workspace {
  display: grid;
  gap: 16px;
}

.planner-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.step-card {
  padding: 18px;
  border-radius: var(--radius-md);
}

.step-card.active {
  background: linear-gradient(135deg, rgba(255, 15, 136, 0.16), rgba(22, 180, 255, 0.14));
}

.step-card span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.planner-form {
  grid-template-columns: 1.1fr 1.1fr 0.8fr 0.8fr 1fr;
  align-items: end;
}

.planner-cta {
  display: flex;
  align-items: end;
  height: 100%;
}

.planner-cta-stack {
  display: grid;
  gap: 10px;
  width: 100%;
}

.day-timeline-shell,
.show-timeline-shell {
  margin-top: 18px;
}

.show-timeline-shell {
  position: relative;
}

.show-timeline-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.show-lane-labels {
  display: grid;
  gap: 12px;
  padding-top: 42px;
}

.show-lane-label {
  min-height: 92px;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
}

.timeline-scroll-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
}

.timeline-static-shell {
  width: 100%;
  max-width: 100%;
}

.day-hours,
.show-ruler {
  display: grid;
  margin-bottom: 10px;
}

.day-hours span,
.show-ruler span {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.day-hours {
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.show-ruler {
  position: relative;
  display: block;
  min-height: 34px;
  min-width: 1440px;
}

.show-ruler span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.day-track,
.show-track {
  position: relative;
  min-height: 128px;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    rgba(255,255,255,0.025);
  background-size: 60px 100%;
}

.show-track {
  min-height: 312px;
  background:
    linear-gradient(180deg, transparent 0, transparent 100px, rgba(255,255,255,0.08) 100px, rgba(255,255,255,0.08) 101px, transparent 101px),
    linear-gradient(180deg, transparent 0, transparent 206px, rgba(255,255,255,0.08) 206px, rgba(255,255,255,0.08) 207px, transparent 207px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    rgba(255,255,255,0.025);
  background-size: 100% 100%, 100% 100%, 60px 100%, auto;
  min-width: 1440px;
}

.day-track {
  background-size: calc(100% / 24) 100%;
}

.day-block,
.show-item-block {
  position: absolute;
  border-radius: 18px;
  padding: 10px 12px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 16px 32px rgba(3, 8, 24, 0.28);
}

.day-block {
  top: 12px;
  bottom: 12px;
  background: linear-gradient(135deg, rgba(255, 15, 136, 0.42), rgba(22, 180, 255, 0.34));
  min-width: 84px;
  padding-right: 42px;
  min-height: 92px;
}

.day-block-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.48);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.9rem;
}

.day-block.selected,
.show-item-block.selected {
  box-shadow: 0 0 0 1px rgba(65,255,178,0.3), 0 16px 32px rgba(3, 8, 24, 0.28);
}

.day-block strong,
.show-item-block strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.18;
}

.show-item-block strong {
  margin-bottom: 0;
  font-size: 0.98rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

.studio-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 340px);
  grid-template-areas:
    "show show"
    "assets inspector";
  align-items: start;
}

.asset-sidebar,
.show-editor,
.inspector-panel {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.show-editor {
  grid-area: show;
}

.asset-sidebar {
  grid-area: assets;
}

.inspector-panel {
  grid-area: inspector;
}

.show-editor,
.inspector-panel,
.asset-sidebar,
.day-timeline-shell,
.show-timeline-shell {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.planner-block-popover {
  position: fixed;
  z-index: 16;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(16, 27, 49, 0.98), rgba(9, 19, 36, 0.98)),
    rgba(8, 16, 29, 0.98);
  box-shadow: 0 24px 48px rgba(2, 8, 22, 0.42);
  backdrop-filter: blur(18px);
  overscroll-behavior: contain;
}

.planner-block-popover::before {
  display: none;
}

.planner-block-popover-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.planner-block-popover-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.planner-block-popover-title {
  margin: 6px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
}

.planner-block-popover-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.planner-block-popover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.planner-block-popover-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
}

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

.planner-block-popover-grid label {
  display: grid;
  gap: 6px;
}

.planner-block-popover-grid label.full-row {
  grid-column: 1 / -1;
}

.planner-block-popover-grid span {
  color: var(--muted);
  font-size: 0.84rem;
}

.planner-block-popover-grid span strong {
  color: var(--text);
  font-weight: 700;
  margin-left: 6px;
}

.planner-block-popover-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.planner-block-popover-actions .button-primary,
.planner-block-popover-actions .ghost-button {
  flex: 1 1 150px;
}

.danger-button {
  border-color: rgba(255, 92, 125, 0.35);
  color: #ffd6df;
}

.danger-button:hover {
  border-color: rgba(255, 92, 125, 0.6);
  background: rgba(255, 92, 125, 0.12);
}

.panel-heading.compact h3 {
  margin-top: 6px;
  font-size: 1.2rem;
}

.asset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.asset-tab {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
}

.asset-tab.active {
  background: linear-gradient(135deg, rgba(255, 15, 136, 0.2), rgba(22, 180, 255, 0.16));
}

.asset-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.planner-asset-filter {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.planner-asset-filter span {
  color: var(--muted);
  font-size: 0.84rem;
}

.asset-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: grab;
}

.asset-card.selected {
  border-color: rgba(22, 180, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(22, 180, 255, 0.28) inset;
}

.asset-card strong {
  display: block;
  margin-bottom: 4px;
}

.asset-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.asset-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.asset-append-button {
  width: 100%;
}

.show-item-block {
  top: 18px;
  height: 86px;
  padding: 14px 14px;
  background: linear-gradient(135deg, rgba(22,180,255,0.52), rgba(137,41,255,0.42));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.show-item-block.voice_track,
.show-item-block.tts {
  top: 124px;
  background: linear-gradient(135deg, rgba(255,15,136,0.58), rgba(137,41,255,0.44));
}

.show-item-block.news {
  top: 124px;
  background: linear-gradient(135deg, rgba(65,255,178,0.48), rgba(22,180,255,0.34));
}

.show-item-block.jingle,
.show-item-block.show_opener {
  top: 230px;
  background: linear-gradient(135deg, rgba(255,171,45,0.55), rgba(255,15,136,0.36));
}

.show-item-block.ad_break,
.show-item-block.promo {
  top: 230px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(22,180,255,0.28));
}

.day-block small,
.show-item-block small {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.show-item-block small {
  display: none;
}

.planner-item-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.guide-card {
  padding: 18px;
  border-radius: var(--radius-md);
}

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

.timeline-visual {
  display: grid;
  gap: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: center;
}

.timeline-row-meta strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-track {
  position: relative;
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    rgba(255, 255, 255, 0.02);
  background-size: calc(100% / 12) 100%;
  overflow: hidden;
}

.timeline-bar {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 110px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(3, 8, 24, 0.28);
}

.timeline-bar strong {
  font-size: 0.92rem;
}

.timeline-bar.current {
  box-shadow: 0 0 0 1px rgba(65, 255, 178, 0.22), 0 12px 24px rgba(3, 8, 24, 0.28);
}

.timeline-bar.music_block,
.timeline-bar.song {
  background: linear-gradient(135deg, rgba(22, 180, 255, 0.58), rgba(137, 41, 255, 0.5));
}

.timeline-bar.voice_track,
.timeline-bar.tts {
  background: linear-gradient(135deg, rgba(255, 15, 136, 0.62), rgba(137, 41, 255, 0.52));
}

.timeline-bar.news {
  background: linear-gradient(135deg, rgba(65, 255, 178, 0.45), rgba(22, 180, 255, 0.46));
}

.timeline-bar.jingle,
.timeline-bar.show_opener {
  background: linear-gradient(135deg, rgba(255, 171, 45, 0.55), rgba(255, 15, 136, 0.45));
}

.timeline-bar.ad_break {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(22, 180, 255, 0.36));
}

@media (max-width: 920px) {
  .two-col,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .planner-steps,
  .studio-workspace,
  .planner-form {
    grid-template-columns: 1fr;
  }

  .studio-workspace {
    grid-template-areas:
      "show"
      "assets"
      "inspector";
  }

  .show-timeline-grid {
    grid-template-columns: 1fr;
  }

  .planner-block-popover {
    position: static;
    width: 100%;
    margin-top: 16px;
  }

  .planner-block-popover::before {
    display: none;
  }

  .show-lane-labels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
  }

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

  .timeline-head {
    flex-direction: column;
    align-items: stretch;
  }
}
