@property --cover-glow-a {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(255, 90, 54, 0.14);
}

@property --cover-glow-b {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(59, 130, 246, 0.1);
}

@property --cover-base-tint {
  syntax: '<color>';
  inherits: true;
  initial-value: rgba(11, 13, 18, 0);
}

:root {
  --bg-deep: #0b0d12;
  --bg-surface: #141824;
  --bg-card: rgba(24, 29, 43, 0.85);
  --bg-card-hover: rgba(31, 37, 54, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-main: #f3f5f9;
  --text-muted: #98a2b3;
  --accent: #ff5a36;
  --accent-glow: rgba(255, 90, 54, 0.35);
  --accent-soft: rgba(255, 90, 54, 0.14);
  --live-green: #22c55e;
  --warn-amber: #f59e0b;
  --danger-red: #ef4444;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 15%, var(--cover-glow-a), transparent 52%),
    radial-gradient(circle at 80% 85%, var(--cover-glow-b), transparent 52%),
    linear-gradient(180deg, var(--cover-base-tint), var(--cover-base-tint)),
    var(--bg-deep);
  background-attachment: fixed;
  transition: --cover-glow-a 1.4s ease, --cover-glow-b 1.4s ease, --cover-base-tint 1.4s ease;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
input {
  font-family: inherit;
}

/* ---------- Shared Utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-live {
  background: rgba(255, 90, 54, 0.16);
  border-color: rgba(255, 90, 54, 0.45);
  color: #ff8c73;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.badge-live .badge-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: #ff6c4c;
  border-color: #ff6c4c;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.24);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.82rem;
}

/* ---------- Public Radio Page ---------- */
.radio-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.radio-stage-layout {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.radio-shell {
  width: 100%;
  max-width: 460px;
  order: 1;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  transition: max-width 0.2s ease;
}

.side-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.side-image-panel {
  order: 3;
  padding: 12px;
  justify-content: center;
  align-items: center;
}

.side-banner-img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.side-lyrics-panel {
  order: 2;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.side-panel-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.lyrics-viewport {
  height: 240px;
  overflow-y: auto;
  padding: 0 6px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.lyrics-content {
  padding: 96px 4px;
  white-space: pre-line;
  text-align: center;
  font-size: 0.96rem;
  line-height: 1.85;
  color: #e2e8f0;
}

.lyrics-content.is-empty {
  padding: 64px 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.radio-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.radio-header-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.radio-stage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radio-info-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.radio-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.radio-brand-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.artwork-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #252b3d 0%, #11141f 68%, #090b10 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.artwork-stage:hover {
  transform: scale(1.02);
  border-color: rgba(255, 90, 54, 0.35);
}

.artwork-stage:active {
  transform: scale(0.98);
}

.artwork-stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.artwork-stage.is-playing {
  box-shadow: 0 0 42px var(--accent-glow), 0 18px 40px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 90, 54, 0.45);
}

.artwork-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: spinDisc 18s linear infinite;
  animation-play-state: paused;
}

.artwork-stage.is-playing .artwork-disc {
  animation-play-state: running;
}

@keyframes spinDisc {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.artwork-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 90, 54, 0.9) 0%, rgba(255, 90, 54, 0.9) 18%, transparent 18.5%),
    repeating-radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.045) 0px,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 2px,
      transparent 5px
    ),
    conic-gradient(
      from 35deg,
      rgba(255, 255, 255, 0.12) 0deg,
      transparent 35deg,
      transparent 170deg,
      rgba(255, 255, 255, 0.1) 205deg,
      transparent 245deg,
      transparent 360deg
    ),
    radial-gradient(circle at center, #1b1f2c 0%, #0d0f17 75%, #07080c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.disc-center-hole {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 4px solid rgba(255, 90, 54, 0.75);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
  z-index: 2;
}

.equalizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 24px;
  margin-bottom: 14px;
}

.equalizer span {
  width: 4px;
  height: 5px;
  border-radius: 99px;
  background: var(--accent);
  opacity: 0.45;
  transition: height 0.2s ease, opacity 0.2s ease;
}

.equalizer.is-playing span {
  opacity: 1;
  animation: eqBounce 0.9s ease-in-out infinite alternate;
}

.equalizer.is-playing span:nth-child(2) {
  animation-delay: 0.15s;
}
.equalizer.is-playing span:nth-child(3) {
  animation-delay: 0.35s;
}
.equalizer.is-playing span:nth-child(4) {
  animation-delay: 0.1s;
}
.equalizer.is-playing span:nth-child(5) {
  animation-delay: 0.28s;
}

@keyframes eqBounce {
  0% {
    height: 6px;
  }
  100% {
    height: 24px;
  }
}

.track-meta {
  text-align: center;
  margin-bottom: 20px;
}

.track-title {
  margin: 0 0 4px;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.track-artist {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.progress-wrap {
  margin-bottom: 22px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff9259);
  transition: width 0.25s linear;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-tune {
  width: 100%;
  padding: 15px 20px;
  border-radius: 16px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.secondary-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.volume-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.volume-slider {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.status-note {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 20px;
}

.status-note:empty {
  display: none;
}

.listener-visits-pill {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.creator-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.creator-info {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
}

.creator-label {
  color: var(--text-muted);
}

.creator-name-link {
  font-weight: 700;
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-color: rgba(255, 90, 54, 0.6);
  text-underline-offset: 3px;
}

.creator-name-link:hover {
  color: #ff8c73;
}

.btn-tiktok {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #161823 0%, #24283b 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: -2px 0 14px rgba(37, 244, 238, 0.18), 2px 0 14px rgba(254, 44, 85, 0.2);
  transition: transform 0.14s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-tiktok:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: -3px 0 20px rgba(37, 244, 238, 0.34), 3px 0 20px rgba(254, 44, 85, 0.36);
}

.btn-tiktok:active {
  transform: scale(0.98);
}

.tiktok-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(-1px 0 0 #25f4ee) drop-shadow(1px 0 0 #fe2c55);
}

.radio-footer {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.radio-footer a:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* ---------- Mobile Header & Focused Lyrics Layout ---------- */
@media (max-width: 767px) {
  .radio-header {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .radio-brand {
    min-width: 0;
  }

  .radio-brand-name {
    font-size: 1.08rem;
  }

  .radio-header-badges {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
  }

  .radio-header-badges .badge {
    padding: 4px 9px;
    font-size: 0.7rem;
  }

  #liveBadge {
    order: 1;
  }

  .listener-visits-pill {
    order: 2;
  }

  .radio-stage-layout .side-lyrics-panel {
    height: 95vh;
    height: 95dvh;
    scroll-margin-top: 10px;
  }

  .radio-stage-layout .side-lyrics-panel .lyrics-viewport {
    flex: 1;
    height: auto;
    min-height: 0;
  }
}

/* ---------- Desktop Horizontal Player Layout ---------- */
@media (min-width: 768px) {
  .radio-stage-layout {
    max-width: 860px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
  }

  .radio-shell {
    grid-column: 1 / -1;
    max-width: none;
    padding: 30px 34px 26px;
  }

  .side-image-panel {
    order: 2;
  }

  .side-lyrics-panel {
    order: 3;
  }

  .side-image-panel.hidden ~ .side-lyrics-panel {
    grid-column: 1 / -1;
  }

  .radio-header {
    margin-bottom: 26px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  .radio-brand-name {
    font-size: 1.35rem;
  }

  .radio-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    align-items: center;
  }

  .artwork-stage {
    width: 225px;
    height: 225px;
    margin-bottom: 18px;
  }

  .equalizer {
    margin-bottom: 0;
  }

  .track-meta {
    text-align: left;
    margin-bottom: 18px;
  }

  .track-title {
    font-size: 1.5rem;
  }

  .status-note {
    text-align: left;
    margin-top: 12px;
  }

  .creator-card {
    margin-top: 22px;
    padding: 14px 18px;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .creator-info {
    justify-content: flex-start;
  }

  .btn-tiktok {
    width: auto;
    padding: 10px 18px;
  }
}

@media (min-width: 1120px) {
  .radio-stage-layout {
    max-width: 1380px;
    grid-template-columns: minmax(220px, 270px) minmax(540px, 760px) minmax(260px, 330px);
    gap: 22px;
    justify-content: center;
    align-items: stretch;
  }

  .radio-stage-layout.no-side-image {
    grid-template-columns: minmax(560px, 800px) minmax(280px, 350px);
  }

  .side-image-panel {
    order: 1;
  }

  .radio-shell {
    grid-column: auto;
    order: 2;
  }

  .side-lyrics-panel {
    order: 3;
  }

  .side-image-panel.hidden ~ .side-lyrics-panel {
    grid-column: auto;
  }

  .side-banner-img {
    max-height: 440px;
  }

  .lyrics-viewport {
    height: 365px;
  }
}

/* ---------- Admin Panel ---------- */
.admin-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.login-wrapper {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

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

.admin-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.col-7 {
  grid-column: span 7;
}
.col-5 {
  grid-column: span 5;
}
.col-12 {
  grid-column: span 12;
}

@media (max-width: 900px) {
  .col-7,
  .col-5 {
    grid-column: span 12;
  }
}

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

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.alert-error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-ok {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text-main);
  font-size: 0.94rem;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.live-monitor-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--border);
}

.queue-list,
.track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.queue-item,
.track-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.queue-item.is-current {
  border-color: rgba(255, 90, 54, 0.5);
  background: rgba(255, 90, 54, 0.09);
}

.track-item.is-disabled {
  opacity: 0.55;
}

.item-main {
  min-width: 0;
  flex: 1;
}

.item-title {
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.tag-manual {
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Admin Tabs & Analytics Dashboard ---------- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
}

.tab-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.period-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.period-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.period-btn.is-active {
  background: rgba(255, 90, 54, 0.18);
  border-color: rgba(255, 90, 54, 0.5);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.col-6 {
  grid-column: span 6;
}

@media (max-width: 900px) {
  .col-6 {
    grid-column: span 12;
  }
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff9259);
  transition: width 0.3s ease;
}

.bar-fill-green {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.bar-fill-blue {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.bar-fill-gray {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.tag-human {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.tag-bot {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
}

.tag-repeat {
  border-color: rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.16);
}

.side-image-admin-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.side-image-preview-thumb {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 8, 12, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.lyrics-textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.5;
  font-family: var(--font-sans);
}

/* ---------- Studio Admin Layout (Mockup Style) ---------- */
.studio-body {
  background: #030305;
}

.studio-shell {
  display: grid;
  grid-template-columns: 245px 1fr;
  min-height: 100vh;
  padding-bottom: 60px;
  background:
    radial-gradient(ellipse 70% 55% at 55% 28%, var(--cover-glow-a), transparent 72%),
    radial-gradient(circle at 85% 82%, var(--cover-glow-b), transparent 55%),
    linear-gradient(180deg, var(--cover-base-tint), var(--cover-base-tint)),
    #060609;
  transition: --cover-glow-a 1.4s ease, --cover-glow-b 1.4s ease, --cover-base-tint 1.4s ease;
}

.studio-shell.is-collapsed {
  grid-template-columns: 76px 1fr;
}

.studio-sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: #0a0a0e;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 16px;
}

.sidebar-brand {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-shell.is-collapsed .sidebar-brand,
.studio-shell.is-collapsed .nav-label,
.studio-shell.is-collapsed .nav-badge {
  display: none;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.icon-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
}

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-item-danger:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
}

.nav-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.studio-main {
  padding: 24px 28px 34px;
  min-width: 0;
}

.studio-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.studio-listener-mirror {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.home-player-card {
  grid-column: 1 / -1;
}

.home-stage-grid {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.home-disc-wrap .artwork-stage {
  width: 165px;
  height: 165px;
  margin: 0;
}

.home-meta-wrap {
  flex: 1;
  min-width: 220px;
}

.home-side-image-card {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-listener-mirror .home-side-image-card.hidden ~ .home-lyrics-card {
  grid-column: 1 / -1;
}

@media (min-width: 1220px) {
  .studio-listener-mirror {
    grid-template-columns: 230px 1fr 290px;
  }
  .home-player-card {
    grid-column: auto;
  }
  .studio-listener-mirror.no-side-image {
    grid-template-columns: 1fr 310px;
  }
  .studio-listener-mirror .home-side-image-card.hidden ~ .home-lyrics-card {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }
  .studio-sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    width: 250px;
    height: calc(100vh - 60px);
    transition: left 0.2s ease;
  }
  .studio-sidebar.is-open {
    left: 0;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.75);
  }
  .studio-mobile-bar {
    display: flex;
  }
  .studio-main {
    padding: 16px 14px 28px;
  }
  .studio-listener-mirror {
    grid-template-columns: 1fr;
  }
}

/* ---------- Bottom Studio Player Bar ---------- */
.studio-player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: #0d0e13;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  z-index: 40;
}

.bar-progress-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

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

.bar-thumb-wrap {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  background: #1b1e2a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bar-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bar-thumb-vinyl {
  font-size: 1.15rem;
}

.bar-track-info {
  min-width: 0;
}

.bar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bar-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.bar-icon-btn svg {
  width: 17px;
  height: 17px;
  display: block;
}

.bar-icon-btn:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.bar-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bar-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #0b0d12;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease;
}

.bar-play-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

.bar-play-btn:hover:not(:disabled) {
  transform: scale(1.06);
}

.bar-play-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bar-time-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-muted);
}

.bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bar-volume-slider {
  max-width: 100px;
}

@media (max-width: 680px) {
  .bar-time-row,
  .bar-volume-slider,
  #barEditCurrentBtn {
    display: none;
  }
  .studio-player-bar {
    grid-template-columns: 1fr auto auto;
    padding: 0 12px;
  }
}

.notif-item.is-unread {
  border-color: rgba(255, 90, 54, 0.45);
  background: rgba(255, 90, 54, 0.08);
}
