/* Painel do LurkyEmotes — uma folha só, sem framework, sem build.
   A paleta é a mesma do painel do LurkyBot: quem usa os dois reconhece na hora. */

:root {
  --bg: #0d1016;
  --panel: #141821;
  --panel-2: #1a1f2b;
  --line: #242b39;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #7c5cff;
  --accent-soft: #7c5cff26;
  --green: #3fcf8e;
  --amber: #f5b74e;
  --red: #f2585b;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--red); }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* ---- login ---- */
.login {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  /* O mesmo halo do painel do LurkyBot, pela mesma razão: sem ele a tela de
     entrada é um retângulo sozinho no meio de um fundo chapado. */
  background:
    radial-gradient(60rem 32rem at 50% -12%, #7c5cff26, transparent 70%),
    radial-gradient(40rem 24rem at 50% 118%, #7c5cff14, transparent 70%);
}
.login-card {
  width: 100%; max-width: 380px; padding: 30px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 24px 60px #05070b80;
}
.login-mark { width: 44px; height: auto; }
.login-card h1 { font-size: 21px; }

/* ---- casca ---- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; padding: 0 8px; }
.brand-mark { width: 24px; height: auto; flex: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--muted); font: inherit; font-weight: 500; text-align: left;
}
.nav button span { width: 16px; text-align: center; opacity: .8; }
.nav button:hover { background: var(--panel-2); color: var(--text); }
.nav button[data-ativa="1"] { background: var(--accent-soft); color: #fff; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.quem {
  padding: 8px 10px; background: var(--panel-2); border-radius: 8px;
  font-size: 12px; color: var(--muted);
}

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #0d1016e6; backdrop-filter: blur(8px); z-index: 5;
}
.topbar h1 { font-size: 17px; }
.view { padding: 22px 24px 64px; display: flex; flex-direction: column; gap: 18px; }

/* ---- primitivos ---- */
.btn {
  font: inherit; font-weight: 500; cursor: pointer;
  padding: 8px 14px; border-radius: 8px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
}
.btn:hover { background: #222836; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: #f2585b55; color: var(--red); }
.btn.danger:hover { background: #f2585b1a; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="file"], select {
  font: inherit; color: inherit; width: 100%;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line);
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); outline-offset: -1px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h2 { font-size: 15px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat .value { font-size: 22px; font-weight: 600; }
.stat .label { font-size: 12px; color: var(--muted); }

/* ---- grade de emotes ---- */
.emotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }

.emote {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  position: relative;
}
.emote.off { opacity: .45; }
.emote.off .figura { filter: grayscale(1); }
.emote .figura {
  height: 56px; width: 100%;
  display: grid; place-items: center;
  background: repeating-conic-gradient(#ffffff08 0% 25%, transparent 0% 50%) 50% / 14px 14px;
  border-radius: 8px;
}
.emote .figura img { max-height: 52px; max-width: 100%; object-fit: contain; }
.emote .codigo { font-family: var(--mono); font-size: 13px; word-break: break-all; text-align: center; }
.emote .meta { font-size: 11px; color: var(--muted); }
.emote .acoes { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }

.selo {
  position: absolute; top: 6px; right: 6px;
  font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: var(--accent-soft); color: #cfc4ff;
}
.selo.aviso { background: #f5b74e26; color: var(--amber); }

.vazio {
  padding: 30px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
/* A marca bem apagada sobre o vazio, como no painel do LurkyBot: uma lista sem
   nada passa a parecer parte da casa, e não uma que não terminou de carregar. */
.vazio::before {
  content: ""; display: block; width: 36px; height: 36px; margin: 0 auto 10px;
  background: url("icone.png") center / contain no-repeat;
  opacity: 0.15;
}

/* ---- envio ---- */
.solta {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center; color: var(--muted); cursor: pointer;
}
.solta.sobre { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.previa { display: flex; gap: 12px; align-items: center; }
.previa img { max-height: 64px; max-width: 96px; object-fit: contain; }

/* ---- tabela ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---- avisos ---- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  padding: 10px 14px; border-radius: 9px; max-width: 340px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px #0009;
}
.toast.ok { border-color: #3fcf8e55; }
.toast.err { border-color: #f2585b66; }

.modal-backdrop {
  position: fixed; inset: 0; background: #05070ccc; z-index: 60;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 420px; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.modal footer { display: flex; gap: 8px; justify-content: flex-end; }

/* Utilitários — existem para o HTML não precisar de atributos `style`, que a
   política de segurança do painel (style-src 'self') bloqueia por princípio. */
.espaco-topo { margin-top: 10px; }
.coluna { flex-direction: column; align-items: stretch; }
.nu { padding: 0; background: none; border: 0; }
.clicavel { cursor: pointer; }

/* ---- páginas públicas (instalar, privacidade) ---- */
.pagina { max-width: 720px; margin: 0 auto; padding: 32px 20px 60px; }
.capa { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.capa img { border-radius: 18px; }
.capa h1 { font-size: 26px; }
.capa p { max-width: 46ch; }
.btn.grande { padding: 12px 26px; font-size: 15px; }

.pagina-corpo { display: flex; flex-direction: column; gap: 14px; }

.tabela-simples { display: flex; flex-direction: column; }
.linha-item {
  display: grid; grid-template-columns: 200px 1fr; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline;
}
.linha-item:first-child { border-top: 0; }
.linha-item a { color: var(--accent); }
.linha-item a:hover { text-decoration: underline; }

.lista { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.lista strong { color: var(--text); }

.rodape { text-align: center; margin-top: 26px; }
.rodape a { color: var(--accent); }

@media (max-width: 560px) {
  .linha-item { grid-template-columns: 1fr; gap: 2px; }
}

#caminho { display: flex; flex-direction: column; gap: 14px; }

.pronto { border-color: #3fcf8e55; margin-bottom: 14px; }
.pronto h2 { font-size: 17px; }

.trocador { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 4px 0 10px; }
.trocador select { width: auto; padding: 4px 8px; font-size: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- celular ---- */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav button { width: auto; }
  .view { padding: 16px 14px 48px; }
  .topbar { padding: 14px 16px; }
}
