:root {
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-800: #9a3412;
  --orange-900: #7c2d12;

  --bg: #fffaf5;
  --surface: #ffffff;
  --text: #2b1a0e;
  --muted: #7a6656;
  --border: #f1e2d3;
  --primary: var(--orange-500);
  --primary-dark: var(--orange-600);

  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #dc2626;
  --bad-bg: #fee2e2;
  --info: #475569;
  --info-bg: #f1f5f9;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(124, 45, 18, .06), 0 4px 16px rgba(124, 45, 18, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--orange-600), var(--orange-700));
  color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 0 8px 20px; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; color: #ffe8d6; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 500;
}
.nav-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-btn.active { background: #fff; color: var(--orange-700); font-weight: 600; }
.nav-btn .count { margin-left: auto; background: rgba(255,255,255,.25); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.nav-btn.active .count { background: var(--orange-100); }
.sidebar .spacer { flex: 1; }
.user-box { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.12); }
.user-box .name { font-weight: 600; font-size: 14px; }
.user-box .role { font-size: 12px; color: #ffd7b8; }
.user-box button { margin-left: auto; }

.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head .grow { flex: 1; min-width: 220px; }

/* ---------- Componentes ---------- */
.btn {
  border: 1px solid transparent; background: var(--primary); color: #fff; padding: 9px 16px;
  border-radius: 10px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--orange-700); border-color: var(--orange-200); }
.btn.secondary:hover { background: var(--orange-50); }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 8px; }
.btn.ghost:hover { background: var(--orange-50); color: var(--orange-700); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; width: 30px; height: 30px; border-radius: 8px;
  display: inline-grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--orange-100); color: var(--orange-700); }
.sidebar .icon-btn { color: #ffe8d6; }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
svg.i { width: 18px; height: 18px; flex: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }

.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 9px 12px; outline: none;
}
.input:focus { border-color: var(--orange-400); box-shadow: 0 0 0 3px var(--orange-100); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.done { color: var(--orange-700); background: var(--orange-100); }

.progress { height: 8px; background: var(--orange-100); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--orange-400), var(--orange-600)); border-radius: 99px; transition: width .3s; }
.progress.thin { height: 5px; }
.progress-wrap { position: relative; }
.progress-wrap .expected { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .45; border-radius: 2px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff;
  font-size: 11px; font-weight: 700; flex: none; border: 2px solid #fff;
}
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 6px; }

/* ---------- Painel ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 2px; }
.stat.accent { background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); color: #fff; border: 0; }
.stat.accent .label { color: #ffe3cc; }

.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; }
.section-title .grow { flex: 1; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border); background: #fff; padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--orange-500); border-color: var(--orange-500); color: #fff; }
.toolbar .input { max-width: 240px; padding: 6px 12px; }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 14px; }
.project-card { padding: 18px; cursor: pointer; transition: transform .1s, box-shadow .15s; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--primary); }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,45,18,.12); }
.project-card h3 { font-size: 16px; }
.project-card .desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.project-card .pct { font-size: 24px; font-weight: 700; color: var(--orange-600); }
.project-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.project-card .meta .grow { flex: 1; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover .title { color: var(--orange-700); }
.due { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.due.over { color: var(--bad); }
.due.soon { color: var(--warn); }

/* ---------- Projeto ---------- */
.back { margin-bottom: 10px; }
.proj-header { padding: 22px; margin-bottom: 18px; border-top: 5px solid var(--primary); }
.proj-header .top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.proj-header h1 { font-size: 24px; }
.proj-header .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.proj-kpis { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 14px; margin-top: 18px; align-items: end; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 22px; font-weight: 700; }
.kpi .value.bad { color: var(--bad); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }

.stage { margin-bottom: 14px; overflow: hidden; }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--orange-50); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.stage-head h3 { font-size: 16px; }
.stage-head .grow { flex: 1; min-width: 150px; }
.stage-head .progress { width: 140px; }
.stage-head .pct { font-weight: 700; color: var(--orange-700); width: 42px; text-align: right; }
.stage-body { padding: 6px 10px 10px; }
.stage-number { width: 28px; height: 28px; border-radius: 8px; background: var(--orange-500); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; flex: none; }

.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 26px; border-left: 2px dashed var(--orange-200); margin-left: 14px; }
.node-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; min-height: 38px; }
.node-row:hover { background: var(--orange-50); }
.node-row .title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.node-row.is-done .title { text-decoration: line-through; color: var(--muted); }
.node-row .tools { display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.node-row:hover .tools, .node-row:focus-within .tools { opacity: 1; }
.node-row .mini-progress { width: 60px; }
.node-row .note-ico { color: var(--orange-400); }
.caret { width: 22px; height: 22px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; border-radius: 6px; flex: none; }
.caret:hover { background: var(--orange-100); }
.caret.placeholder { visibility: hidden; }

.check {
  appearance: none; width: 20px; height: 20px; border: 2px solid var(--orange-300); border-radius: 6px; cursor: pointer; flex: none;
  display: grid; place-items: center; background: #fff; margin: 0;
}
.check:checked { background: var(--orange-500); border-color: var(--orange-500); }
.check:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.partial { background: var(--orange-100); }
.check.partial::after { content: ""; width: 8px; height: 2px; background: var(--orange-500); }

.add-row { display: flex; gap: 6px; padding: 6px 6px 0 36px; }
.add-row .input { padding: 6px 10px; font-size: 14px; }

/* ---------- Tarefas / Equipe / Atividade ---------- */
.group { margin-bottom: 20px; }
.group h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.task-line { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.task-line:last-child { border-bottom: 0; }
.task-line .grow { flex: 1; min-width: 0; }
.task-line .path { font-size: 12px; color: var(--muted); }
.task-line.is-done .t { text-decoration: line-through; color: var(--muted); }
.path a { cursor: pointer; text-decoration: none; }
.path a:hover { text-decoration: underline; }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.member { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.member .head { display: flex; align-items: center; gap: 12px; }
.member .head .grow { flex: 1; min-width: 0; }
.member .nums { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; background: var(--orange-50); border-radius: 10px; padding: 10px 4px; }
.member .nums b { display: block; font-size: 20px; }
.member .nums span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }

.feed-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-hero { background: linear-gradient(140deg, var(--orange-400), var(--orange-700)); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-hero h1 { font-size: 38px; }
.auth-hero ul { padding-left: 20px; margin: 0; color: #ffeadb; line-height: 1.9; }
.auth-form { display: grid; place-items: center; padding: 30px; }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h2 { margin-bottom: 4px; font-size: 24px; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0; min-height: 1.2em; }

/* ---------- Modal / Toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(43, 26, 14, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.modal { width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 19px; margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); animation: fade .15s; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-kpis { grid-template-columns: 1fr 1fr; }
  .proj-kpis .kpi:first-child { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .brand { padding: 4px 8px; width: 100%; }
  .nav-btn { width: auto; }
  .sidebar .spacer { display: none; }
  .user-box { width: 100%; }
  .main { padding: 18px 16px 50px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 30px; }
  .node-row .tools { opacity: 1; }
  .stage-head .progress { width: 80px; }
}

/* ---------- Página pública do cliente ---------- */
.pub { min-height: 100vh; padding-bottom: 50px; }
.pub-wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.pub-hero { background: linear-gradient(140deg, var(--orange-500), var(--orange-700)); color: #fff; padding: 40px 0 80px; }
.pub-hero h1 { font-size: 32px; margin-top: 6px; }
.pub-summary { margin-top: -54px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; padding: 24px; }
.pub-ring {
  width: 150px; height: 150px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--orange-500) calc(var(--p) * 1%), var(--orange-100) 0);
}
.pub-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; }
.pub-ring b { font-size: 32px; color: var(--orange-600); line-height: 1; }
.pub-ring span { font-size: 12px; color: var(--muted); }
.pub-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.pub-facts > div { background: var(--orange-50); border-radius: 10px; padding: 10px 12px; }
.pub-facts span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.pub-facts b { font-size: 17px; }
.pub-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--orange-300); display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.pub-check.on { background: var(--orange-500); border-color: var(--orange-500); }
@media (max-width: 700px) {
  .pub-facts { grid-template-columns: 1fr 1fr; }
  .pub-summary { justify-content: center; }
}

/* ---------- Gerenciar acesso ---------- */
.pick { display: flex; align-items: center; gap: 8px; padding: 5px 4px; cursor: pointer; border-radius: 8px; }
.pick:hover { background: var(--orange-50); }
.pick input[type=radio] { accent-color: var(--orange-500); width: 16px; height: 16px; }
.pick .check:disabled { opacity: .55; cursor: default; }
.pick-box { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.pick-kids { padding-left: 24px; }
.stage-pick { font-weight: 600; color: var(--orange-700); }

/* ---------- Financeiro ---------- */
.fin-card { border-left: 4px solid var(--ok); }
.fin-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.fin-grid > div { background: var(--orange-50); border-radius: 10px; padding: 10px 12px; }
.fin-grid > div > span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.fin-grid b { font-size: 16px; }
.fin-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.fin-label b { color: var(--orange-700); font-weight: 600; }
.fin-row { display: grid; grid-template-columns: 1fr 130px 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.fin-row.pay { grid-template-columns: 145px 1fr 120px auto 30px; }
.fin-row .input { padding: 7px 10px; }
.money { text-align: right; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fin-table th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fin-table tfoot td { font-weight: 700; background: var(--orange-50); border-bottom: 0; }
@media (max-width: 1100px) { .fin-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
  .fin-grid { grid-template-columns: 1fr 1fr; }
  .fin-row.pay { grid-template-columns: 1fr 1fr; }
}

/* ---------- Financeiro: painel visual ---------- */
.fin-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.fin-tile { padding: 14px 16px; position: relative; }
.fin-tile .ft-ico { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--orange-50); color: var(--orange-600); }
.fin-tile .label { font-size: 12px; color: var(--muted); font-weight: 600; padding-right: 34px; }
.fin-tile .value { font-size: 20px; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.fin-tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fin-tile.accent { background: linear-gradient(135deg, var(--orange-500), var(--orange-700)); color: #fff; border: 0; }
.fin-tile.accent .label, .fin-tile.accent .sub { color: #ffe3cc; }
.fin-tile.accent .ft-ico { background: rgba(255,255,255,.2); color: #fff; }
.fin-tile.pos { border-left: 4px solid #0d9488; }
.fin-tile.neg { border-left: 4px solid var(--bad); }
.fin-tile.neg .value { color: var(--bad); }

.fin-charts { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 20px; align-items: start; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ch-wrap { position: relative; }
.ch-empty { position: absolute; inset: 0 0 34px 64px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.ch-grid { stroke: #f1e7dd; stroke-width: 1; }
.ch-base { stroke: #d9c8b8; stroke-width: 1; }
.ch-ref { stroke: var(--muted); stroke-width: 2; }
.ch-axis { font-size: 11px; fill: var(--muted); }
.ch-now { fill: var(--orange-700); font-weight: 700; }
.ch-val { font-size: 11px; font-weight: 700; fill: var(--text); }
.ch-hit { cursor: default; outline: none; }
.ch-hit:hover, .ch-hit:focus { fill: rgba(249,115,22,.06); }
.ch-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ch-legend .hatch-key { background: repeating-linear-gradient(45deg, #fb923c 0 2px, #fdd5b4 2px 4px); }
.ch-legend .line-key { height: 2px; width: 16px; border-radius: 1px; background: var(--muted); }
.ch-table summary { cursor: pointer; font-size: 13px; color: var(--orange-700); font-weight: 600; margin-top: 8px; }
.ch-table .fin-table td, .ch-table .fin-table th { padding: 7px 10px; }

.ch-tip { position: fixed; z-index: 80; pointer-events: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; box-shadow: 0 8px 24px rgba(43,26,14,.15); font-size: 13px; min-width: 170px; }
.ch-tip .tt-title { font-weight: 700; margin-bottom: 4px; }
.ch-tip .tt-row { display: flex; align-items: center; gap: 8px; }
.ch-tip .tt-row i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.ch-tip .tt-row b { min-width: 86px; }
.ch-tip .tt-row span { color: var(--muted); }

.rb { display: flex; flex-direction: column; gap: 6px; }
.rb-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 8px; cursor: pointer; outline: none; }
.rb-row:hover, .rb-row:focus { background: var(--orange-50); }
.rb-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-track { position: relative; height: 18px; }
.rb-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #d9c8b8; }
.rb-bar { position: absolute; top: 3px; height: 12px; background: #0d9488; border-radius: 0 4px 4px 0; min-width: 2px; }
.rb-bar.neg { background: var(--bad); border-radius: 4px 0 0 4px; }
.rb-val { font-size: 13px; font-weight: 600; white-space: nowrap; text-align: right; min-width: 92px; }

.fin-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.fin-proj { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--primary); }
.fin-proj h3 { font-size: 15px; }
.fin-proj h3:hover { color: var(--orange-700); }
.fp-main b { font-size: 20px; color: var(--orange-700); }
.fp-main span { font-size: 13px; }
.fp-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fp-nums > div { background: var(--orange-50); border-radius: 8px; padding: 7px 10px; }
.fp-nums > div > span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.fp-nums b { font-size: 14px; }

.pay-group { margin-bottom: 14px; }
.pay-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-bottom: 4px; border-bottom: 2px solid var(--orange-100); }
.pay-head b { color: var(--text); }
.pay-head .bad-text { color: var(--bad); }
.pay-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pay-item:last-child { border-bottom: 0; }
.pay-item .grow { flex: 1; min-width: 0; }
.pay-item .title { font-weight: 700; }

@media (max-width: 1350px) { .fin-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .fin-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .fin-tiles { grid-template-columns: 1fr 1fr; } .fin-tile .value { font-size: 17px; } }

@media (max-width: 800px) {
  .sidebar { gap: 2px; }
  .nav-btn { padding: 8px 10px; font-size: 14px; }
  .rb-row { grid-template-columns: 90px 1fr auto; }
  .rb-val { min-width: 0; font-size: 12px; }
  .fin-tile .ft-ico { display: none; }
  .fin-tile .label { padding-right: 0; }
}

/* ---------- Reorganizar com IA ---------- */
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; line-height: 1.5; }
.rg-steps { display: flex; gap: 8px; margin-bottom: 16px; }
.rg-step { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted);
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; text-align: left; }
.rg-step span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-700); font-size: 12px; flex: none; }
.rg-step.active { border-color: var(--orange-400); background: var(--orange-50); color: var(--orange-800); }
.rg-step.active span { background: var(--primary); color: #fff; }
.rg-mode { display: flex; gap: 18px; flex-wrap: wrap; margin: -4px 0 12px; }
.rg-mode label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.rg-mode input { accent-color: var(--primary); }
.rg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rg-stats > div { background: var(--orange-50); border-radius: 10px; padding: 8px 10px; }
.rg-stats b { display: block; font-size: 20px; }
.rg-stats span { font-size: 12px; color: var(--muted); }
.rg-stats .neg b { color: var(--bad); }
.rg-alert { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 8px; }
.rg-alert.bad { background: var(--bad-bg); color: var(--bad); }
.rg-alert summary { cursor: pointer; font-weight: 600; }
.rg-alert ul { margin: 6px 0 0; padding-left: 18px; }
.rg-preview { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-height: 280px; overflow: auto; font-size: 13.5px; }
.rp-stage + .rp-stage { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.rg-preview ul { list-style: none; margin: 4px 0 0; padding-left: 18px; }
.rg-preview li { margin: 2px 0; }
.rp-done { color: var(--muted); text-decoration: line-through; }
.rp-meta { font-size: 12px; color: var(--muted); background: var(--info-bg); border-radius: 6px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }
.undo-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; background: var(--orange-50); }
.undo-bar .grow { flex: 1; }
