/* ---------- painel administrativo (/admin) ---------- */
body.in-admin { background: #0c0f0e; }
#admin { --adm-bg: #0c0f0e; --adm-card: #141917; --adm-line: #ffffff14; --adm-muted: #ffffff8c; }

.adm { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }

/* menu lateral */
.adm-side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 14px;
  background: #0f1412; border-right: 1px solid var(--adm-line);
}
.adm-brand { font-size: 1.15rem; font-weight: 800; padding: 0 10px; }
.adm-brand b { color: var(--gold); }
.adm-nav { display: flex; flex-direction: column; gap: 4px; }
.adm-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #fff; text-decoration: none; font-weight: 600; opacity: .7;
  transition: background .15s, opacity .15s;
}
.adm-nav a:hover { background: #ffffff0d; opacity: 1; }
.adm-nav a[aria-current="page"] { background: #f4c5421c; color: var(--gold); opacity: 1; }
.adm-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.adm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 0; border-top: 1px solid var(--adm-line); }
.adm-side-foot small { color: var(--adm-muted); font-size: .75rem; }
.adm-back { margin-top: 10px; color: #9fe8c0; text-decoration: none; font-size: .9rem; }
.adm-back:hover { text-decoration: underline; }

/* conteúdo */
.adm-main { min-width: 0; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.adm-head h1 { margin: 0; font-size: 1.6rem; }
.adm-head p { margin: 4px 0 0; color: var(--adm-muted); }
.adm-head-tools { display: flex; gap: 8px; align-items: center; }
.adm-content { display: flex; flex-direction: column; gap: 18px; }
.adm-loading { padding: 40px; text-align: center; color: var(--adm-muted); }
.adm-backlink { color: #9fe8c0; text-decoration: none; align-self: flex-start; }
.adm-backlink:hover { text-decoration: underline; }

/* filtro de período (segmentado) */
.adm-seg { display: inline-flex; background: #ffffff0d; border: 1px solid var(--adm-line); border-radius: 10px; padding: 3px; }
.adm-seg button {
  font: inherit; font-size: .85rem; font-weight: 600; color: #fff; background: none; border: none;
  padding: 7px 12px; border-radius: 7px; cursor: pointer; opacity: .7;
}
.adm-seg button:hover { opacity: 1; }
.adm-seg button[aria-pressed="true"] { background: #ffffff1f; opacity: 1; }

/* cartões de indicador */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.adm-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px;
  background: var(--adm-card); border: 1px solid var(--adm-line);
}
.adm-tile-label { font-size: .82rem; color: var(--adm-muted); font-weight: 600; }
.adm-tile-value { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.adm-tile-extra { font-size: .8rem; color: var(--adm-muted); }
.adm-tile.gold { border-color: #f4c54255; background: linear-gradient(160deg, #241d0b, var(--adm-card) 70%); }
.adm-tile.gold .adm-tile-value { color: var(--gold); }
.adm-tile.pos .adm-tile-value { color: var(--you); }
.adm-tile.neg .adm-tile-value { color: var(--bot); }
.adm-tile.mode-m { border-top: 3px solid #5ab0ff; }
.adm-tile.mode-p { border-top: 3px solid #c792ff; }

/* cartões com tabela */
.adm-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.adm-card { background: var(--adm-card); border: 1px solid var(--adm-line); border-radius: 14px; overflow: hidden; min-width: 0; }
.adm-card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--adm-line);
}
.adm-card-head h2 { margin: 0; font-size: 1.02rem; }
.adm-card-head a { color: #9fe8c0; text-decoration: none; font-size: .9rem; }
.adm-note { margin: 0; padding: 10px 16px 14px; font-size: .82rem; color: var(--adm-muted); }

.adm-table-wrap { overflow-x: auto; }
.adm-scroll { max-height: 420px; overflow-y: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th {
  text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--adm-muted); padding: 10px 14px; background: #ffffff06; position: sticky; top: 0;
  white-space: nowrap;
}
.adm-table td { padding: 10px 14px; border-top: 1px solid var(--adm-line); vertical-align: middle; }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-table .nowrap { white-space: nowrap; }
.adm-table .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; }
.adm-table a { color: #fff; text-decoration: none; font-weight: 600; }
.adm-table a:hover { color: var(--gold); text-decoration: underline; }
.adm-table.clickable tbody tr { cursor: pointer; }
.adm-table.clickable tbody tr:hover, .adm-table.clickable tbody tr:focus-visible { background: #ffffff0a; outline: none; }
.adm-table tr.group th { background: #ffffff0d; color: var(--gold); padding-top: 12px; }
.adm-table.compare td:first-child { color: #ffffffcc; }
.adm-table.compare th.num { color: #fff; font-size: .8rem; }
.adm-empty { text-align: center; color: var(--adm-muted); padding: 26px !important; }
.adm-muted { color: var(--adm-muted); }
.adm-table .pos, .adm-tiles .pos, .adm-dl .pos { color: var(--you); }
.adm-table .neg, .adm-tiles .neg, .adm-dl .neg { color: var(--bot); }

/* etiquetas */
.adm-tag {
  display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: #ffffff14; white-space: nowrap;
}
.adm-tag.t-premio_partida { background: #3ddc8422; color: #7cf0b0; }
.adm-tag.t-entrada_partida { background: #ff6b6b22; color: #ffa3a3; }
.adm-tag.t-estorno { background: #5ab0ff22; color: #9fd0ff; }
.adm-tag.t-bonus_cadastro { background: #c792ff22; color: #dcbcff; }
.adm-tag.t-taxa_casa, .adm-tag.admin { background: #f4c54226; color: var(--gold); }
.adm-status { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.adm-status::before { content: "●"; margin-right: 5px; }
.adm-status.on { color: var(--you); }
.adm-status.off { color: var(--bot); }
.adm-res { font-weight: 700; margin-right: 4px; }
.adm-res.vitoria { color: var(--you); }
.adm-res.derrota { color: var(--bot); }
.adm-res.cancelada { color: var(--adm-muted); }

/* filtros e botões */
.adm-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-filters input, .adm-filters select {
  font: inherit; font-size: .88rem; color: #fff; background: #ffffff0d;
  border: 1px solid #ffffff26; border-radius: 9px; padding: 8px 10px; min-width: 0;
}
.adm-filters input { width: 240px; }
.adm-filters select option { background: #141917; }
.adm-filters input:focus, .adm-filters select:focus { outline: none; border-color: var(--you); }
.adm-btn {
  font: inherit; font-size: .88rem; font-weight: 700; color: #fff; cursor: pointer;
  background: #ffffff14; border: 1px solid #ffffff26; border-radius: 9px; padding: 8px 14px;
}
.adm-btn:hover:not(:disabled) { background: #ffffff24; }
.adm-btn:disabled { opacity: .4; cursor: not-allowed; }
.adm-btn.primary { background: var(--you); border-color: var(--you); color: var(--ink); }
.adm-btn.danger { background: transparent; border-color: var(--bot); color: var(--bot); }
.adm-btn.danger:hover { background: #ff6b6b1f; }
.adm-pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--adm-line); font-size: .88rem; color: var(--adm-muted); }

/* dados do cliente */
.adm-dl { margin: 0; }
.adm-dl div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 16px; border-top: 1px solid var(--adm-line); }
.adm-dl div:first-child { border-top: none; }
.adm-dl dt { color: var(--adm-muted); }
.adm-dl dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.adm-wa { margin-left: 8px; font-size: .78rem; color: #25d366; }

/* botão do perfil (app) */
.btn-admin { background: #ffffff10; color: var(--gold); border: 2px solid #f4c54266; }

/* celular: menu vira barra no topo */
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .adm-side {
    position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center;
    gap: 10px; padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--adm-line);
    overflow-x: auto; scrollbar-width: none;
  }
  .adm-brand { display: none; }
  .adm-nav { flex-direction: row; gap: 4px; }
  .adm-nav a { padding: 8px 10px; white-space: nowrap; font-size: .88rem; }
  .adm-side-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .adm-side-foot small, .adm-side-foot strong { display: none; }
  .adm-back { margin: 0; white-space: nowrap; font-size: .85rem; }
  .adm-main { padding: 18px 14px 40px; }
  .adm-grid-2 { grid-template-columns: 1fr; }
  .adm-filters input { width: 100%; }
  .adm-head-tools { width: 100%; }
  .adm-seg { width: 100%; overflow-x: auto; }
}
