/* Agenda da Casa de Festa — mesmo visual do Painel Financeiro (Padrão Executivo Contínuo),
   com letra e toques maiores: quem usa também são pessoas de 50+ anos, no celular.
   Fundo contínuo; só dado vira cartão; cor só com significado.
   Tokens definidos uma vez por tema: o tema.js sempre define data-theme. */

:root {
  color-scheme: light;
  /* Superfícies */
  --bg: #eaeff5;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --surface-3: #e9eef5;
  --input-bg: #ffffff;
  /* Texto */
  --text: #213b52;
  --text-2: #3b5469;
  --muted: #5a7286;
  --soft: #7c8fa1;
  /* Marca */
  --blue: #2c5372;
  --blue-2: #5d86a5;
  --blue-fill: #2c5372;
  --blue-soft: rgba(44, 83, 114, 0.09);
  --on-blue: #ffffff;
  /* Linhas */
  --line: rgba(44, 83, 114, 0.12);
  --line-strong: rgba(44, 83, 114, 0.22);
  --line-soft: rgba(44, 83, 114, 0.07);
  /* Tons */
  --ok: #1f8c80;
  --ok-bg: rgba(31, 140, 128, 0.11);
  --warn: #b8692c;
  --warn-fill: #d4874e;
  --warn-bg: rgba(212, 135, 78, 0.14);
  --bad: #d2303f;
  --bad-fill: #e83948;
  --bad-bg: rgba(232, 57, 72, 0.1);
  /* Estados do calendário */
  --dia-alugado: #2c5372;
  --on-alugado: #ffffff;
  --dia-pre: #f1c75b;
  --on-pre: #3a2a00;
  /* Cores das temporadas */
  --temp-roxo: #8a6d9f;
  --temp-verde: #1f8c80;
  --temp-laranja: #d4874e;
  --temp-rosa: #c8558a;
  --temp-azul: #4f8fc0;
  /* Forma */
  --shadow: 0 1px 2px rgba(44, 83, 114, 0.06), 0 2px 8px rgba(44, 83, 114, 0.04);
  --shadow-lg: 0 18px 40px rgba(20, 45, 70, 0.18);
  --r: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* Tipografia e espaçamento (maiores que no Painel) */
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12.5px;
  --fs-sm: 14px;
  --fs: 16px;
  --fs-md: 17px;
  --fs-lg: 22px;
  --fs-xl: 30px;
  --e1: 4px;
  --e2: 8px;
  --e3: 12px;
  --e4: 16px;
  --e5: 24px;
  --e6: 32px;
  --toque: 48px;
  --nav-h: 68px;
  --pad-x: clamp(16px, 2vw, 30px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e17;
  --surface: #161b26;
  --surface-2: #1c2331;
  --surface-3: #232b3a;
  --input-bg: #0f1420;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --soft: #64748b;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --blue-fill: #2563eb;
  --blue-soft: rgba(59, 130, 246, 0.16);
  --on-blue: #ffffff;
  --line: #232b3a;
  --line-strong: #2e3849;
  --line-soft: #1a2130;
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.14);
  --warn: #f59e0b;
  --warn-fill: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --bad: #f43f5e;
  --bad-fill: #f43f5e;
  --bad-bg: rgba(244, 63, 94, 0.14);
  --dia-alugado: #2563eb;
  --on-alugado: #ffffff;
  --dia-pre: #f59e0b;
  --on-pre: #1d1300;
  --temp-roxo: #a78bfa;
  --temp-verde: #10b981;
  --temp-laranja: #fb923c;
  --temp-rosa: #f472b6;
  --temp-azul: #22d3ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 0 0 1px #232b3a, 0 24px 56px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.caption { font-size: var(--fs-sm); color: var(--muted); }
.mt { margin-top: var(--e4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--nav-h);
  display: flex; align-items: center; gap: var(--e5);
  padding: 0 var(--pad-x);
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; text-decoration: none; min-width: 0; }
.brand-nome { overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--blue-fill); color: var(--on-blue);
  display: grid; place-items: center;
}
.brand-mark .icon { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: var(--fs);
  padding: 10px 14px; border-radius: var(--r-sm);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--e2); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; flex: none;
  border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Botões (sempre com texto; altura mínima de toque) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--toque); padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: var(--fs); white-space: nowrap; text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover { border-color: var(--blue-2); }
.btn-primary { background: var(--blue-fill); border-color: var(--blue-fill); color: var(--on-blue); }
.btn-primary:hover { filter: brightness(1.1); border-color: var(--blue-fill); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); border-color: var(--ok); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: transparent; background: var(--blue-soft); }
.btn-danger { color: var(--bad); border-color: var(--bad-bg); background: transparent; }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad-bg); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-lg { min-height: 56px; padding: 0 24px; font-size: var(--fs-md); border-radius: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-whats { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-whats:hover { filter: brightness(1.08); border-color: #1f9d55; }

/* ---------- Página ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: var(--e4) var(--pad-x) 56px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); margin: var(--e2) 0 var(--e4); flex-wrap: wrap; min-height: 48px; }
.page-head h1 { font-size: 26px; letter-spacing: -0.015em; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: var(--e2); flex-wrap: wrap; align-items: center; }

.grade { display: grid; gap: 14px; align-items: start; }
.grade-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.grade-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.bloco { margin-top: 14px; }

/* ---------- Cartão ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 20px 22px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); margin-bottom: 14px; min-height: 32px; flex-wrap: wrap; }
.card-head h2 { font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.005em; }
.card-head .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }

/* ---------- Número em destaque ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.stat-rotulo { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat-ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--soft); flex: none; }
.stat-ponto.ok { background: var(--ok); }
.stat-ponto.warn { background: var(--warn-fill); }
.stat-ponto.azul { background: var(--blue); }
.stat-valor { font-size: clamp(24px, 2.2vw, 30px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-delta { font-size: var(--fs-sm); color: var(--muted); }

/* Cartão de pessoa (Resumo) */
.pessoa { display: grid; gap: 4px; }
.pessoa-topo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pessoa-topo b { font-size: var(--fs-md); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blue-soft); color: var(--blue); font-weight: 800;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); white-space: nowrap; line-height: 1.5;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.pre { background: color-mix(in srgb, var(--dia-pre) 30%, transparent); color: var(--text); }

/* ---------- Segmentado ---------- */
.seg { display: inline-flex; flex-wrap: wrap; border-radius: 14px; padding: 4px; background: var(--surface-3); gap: 2px; }
.seg button { border: 0; background: none; min-height: 42px; padding: 0 16px; border-radius: 11px; font-weight: 700; font-size: var(--fs-sm); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Campos ---------- */
.input, .select, .textarea {
  min-height: var(--toque); border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--input-bg);
  padding: 0 14px; min-width: 0; outline: none; font-size: var(--fs); width: 100%;
}
.textarea { padding: 12px 14px; min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input.erro { border-color: var(--bad); }
.campo { display: grid; gap: 6px; margin-bottom: 18px; align-content: start; position: relative; }
.campo > label, .campo .lbl { font-weight: 700; font-size: var(--fs); color: var(--text-2); }
.campo .opcional { font-weight: 500; color: var(--muted); font-size: var(--fs-sm); }
.campo .ajuda { font-size: var(--fs-sm); color: var(--muted); }
.campo .erro-campo { font-size: var(--fs-sm); color: var(--bad); font-weight: 600; }
.campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.busca { max-width: 360px; }

/* Valor grande (R$) */
.valor-grande { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--blue); padding: 4px 2px; }
.valor-grande span { font-size: 22px; font-weight: 700; color: var(--muted); }
.valor-grande input { border: 0; outline: none; background: none; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; width: 100%; min-width: 0; padding: 0; }

/* Botões de escolha grandes (quem, como pagou, tipo de evento) */
.opcoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.opcoes.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opcoes.duas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opcoes.uma { grid-template-columns: minmax(0, 1fr); }
.opcao {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 56px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700;
}
.opcoes.uma .opcao, .opcao.esq { justify-content: flex-start; text-align: left; }
.opcao:hover { border-color: var(--blue-2); background: var(--surface-2); }
.opcao[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.opcao .t { font-weight: 700; display: block; line-height: 1.25; }
.opcao .s { font-size: var(--fs-sm); color: var(--muted); display: block; font-weight: 500; }
.opcao .marca {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center;
}
.opcao[aria-pressed="true"] .marca { border-color: var(--blue); background: var(--blue); color: #fff; }
.opcao .marca .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.opcao[aria-pressed="true"] .marca .icon { opacity: 1; }
.numeros { display: flex; gap: 6px; flex-wrap: wrap; }
.numeros button { min-width: 52px; min-height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; }
.numeros button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }

/* Caixas de aviso */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: var(--fs); margin-bottom: 16px; }
.aviso .icon { margin-top: 2px; }
.aviso.bad { background: var(--bad-bg); color: var(--bad); }
.aviso.warn { background: var(--warn-bg); color: var(--warn); }
.aviso.info { background: var(--blue-soft); color: var(--text-2); }
.aviso b { font-weight: 800; }

/* ---------- Listas ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 6px; border-bottom: 1px solid var(--line-soft);
}
.lista > .lista-item:last-child, .lista > li:last-child > .lista-item { border-bottom: 0; }
button.lista-item { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; border-radius: 8px; min-height: 64px; }
button.lista-item:hover { background: var(--surface-2); }
.li-texto { min-width: 0; display: block; }
.li-titulo { display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.li-titulo > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { display: block; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-valor { font-weight: 800; text-align: right; white-space: nowrap; }
.li-valor small { display: block; font-size: var(--fs-xs); font-weight: 700; }
.li-data {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; align-content: center; flex: none;
  background: var(--blue-soft); color: var(--blue); line-height: 1.05;
}
.li-data b { font-size: 19px; font-weight: 800; }
.li-data small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.li-data.pre { background: color-mix(in srgb, var(--dia-pre) 30%, transparent); color: var(--text); }
.li-data.cancelada { background: var(--surface-3); color: var(--soft); }
.grupo-titulo {
  font-size: var(--fs-xs); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 18px 6px 4px; display: flex; justify-content: space-between;
}
.grupo-titulo:first-child { padding-top: 0; }

.vazio {
  text-align: center; color: var(--muted); padding: 26px 16px; font-size: var(--fs);
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
}
.vazio strong { display: block; color: var(--text); margin-bottom: 4px; font-weight: 700; }
.vazio .btn { margin-top: 14px; }

/* ---------- Calendário do mês ---------- */
.cal-topo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-titulo { text-align: center; }
.cal-titulo h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.cal-seta {
  width: 52px; height: 52px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; color: var(--text);
}
.cal-seta:hover { border-color: var(--blue); }
.cal-seta .icon { width: 24px; height: 24px; }
.cal-temporadas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; min-height: 0; }
.chip-temp {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--text);
  background: color-mix(in srgb, var(--temp) 18%, transparent); border: 1px solid color-mix(in srgb, var(--temp) 45%, transparent);
}
.chip-temp i { width: 10px; height: 10px; border-radius: 3px; background: var(--temp); }
.cal-hoje-btn { justify-self: center; }

.cal-sem, .cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-sem { margin-bottom: 6px; }
.cal-sem span { text-align: center; font-size: var(--fs-sm); font-weight: 800; color: var(--muted); }
.cal-sem .fds { color: var(--text-2); }
.cal-grade { touch-action: pan-y; }
.cal-vazio { display: block; }
.cal-dia {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px;
  min-height: 92px; padding: 8px 8px 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); text-align: left; line-height: 1.2;
  transition: transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
.cal-dia:hover { box-shadow: 0 0 0 2px var(--blue-2); }
.cal-dia:active { transform: scale(0.98); }
.cal-dia .num { font-size: 18px; font-weight: 800; }
.cal-dia .feriado { font-size: 11.5px; font-weight: 700; color: var(--bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-dia .quem { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-dia .hora { font-size: 11.5px; font-weight: 600; opacity: 0.85; white-space: nowrap; }
.cal-dia.passado:not(.alugado):not(.pre) { background: var(--surface-2); color: var(--soft); }
.cal-dia.passado .num { opacity: 0.8; }
.cal-dia.alugado { background: var(--dia-alugado); border-color: var(--dia-alugado); color: var(--on-alugado); }
.cal-dia.alugado .feriado { color: #ffd2d6; }
.cal-dia.pre { background: var(--dia-pre); border-color: var(--dia-pre); color: var(--on-pre); }
.cal-dia.pre .feriado { color: #8f1220; }
.cal-dia.hoje { box-shadow: 0 0 0 3px var(--ok); }
.cal-dia.hoje .num::after { content: "hoje"; margin-left: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ok); vertical-align: 3px; }
.cal-dia.hoje.alugado .num::after, .cal-dia.hoje.pre .num::after { color: inherit; }
/* Temporada: faixa colorida no topo da célula */
.cal-dia[style*="--temp"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--temp); }
.cal-dia[style*="--temp"] { padding-top: 11px; }
.cal-dia .mais { font-size: 11px; font-weight: 800; opacity: 0.9; }

.cal-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; }
.cal-legenda span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legenda i { width: 18px; height: 18px; border-radius: 5px; display: inline-block; border: 1px solid var(--line-strong); }
.cal-legenda .l-livre { background: var(--surface); }
.cal-legenda .l-alugado { background: var(--dia-alugado); border-color: var(--dia-alugado); }
.cal-legenda .l-pre { background: var(--dia-pre); border-color: var(--dia-pre); }
.cal-legenda .l-feriado { width: auto; height: auto; border: 0; font-style: normal; color: var(--bad); font-weight: 800; }
.cal-legenda .l-temp { background: linear-gradient(var(--temp-roxo) 0 30%, var(--surface) 30%); }
.cal-legenda .l-hoje { box-shadow: 0 0 0 2px var(--ok); border-color: transparent; }

/* ---------- Detalhe da reserva ---------- */
.det-topo { display: grid; gap: 4px; margin-bottom: 14px; }
.det-topo h3 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.015em; }
.det-topo .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.barra-pago { margin: 8px 0 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.barra-pago .linha { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: var(--fs); }
.barra-pago .linha b { font-weight: 800; }
.barra { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 10px 0 2px; }
.barra i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.infos { display: grid; border-top: 1px solid var(--line-soft); margin: 0 0 8px; }
.infos > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.infos dt { color: var(--muted); }
.infos dd { margin: 0; font-weight: 700; text-align: right; }
.subtitulo { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 6px; }
.subtitulo:first-child { margin-top: 0; }
.pag-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.pag-item:last-child { border-bottom: 0; }
.pag-item .v { font-weight: 800; text-align: right; }
.pag-item .s { font-size: var(--fs-sm); color: var(--muted); }
.pag-item.previsto .v { color: var(--warn); }
.pag-item.atrasado .s { color: var(--bad); font-weight: 700; }
.pag-acoes { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.det-acoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 18px; }
.det-perigo { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* Revisão antes de salvar */
.revisao { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 8px; }
.revisao-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.revisao-row:last-child { border-bottom: 0; }
.revisao-row .k { color: var(--muted); }
.revisao-row .v { font-weight: 700; text-align: right; }

/* ---------- Sheet (modal; vira gaveta no celular) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(6, 16, 26, 0.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; animation: fade 0.12s ease-out;
}
.sheet {
  width: min(600px, 100%); max-height: min(860px, calc(100vh - 40px)); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: subir 0.18s var(--ease);
}
.sheet.sheet-sm { width: min(440px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: var(--fs-md); font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { padding: 20px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sheet-foot .esq { margin-right: auto; }
.sheet-msg { margin: 0; font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(12px); opacity: 0; } }

/* Etapas */
.wiz-passo { display: block; padding: 10px 20px 0; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.wiz-prog { display: flex; gap: 6px; padding: 0 20px; margin-top: 8px; }
.wiz-prog i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.wiz-prog i.on { background: var(--blue); }
.wiz-titulo { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.wiz-sub { color: var(--muted); margin: 0 0 18px; }
.parcelas-lista { margin: 4px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-2); }
.parcelas-lista li { padding: 3px 0; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 14px 20px; border-radius: 12px; font-weight: 700; font-size: var(--fs); box-shadow: var(--shadow-lg); animation: subir 0.15s ease-out; text-align: center; }
.toast.erro { background: var(--bad-fill); color: #fff; }

/* ---------- Navegação inferior (celular) ---------- */
.bottom-nav { display: none; }

/* ---------- Login ---------- */
.pagina-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.login-wrap { display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); padding: 28px 24px; text-align: center; }
.login-card .brand-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; }
.login-card .brand-mark .icon { width: 30px; height: 30px; }
.login-card h1 { font-size: var(--fs-lg); font-weight: 800; }
.login-card p { color: var(--muted); margin-top: 4px; }
.pin-pontos { display: flex; justify-content: center; gap: 14px; margin: 22px 0 6px; min-height: 22px; }
.pin-pontos i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pin-pontos i.on { background: var(--blue); border-color: var(--blue); }
.login-erro { min-height: 24px; color: var(--bad); font-weight: 700; margin: 6px 0 10px; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.teclado button {
  min-height: 64px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 26px; font-weight: 700; color: var(--text);
}
.teclado button:hover { background: var(--surface-2); }
.teclado button:active { background: var(--blue-soft); }
.teclado .tecla-acao { font-size: var(--fs); font-weight: 700; color: var(--muted); }
.teclado .tecla-entrar, .teclado .tecla-entrar:hover { background: var(--blue-fill); border-color: var(--blue-fill); color: var(--on-blue); font-size: var(--fs-md); }
.teclado .tecla-entrar:hover { filter: brightness(1.1); }
.login-tema { position: fixed; top: 12px; right: 12px; }

/* ---------- Carregando ---------- */
.carregando { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .grade-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-main, .grade-2 { grid-template-columns: minmax(0, 1fr); }
  .cal-dia { min-height: 80px; }
}
@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  .nav { display: none; }
  .so-desktop { display: none !important; }
  .brand-nome { font-size: 15px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(70px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .bottom-nav a {
    display: grid; justify-items: center; gap: 3px; text-decoration: none; font-size: 12px; font-weight: 700;
    color: var(--muted); padding: 6px 0;
  }
  .bottom-nav a[aria-current="page"] { color: var(--blue); }
  .bottom-nav .icon { width: 24px; height: 24px; }
  .bn-mais {
    justify-self: center; display: grid; justify-items: center; gap: 2px; border: 0; background: none;
    font-size: 12px; font-weight: 700; color: var(--blue); margin-top: -22px;
  }
  .bn-mais span.circ {
    width: 56px; height: 56px; border-radius: 18px; background: var(--blue-fill); color: var(--on-blue);
    display: grid; place-items: center; box-shadow: var(--shadow-lg);
  }
  .bn-mais .icon { width: 28px; height: 28px; stroke-width: 2.4; }
  .page { padding-top: var(--e3); }
  .page-head h1 { font-size: var(--fs-lg); }
  .grade-3 { grid-template-columns: minmax(0, 1fr); }
  .grade-4 { gap: 10px; }
  .stat { padding: 14px; }
  .stat-valor { font-size: 22px; }
  .card { padding: 16px 14px; }
  .cal-card { padding: 14px 8px; }
  .cal-topo { gap: 6px; }
  .cal-titulo h2 { font-size: 20px; }
  .cal-seta { width: 48px; height: 48px; }
  .cal-sem, .cal-grade { gap: 4px; }
  .cal-sem span { font-size: 12px; }
  .cal-dia { min-height: 62px; padding: 5px 3px 4px; align-items: center; text-align: center; border-radius: 10px; }
  .cal-dia[style*="--temp"] { padding-top: 8px; }
  .cal-dia[style*="--temp"]::before { height: 5px; }
  .cal-dia .num { font-size: 17px; }
  .cal-dia .quem { font-size: 10.5px; }
  .cal-dia .hora { display: none; }
  .cal-dia .feriado { font-size: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  .cal-dia.alugado .feriado { background: #ffd2d6; }
  .cal-dia.hoje .num::after { content: none; }
  .cal-legenda { gap: 8px 14px; font-size: 13px; }
  .overlay { padding: 0; place-items: end stretch; }
  .sheet { width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 18px 18px 0 0; border-width: 1px 0 0; }
  .sheet.sheet-sm { width: 100%; }
  .sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto -4px; flex: none; }
  .sheet-body { padding: 18px 16px; }
  .sheet-head { padding-left: 16px; }
  .wiz-prog { padding: 0 16px; }
  .wiz-passo { padding: 10px 16px 0; }
  .sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
  .sheet-foot .esq { flex: 0 0 auto; }
  .campos-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .opcoes { grid-template-columns: 1fr 1fr; }
  .opcoes.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .opcoes.uma { grid-template-columns: minmax(0, 1fr); }
  .opcao { padding: 10px 8px; }
  .toasts { bottom: 92px; }
  .busca { max-width: none; }
  .seg { width: 100%; }
  .seg button { flex: 1 0 auto; padding: 0 10px; }
}
@media (max-width: 340px) {
  .campos-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cal-dia .quem { display: none; }
}
/* iOS dá zoom ao focar campo com fonte < 16px: em tela de toque os campos ficam com 16px ou mais. */
@media (max-width: 720px), (pointer: coarse) {
  .input, .select, .textarea { font-size: 16px; }
}
/* Tablet em pé: menu completo no topo, sem barra inferior; calendário e lista um embaixo do outro. */
@media (min-width: 721px) and (max-width: 1080px) {
  .nav a { padding: 10px 12px; }
  .nav a .icon { display: none; }
  .grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Troca de tema sem piscar (ver tema-troca.js) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.32s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.tema-trocando, .tema-trocando *, .tema-trocando *::before, .tema-trocando *::after {
  transition: background-color 0.32s ease, color 0.32s ease, border-color 0.32s ease, box-shadow 0.32s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Créditos (rodapé discreto; ver creditos.js) ---------- */
.creditos {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 12px;
  max-width: 1280px; margin: -28px auto 0; padding: 14px var(--pad-x) 22px;
  font-size: var(--fs-xs); color: var(--soft); line-height: 1.6;
}
.creditos:empty { display: none; }
.creditos b { color: var(--muted); font-weight: 700; }
.creditos a { display: inline-flex; align-items: center; padding: 5px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.creditos a:hover { color: var(--blue); background: var(--blue-soft); }
.creditos svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.creditos-links { display: inline-flex; gap: 4px; }
body:not(.pagina-login) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.pagina-login) > .page { flex: 1 0 auto; width: 100%; }
.pagina-login .creditos { margin: 0; padding: 8px 0 18px; }

/* Barras de rolagem finas na cor do tema */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
