/* ==========================================================================
   ECO MARAMBAIA — Central de Reestruturação
   Tema: mangue (verdes profundos), água (azul-petróleo), madeira (terrosos)
   ========================================================================== */
:root {
  --bg: #f3f0e8;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1b2a24;
  --muted: #647268;
  --line: #e4dfd2;
  --green-900: #0f2a24;
  --green-800: #163a31;
  --green-700: #1f5a48;
  --green-500: #2f8a6b;
  --green-100: #dff0e8;
  --water: #2b7a8c;
  --water-100: #dceef2;
  --wood: #9a6b3f;
  --wood-100: #f1e6d8;
  --amber: #c97a12;
  --amber-100: #fbecd2;
  --yellow: #d8ab1c;
  --yellow-100: #fbf3cf;
  --red: #c23b2b;
  --red-100: #fae1dc;
  --black: #1e1e1e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 42, 36, .05), 0 6px 20px rgba(27, 42, 36, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--ink); background: var(--bg); }
body.modal-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green-700); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sp { flex: 1; }
.muted { color: var(--muted); }
.r { text-align: right; }
.pos { color: var(--green-700); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.na { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: #8a6a10; background: var(--yellow-100); border: 1px dashed #d9c06a; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 2px; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #dfe9e3; background: linear-gradient(180deg, var(--green-900), #12332b 60%, #173a30); z-index: 30; }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand strong { display: block; font-size: 14.5px; letter-spacing: .12em; color: #fff; }
.brand span { font-size: 11.5px; color: #9fbbae; letter-spacing: .04em; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #cfeadb; background: rgba(255, 255, 255, .08); flex: none; }
.brand-mark svg { width: 26px; height: 26px; }
#nav { flex: 1; overflow-y: auto; padding: 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #c3d5cb; text-decoration: none; font-size: 13.5px; transition: background .15s, color .15s; }
#nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
#nav a.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #7fd0ae; }
#nav a span { flex: 1; min-width: 0; }
#nav a b { font-size: 11px; background: var(--red); color: #fff; border-radius: 99px; padding: 1px 7px; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 6px; }
.side-foot-title { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8fad9f; }
.side-btn { text-align: left; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #e3eee8; border-radius: 9px; padding: 7px 10px; font-size: 12.5px; }
.side-btn:hover { background: rgba(255, 255, 255, .13); }
.side-btn.danger { color: #ffc5bb; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(243, 240, 232, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 20px; letter-spacing: -.01em; }
.topbar p { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamb { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px 7px 10px; font-weight: 600; font-size: 13px; }
.user-chip:hover { border-color: var(--green-500); }
.view { padding: 22px 28px 60px; display: grid; gap: 16px; align-content: start; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--green-700); color: #fff; }
.btn.primary:hover { background: var(--green-800); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--green-500); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger.ghost { background: var(--surface); color: var(--red); border-color: #ecc5be; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn .ic { width: 15px; height: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.icon-btn:hover { border-color: var(--green-500); color: var(--green-700); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }
.acts { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2, .card > h2 { font-size: 15px; letter-spacing: .01em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; padding: 24px 26px; border-radius: 18px; color: #eaf3ee; background: radial-gradient(120% 140% at 0% 0%, #23604d 0%, var(--green-800) 45%, var(--green-900) 100%); box-shadow: var(--shadow); }
.hero .eyebrow { color: #a9cdbc; }
.hero-pct { font-size: 54px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: #fff; margin: 4px 0 10px; }
.hero p { font-size: 13px; color: #b9d3c7; margin-top: 10px; }
.hero-phases { display: grid; gap: 9px; align-content: center; }
.phase-mini { display: grid; grid-template-columns: 170px 1fr 44px; gap: 12px; align-items: center; font-size: 12.5px; }
.phase-mini b { text-align: right; color: #fff; }
.hero .progress { background: rgba(255, 255, 255, .14); }
.hero .progress i { background: linear-gradient(90deg, #7fd0ae, #cfe8a5); }

.progress { height: 8px; border-radius: 99px; background: #ebe6d9; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--green-500); transition: width .4s ease; }
.progress.big { height: 12px; }
.progress.s-warn i { background: var(--yellow); } .progress.s-crit i { background: var(--red); } .progress.s-zero i { background: var(--black); }
td .progress { margin-top: 5px; height: 5px; min-width: 70px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; display: grid; gap: 3px; padding: 16px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green-500); }
.kpi:hover { transform: translateY(-2px); border-color: #cfc8b6; }
.kpi.wood::before { background: var(--wood); } .kpi.red::before { background: var(--red); } .kpi.water::before { background: var(--water); } .kpi.amber::before { background: var(--amber); }
.kpi-ic { position: absolute; right: 14px; top: 14px; color: #b9b29f; }
.kpi-l { font-size: 12px; font-weight: 600; color: var(--muted); padding-right: 26px; }
.kpi-v { font-size: 23px; letter-spacing: -.02em; line-height: 1.2; }
.kpi-v .na { font-size: 12px; }
.kpi-s { font-size: 11.5px; color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; border-top: 3px solid var(--green-500); }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat strong { font-size: 19px; letter-spacing: -.01em; }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat .btn { justify-self: start; margin-top: 6px; }
.stat.green { border-top-color: var(--green-500); } .stat.red { border-top-color: var(--red); } .stat.amber { border-top-color: var(--amber); }
.stat.wood { border-top-color: var(--wood); } .stat.water { border-top-color: var(--water); } .stat.black { border-top-color: var(--black); }

/* ---------- Gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #ece7da; stroke-width: 1; }
.chart .bar { fill: var(--green-500); }
.chart .bar.wood { fill: var(--wood); } .chart .bar.water { fill: var(--water); }
.chart .bar:hover { opacity: .85; }
.chart .val { font-size: 12px; font-weight: 700; fill: var(--ink); }
.chart .lbl { font-size: 11.5px; fill: var(--muted); }
.chart .line { fill: none; stroke: var(--wood); stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { fill: var(--wood); opacity: .12; }
.chart .dot { fill: #fff; stroke: var(--wood); stroke-width: 2.5; }
.chart-empty { min-height: 180px; display: grid; place-items: center; text-align: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 16px; }
.chart-empty .na { white-space: normal; font-size: 11px; }

/* ---------- Alertas ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.red { background: var(--red); } .dot.orange { background: #e2761b; } .dot.yellow { background: var(--yellow); } .dot.green { background: var(--green-500); }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.alerts a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.alerts a:hover { background: var(--surface-2); }
.legend { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--muted); }
.legend .dot { margin-right: -6px; }

/* ---------- Badges e banners ---------- */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 2px 9px; white-space: nowrap; background: #ece8dd; color: #4d5a52; border: 1px solid transparent; }
.b-gray { background: #ece8dd; color: #4d5a52; }
.b-blue { background: var(--water-100); color: #1c5967; }
.b-amber { background: var(--amber-100); color: #8a5208; }
.b-red { background: var(--red-100); color: #98291c; }
.b-green { background: var(--green-100); color: #1a5341; }
.b-yellow { background: var(--yellow-100); color: #7d6208; }
.b-black { background: var(--black); color: #fff; }
.b-outline { background: transparent; border-color: var(--line); color: var(--muted); }
.status-wrap { display: inline-flex; border-radius: 99px; padding: 0 4px; }
.status-wrap select { border: 0; background: transparent; font-weight: 600; font-size: 12.5px; padding: 4px 4px; color: inherit; }
.inline-sel { border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: var(--surface); font-size: 12.5px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: 12px; font-size: 13.5px; border: 1px solid; }
.banner .ic { margin-top: 1px; }
.banner.yellow { background: var(--yellow-100); border-color: #e6d28a; color: #5f4a05; }
.banner.red { background: var(--red-100); border-color: #ecc0b8; color: #7c2317; }
.banner.green { background: var(--green-100); border-color: #bcdccc; color: #174536; }
.banner.wood { background: var(--wood-100); border-color: #dcc7ab; color: #5e3f1f; }

/* ---------- Barra de ferramentas e tabelas ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select, .search { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; height: 38px; }
.toolbar select { padding: 0 10px; max-width: 220px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 220px; flex: 0 1 300px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }
.search:focus-within { border-color: var(--green-500); }
.tabs, .seg { display: inline-flex; background: #e9e4d6; border-radius: 11px; padding: 3px; gap: 2px; justify-self: start; flex-wrap: wrap; }
.tabs button, .seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs button.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg button { padding: 5px 10px; font-size: 12.5px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card .table-wrap { border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #efeade; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fcfbf7; }
.tbl td.r { white-space: nowrap; }
.tbl td small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; max-width: 320px; }
.tbl td.r small { margin-left: auto; }
.tbl td.acts { display: table-cell; text-align: right; }
.tbl td.acts .icon-btn { margin-left: 4px; }
.tbl tr.row-red { background: #fdf3f1; }
.empty { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 34px 16px; background: var(--surface); border: 1px dashed #d5cebc; border-radius: 12px; color: var(--muted); }
.empty strong { color: var(--ink); font-size: 14px; }
.empty span { font-size: 12.5px; }

/* ---------- Plano de ação e perguntas ---------- */
.roadmap-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.roadmap-top strong { display: block; font-size: 20px; letter-spacing: -.01em; }
.roadmap-top > span { color: var(--muted); font-size: 13px; }
.phase-bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.phase-bar .progress { width: 180px; }
.phase-bar b { font-size: 12px; color: var(--muted); }
.steps, .qlist { list-style: none; margin: 0; padding: 0; }
.steps li, .qlist li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid #efeade; flex-wrap: wrap; }
.step-main, .qmain { flex: 1 1 260px; min-width: 0; }
.step-main strong, .qmain strong { display: block; font-weight: 600; }
.step-main span { font-size: 12.5px; color: var(--muted); }
.steps li.done .step-main strong, .qlist li.done .qmain strong { color: var(--muted); text-decoration: line-through; }
.qmain p { font-size: 13px; margin-top: 2px; white-space: pre-wrap; }
.qmain small { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 3px; }
.qmain small .ic { width: 13px; height: 13px; }
.qbox { width: 20px; height: 20px; border: 2px solid #c9c2b0; border-radius: 6px; display: grid; place-items: center; flex: none; color: #fff; }
.qlist li.done .qbox { background: var(--green-500); border-color: var(--green-500); }
.qbox .ic { width: 13px; height: 13px; stroke-width: 3; }

/* ---------- Equipe ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.person { display: grid; gap: 10px; align-content: start; }
.person header { display: flex; gap: 12px; align-items: center; }
.person header > div { flex: 1; min-width: 0; }
.person header h2 { font-size: 16px; }
.person header span { font-size: 12.5px; color: var(--muted); }
.person h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.person-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person-stats .stat { padding: 8px 10px; }
.person-stats .stat strong { font-size: 18px; }
.person .btn { justify-self: start; }
.note { font-size: 12.5px; color: var(--muted); font-style: italic; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; }
.next { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.next li { display: flex; gap: 8px; align-items: center; }
.next li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green-700); color: #fff; font-size: 10.5px; font-weight: 700; border: 2px solid var(--surface); flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; border: 0; background: linear-gradient(135deg, var(--green-500), var(--water)); }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; background: var(--wood); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kcol { background: #ebe6d9; border-radius: 14px; padding: 10px; min-height: 180px; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.kcol.drop { border-color: var(--green-500); background: #e2ecdf; }
.kcol header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.kcol header h3 { font-size: 13px; flex: 1; }
.kcol header b { font-size: 11.5px; background: rgba(0, 0, 0, .08); border-radius: 99px; padding: 1px 8px; }
.kcards { display: grid; gap: 8px; }
.kempty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 0; }
.kcard { display: grid; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: transform .12s, box-shadow .12s; }
.kcard:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }
.kcard.dragging { opacity: .45; }
.kcard.late { border-left: 3px solid var(--red); }
.kcard strong { font-size: 13.5px; font-weight: 600; }
.kcard-top { display: flex; gap: 5px; flex-wrap: wrap; }
.kcard-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.kcard-meta span { display: inline-flex; gap: 4px; align-items: center; }
.kcard-meta .ic { width: 13px; height: 13px; }
.late-txt { color: var(--red); font-weight: 600; }
.kcard footer { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.move { display: inline-flex; gap: 4px; }
.move .icon-btn { width: 26px; height: 26px; }

/* ---------- Dívidas, compras, decisões, operação, indicadores ---------- */
.ranks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rank h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rank ol { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 6px; }
.rank li { counter-increment: r; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.rank li::before { content: counter(r); width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); flex: none; }
.rank li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pipe { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.pipe:hover, .pipe.on { border-color: var(--green-500); }
.pipe.on { background: var(--green-100); }
.pipe i { grid-row: span 3; width: 28px; height: 28px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 13px; }
.pipe span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pipe b { font-size: 19px; }
.pipe small { font-size: 11.5px; color: var(--muted); }

.ata { display: grid; gap: 14px; }
.decision p { font-size: 13.5px; white-space: pre-wrap; }
.decision .final { margin: 12px 0; padding: 10px 14px; background: var(--surface-2); border-left: 3px solid var(--green-500); border-radius: 0 10px 10px 0; }
.final span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.meta dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }

.model.day { border-top: 4px solid var(--amber); }
.model.night { border-top: 4px solid var(--water); background: linear-gradient(180deg, #f4f8f9, var(--surface) 60%); }
.model-foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.model-foot b { color: var(--ink); font-size: 16px; }

.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ind { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ind span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ind strong { font-size: 21px; letter-spacing: -.01em; min-height: 30px; }
.ind small { font-size: 11.5px; color: var(--muted); }
.ind.missing { background: var(--surface-2); border-style: dashed; }
.ind.missing strong .na { font-size: 10.5px; white-space: normal; }

.stk { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.stk i { width: 11px; height: 11px; border-radius: 50%; background: #b8b2a2; }
.s-ok i { background: var(--green-500); } .s-warn i { background: var(--yellow); } .s-crit i { background: var(--red); } .s-zero i { background: var(--black); }

/* ---------- Calendário ---------- */
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-cell { min-height: 62px; background: var(--surface-2); border: 1px solid #eee9dc; border-radius: 8px; padding: 3px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.cal-cell.off { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--green-500); background: var(--green-100); }
.cal-day { border: 0; background: transparent; text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 1px 3px; border-radius: 5px; }
.cal-day:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.cal-ev { border: 0; background: var(--green-700); color: #fff; border-radius: 5px; font-size: 10.5px; padding: 2px 4px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.off { background: #b8b2a2; text-decoration: line-through; }

/* ---------- Histórico ---------- */
.log h2 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.log ul { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid #efeade; font-size: 13.5px; }
.log li span { flex: 1; min-width: 0; }
.log time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Modal e formulários ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 30, 25, .55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 18px; animation: fade .15s ease; }
.modal { width: min(600px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(820px, 100%); }
.modal.small { width: min(440px, 100%); }
.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal > header h3 { font-size: 16.5px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal > footer { display: flex; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.confirm-text { font-size: 14px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field > label i { color: var(--red); font-style: normal; }
.field small { font-size: 11.5px; color: var(--muted); }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=month], .field input[type=time], .field select, .field textarea {
  width: 100%; border: 1px solid #d8d2c2; border-radius: 9px; padding: 9px 11px; background: #fff; min-height: 40px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47, 138, 107, .15); }
.money-in { display: flex; align-items: center; border: 1px solid #d8d2c2; border-radius: 9px; background: #fff; }
.money-in span { padding: 0 4px 0 11px; color: var(--muted); font-weight: 600; font-size: 13px; }
.money-in input[type=number] { border: 0; box-shadow: none !important; padding-left: 4px; background: transparent; }
.money-in:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47, 138, 107, .15); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px 5px 9px; font-size: 13px; cursor: pointer; background: var(--surface-2); }
.check:has(input:checked) { background: var(--green-100); border-color: #9fcdb8; }
.checklist { display: grid; gap: 6px; }
.cl-row { display: flex; gap: 8px; align-items: center; }
.cl-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green-700); flex: none; }
.field > .btn { justify-self: start; }
.comments { display: grid; gap: 8px; }
.comment { background: var(--surface-2); border-radius: 10px; padding: 8px 11px; font-size: 13px; }
.comment span { color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.comment p { white-space: pre-wrap; margin-top: 2px; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--green-900); color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: fade .2s ease; transition: opacity .3s; max-width: 340px; }
.toast.err { background: var(--red); }
.toast.out { opacity: 0; }

/* ---------- Tela inicial ---------- */
.welcome { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: radial-gradient(120% 90% at 20% 0%, #256551 0%, var(--green-800) 40%, var(--green-900) 100%); }
.welcome-card { width: min(560px, 100%); text-align: center; color: #e6f1eb; display: grid; gap: 6px; justify-items: center; animation: fade .4s ease; }
.brand-mark.lg { width: 72px; height: 72px; border-radius: 22px; margin-bottom: 12px; }
.brand-mark.lg svg { width: 44px; height: 44px; }
.welcome h1 { font-size: clamp(26px, 6vw, 38px); letter-spacing: .16em; color: #fff; }
.welcome h2 { font-size: 13px; letter-spacing: .3em; color: #9fd0b9; font-weight: 600; }
.welcome p { margin: 14px 0 26px; color: #c2d8cd; font-style: italic; }
.welcome h3 { font-size: 12px; letter-spacing: .2em; color: #9fbbae; margin-bottom: 10px; }
.who { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.who button { display: grid; gap: 8px; justify-items: center; min-width: 92px; padding: 14px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07); color: #fff; font-weight: 600; transition: background .15s, transform .15s; }
.who button:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 25; }
  .hamb { display: inline-grid; }
  .hamb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 60px; }
  .grid2, .alerts, .ranks { grid-template-columns: minmax(0, 1fr); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .topbar h1 { font-size: 17px; }
  .topbar p { display: none; }
  .user-chip span { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kpi-grid { gap: 10px; }
  .kpi-v { font-size: 18px; }
  .hero { padding: 18px; }
  .hero-pct { font-size: 42px; }
  .phase-mini { grid-template-columns: 1fr 40px; }
  .phase-mini span { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .overlay { padding: 0; place-items: end stretch; }
  .modal, .modal.wide, .modal.small { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
  .modal > footer { border-radius: 0; }
  .search { flex: 1 1 100%; }
  .toolbar select { flex: 1 1 140px; max-width: none; }
  .toolbar .btn.primary { flex: 1 1 100%; }
  .kanban { grid-template-columns: repeat(5, 82vw); }
  .cal-cell { min-height: 50px; }
  .person-stats .stat strong { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
