/* TinyTok — área de admin e páginas de conta. Tema escuro roxo/bordô/preto, funciona no celular. */
@font-face {
  font-family: "TinyTok Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/overlays/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "TinyTok Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/overlays/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0b070b;
  --panel: #150d16;
  --raise: #201522;
  --line: #2f1f33;
  --line2: #43294a;
  --text: #f6f1f8;
  --muted: #a898ad;
  --purple: #a259ff;
  --purple-soft: #d4b0ff;
  --bordo: #9b1b42;
  --pink: #f08aac;
  --grad: linear-gradient(135deg, #a259ff 0%, #7b2bb8 50%, #9b1b42 100%);
  --ok: #2fd37a;
  --warn: #f5a524;
  --bad: #ff4d7d;
  --gold: #ffd54a;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, rgba(162, 89, 255, .14), transparent 60%), radial-gradient(900px 500px at 110% 0%, rgba(155, 27, 66, .16), transparent 60%), var(--bg);
  color: var(--text); font: 500 15px/1.45 "TinyTok Sans", system-ui, -apple-system, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--purple-soft); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: .55rem 1rem;
  border-radius: 12px; border: 1px solid var(--line2); background: var(--raise); font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--purple); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; box-shadow: 0 6px 22px rgba(162, 89, 255, .3); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 77, 125, .45); color: #ffc2d3; }
.btn.danger:hover { background: rgba(255, 77, 125, .12); border-color: var(--bad); }
.btn.sm { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; border-radius: 10px; }
.btn svg { width: 17px; height: 17px; }

label.field { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 700; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 42px; padding: .55rem .8rem; border-radius: 12px; border: 1px solid var(--line2); background: #0f0910; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(162, 89, 255, .2); }

.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg button { min-height: 36px; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line2); background: transparent; font-weight: 700; font-size: .85rem; cursor: pointer; }
.seg button.on { background: rgba(162, 89, 255, .18); border-color: var(--purple); color: #fff; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; }
.auth-card { width: 100%; max-width: 400px; padding: 1.8rem 1.5rem; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.auth-brand .logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 30px rgba(162, 89, 255, .45); }
.auth-brand .word { height: 30px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: .9rem; }
.auth-card form { display: flex; flex-direction: column; gap: .8rem; }
.auth-card .btn.primary { width: 100%; min-height: 46px; margin-top: .3rem; }
.msg { min-height: 1.2em; font-size: .88rem; font-weight: 600; }
.msg.err { color: #ff9cb8; }
.msg.ok { color: #8ff0b8; }

/* ---------- layout do painel ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem;
  background: rgba(11, 7, 11, .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.top .brand { display: flex; align-items: center; gap: .55rem; }
.top .brand .logo { width: 32px; height: 32px; border-radius: 9px; }
.top .brand .word { height: 20px; }
.top .tag { font-size: .7rem; font-weight: 800; letter-spacing: .08em; padding: .15rem .45rem; border-radius: 6px; background: rgba(162, 89, 255, .2); color: var(--purple-soft); }
.top .who { margin-left: auto; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

.tabs { display: flex; gap: .3rem; padding: .7rem 1rem 0; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: 12px; border: 1px solid transparent; background: transparent;
  font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button svg { width: 17px; height: 17px; }
.tabs button.on { color: #fff; background: var(--raise); border-color: var(--line2); }
main { max-width: 1180px; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }

.card { padding: 1.1rem; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.card h2 { margin: 0 0 .9rem; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.card h2 svg { width: 19px; height: 19px; color: var(--purple-soft); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card-head .grow { flex: 1; }

/* ---------- números ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.stat { padding: .9rem 1rem; border-radius: 16px; background: var(--raise); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.hl { background: linear-gradient(135deg, rgba(162, 89, 255, .2), rgba(155, 27, 66, .16)); border-color: rgba(162, 89, 255, .4); }

/* ---------- formulário de convites ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; }
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row > span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.codes { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.code-line {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem .55rem .9rem; border-radius: 12px; background: #0f0910; border: 1px dashed var(--line2);
}
.code-line .mono { flex: 1; font-size: 1.05rem; font-weight: 700; }

/* ---------- listas (tabela no PC, cartões no celular) ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: grid; align-items: center; gap: .8rem; padding: .75rem .4rem; border-bottom: 1px solid var(--line);
  grid-template-columns: var(--cols);
}
.row:last-child { border-bottom: 0; }
.row.head { font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 0; }
.row.click { cursor: pointer; border-radius: 12px; }
.row.click:hover { background: var(--raise); }
.cell-main { min-width: 0; }
.cell-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main small { color: var(--muted); }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.pill.pro { background: linear-gradient(135deg, rgba(255, 213, 74, .22), rgba(240, 138, 172, .18)); color: var(--gold); border-color: rgba(255, 213, 74, .35); }
.pill.free { background: rgba(255, 255, 255, .06); color: var(--muted); }
.pill.admin { background: rgba(162, 89, 255, .2); color: var(--purple-soft); }
.pill.ok { background: rgba(47, 211, 122, .14); color: #8ff0b8; }
.pill.warn { background: rgba(245, 165, 36, .14); color: #ffd38a; }
.pill.bad { background: rgba(255, 77, 125, .14); color: #ffb0c6; }
.pill.live { background: rgba(255, 59, 107, .2); color: #ff9cb8; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.live { background: #ff3b6b; box-shadow: 0 0 8px #ff3b6b; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.toolbar input { max-width: 320px; }

/* ---------- gaveta da conta ---------- */
.drawer-bg { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.drawer {
  position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); overflow-y: auto; padding: 1.2rem;
  background: var(--panel); border-left: 1px solid var(--line2); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer h3 { margin: 1.2rem 0 .6rem; font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.drawer .close { position: absolute; top: .9rem; right: .9rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mini { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; }
.mini div { padding: .5rem .7rem; border-radius: 10px; background: var(--raise); }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; z-index: 40; transform: translateX(-50%); padding: .7rem 1.1rem; border-radius: 14px;
  background: #1e1420; border: 1px solid var(--line2); font-weight: 700; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: up .2s ease-out;
}
.toast.err { border-color: rgba(255, 77, 125, .6); }
@keyframes up { from { transform: translate(-50%, 10px); opacity: 0; } }

@media (max-width: 720px) {
  main { padding: .7rem; }
  .row.head { display: none; }
  .row { grid-template-columns: 1fr auto !important; gap: .35rem .6rem; padding: .8rem .3rem; }
  .row .hide-sm { display: none; }
  .top .word { display: none; }
}
