/* ===== Evento · Caixa — mesmo tema do Brisa · Rotina ===== */
:root {
  --bg: #16130f; --surface: #201c16; --surface-2: #2a251d; --line: #383127;
  --text: #f3ede2; --text-dim: #a89c8a;
  --accent: #e07a4f; --accent-soft: rgba(224,122,79,.14);
  --ok: #9db787; --ok-soft: rgba(157,183,135,.14);
  --danger: #d96c6c; --danger-soft: rgba(217,108,108,.14);
  --radius: 18px;
  --font-display: "Cabinet Grotesk", sans-serif; --font-body: "Supreme", sans-serif;
}
[data-theme="light"] {
  --bg: #f6f1e8; --surface: #fffdf8; --surface-2: #efe8db; --line: #e0d7c6;
  --text: #2b2419; --text-dim: #8d8170;
  --accent: #c95f36; --accent-soft: rgba(201,95,54,.11);
  --ok: #6d8f55; --ok-soft: rgba(109,143,85,.13);
  --danger: #b04545; --danger-soft: rgba(176,69,69,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; } [data-theme="light"] { color-scheme: light; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px;
  line-height: 1.45; min-height: 100dvh; padding-bottom: 90px; }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.oculto { display: none !important; }

.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.marca { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.marca span { color: var(--accent); }
.topo-acoes { display: flex; gap: 8px; align-items: center; }
.chip { font-size: 13px; color: var(--text-dim); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select.chip { border: 1px solid var(--line); cursor: pointer; max-width: 45vw; appearance: none; -webkit-appearance: none; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.icone { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 12px; font-size: 18px; cursor: pointer; }

.banner { margin: 10px 16px 0; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: var(--danger-soft); border: 1px solid var(--danger); color: var(--text); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok); }

.abas { display: flex; gap: 6px; padding: 12px 16px 4px; }
.abas button { flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-dim); font-family: var(--font-display); font-weight: 700; font-size: 15px; cursor: pointer; }
.abas button.ativa { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

main { padding: 8px 16px; max-width: 760px; margin: 0 auto; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; align-items: center; }
select, input, textarea { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); border-radius: 12px;
  padding: 10px 12px; font: inherit; font-size: 15px; min-width: 0; }
.filtros select { flex: 1; }
.check { font-size: 14px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }

.lista { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; cursor: pointer; }
.item.apagado { opacity: .45; text-decoration: line-through; }
.item .titulo { font-weight: 500; }
.item .valor { font-family: var(--font-display); font-weight: 800; font-size: 18px; text-align: right; }
.item .valor.venda { color: var(--ok); } .item .valor.repasse { color: var(--accent); }
.item .meta { grid-column: 1 / -1; font-size: 13px; color: var(--text-dim); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); margin-right: 4px; }
.vazio { text-align: center; color: var(--text-dim); padding: 40px 0; }

.fab { position: fixed; right: 20px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 30px; line-height: 56px; cursor: pointer; z-index: 4;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.card h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 8px; }
.linha { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.linha:last-child { border-bottom: none; }
.linha.total { font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.linha .n { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.neg { color: var(--danger); } .pos { color: var(--ok); }
.sub { color: var(--text-dim); font-size: 13px; }

.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-size: 13px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.form .duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acoes { display: flex; gap: 8px; margin-top: 6px; }
button.primario, button.secundario, button.perigo { flex: 1; padding: 12px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line); }
button.primario { background: var(--accent); color: #fff; border-color: var(--accent); }
button.secundario { background: var(--surface-2); color: var(--text); }
button.perigo { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
button.mini { padding: 6px 10px; border-radius: 10px; font-size: 13px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); cursor: pointer; }

.sheet-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 8; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; max-width: 760px; margin: 0 auto; }
.sheet h2 { font-family: var(--font-display); font-size: 20px; margin-bottom: 12px; }

.token-tela { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.token-tela .card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
