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

:root {
  --bg: #0a0a0f;
  --bg-card: #14141f;
  --bg-surface: #1a1a2e;
  --bg-hover: #222240;
  --text: #e0e0e0;
  --text-muted: #8888a0;
  --text-dim: #555570;
  --border: #2a2a40;
  --accent: #f39c12;
  --live: #e74c3c;
  --live-bg: rgba(231, 76, 60, 0.15);
  --conflict: #e74c3c;
  --conflict-bg: rgba(231, 76, 60, 0.12);
  --fav: #f1c40f;
  --now-line: #e74c3c;
  --radius: 8px;
  --radius-sm: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 52px;
}

.nav-title {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--accent);
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tab.active {
  color: var(--text);
  background: var(--bg-surface);
}

.badge {
  background: var(--text-dim);
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.tab.active .badge {
  background: var(--accent);
  color: #000;
}

.nav-conflict {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--conflict);
  font-size: 13px;
  font-weight: 600;
  cursor: default;
}

.conflict-icon {
  font-size: 16px;
}

/* Main */
#content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 16px;
}

/* Stage Toggles */
.stage-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  user-select: none;
  background: transparent;
  color: var(--text-muted);
}

.toggle:hover {
  background: var(--bg-hover);
}

.toggle.active {
  background: color-mix(in srgb, var(--color) 18%, transparent);
  border-color: var(--color);
  color: var(--text);
}

.toggle input {
  display: none;
}

.toggle-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color);
  opacity: 0.4;
  transition: opacity 0.15s;
}

.toggle.active .toggle-indicator {
  opacity: 1;
}

/* Now Banner */
.now-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.now-banner-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.now-banner-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.now-banner-value {
  color: var(--text);
  font-size: 13px;
}

.now-banner-value strong {
  color: var(--accent);
}

.now-banner-value .stage-tag {
  display: inline-block;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin: 0 2px;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 4px;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Timetable */
.timetable-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.timetable-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.th-spacer {
  flex: 0 0 56px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.th-item {
  flex: 1;
  min-width: 180px;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid var(--border);
}

.th-item:last-child {
  border-right: none;
}

.timetable-divider {
  position: absolute;
  left: 56px;
  right: 0;
  height: 1px;
  background: var(--border);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

.timetable-container {
  overflow-x: auto;
}

.timetable {
  display: flex;
  min-height: 600px;
  position: relative;
}

.time-axis {
  flex: 0 0 56px;
  position: relative;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.time-label {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  transform: translateY(-50%);
  padding-right: 8px;
  font-weight: 500;
}

.stage-column {
  flex: 1;
  min-width: 180px;
  position: relative;
  border-right: 1px solid var(--border);
}

.stage-column:last-child {
  border-right: none;
}

.stage-column-body {
  position: relative;
  min-height: inherit;
}

.slot {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid var(--slot-color);
  background: color-mix(in srgb, var(--slot-color) 12%, var(--bg-surface));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 28px;
}

.slot:hover {
  background: color-mix(in srgb, var(--slot-color) 22%, var(--bg-surface));
}

.slot.past {
  opacity: 0.3;
}

.slot.live {
  background: color-mix(in srgb, var(--slot-color) 25%, var(--bg-surface));
  border-color: var(--live);
  box-shadow: 0 0 12px color-mix(in srgb, var(--live) 30%, transparent);
}

.slot-artist {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-time {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.slot-genre {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-badge {
  display: inline-block;
  background: var(--live);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  animation: pulse-badge 2s ease-in-out infinite;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.slot-fav-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-dim);
  transition: all 0.15s;
  z-index: 2;
  line-height: 1;
}

.slot-fav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fav);
}

.slot-fav-btn.favourited {
  color: var(--fav);
}

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--now-line);
  z-index: 5;
  pointer-events: none;
}

.now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--now-line);
}

/* Empty / no stages */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

/* Artists */
.artists-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.artists-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.artists-search:focus {
  border-color: var(--accent);
}

.artists-search::placeholder {
  color: var(--text-dim);
}

.artists-filter {
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 130px;
}

.artists-filter:focus {
  border-color: var(--accent);
}

.artist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.artist-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.artist-entry:hover {
  border-color: var(--text-dim);
}

.artist-fav-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
  color: var(--text-dim);
}

.artist-fav-btn:hover {
  background: var(--bg-hover);
}

.artist-fav-btn.favourited {
  color: var(--fav);
}

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

.artist-name {
  font-size: 15px;
  font-weight: 600;
}

.artist-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
}

.artist-meta .tag {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.artist-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Favourites */
.favourites-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.favourites-count {
  font-size: 14px;
  color: var(--text-muted);
}

.conflict-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.conflict-card {
  padding: 10px 14px;
  background: var(--conflict-bg);
  border: 1px solid var(--conflict);
  border-radius: var(--radius);
  font-size: 13px;
}

.conflict-card .conflict-head {
  font-weight: 600;
  color: var(--conflict);
  margin-bottom: 4px;
}

.conflict-card .conflict-detail {
  color: var(--text-muted);
  font-size: 12px;
}

.conflict-card .conflict-status {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

.fav-slot-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fav-slot-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.fav-slot-entry.conflicting {
  border-color: var(--conflict);
  background: var(--conflict-bg);
}

.fav-slot-stage {
  width: 4px;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 2px;
}

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

.fav-slot-artist {
  font-size: 14px;
  font-weight: 600;
}

.fav-slot-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.fav-slot-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.fav-slot-status.live-status {
  background: var(--live-bg);
  color: var(--live);
}

.fav-slot-status.past-status {
  color: var(--text-dim);
}

.fav-slot-status.future-status {
  color: var(--text-muted);
}

/* No results */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.no-results h3 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-inner {
    gap: 8px;
    padding: 0 10px;
  }

  .nav-title {
    font-size: 14px;
  }

  .tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  #content {
    padding: 10px;
  }

  .stage-column {
    min-width: 140px;
  }

  .artist-entry {
    flex-wrap: wrap;
  }

  .now-banner {
    flex-direction: column;
    gap: 4px;
  }
}
