/* ============================================================
   HarmonyMatch — Design System
   Dark theme | Purple/Cyan/Pink palette | Card-based layout
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --navbar-h:          56px;
  --bg-base:           #0d0d14;
  --bg-surface:        #13131f;
  --bg-card:           #1a1a2e;
  --bg-card-hover:     #1f1f38;
  --bg-sidebar:        #111120;

  --text-primary:      #f0f0ff;
  --text-secondary:    #9898b8;
  --text-muted:        #55556a;

  --border:            rgba(255,255,255,0.08);
  --border-hover:      rgba(255,255,255,0.14);

  --accent-purple:     #7c3aed;
  --accent-purple-mid: #9d5bfa;
  --accent-purple-light: #c084fc;
  --accent-cyan:       #06b6d4;
  --accent-pink:       #d946ef;

  --gradient-brand: linear-gradient(135deg, #06b6d4 0%, #7c3aed 45%, #d946ef 100%);
  --gradient-card:  linear-gradient(135deg, rgba(124,58,237,0.12) 0%, rgba(217,70,239,0.06) 100%);

  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 40px rgba(124,58,237,0.2);
  --radius:        14px;
  --radius-sm:     8px;
  --sidebar-w:     220px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  /* Subtle background texture */
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(124,58,237,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(6,182,212,0.1) 0%, transparent 50%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 3px; }

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.hm-navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--navbar-h);
  background: rgba(17,17,32,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 0 18px rgba(124,58,237,0.45);
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.btn-ghost i { font-size: 14px; }
.btn-ghost-label { font-size: 13px; }

/* ============================================================
   AUTH PAGES  (login.php)
   ============================================================ */
.auth-wrap {
  display: flex;
  min-height: 100vh;
}

.auth-left {
  flex: 0 0 480px;
  background: linear-gradient(160deg, #0f0f20 0%, #0a0a18 100%);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  position: relative;
  overflow: hidden;
}

/* Decorative orbs on left panel */
.auth-left::before {
  content: '';
  position: absolute;
  top: -80px; left: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
}

/* Logo */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  box-shadow: 0 0 20px rgba(124,58,237,0.4);
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
}
.auth-tab:hover:not(.active) { color: var(--text-primary); }

/* ============================================================
   SHARED APP LAYOUT  (dashboard, search, chat, profile…)
   ============================================================ */
.hm-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
}

/* Sidebar */
.hm-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
}


.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(124,58,237,0.18);
  color: var(--accent-purple-light);
  border: 1px solid rgba(124,58,237,0.25);
}

/* Main content area */
.hm-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-width: calc(100vw - var(--sidebar-w));
}

/* Section header */
.section-header { margin-bottom: 24px; }
.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- Cards ---------- */
.hm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.hm-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 20px rgba(124,58,237,0.3);
}
.btn-primary:hover {
  background: var(--accent-purple-mid);
  box-shadow: 0 0 28px rgba(124,58,237,0.45);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

/* ---------- Forms ---------- */
.field, .form-group { margin-bottom: 18px; }

.field-label, .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-input, .form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 11px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field-input:focus, .form-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.field-input::placeholder, .form-input::placeholder { color: var(--text-muted); }

textarea.field-input, textarea.form-input {
  resize: vertical;
  min-height: 90px;
}

select.field-input, select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239898b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select.field-input option, select.form-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ---------- Tags / Chips ---------- */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.tag-purple {
  background: rgba(124,58,237,0.18);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--accent-purple-light);
}
.tag-cyan {
  background: rgba(6,182,212,0.12);
  border: 1px solid rgba(6,182,212,0.25);
  color: var(--accent-cyan);
}
.tag-pink {
  background: rgba(217,70,239,0.12);
  border: 1px solid rgba(217,70,239,0.25);
  color: #e879f9;
}
.tag .tag-remove {
  margin-left: 6px;
  cursor: pointer;
  opacity: 0.6;
  font-size: 11px;
}
.tag .tag-remove:hover { opacity: 1; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-green {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34d399;
}
.badge-red {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

/* ============================================================
   DASHBOARD — Match Grid
   ============================================================ */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.discover-shell {
  display: grid;
  gap: 18px;
}

.discover-status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.discover-feed {
  display: grid;
  justify-items: center;
}

.discover-card {
  width: min(100%, 520px);
  cursor: default;
}

.discover-photo {
  aspect-ratio: 1 / 0.92;
}

.discover-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.discover-card-name {
  font-size: 24px;
}

.discover-intent {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-purple-light);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 999px;
  padding: 6px 10px;
}

.discover-actions {
  padding-top: 4px;
}

.discover-vibe {
  margin-top: 16px;
}

.discover-vibe-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discover-vibe-box {
  margin-top: 12px;
}

.discover-empty {
  width: min(100%, 520px);
  text-align: center;
  padding: 42px 28px;
}

.discover-empty i {
  font-size: 34px;
  color: var(--accent-purple-light);
  margin-bottom: 14px;
}

.discover-empty h3 {
  margin-bottom: 10px;
}

.discover-empty p {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.match-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(124,58,237,0.12);
}

.match-card-photo {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--bg-surface) 0%, #1a1a30 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.match-card-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.match-card-body { padding: 16px; }
.match-card-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.match-card-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* Compatibility bar */
.compat-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.compat-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.compat-track {
  flex: 1;
  height: 5px;
  background: var(--bg-surface);
  border-radius: 999px;
  overflow: hidden;
}
.compat-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: 999px;
}
.compat-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-purple-light);
  min-width: 32px;
  text-align: right;
}

.match-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.match-card-actions .action-btn {
  flex: 1;
  padding: 10px 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  line-height: 1;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.match-card-actions .action-btn span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.action-btn.like-btn {
  background: rgba(217,70,239,0.15);
  border: 1px solid rgba(217,70,239,0.3);
  color: #e879f9;
}
.action-btn.like-btn:hover {
  background: rgba(217,70,239,0.25);
  box-shadow: 0 0 16px rgba(217,70,239,0.2);
}
.action-btn.msg-btn {
  background: rgba(6,182,212,0.12);
  border: 1px solid rgba(6,182,212,0.25);
  color: var(--accent-cyan);
}
.action-btn.msg-btn:hover {
  background: rgba(6,182,212,0.22);
  box-shadow: 0 0 16px rgba(6,182,212,0.2);
}
.action-btn.pass-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary);
}
.action-btn.pass-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}
.action-btn.info-btn {
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.22);
  color: var(--accent-cyan);
  flex-direction: column;
}
.action-btn.info-btn:hover {
  background: rgba(6,182,212,0.2);
  box-shadow: 0 0 16px rgba(6,182,212,0.15);
}

/* Compatibility badge overlaid on photo */
.compat-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: var(--accent-purple-light);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124,58,237,0.35);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Artist background card — shown in photo area when no profile photo */
.artist-bg-card {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2) 0%, rgba(217,70,239,0.12) 100%);
  padding: 24px 16px;
}
.artist-bg-card i {
  font-size: 40px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.artist-bg-card span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
}

/* Likes page — pink heart badge over photo */
.likes-heart-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(217,70,239,0.85);
  color: #fff;
  font-size: 13px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Clickable profile name in card body */
.profile-name-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.15s;
}
.profile-name-link:hover {
  color: var(--accent-purple-light);
}

/* Top artist label in card body */
.top-artist-label {
  font-size: 12px;
  color: var(--accent-purple-light);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.top-artist-label i { font-size: 11px; }

.match-why {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.match-summary {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.spotify-embed-wrap {
  width: 100%;
}

/* Avatar placeholder */
.avatar-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

/* ============================================================
   PROFILE PAGES
   ============================================================ */
.profile-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.profile-photo-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(124,58,237,0.35);
  flex-shrink: 0;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(124,58,237,0.2);
}
.profile-photo-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-lg .avatar-placeholder { font-size: 44px; }

.profile-info { flex: 1; min-width: 200px; }
.profile-info h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.profile-info p  { font-size: 14px; color: var(--text-secondary); }

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

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}
.filter-row .form-group { margin-bottom: 0; min-width: 180px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-surface);
  outline: none;
  margin: 8px 0 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
}

/* ============================================================
   CHAT PAGE
   ============================================================ */
.chat-layout {
  display: flex;
  gap: 0;
  padding: 0;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}

.chat-inbox {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  overflow-y: auto;
  padding: 20px;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow: hidden;
  padding: 0;
}

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-row .form-input { flex: 1; }

/* Message bubbles */
.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.msg-bubble.sent {
  align-self: flex-end;
  background: var(--accent-purple);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.received {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Inbox item */
.inbox-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.inbox-item:hover { background: rgba(255,255,255,0.04); }
.inbox-item.active { background: rgba(124,58,237,0.12); }

.inbox-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.inbox-avatar img { width: 100%; height: 100%; object-fit: cover; }

.inbox-info { min-width: 0; }
.inbox-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-preview {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   ONBOARDING PAGE
   ============================================================ */
.onboarding-container {
  max-width: 600px;
  margin: 48px auto;
  padding: 0 24px;
}

.onboarding-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  flex: 1;
  text-align: center;
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  transition: all 0.2s;
}
.step:last-child { border-right: none; }
.step.active {
  background: rgba(124,58,237,0.15);
  color: var(--accent-purple-light);
}
.step.done {
  color: #34d399;
}

.onboarding-step h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
}

/* Genre checkboxes */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.genre-chip {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  user-select: none;
}
.genre-chip:hover {
  border-color: rgba(124,58,237,0.3);
  color: var(--text-primary);
}
.genre-chip.selected {
  background: rgba(124,58,237,0.18);
  border-color: rgba(124,58,237,0.4);
  color: var(--accent-purple-light);
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  text-align: center;
  padding: 20px;
}

.stat-value {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table td .btn-outline,
.admin-table td .btn-primary {
  padding: 6px 14px;
  font-size: 13px;
  margin-right: 6px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.admin-toolbar .form-group {
  margin-bottom: 0;
  min-width: 180px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
}

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

.modal-card {
  width: min(560px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

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

.modal-head h3 {
  margin: 0;
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.mt-1        { margin-top: 8px; }
.mt-2        { margin-top: 16px; }
.mt-3        { margin-top: 24px; }
.mb-1        { margin-bottom: 8px; }
.mb-2        { margin-bottom: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .auth-left { display: none; }
  .hm-sidebar { width: 64px; }

  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .hm-main { max-width: calc(100vw - 64px); padding: 20px; }
  .chat-inbox { width: 220px; }
  .btn-ghost-label { display: none; }
}

@media (max-width: 600px) {
  .hm-sidebar { display: none; }
  /* Shrink layout to content so the chat page doesn't scroll to empty space */
  .hm-layout { min-height: 0; }
  .hm-main { max-width: 100vw; padding: 16px; padding-bottom: 74px; }
  .auth-card { padding: 28px 20px; }
  .match-grid { grid-template-columns: 1fr; }
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
  /* Chat: fill exactly the space between navbar and bottom nav — no overflow, no scroll gap */
  .chat-layout {
    flex-direction: column;
    height: calc(100vh - var(--navbar-h) - 58px);
    overflow: hidden;
    padding-bottom: 0;
  }
  /* Inbox fills all available height and scrolls only when needed */
  .chat-inbox {
    width: 100%;
    border-right: none;
    border-bottom: none;
    border-radius: var(--radius);
    flex: 1;
    overflow-y: auto;
  }
  /* Panel hidden by default on mobile — CSS controls show/hide */
  .chat-panel { display: none; border-radius: var(--radius); }

  /* Conversation open: swap inbox out, panel in */
  .chat-layout.mobile-panel-open .chat-inbox { display: none; }
  .chat-layout.mobile-panel-open .chat-panel {
    display: flex !important;
    flex: 1;
    min-height: 0;
    border-radius: var(--radius);
  }

  /* Search filters: stack full-width */
  .filter-row { gap: 12px; }
  .filter-row .form-group { min-width: 0; width: 100%; }

  /* Profile: center-stack on small screens */
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .profile-actions { justify-content: center; }

  /* Onboarding: less top margin */
  .onboarding-container { margin-top: 24px; }
}

/* Chat back button — icon-only, mobile only */
.chat-back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  padding: 0 10px 0 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chat-back-btn:hover { color: var(--text-primary); }
@media (min-width: 601px) {
  .chat-back-btn { display: none !important; }
}
@media (max-width: 600px) {
  .chat-back-btn { display: flex; }
}

/* ============================================================
   BOTTOM NAVIGATION BAR (mobile only)
   ============================================================ */
.hm-bottom-nav { display: none; }

/* Explicitly hide on all screens wider than mobile — overrides any zoom/cascade issues */
@media (min-width: 601px) {
  .hm-bottom-nav { display: none !important; }
}

@media (max-width: 600px) {
  .hm-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 300;
    height: 58px;
    background: rgba(13,13,20,0.97);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    justify-content: space-around;
    align-items: stretch;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 4px 2px;
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item i { font-size: 19px; }
  .bottom-nav-item.active { color: var(--accent-purple-light); }
  .bottom-nav-item:active { opacity: 0.7; }
}

.admin-login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.14), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, #101826 100%);
}

.admin-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.admin-login-card {
  width: min(100%, 460px);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

.admin-login-card h1 {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.admin-login-copy {
  margin: 0 0 22px;
  color: #cbd5e1;
  line-height: 1.6;
}

.admin-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: #86efac;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}

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

.admin-login-form .form-label {
  color: #cbd5e1;
}

.admin-login-form .form-input {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}

.admin-login-form .form-input:focus {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.admin-login-submit {
  margin-top: 10px;
  justify-content: center;
}

.admin-login-links {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 14px;
}

.admin-login-links a {
  color: #93c5fd;
}
