:root {
  --bg:         #0c0c18;
  --surface:    #121220;
  --card:       #181828;
  --card-hover: #1f1f35;
  --border:     #242438;
  --border-l:   #2e2e48;
  --primary:    #f97316;
  --primary-dk: #e8650a;
  --primary-gl: rgba(249,115,22,0.15);
  --online:     #22c55e;
  --recent:     #eab308;
  --text:       #e2e8f0;
  --text-dim:   #94a3b8;
  --text-muted: #4b5563;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
}

*{box-sizing:border-box;margin:0;padding:0}
a{color:inherit;text-decoration:none}

body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  font-size:15px;
  line-height:1.6;
  min-height:100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--border-l);border-radius:3px}

/* ── Nav ── */
.nav{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:100;
}
.nav-inner{
  max-width:1200px;margin:0 auto;
  padding:0 1.5rem;height:58px;
  display:flex;align-items:center;justify-content:space-between;
}
.nav-brand{
  font-size:1.4rem;font-weight:800;
  color:var(--primary);letter-spacing:-0.02em;
}
.nav-links{display:flex;align-items:center;gap:0.25rem}
.nav-link{
  display:flex;align-items:center;gap:0.35rem;
  padding:0.4rem 0.8rem;border-radius:7px;
  font-size:0.88rem;font-weight:500;color:var(--text-dim);
  transition:all 0.15s;white-space:nowrap;
}
.nav-link:hover,.nav-link.active{color:var(--text);background:var(--card)}
.nav-link svg{width:16px;height:16px;flex-shrink:0}
.nbadge{
  background:var(--primary);color:#fff;
  border-radius:999px;font-size:0.65rem;
  padding:1px 5px;font-weight:700;
}
.nav-btn-link{
  background:none;border:none;cursor:pointer;
  font-family:inherit;color:var(--text-dim);
  display:flex;align-items:center;gap:0.35rem;
  padding:0.4rem 0.8rem;border-radius:7px;
  font-size:0.88rem;font-weight:500;
  transition:all 0.15s;
}
.nav-btn-link:hover{color:var(--text);background:var(--card)}

/* ── Layout ── */
.container{max-width:1200px;margin:0 auto;padding:2rem 1.5rem}
.container-sm{max-width:440px;margin:0 auto;padding:3rem 1.5rem}
.container-md{max-width:780px;margin:0 auto;padding:2rem 1.5rem}

/* ── Forms ── */
.form-group{margin-bottom:1rem}
label{display:block;font-size:0.78rem;font-weight:600;margin-bottom:0.35rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:0.04em}
input[type=text],input[type=email],input[type=password],input[type=date],input[type=number],select,textarea{
  width:100%;padding:0.6rem 0.85rem;
  background:var(--surface);border:1.5px solid var(--border-l);
  border-radius:8px;font-size:0.9rem;font-family:inherit;
  color:var(--text);transition:border-color 0.18s,box-shadow 0.18s;
}
input:focus,select:focus,textarea:focus{
  outline:none;border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-gl);
}
select option{background:var(--surface)}
textarea{resize:vertical;min-height:100px}
.form-row{display:flex;gap:1rem}
.form-row .form-group{flex:1}
.checkbox-group{display:flex;flex-wrap:wrap;gap:0.5rem;margin-top:0.25rem}
.checkbox-pill{
  display:flex;align-items:center;gap:0.4rem;
  padding:0.4rem 0.85rem;border-radius:20px;
  border:1.5px solid var(--border-l);font-size:0.82rem;
  cursor:pointer;transition:all 0.15s;color:var(--text-dim);
  background:var(--surface);user-select:none;
}
.checkbox-pill input{display:none}
.checkbox-pill.checked,.checkbox-pill:has(input:checked){
  border-color:var(--primary);color:var(--primary);
  background:var(--primary-gl);
}

/* ── Buttons ── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:0.4rem;
  padding:0.55rem 1.3rem;border-radius:8px;border:none;
  font-size:0.88rem;font-weight:600;cursor:pointer;
  text-decoration:none;transition:all 0.18s;white-space:nowrap;font-family:inherit;
}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dk);transform:translateY(-1px);box-shadow:0 4px 16px rgba(249,115,22,0.35)}
.btn-secondary{background:var(--card-hover);color:var(--text);border:1px solid var(--border-l)}
.btn-secondary:hover{background:var(--border-l)}
.btn-outline{background:transparent;color:var(--primary);border:1.5px solid var(--primary)}
.btn-outline:hover{background:var(--primary-gl)}
.btn-ghost{background:transparent;color:var(--text-dim);border:1px solid var(--border-l)}
.btn-ghost:hover{color:var(--text);background:var(--card)}
.btn-danger{background:#dc2626;color:#fff}
.btn-danger:hover{background:#b91c1c}
.btn-success{background:#16a34a;color:#fff}
.btn-success:hover{background:#15803d}
.btn-sm{padding:0.35rem 0.85rem;font-size:0.8rem;border-radius:6px}
.btn-lg{padding:0.75rem 1.8rem;font-size:1rem}
.btn-block{width:100%}
.btn-icon{width:38px;height:38px;padding:0;border-radius:8px}
.btn-link-bare{background:none;border:none;cursor:pointer;font-family:inherit;color:var(--text-dim);font-size:0.88rem;font-weight:500;transition:color 0.15s;padding:0.4rem 0.8rem;border-radius:7px}
.btn-link-bare:hover{color:var(--text);background:var(--card)}

/* ── Cards ── */
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius)}
.card-body{padding:1.5rem}

/* ── Alerts ── */
.alert{padding:0.7rem 1rem;border-radius:8px;margin-bottom:1rem;font-size:0.88rem}
.alert-error{background:rgba(220,38,38,0.1);color:#fca5a5;border:1px solid rgba(220,38,38,0.3)}
.alert-success{background:rgba(22,163,74,0.1);color:#86efac;border:1px solid rgba(22,163,74,0.3)}

/* ── Hero ── */
.hero{
  background:linear-gradient(135deg,#1a0a2e 0%,#0c0c18 40%,#1a0c0a 100%);
  padding:7rem 1.5rem;text-align:center;
  position:relative;overflow:hidden;
}
.hero::before{
  content:'';position:absolute;inset:0;
  background:radial-gradient(ellipse 80% 60% at 50% 0%,rgba(249,115,22,0.12),transparent);
}
.hero-content{position:relative;z-index:1}
.hero h1{font-size:3.4rem;font-weight:800;margin-bottom:1rem;letter-spacing:-0.03em;line-height:1.15}
.hero h1 span{color:var(--primary)}
.hero p{font-size:1.15rem;color:var(--text-dim);margin-bottom:2.5rem;max-width:460px;margin-left:auto;margin-right:auto}
.hero-btns{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.hero-stats{
  display:flex;gap:3rem;justify-content:center;
  margin-top:4rem;flex-wrap:wrap;
}
.hero-stat{text-align:center}
.hero-stat-n{font-size:2rem;font-weight:800;color:var(--primary)}
.hero-stat-l{font-size:0.82rem;color:var(--text-dim);margin-top:0.15rem}

/* ── Online status ── */
.status-dot{
  display:inline-block;width:10px;height:10px;
  border-radius:50%;flex-shrink:0;
}
.status-dot.online{background:var(--online);box-shadow:0 0 6px var(--online)}
.status-dot.recent{background:var(--recent)}
.status-dot.offline{background:var(--text-muted)}
.status-label.online{color:var(--online)}
.status-label.recent{color:var(--recent)}
.status-label.offline{color:var(--text-muted)}

/* ── Filter bar ── */
.filter-bar{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);padding:1rem 1.25rem;
  display:flex;gap:0.75rem;align-items:flex-end;flex-wrap:wrap;
  margin-bottom:1.5rem;
}
.filter-bar .form-group{margin-bottom:0;flex:1;min-width:100px}
.filter-toggle{
  display:flex;align-items:center;gap:0.5rem;
  padding:0.55rem 0.85rem;border-radius:7px;
  border:1.5px solid var(--border-l);background:var(--surface);
  color:var(--text-dim);font-size:0.82rem;font-weight:600;cursor:pointer;
  transition:all 0.15s;white-space:nowrap;font-family:inherit;
}
.filter-toggle:has(input:checked),.filter-toggle.active{
  border-color:var(--online);color:var(--online);background:rgba(34,197,94,0.08);
}
.filter-toggle input{display:none}

/* ── Browse grid ── */
.profile-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  gap:3px;
}
.pcard{
  position:relative;background:var(--card);
  overflow:hidden;cursor:pointer;
  aspect-ratio:3/4;display:block;
  transition:transform 0.18s;
}
.pcard:hover{transform:scale(1.02);z-index:1}
.pcard-img{width:100%;height:100%;object-fit:cover;display:block;background:var(--card)}
.pcard-no-photo{
  width:100%;height:100%;
  background:linear-gradient(135deg,var(--card),var(--card-hover));
  display:flex;align-items:center;justify-content:center;
  font-size:3rem;color:var(--border-l);
}
.pcard-overlay{
  position:absolute;bottom:0;left:0;right:0;
  background:linear-gradient(transparent,rgba(0,0,0,0.85));
  padding:1.5rem 0.6rem 0.6rem;
}
.pcard-name{font-size:0.85rem;font-weight:700;color:#fff;line-height:1.2}
.pcard-meta{font-size:0.75rem;color:rgba(255,255,255,0.65);margin-top:0.1rem}
.pcard-dot{
  position:absolute;top:7px;right:7px;
  width:11px;height:11px;border-radius:50%;
  border:2px solid var(--card);
}
.pcard-dot.online{background:var(--online);box-shadow:0 0 5px var(--online)}
.pcard-dot.recent{background:var(--recent)}
.pcard-dot.offline{display:none}
.pcard-lf{
  position:absolute;top:7px;left:7px;
  background:rgba(0,0,0,0.6);backdrop-filter:blur(4px);
  color:#fff;font-size:0.62rem;font-weight:700;
  padding:2px 6px;border-radius:4px;
  text-transform:uppercase;letter-spacing:0.03em;
}

/* ── Profile view ── */
.profile-wrap{display:flex;gap:2rem;align-items:flex-start}
.profile-left{flex-shrink:0;width:280px}
.profile-main-photo{
  width:100%;aspect-ratio:1/1;border-radius:var(--radius);
  overflow:hidden;background:var(--card);
  display:flex;align-items:center;justify-content:center;font-size:5rem;
}
.profile-main-photo img{width:100%;height:100%;object-fit:cover;display:block}
.profile-thumbs{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.pthumb{
  width:64px;height:64px;border-radius:6px;overflow:hidden;cursor:pointer;
  border:2px solid transparent;transition:border-color 0.15s;
  flex-shrink:0;
}
.pthumb:hover{border-color:var(--primary)}
.pthumb img{width:100%;height:100%;object-fit:cover;display:block}
.profile-right{flex:1;min-width:0}
.profile-username{font-size:2rem;font-weight:800;letter-spacing:-0.02em}
.profile-age{color:var(--text-dim);font-size:1.1rem}
.profile-status{
  display:flex;align-items:center;gap:0.5rem;
  margin-top:0.5rem;font-size:0.85rem;
}
.profile-views{color:var(--text-muted);font-size:0.8rem;margin-top:0.3rem}
.attr-grid{
  display:grid;grid-template-columns:1fr 1fr;
  gap:0.5rem;margin:1.25rem 0;
}
.attr-item{
  background:var(--surface);border:1px solid var(--border);
  border-radius:8px;padding:0.55rem 0.85rem;
}
.attr-label{font-size:0.7rem;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.04em;display:block}
.attr-value{font-size:0.9rem;font-weight:600;color:var(--text);margin-top:0.1rem}
.lf-tags{display:flex;flex-wrap:wrap;gap:0.4rem;margin-top:1rem}
.lf-tag{
  background:var(--primary-gl);color:var(--primary);
  border:1px solid rgba(249,115,22,0.3);
  padding:0.3rem 0.75rem;border-radius:20px;
  font-size:0.8rem;font-weight:600;
}
.profile-bio{
  margin-top:1.25rem;color:var(--text-dim);font-size:0.92rem;line-height:1.7;
}
.profile-actions{display:flex;gap:0.6rem;flex-wrap:wrap;margin-top:1.5rem}

/* ── Edit profile ── */
.section-card{
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--radius);margin-bottom:1.5rem;overflow:hidden;
}
.section-head{
  padding:1rem 1.5rem;border-bottom:1px solid var(--border);
  font-size:0.85rem;font-weight:700;color:var(--text-dim);
  text-transform:uppercase;letter-spacing:0.06em;
}
.section-body{padding:1.5rem}
.photo-grid{display:flex;gap:6px;flex-wrap:wrap}
.photo-item{
  position:relative;width:100px;height:100px;
  border-radius:8px;overflow:hidden;
  border:2px solid transparent;transition:border-color 0.15s;
  flex-shrink:0;
}
.photo-item.primary{border-color:var(--primary)}
.photo-item img{width:100%;height:100%;object-fit:cover;display:block}
.photo-overlay{
  position:absolute;bottom:0;left:0;right:0;
  background:rgba(0,0,0,0.7);display:flex;gap:2px;padding:4px;
}
.photo-overlay button{
  flex:1;background:rgba(255,255,255,0.15);border:none;
  border-radius:4px;padding:3px;cursor:pointer;
  font-size:0.6rem;font-weight:700;color:#fff;
  transition:background 0.15s;
}
.photo-overlay button:hover{background:rgba(255,255,255,0.3)}
.primary-badge{
  position:absolute;top:4px;left:4px;
  background:var(--primary);color:#fff;
  font-size:0.58rem;font-weight:700;padding:2px 5px;
  border-radius:4px;text-transform:uppercase;
}
.upload-zone{
  border:2px dashed var(--border-l);border-radius:var(--radius);
  padding:2rem;text-align:center;background:var(--surface);
  transition:border-color 0.2s;cursor:pointer;
}
.upload-zone:hover{border-color:var(--primary)}
.upload-zone input{display:none}
.upload-zone label{cursor:pointer;color:var(--primary);font-weight:600}

/* ── Messages ── */
.inbox-list{list-style:none}
.conv-item{
  display:flex;align-items:center;gap:1rem;
  padding:0.9rem 1.25rem;
  border-bottom:1px solid var(--border);
  text-decoration:none;color:inherit;transition:background 0.1s;
}
.conv-item:hover{background:var(--card-hover)}
.conv-item.unread .conv-name{color:#fff;font-weight:700}
.conv-avatar{
  width:48px;height:48px;border-radius:50%;
  background:var(--card-hover);overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  font-size:1.4rem;flex-shrink:0;position:relative;
}
.conv-avatar img{width:100%;height:100%;object-fit:cover}
.conv-avatar-dot{
  position:absolute;bottom:1px;right:1px;
  width:11px;height:11px;border-radius:50%;
  border:2px solid var(--card);
}
.conv-body{flex:1;min-width:0}
.conv-name{font-weight:500;font-size:0.9rem;color:var(--text-dim)}
.conv-preview{color:var(--text-muted);font-size:0.82rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:0.1rem}
.conv-meta{display:flex;flex-direction:column;align-items:flex-end;gap:0.35rem;flex-shrink:0}
.conv-time{font-size:0.75rem;color:var(--text-muted)}
.unread-dot{width:8px;height:8px;background:var(--primary);border-radius:50%}

/* ── Thread ── */
.thread-wrap{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.thread-head{
  display:flex;align-items:center;gap:1rem;
  padding:0.9rem 1.25rem;border-bottom:1px solid var(--border);
  background:var(--surface);
}
.thread-avatar{
  width:40px;height:40px;border-radius:50%;
  background:var(--card-hover);overflow:hidden;
  display:flex;align-items:center;justify-content:center;font-size:1.2rem;
}
.thread-avatar img{width:100%;height:100%;object-fit:cover}
.thread-username{font-weight:700;font-size:0.95rem}
.thread-body{
  display:flex;flex-direction:column;gap:0.5rem;
  padding:1.25rem;min-height:420px;max-height:520px;overflow-y:auto;
  background:var(--bg);
}
.msg-row{display:flex;flex-direction:column}
.msg-row.mine{align-items:flex-end}
.msg-row.theirs{align-items:flex-start}
.msg-bubble{
  max-width:68%;padding:0.6rem 1rem;
  border-radius:16px;font-size:0.88rem;line-height:1.55;word-break:break-word;
}
.msg-bubble.mine{background:var(--primary);color:#fff;border-bottom-right-radius:3px}
.msg-bubble.theirs{background:var(--card);border:1px solid var(--border);border-bottom-left-radius:3px}
.msg-time{font-size:0.7rem;color:var(--text-muted);margin-top:0.15rem;padding:0 0.2rem}
.thread-foot{
  border-top:1px solid var(--border);padding:0.9rem 1.25rem;
  display:flex;gap:0.6rem;background:var(--surface);
}
.thread-foot input{flex:1}

/* ── Favourites / Winks ── */
.fav-grid,.wink-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:3px;
}
.fav-card,.wink-card{
  position:relative;aspect-ratio:3/4;
  background:var(--card);overflow:hidden;display:block;
  transition:transform 0.18s;
}
.fav-card:hover,.wink-card:hover{transform:scale(1.02);z-index:1}
.fav-card img,.wink-card img{width:100%;height:100%;object-fit:cover}
.fav-card-no-photo,.wink-card-no-photo{
  width:100%;height:100%;background:var(--card-hover);
  display:flex;align-items:center;justify-content:center;font-size:2.5rem;color:var(--border-l);
}
.fav-overlay,.wink-overlay{
  position:absolute;bottom:0;left:0;right:0;
  background:linear-gradient(transparent,rgba(0,0,0,0.85));
  padding:1rem 0.5rem 0.5rem;
}
.fav-overlay .name,.wink-overlay .name{font-size:0.8rem;font-weight:700;color:#fff}
.fav-overlay .meta,.wink-overlay .meta{font-size:0.7rem;color:rgba(255,255,255,0.6)}

/* ── Tabs ── */
.tabs{display:flex;border-bottom:1px solid var(--border);margin-bottom:1.5rem}
.tab{
  padding:0.7rem 1.2rem;font-size:0.88rem;font-weight:600;
  color:var(--text-muted);border-bottom:2px solid transparent;
  cursor:pointer;transition:all 0.15s;margin-bottom:-1px;
}
.tab.active{color:var(--primary);border-bottom-color:var(--primary)}
.tab-panel{display:none}
.tab-panel.active{display:block}

/* ── Admin ── */
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;flex-wrap:wrap;gap:1rem}
.page-title{font-size:1.5rem;font-weight:800;letter-spacing:-0.02em}
.table-wrap{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:auto}
table{width:100%;border-collapse:collapse}
th{padding:0.7rem 1rem;text-align:left;font-size:0.72rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--text-muted);font-weight:700;border-bottom:1px solid var(--border);background:var(--surface)}
td{padding:0.8rem 1rem;border-bottom:1px solid var(--border);font-size:0.88rem;vertical-align:middle}
tr:last-child td{border-bottom:none}
tr:hover td{background:var(--card-hover)}
.user-cell{display:flex;align-items:center;gap:0.7rem}
.mini-av{
  width:36px;height:36px;border-radius:50%;
  background:var(--card-hover);overflow:hidden;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:1rem;
}
.mini-av img{width:100%;height:100%;object-fit:cover}
.tag{display:inline-block;border-radius:4px;font-size:0.68rem;padding:2px 7px;font-weight:700;text-transform:uppercase;letter-spacing:0.03em}
.tag-admin{background:rgba(139,92,246,0.15);color:#a78bfa}
.tag-banned{background:rgba(220,38,38,0.15);color:#fca5a5}
.tag-active{background:rgba(34,197,94,0.15);color:#86efac}
.actions-cell{display:flex;gap:0.35rem;flex-wrap:wrap}

/* ── Misc ── */
.empty-state{text-align:center;padding:5rem 1rem;color:var(--text-muted)}
.empty-icon{font-size:3rem;margin-bottom:1rem;opacity:0.5}
.text-muted{color:var(--text-muted)}
.text-dim{color:var(--text-dim)}
.text-center{text-align:center}
.d-flex{display:flex}
.align-center{align-items:center}
.justify-between{justify-content:space-between}
.gap-1{gap:0.5rem}
.gap-2{gap:1rem}
.mt-1{margin-top:0.5rem}
.mt-2{margin-top:1rem}
.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:0.5rem}
.mb-2{margin-bottom:1rem}
.mb-3{margin-bottom:1.5rem}
.fw-bold{font-weight:700}
.fs-sm{font-size:0.82rem}

/* ── Responsive ── */
@media(max-width:900px){
  .profile-wrap{flex-direction:column}
  .profile-left{width:100%;max-width:320px;margin:0 auto}
}
@media(max-width:640px){
  .hero h1{font-size:2.2rem}
  .filter-bar{flex-direction:column}
  .form-row{flex-direction:column}
  .profile-grid{grid-template-columns:repeat(3,1fr)}
  .nav-links .nav-link span{display:none}
  .attr-grid{grid-template-columns:1fr}
}
@media(max-width:400px){
  .profile-grid{grid-template-columns:repeat(2,1fr)}
  .container,.container-sm,.container-md{padding:1rem 0.75rem}
}
