/* Tabernáculo Gestão — Tesouraria Digital */
:root {
  --navy-900: #14213A;
  --navy-800: #1B2B47;
  --navy-700: #213A63;
  --blue-600: #1F4A8A;
  --blue-500: #2B5CA8;
  --blue-400: #4C7DD0;
  --blue-50: #EDF2FB;
  --bg: #F2F4F8;
  --card: #FFFFFF;
  --ink: #0F1B2E;
  --ink-2: #4A5568;
  --ink-3: #8592A6;
  --line: #E4E8EF;
  --green: #0E9F57;
  --green-bg: #E6F6EE;
  --red: #DC3545;
  --red-bg: #FDECEE;
  --amber: #B7791F;
  --amber-bg: #FFF6E5;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .04), 0 6px 20px rgba(16, 30, 54, .06);
  --shadow-lg: 0 10px 40px rgba(16, 30, 54, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 66px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { font-size: 15px; line-height: 1.45; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue-500); text-decoration: none; }
img { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 28px;
  background: radial-gradient(120% 80% at 50% 0%, var(--blue-600), var(--navy-800) 60%, var(--navy-900)); }
.splash img { width: 160px; opacity: .95; animation: fadeUp .6s ease both; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(120% 70% at 50% 0%, var(--blue-600), var(--navy-800) 55%, var(--navy-900)); color: #fff; }
.auth-hero { flex: 1; display: grid; place-items: center; padding: calc(40px + var(--safe-t)) 24px 24px; text-align: center; }
.auth-hero img { width: min(200px, 52vw); animation: fadeUp .6s ease both; }
.auth-hero h1 { font-size: 20px; margin: 22px 0 2px; font-weight: 700; letter-spacing: .2px; }
.auth-hero p { margin: 0; opacity: .7; font-size: 14px; }
.auth-card { background: var(--card); color: var(--ink); border-radius: 28px 28px 0 0; padding: 28px 22px calc(28px + var(--safe-b)); animation: fadeUp .5s .1s ease both; }
.auth-card h2 { margin: 0 0 4px; font-size: 22px; }
.auth-card .lead { margin: 0 0 20px; color: var(--ink-3); }
@media (min-width: 720px) {
  .auth { flex-direction: row; }
  .auth-card { width: 440px; border-radius: 0; display: flex; flex-direction: column; justify-content: center; padding: 48px; }
}

/* ---------- formulários ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238592A6' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
textarea.input { height: auto; min-height: 84px; padding: 14px 16px; resize: vertical; }
.input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(43, 92, 168, .12); }
.input[readonly] { background: var(--bg); }
.money { position: relative; }
.money .input { padding-left: 46px; font-size: 20px; font-weight: 650; height: 58px; font-variant-numeric: tabular-nums; }
.money::before { content: 'R$'; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; font-size: 15px; pointer-events: none; }
.money.sm .input { height: 50px; font-size: 17px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.err { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 14px; border: 0;
  font-weight: 650; font-size: 16px; background: var(--blue-50); color: var(--blue-600); transition: transform .08s, filter .15s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, var(--blue-500), var(--blue-600)); color: #fff; box-shadow: 0 6px 16px rgba(31, 74, 138, .28); }
.btn.success { background: linear-gradient(180deg, #13B166, var(--green)); color: #fff; box-shadow: 0 6px 16px rgba(14, 159, 87, .28); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.block { width: 100%; }
.btn.sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.seg { display: flex; background: #E9EDF4; border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; height: 42px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: var(--blue-600); box-shadow: 0 1px 4px rgba(16, 30, 54, .12); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip.on { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-600); }

/* ---------- estrutura ---------- */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy-800); color: #fff; padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 12px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar .brand img { width: 34px; height: 34px; object-fit: contain; }
.topbar .brand b { display: block; font-size: 15px; line-height: 1.15; }
.topbar .brand small { display: block; font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { background: rgba(255,255,255,.1); border: 0; width: 38px; height: 38px; border-radius: 12px; color: #fff; display: grid; place-items: center; }
.topbar .back svg { width: 22px; height: 22px; }
.iconbtn { background: rgba(255,255,255,.1); border: 0; width: 38px; height: 38px; border-radius: 12px; color: #fff; display: grid; place-items: center; flex: none; }
.iconbtn svg { width: 20px; height: 20px; }
.page { padding: 16px; max-width: 1120px; margin: 0 auto; animation: fadeUp .25s ease both; }
.page-title { font-size: 24px; font-weight: 750; margin: 6px 2px 14px; letter-spacing: -.3px; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; margin: 22px 2px 10px; }
.section-title a, .section-title button.link { font-size: 14px; font-weight: 600; background: none; border: 0; color: var(--blue-500); }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); height: 100%; justify-content: center; }
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a.on { color: var(--blue-600); }
.bottomnav a.fab { position: relative; }
.bottomnav a.fab span.fab-circle { width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, var(--blue-400), var(--blue-600)); box-shadow: 0 8px 20px rgba(31, 74, 138, .4); border: 4px solid var(--bg); }
.bottomnav a.fab span.fab-circle svg { width: 26px; height: 26px; }

@media (min-width: 900px) {
  .shell { padding-bottom: 24px; padding-left: 240px; }
  .bottomnav { top: 0; bottom: 0; right: auto; width: 240px; height: 100vh; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: 18px 12px; gap: 4px; background: var(--navy-900); border: 0; }
  .bottomnav::before { content: ''; display: block; height: 120px; margin: 4px 0 18px; background: url(/assets/logo-white.png) center / contain no-repeat; }
  .bottomnav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; height: 48px; border-radius: 12px; font-size: 15px; color: rgba(255,255,255,.7); }
  .bottomnav a.on { background: rgba(255,255,255,.1); color: #fff; }
  .bottomnav a.fab span.fab-circle { width: auto; height: auto; margin: 0; border: 0; box-shadow: none; background: none; border-radius: 0; }
  .bottomnav a.fab span.fab-circle svg { width: 24px; height: 24px; }
  .bottomnav a.fab { background: linear-gradient(160deg, var(--blue-400), var(--blue-600)); color: #fff; margin: 6px 0; }
  .topbar .brand img { display: none; }
  .page { padding: 24px 28px; }
}

/* ---------- cartões ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.hero { position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--shadow-lg);
  background: radial-gradient(140% 120% at 100% 0%, var(--blue-400) 0%, var(--blue-600) 35%, var(--navy-800) 75%); }
.hero::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 190px; height: 190px; opacity: .08;
  background: url(/assets/logo-white.png) center / contain no-repeat; }
.hero .label { font-size: 13px; opacity: .75; font-weight: 600; }
.hero .big { font-size: 34px; font-weight: 750; letter-spacing: -.8px; margin: 4px 0 2px; }
.hero .sub { font-size: 13px; opacity: .8; }
.hero .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hero .split > div { background: rgba(255,255,255,.12); border-radius: 14px; padding: 10px 12px; }
.hero .split small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; }
.hero .split small svg { width: 15px; height: 15px; }
.hero .split b { display: block; font-size: 17px; margin-top: 2px; }
.eye { position: absolute; right: 14px; top: 14px; z-index: 2; }

.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.monthnav { display: flex; align-items: center; background: #fff; border-radius: 14px; box-shadow: var(--shadow); height: 44px; }
.monthnav button { border: 0; background: none; width: 40px; height: 44px; display: grid; place-items: center; color: var(--ink-2); }
.monthnav button svg { width: 18px; height: 18px; }
.monthnav span { min-width: 120px; text-align: center; font-weight: 650; font-size: 14px; }
.monthnav span::first-letter { text-transform: uppercase; }
.congsel { height: 44px; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--shadow); padding: 0 36px 0 14px; font-weight: 600; font-size: 14px; max-width: 100%;
  -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238592A6' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.kpi { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.kpi .ic svg { width: 18px; height: 18px; }
.kpi small { color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.kpi b { font-size: 18px; font-weight: 750; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic.g { background: var(--green-bg); color: var(--green); }
.ic.r { background: var(--red-bg); color: var(--red); }
.ic.b { background: var(--blue-50); color: var(--blue-500); }
.ic.a { background: var(--amber-bg); color: var(--amber); }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(6, 1fr); } }

.cta { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; text-align: left; margin-top: 14px; padding: 16px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #13B166, #0B8A4B); box-shadow: 0 10px 24px rgba(14, 159, 87, .3); }
.cta .ic { width: 48px; height: 48px; border-radius: 15px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.cta .ic svg { width: 26px; height: 26px; }
.cta b { display: block; font-size: 18px; }
.cta small { opacity: .85; }
.cta > svg { margin-left: auto; width: 22px; height: 22px; opacity: .8; }

.grid2 { display: grid; gap: 12px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- listas ---------- */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.item:last-child { border-bottom: 0; }
a.item { color: inherit; }
.item:active { background: var(--bg); }
.item .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.item .ic svg { width: 20px; height: 20px; }
.item .main { flex: 1; min-width: 0; }
.item .main b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main small { display: block; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .val { text-align: right; font-weight: 700; white-space: nowrap; }
.item .val small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.item.cancelled { opacity: .5; }
.item.cancelled .val { text-decoration: line-through; }
.item > svg.chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.daylabel { font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; margin: 16px 4px 8px; }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; opacity: .5; margin-bottom: 8px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); vertical-align: middle; }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.blue { background: var(--blue-50); color: var(--blue-600); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }

/* ---------- registrar ---------- */
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action { background: var(--card); border: 0; border-radius: 20px; box-shadow: var(--shadow); padding: 18px 16px; text-align: left; display: flex; flex-direction: column; gap: 12px; min-height: 130px; transition: transform .1s; }
.action:active { transform: scale(.98); }
.action .ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; }
.action .ic svg { width: 24px; height: 24px; }
.action b { font-size: 16px; }
.action small { color: var(--ink-3); font-size: 13px; line-height: 1.3; }
.action.main { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; color: #fff; background: linear-gradient(135deg, #13B166, #0B8A4B); box-shadow: 0 10px 24px rgba(14, 159, 87, .3); }
.action.main .ic { background: rgba(255,255,255,.2); color: #fff; width: 54px; height: 54px; }
.action.main small { color: rgba(255,255,255,.85); }
@media (min-width: 700px) { .actions-grid { grid-template-columns: repeat(3, 1fr); } }

.form-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 6px; margin-bottom: 12px; }
.form-card > h3 { margin: 0 0 14px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.form-card > h3 svg { width: 18px; height: 18px; color: var(--blue-500); }
.form-wrap { max-width: 640px; margin: 0 auto; }
.split-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.split-line .lbl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin: 0 0 4px 4px; }

.sumbar { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 15; background: var(--navy-800); color: #fff; border-radius: 20px; padding: 14px; box-shadow: var(--shadow-lg); margin-top: 8px; }
.sumbar .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.sumbar .nums small { display: block; font-size: 11.5px; opacity: .7; font-weight: 600; }
.sumbar .nums b { font-size: 16px; }
.sumbar .nums .pos { color: #4ADE80; }
.sumbar .nums .neg { color: #FF8A94; }
@media (min-width: 900px) { .sumbar { bottom: 16px; } }

.catgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.catgrid button { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); min-height: 78px; line-height: 1.2; text-align: center; }
.catgrid button svg { width: 22px; height: 22px; }
.catgrid button.on { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-600); }
@media (min-width: 560px) { .catgrid { grid-template-columns: repeat(4, 1fr); } }

.upload { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px; cursor: pointer; margin-bottom: 14px; }
.upload svg { width: 22px; height: 22px; color: var(--blue-500); flex: none; }
.upload input { display: none; }
.upload .thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }

.success { text-align: center; padding: 30px 10px 10px; }
.success .check { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; animation: pop .5s ease both; box-shadow: 0 0 0 12px var(--green-bg); }
.success .check svg { width: 48px; height: 48px; }
.success h2 { margin: 0 0 6px; font-size: 22px; }
.success .totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.success .totals div { background: var(--card); border-radius: 14px; padding: 12px 6px; box-shadow: var(--shadow); }
.success .totals small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.success .totals b { font-size: 16px; }
.stack { display: grid; gap: 10px; }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 10px; fill: var(--ink-3); font-family: inherit; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; gap: 12px; }
.hbar .r { display: grid; gap: 5px; }
.hbar .r .t { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.hbar .r .t span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 9px; border-radius: 99px; background: var(--bg); overflow: hidden; display: flex; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }

/* ---------- tabelas ---------- */
.tablewrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFD; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; white-space: nowrap; }
table.t tfoot td { font-weight: 750; background: #FAFBFD; }

/* ---------- folha inferior (modal) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 18, 32, .45); animation: fade .2s ease both; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); animation: slideUp .28s cubic-bezier(.2, .8, .2, 1) both; -webkit-overflow-scrolling: touch; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: #CBD3DF; margin: 4px auto 12px; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.sheet .sheet-head h2 { margin: 0; font-size: 19px; }
.sheet .close { border: 0; background: #E4E8EF; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sheet .close svg { width: 18px; height: 18px; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.detail { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; margin-bottom: 12px; }
.detail .dl { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail .dl:last-child { border-bottom: 0; }
.detail .dl span { color: var(--ink-3); flex: none; }
.detail .dl b { text-align: right; font-weight: 600; word-break: break-word; }
.amount-big { text-align: center; padding: 10px 0 18px; }
.amount-big b { font-size: 34px; font-weight: 800; letter-spacing: -.8px; display: block; }
.timeline { font-size: 13px; }
.timeline div { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline div::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-400); }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 100; display: grid; justify-items: center; pointer-events: none; gap: 8px; padding: 0 12px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; max-width: 520px; animation: toastIn .3s ease both; }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast.ok svg { color: #4ADE80; }
.toast.error { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---------- configurações ---------- */
.profile { display: flex; align-items: center; gap: 14px; }
.avatar { width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(135deg, var(--blue-400), var(--blue-600)); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 20px; flex: none; }

/* ---------- impressão / PDF ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body.printing { background: #fff; }
  body.printing #app, body.printing #sheet-root, body.printing #toast-root { display: none !important; }
  body.printing #print-root { display: block; }
}
.pr { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #111; font-size: 10.5pt; }
.pr header { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid #1F4A8A; padding-bottom: 10px; margin-bottom: 14px; }
.pr header img { width: 74px; }
.pr header h1 { font-size: 15pt; margin: 0; color: #1B2B47; }
.pr header p { margin: 2px 0 0; color: #555; font-size: 9.5pt; }
.pr h2 { font-size: 11.5pt; color: #1F4A8A; margin: 16px 0 6px; border-bottom: 1px solid #ccd; padding-bottom: 3px; }
.pr table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.pr th, .pr td { border-bottom: 1px solid #e2e5ea; padding: 4px 6px; text-align: left; }
.pr th { background: #EDF2FB; font-size: 8.5pt; }
.pr td.r, .pr th.r { text-align: right; white-space: nowrap; }
.pr .boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pr .boxes div { border: 1px solid #d6dce6; border-radius: 6px; padding: 6px 8px; }
.pr .boxes small { display: block; color: #666; font-size: 8pt; }
.pr .boxes b { font-size: 11pt; }
.pr .pos { color: #0B7A43; } .pr .neg { color: #C21F30; }
.pr tr { page-break-inside: avoid; }
.pr h2 { break-after: avoid; page-break-after: avoid; }
.pr .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; text-align: center; font-size: 9.5pt; }
.pr .sign div { border-top: 1px solid #333; padding-top: 4px; }
.pr footer { margin-top: 18px; font-size: 8pt; color: #777; text-align: center; }
