/* lancei · estilo dos painéis (admin e dono da arena)
   Marca: Lima #D6F03C · Tinta #10140F · Papel #F7F7F2 · Cinza #4A4F45 · Neutro #E9E9E2
   Regra da marca: Lima nunca como texto/traço sobre fundo claro. No tema claro o destaque é Tinta;
   no escuro, Lima. */
:root, :root[data-theme="light"] {
  --lima: #D6F03C; --tinta: #10140F; --papel: #F7F7F2; --cinza: #4A4F45; --neutro: #E9E9E2;
  --bg: #F7F7F2; --card: #FFFFFF; --card-2: #EFEFE8; --line: #DEDED5; --line-2: #C9CABF;
  --text: #10140F; --muted: #4A4F45;
  --accent: #10140F;          /* traço/realce: Tinta no claro */
  --accent-bg: #10140F; --accent-fg: #D6F03C;   /* botão principal: Lima sobre Tinta */
  --bar-bg: #D6F03C; --bar-fg: #10140F;         /* barra do topo: Tinta sobre Lima (versão principal) */
  --ok: #1E7A36; --ok-bg: #E3F2E1; --warn: #8A5A00; --warn-bg: #FBEFD5; --bad: #B42318; --bad-bg: #FBE5E1;
  --info: #24527A; --info-bg: #E2ECF5;
  --chart-a: #10140F; --chart-b: #C9CABF;
  --shadow: 0 1px 2px rgba(16,20,15,.05), 0 2px 10px rgba(16,20,15,.04);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #10140F; --card: #181D16; --card-2: #20261D; --line: #2C3428; --line-2: #3B4436;
  --text: #F7F7F2; --muted: #A9AFA2;
  --accent: #D6F03C;
  --accent-bg: #D6F03C; --accent-fg: #10140F;
  --bar-bg: #10140F; --bar-fg: #D6F03C;
  --ok: #8BDB8F; --ok-bg: #1B2E1C; --warn: #F5BE5B; --warn-bg: #332810; --bad: #FF8A7A; --bad-bg: #3A1B17;
  --info: #8EC1EC; --info-bg: #17283A;
  --chart-a: #D6F03C; --chart-b: #3B4436;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
.wrap { max-width: 1140px; margin: 0 auto; padding-block: 22px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
[hidden] { display: none !important; }

/* ---- marca ---- */
.lancei, .lc-word { font-family: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif; font-weight: 800;
  letter-spacing: -0.04em; line-height: 1; text-transform: none; }
.lc-logo { display: inline-flex; align-items: center; gap: .21em; font-size: 26px; color: inherit; text-decoration: none; }
.lc-logo svg { width: 1.03em; height: 1.03em; flex: none; }
.lc-logo .lc-word { font-size: 1em; }
h1, h2, h3, .stat .n, .kpi .n, .tabs button { font-family: "Bricolage Grotesque", system-ui, sans-serif; }

/* ---- barra do topo ---- */
.appbar { background: var(--bar-bg); color: var(--bar-fg); border-bottom: 1px solid var(--line); }
.appbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-block: 12px; }
.appbar .ctx { display: flex; align-items: center; gap: 14px; min-width: 0; }
.appbar .ctx .sep { width: 1px; height: 22px; background: currentColor; opacity: .25; }
.appbar .ctx .where { font-weight: 600; font-size: 14px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.appbar .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.appbar .btn:hover, .appbar .btn:focus-visible { border-color: currentColor; }
.appbar .btn.primary { background: var(--tinta); color: var(--lima); border-color: var(--tinta); }
:root[data-theme="dark"] .appbar .btn.primary { background: var(--lima); color: var(--tinta); border-color: var(--lima); }
.btn.icon-btn { width: 38px; height: 38px; padding: 0; justify-content: center; flex: none; }
.btn.icon-btn svg { width: 19px; height: 19px; }

.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.brand { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1 { margin: 2px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 28px 0 12px; }
h2 .muted { font-family: system-ui, sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 0; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---- abas ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto;
  scrollbar-width: none; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px;
  font-weight: 700; padding: 12px 14px 11px; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent;
  margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.tabs .badge { font-family: system-ui, sans-serif; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bad-bg); color: var(--bad); }
.tabs .badge.warn { background: var(--warn-bg); color: var(--warn); }
.panel { animation: fadein .18s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }

/* ---- blocos ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--text); border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; line-height: 1.4; }
.btn:hover, .btn:focus-visible { border-color: var(--text); outline: none; }
.btn.primary { background: var(--accent-bg); color: var(--accent-fg); border-color: var(--accent-bg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line-2); }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: default; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat .n, .kpi .n { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .l, .kpi .l { font-size: 13px; color: var(--muted); }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.hl { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.kpi.hl .l, .kpi.hl .sub { color: #C9CEC2; }
.kpi.hl .n { color: var(--lima); }
:root[data-theme="dark"] .kpi.hl { background: var(--lima); color: var(--tinta); border-color: var(--lima); }
:root[data-theme="dark"] .kpi.hl .n { color: var(--tinta); }
:root[data-theme="dark"] .kpi.hl .l, :root[data-theme="dark"] .kpi.hl .sub { color: #3B4430; }
.kpi.bad .n { color: var(--bad); }
.kpi.warn .n { color: var(--warn); }
.kpi.ok .n { color: var(--ok); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; white-space: nowrap; background: var(--card-2); color: var(--muted); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on, .pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.off, .pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }
.pill.mute { color: var(--muted); background: var(--card-2); }
.pill.plain::before { display: none; }

.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--card-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
td a { font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
td .acts { display: flex; gap: 6px; justify-content: flex-end; }

.thumbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.clip { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.clip .media { position: relative; aspect-ratio: 16 / 9; background: #000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.clip .media img, .clip .media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.clip .media .play { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: #10140Fcc; border: 2px solid var(--lima);
  display: flex; align-items: center; justify-content: center; }
.clip .media .play::after { content: ""; border-left: 16px solid var(--lima); border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 4px; }
.clip .meta { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.empty { color: var(--muted); padding: 20px 0; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy code { background: var(--card-2); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.bars { display: grid; grid-template-columns: repeat(18, 1fr); gap: 4px; align-items: end; height: 120px; }
.bars div { background: var(--chart-a); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div.zero { background: var(--line); }
.bar-labels { display: grid; grid-template-columns: repeat(18, 1fr); gap: 4px; font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { margin-left: auto; min-width: 220px; width: auto; }
.chip { border: 1px solid var(--line-2); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--accent-bg); color: var(--accent-fg); border-color: var(--accent-bg); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
input[readonly] { background: var(--card-2); }
input[type=color] { padding: 2px; width: 42px; height: 36px; flex: none; cursor: pointer; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--tinta); }
:root[data-theme="dark"] input[type=checkbox] { accent-color: var(--lima); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; font-size: 14px; }
.form .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.acts-r { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.acts-l { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { color: var(--bad); margin: 0; font-size: 14px; }
.ok-msg { color: var(--ok); font-size: 13.5px; font-weight: 600; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(16,20,15,.6); }
dialog h3 { margin: 0 0 4px; font-size: 20px; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.cols-2-1 { display: grid; gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); align-items: start; }
.banner { border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px; font-weight: 500; }
.banner.warn { color: var(--warn); background: var(--warn-bg); }
.banner.bad { color: var(--bad); background: var(--bad-bg); }
.banner.ok { color: var(--ok); background: var(--ok-bg); }
.banner.info { color: var(--info); background: var(--info-bg); }
.banner .btn { color: var(--text); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sbars { display: grid; gap: 3px; align-items: end; height: 150px; }
.sbars .col { display: flex; flex-direction: column-reverse; height: 100%; justify-content: flex-start; border-radius: 4px 4px 0 0; overflow: hidden; min-width: 0; cursor: default; }
.sbars .col > i { display: block; width: 100%; }
.sbars .col.zero { background: none; }
.sbars .col.zero::before { content: ""; display: block; height: 2px; background: var(--line); }
.sbars .col > i + i { border-bottom: 2px solid var(--card); }
.slabels { display: grid; gap: 3px; font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
.split i { display: block; height: 100%; }
.split i + i { border-left: 2px solid var(--card); }
.qrow { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.qrow:last-child { border-bottom: 0; }
.qrow .pct { color: var(--muted); font-size: 13px; min-width: 42px; text-align: right; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--tinta); color: var(--papel); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.45; }
.timeline { display: grid; gap: 0; max-height: 520px; overflow: auto; }
.timeline div { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.timeline div:last-child { border-bottom: 0; }
.qcard { display: grid; gap: 10px; min-width: 0; }
.qcard > * { min-width: 0; }
.qhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.qhead input[type=text] { font-weight: 700; flex: 1 1 140px; min-width: 0; }
.qhead input[type=color] { flex: none; }
.qhead select { min-width: 0; max-width: 100%; }
/* câmera em duas linhas: nome inteiro em cima, tipo e botões embaixo (cabe em cartões estreitos) */
.camrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "id nome nome" ". tipo acoes" ". url url";
  gap: 6px 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.camrow > * { min-width: 0; }
.camrow > code { grid-area: id; }
.camrow > input[data-f="nome"] { grid-area: nome; width: 100%; }
.camrow > select { grid-area: tipo; width: 100%; max-width: 180px; }
.camrow > span { grid-area: acoes; justify-self: end; }
.camrow > .url { grid-area: url; width: 100%; }


/* ---- financeiro ---- */
.fbars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; align-items: end; height: 170px; padding-top: 8px; }
.fbars .m { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-items: end; height: 100%; position: relative; }
.fbars .m i { display: block; border-radius: 4px 4px 0 0; min-height: 2px; }
.fbars .m i.p { background: var(--chart-b); }
.fbars .m i.r { background: var(--chart-a); }
.fbars .m.cur::after { content: ""; position: absolute; inset: -6px -6px auto; height: calc(100% + 12px); border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, transparent); z-index: -1; }
.flabels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }
.flabels b { color: var(--text); }
.inv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.inv:last-child { border-bottom: 0; }
.inv .who { font-weight: 700; }
.inv .what { font-size: 13.5px; color: var(--muted); }
.inv .val { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 800; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.inv .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.hero > div { padding: 20px; }
.hero .main { border-right: 1px solid var(--line); }
.hero .big { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 800; font-size: 40px; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hero .pixqr { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; width: max-content; }
.pixcode { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--card-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; max-height: 74px; overflow: auto; }
.steps { display: grid; gap: 10px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 14px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-family: "Bricolage Grotesque", system-ui, sans-serif; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

@media (max-width: 760px) { .hero, .cols-2-1 { grid-template-columns: 1fr; } .hero .main { border-right: 0; border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) {
  h1 { font-size: 24px; } .stat .n, .kpi .n { font-size: 24px; } .hero .big { font-size: 32px; }
  .row2, .row3 { grid-template-columns: 1fr; } .filters input[type=search] { margin-left: 0; width: 100%; }
  .camrow { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .appbar .ctx .sep, .appbar .ctx .where { display: none; }
  .fbars, .flabels { gap: 6px; }
  .timeline div { grid-template-columns: 1fr; gap: 2px; }
}
