:root {
  --surface: rgba(7, 18, 34, 0.72);
  --surface-strong: rgba(8, 18, 34, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #edf4ff;
  --muted: #9eb0c9;
  --primary: #78f0c5;
  --primary-strong: #3fd2ff;
  --accent: #ff8f70;
  --bg-start: #06101d;
  --bg-mid: #0b1628;
  --bg-end: #12233b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body.nexus-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--primary-strong) 24%, transparent), transparent 28%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 20%, transparent), transparent 24%),
    linear-gradient(145deg, var(--bg-start) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
}

body.modal-open {
  overflow: hidden;
}

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

img {
  display: block;
  width: 100%;
}

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

.page-shell,
.auth-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.admin-layout {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 24px 0 48px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
}

.admin-content {
  min-width: 0;
}

.auth-brand,
.glass-panel,
.modal-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-brand::after,
.glass-panel::after,
.modal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%);
}

.auth-brand,
.glass-panel,
.modal-card {
  padding: 28px;
}

.auth-brand {
  padding: 42px;
}

.site-header,
.section-head,
.modal-head,
.list-row,
.user-chip,
.pill-row,
.form-actions,
.front-menu,
.admin-nav-link,
.slider-controls {
  display: flex;
  align-items: center;
}

.site-header,
.section-head,
.modal-head {
  justify-content: space-between;
  gap: 20px;
}

.site-header {
  margin-bottom: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* ============================================
   TOP NAVIGATION BAR (Modern Website Layout)
   Redesigned with polished tab-style buttons
   ============================================ */
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav-toggle {
  display: none;
}

/* Mobile navigation - hidden on desktop */
.mobile-nav {
  display: none !important;
}

.top-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.top-nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  opacity: 0;
  transition: opacity 250ms ease;
  border-radius: inherit;
}

.top-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  border-radius: 3px 3px 0 0;
  transition: width 250ms ease;
}

.top-nav-link:hover {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.top-nav-link:hover::before {
  opacity: 1;
}

.top-nav-link.is-active {
  color: #04111d;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--primary) 45%, transparent), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.top-nav-link.is-active::before {
  display: none;
}

.top-nav-link.is-active::after {
  width: 70%;
  background: rgba(4, 17, 29, 0.6);
}

.top-nav-link i {
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
  transition: transform 250ms ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.top-nav-link:hover i {
  transform: scale(1.15);
}

.top-nav-link.is-active i {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.top-nav-link span {
  position: relative;
  z-index: 1;
}

/* Stats bar - polished card-style display */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 0;
  margin-bottom: 24px;
}

.stats-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stats-bar-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  opacity: 0.8;
  transition: opacity 250ms ease;
}

.stats-bar-item:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 25px color-mix(in srgb, var(--primary) 18%, transparent);
}

.stats-bar-item:hover::before {
  opacity: 1;
}

.stats-bar-item i {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 2px;
  transition: transform 250ms ease;
  filter: drop-shadow(0 2px 4px rgba(120, 240, 197, 0.3));
}

.stats-bar-item:hover i {
  transform: scale(1.2) rotate(-5deg);
}

.stats-bar-item strong {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(120, 240, 197, 0.2);
}

.stats-bar-item small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stats-bar-divider {
  display: none; /* Hidden in grid layout */
}

/* ============================================
   END TOP NAVIGATION STYLES
   ============================================ */

.hero-title,
h1,
h2,
h3 {
  margin: 0;
  line-height: 1;
}

.hero-title,
.auth-brand h1 {
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.4rem, 2vw, 2.4rem);
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--primary);
  font-size: 0.78rem;
}

.lede,
.media-copy p,
.switch-copy,
.empty-state,
.list-row small,
.empty-note,
.section-banner p,
.hero-panel p {
  color: var(--muted);
}

.lede {
  margin: 12px 0 0;
  max-width: 44rem;
  font-size: 1.02rem;
  line-height: 1.7;
}

.compact {
  max-width: 44rem;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mobile-menu-toggle,
.icon-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
}

.mobile-menu-toggle {
  display: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
}

.user-chip {
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.avatar,
.mini-art {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #04111d;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.hero-grid,
.dashboard-grid,
.stats-grid,
.media-grid,
.link-grid,
.modal-grid,
.responsive-form,
.inline-form-grid,
.playlist-add-form,
.theme-editor-grid {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  margin-bottom: 24px;
}

.hero-grid-front {
  align-items: start;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

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

.theme-editor-grid,
.inline-form-grid,
.responsive-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.playlist-add-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.hero-panel-rich {
  overflow: hidden;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.stat-card strong {
  font-size: 2.4rem;
  letter-spacing: -0.05em;
}

.stat-label,
.user-chip small,
.media-copy small {
  color: var(--muted);
}

.tab-bar {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.tab-button,
.btn,
.mobile-menu-toggle,
.icon-btn,
.admin-nav-link,
.front-menu-link,
.slider-dot {
  transition: 180ms ease;
  cursor: pointer;
}

.tab-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
}

.tab-button.is-active,
.front-menu-link:hover,
.admin-nav-link:hover {
  color: #05111d;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.search-row {
  margin: 18px 0;
}

.search-box,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input[type="color"] {
  min-height: 56px;
  padding: 8px;
}

input::placeholder,
textarea::placeholder {
  color: #7f93ae;
}

input:focus,
select:focus,
textarea:focus,
.search-box:focus {
  border-color: color-mix(in srgb, var(--primary) 65%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  color: #04111d;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #f05b73, #ff8361);
}

.btn-full {
  width: 100%;
}

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

.media-card {
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

/* Media Actions Container */
.media-actions {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

/* Playlist Dropdown */
.playlist-dropdown {
  position: relative;
  width: 100%;
}

.playlist-dropdown .dropdown-toggle {
  width: 100%;
}

.playlist-dropdown .dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}

.playlist-dropdown .dropdown-menu.show {
  display: block;
}

.playlist-dropdown .dropdown-header {
  font-weight: 600;
  padding: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

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

.playlist-dropdown .playlist-option {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 180ms ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.playlist-dropdown .playlist-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.playlist-dropdown .playlist-option-info {
  flex: 1;
}

.playlist-dropdown .playlist-option-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.playlist-dropdown .playlist-option-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.playlist-dropdown .playlist-option-add {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #04111d;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
  font-size: 0.9rem;
  transition: all 180ms ease;
}

.playlist-dropdown .playlist-option-add:hover {
  transform: scale(1.02);
}

.media-art {
  min-height: 190px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--primary) 22%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-strong) 24%, rgba(26, 54, 90, 0.8)), rgba(7, 18, 34, 0.9));
  color: var(--primary);
  font-size: 2.2rem;
}

.media-art img {
  height: 100%;
  object-fit: cover;
}

.media-copy {
  display: grid;
  gap: 6px;
}

.front-menu-panel {
  margin-bottom: 24px;
}

.front-menu {
  gap: 12px;
  flex-wrap: wrap;
}

.front-menu-link,
.admin-nav-link {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  gap: 10px;
}

.section-banner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.slider-shell {
  margin: 20px 0 10px;
  display: grid;
  gap: 16px;
}

.slider-track {
  position: relative;
  min-height: 360px;
}

.slider-shell-section .slider-track {
  min-height: 280px;
}

.slider-card {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: 24px;
  overflow: hidden;
  opacity: 0;
  transform: translateX(30px) scale(0.98);
  transition: opacity 350ms ease, transform 350ms ease;
}

.slider-card.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.slider-overlay {
  min-height: inherit;
  height: 100%;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(4, 9, 18, 0.08), rgba(4, 9, 18, 0.8));
}

.slider-badge {
  width: fit-content;
  background: color-mix(in srgb, var(--accent) 30%, rgba(255, 255, 255, 0.08));
}

.slider-controls {
  justify-content: space-between;
  gap: 16px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex: 1;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.28);
}

.slider-dot.is-active {
  background: var(--primary);
  transform: scale(1.15);
}

.slider-btn {
  flex-shrink: 0;
}

.list-stack,
.management-stack,
.playlist-items {
  display: grid;
  gap: 16px;
}

.list-row {
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.mini-art {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
}

.empty-state {
  padding: 30px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.alert-success {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  color: #b7ffe4;
}

.alert-error {
  background: rgba(255, 107, 122, 0.12);
  border-color: rgba(255, 107, 122, 0.24);
  color: #ffd2d8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 15, 0.72);
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(920px, 100%);
  background: var(--surface-strong);
}

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

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

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.checkbox-field input {
  width: auto;
  margin: 0;
}

.divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.player-panel,
.admin-section,
.upgrade-panel {
  margin-top: 24px;
}

.management-stack .manager-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 18px;
}

.manager-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  cursor: pointer;
}

.manager-summary::-webkit-details-marker {
  display: none;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row,
.danger-form {
  margin-top: 16px;
}

.danger-form {
  display: flex;
  justify-content: flex-start;
}

.switch-copy {
  margin: 18px 0 0;
}

.switch-copy a {
  color: var(--primary);
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 20px;
}

.admin-nav {
  display: grid;
  gap: 10px;
}

.admin-sidebar-actions {
  display: grid;
  gap: 12px;
}

.media-player {
  width: 100%;
  border-radius: 18px;
  background: #050b13;
}

@media (max-width: 1100px) {
  .admin-layout,
  .auth-panel,
  .hero-grid,
  .dashboard-grid,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .media-grid,
  .link-grid,
  .responsive-form,
  .stats-grid,
  .theme-editor-grid,
  .inline-form-grid,
  .playlist-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell,
  .auth-shell,
  .admin-layout {
    width: min(100% - 1rem, 1440px);
    padding-top: 16px;
  }

  .admin-layout {
    gap: 16px;
  }

  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mobile-menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .site-actions.is-open {
    display: flex;
  }

  /* Mobile top navigation */
  .top-nav-toggle {
    display: flex;
  }

  /* Hide the separate top-nav bar on mobile */
  .top-nav {
    display: none;
  }

  /* Show nav links inside the hamburger menu */
  .mobile-nav {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }

  .top-nav {
    flex-direction: column;
    padding: 8px;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
  }

  .top-nav.is-open {
    max-height: 500px;
  }

  .top-nav-link {
    width: 100%;
    justify-content: center;
  }

  /* Mobile stats bar - horizontal scroll */
  .stats-bar {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    padding: 12px 16px;
  }

  .stats-bar::-webkit-scrollbar {
    display: none;
  }

  .stats-bar-divider {
    flex-shrink: 0;
  }

  .front-menu,
  .pill-row {
    gap: 10px;
  }

  .tab-bar {
    width: 100%;
    overflow-x: auto;
  }

  .media-grid,
  .link-grid,
  .responsive-form,
  .stats-grid,
  .theme-editor-grid,
  .inline-form-grid,
  .playlist-add-form,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .glass-panel,
  .auth-brand,
  .modal-card {
    padding: 22px;
  }

  .user-chip,
  .manager-summary,
  .section-banner,
  .slider-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .slider-track,
  .slider-shell-section .slider-track {
    min-height: 240px;
  }
}

/* ==================== UNIFIED SEARCH BAR ==================== */
.unified-search {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin: 20px 0;
}

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

.search-input-wrapper {
  position: relative;
  flex: 1;
}

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

.unified-search-input {
  width: 100%;
  padding: 14px 44px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.unified-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
  outline: none;
}

.unified-search-input::placeholder {
  color: var(--muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.search-select-wrapper {
  position: relative;
  min-width: 180px;
}

.search-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  transition: all 0.2s ease;
}

.search-select:focus {
  border-color: var(--primary);
  outline: none;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.8rem;
}

.search-mode-row {
  margin-top: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.search-type-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-type-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.search-type-tab.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: var(--primary);
  color: #04111d;
}

.search-sort-buttons {
  display: flex;
  gap: 8px;
}

.search-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-sort-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.search-sort-btn.is-active {
  background: rgba(var(--primary-rgb), 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.search-help-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-help-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Search Suggestions */
.search-suggestions {
  margin-top: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.suggestion-item i {
  color: var(--muted);
  width: 20px;
  text-align: center;
}

.suggestion-type {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

/* Search Help Modal */
.search-help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.search-help-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.search-help-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.search-help-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.search-help-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.search-help-body {
  padding: 24px;
  overflow-y: auto;
}

.help-section {
  margin-bottom: 24px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px 0;
  color: var(--primary);
}

.help-section p {
  margin: 0 0 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.help-section code {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--primary);
  margin: 4px 4px 4px 0;
}

.help-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-section li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.help-section li i {
  width: 20px;
  color: var(--primary);
}

/* Search Results */
.search-results-container {
  margin-top: 24px;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.search-results-count {
  font-weight: 600;
  color: var(--text);
}

.search-results-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.search-results-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.search-results-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-result-section {
  margin-bottom: 24px;
}

.search-result-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: var(--text);
}

.search-result-section h4 i {
  color: var(--primary);
}

.search-result-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}

.search-result-art {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.search-result-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-art i {
  font-size: 1.5rem;
  color: var(--muted);
}

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

.search-result-info h5 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-info p {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.search-result-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-no-results {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.search-no-results i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
}

.search-loading i {
  animation: spin 1s linear infinite;
}

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

/* Member result specific styles */
.member-result {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-result:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}

.member-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}

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

.member-info {
  flex: 1;
}

.member-info h5 {
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
}

.offline-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

/* Responsive Search */
@media (max-width: 768px) {
  .unified-search {
    padding: 16px;
  }

  .search-bar-row {
    flex-direction: column;
    gap: 12px;
  }

  .search-input-wrapper {
    width: 100%;
  }

  .search-select-wrapper {
    width: 100%;
    min-width: unset;
  }

  .search-mode-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-type-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .search-sort-buttons {
    width: 100%;
    justify-content: center;
  }

  .search-help-btn {
    width: 100%;
  }

  .search-help-modal {
    padding: 12px;
  }

  .search-help-content {
    max-height: 90vh;
  }

  .search-result-item {
    flex-direction: column;
    gap: 12px;
  }

  .search-result-art {
    width: 100%;
    height: 120px;
  }
}
