:root {
  --bg: #140c10;
  --bg2: #1d1218;
  --card: #241720;
  --line: #3a2631;
  --text: #f6eaee;
  --muted: #b39aa5;
  --accent: #e0446b;
  --accent2: #ff8a5c;
  --ok: #3ccf91;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #3a1424 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.45 "DM Sans", system-ui, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, h3, .brand { font-family: "Fraunces", Georgia, serif; }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; margin: 18px 0 12px; }
h2 { margin: 0 0 6px; }
h3 { margin: 0 0 4px; }
a { color: var(--accent2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.brand { font-weight: 700; font-size: 22px; letter-spacing: .2px; }
.brand span { color: var(--accent); }
.brand.big { font-size: 30px; }
.brand small { font: 500 12px "DM Sans", system-ui, sans-serif; color: var(--muted); margin-left: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 64px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; }

.btn {
  border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px;
  padding: 9px 16px; font: 500 14px "DM Sans", system-ui, sans-serif; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: 0; color: #fff; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--bg2); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.big { padding: 14px 28px; font-size: 16px; }
.btn.danger { color: #ff7b8f; }
.btn:disabled { opacity: .6; cursor: wait; }

.tabs { display: flex; gap: 4px; background: var(--bg2); padding: 4px; border-radius: 999px; margin-bottom: 18px; }
.tabs.small { margin: 12px 12px 8px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 999px; font: 500 14px "DM Sans", system-ui, sans-serif; cursor: pointer; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--text); cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent2); }
.field-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: #2d1822; border: 1px solid var(--accent); padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
.toast.ok { border-color: var(--ok); }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(0, 560px); gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 32px 16px; }
.auth-hero p { color: var(--muted); font-size: 17px; max-width: 460px; }
.hero-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.hero-points li { padding-left: 26px; position: relative; }
.hero-points li::before { content: "♥"; position: absolute; left: 0; color: var(--accent); }
.auth-card { max-height: calc(100vh - 64px); overflow: auto; }

.photo-pick { display: flex; align-items: center; gap: 14px; }
.photo-pick .preview {
  width: 84px; height: 84px; border-radius: 50%; background: var(--bg2) center/cover no-repeat;
  border: 2px dashed var(--line); flex: none; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center;
}
.photo-pick .preview.has { border-style: solid; border-color: var(--accent); font-size: 0; }

/* ---- Layout de páginas ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(20,12,16,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.page { padding: 28px 16px; display: flex; justify-content: center; }
.page.wide { display: block; max-width: 1280px; margin: 0 auto; }
.narrow { width: 100%; max-width: 640px; }

.timer { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.timer.warn { border-color: var(--accent); color: #ffb3c3; }
.timer.vip { border-color: var(--ok); color: #a9f0cf; }

/* ---- Chat ---- */
#view-chat { height: 100vh; display: flex; flex-direction: column; }
.chat-layout { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(29,18,24,.6); }
.filters { padding: 4px 12px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.filter-title { font-size: 13px; color: var(--muted); }
.filter-toggle { margin: 0 12px 6px; align-self: flex-start; }
.list { list-style: none; margin: 0; padding: 4px 6px; overflow: auto; flex: 1; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; }
.list li:hover, .list li.active { background: var(--card); }
.list .who { min-width: 0; flex: 1; }
.list .who b { display: block; }
.list .who span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .empty-list { color: var(--muted); cursor: default; justify-content: center; text-align: center; padding: 30px 10px; }
.avatar-wrap { position: relative; flex: none; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--bg2); display: block; }
.dot { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #6b5560; border: 2px solid var(--bg); }
.dot.on { background: var(--ok); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

.conversation { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 20px; }
.empty-mark { font-size: 42px; color: var(--accent); }
#conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.conv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-head .back { display: none; }
.conv-info { padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); display: flex; gap: 16px; align-items: flex-start; }
.conv-info img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.messages { flex: 1; overflow: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(560px, 78%); padding: 9px 13px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; word-wrap: break-word; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, #b8304f, #d4593e); border: 0; }
.msg time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.typing { padding: 0 18px 6px; font-size: 12px; color: var(--muted); }
.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.composer input { border-radius: 999px; }

/* ---- Pagamento ---- */
.pay-card { text-align: center; }
.price { font: 700 44px "Fraunces", serif; margin: 14px 0 18px; }

/* ---- Admin ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font: 700 26px "Fraunces", serif; }
.stat span { color: var(--muted); font-size: 13px; }
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.inline { display: flex; gap: 8px; margin: 12px 0; }
.fetish-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fetish-list li { display: flex; align-items: center; gap: 6px; background: var(--bg2); border-radius: 10px; padding: 6px 6px 6px 12px; }
.fetish-list li span { flex: 1; }
#user-search { margin: 10px 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.pill.ok { border-color: var(--ok); color: #a9f0cf; }
.pill.bad { border-color: var(--accent); color: #ffb3c3; }

/* ---- Responsivo ---- */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 20px; }
  .auth-card { max-height: none; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.in-conv .sidebar { display: none; }
  .chat-layout:not(.in-conv) .conversation { display: none; }
  .conv-head .back { display: inline-block; }
  .topbar { padding: 10px 12px; }
  .topbar .brand { font-size: 18px; }
  .conv-info { flex-direction: column; }
}

.admin-col { display: flex; flex-direction: column; gap: 16px; }
#crm-status .err { color: #ffb3c3; display: block; margin-top: 4px; word-break: break-word; }
