:root {
  --navy-900: #0f2744; --navy-800: #16345a; --navy-700: #1e3a5f; --navy-600: #2a4f7a;
  --ink: #1a2332; --muted: #5c6b7a; --line: #d8e0ea; --bg: #eef2f6; --bg-soft: #f7f9fc; --panel: #fff;
  --ok: #1b7a4e; --ok-bg: #e6f5ee; --warn: #9a5b00; --warn-bg: #fff4e0; --danger: #a11c2e; --danger-bg: #fde8eb;
  --reserve: #0d6b6b; --reserve-bg: #e4f5f5;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,39,68,.06), 0 8px 24px rgba(15,39,68,.06);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: 160ms ease;
  --ease-out: 200ms cubic-bezier(.22,.61,.36,1);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.45; min-height: 100vh;
  background: radial-gradient(1200px 500px at 10% -10%, #d9e6f5 0%, transparent 55%),
              radial-gradient(900px 400px at 100% 0%, #d5ebe4 0%, transparent 50%), var(--bg); }
a { color: var(--navy-700); text-decoration: none; transition: color var(--ease); } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.icon { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
.icon--brand { width: 1.15rem; height: 1.15rem; }

.topbar { background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 12px rgba(15,39,68,.25); }
.topbar__inner { max-width: 1200px; margin: 0 auto; padding: .65rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.brand__foto {
  display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.12); cursor: pointer; flex-shrink: 0;
  width: 2rem; height: 2rem; transition: background var(--ease), transform var(--ease);
}
.brand__foto:hover { background: rgba(255,255,255,.22); }
.brand__foto:active { transform: scale(.96); }
.brand__nome { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.brand__nome:hover { color: #fff; text-decoration: none; opacity: .9; }
.brand__nome--solo { display: inline-flex; align-items: center; gap: .5rem; max-width: none; }
.nav { display: flex; align-items: center; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.nav--adm { flex-wrap: nowrap; flex-shrink: 0; }
.nav__link, .nav__logout {
  display: inline-flex; align-items: center; gap: .4rem;
  color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: 8px;
  transition: background var(--ease), color var(--ease), transform var(--ease);
}
.nav__link:hover, .nav__logout:hover { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }
.nav__link.is-active { color: #fff; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.nav__user { opacity: .7; font-size: .85rem; padding: 0 .4rem; margin-left: .35rem; border-left: 1px solid rgba(255,255,255,.2); padding-left: .75rem; }
.nav-toggle {
  display: none; margin-left: auto; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: 8px; padding: .4rem .55rem; cursor: pointer;
  transition: background var(--ease);
}
.nav-toggle:hover { background: rgba(255,255,255,.16); }
.nav-toggle .icon { display: block; width: 1.15rem; height: 1.15rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.flashes { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .75rem 1rem; border-radius: 10px; font-size: .95rem; animation: flash-in var(--ease-out); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.flash--success { background: var(--ok-bg); color: var(--ok); } .flash--danger { background: var(--danger-bg); color: var(--danger); }
.flash--warning { background: var(--warn-bg); color: var(--warn); } .flash--info { background: #e8eef8; color: var(--navy-700); }

.month-head { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.25rem; }
.month-head__bar {
  display: flex; align-items: center; justify-content: space-between; gap: .65rem;
  flex-wrap: nowrap; min-width: 0; width: 100%;
}
.month-head__bar .month-nav { flex: 1 1 auto; min-width: 0; }
.month-head__actions { display: flex; gap: .45rem; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }
.month-head__actions form { display: flex; }
.month-head__actions .btn,
.section-head__actions .btn { padding: .35rem .7rem; font-size: .9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin: 0; font-weight: 600; }
/* Telas sem barra (Regras, Categorias…): título + ações lado a lado */
.month-head:not(:has(.month-head__bar)) {
  flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem;
}
.month-head:not(:has(.month-head__bar)) > div:first-child { flex: 1; min-width: 12rem; }
.month-head:not(:has(.month-head__bar)) .eyebrow { margin: 0 0 .25rem; }
.lead { color: var(--muted); margin: .4rem 0 0; max-width: 42rem; }

.month-nav { display: inline-flex; align-items: center; gap: .5rem; }
.month-nav__btn {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); color: var(--navy-700); box-shadow: var(--shadow);
  transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.month-nav__btn:hover { background: var(--navy-700); color: #fff; text-decoration: none; transform: scale(1.05); }
.month-nav__btn.is-disabled { opacity: .3; pointer-events: none; }
.month-nav__label { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 700; letter-spacing: -.02em; min-width: 11ch; text-align: center; }
.month-picker { position: relative; }
.month-nav__trigger {
  display: inline-flex; align-items: center; gap: .35rem;
  background: transparent; border: 0; padding: .1rem .3rem; border-radius: 10px;
  cursor: pointer; color: inherit; font: inherit;
}
.month-nav__trigger:hover { background: rgba(30, 58, 95, .06); }
.month-nav__trigger .icon { width: 1.15rem; height: 1.15rem; color: var(--navy-700); }
.month-nav__caret { width: .95rem; height: .95rem; color: var(--muted); transition: transform var(--ease); }
.month-picker.is-open .month-nav__caret { transform: rotate(180deg); }
.month-picker__panel {
  position: absolute; z-index: 35; top: calc(100% + .4rem); left: 0;
  width: min(22.5rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 28rem); overflow: auto;
  padding: .9rem .9rem .5rem; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(15, 39, 68, .16);
}
.month-picker__panel[hidden] { display: none !important; }
.month-picker__year {
  display: grid; grid-template-columns: 3.1rem 1fr; gap: .35rem .55rem;
  align-items: center; margin-bottom: .7rem;
}
.month-picker__ano { font-weight: 700; color: var(--navy-700); font-size: .95rem; }
.month-picker__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.month-picker__mes {
  display: grid; place-items: center; min-height: 2rem; padding: .3rem .1rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font-size: .84rem; font-weight: 600; text-decoration: none;
}
.month-picker__mes:hover { border-color: var(--navy-600); background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.month-picker__mes.is-current { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.month-picker__mes.is-current:hover { background: var(--navy-800); color: #fff; }
.month-picker__new { margin: .15rem 0 0; padding-top: .45rem; border-top: 1px solid var(--line); }
.month-picker__new-btn {
  display: inline-flex; align-items: center; gap: .35rem; width: 100%;
  background: transparent; border: 0; color: var(--navy-700); font: inherit;
  font-weight: 600; font-size: .92rem; padding: .45rem .15rem; border-radius: 8px;
  cursor: pointer; text-align: left;
}
.month-picker__new-btn:hover { background: var(--bg-soft); }
.month-picker__new-btn .icon { width: 1rem; height: 1rem; }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow);
  transition: transform var(--ease-out), box-shadow var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(15,39,68,.1); }
.stat__label { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat__value { display: block; font-size: 1.35rem; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.stat__meta { font-size: .8rem; color: var(--muted); }
.stat--balance { background: linear-gradient(145deg, var(--navy-800), var(--navy-600)); color: #fff; border: none; }
.stat--balance .stat__label { color: rgba(255,255,255,.7); }
.stat--balance:hover { box-shadow: 0 6px 20px rgba(15,39,68,.28); }

.summary-strip--narrow { max-width: 20rem; grid-template-columns: 1fr; }
a.stat--link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.stat--link:hover { text-decoration: none; color: inherit; }
.hint-link { font-weight: 600; color: var(--navy-700); text-decoration: underline; text-underline-offset: 2px; }
.hint-link:hover { color: var(--navy-900); }
.summary-strip--compact { gap: .5rem; margin-bottom: .85rem; }
.summary-strip--compact .stat { padding: .55rem .75rem; border-radius: 10px; }
.summary-strip--compact .stat:hover { transform: none; }
.summary-strip--compact .stat__label { font-size: .68rem; letter-spacing: .03em; }
.summary-strip--compact .stat__value { font-size: 1.05rem; margin-top: .1rem; line-height: 1.25; }
.summary-strip--compact .stat__meta { font-size: .72rem; }
.summary-strip--compact .stat--balance:hover { box-shadow: var(--shadow); }

.income-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; align-items: start;
}
.income-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.income-col:not(:has(.panel)) { display: none; }
.income-grid:has(> .income-col:last-child:not(:has(.panel))) { grid-template-columns: 1fr; }
.income-grid .panel { margin-bottom: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; overflow: hidden;
  transition: box-shadow var(--ease);
}
.panel:hover { box-shadow: 0 2px 12px rgba(15,39,68,.09); }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.panel__head--fold { cursor: pointer; list-style: none; transition: background var(--ease); }
.panel__head--fold:hover { background: #eef3f9; }
.panel__head--fold::-webkit-details-marker { display: none; }
.panel--fold:not([open]) > .panel__head--fold { border-bottom: none; }
.panel__head--fold h2 { margin: 0; font-size: 1.05rem; }
.panel__head-actions { display: inline-flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.panel > .form { padding: 1rem; } .panel.notes h2 { padding: .85rem 1rem 0; } .panel.notes form { padding: .75rem 1rem 1rem; display: grid; gap: .75rem; }

.pill { background: var(--navy-700); color: #fff; font-size: .85rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { display: inline-block; font-size: .68rem; background: #e8eef8; color: var(--navy-700); padding: .1rem .4rem; border-radius: 4px; margin-left: .35rem; vertical-align: middle; font-weight: 600; text-transform: uppercase; }
.tag--muted { background: #eef1f4; color: var(--muted); }
.badge { display: inline-block; font-size: .65rem; padding: .15rem .4rem; border-radius: 4px; margin-right: .35rem; vertical-align: middle; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.badge[hidden] { display: none !important; }
.badge--reserve { background: var(--reserve-bg); color: var(--reserve); }
tr.row-reserva { background: var(--reserve-bg); }
.reserva-flag {
  display: inline-flex; align-items: center; gap: .2rem; margin-left: .45rem;
  font-size: .72rem; font-weight: 600; color: var(--reserve); white-space: nowrap; cursor: pointer;
}
.reserva-flag input { margin: 0; }
.table-wrap { overflow: auto; max-height: min(72vh, calc(100vh - 8.5rem)); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.table th, .table td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
  background: var(--bg-soft); position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line);
}
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:nth-child(even) { background: #fafbfd; }
.table tbody tr:hover { background: #f0f5fb; }
.table--dense td, .table--dense th { padding: .4rem .55rem; font-size: .88rem; }
.table--compact { table-layout: fixed; }
.table--compact th, .table--compact td { padding: .28rem .5rem; font-size: .88rem; }
.table--compact th:nth-child(1), .table--compact td:nth-child(1) { width: auto; }
.table--compact th:nth-child(2), .table--compact td:nth-child(2) { width: 7.5rem; }
.table--compact th:nth-child(3), .table--compact td:nth-child(3) { width: 9.5rem; }
.table--compact th:nth-child(4), .table--compact td:nth-child(4) { width: 8rem; }
.table--compact th:nth-child(5), .table--compact td:nth-child(5) { width: 5.5rem; }
.table--compact .input, .table--compact select {
  padding: .22rem .45rem; border-radius: 6px; font-size: .88rem; min-height: 1.9rem; height: 1.9rem;
  box-sizing: border-box; max-width: 100%;
}
.table--compact .input--num { width: 100%; max-width: 6.5rem; margin-left: auto; display: block; }
.table--compact .input--date { width: 100%; }
.table--compact .status-select { min-width: 0; width: 100%; }
.table--compact .icon-btn { padding: .2rem; }
.table--compact .icon-btn .icon { width: .9rem; height: .9rem; }
.table--compact .row-comment { margin-top: .1rem; font-size: .72rem; }
.table--compact .subtotal-row td.num { text-align: right; }
.table--income th, .table--income td { padding: .4rem .55rem; }
.table--income .input, .table--income select {
  padding: .32rem .5rem; border-radius: 7px; min-height: 2.1rem; height: 2.1rem;
}
.table--income .icon-btn { padding: .28rem; }
.table--income .row-comment { margin-top: .15rem; }
.total-row td { background: var(--navy-700) !important; color: #fff; font-weight: 700; }
.subtotal-row td { font-weight: 600; background: var(--bg-soft) !important; }
.muted { color: var(--muted); } .warn { color: var(--warn); font-size: .9rem; }

.row-status--pendente { box-shadow: inset 3px 0 0 var(--warn); }
.row-status--pago { box-shadow: inset 3px 0 0 var(--ok); }
.status-select {
  font-weight: 600; min-width: 7.5rem; transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.status--pendente {
  background: var(--warn-bg) !important; border-color: #efc98a !important; color: var(--warn);
}
.status--pago {
  background: var(--ok-bg) !important; border-color: #9ed4b8 !important; color: var(--ok);
}
.status-toque { display: none; }

.input, select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; background: #fff; width: 100%;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30,58,95,.25); border-color: var(--navy-600); }
.input--num { width: 7.5rem; text-align: right; font-variant-numeric: tabular-nums; } .input--date { width: 9.5rem; }
.editable.is-saving { opacity: .5; } .editable.is-saved { box-shadow: 0 0 0 2px rgba(27,122,78,.35); } .editable.is-error { box-shadow: 0 0 0 2px rgba(161,28,46,.5); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: 9px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--navy-700); color: #fff; } .btn--primary:hover { background: var(--navy-900); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--navy-700); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--bg-soft); border-color: var(--navy-600); text-decoration: none; }
.btn--block { width: 100%; } .btn--sm { padding: .3rem .6rem; font-size: .85rem; }
.btn .icon { width: .95rem; height: .95rem; }

.icon-btn {
  background: transparent; border: none; cursor: pointer; padding: .35rem; border-radius: 7px;
  color: var(--muted); opacity: .7; display: inline-grid; place-items: center;
  transition: opacity var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}
.icon-btn .icon { width: 1rem; height: 1rem; display: block; }
.icon-btn[data-has="1"], .icon-btn:hover { opacity: 1; background: var(--bg-soft); color: var(--navy-700); }
.icon-btn--danger:hover { background: var(--danger-bg); color: var(--danger); }
.actions { width: auto; white-space: nowrap; }
.actions .icon-btn { margin-left: .1rem; }
.table--lancamentos td.actions form.inline { display: inline-flex; margin: 0; }

.row-comment {
  display: block; margin-top: .2rem; font-size: .78rem; color: var(--muted); line-height: 1.3; max-width: 36rem;
}
.row-comment__text { font-style: italic; color: #4a5a6a; }
.row-comment__meta { color: var(--muted); }
.row-desc { font-weight: 500; }
.add-row td { padding: .55rem .65rem; background: var(--bg-soft); border-bottom: none; }
.add-row .btn { margin: 0; }

.panel__title { margin: 0; padding: .85rem 1rem 0; font-size: 1rem; }
.panel__title--inline { padding: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; padding: .85rem 1rem 1rem; }
.inline-form .field { min-width: 10rem; flex: 1; }
.inline-form--row { padding: .35rem 0; flex: 1; }
.inline-form--compact { gap: .4rem; padding: .55rem .85rem .7rem; align-items: end; }
.inline-form--compact.inline-form--row { padding: .2rem 0; }
.inline-form--compact .field { min-width: 7rem; gap: .2rem; }
.inline-form--compact .field span { font-size: .72rem; }
.inline-form--compact .input, .inline-form--compact select {
  padding: .28rem .45rem; border-radius: 6px; min-height: 2rem; height: 2rem; font-size: .88rem; box-sizing: border-box;
}
.inline-form--compact .field--sm { flex: 0 0 7.5rem; min-width: 7rem; }
.inline-form--compact .field--xs { flex: 0 0 4.5rem; min-width: 4rem; }
.inline-form__actions { display: flex; gap: .35rem; align-items: center; padding-bottom: .15rem; }
.inline-form--compact .inline-form__actions { padding-bottom: 0; align-self: end; flex-shrink: 0; }
.cat-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.cat-row--compact { gap: .35rem; align-items: end; }
.table--rules th, .table--rules td { padding: .28rem .55rem; }
/* Cada linha já traz o rótulo do campo. O cabeçalho da tabela não acompanha essa largura. */
.table--rules thead { display: none; }
.table--cats { table-layout: fixed; width: 100%; }
.table--cats th, .table--cats td { padding: .28rem .5rem; vertical-align: middle; }
.table--cats thead th { padding: .4rem .5rem; }
.table--cats th:nth-child(1), .table--cats td:nth-child(1) { width: auto; }
.table--cats th:nth-child(2), .table--cats td:nth-child(2) { width: 10rem; }
.table--cats th:nth-child(3), .table--cats td:nth-child(3) { width: 5.5rem; }
.table--cats th:nth-child(4), .table--cats td:nth-child(4) { width: 7rem; }
.table--cats th:nth-child(5), .table--cats td:nth-child(5) { width: 10rem; }
.table--cats .input {
  padding: .28rem .45rem; border-radius: 6px; min-height: 2rem; height: 2rem;
  font-size: .88rem; box-sizing: border-box; width: 100%;
}
.table--cats .input--num { width: 100%; max-width: 4.5rem; margin-left: auto; display: block; }
.table--cats .actions {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; white-space: nowrap;
}
.table--cats .actions .inline { display: inline; margin: 0; }
.table--cats .actions .btn { flex-shrink: 0; }
.table--grupos th:nth-child(4), .table--grupos td:nth-child(4) { width: 5.5rem; }
.table--grupos th:nth-child(5), .table--grupos td:nth-child(5) { width: 6.5rem; }
.table--grupos th:nth-child(6), .table--grupos td:nth-child(6) { width: 10.5rem; }
.grupo-nome { display: flex; align-items: center; gap: .35rem; }
.grupo-nome .input { flex: 1; min-width: 0; }
.table--pessoas th:nth-child(2), .table--pessoas td:nth-child(2) { width: 8rem; }
.table--pessoas th:nth-child(3), .table--pessoas td:nth-child(3) { width: 12rem; }
.table--pessoas th:nth-child(4), .table--pessoas td:nth-child(4) { width: 5rem; }
.table--pessoas th:nth-child(5), .table--pessoas td:nth-child(5) { width: 7rem; }
.table--pessoas th:nth-child(6), .table--pessoas td:nth-child(6) { width: 10.5rem; }
.table--pessoas select.input { width: 100%; max-width: none; }
.cat-list-row[hidden] { display: none; }
.pill--sm { font-size: .75rem; padding: .15rem .5rem; }
.section-head--rules {
  padding: .65rem .85rem .45rem; margin: 0; border-bottom: 1px solid var(--line);
  align-items: center;
}
.rules-search { display: inline-flex; align-items: center; gap: .5rem; flex: 1; justify-content: flex-end; min-width: 12rem; flex-wrap: wrap; }
.input--search { max-width: 22rem; width: 100%; padding: .35rem .65rem; min-height: 2rem; height: 2rem; }
.rules-search__count { font-size: .8rem; white-space: nowrap; }
.rules-empty { padding: .75rem 1rem 1rem; margin: 0; }
.rule-row[hidden] { display: none; }
.rule-edit-form.is-dirty .rule-field { border-color: #c9a227; }
.rule-edit-form.is-saved .rule-field { box-shadow: 0 0 0 2px rgba(27,122,78,.3); }
.rule-edit-form.is-error .rule-field { box-shadow: 0 0 0 2px rgba(161,28,46,.4); }
.inline-delete { padding-bottom: .15rem; }
.pill--warn { background: #fff3e0; color: #9a5b00; }

.form { display: grid; gap: .9rem; } .field { display: grid; gap: .35rem; font-size: .9rem; }
.field span { font-weight: 600; color: var(--muted); font-size: .8rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .92rem; } .hint { color: var(--muted); font-size: .8rem; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 45%, #2d6a6a 100%); margin: -1.25rem -1rem -3rem; }
.login__card { width: min(400px, 100%); background: #fff; border-radius: 16px; padding: 1.75rem 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login__eyebrow { margin: 0; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.login__title { margin: .35rem 0 .25rem; } .login__sub { margin: 0 0 1.25rem; color: var(--muted); }

.cat-bars { display: flex; flex-direction: column; gap: .12rem; padding: .5rem .85rem .35rem; }
.cat-bar {
  display: grid; grid-template-columns: minmax(100px, 140px) 1fr; gap: .5rem;
  align-items: center; padding: .12rem .35rem; border: 1px solid transparent; border-radius: 6px;
  color: inherit; transition: background var(--ease), border-color var(--ease);
}
.cat-bar:hover { background: #e8eef8; border-color: #b7c9e0; text-decoration: none; }
.cat-bar.is-active { background: #e8eef8; border-color: var(--navy-700); }
.cat-bar--reserva .cat-bar__fill { background: var(--reserve); }
.cat-bar--reserva.is-active { background: var(--reserve-bg); border-color: var(--reserve); }
.cat-bar--reserva.is-active .cat-bar__fill { background: #0a5555; }
.cat-bar__name {
  font-size: .75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.cat-bar__track {
  display: block; height: 1.25rem; background: #e8edf3; border-radius: 5px; overflow: hidden;
}
.cat-bar__fill {
  display: flex; align-items: center; gap: .3rem; height: 100%; min-width: 6.25rem;
  padding: 0 .45rem; box-sizing: border-box;
  background: var(--navy-700); color: #fff; border-radius: 5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cat-bar.is-active .cat-bar__fill { background: var(--navy-900); }
.cat-bar__fill strong { font-size: .72rem; font-weight: 700; }
.cat-bar__fill small { font-size: .65rem; opacity: .85; }
.cat-bars__warn { padding: .35rem 1rem .75rem; margin: 0; font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem 1rem 1rem; }
.chip { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; font-size: .88rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters .input--search { max-width: 14rem; min-width: 10rem; flex: 1; }
.filters select { width: auto; min-width: 140px; }
.filters__date { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); }
.th-sort { color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort.is-active { color: var(--navy-700); text-decoration: underline; }
.row-proj { opacity: .85; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .5rem 0 .75rem; }
.section-head h2 { margin: 0; }
.section-head__actions { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
#toggleGroups.is-collapsed .icon { transform: rotate(180deg); }

.is-known { background: var(--ok-bg) !important; } .is-unknown { background: #fff8f0 !important; } .is-dup { opacity: .55; }
tr:has(.pular-linha:checked) { opacity: .72; background: #f3f4f6 !important; }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; } .dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .75rem; padding: .85rem 0; background: linear-gradient(transparent, var(--bg) 30%); }
form:has(.sticky-actions) .table-wrap:last-of-type { margin-bottom: 4.5rem; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; animation: modal-fade .18s ease; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15,39,68,.45); }
.modal__panel {
  position: relative; width: min(480px, 100%); max-height: 85vh; overflow: auto; background: #fff;
  border-radius: 16px 16px 0 0; z-index: 1; box-shadow: 0 -8px 40px rgba(0,0,0,.2);
  animation: modal-up var(--ease-out);
}
@keyframes modal-up { from { transform: translateY(12px); opacity: .85; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.modal__head h3 { display: inline-flex; align-items: center; gap: .4rem; }
.modal__body { padding: .85rem 1rem 1.25rem; display: grid; gap: .55rem; min-height: 2rem; border-top: 1px solid var(--line); }
.modal__form { padding: .85rem 1rem 1rem; display: grid; gap: .65rem; }
.modal__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.modal__actions .btn { flex: 1 1 8rem; }
.comment-item { background: var(--bg-soft); border-radius: 8px; padding: .55rem .7rem; }
.comment-item__meta { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.comment-item__meta-actions { display: inline-flex; gap: .15rem; }
.comment-item__body { font-size: .85rem; color: var(--ink); }
.comment-item.is-editing { outline: 2px solid rgba(30, 64, 120, .35); }
/* Barras com data-largura: width 0 até o JS aplicar o % (evita flash 100% → correto). */
[data-largura] { width: 0; max-width: 100%; }
[data-largura]:not(.is-ready) { visibility: hidden; }

@media (min-width: 720px) { .modal { place-items: center; } .modal__panel { border-radius: 16px; } }
@media (max-width: 860px) {
  .summary-strip { grid-template-columns: 1fr; }
  .income-grid { display: flex; flex-direction: column; align-items: stretch; }
  .income-col { display: contents; }
  .income-slot { order: var(--ord); align-self: stretch; width: 100%; }
}
@media (max-width: 720px) {
  .nav-toggle, #mainNav { display: none; }
  body:not(.plat-home) .nav__link,
  body:not(.plat-home) .nav__logout { width: 100%; }
  body:not(.plat-home) .nav__user { border-left: none; padding-left: .7rem; margin: .35rem 0; }

  body.plat-home .topbar__inner { padding: .5rem .75rem; }
  body.plat-home .brand__nome--solo { font-size: .95rem; max-width: 11rem; }
  body.plat-home .nav--adm { gap: .15rem; }
  body.plat-home .nav__user { font-size: .78rem; max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding: 0 .25rem; }
  body.plat-home .nav__link,
  body.plat-home .nav__logout {
    width: auto; min-width: 2.25rem; min-height: 2.25rem; padding: .4rem;
    font-size: 0; gap: 0; justify-content: center;
  }
  body.plat-home .nav__link .icon,
  body.plat-home .nav__logout .icon { width: 1.15rem; height: 1.15rem; }

  .plat-card { padding: .65rem .7rem; gap: .45rem; }
  .plat-acoes { flex-wrap: nowrap; }
  .plat-acoes .btn { flex: 1; justify-content: center; min-width: 0; padding: .35rem .45rem; font-size: .8rem; }

  .container { padding: 1rem .75rem 2.5rem; }
  .hint { line-height: 1.4; overflow-wrap: anywhere; }
  .month-head { margin-bottom: 1rem; gap: .25rem; }
  .month-head__bar { gap: .4rem; }
  .month-head__bar .month-nav { gap: .35rem; }
  .month-head__bar .month-nav__label {
    font-size: clamp(1.05rem, 4.2vw, 1.45rem); min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .month-head__actions,
  .section-head__actions { width: auto; margin-left: auto; gap: .35rem; flex-wrap: nowrap; }
  .month-head__actions form { flex: 0 0 auto; }
  .month-head__actions .btn,
  .section-head__actions .btn {
    flex: 0 0 auto; min-width: 2.25rem; min-height: 2.25rem; padding: .4rem;
  }
  .month-head__actions .btn:has(.icon),
  .section-head__actions .btn:has(.icon) { font-size: 0; gap: 0; }
  .month-head__actions .btn:has(.icon) .icon,
  .section-head__actions .btn:has(.icon) .icon { width: 1.15rem; height: 1.15rem; }

  .section-head { gap: .5rem; margin: .25rem 0 .65rem; }

  .panel__head {
    flex-wrap: wrap; align-items: flex-start; gap: .5rem .65rem;
    padding: .7rem .75rem;
  }
  .panel__head h2, .panel__head h3 { flex: 1; min-width: 0; line-height: 1.25; }
  .panel__head-actions { gap: .4rem; margin-left: auto; }
  .pill { font-size: .78rem; padding: .2rem .55rem; }
  .panel__head .icon-btn,
  .panel__head-actions .icon-btn {
    width: 2.25rem; height: 2.25rem; padding: 0; flex-shrink: 0;
  }

  .panel__head .filters { flex: 1 1 100%; }
  .filters {
    flex-direction: column; align-items: stretch; width: 100%; gap: .45rem;
  }
  .filters .input--search,
  .filters select,
  .filters .input--date {
    width: 100%; max-width: none; min-width: 0;
  }
  .filters__date {
    display: grid; grid-template-columns: 2.2rem 1fr; width: 100%; gap: .4rem; align-items: center;
  }
  .filters__date .input--date { width: 100%; }
  .filters .btn { width: 100%; }

  .table-wrap { max-height: none; }
  .input--num { width: 6.5rem; }
  .icon-btn { min-width: 2.25rem; min-height: 2.25rem; padding: .45rem; }
  .actions { display: inline-flex; align-items: center; gap: .1rem; }

  .table thead { display: none; }
  .table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: .3rem .55rem;
    padding: .7rem .65rem; border-bottom: 1px solid var(--line); align-items: start;
  }
  .table td { border: none; padding: 0; }
  .table td[data-label]::before {
    content: attr(data-label); display: block; font-size: .65rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em; margin-bottom: .12rem; font-weight: 600;
  }
  .table tbody td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .table tfoot tr { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem .65rem; }
  .table tfoot td { border: none; padding: 0; }
  .table tfoot td:empty { display: none; }
  .row-status--pendente { box-shadow: inset 0 3px 0 var(--warn); }
  .row-status--pago { box-shadow: inset 0 3px 0 var(--ok); }

  /* —— Despesas (table--compact): nome e valor na primeira linha —— */
  .table--compact tbody tr {
    display: flex; flex-wrap: wrap; align-items: center;
    width: 100%;
    gap: .2rem .4rem;
    padding: .5rem .65rem .55rem;
  }
  .table--compact tbody td { display: block; }
  .table--compact tbody td:first-child {
    flex: 1 1 8rem; max-width: calc(100% - 6rem);
    align-self: center; min-width: 0; padding-bottom: 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem;
  }
  .table--compact tbody td:nth-child(2),
  .table--compact tbody td:nth-child(4),
  .table--compact tbody td.actions { flex: 0 0 auto; width: max-content; max-width: max-content; }
  .table--compact tbody td:nth-child(3) { flex: 0 1 auto; min-width: 0; max-width: 7.4rem; }
  .table--compact td[data-label]::before { content: none; }
  .table--compact .row-desc {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%;
  }
  .table--compact .row-comment { flex-basis: 100%; }
  .table--compact .input--num {
    width: 5.4rem; max-width: 5.4rem; margin-left: auto;
    height: 2rem; min-height: 2rem; text-align: right;
  }
  .table--compact .input--date {
    width: 7.4rem; max-width: 100%; height: 1.85rem; min-height: 1.85rem;
    font-size: .82rem; color: var(--ink); background: #fff;
    border-color: var(--line); border-radius: 999px; padding: 0 .45rem;
  }
  .table--compact .status-select { display: none; }
  .table--compact .status-toque {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 1.8rem; padding: .15rem .55rem; border-radius: 999px;
    font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
  }
  .table--compact .icon-btn { min-width: 1.75rem; min-height: 1.75rem; padding: .2rem; }
  .table--compact .row-status--pendente { box-shadow: inset 3px 0 0 var(--warn); }
  .table--compact .row-status--pago { box-shadow: inset 3px 0 0 var(--ok); }
  .table--compact tfoot { display: none; }
  .table--compact .empty-hint td { flex: 1 1 100%; }

  /* —— Rendimentos (table--income) —— */
  .table--income tbody tr {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .35rem .4rem;
    align-items: center;
    padding: .55rem .7rem;
  }
  .table--income tbody td:first-child {
    grid-column: 1; font-weight: 500; min-width: 0;
  }
  .table--income tbody td:first-child .row-desc {
    display: block; overflow: hidden; text-overflow: ellipsis;
  }
  .table--income tbody td.num {
    grid-column: 2; padding: 0;
  }
  .table--income tbody td.num::before { content: none; }
  .table--income tbody td.actions {
    grid-column: 3; justify-self: end;
  }
  .table--income .input--num {
    width: 5.85rem; max-width: 5.85rem; height: 2.15rem; min-height: 2.15rem;
  }
  .table--income .row-comment { margin-top: .2rem; }
  .table--income tfoot tr { padding: .45rem .7rem; }
  .table--income .total-row td {
    background: transparent !important; color: var(--navy-800);
    font-size: .92rem;
  }
  .table--income .total-row {
    background: var(--bg-soft);
    border-radius: 0;
    box-shadow: inset 0 1px 0 var(--line);
  }

  /* —— Categorias / Pessoas (table--cats) —— */
  .inline-form--compact {
    flex-direction: column; align-items: stretch; gap: .55rem;
    padding: .75rem .85rem .9rem;
  }
  .inline-form--compact .field,
  .inline-form--compact .field--sm { flex: 1 1 auto; min-width: 0; width: 100%; }
  .inline-form--compact > .btn {
    align-self: flex-end; min-width: 5.5rem;
  }
  .section-head--rules {
    flex-wrap: wrap; gap: .45rem .65rem; padding: .7rem .85rem .55rem;
  }
  .section-head--rules .rules-search {
    flex: 1 1 100%; justify-content: stretch; min-width: 0;
  }
  .section-head--rules .input--search { max-width: none; }
  .table--rules tbody tr {
    display: block; padding: 0; border-bottom: 1px solid var(--line);
  }
  .table--rules tbody td { display: block; font-weight: 400; padding: 0; }
  .table--rules .inline-form--compact { padding: .7rem .75rem .8rem; }
  .table--rules .inline-form__actions { justify-content: flex-end; width: 100%; }
  .table--rules .field--xs .pill { justify-self: start; }
  .table--cats tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem .55rem;
    padding: .85rem .75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: .55rem .65rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
  }
  .table--cats tbody tr:first-child { margin-top: .65rem; }
  .table--cats tbody tr:last-child { margin-bottom: .75rem; }
  .table--cats tbody td {
    display: block; min-width: 0; width: auto;
  }
  .table--cats tbody td:first-child {
    grid-column: 1 / -1; font-weight: 600;
  }
  .table--cats tbody td.actions {
    grid-column: 1 / -1;
    display: flex; justify-content: flex-end; gap: .4rem;
    padding-top: .15rem; border-top: 1px dashed var(--line); margin-top: .1rem;
  }
  .table--cats tbody td.actions::before { display: none; }
  .table--cats .input,
  .table--cats select.input {
    width: 100%; max-width: none; margin-left: 0;
    min-height: 2.25rem; height: 2.25rem;
  }
  .table--cats .input--num {
    width: 100%; max-width: none; margin-left: 0; display: block; text-align: left;
  }
  .table--cats .pill--sm { display: inline-flex; }
  .table--cats tbody tr:has(td[colspan]) {
    display: block; background: transparent; border: none; margin: .5rem .75rem; padding: .5rem 0;
  }
  .table--cats tbody tr:has(td[colspan]) td { grid-column: auto; }

  /* —— Lançamentos —— */
  .table--lancamentos tbody tr {
    grid-template-columns: 1fr auto;
    gap: .28rem .5rem;
    padding: .75rem .7rem;
  }
  .table--lancamentos tbody td:first-child { grid-column: auto; font-weight: 500; }
  .table--lancamentos tbody td:nth-child(1) { grid-column: 1; grid-row: 2; } /* Data */
  .table--lancamentos tbody td:nth-child(2) { grid-column: 2; grid-row: 2; justify-self: end; text-align: right; } /* Cartão */
  .table--lancamentos tbody td:nth-child(3) { /* Descrição */
    grid-column: 1; grid-row: 1; font-weight: 600; min-width: 0; padding-right: .35rem;
  }
  .table--lancamentos tbody td:nth-child(3)::before { content: none; }
  .table--lancamentos tbody td:nth-child(4) { /* Categoria */
    grid-column: 1 / -1; grid-row: 3; min-width: 0;
  }
  .table--lancamentos tbody td:nth-child(5) { /* Valor */
    grid-column: 2; grid-row: 1; justify-self: end; align-self: start;
    font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums;
    white-space: nowrap; text-align: right;
  }
  .table--lancamentos tbody td:nth-child(5)::before { content: none; }
  .table--lancamentos tbody td:nth-child(6) { /* Parc. */
    grid-column: 1; grid-row: 4; align-self: center;
  }
  .table--lancamentos tbody td.actions {
    grid-column: 2; grid-row: 4; justify-self: end; align-self: center;
  }
  .table--lancamentos tbody td:nth-child(1)::before,
  .table--lancamentos tbody td:nth-child(2)::before,
  .table--lancamentos tbody td:nth-child(6)::before {
    display: inline; margin-right: .3rem; margin-bottom: 0;
  }
  .table--lancamentos .editable-categoria {
    width: 100%; min-height: 2.15rem; height: 2.15rem;
  }
  .table--lancamentos .reserva-flag { margin-left: 0; }
  .table--lancamentos .row-comment { max-width: none; }
  .table--lancamentos tbody tr:has(td[colspan]) td {
    grid-column: 1 / -1; grid-row: auto;
  }

  .cat-bar {
    grid-template-columns: 1fr; gap: .25rem;
  }
  .cat-bar__fill { min-width: 6.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.analise-filtros { margin-bottom: .35rem; }
#deWrap[hidden] { display: none !important; }
.analise-hint { margin: 0 0 1rem; }
.analise-gap { margin: 0; padding: 0 1rem .85rem; }
.is-gap { color: var(--muted); font-style: italic; font-weight: 500; font-size: .78rem; }
.narrativa__list { margin: 0; padding: .85rem 1rem 1rem 1.6rem; display: grid; gap: .35rem; }
.narrativa__list li { padding-left: .15rem; }
.alerta-grupos { border-color: #e8c98a; background: #fffbf3; }
.alerta-grupos__list { margin: 0; padding: .85rem 1rem 1rem 1.6rem; display: grid; gap: .4rem; list-style: disc; }
.alerta-grupos__list a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.alerta-grupos__list .alerta--alto { color: #9a3412; }
.alerta-grupos__list .alerta--baixo { color: #1d4ed8; }
.summary-strip--4 { grid-template-columns: repeat(4, 1fr); }
.kpi-delta { font-weight: 600; min-height: 1.1em; }
.stat--balance .stat__meta { color: rgba(255,255,255,.82); }
.stat--balance .kpi-delta { color: #fff; }
.delta--good { color: var(--ok); font-weight: 600; }
.delta--bad { color: var(--danger); font-weight: 600; }
.delta--reserve { color: var(--reserve); font-weight: 600; }
.chart-box { position: relative; height: 300px; padding: .35rem .75rem 1rem; }
.chart-box--sm { height: 240px; }
.chart-box--lg { height: 420px; }
.chart-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; align-items: start; }
.chart-grid .panel { margin-bottom: 1rem; }
.cmp-list { padding: .35rem 0 .85rem; }
.cmp { padding: .4rem 1rem; }
a.cmp--link { display: block; color: inherit; text-decoration: none; }
a.cmp--link:hover { background: #f0f5fb; text-decoration: none; }
a.cmp--link.is-open { background: #e8eef8; }
.cmp__top { display: flex; justify-content: space-between; gap: .75rem; font-size: .88rem; }
.cmp__top span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp__track { height: 6px; background: var(--bg); border-radius: 99px; margin-top: .28rem; overflow: hidden; }
.cmp__bar { height: 100%; border-radius: 99px; background: var(--navy-600); }
.cmp__bar.delta--bad { background: var(--danger); }
.cmp__bar.delta--good { background: var(--ok); }
.cmp__bar.delta--reserve { background: var(--reserve); }
.table--matrix .is-foco { background: #e8eef8; }
.table--matrix .is-base { background: #e7f3ee; }
.table--matrix .sum-row td { font-weight: 600; background: var(--bg-soft); }
.table--matrix .sum-row--saldo td { font-weight: 700; background: var(--navy-800); color: #fff; }
.table--matrix .sum-row--saldo .delta--good,
.table--matrix .sum-row--saldo .delta--bad,
.table--matrix .sum-row--saldo .delta--reserve { color: #fff; }
.table--matrix th:first-child,
.table--matrix td:first-child {
  position: sticky; left: 0; z-index: 1; background: #fff; min-width: 11rem;
  box-shadow: 1px 0 0 var(--line);
}
.table--matrix thead th:first-child { z-index: 3; background: var(--bg-soft); }
.table--matrix .sum-row td:first-child { background: var(--bg-soft); }
.table--matrix .sum-row--saldo td:first-child { background: var(--navy-800); color: #fff; }
.table--matrix tr.is-reserve td:first-child { background: var(--reserve-bg); }

@media (max-width: 980px) {
  .summary-strip--4, .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .table.table--matrix thead { display: table-header-group; }
  .table.table--matrix tbody tr,
  .table.table--matrix tfoot tr { display: table-row; padding: 0; border-bottom: none; }
  .table.table--matrix th,
  .table.table--matrix td { display: table-cell; border-bottom: 1px solid var(--line); padding: .4rem .5rem; }
  .table.table--matrix tbody td:first-child { grid-column: auto; font-weight: 600; }
  .table.table--matrix td[data-label]::before { content: none; }
}

/* Importação: prévia do que a reconciliação vai remover */
.reconcilia__alerta { margin: .75rem 1rem 0; }
.reconcilia { margin: .75rem 1rem; border: 1px solid #e8c98a; border-radius: 10px; background: #fffbf3; }
.reconcilia__resumo { cursor: pointer; padding: .65rem .9rem; font-weight: 600; color: #9a3412; }
.reconcilia .table-wrap { max-height: 320px; overflow: auto; }
.reconcilia__check { padding: .65rem .9rem; border-top: 1px solid #e8c98a; }

.brand__logo { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; background: #fff; display: block; }
.brand__foto .icon--brand { width: 1.05rem; height: 1.05rem; color: #fff; }
.nav__user--solo { margin-left: 0; border-left: none; padding-left: .4rem; }
.vista-barra {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff4e0; color: #6b4a12; padding: .55rem 1rem;
}
.vista-barra .btn { background: #fff; }
.plat { display: grid; gap: 1rem; }
.plat-novo { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; }
.plat-novo > summary { cursor: pointer; width: fit-content; list-style: none; }
.plat-novo > summary::-webkit-details-marker { display: none; }
.plat-form { margin-top: .8rem; display: grid; gap: .6rem; max-width: 28rem; }
.plat-grade { display: grid; gap: .65rem; margin-top: .8rem; align-items: start; }
@media (min-width: 900px) { .plat-grade { grid-template-columns: 1fr 1fr; } }
.plat-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem .85rem; display: grid; gap: .55rem; }
.plat-card__head { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.plat-card__info { flex: 1; min-width: 0; }
.plat-card__info h2 { font-size: 1rem; line-height: 1.25; }
.plat-card__info p { margin: .1rem 0 0; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plat-logo {
  width: 2.75rem; height: 2.75rem; object-fit: cover; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; flex-shrink: 0;
}
.plat-logo--empty {
  display: inline-grid; place-items: center; color: var(--muted); background: var(--bg-soft);
}
.plat-logo--empty .icon { width: 1.15rem; height: 1.15rem; }
.plat-acoes { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.plat-acoes form { display: flex; }
.plat-volta { margin: 0; }
.plat-volta a { font-weight: 700; }
.plat-ficha { max-width: 36rem; }
.plat-ficha h1 { margin: 0; font-size: 1.35rem; }
.plat-ficha h2 { margin: .2rem 0 0; font-size: 1.05rem; }
.plat-acessos > summary { cursor: pointer; width: fit-content; list-style: none; }
.plat-acessos > summary::-webkit-details-marker { display: none; }
.plat-acessos__corpo { display: grid; gap: .6rem; margin-top: .7rem; }
.plat-acessos:not([open]) > .plat-acessos__corpo { display: none; }
.plat-pessoa { display: grid; gap: .4rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.plat-pessoa-topo { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.plat-pessoa-topo div span { display: block; color: var(--muted); font-size: .9rem; }
.logo-preview {
  width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; display: block; margin-bottom: .35rem;
}
.tutorial__foto { padding: .85rem 1rem; margin: 0 0 1rem; max-width: 28rem; display: grid; gap: .45rem; }
body.plat-home .topbar__inner { flex-wrap: nowrap; gap: .5rem; }
body.plat-home .brand { min-width: 0; flex: 1; }
.badge { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .15rem .55rem; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--off { background: var(--danger-bg); color: var(--danger); }
.empty__links { display: flex; gap: .5rem; flex-wrap: wrap; }
.tutorial { margin: 0 0 1rem; padding-left: 1.2rem; }
.tutorial__form { max-width: 28rem; }

/* Barra inferior do celular. No desktop fica escondida; o menu do topo continua. */
.tabbar, .tabmais { display: none; }
body.tabmais-open { overflow: hidden; }

@media (max-width: 720px) {
  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: var(--navy-900);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .2rem .15rem calc(.3rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(15,39,68,.28);
  }
  .tabbar__item {
    flex: 1;
    min-width: 0;
    min-height: 3.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .12rem;
    padding: .3rem .1rem;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.78);
    font: inherit;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item .icon { width: 1.3rem; height: 1.3rem; display: block; }
  .tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__item:hover { color: #fff; text-decoration: none; }
  .tabbar__item.is-active,
  .tabbar__item.is-open { color: #f0c453; }
  .tabbar__item:focus-visible {
    outline: 2px solid #f0c453;
    outline-offset: -4px;
    border-radius: 8px;
  }

  body:has(.tabbar) {
    padding-bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
  }
  body:has(.tabbar) .container { padding-bottom: .75rem; }
  body:has(.tabbar) .sticky-actions {
    bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
  }

  .tabmais:not([hidden]) { display: block; }
  .tabmais__backdrop {
    position: fixed; inset: 0; z-index: 46;
    border: 0; padding: 0; margin: 0; width: 100%;
    background: rgba(15, 39, 68, .45);
    cursor: pointer;
  }
  .tabmais__sheet {
    position: fixed;
    z-index: 47;
    left: .75rem; right: .75rem;
    bottom: calc(4.55rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15,39,68,.28);
    padding: .35rem;
    display: grid;
    animation: modal-up var(--ease-out);
    max-height: min(70vh, 28rem);
    overflow: auto;
  }
  .tabmais__sheet:focus { outline: none; }
  .tabmais__user {
    margin: 0;
    padding: .45rem .75rem .35rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
  }
  .tabmais__link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
  }
  .tabmais__link:hover { background: var(--bg-soft); text-decoration: none; color: var(--navy-800); }
  .tabmais__link.is-active { background: #e8eef8; color: var(--navy-800); }
  .tabmais__link .icon { width: 1.15rem; height: 1.15rem; }
  .tabmais__sair {
    margin-top: .15rem;
    color: var(--danger);
    box-shadow: inset 0 1px 0 var(--line);
    border-radius: 10px;
  }
}

/* Antes eram style="" no HTML; a CSP (27/10/2026) bloqueia estilo embutido. */
.vazio-cat { padding: .5rem 0; }
.panel--estreito { max-width: 480px; }

/* Registro do administrador (tela da plataforma) */
.lista-acoes { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.lista-acoes li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; border-bottom: 1px solid var(--line); padding: .35rem 0; }

/* Exclusão bloqueada: no lugar do botão, um selo que se lê também no celular (27/10/2026).
   E todo botão desativado do app fica visivelmente apagado. */
.em-uso { display: inline-block; font-size: .78rem; color: var(--muted); background: #eef1f4; border-radius: 999px; padding: .25rem .6rem; white-space: nowrap; cursor: help; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(1); }
