:root {
  --bg: #0d0d0f;
  --panel: #16161a;
  --panel-2: #1d1d22;
  --line: #2a2a31;
  --text: #e8e6df;
  --muted: #9a978c;
  --gold: #c9a227;
  --gold-dim: #8a7019;
  --red: #b3261e;
  --green: #2e7d32;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, system-ui, sans-serif;
}
h1, h2, h3, .brand span { font-family: Cinzel, Georgia, serif; letter-spacing: .03em; }
a { color: var(--gold); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 40px 36px; max-width: 360px; width: 100%; }
.login-box h1 { color: var(--gold); margin: 8px 0 4px; font-size: 28px; }
.login-box p { color: var(--muted); margin: 0 0 24px; }
.login-crest { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 10px; filter: drop-shadow(0 6px 18px #000c); }

/* layout */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; justify-content: center; padding: 0 8px; }
.brand img { width: 108px; height: auto; filter: drop-shadow(0 4px 14px #000a); }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a { display: flex; align-items: center; color: var(--text); text-decoration: none; padding: 9px 12px; border-radius: 8px; }
/* ícones do menu: PNG branco usado como máscara, então herdam a cor do texto (dourado quando ativo) */
.ico { flex: 0 0 auto; display: inline-block; width: 19px; height: 19px; margin-right: 11px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; opacity: .92; }
nav a.active .ico { opacity: 1; }
nav a:hover { background: var(--panel-2); }
nav a.active { background: #2a2410; color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid var(--line); }
.me img { width: 32px; height: 32px; border-radius: 50%; }
.me .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.me button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.me button:hover { color: var(--red); }
.main { padding: 24px 28px 48px; min-width: 0; }
.top h2 { margin: 0 0 20px; font-size: 24px; color: var(--gold); }

/* componentes */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--gold); }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat .n { font-size: 28px; font-weight: 600; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }

label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .05em; }
input[type=text], input[type=url], input[type=password], select, textarea {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-dim); border-color: var(--gold-dim); }
textarea { min-height: 120px; resize: vertical; }
select[multiple] { min-height: 130px; }
input[type=color] { width: 54px; height: 36px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text); text-transform: none; font-size: 14px; letter-spacing: 0; }
.check input { width: auto; }

.btn { display: inline-block; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; cursor: pointer; font: inherit; font-weight: 500; text-decoration: none; }
.btn:hover { border-color: var(--gold-dim); }
.btn.gold { background: var(--gold); color: #1a1500; border-color: var(--gold); }
.btn.gold:hover { filter: brightness(1.1); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag.pending { background: #3a3010; color: var(--gold); }
.tag.approved { background: #12301a; color: #6fcf7f; }
.tag.rejected { background: #3a1412; color: #f08a84; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters .btn.on { background: #2a2410; border-color: var(--gold); color: var(--gold); }

/* editor de mensagens */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .composer { grid-template-columns: 1fr; } }
.preview { background: #313338; border-radius: var(--radius); padding: 16px; position: sticky; top: 16px; }
.preview .who { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.preview .who img { width: 38px; height: 38px; border-radius: 50%; background: #1e1f22; }
.preview .who b { color: #fff; }
.preview .who i { font-style: normal; font-size: 10px; background: #5865f2; color: #fff; padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.preview .content { white-space: pre-wrap; color: #dbdee1; margin: 4px 0 8px 48px; word-break: break-word; }
.pv-embed { margin-left: 48px; background: #2b2d31; border-left: 4px solid var(--gold); border-radius: 4px; padding: 10px 14px; max-width: 480px; position: relative; }
.pv-embed .t { color: #fff; font-weight: 600; margin-bottom: 4px; word-break: break-word; }
.pv-embed .d { color: #dbdee1; white-space: pre-wrap; word-break: break-word; }
.pv-embed .f { color: #949ba4; font-size: 12px; margin-top: 8px; }
.pv-embed img.big { max-width: 100%; border-radius: 4px; margin-top: 10px; display: block; }
.pv-embed img.thumb { position: absolute; top: 10px; right: 10px; width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }

.ranking li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
ul.clean { list-style: none; margin: 0; padding: 0; }

h3.sec { margin: 26px 0 12px; color: var(--gold); font-size: 17px; }
.sellers { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
details.seller { padding: 12px 14px; }
details.seller summary { cursor: pointer; }
details.seller[open] summary { margin-bottom: 8px; }

.toast { position: fixed; bottom: 22px; right: 22px; background: var(--panel); border: 1px solid var(--gold-dim); color: var(--text); padding: 12px 18px; border-radius: 10px; max-width: 360px; box-shadow: 0 8px 30px #000a; z-index: 10; }
.toast.err { border-color: var(--red); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }  /* o menu não estica para preencher a tela */
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 10px 14px; padding: 12px 14px; }
  .brand img { width: 56px; }
  nav { flex-direction: row; flex-wrap: wrap; }
  .me { margin: 0 0 0 auto; border: 0; }
  .main { padding: 16px; }
}
