/* LRfin Dashboard - styles */

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #F6F8FB;
  --card: #ffffff;
  --ink: #241129;
  --ink-2: #311131;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e2e8f0; --lav: #dbeafe; --lav-soft: #eaf3fb;
  --line-2: #eef2f7;
  --green: #0663AA;
  --green-dark: #12447E;
  --green-deep: #311131;
  --green-soft: #dbeafe;
  --green-tint: #eaf3fb;
  --pink: #fbdfe1;
  --pink-ink: #EA404D;
  --yellow: #e8f2fb;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 2px 6px rgba(49,17,49,.08), 0 1px 2px rgba(49,17,49,.06);
}

html, body { height: 100%; }
body {
  background: linear-gradient(160deg, #F6F8FB 0%, #eaf3fb 100%) fixed;
  color: var(--ink);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

#root { min-height: 100%; }

/* ----- APP LAYOUT ----- */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 18px;
  padding: 22px;
  min-height: 100vh;
  max-width: 1480px;
  margin: 0 auto;
  align-items: start;
}
.sheet {
  background: var(--card);
  border-radius: 28px;
  padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(36,17,41,.1);
  min-width: 0;
}

/* ----- RIGHT PANEL ----- */
.right-panel {
  background: linear-gradient(165deg, #12447E 0%, #311131 100%);
  border-radius: 28px;
  padding: 20px 18px;
  color: white;
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 50px rgba(20,60,50,.28);
}
.right-panel::-webkit-scrollbar { width: 4px; }
.right-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }
.rp-user { display: flex; align-items: center; gap: 12px; }
.rp-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #0E92D2, #0663AA);
  color: #fff; font-weight: 800; font-size: 19px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.rp-name { font-size: 16px; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; }
.rp-role { font-size: 11.5px; color: rgba(255,255,255,.65); }
.rp-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px 6px;
}
.rp-stat { text-align: center; }
.rp-stat span { display: block; font-size: 10px; color: rgba(255,255,255,.6); margin-bottom: 2px; }
.rp-stat strong { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.rp-title {
  font-size: 13px; font-weight: 700; letter-spacing: -.2px;
  margin: 4px 2px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.rp-status {
  border-radius: 16px;
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: transform .15s;
  text-align: left;
}
.rp-status:hover { transform: translateY(-2px); }
.rp-status.ok { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.rp-status.bad { background: linear-gradient(135deg, #0E92D2, #0663AA); color: #fff; }
.rp-status-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 19px;
  background: rgba(255,255,255,.16);
}
.rp-status.bad .rp-status-icon { background: rgba(255,255,255,.4); }
.rp-status-label { font-size: 13.5px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.rp-status-sub { font-size: 11px; opacity: .75; margin-top: 2px; line-height: 1.4; }
.rp-bucket {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .15s, transform .15s;
  text-align: left;
  width: 100%;
}
.rp-bucket:hover { background: rgba(255,255,255,.13); transform: translateY(-1px); }
.rp-bucket-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(242,194,90,.2);
  display: grid; place-items: center; font-size: 15px;
  flex-shrink: 0;
}
.rp-bucket-info { flex: 1; min-width: 0; }
.rp-bucket-label { display: block; font-size: 12px; font-weight: 600; }
.rp-bucket-nums { display: block; font-size: 10.5px; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.rp-bucket-bar {
  display: block;
  width: 100%; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.15);
  overflow: hidden; margin-top: 5px;
}
.rp-bucket-bar div { height: 100%; border-radius: 2px; background: #0663AA; }
.rp-bucket-bar div.over { background: #e0607a; }
.rp-bucket-pct {
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.rp-bucket-pct.over { color: #f2b6bc; }

/* bucket com toggle de conclusão mensal */
.rp-title-hint { font-size: 10.5px; font-weight: 500; color: rgba(255,255,255,.5); }
.rp-bucket-wrap {
  background: rgba(255,255,255,.07); border-radius: 14px;
  padding: 4px; transition: background .15s;
  border: 1px solid transparent;
}
.rp-bucket-wrap.is-done { background: rgba(14,146,210,.16); border-color: rgba(14,146,210,.4); }
.rp-bucket { display: flex; align-items: flex-start; gap: 9px; background: none; padding: 6px; width: 100%; }
.rp-bucket:hover { background: none; transform: none; }
.rp-check {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06);
  color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center;
  transition: background .12s, border-color .12s, transform .12s;
}
.rp-check:hover { border-color: #0E92D2; transform: scale(1.08); }
.rp-check.on { background: linear-gradient(135deg, #0E92D2, #0663AA); border-color: transparent; }
.rp-pct {
  min-width: 46px; height: 24px; padding: 0 8px; border-radius: 999px; flex-shrink: 0; margin-top: 2px;
  display: grid; place-items: center; white-space: nowrap;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.2);
}
.rp-pct.on { background: linear-gradient(135deg, #0E92D2, #0663AA); border-color: transparent; color: #fff; }
.rp-bucket-info { flex: 1; min-width: 0; text-align: left; background: none; border-radius: 8px; padding: 2px 4px; cursor: pointer; }
.rp-bucket-info:hover .rp-bucket-label { text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); }
.rp-bucket-state { display: block; font-size: 10.5px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-bucket-state.done { color: #7fd0f5; }
.rp-bucket-state.pend { color: rgba(255,255,255,.5); }
.rp-bucket-editor { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 7px; }
.rp-bucket-editor label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.75); }
.rp-bucket-editor textarea {
  width: 100%; resize: vertical; border-radius: 9px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.95); color: var(--ink); font: inherit; font-size: 12px; padding: 8px 10px;
}
.rp-editor-actions { display: flex; gap: 6px; justify-content: flex-end; }
.rp-editor-btn { padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; background: #0E92D2; color: #fff; }
.rp-editor-btn.ghost { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); }

/* ----- TOP NAV ----- */
.topnav {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; margin-right: 4px; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-deep); color: white;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
  white-space: nowrap;
}
.brand-mark span { color: var(--green); }
.brand-name { font-weight: 700; letter-spacing: -.3px; font-size: 14px; display: none; }
.topnav-tabs {
  display: flex; align-items: center; gap: 2px;
  flex: 1 1 auto; min-width: 0;
  overflow: hidden;
}
.tn-tab {
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: -.1px;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
  position: relative;
  transition: color .18s, background .18s;
  display: inline-flex; align-items: center; gap: 6px;
}
.tn-tab-icon { font-size: 15px; line-height: 1; flex-shrink: 0; filter: saturate(.85); }
.tn-tab-label { display: none; white-space: nowrap; }
.tn-tab:hover { color: var(--green-dark); background: var(--green-tint); }
.tn-tab.active {
  color: #fff; font-weight: 600;
  background: var(--green-deep);
  box-shadow: 0 2px 8px rgba(49,17,49,.18);
}
.tn-tab.active .tn-tab-icon { filter: none; }
.tn-tab.active .tn-tab-label { display: inline; }
.topnav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topnav-actions { display: flex; align-items: center; gap: 8px; }

/* ----- MAIN ----- */
.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* PAGE STRIP (saudação + mês) */
.top-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 2px 4px;
}
.welcome { display: flex; align-items: center; gap: 12px; }
.welcome-title { font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave {
  0%,60%,100% { transform: rotate(0); }
  10% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.welcome-sub { font-size: 12.5px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.month-picker {
  display: flex; align-items: center; gap: 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px;
}
.mp-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.mp-btn:hover { background: var(--line-2); }
.mp-label { font-weight: 600; font-size: 12.5px; padding: 0 6px; min-width: 120px; text-align: center; }
.circle-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-2);
  position: relative;
}
.circle-btn:hover { box-shadow: var(--shadow); }
.dot-badge {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  border: 2px solid white;
}

/* ----- GRID ----- */
.grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.row {
  display: grid;
  gap: 16px;
}
.row-2 {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.col-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
}

/* ----- METRIC CARDS ----- */
.metrics-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
}
.metric-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}
.metric-card.big {
  background: linear-gradient(150deg, #311131 0%, #12447E 100%);
  color: white;
  position: relative;
  overflow: hidden;
}
.metric-card.big::after {
  content: '';
  position: absolute;
  right: -40px; bottom: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(23,122,99,.18), transparent 70%);
}
.mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mc-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.mc-sub { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 0; }
.mc-label-light {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
}
.mc-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--green-deep);
}
.bg-green { background: var(--green-tint); color: var(--green-dark); }
.bg-green-soft { background: var(--green-soft); color: var(--green-deep); }
.bg-pink { background: var(--pink); color: var(--pink-ink); }
.bg-yellow { background: var(--yellow); color: #12447E; }

/* AMOUNT */
.amount {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 700;
  letter-spacing: -.8px;
  color: var(--ink);
  font-family: 'Poppins', sans-serif;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.amount.light { color: white; }
.amount .a-sign {
  font-size: 13px;
  font-weight: 600;
  opacity: .65;
  margin-right: 4px;
}
.amount .a-int { font-size: 23px; }
.amount .a-dec { font-size: 13px; opacity: .55; font-weight: 600; }
.amount.big .a-int { font-size: 32px; letter-spacing: -1.4px; }
.amount.big .a-sign { font-size: 16px; }
.amount.big .a-dec { font-size: 16px; }

/* PILL */
.mc-foot {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.mc-foot-text { color: var(--muted); font-size: 11px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mc-foot-text.light { color: rgba(255,255,255,.55); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -.1px;
}
.pill-up { background: var(--green-tint); color: var(--green-dark); }
.pill-down { background: var(--pink); color: var(--pink-ink); }

/* ----- SPENDING OVERVIEW ----- */
.spending-overview .so-body {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.so-total-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.so-left { display: flex; flex-direction: column; gap: 6px; }

.period-select {
  background: var(--line-2);
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
}

.donut-wrap {
  position: relative;
  width: 170px; height: 170px;
  margin-top: 6px;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 16px;
}
.dc-label { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.dc-value { font-size: 12.5px; font-weight: 700; letter-spacing: -.2px; padding: 0 10px; line-height: 1.2; }

.so-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  min-width: 0;
}
.cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-swatch { flex-shrink: 0; }
.cat-name { flex: 1; min-width: 0; }
.cat-value, .cat-pct { flex-shrink: 0; }
.cat-swatch {
  width: 10px; height: 10px;
  border-radius: 3px;
}
.cat-name { font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cat-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.cat-pct { color: var(--muted); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; min-width: 28px; }
.empty-cats { padding: 16px; color: var(--muted); text-align: center; }

/* ----- AI INSIGHT ----- */
.ai-insight {
  background: linear-gradient(150deg, #311131 0%, #12447E 100%);
  color: white;
  position: relative;
  overflow: hidden;
}
.ai-head-row { margin-bottom: 8px; }
.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
}
.ai-insight-text {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: white;
  margin-bottom: 14px;
  max-width: 280px;
}
.ai-bulb {
  position: absolute;
  right: -14px;
  top: 10px;
  color: white;
  pointer-events: none;
}

.btn-green {
  background: linear-gradient(135deg, #12447E, #311131);
  color: white;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 12px;
  letter-spacing: -.1px;
  transition: filter .15s;
}
.btn-green:hover { filter: brightness(1.12); }
.btn-green:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  background: var(--line-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 10px;
}
.btn-ghost:hover { background: var(--line); }

/* ----- QUICK ACTIONS ----- */
.quick-actions h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -.2px;
}
.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.qa-btn {
  background: var(--line-2);
  border-radius: 12px;
  padding: 14px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform .15s, background .15s;
}
.qa-btn:hover { background: var(--green-tint); transform: translateY(-2px); }
.qa-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.qa-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
}

/* ----- RECOMMENDATIONS ----- */
.recommendations .rec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rec-item {
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 110px;
  transition: transform .15s;
  cursor: pointer;
}
.rec-item:hover { transform: translateY(-2px); }
.rec-icon { font-size: 22px; margin-bottom: 4px; }
.rec-title { font-weight: 700; font-size: 13.5px; letter-spacing: -.2px; }
.rec-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.rec-item.card-dark {
  background: linear-gradient(150deg, #311131, #12447E);
  color: white;
}
.rec-item.card-dark .rec-sub { color: rgba(255,255,255,.6); }
.rec-item.card-alert { background: #fee8ec; }
.rec-item.card-alert .rec-sub { color: var(--pink-ink); }

.link-btn {
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.link-btn:hover { color: var(--green-dark); }

/* ----- RECENT TX ----- */
.recent-tx .tx-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tx-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-radius: 8px;
}
.tx-meta { min-width: 0; overflow: hidden; }
.tx-desc { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row:hover { background: var(--line-2); }
.tx-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px;
  background: var(--line-2);
}
.tx-income { background: var(--green-tint); }
.tx-expense { background: var(--pink); }
.tx-desc { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; }
.tx-date { font-size: 11.5px; color: var(--muted); }
.tx-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  letter-spacing: -.2px;
  white-space: nowrap;
}
.tx-amount.in { color: var(--green-dark); }
.tx-amount.out { color: var(--ink); }
.tx-del {
  opacity: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: opacity .15s;
}
.tx-row:hover .tx-del { opacity: 1; }
.tx-del:hover { background: var(--pink); color: var(--pink-ink); }
.empty-tx { padding: 16px; color: var(--muted); text-align: center; font-size: 13px; }

/* ----- MODALS ----- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(20,40,35,.5);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white;
  border-radius: var(--radius);
  width: min(540px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.modal-x {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
}
.modal-x:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 18px 22px 22px; }

/* FORM */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23,122,99,.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; padding-top: 12px; }
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 6px;
}

/* ----- PAGES ----- */
.page { display: flex; flex-direction: column; gap: 16px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 0;
}
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.page-head-actions { display: flex; gap: 8px; }

/* TABLE */
.lc-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.lc-filters { display: flex; gap: 6px; }
.lc-filters button {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--line-2);
  color: var(--ink-2);
}
.lc-filters button.active { background: var(--green-deep); color: white; }
.lc-search {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  width: 240px;
  outline: none;
}
.lc-search:focus { border-color: var(--green); }
.lc-toolbar-right { display: flex; align-items: center; gap: 10px; }
.lc-cat-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: white;
  outline: none;
  cursor: pointer;
  max-width: 200px;
}
.lc-cat-select:focus { border-color: var(--green); }

table.lc-table, table.div-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lc-table th, .div-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.lc-table td, .div-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.lc-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.lc-desc { font-weight: 600; }
.lc-tag { font-size: 11px; color: var(--muted); }
.lc-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.lc-amount.in { color: var(--green-dark); }
.lc-amount.out { color: var(--ink); }
.row-del, .row-actions button {
  width: 26px; height: 26px;
  border-radius: 8px;
  color: var(--muted);
  display: inline-grid; place-items: center;
}
.row-del:hover { background: var(--pink); color: var(--pink-ink); }
.row-actions { display: flex; gap: 4px; }
.row-actions button:hover { background: var(--line-2); color: var(--ink); }

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-done { background: var(--green-tint); color: var(--green-dark); }
.badge-open { background: var(--yellow); color: #12447E; }
.badge-muted { background: var(--line-2); color: var(--muted); }

/* DIVIDAS */
.div-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1fr;
  gap: 12px;
}
.ds-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.ds-label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.ds-stats {
  background: linear-gradient(150deg, #311131, #12447E);
  color: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 8px;
  justify-content: center;
}
.ds-stat { display: flex; justify-content: space-between; font-size: 12.5px; }
.ds-stat span { color: rgba(255,255,255,.7); }
.ds-stat strong { font-size: 14px; }

.dt-name { font-weight: 600; }
.dt-progress {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
  font-size: 11px; color: var(--muted);
}
.dt-bar {
  width: 100px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.dt-bar div {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
}

/* ANALISE bar chart */
.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  height: 220px;
  align-items: end;
  padding: 14px 0;
}
.bar-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%;
  justify-content: end;
}
.bar-group {
  display: flex; gap: 3px; height: 100%;
  width: 100%;
  align-items: end;
  justify-content: center;
}
.bar {
  flex: 1;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  transition: opacity .2s;
}
.bar-in { background: var(--green); }
.bar-out { background: var(--ink-2); }
.bar:hover { opacity: .8; }
.bar-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.bar-legend {
  display: flex; gap: 16px; padding-top: 8px;
  font-size: 12px; color: var(--muted);
}
.bar-legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.big-stats {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 10px;
}
.big-stats > div {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.big-stats > div:last-child { border-bottom: none; }
.big-stats span { color: var(--muted); font-size: 13px; }

.insight-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.insight-card { position: relative; padding: 22px; }
.insight-card h3 { font-size: 16px; margin-bottom: 8px; }
.insight-card p { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.insight-num {
  position: absolute; top: 14px; right: 18px;
  font-size: 38px; font-weight: 800; color: var(--green-tint);
  letter-spacing: -1px;
}

.empty-card { padding: 40px; text-align: center; color: var(--muted); }

/* CARTÕES */
.card-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cc-name { font-weight: 700; font-size: 15px; }
.cc-bars {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px;
  height: 80px; align-items: end;
}
.cc-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: end; }
.cc-bar { width: 100%; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; }
.cc-bar-col span { font-size: 9.5px; color: var(--muted); }

/* RESPONSIVE */
@media (max-width: 1280px) {
  .app { gap: 14px; padding: 14px; }
  .metrics-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .qa-grid { grid-template-columns: 1fr 1fr; }
  .recommendations .rec-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 900px) {
  .app { padding: 12px; }
  .sheet { padding: 14px; border-radius: 20px; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .recommendations .rec-grid { grid-template-columns: 1fr; }
  .div-summary { grid-template-columns: 1fr 1fr; }
  .spending-overview .so-body { grid-template-columns: 1fr; }
  .donut-wrap { margin: 0 auto; }
}
@media (max-width: 640px) {
  .metrics-row { grid-template-columns: 1fr; }
  .div-summary { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: 1fr 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .top-header { flex-direction: column; align-items: stretch; }
}

/* ===== ANÁLISE YEAR-OVER-YEAR ===== */
.year-switch {
  display: inline-flex;
  background: var(--line-2);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.year-switch button {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.year-switch button:hover { color: var(--ink-2); }
.year-switch button.active {
  background: var(--green-deep);
  color: white;
}

.ds-delta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.ds-prev { font-size: 11px; }

.bar-chart-yoy { height: 260px; }
.bar-chart-yoy .bar-group { gap: 6px; }
.bar-pair { display: flex; flex-direction: column; height: 100%; justify-content: end; gap: 0; flex: 1; }
.bar-pair .bar { width: 100%; border-radius: 3px 3px 0 0; }
.bar.bar-prev-in {
  background: repeating-linear-gradient(45deg, #cbd5d8 0 4px, #b8c3c7 4px 8px);
  opacity: .9;
}
.bar.bar-prev-out {
  background: repeating-linear-gradient(45deg, #9ca3af 0 4px, #82898f 4px 8px);
  opacity: .85;
}
.bar-pair > .bar:not(:last-child) { margin-bottom: 2px; }

.bar-legend.inline { padding-top: 0; gap: 12px; flex-wrap: wrap; }
.bar-legend.inline i { width: 12px; height: 8px; border-radius: 2px; }

/* Analysis table */
table.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.analysis-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.analysis-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}
.analysis-table td.num { text-align: right; }
.analysis-table td.in { color: var(--green-dark); }
.analysis-table td.out { color: var(--ink); }
.analysis-table td.muted { color: var(--muted); }
.analysis-table tr.total-row td {
  background: rgba(14, 74, 64, .04);
  border-top: 2px solid var(--line);
  border-bottom: none;
  padding: 14px 12px;
}

/* ===== CHECKLIST MENSAL ===== */
.ck-proj { padding: 16px 20px; }
.ck-proj-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ckp-msg { font-size: 13.5px; line-height: 1.5; flex: 1; min-width: 260px; }
.ckp-msg b { font-weight: 700; }
.proj-over .ckp-msg b { color: var(--pink-ink); }
.proj-ok .ckp-msg b { color: var(--green-dark); }
.ckp-nums { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ckp-nums i { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.ckp-teto { font-weight: 700; color: var(--ink); }
.ckp-bar {
  position: relative;
  height: 12px; border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}
.ckp-fill-proj {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, #0E92D2, #0663AA);
  border-radius: 999px;
  opacity: .45;
}
.ckp-fill-pago {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, #0663AA, #12447E);
  border-radius: 999px;
}
.ckp-overflow {
  position: absolute; inset: 0 0 0 auto;
  background: repeating-linear-gradient(45deg, #d1455a 0 6px, #e06777 6px 12px);
}
.proj-over .ckp-bar { box-shadow: inset 0 0 0 1.5px rgba(209,69,90,.4); }

.ck-seed {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 20px;
  background: linear-gradient(145deg, var(--lav-soft), var(--lav));
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}

.ck-group { padding: 16px 20px 14px; }
.ck-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ckg-title { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ckg-title > div { min-width: 0; }
.ckg-icon {
  flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(145deg, var(--lav-soft), var(--lav));
  display: grid; place-items: center; font-size: 18px;
}
.ckg-title h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.ckg-sub { font-size: 11.5px; color: var(--muted); display: block; line-height: 1.35; }
.ckg-right { flex-shrink: 0; }
.ckg-right { display: flex; align-items: center; gap: 14px; }
.ckg-count { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ckg-total { text-align: right; }
.ckg-total strong { font-size: 16px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; display: block; }
.ckg-total strong.neg { color: var(--pink-ink); }
.ckg-target { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ckg-bar { height: 5px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.ckg-bar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #EA404D, #a8232f); transition: width .4s cubic-bezier(.16,1,.3,1); }
.ckg-bar div.over { background: var(--pink-ink); }

.ck-rows { display: flex; flex-direction: column; margin-top: 8px; }
.ck-row {
  display: grid;
  grid-template-columns: 26px minmax(0,1fr) auto auto 26px;
  align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-2);
}
.ck-row:last-child { border-bottom: none; }
.ck-check {
  width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid var(--line);
  background: white;
  display: grid; place-items: center;
  color: white;
  transition: background .15s, border-color .15s, transform .1s;
}
.ck-check:hover { border-color: var(--green); transform: scale(1.06); }
.ck-check.on { background: linear-gradient(135deg, #0E92D2, #0663AA); border-color: transparent; }
.ck-info { display: flex; flex-direction: column; min-width: 0; }
.ck-desc { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-row.is-pago .ck-desc { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(38,38,46,.35); }
.ck-redu {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--line-2); color: var(--muted);
  white-space: nowrap;
  transition: filter .12s;
}
.ck-redu.on { background: #fbdfe1; color: #EA404D; }
.ck-redu:hover { filter: brightness(.95); }
.ck-redu-spacer { width: 0; }
.ck-classe-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
  background: var(--line-2); color: var(--muted); border: 1px solid transparent;
  transition: filter .12s;
}
.ck-classe-pill:hover { filter: brightness(.95); }
.ck-classe-pill.c-fixo_essencial { background: #eef1f5; color: #1f2937; }
.ck-classe-pill.c-fixo { background: #e6eef6; color: #3f6285; }
.ck-classe-pill.c-variavel { background: #fdeae4; color: #c25b40; }
.ck-classe-pill.c-investimento { background: #e3f0e7; color: #2f6b41; }
.ck-classe-pill.c-protecao { background: #ece9f7; color: #5b4d94; }
.ck-classe-pill.c-caridade { background: #f6eecf; color: #8a6f10; }
.ck-classe-wrap { position: relative; }
.ck-classe-pill.open { border-color: rgba(0,0,0,.18); }
.ck-classe-menu {
  position: absolute; z-index: 200;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15,23,42,.14); padding: 5px; width: 170px;
  display: flex; flex-direction: column; gap: 1px;
}
.ck-classe-menu button {
  text-align: left; font: inherit; font-size: 12px; font-weight: 500; color: #374151;
  padding: 7px 10px; border-radius: 8px; background: none; cursor: pointer; white-space: nowrap;
}
.ck-classe-menu button:hover { background: var(--line-2); }
.ck-classe-menu button.sel { background: #0663AA; color: #fff; font-weight: 600; }
.ck-money {
  font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
  padding: 4px 8px; border-radius: 8px;
  white-space: nowrap;
  transition: background .12s;
}
.ck-money:hover { background: var(--green-tint); outline: 1px dashed var(--green); }
.ck-money.in { color: var(--green-dark); }
.ck-money { justify-self: end; text-align: right; }
.ck-money-input {
  width: 110px;
  padding: 4px 8px;
  border: 1.5px solid var(--green);
  border-radius: 8px;
  font-size: 13.5px; font-weight: 700;
  text-align: right;
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px rgba(23,122,99,.15);
  font-variant-numeric: tabular-nums;
}
.ck-del {
  width: 26px; height: 26px; border-radius: 8px;
  color: var(--muted); display: grid; place-items: center;
  opacity: 0; transition: opacity .12s;
}
.ck-row:hover .ck-del { opacity: 1; }
.ck-del:hover { background: var(--pink); color: var(--pink-ink); }
.ck-empty-group { padding: 12px 4px; font-size: 12.5px; color: var(--muted); }

.ck-add-btn {
  white-space: nowrap;
  margin-top: 8px;
  font-size: 12.5px; font-weight: 700;
  color: var(--green-dark);
  padding: 6px 10px; border-radius: 10px;
  align-self: flex-start;
}
.ck-add-btn:hover { background: var(--green-tint); }
.ck-quick {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px;
  background: var(--line-2);
  border-radius: 12px;
  padding: 8px;
}
.ck-quick input, .ck-quick select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  background: white;
}
.ck-quick input:focus, .ck-quick select:focus { border-color: var(--green); }
.ck-qi-desc { flex: 1; min-width: 0; }
.ck-qi-cat { max-width: 170px; }
.ck-qi-val { width: 100px; text-align: right; font-variant-numeric: tabular-nums; }
.ck-qi-save {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #0E92D2, #0663AA);
  color: white; display: grid; place-items: center;
  flex-shrink: 0;
}
.ck-qi-cancel {
  width: 32px; height: 32px; border-radius: 9px;
  color: var(--muted); display: grid; place-items: center;
  flex-shrink: 0;
}
.ck-qi-cancel:hover { background: white; }

@media (max-width: 640px) {
  .ck-row { grid-template-columns: 26px minmax(0,1fr) auto 26px; }
  .ck-redu, .ck-redu-spacer, .ck-classe { display: none; }
  .ck-group-head { flex-direction: column; }
  .ckg-right { width: 100%; justify-content: space-between; }
}

/* SCROLLBAR */
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* ===== EDITABLE GRIDS (Receitas / Despesas) ===== */
.grid-card { padding: 18px 0 18px; overflow: hidden; }
.grid-card .card-head { padding: 0 22px 14px; }
.big-total { font-size: 13px; color: var(--muted); }
.big-total strong { color: var(--ink); font-weight: 700; }

.page-hint { font-size: 12px; color: var(--muted); }

.grid-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
table.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 980px;
}
.grid-table th {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 6px;
  background: var(--line-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.grid-table th.gh-row {
  text-align: left;
  padding-left: 22px;
  background: var(--line-2);
  min-width: 180px;
  position: sticky; left: 0; z-index: 2;
}
.grid-table th.gh-month { text-align: center; min-width: 62px; }

.grid-table td {
  padding: 0;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.grid-table tbody tr:hover { background: rgba(23,122,99,.04); }

.gt-row-name {
  font-weight: 600;
  padding: 10px 12px 10px 22px;
  white-space: nowrap;
  background: white;
  position: sticky; left: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.gt-row-name.gt-sub { font-weight: 500; color: var(--ink-2); padding-left: 32px; }
.gt-row-name.gt-section-name { background: var(--line-2); }
tr.gt-section td { background: var(--line-2); padding: 8px 22px; font-size: 12px; }
tr.gt-subtotal td { background: rgba(14, 74, 64, .03); font-weight: 600; }
tr.gt-subtotal .gt-month-cell { color: var(--ink); font-weight: 600; }

.gt-row-del {
  width: 20px; height: 20px;
  border-radius: 6px;
  color: var(--muted);
  display: inline-grid; place-items: center;
  opacity: 0;
  transition: opacity .15s;
}
tr:hover .gt-row-del { opacity: 1; }
.gt-row-del:hover { background: var(--pink); color: var(--pink-ink); }

.gt-month-cell {
  text-align: center;
  padding: 4px 2px;
  border-left: 1px solid var(--line-2);
  position: relative;
}
.gt-row-total {
  text-align: right;
  padding: 10px 16px 10px 8px;
  font-weight: 700;
  border-left: 2px solid var(--line);
  background: rgba(14, 74, 64, .025);
  white-space: nowrap;
}
.gt-row-total.grand { background: var(--green-deep); color: white; }
.gt-total-row td {
  font-weight: 700;
  background: rgba(14, 74, 64, .04);
  padding-top: 12px; padding-bottom: 12px;
  border-top: 2px solid var(--line);
}
.gt-total-row .gt-row-name { background: rgba(14, 74, 64, .04); color: var(--ink); }

/* cells */
.gc-cell {
  width: 100%;
  padding: 8px 4px;
  background: transparent;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: center;
  cursor: text;
  transition: background .12s;
  font-weight: 500;
  min-height: 34px;
}
.gc-cell:hover { background: var(--green-tint); outline: 1px dashed var(--green); }
.gc-cell.gc-has { color: var(--ink); font-weight: 600; }
.gc-empty { color: var(--muted-2); font-size: 13px; }

.gc-input {
  width: 100%;
  padding: 8px 4px;
  background: white;
  border: 1.5px solid var(--green);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink);
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px rgba(23,122,99,.15);
  font-weight: 600;
}

.gt-detail {
  display: block;
  font-size: 10px;
  color: var(--green-dark);
  margin-top: 2px;
  font-weight: 500;
}

.grid-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px 0;
}
.grid-add input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}
.grid-add input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,122,99,.15); }
.grid-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-right: 22px;
}
.grid-hint {
  padding: 10px 22px 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 900px) {
  .grid-add-row { grid-template-columns: 1fr; padding-right: 0; }
}

/* ===== PLANO 70 / 10 / 10 / 10 (Jim Rohn) ===== */
.plano-card { padding: 20px 22px 18px; }
.plano-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.plano-kicker {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 2px;
}
.plano-title h3 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.plano-title h3 b { color: var(--green-deep); font-weight: 800; }
.plano-income { text-align: right; }
.plano-income .pi-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.plano-income .amount { justify-content: flex-end; }

.plano-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13.5px; }

.plano-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.plano-tile {
  background: linear-gradient(145deg, var(--lav-soft), var(--lav));
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.plano-tile.pt-gastos {
  background: linear-gradient(150deg, #EA404D 0%, #a8232f 100%);
  color: white;
}
.pt-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pt-emoji { font-size: 20px; }
.pt-pct {
  font-size: 12px; font-weight: 800; letter-spacing: -.2px;
  background: rgba(255,255,255,.55); color: var(--green-deep);
  padding: 2px 8px; border-radius: 999px;
}
.pt-gastos .pt-pct { background: rgba(255,255,255,.22); color: #ffd9dc; }
.pt-label { font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.pt-sub { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.pt-gastos .pt-sub { color: rgba(255,255,255,.55); }
.pt-amount {
  font-size: 22px; font-weight: 800; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.pt-target { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.pt-gastos .pt-target { color: rgba(255,255,255,.6); }
.pt-bar {
  height: 6px; border-radius: 999px;
  background: rgba(20,40,35,.08);
  overflow: hidden; margin-bottom: 8px;
}
.pt-gastos .pt-bar { background: rgba(255,255,255,.14); }
.pt-bar div { height: 100%; border-radius: 999px; background: var(--green-dark); transition: width .4s cubic-bezier(.16,1,.3,1); }
.pt-bar div.over { background: var(--pink-ink); }
.pt-gastos .pt-bar div { background: #fff; }
.pt-gastos .pt-bar div.over { background: #2a1015; }
.pt-status { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-status.pos { color: var(--green-dark); }
.pt-status.neg { color: var(--pink-ink); }
.pt-gastos .pt-status.pos { color: #ffd9dc; }
.pt-gastos .pt-status.neg { color: #ffffff; }
.plano-tile.pt-over:not(.pt-gastos) { background: #fbe6e7; }

/* Lever strip */
.plano-lever {
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.plano-lever.lever-ok { background: var(--green-tint); }
.plano-lever.lever-over { background: #fbe6e7; }
.pl-msg { font-size: 13px; line-height: 1.5; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; min-width: 240px; flex: 1; }
.pl-msg b { font-weight: 700; }
.lever-over .pl-msg b { color: var(--pink-ink); }
.lever-ok .pl-msg b { color: var(--green-dark); }
.pl-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.lever-ok .pl-dot { background: var(--green-dark); box-shadow: 0 0 0 3px rgba(23,122,99,.25); }
.lever-over .pl-dot { background: var(--pink-ink); box-shadow: 0 0 0 3px rgba(209,69,90,.2); }
.pl-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pl-stat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pl-stat strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 2px; }
.dotmark { width: 9px; height: 9px; border-radius: 3px; }
.dotmark.paid { background: var(--green-dark); }
.dotmark.pend { background: #0E92D2; }
.dotmark.redu { background: #EA404D; }
.pl-link { font-size: 12.5px; font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.pl-link:hover { color: var(--green-deep); text-decoration: underline; }

/* toggle badges in Lançamentos */
.badge-toggle { cursor: pointer; transition: filter .12s, transform .12s; border: 1px solid transparent; }
.badge-toggle:hover { filter: brightness(.96); transform: translateY(-1px); }
.badge-redu { background: #fbdfe1; color: #EA404D; }
.badge-fixed { background: var(--line-2); color: var(--muted); }

@media (max-width: 1100px) {
  .plano-grid { grid-template-columns: 1fr 1fr; }
  .plano-tile.pt-gastos { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .plano-grid { grid-template-columns: 1fr; }
  .plano-head { flex-direction: column; align-items: flex-start; }
  .plano-income { text-align: left; }
  .plano-income .amount { justify-content: flex-start; }
}

/* ----- AI ASSISTANT (base) ----- */
.ai-assistant {
  display: flex; flex-direction: column; gap: 10px;
  border-radius: 18px; padding: 16px;
}
.ai-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: -.1px;
}
.ai-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  animation: aiPulse 2.2s ease-in-out infinite;
}
@keyframes aiPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.ai-answer {
  font-size: 12.5px; line-height: 1.55; border-radius: 12px;
  padding: 11px 12px;
}
.ai-form { display: flex; gap: 6px; border-radius: 999px; padding: 4px 4px 4px 14px; }
.ai-form input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 12.5px; min-width: 0;
}
.ai-form input::placeholder { color: rgba(255,255,255,.5); }
.ai-form button {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  transition: transform .12s, opacity .12s;
}
.ai-form button:disabled { opacity: .4; cursor: default; }
.ai-form button:not(:disabled):hover { transform: scale(1.07); }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-chips button {
  border: 1px solid transparent; border-radius: 999px;
  padding: 6px 12px; font-size: 11.5px; font-weight: 600;
  transition: background .12s;
}

/* AI assistant inside right panel (dark) */
.right-panel .ai-assistant { background: rgba(255,255,255,.08); margin-top: auto; border: 1px solid rgba(255,255,255,.1); }
.right-panel .ai-head { color: #cfe6f7; }
.right-panel .ai-dot { background: #0E92D2; box-shadow: 0 0 0 3px rgba(14,146,210,.28); }
.right-panel .ai-answer { background: rgba(255,255,255,.94); color: var(--ink-2); }
.right-panel .ai-form { background: rgba(255,255,255,.94); }
.right-panel .ai-form input { color: var(--ink); }
.right-panel .ai-form input::placeholder { color: var(--muted-2); }
.right-panel .ai-form button { background: var(--green-deep); }
.right-panel .ai-chips button { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); border-color: transparent; }
.right-panel .ai-chips button:hover { background: rgba(255,255,255,.2); }

/* responsive: panel drops below */
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .right-panel { position: static; max-height: none; }
}


/* ===== REORGANIZAÇÃO: NAV / SUBNAV / RELATÓRIO / PATRIMÔNIO ===== */
.topnav-tabs { flex-wrap: nowrap; }
.tn-tab-label { white-space: nowrap; }
.btn-relatorio {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: #374151; white-space: nowrap;
}
.btn-relatorio:hover, .btn-relatorio.active { background: #1f2937; color: #fff; border-color: #1f2937; }

.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.subnav-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; color: #4b5563; white-space: nowrap;
}
.subnav-tab.active { background: var(--green, #16a34a); border-color: var(--green, #16a34a); color: #fff; }
.orc-wrap .page { padding-top: 0; }

/* Gastos por classe */
.classes-card { margin-bottom: 18px; }
.classes-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 8px 0 12px; }
.classes-seg { min-width: 4px; }
.classes-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12.5px; color: #4b5563; }
.classes-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.ck-classe {
  border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit;
  font-size: 11.5px; color: #4b5563; padding: 3px 8px; max-width: 150px; cursor: pointer;}

/* HBar (composição por categoria) */
.hbar { display: grid; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 190px 1fr 110px 40px; align-items: center; gap: 12px; }
.hbar-label { font-size: 13px; color: #374151; }
.hbar-track { height: 12px; background: #f1f3f4; border-radius: 999px; overflow: hidden; }
.hbar-track div { height: 100%; border-radius: 999px; }
.hbar-val { font-size: 12.5px; font-weight: 600; text-align: right; }
.hbar-pct { font-size: 12px; color: #9ca3af; text-align: right; }

/* Pie */
.pie-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.pie { width: 160px; height: 160px; border-radius: 50%; flex: 0 0 auto; }
.pie-legend { display: grid; gap: 8px; flex: 1; min-width: 220px; }
.pie-legend > div { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 13px; color: #4b5563; }
.pie-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* Count cards */
.count-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.count-card {
  border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px 16px;
  display: grid; gap: 4px; text-align: left; cursor: pointer; font: inherit;
}
.count-card:hover { border-color: #9ca3af; }
.count-card .cc-label { font-size: 12.5px; color: #6b7280; }
.count-card .cc-n { font-size: 24px; font-weight: 700; color: #111827; }
.count-card .cc-v { font-size: 12px; color: #6b7280; }

/* Família */
.fam-tree { display: grid; gap: 18px; }
.fam-couple, .fam-children { display: flex; gap: 14px; flex-wrap: wrap; }
.fam-node {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; min-width: 190px;
  display: grid; gap: 3px; background: #fafbfc;
}
.fam-node strong { font-size: 15px; }
.fam-role { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9ca3af; }
.fam-sub { font-size: 12px; color: #6b7280; }
.fam-child { background: #fff; }

/* Sucessão */
.suc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.suc-kpi { background: #f8f9fa; border-radius: 12px; padding: 12px 16px; display: grid; gap: 4px; }
.suc-kpi span { font-size: 12px; color: #6b7280; }
.suc-kpi strong { font-size: 17px; }
.suc-kpi.big strong { font-size: 22px; }
.suc-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.suc-bar-meacao { background: #311131; }
.suc-bar-heranca { background: #EA404D; }
.suc-bar-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: #4b5563; }
.suc-note { font-size: 12px; color: #9ca3af; margin-top: 12px; }
.suc-lines { display: grid; gap: 6px; margin: 12px 0; }
.suc-lines > div { display: flex; justify-content: space-between; font-size: 13px; color: #4b5563; }
.suc-lines .suc-total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; color: #111827; }
.suc-custos { display: grid; gap: 16px; }
.suc-custo-head { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.suc-itcmd { display: grid; gap: 8px; }

/* Herdeiros */
.herd-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.herd-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 5px; }
.herd-top { display: flex; justify-content: space-between; align-items: center; }
.herd-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #eef2ff; color: #4f46e5;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.herd-nome { font-size: 15px; }
.herd-comp { font-size: 12px; color: #9ca3af; }
.herd-valor { font-size: 20px; font-weight: 700; }
.herd-pct { font-size: 12px; color: #6b7280; }

/* Objetivos */
.obj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.obj-card { display: grid; gap: 8px; align-content: start; }
.obj-card.done { border-color: #86efac; }
.obj-head { display: flex; justify-content: space-between; align-items: center; }
.obj-icon { font-size: 26px; }
.obj-nums { display: flex; align-items: baseline; gap: 8px; }
.obj-nums strong { font-size: 20px; }
.obj-nums span { font-size: 12.5px; color: #6b7280; }
.obj-bar { height: 10px; background: #f1f3f4; border-radius: 999px; overflow: hidden; }
.obj-bar div { height: 100%; background: var(--green, #16a34a); border-radius: 999px; }
.obj-foot { display: flex; gap: 12px; font-size: 12px; color: #6b7280; flex-wrap: wrap; }
.obj-aporte { font-weight: 600; color: #111827; }
.obj-done { color: #16a34a; font-weight: 600; }

/* Reserva */
.res-bar { position: relative; height: 18px; background: #f1f3f4; border-radius: 999px; overflow: hidden; }
.res-fill { height: 100%; background: linear-gradient(90deg, #16a34a, #4ade80); border-radius: 999px; }
.res-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
.res-legend { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: #4b5563; }

/* IRPF */
.irpf-tips { display: grid; gap: 10px; padding-left: 18px; font-size: 13.5px; color: #374151; line-height: 1.6; }

/* ===== RELATÓRIO ===== */
.rel-doc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 48px 56px; display: grid; gap: 40px; }
.rel-capa h1 { font-size: 52px; letter-spacing: -0.02em; margin: 0 0 4px; }
.rel-sub { color: #6b7280; font-size: 15px; margin: 0 0 24px; }
.rel-hr { border-top: 1px solid var(--line); margin: 20px 0 24px; }
.rel-capa h4, .rel-sec-head h3 { font-size: 16px; margin: 0 0 16px; }
.rel-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; }
.rel-info-grid > div { display: grid; gap: 3px; }
.rel-info-grid span { font-size: 12px; color: #9ca3af; }
.rel-info-grid strong { font-size: 14px; font-weight: 600; }
.rel-sec-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 24px; }
.rel-scope { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; color: #6b7280; }
.rel-explain { font-size: 12px; color: #6b7280; line-height: 1.55; margin: -6px 0 14px; max-width: 720px; text-wrap: pretty; }
.rel-stamp { font-size: 11.5px; color: #9ca3af; margin: -16px 0 24px; }
.rel-flash { font-size: 12px; font-weight: 600; color: #2f6b41; white-space: nowrap; }
/* Importação de fatura */
.fat-card { position: relative; }
.fat-card.fat-dragover { outline: 2px dashed #0663AA; outline-offset: -6px; }
.fat-drop-overlay { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(240,247,253,0.92); border-radius: inherit; font-weight: 700; color: #0663AA; font-size: 15px; pointer-events: none; }
.fat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fat-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #1f2937; background: #f0f4f8; border: 1px solid #d7e0e8; border-radius: 999px; padding: 4px 10px; }
.fat-chip button { border: 0; background: none; cursor: pointer; color: #9ca3af; font-size: 11px; padding: 0; }
.fat-chip button:hover { color: #b3413b; }
.fat-card textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; }
.fat-erro { font-size: 12.5px; color: #b3413b; background: #fdf1f0; border: 1px solid #f0d4d2; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.fat-status { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #374151; font-weight: 600; margin-bottom: 10px; }
.fat-dup-flag { color: #a16207; }
.fat-table select { font-size: 12px; padding: 4px 6px; max-width: 200px; }
.fat-table .fat-date { font-size: 12px; padding: 3px 6px; }
.fat-table tr.fat-off td { opacity: 0.45; }
.fat-dup { color: #a16207; font-style: normal; font-size: 11.5px; }
.fat-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.fat-foot-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #374151; }
.rel-diag { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.rel-sec { min-width: 0; max-width: 100%; }
@media screen { .rel-sec { overflow: hidden; } }
.rel-diag-crit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; min-width: 0; }
.rel-diag-line { display: flex; align-items: baseline; gap: 10px; border: 1px solid #f3c4c8; background: #fdf4f5; border-radius: 10px; padding: 9px 14px; min-width: 0; max-width: 100%; overflow: hidden; }
.rel-diag-line strong { font-size: 12.5px; letter-spacing: -.1px; white-space: nowrap; }
.rel-diag-line-txt { font-size: 11.5px; color: #4b5563; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; width: 0; min-width: 0; }
.rel-diag-line .rel-diag-icon { font-size: 13px; align-self: center; }
@media print { .rel-diag-line-txt { white-space: normal; } }
.rel-diag-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; break-inside: avoid; }
.rel-diag-item strong { font-size: 12.5px; letter-spacing: -.1px; display: block; margin-bottom: 3px; }
.rel-diag-item p { font-size: 11.5px; color: #4b5563; line-height: 1.5; margin: 0; }
.rel-diag-icon { font-size: 15px; line-height: 1.3; }
.rel-diag-item.d-alerta { border-color: #f3c4c8; background: #fdf4f5; }
.rel-diag-item.d-atencao { border-color: #ecd9ae; background: #fdf9ef; }
.rel-diag-item.d-ok { border-color: #c8ddce; background: #f3f9f5; }
.rel-diag-item.d-insight { border-color: #c4dcee; background: #f2f8fd; }
.rel-neg { color: #EA404D; }
.rel-res-bar-wrap { margin: 4px 0 14px; }
.rel-res-bar { position: relative; height: 14px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.rel-res-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0E92D2, #0663AA); }
.rel-res-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
.rel-res-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: #6b7280; margin-top: 6px; }
.rel-de { font-style: normal; font-weight: 500; font-size: 11px; color: #9ca3af; }
@media (max-width: 760px) { .rel-diag { grid-template-columns: 1fr; } }
.rel-fam { display: flex; gap: 12px; flex-wrap: wrap; }
.rel-fam-node { border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; display: grid; gap: 2px; min-width: 170px; }
.rel-fam-node span { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; }
.rel-fam-node em { font-style: normal; font-size: 12px; color: #6b7280; }
.rel-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 14px 0; }
.rel-kpi { display: grid; gap: 3px; background: #f8f9fa; border-radius: 12px; padding: 14px 16px; }
.rel-kpi span { font-size: 12px; color: #6b7280; }
.rel-kpi strong { font-size: 19px; }
.rel-kpi.big strong { font-size: 26px; }
.rel-kpi em { font-style: normal; font-size: 11.5px; color: #9ca3af; }
.rel-bars { display: grid; gap: 10px; margin: 14px 0; }
.rel-bar-row { display: grid; grid-template-columns: 200px 1fr 130px; gap: 12px; align-items: center; font-size: 13px; }
.rel-bar-track { height: 12px; background: #f1f3f4; border-radius: 999px; overflow: hidden; }
.rel-bar-track div { height: 100%; border-radius: 999px; }
.rel-bar-row strong { text-align: right; font-size: 12.5px; }
.rel-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.rel-table th { text-align: left; color: #9ca3af; font-weight: 500; font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.rel-table td { padding: 8px 10px; border-bottom: 1px solid #f1f3f4; }
.rel-note { font-size: 11.5px; color: #9ca3af; }
.rel-empty { font-size: 13px; color: #9ca3af; }
.rel-partilha-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.rel-partilha-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: #4b5563; }
.rel-partilha-legend i, .classes-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.rel-herd { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.rel-herd-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.rel-herd-role { font-size: 11px; color: #9ca3af; text-transform: uppercase; }
.rel-herd-card em { font-style: normal; font-size: 12px; color: #6b7280; }
.rel-herd-val { font-size: 20px; font-weight: 700; }
.rel-herd-pct { font-size: 11.5px; color: #9ca3af; }
.rel-legal { font-size: 12.5px; color: #6b7280; line-height: 1.7; }

@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .topnav, .right-panel, .top-header, .stepsbar, .subnav, .no-print, .ai-assistant, .sb-pend { display: none !important; }
  .app, .sheet, .main { display: block !important; padding: 0 !important; margin: 0 !important; background: #fff !important; box-shadow: none !important; border: none !important; max-width: none !important; }
  .rel-doc { border: none; padding: 0; max-width: none; }
  .rel-page { padding: 0 !important; }
  .rel-sec { break-inside: auto; overflow: visible !important; max-width: 100% !important; page-break-inside: auto; }
  .rel-sec-head, .rel-kpi-row, .rel-diag-item, .rel-diag-line, .rel-herd-card, .rel-res-bar-wrap { break-inside: avoid; }
  .rel-diag { grid-template-columns: 1fr 1fr !important; }
  .rel-diag-line { overflow: visible !important; align-items: flex-start; }
  .rel-diag-line-txt { white-space: normal !important; width: auto !important; overflow: visible !important; }
  .rel-table { width: 100% !important; }
  .rel-table thead { display: table-header-group; }
  .rel-table tr { break-inside: avoid; }
}

a { color: #16a34a; }
a:hover { color: #15803d; }


/* ===== CLIENT SWITCHER (múltiplos planejamentos) ===== */
.client-switcher { position: relative; }
.cs-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 10px 5px 5px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s; color: var(--ink);
}
.cs-trigger:hover { border-color: var(--green); box-shadow: 0 2px 8px rgba(6,99,170,.12); }
.cs-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0E92D2, #0663AA); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.cs-avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.cs-name { font-size: 13px; font-weight: 700; letter-spacing: -.2px; }
.cs-trigger svg { color: var(--muted); }
.cs-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 268px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 16px 40px rgba(36,17,41,.18);
  padding: 8px; animation: csIn .14s ease;
}
@keyframes csIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cs-menu-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px 8px; }
.cs-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.cs-item { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.cs-item.active { background: var(--green-tint); }
.cs-item-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 10px; cursor: pointer; color: var(--ink); text-align: left;
}
.cs-item-main:hover { background: var(--line-2); }
.cs-item.active .cs-item-main:hover { background: transparent; }
.cs-item-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-check { color: var(--green); font-weight: 800; }
.cs-icon {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--muted-2); font-size: 12px;
  transition: background .12s, color .12s;
}
.cs-icon:hover { background: var(--line-2); color: var(--ink); }
.cs-icon.danger:hover { background: var(--pink); color: var(--pink-ink); }
.cs-new {
  width: 100%; margin-top: 6px; padding: 10px; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: var(--green-dark);
  background: var(--green-tint); transition: filter .12s;
}
.cs-new:hover { filter: brightness(.97); }
.cs-create { margin-top: 6px; padding: 10px; border-radius: 12px; background: var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.cs-create input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--card); }
.cs-copy { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
.cs-copy input { width: auto; }
.cs-create-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cs-mini { padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: var(--green); color: #fff; }
.cs-mini.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.cs-rename { flex: 1; display: flex; gap: 6px; padding: 5px 6px; }
.cs-rename input { flex: 1; min-width: 0; border: 1px solid var(--green); border-radius: 8px; padding: 6px 9px; font-size: 13px; }
@media (max-width: 640px) { .cs-name { display: none; } .cs-menu { width: 240px; } }

/* ===== OBJETIVOS PESSOAIS ===== */
.ds-big { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.opes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.opes-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, background .15s; }
.opes-card.on { border-color: var(--green); background: var(--green-tint); }
.opes-head { position: relative; display: block; width: 100%; text-align: left; padding: 18px 18px 16px; }
.opes-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--lav-soft); display: grid; place-items: center; font-size: 17px; margin-bottom: 34px; }
.opes-card.on .opes-icon { background: #fff; }
.opes-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; display: grid; place-items: center; }
.opes-name { font-weight: 600; font-size: 15px; letter-spacing: -.2px; }
.opes-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; text-wrap: pretty; }
.opes-toggle { display: flex; align-items: center; gap: 6px; padding: 0 18px 14px; font-size: 12.5px; font-weight: 600; color: var(--green); }
.opes-chev { display: inline-block; transition: transform .15s; }
.opes-chev.up { transform: rotate(180deg); }
.opes-form { display: grid; gap: 12px; padding: 4px 18px 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.opes-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opes-field { display: grid; gap: 5px; }
.opes-field > span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.opes-field textarea, .opes-field input { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 13px; resize: vertical; width: 100%; }
.opes-field textarea:focus, .opes-field input:focus { outline: none; border-color: var(--green); }
.opes-resumo { margin-top: 20px; padding: 20px; display: grid; gap: 14px; }
.opes-resumo h3 { font-size: 14px; }
.opes-resumo-list { display: grid; gap: 12px; }
.opes-resumo-item { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.opes-resumo-item:last-child { border-bottom: none; padding-bottom: 0; }
.opes-resumo-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--green-tint); display: grid; place-items: center; font-size: 14px; }
.opes-resumo-meta { font-size: 12px; color: var(--muted); }
.opes-resumo-motivo { font-size: 12.5px; margin-top: 3px; text-wrap: pretty; }

/* ===== BARRA DE ETAPAS + FECHAMENTO MENSAL ===== */
.stepsbar { display: flex; align-items: center; gap: 18px; padding: 12px 18px; background: var(--green-deep); border-radius: 16px; margin: 0 0 4px; }
.sb-left { flex: 1 1 auto; min-width: 120px; display: grid; gap: 6px; }
.sb-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.sb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6ee7a8, #0663AA); transition: width .35s ease; }
.sb-meta { font-size: 11px; color: rgba(255,255,255,.6); }
.sb-meta strong { color: #fff; font-weight: 600; }
.sb-steps { display: flex; gap: 6px; flex-shrink: 0; }
.sb-step { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.55); font-size: 12px; font-weight: 600; display: grid; place-items: center; transition: all .15s; }
.sb-step:hover { background: rgba(255,255,255,.18); color: #fff; }
.sb-step.done { background: rgba(110,231,168,.16); color: #6ee7a8; }
.sb-step.current { background: #fff; color: var(--green-deep); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.sb-pend { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 12px; background: rgba(234,64,77,.14); color: #ffd9dc; flex-shrink: 0; text-align: left; transition: background .15s; }
.sb-pend:hover { background: rgba(234,64,77,.24); }
.sb-pend.ok { background: rgba(110,231,168,.14); color: #c9f5dc; }
.sb-pend.ok:hover { background: rgba(110,231,168,.22); }
.sb-pend-dot { width: 8px; height: 8px; border-radius: 50%; background: #EA404D; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(234,64,77,.18); }
.sb-pend.ok .sb-pend-dot { background: #6ee7a8; box-shadow: 0 0 0 4px rgba(110,231,168,.18); }
.sb-pend-txt { display: grid; font-size: 12px; font-weight: 600; line-height: 1.25; }
.sb-pend-txt em { font-style: normal; font-weight: 500; font-size: 10.5px; opacity: .75; }
@media (max-width: 1000px) {
  .stepsbar { flex-wrap: wrap; gap: 12px; }
  .sb-left { flex-basis: 100%; }
}

.fech-grid { display: grid; gap: 14px; }
.fech-anchor { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border-radius: 14px; background: var(--green-tint); border: 1px solid var(--green-soft); }
.fech-anchor-label { font-size: 13px; font-weight: 600; }
.fech-anchor-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; text-wrap: pretty; }
.fech-dia { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.fech-dia select { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.fech-status { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--pink); color: #7a1a22; font-size: 12px; }
.fech-status strong { font-size: 13px; }
.fech-status.ok { background: #e6f7ee; color: #12603d; }
.fech-hist { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.fech-hist-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.fech-hist-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 12.5px; }
.fech-hist-badge { width: 20px; height: 20px; border-radius: 50%; background: var(--line-2); color: var(--muted); display: grid; place-items: center; font-size: 11px; }
.fech-hist-badge.ok { background: #d8f3e4; color: #12603d; }
.fech-hist-nota { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* ===== RELATÓRIO MENSAL ===== */
.relm-actions { display: flex; gap: 8px; }
.relm-linha { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.relm-linha:last-child { border-bottom: none; }
.relm-linha span { color: var(--muted); }
.relm-pct { font-style: normal; color: var(--green); font-size: 11.5px; margin-left: 4px; }
.relm-h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.relm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.relm-vazio { font-size: 12.5px; color: var(--muted-2); font-style: italic; }
.relm-verdict { display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: center; padding: 16px; border-radius: 14px; background: var(--green-tint); }
.relm-verdict.warn { background: #fff6e5; }
.relm-verdict.bad { background: var(--pink); }
.relm-verdict-nota { font-size: 34px; font-weight: 700; letter-spacing: -1px; text-align: center; line-height: 1; }
.relm-verdict-nota em { display: block; font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); }
.relm-verdict strong { font-size: 15px; }
.relm-verdict p { font-size: 12.5px; color: var(--muted); margin-top: 2px; text-wrap: pretty; }
.relm-verdict-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.relm-verdict-kpis span { background: rgba(255,255,255,.75); border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; }
.relm-rohn { display: grid; gap: 10px; }
.relm-rohn-row { display: grid; grid-template-columns: 150px 1fr 190px 78px; gap: 12px; align-items: center; font-size: 12.5px; }
.relm-rohn-lab em { font-style: normal; color: var(--muted); font-size: 11px; }
.relm-rohn-val { text-align: right; font-weight: 600; }
.relm-rohn-val em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 11px; }
.relm-tag { justify-self: end; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 999px; background: #e6f7ee; color: #12603d; }
.relm-rohn-row.bad .relm-tag { background: var(--pink); color: #7a1a22; }
.relm-obj { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.relm-obj:last-child { border-bottom: none; }
.relm-obj strong { font-size: 13.5px; }
.relm-obj span { display: block; font-size: 11.5px; color: var(--muted); }
.relm-obj p { font-size: 12.5px; margin-top: 3px; text-wrap: pretty; }
.relm-relato p { font-size: 13px; margin-bottom: 8px; text-wrap: pretty; }
.relm-sug { display: grid; gap: 9px; padding-left: 20px; }
.relm-sug li { font-size: 13px; text-wrap: pretty; }
@media (max-width: 900px) { .relm-cols { grid-template-columns: 1fr; } .relm-rohn-row { grid-template-columns: 1fr; gap: 4px; } }
.relm-rohn-row.na .relm-tag { background: var(--line-2); color: var(--muted); }
.relm-rohn-row.na { opacity: .75; }
.opes-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 6px 0 -4px; }
.obj-origem { font-size: 11px; color: var(--green); font-weight: 600; }
.obj-definir { align-self: start; font-size: 11.5px; font-weight: 600; color: var(--green); background: var(--green-tint); border-radius: 999px; padding: 5px 11px; }
.obj-definir:hover { background: var(--green-soft); }
.opes-confirm-row { display: grid; gap: 6px; margin-top: 2px; }
.opes-confirm { width: 100%; justify-content: center; }
.opes-confirm-hint { font-size: 11px; color: var(--muted); }
.opes-flash-msg { font-style: normal; color: var(--green); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.obj-card.flash { animation: objFlash 2.2s ease; }
@keyframes objFlash { 0%,55% { box-shadow: 0 0 0 3px var(--green); } 100% { box-shadow: var(--shadow); } }

/* ===== STATUS DO ORÇAMENTO (barra 0 → gasto total, segmentada por classe) ===== */
.ckp-status-wrap { position: relative; margin-top: 18px; }
.res-bar.ckp-status { display: flex; }
.ckp-seg { height: 100%; min-width: 2px; transition: width .4s cubic-bezier(.16,1,.3,1); }
.ckp-seg.seg-redutivel { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 5px, transparent 5px 10px); }
.res-bar.ckp-status .res-tick { z-index: 2; }
.ckp-meta-tick { position: absolute; top: 0; }
.ckp-meta-tick span { position: absolute; top: -15px; left: 0; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; letter-spacing: .02em; }
.ckp-meta-tick.tick-rec span { top: auto; bottom: -30px; color: var(--muted); }
.proj-over .ckp-meta-tick:not(.tick-rec) span { color: #b32b3c; }
.ckp-scale { margin-top: 34px; }
.ckp-scale span { white-space: nowrap; }
.ckp-cls-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 11.5px; color: #4b5563; }
.ckp-cls-legend span { white-space: nowrap; }
.ckp-cls-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ckp-cls-legend strong { font-variant-numeric: tabular-nums; }
.ckp-cls-legend .leg-redutivel { font-weight: 700; }
.ckp-scale { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ckp-receita { font-weight: 700; color: var(--ink); }

/* ===== CONFRONTO MANUAL × FATURA ===== */
.ck-cf { padding: 0; overflow: hidden; }
.ck-cf.cf-ok { border-color: #cde7d5; }
.ck-cf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 20px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; }
.ck-cf-title h3 { margin: 0 0 2px; font-size: 14.5px; }
.ck-cf-badges { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ck-cf-badges svg { transition: transform .2s; color: var(--muted); }
.ck-cf-badges svg.up { transform: rotate(180deg); }
.cf-badge { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.cf-badge.warn { background: #fdeef0; color: #b32b3c; }
.cf-badge.ask { background: #eef5fb; color: #0663AA; }
.cf-badge.ok { background: #e8f5ec; color: #256c3a; }
.ck-cf-body { padding: 0 20px 16px; border-top: 1px solid var(--line-2); }
.cf-sec { margin-top: 14px; }
.cf-sec h4 { margin: 0 0 2px; font-size: 13px; }
.cf-hint { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.cf-par { border: 1px solid #f2cdd3; background: #fef7f8; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.cf-par-txs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cf-tx { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.cf-tx .cf-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-tx strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.cf-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.cf-tag.manual { background: #fff3e0; color: #9a5b00; }
.cf-tag.fat { background: #e8f0fe; color: #0663AA; }
.cf-meta { font-size: 11px; color: var(--muted); }
.cf-par-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cf-motivo { font-size: 11px; color: #b32b3c; font-weight: 700; margin-right: auto; }
.btn-ghost.sm, .btn-green.sm { padding: 4px 10px; font-size: 12px; }
.btn-ghost.keep { color: #256c3a; }
.cf-cat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.cf-cat:last-child { border-bottom: 0; }
.cf-cat.done .cf-cat-q { color: #256c3a; }
.cf-cat-q .cf-meta { display: block; margin-top: 1px; }
@media (max-width: 720px) { .cf-par-txs { grid-template-columns: 1fr; } }

/* Filtro por classe/categoria no grupo Gastos */
.ck-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.ckf-chip { font: inherit; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: #4b5563; cursor: pointer; white-space: nowrap; }
.ckf-chip:hover { border-color: #b8c2cc; }
.ckf-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ckf-cat { font: inherit; font-size: 11.5px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: #4b5563; max-width: 200px; }
.ckf-sum { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Análise: receitas × despesas do mês */
.an-mes-nav { display: flex; gap: 6px; }
.an-mes-row { display: grid; grid-template-columns: 76px 1fr 130px; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; }
.an-mes-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.an-mes-label { color: var(--muted); font-weight: 600; }
.an-mes-bar { position: relative; height: 18px; background: #f1f3f4; border-radius: 999px; overflow: hidden; }
.an-mes-bar .amb-in { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #16a34a, #4ade80); }
.an-mes-bar .amb-out { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1f2937, #4b5563); }
.an-mes-bar .amb-out.over { background: linear-gradient(90deg, #991b1b, #dc2626); }
.an-mes-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 12.5px; color: #4b5563; }
.an-mes-foot strong { font-variant-numeric: tabular-nums; }
.an-mes-foot .in, .an-mes-row .in { color: #16a34a; }
.an-mes-foot .out, .an-mes-row .out { color: #b32b3c; }
.an-flag { font-weight: 700; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; }
.an-flag.good { background: #e8f5ec; color: #256c3a; }
.an-flag.warn { background: #fdf3e0; color: #9a5b00; }
.an-flag.bad { background: #fdeef0; color: #b32b3c; }

/* Seção Família */
.fs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 12px; }
.fs-item { padding: 12px 14px; background: #f8f9fa; border-radius: 10px; border: 1px solid var(--line-2); }
.fs-label { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.fs-item strong { display: block; font-size: 14px; margin-bottom: 2px; }
.fs-meta { display: block; font-size: 11.5px; color: #666; }

/* Guia da etapa (painel direito) */
.rp-guia { background: linear-gradient(135deg, #f2f8fd, #eef5fb); border: 1px solid #c4dcee; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.rp-guia-head { font-size: 12.5px; font-weight: 700; color: #0663AA; display: flex; align-items: center; gap: 6px; }
.rp-guia-texto { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: #37516a; }

/* Fechamento do mês */
.ck-fech { padding: 16px 20px; }
.ck-fech.is-fechado { border-color: #cde7d5; background: #f7fcf8; }
.ckf-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ckf-head h3 { margin: 0; font-size: 15px; }
.ckf-data { font-size: 12px; color: var(--muted); }
.ckf-reqs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12.5px; color: #6b7280; }
.ckf-req.ok { color: #256c3a; font-weight: 600; }
.ckf-bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.ckf-bar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #16a34a, #4ade80); transition: width .4s cubic-bezier(.16,1,.3,1); }
.ckf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.ckf-preview { font-size: 13px; color: #4b5563; font-variant-numeric: tabular-nums; }
.ckf-foot .btn-green:disabled { opacity: .45; cursor: not-allowed; }
.ckf-nums { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 12px 0 14px; font-size: 13px; color: #4b5563; }
.ckf-nums strong, .ckf-preview strong { font-variant-numeric: tabular-nums; }
.ckf-nums .in, .ckf-preview .in { color: #16a34a; }
.ckf-nums .out, .ckf-preview .out { color: #b32b3c; }

/* ===== HEADER ÚNICO ESCURO (nav + etapas + progresso + fechamento) ===== */
.topnav.tn-dark { flex-wrap: wrap; background: var(--green-deep); border-radius: 16px; padding: 12px 16px; margin-bottom: 6px; }
.tn-dark .tn-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.tn-dark .brand-name { color: #fff; }
.tn-dark .tn-tab { color: rgba(255,255,255,.85); position: relative; }
.tn-dark .tn-tab:hover { background: rgba(255,255,255,.1); color: #fff; }
.tn-dark .tn-tab.active { background: #fff; color: var(--green-deep); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tn-num { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 5px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.75); font-size: 9.5px; font-weight: 700; margin-right: 4px; flex-shrink: 0; }
.tn-num.done { background: rgba(110,231,168,.2); color: #6ee7a8; }
.tn-dark .tn-tab.active .tn-num { background: rgba(49,17,49,.12); color: var(--green-deep); }
.tn-dark .tn-tab.active .tn-num.done { background: rgba(22,163,74,.15); color: #16a34a; }
.tn-dark .btn-relatorio { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.tn-dark .btn-relatorio:hover, .tn-dark .btn-relatorio.active { background: #fff; color: var(--green-deep); }
.tn-dark .circle-btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.tn-dark .circle-btn:hover, .tn-dark .circle-btn.active { background: #fff; color: var(--green-deep); }
.tn-progrow { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.tn-track { flex: 1 1 auto; min-width: 100px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.tn-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6ee7a8, #0663AA); transition: width .35s ease; }
.tn-progmeta { font-size: 11px; color: rgba(255,255,255,.6); white-space: nowrap; }
.tn-progmeta strong { color: #fff; font-weight: 600; }
.tn-dark .sb-pend { padding: 6px 12px; }
@media (max-width: 1000px) { .tn-dark .tn-row { flex-wrap: wrap; } }

/* Cards clicáveis (Visão Geral) */
.card.clickable, .metric-card.clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.card.clickable:hover, .metric-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,35,30,.10); }
/* Etapa pendente: ponto vermelho no emoji da aba */
.tn-dark .tn-tab.pend::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #ea404d; box-shadow: 0 0 0 2px var(--green-deep); }
.tn-dark .tn-tab.pend.active::after { box-shadow: 0 0 0 2px #fff; }

/* LOGIN */
.login-screen{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));background:linear-gradient(160deg,#f2f5f4,#e6eeeb)}
.login-card{width:100%;max-width:380px;background:#fff;border-radius:22px;box-shadow:0 20px 50px rgba(36,17,41,.12);padding:34px 30px;display:flex;flex-direction:column;gap:14px}
.login-logo{font-size:34px;line-height:1}
.login-card h1{font-size:24px;letter-spacing:-.4px}
.login-sub{font-size:13.5px;color:#6b7280;margin-top:-8px;line-height:1.5}
.login-fields{display:flex;flex-direction:column;gap:12px}
.login-field{display:flex;flex-direction:column;gap:6px}
.login-field span{font-size:12px;font-weight:600;color:#374151}
.login-field input{border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:12px 14px;font:inherit;font-size:16px;outline:none;min-height:44px;width:100%}
.login-field input:focus{border-color:var(--green,#16a34a)}
.login-err{font-size:12.5px;color:#b3261e;background:#fdf0f0;border:1px solid #f3c4c8;border-radius:10px;padding:8px 12px}
.login-btn{min-height:48px;border:none;border-radius:12px;background:linear-gradient(135deg,#0E92D2,#0663AA);color:#fff;font:inherit;font-weight:700;font-size:14.5px;cursor:pointer;letter-spacing:-.1px}
.login-btn:hover{filter:brightness(1.05)}
.login-btn:disabled{opacity:.6;cursor:default}
.login-back{background:none;border:none;font:inherit;font-size:12.5px;color:#6b7280;cursor:pointer;min-height:44px}
.login-back:hover{color:#111827}
.login-hint{font-size:11.5px;color:#9ca3af;text-align:center;margin-top:2px}

/* ACCOUNT CHIP (usuário logado) */
.account-chip{display:flex;align-items:center;gap:9px;border:1px solid var(--line,#e5e7eb);border-radius:999px;padding:4px 6px 4px 5px;background:#fff;min-width:0}
.account-info{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.account-info strong{font-size:12.5px;letter-spacing:-.1px}
.account-info small{font-size:10.5px;color:#9ca3af;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.btn-logout{border:1px solid var(--line,#e5e7eb);background:#fff;border-radius:999px;font:inherit;font-size:11.5px;font-weight:600;color:#374151;padding:7px 13px;cursor:pointer;flex-shrink:0}
.btn-logout:hover{background:var(--line-2,#f3f4f6)}

/* MOBILE / APP-READY (iOS + Android) */
*{-webkit-tap-highlight-color:transparent}
@media (max-width:900px){
  .topnav-tabs{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .topnav-tabs::-webkit-scrollbar{display:none}
  .subnav{overflow-x:auto;-webkit-overflow-scrolling:touch;flex-wrap:nowrap;scrollbar-width:none}
  .subnav::-webkit-scrollbar{display:none}
  .subnav-tab{white-space:nowrap;flex:0 0 auto;min-height:40px}
  .card{overflow-x:auto}
}
@media (max-width:640px){
  html{-webkit-text-size-adjust:100%}
  .app{padding:8px calc(8px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left))}
  .sheet{padding:12px 10px;border-radius:16px}
  .top-header{flex-wrap:wrap;gap:10px}
  .account-info small{display:none}
  input,select,textarea{font-size:16px}
  .btn-green,.btn-ghost,.btn-logout,.mp-btn,.circle-btn{min-height:44px}
  .circle-btn{width:44px;height:44px}
  .login-card{padding:28px 22px;border-radius:18px}
}

/* GOOGLE SIGN-IN */
.gbtn{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;border:1px solid #dadce0;border-radius:12px;background:#fff;font:inherit;font-weight:600;font-size:14px;color:#3c4043;cursor:pointer;width:100%}
.gbtn:hover{background:#f8faf9;border-color:#c6c9cc}


.gsi-holder{display:flex;justify-content:center;min-height:44px}
.gsi-setup{border:1px solid #e5e7eb;border-radius:12px;padding:14px;background:#fafbfc;text-align:left}
.gsi-setup strong{display:block;font-size:13px;margin-bottom:6px;color:#111827}
.gsi-setup p{margin:0;font-size:12px;line-height:1.55;color:#4b5563}
.gsi-setup code{font-family:ui-monospace,Menlo,monospace;font-size:11.5px;background:#eef1f4;padding:1px 4px;border-radius:4px}
.login-erro{border:1px solid #fecaca;background:#fef2f2;color:#991b1b;border-radius:10px;padding:10px 12px;font-size:12.5px;line-height:1.5}
