:root {
  --bg: #000000; --card: rgba(14,14,14,.92); --card2: #161616; --line: #2a2a2a;
  --txt: #f2f2f2; --muted: #9a9a9a; --gold: #c9962e; --gold2: #e0ae45;
  --ok: #3fae6a; --bad: #d9534f; --warn: #e0a030; --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #000; color: var(--txt);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--gold2); }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; color: var(--gold2); }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.center { text-align: center; padding: 3rem 1rem; }
.wrap { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 5rem; }
.narrow { max-width: 480px; }

/* topo */
.top { position: sticky; top: 0; z-index: 5; background: #000; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; padding-top: max(.5rem, env(safe-area-inset-top)); }
.top img { height: 38px; }
.top .quem { margin-left: auto; text-align: right; font-size: .8rem; color: var(--muted); }
.top .quem b { color: var(--txt); display: block; font-size: .9rem; }
.nav { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.nav a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; }
.nav a.on { color: #000; background: var(--gold); border-color: var(--gold); font-weight: 600; }

/* cartões e formulários */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; }
.logo-big { display: block; width: 220px; max-width: 70%; margin: 1.5rem auto 1rem; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .7rem 0 .25rem; }
input, select, textarea { font-family: inherit; width: 100%; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); color: var(--txt); font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 .75rem; }
@media (max-width: 520px) { .row, .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .8rem 0; color: var(--txt); font-size: .92rem; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--gold); }

button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  padding: .7rem 1.1rem; border-radius: 10px; border: 1px solid var(--gold); background: var(--gold); color: #000;
  font-weight: 700; font-size: .95rem; text-decoration: none; }
button.sec, .btn.sec { background: transparent; color: var(--gold2); }
button.ghost { background: transparent; border-color: var(--line); color: var(--txt); font-weight: 500; }
button.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
button.okb { background: var(--ok); border-color: var(--ok); color: #fff; }
button:disabled { opacity: .5; cursor: wait; }
.full { width: 100%; margin-top: 1rem; }
.acoes { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

/* listas */
.item { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .info { flex: 1; min-width: 0; }
.item .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { white-space: nowrap; display: inline-block; font-size: .72rem; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.ok { color: var(--ok); border-color: var(--ok); } .tag.bad { color: var(--bad); border-color: var(--bad); }
.tag.warn { color: var(--warn); border-color: var(--warn); } .tag.gold { color: var(--gold2); border-color: var(--gold); }
.code { font-family: ui-monospace, monospace; color: var(--gold2); }

.linkbox { word-break: break-all; background: var(--card2); border: 1px dashed var(--gold); border-radius: 10px; padding: .7rem; font-size: .85rem; }
.qr { display: block; margin: 1rem auto; background: #fff; padding: 10px; border-radius: 10px; width: 220px; }
.aviso { border-left: 3px solid var(--warn); background: #2a2213; padding: .7rem .9rem; border-radius: 8px; font-size: .9rem; margin: .8rem 0; }
.erro { border-left-color: var(--bad); background: #2a1515; }
.sucesso { border-left-color: var(--ok); background: #13261a; }
dl.dados { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
dl.dados dt { color: var(--muted); } dl.dados dd { margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #fff; color: #000; padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 24px #0008; z-index: 50; max-width: 90vw; }
.modal-fundo { position: fixed; inset: 0; background: #000b; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 1.2rem; }
@media (min-width: 700px) { .modal-fundo { align-items: center; } .modal { border-radius: 16px; } }

/* ---------- Fundo animado: máquinas de tatuagem + logo ---------- */
body::before { content: ""; position: fixed; inset: -220px; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22220%22 height=%22220%22 viewBox=%220 0 220 220%22%3E %3Cg transform=%22translate%2818 20%29%22%3E%3Cg fill=%22none%22 stroke=%22%23c9962e%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%229%22 y=%2218%22 width=%229%22 height=%2219%22 rx=%223%22/%3E%3Crect x=%2220%22 y=%2218%22 width=%229%22 height=%2219%22 rx=%223%22/%3E %3Cpath d=%22M5 40 H33 V13%22/%3E%3Cpath d=%22M8 13 H38%22/%3E%3Ccircle cx=%2238%22 cy=%2213%22 r=%222.2%22/%3E %3Cpath d=%22M33 40 L41 47%22/%3E%3Crect x=%2239%22 y=%2245%22 width=%227%22 height=%2212%22 rx=%222%22 transform=%22rotate%28-48 42 51%29%22/%3E %3Cpath d=%22M46 55 L56 63%22/%3E%3Cpath d=%22M33 22 L39 22%22/%3E%3C/g%3E%3C/g%3E %3Cg transform=%22translate%28150 120%29 rotate%2835%29%22%3E%3Cg fill=%22none%22 stroke=%22%23c9962e%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%220%22 y=%220%22 width=%2212%22 height=%2226%22 rx=%225%22/%3E%3Cpath d=%22M2 26 H10 L9 40 H3 Z%22/%3E%3Cpath d=%22M6 40 V48%22/%3E%3Cpath d=%22M3 6 H9%22/%3E%3Cpath d=%22M6 -6 V0%22/%3E%3C/g%3E%3C/g%3E %3Cg transform=%22translate%28120 10%29 rotate%28180 30 30%29 scale%28.8%29%22%3E%3Cg fill=%22none%22 stroke=%22%23c9962e%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%229%22 y=%2218%22 width=%229%22 height=%2219%22 rx=%223%22/%3E%3Crect x=%2220%22 y=%2218%22 width=%229%22 height=%2219%22 rx=%223%22/%3E %3Cpath d=%22M5 40 H33 V13%22/%3E%3Cpath d=%22M8 13 H38%22/%3E%3Ccircle cx=%2238%22 cy=%2213%22 r=%222.2%22/%3E %3Cpath d=%22M33 40 L41 47%22/%3E%3Crect x=%2239%22 y=%2245%22 width=%227%22 height=%2212%22 rx=%222%22 transform=%22rotate%28-48 42 51%29%22/%3E %3Cpath d=%22M46 55 L56 63%22/%3E%3Cpath d=%22M33 22 L39 22%22/%3E%3C/g%3E%3C/g%3E %3Cg transform=%22translate%2840 150%29 rotate%28-25%29%22%3E%3Cg fill=%22none%22 stroke=%22%23c9962e%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%220%22 y=%220%22 width=%2212%22 height=%2226%22 rx=%225%22/%3E%3Cpath d=%22M2 26 H10 L9 40 H3 Z%22/%3E%3Cpath d=%22M6 40 V48%22/%3E%3Cpath d=%22M3 6 H9%22/%3E%3Cpath d=%22M6 -6 V0%22/%3E%3C/g%3E%3C/g%3E %3Cg fill=%22%23c9962e%22%3E%3Ccircle cx=%22105%22 cy=%22105%22 r=%221.6%22/%3E%3Ccircle cx=%22195%22 cy=%22200%22 r=%221.3%22/%3E%3Ccircle cx=%2210%22 cy=%22120%22 r=%221.3%22/%3E%3Cpath d=%22M190 60 l3 6 6 3 -6 3 -3 6 -3 -6 -6 -3 6 -3z%22/%3E%3Cpath d=%22M90 190 l2 4 4 2 -4 2 -2 4 -2 -4 -4 -2 4 -2z%22/%3E%3C/g%3E %3C/svg%3E"); background-size: 220px 220px; opacity: .085;
  animation: fundo-deriva 90s linear infinite; }
body::after { content: ""; position: fixed; left: 50%; top: 55%; z-index: 0; pointer-events: none;
  width: min(80vw, 560px); aspect-ratio: 1221 / 797; transform: translate(-50%, -50%);
  background: url("logo.png") center / contain no-repeat; opacity: .07;
  animation: logo-respira 9s ease-in-out infinite; }
#app, .toast { position: relative; z-index: 1; }
.toast { position: fixed; }
.top { background: rgba(0,0,0,.88); backdrop-filter: blur(6px); }
.nav { background: rgba(0,0,0,.85); backdrop-filter: blur(6px); }
.modal { background: #0b0b0b; border: 1px solid var(--line); }
@keyframes fundo-deriva { from { transform: translate(0, 0); } to { transform: translate(220px, 220px); } }
@keyframes logo-respira { 0%, 100% { opacity: .055; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: .10; transform: translate(-50%, -52%) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }

.contato { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; text-align: center; margin: 1.5rem 0 1rem; }
.contato a { color: var(--gold2); text-decoration: none; }

.btn-instalar.mini { padding: .4rem .7rem; font-size: .8rem; margin-left: .5rem; }

/* ---------- financeiro ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin: .6rem 0; }
.kpi { background: #0d0d0d; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; }
.kpi span { display: block; font-size: .75rem; color: var(--muted); }
.kpi b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.kpi.ok b { color: var(--ok); } .kpi.bad b { color: var(--bad); } .kpi.warn b { color: var(--warn); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tabela th, .tabela td { padding: .4rem .35rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.tabela th { color: var(--muted); font-weight: 600; font-size: .75rem; }
.rolar { overflow-x: auto; }
.taxas input { width: 4.6rem; margin: 0; padding: .35rem .3rem; text-align: right; }
.saldo-grande { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.periodo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi.gold b { color: var(--gold2); }
