/* ==========================================================================
   TecBunker Music (https://music.tecbunker.com) — Helles Studio-Design-System
   Für Desktop-Frontend, Mobile-Touch-Oberfläche & Admin-Backend
   ========================================================================== */

:root {
  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #E2E8F0;
  --border-hairline: #E2E8F0;
  --border-strong: #CBD5E1;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-faint: #94A3B8;

  --accent-ink: #0F172A;
  --accent-hover: #1E293B;
  --accent-focus: #334155;

  --status-ready-bg: #F1F5F9;
  --status-ready-fg: #0F172A;
  --status-pending-bg: #F8FAFC;
  --status-pending-fg: #475569;
  --status-error-bg: #FEF2F2;
  --status-error-fg: #991B1B;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

  --sidebar-w: 256px;
  --player-h: 92px;
  --mobile-nav-h: 62px;
  --mobile-mini-h: 64px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}

/* ==========================================================================
   Buttons, Inputs & Badges (Helles Monochrome Studio UI)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent-ink);
  color: #FFFFFF;
  border-color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: transparent;
}

.btn-danger {
  color: #991B1B;
  border-color: #FECACA;
  background: #FEF2F2;
}

.btn-danger:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.btn-icon-round {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
}

.badge-dark {
  background: var(--accent-ink);
  color: #FFFFFF;
  border-color: var(--accent-ink);
}

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

/* ==========================================================================
   Frontend Layout (Desktop & Mobile Shell)
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  padding-bottom: 0;
  transition: padding-bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

body.has-player .app-shell {
  padding-bottom: var(--player-h);
}

.app-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-hairline);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

body.has-player .app-sidebar {
  height: calc(100vh - var(--player-h));
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-ink);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

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

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-ink);
  color: #FFFFFF;
}

.nav-item-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.75;
}

/* Main Content Area */
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 460px;
}

.search-box .ui-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  padding-left: 38px;
  background: var(--bg-surface);
}

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

.content-container {
  padding: 24px 28px 48px;
  max-width: 1440px;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* ==========================================================================
   Cards Grid (Playlists & Albums)
   ========================================================================== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.media-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.media-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.media-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.media-card:hover .media-card-play {
  opacity: 1;
  transform: translateY(0);
}

.media-card-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   Playlist / Album Showcase Hero
   ========================================================================== */
.hero-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.hero-cover {
  width: 168px;
  height: 168px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.hero-info {
  flex: 1;
  min-width: 0;
}

.hero-kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.hero-desc {
  color: var(--text-secondary);
  margin: 0 0 14px;
  max-width: 680px;
}

.hero-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

/* ==========================================================================
   Track Table (Frontend & Admin)
   ========================================================================== */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.track-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.track-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 11px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}

.track-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

.track-table tbody tr:last-child td {
  border-bottom: none;
}

.track-row {
  transition: background-color 0.1s ease;
  cursor: pointer;
}

.track-row:hover {
  background-color: var(--bg-subtle);
}

.track-row.is-playing {
  background-color: #F1F5F9;
}

.track-cell-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.track-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.track-title-text {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.track-artist-text {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
}

/* ==========================================================================
   Persistenter Bottom-Audio-Player (Desktop)
   ========================================================================== */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
  z-index: 100;
  display: grid;
  grid-template-columns: 280px 1fr 290px;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
  /* Beim ersten Laden unsichtbar und nach unten verschoben */
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              visibility 0.45s;
}

body.has-player .player-bar,
.player-bar.is-active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.player-now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  flex-shrink: 0;
  cursor: pointer;
}

.player-meta {
  min-width: 0;
  flex: 1;
}

.player-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-timeline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 38px;
  text-align: center;
}

.waveform-scrubber {
  flex: 1;
  height: 36px;
  display: block;
  cursor: pointer;
  position: relative;
  user-select: none;
  touch-action: none;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-tooltip {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  background: var(--accent-ink);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s ease;
  box-shadow: var(--shadow-xs);
  z-index: 10;
}

.waveform-scrubber:hover .waveform-tooltip,
.waveform-scrubber.is-scrubbing .waveform-tooltip {
  opacity: 1;
}

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

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider {
  width: 84px;
  accent-color: var(--accent-ink);
  cursor: pointer;
}

/* ==========================================================================
   Mobile-Spezifisches Design (Optimiert für Smartphone-Displays)
   ========================================================================== */
.mobile-bottom-nav,
.mobile-mini-player,
.mobile-sheet {
  display: none;
}

@media (max-width: 880px), (pointer: coarse) and (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    transition: padding-bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.has-player .app-shell {
    padding-bottom: calc(var(--mobile-nav-h) + var(--mobile-mini-h) + env(safe-area-inset-bottom, 0px) + 20px);
  }

  .app-sidebar {
    display: none;
  }

  .player-bar {
    display: none;
  }

  .topbar {
    padding: 12px 16px;
  }

  .content-container {
    padding: 16px 16px 32px;
  }

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

  .hero-banner {
    flex-direction: column;
    text-align: center;
    padding: 18px;
  }

  .hero-cover {
    width: 140px;
    height: 140px;
  }

  .hero-meta, .hero-actions {
    justify-content: center;
  }

  .hide-mobile {
    display: none !important;
  }

  /* Schwebender Mobile Mini-Player */
  .mobile-mini-player {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
    height: var(--mobile-mini-h);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    box-shadow: var(--shadow-md);
    z-index: 120;
    /* Beim ersten Laden unsichtbar und nach unten verschoben */
    transform: translateY(calc(100% + 50px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease,
                visibility 0.45s;
  }

  body.has-player .mobile-mini-player,
  .mobile-mini-player.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-mini-progress {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 0;
    height: 2px;
    background: var(--bg-subtle);
    overflow: hidden;
  }

  .mobile-mini-progress-fill {
    height: 100%;
    background: var(--accent-ink);
    width: 0%;
  }

  /* Mobile Bottom Tab Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--border-strong);
    z-index: 110;
  }

  .mobile-tab-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
  }

  .mobile-tab-btn.active {
    color: var(--accent-ink);
    font-weight: 600;
  }
}

/* Erzwungene Mobile-Ansicht über /mobile */
body.force-mobile .app-shell {
  max-width: 480px;
  margin: 0 auto;
  grid-template-columns: 1fr;
  border-left: 1px solid var(--border-hairline);
  border-right: 1px solid var(--border-hairline);
  min-height: 100vh;
  background: var(--bg-canvas);
  padding-bottom: 148px;
}
body.force-mobile .app-sidebar,
body.force-mobile .player-bar {
  display: none;
}
body.force-mobile .mobile-mini-player,
body.force-mobile .mobile-bottom-nav {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
}
body.force-mobile .mobile-bottom-nav {
  display: grid;
  max-width: 480px;
}

/* Fullscreen Mobile Now-Playing Sheet */
.mobile-sheet {
  position: fixed;
  inset: 0;
  background: var(--bg-surface);
  z-index: 300;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

.mobile-sheet.open {
  display: flex;
}

.mobile-sheet-cover {
  width: min(76vw, 320px);
  height: min(76vw, 320px);
  border-radius: var(--radius-lg);
  object-fit: cover;
  margin: 12px auto;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Admin Studio Redesign (/admin) — Sidebar + Fixed Topbar + Main Container
   ========================================================================== */
:root {
  --admin-sidebar-w: 264px;
  --admin-topbar-h: 64px;
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  position: relative;
}

/* Linkes Sidebar-Menü */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: #0B1120;
  border-right: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-sidebar-brand {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1E293B;
  background: #070B14;
}

.admin-sidebar-brand .brand-mark {
  background: #38BDF8;
  color: #0B1120;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.admin-brand-info {
  min-width: 0;
}

.admin-brand-title {
  font-weight: 700;
  font-size: 14px;
  color: #F8FAFC;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.admin-brand-subtitle {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.admin-nav-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  padding: 0 10px 6px;
}

.admin-nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-nav-item {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #94A3B8;
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: none;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F1F5F9;
}

.admin-nav-item.active {
  background: #1E293B;
  color: #38BDF8;
  font-weight: 600;
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #38BDF8;
  border-radius: 0 3px 3px 0;
}

.admin-nav-item .admin-nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  background: #1E293B;
  color: #94A3B8;
  border: 1px solid #334155;
}

.admin-nav-item.active .admin-nav-badge {
  background: #38BDF8;
  color: #0B1120;
  border-color: #38BDF8;
}

.admin-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #1E293B;
  background: #070B14;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-footer-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #94A3B8;
}

/* Fixierter Header */
.admin-topbar {
  position: fixed;
  top: 0;
  left: var(--admin-sidebar-w);
  right: 0;
  height: var(--admin-topbar-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-module-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  white-space: nowrap;
}

.admin-topbar-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-quick-stream-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 20px;
  font-size: 12px;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Haupt-Container */
.admin-main {
  margin-left: var(--admin-sidebar-w);
  padding-top: var(--admin-topbar-h);
  flex: 1;
  min-width: 0;
  background: var(--bg-canvas);
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-content {
  padding: 24px 32px 80px;
  max-width: 1560px;
  margin: 0 auto;
}

/* Fallback-Klassen für bisheriges Markup */
.admin-body {
  padding: 0;
  max-width: 100%;
  width: 100%;
}

.admin-sidebar-toggle {
  display: none;
}

.admin-sidebar-backdrop {
  display: none;
}

@media (max-width: 980px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 95;
    backdrop-filter: blur(2px);
  }
  .admin-topbar {
    left: 0;
    padding: 0 16px;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-sidebar-toggle {
    display: inline-flex;
  }
  .admin-content {
    padding: 16px 16px 64px;
  }
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* Chunked Upload Dropzone */
.upload-dropzone {
  background: var(--bg-surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone.dragover {
  border-color: var(--accent-ink);
  background: var(--bg-subtle);
}

.upload-queue-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.progress-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-ink);
  width: 0%;
  transition: width 0.15s ease;
}

/* Schwebende Bulk-Edit Aktionsleiste */
.bulk-action-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--accent-ink);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 150;
  display: none;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.bulk-action-bar.visible {
  display: flex;
}

/* Modals (Einzel-Track-Editor, Massen-Tag-Editor, Playlist-Editor) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(3px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toast.error {
  border-left-color: #991B1B;
  background: #FEF2F2;
  color: #991B1B;
}

/* ==========================================================================
   LIVE-STREAMING, DJ-PROFIL & ARCHIV
   ========================================================================== */
.livestream-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.livestream-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .livestream-main-grid {
    grid-template-columns: 1fr;
  }
}

.livestream-player-box {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.livestream-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.livestream-offline-box {
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.live-dot-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-red 1.6s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.dj-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dj-avatar-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 3px solid var(--border-strong);
  margin: 0 auto;
  position: relative;
}

.dj-avatar-wrap.is-live {
  border-color: #EF4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.dj-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  transition: all 0.15s ease;
  text-decoration: none;
}

.social-btn:hover {
  background: var(--text-primary);
  color: var(--bg-surface);
  transform: translateY(-2px);
}

/* Stream Archiv Grid */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.archive-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.archive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.archive-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0F172A;
  overflow: hidden;
  cursor: pointer;
}

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

.archive-duration-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.archive-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.archive-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}


