:root {
  --bg: #0a0a0b;
  --panel: #121214;
  --panel-2: #18181b;
  --line: #26262b;
  --text: #ececef;
  --muted: #8b8b94;
  --accent: #e5385a;
  --accent-2: #ff6b8a;
  --green: #30a46c;
  --orange: #f5a524;
  --red: #e5484d;
  --bubble-fan: #1f1f24;
  --bubble-me: #3a1420;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Boutons, champs ---------- */
.btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.btn:hover { border-color: #3a3a42; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #f04466; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
.input:focus { outline: none; border-color: var(--accent); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- Connexion ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login p { margin: 0 0 20px; }
.login .err { color: var(--red); min-height: 20px; margin: 8px 0; }

/* ---------- Structure ---------- */
.shell { height: 100%; display: grid; grid-template-rows: 52px 1fr; }
.top { display: flex; align-items: center; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-weight: 800; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.brand i { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: inline-grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.nav a.on { color: var(--text); background: var(--panel-2); }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.dot.ok { background: var(--green); }
.dot.warn { background: var(--orange); }

.inbox { display: grid; grid-template-columns: 370px 1fr 300px; min-height: 0; }
.col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.col:last-child { border-right: 0; }

/* ---------- File ---------- */
.qhead { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.tabs { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.tabs button { flex: 1; background: none; border: 0; border-radius: 7px; padding: 6px 4px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tabs button.on { background: #000; color: var(--text); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; min-width: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.chip.on { border-color: var(--accent); color: var(--text); }
.qlist { overflow-y: auto; flex: 1; }
.qitem { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #1b1b1f; cursor: pointer; }
.qitem:hover { background: #141417; }
.qitem.on { background: #1d1015; box-shadow: inset 3px 0 var(--accent); }
.av { width: 40px; height: 40px; border-radius: 50%; background: #26262b; display: grid; place-items: center; font-weight: 700; color: #bbb; overflow: hidden; flex: none; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.qname { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qprev { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qmeta { text-align: right; font-size: 12px; display: grid; gap: 3px; justify-items: end; align-content: start; }
.wait { font-weight: 700; font-variant-numeric: tabular-nums; }
.wait.g { color: var(--green); } .wait.o { color: var(--orange); } .wait.r { color: var(--red); }
.tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: #26262b; color: #ccc; margin-right: 4px; vertical-align: 1px; }
.tag.model { background: #2a1520; color: var(--accent-2); }
.tag.vip { background: #3b2e0b; color: #f5c451; }
.tag.lock { background: #1a2633; color: #79b8ff; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Chat ---------- */
.chead { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; min-height: 60px; }
.chead .who { min-width: 0; }
.chead .who b { display: block; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 70%; padding: 8px 12px; border-radius: 14px; background: var(--bubble-fan); white-space: pre-wrap; word-wrap: break-word; align-self: flex-start; }
.msg.me { background: var(--bubble-me); align-self: flex-end; }
.msg.info { align-self: center; background: none; color: var(--muted); font-size: 12px; }
.msg .by { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.msg.fan .by { text-align: left; }
.msg .deleted { font-style: italic; color: var(--muted); }
.medias { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.medias img, .medias video { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; }
.ppv { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: #00000055; font-size: 12px; }
.daysep { align-self: center; font-size: 11px; color: var(--muted); margin: 8px 0; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; }
.composer textarea { resize: none; min-height: 60px; max-height: 200px; }
.composer .bar { display: flex; align-items: center; gap: 8px; }
.nochat { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

/* ---------- Fiche fan ---------- */
.side { overflow-y: auto; padding: 14px; display: grid; gap: 14px; align-content: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 22px; font-weight: 800; }

/* ---------- Pages ---------- */
.page { overflow-y: auto; padding: 24px; }
.page h2 { margin: 0 0 16px; }
table.t { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.t th, table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 16px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.banner { margin: 12px; padding: 10px 12px; border-radius: 9px; background: #2b1a08; border: 1px solid #5c3a10; color: #f5c451; font-size: 13px; }
.banner a { color: #ffd479; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 20; }
.toast { background: #222228; border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 30px #0008; }
.toast.err { border-color: #6b1f2a; }

@media (max-width: 1100px) {
  .inbox { grid-template-columns: 320px 1fr; }
  .inbox .col.side-col { display: none; }
}
@media (max-width: 720px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-chat .col.queue-col { display: none; }
  .inbox:not(.has-chat) .col.chat-col { display: none; }
  .nav a { padding: 6px 6px; }
  .top { gap: 10px; padding: 0 10px; }
  .page { padding: 16px; }
}
