:root {
  color-scheme: dark;
  --fundo: #171e19;
  --painel: #212b23;
  --painel-elevado: #253229;
  --menu: #153426;
  --linha: #35443a;
  --texto: #f1f5ed;
  --suave: #b0c2b4;
  --verde: #a7d9ac;
  --laranja: #ffc082;
  --primario: #255b40;
  --raio: .68rem;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); color: var(--texto); line-height: 1.45; }
a { color: var(--verde); text-underline-offset: .18em; }
a:hover { color: var(--texto); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--laranja); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.65rem); line-height: 1.08; letter-spacing: -.045em; }
h2 { font-size: 1.21rem; letter-spacing: -.02em; line-height: 1.25; }
h3 { font-size: .98rem; }
small { font-size: .78em; }
li { margin: .45rem 0; }
[id] { scroll-margin-top: 1.25rem; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.skip-link:focus { position: fixed; z-index: 10; top: 1rem; left: 1rem; background: var(--menu); padding: .65rem; }

.app-shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  align-self: start;
  position: sticky;
  top: 0;
  min-height: 100vh;
  background: var(--menu);
  border-right: 1px solid #244535;
  padding: 0 .85rem 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .66rem;
  min-height: 4.15rem;
  color: var(--texto);
  font-size: 1.03rem;
  font-weight: 750;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar .brand { padding-inline: .55rem; }
.brand-mark {
  position: relative;
  width: 1.47rem;
  height: 1.47rem;
  flex: 0 0 auto;
  border: 1.5px solid var(--laranja);
  border-radius: 50%;
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: .19rem;
  border: 1px solid #f19e5f;
  border-radius: 50%;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: .46rem;
  height: .25rem;
  top: -.19rem;
  right: -.16rem;
  background: var(--verde);
  border-radius: 90% 0;
  transform: rotate(-27deg);
}
.side-nav { display: flex; flex-direction: column; gap: .32rem; margin-top: 1.15rem; }
.side-nav a {
  min-height: 2.7rem;
  display: flex;
  align-items: center;
  gap: .62rem;
  padding: .55rem .65rem;
  border-radius: .46rem;
  color: #c4d5c9;
  font-size: .88rem;
  text-decoration: none;
}
.side-nav a:hover { background: #214331; color: var(--texto); }
.side-nav a[aria-current="page"] { color: var(--texto); background: #2b4b38; font-weight: 675; }
.nav-icon {
  min-width: 1.18rem;
  color: #a7c4b1;
  font-size: 1.13rem;
  line-height: 1;
  text-align: center;
}
.side-nav a[aria-current="page"] .nav-icon { color: var(--laranja); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  min-height: 4.15rem;
  background: var(--painel);
  border-bottom: 1px solid #2d3a30;
  padding: .2rem clamp(1.12rem, 3vw, 2.5rem);
}
.empresa, .top-actions { display: flex; align-items: center; gap: .68rem; }
.empresa { font-size: .93rem; font-weight: 680; }
.top-actions { font-size: .84rem; }
.top-actions a { color: var(--suave); text-decoration: none; }
.top-actions form { margin: 0; }
.leaf {
  display: inline-block;
  width: .86rem;
  height: .56rem;
  border: 1.4px solid var(--verde);
  border-radius: 90% 0;
  transform: rotate(-24deg);
  flex: 0 0 auto;
}
main { width: min(100%, 90rem); margin: auto; padding: clamp(1.1rem, 3vw, 2.5rem); }
main.standalone { max-width: 32rem; padding-top: clamp(2rem, 8vw, 5rem); }
main > nav:not(.side-nav) { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; font-size: .88rem; }
section {
  min-width: 0;
  margin-bottom: 1rem;
  padding: clamp(.9rem, 2vw, 1.38rem);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--painel);
}
section:target { border-color: #80ab8c; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
label { display: block; margin: .55rem 0; }
input, select, textarea {
  max-width: 100%;
  min-height: 2.42rem;
  padding: .45rem .59rem;
  color: var(--texto);
  border: 1px solid #52665a;
  border-radius: .38rem;
  background: #19231d;
}
input[type="radio"], input[type="checkbox"] { min-height: auto; accent-color: #87c493; }
input::placeholder { color: #a8bcae; opacity: 1; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .43rem;
  min-height: 2.52rem;
  padding: .48rem .8rem;
  border: 1px solid transparent;
  border-radius: .43rem;
  background: var(--primario);
  color: #f6fbf6;
  font-size: .86rem;
  line-height: 1.2;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #316f50; color: white; }
.button-secondary { background: transparent; border-color: #465a4b; color: var(--texto); }
.button-secondary:hover { background: #304438; }
.button-quiet { min-height: 2rem; padding: .3rem .5rem; background: transparent; color: var(--verde); }
.button-quiet:hover { background: #314438; }
.button-icon { font-size: 1.3em; line-height: 1; font-weight: 400; }
fieldset { min-width: 0; border: 1px solid var(--linha); border-radius: .4rem; margin: 0 0 1rem; padding: .65rem 1rem; }
legend { font-weight: 650; }
fieldset label { overflow-wrap: anywhere; }
.errorlist { color: #ffaaa0; }
.helptext, .muted { color: var(--suave); font-size: .87rem; }
.helptext { display: block; margin-top: .33rem; }
.notice { padding: .65rem .85rem; border: 1px solid #425e49; border-radius: .5rem; background: #24392c; }
.notice.error { border-color: #795547; background: #412b25; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: .85rem; margin-bottom: 1.35rem; }
.page-heading h1 { margin: 0; }

.assistente-workspace { display: grid; grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.assistente-historico { border: 1px solid var(--linha); border-radius: var(--raio); background: var(--painel); padding: .8rem; min-width: 0; }
.assistente-historico .button, .chat-pesquisa input { width: 100%; }
.chat-pesquisa { margin: .65rem 0; }
.assistente-historico ul { list-style: none; margin: .35rem 0 0; padding: 0; }
.assistente-historico li { margin: 0; padding: .28rem 0; }
.assistente-historico li a { display: block; overflow-wrap: anywhere; padding: .35rem; border-radius: .35rem; text-decoration: none; }
.assistente-historico li a[aria-current] { background: var(--painel-elevado); font-weight: 650; }
.chat-gestao { margin-bottom: .8rem; font-size: .85rem; }
.chat-gestao summary { color: var(--suave); cursor: pointer; }
.chat-gestao form { margin-top: .45rem; }
.chat-atalhos { margin-bottom: .75rem; }
.assistente-maria { --painel: #202335; --painel-elevado: #303650; --linha: #3d4565; --primario: #484d87; --verde: #c1cbff; }
.assistente-maria .chat-resposta { background: #1c2236; }
.assistente-maria .chat-pergunta { background: #333a59; }
.assistente-maria .button:hover { background: #565e95; }
.side-nav .nav-maria[aria-current="page"] { background: #333a59; }
@media (max-width: 920px) {
  .assistente-workspace { grid-template-columns: minmax(0, 1fr); }
  .assistente-historico ul { max-height: 7rem; overflow: auto; }
}
.chat-financeiro { position: relative; max-width: 54rem; }
.chat-pergunta, .chat-resposta { padding: .85rem 1rem; margin-bottom: 1rem; border-radius: .65rem; background: #19251d; }
.chat-pergunta { margin-left: auto; width: fit-content; max-width: 90%; background: #2a412f; overflow-wrap: anywhere; }
.chat-pergunta p, .chat-resposta p { margin: .35rem 0; }
.chat-resposta .row-actions, .chat-resposta > .button { margin-top: .7rem; }
.chat-indicadores { display: grid; gap: .4rem; margin: .8rem 0; }
.chat-indicadores div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .35rem .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--linha); }
.chat-indicadores dd { margin: 0; font-weight: 650; }
.chat-compose { display: flex; gap: .5rem; align-items: stretch; }
.chat-compose > input { flex: 1; min-width: 0; }
.chat-attach { position: relative; flex: 0 0 auto; }
.chat-attach summary {
  display: grid;
  width: 2.55rem;
  min-height: 2.52rem;
  height: 100%;
  place-items: center;
  border: 1px solid #52665a;
  border-radius: .43rem;
  background: #19231d;
  font-size: 1.55rem;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}
.chat-attach summary::-webkit-details-marker { display: none; }
.chat-attach summary:hover, .chat-attach[open] summary { background: #304438; }
.chat-attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + .4rem);
  z-index: 2;
  width: min(16rem, calc(100vw - 4rem));
  padding: .35rem;
  border: 1px solid #52665a;
  border-radius: .5rem;
  box-shadow: 0 .6rem 1.5rem #0c130e90;
  background: var(--painel-elevado);
}
.chat-attach-menu label { margin: 0; padding: .55rem .6rem; border-radius: .35rem; font-size: .9rem; cursor: pointer; }
.chat-attach-menu label:hover { background: #304438; }
.chat-attach-menu label:focus-within { outline: 2px solid var(--laranja); outline-offset: -2px; }
.chat-attach-menu p { margin: .2rem .6rem .4rem; font-size: .78rem; }
.chat-selecao { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .55rem; padding: 0; list-style: none; }
.chat-selecao[hidden] { display: none; }
.chat-selecao li {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: .15rem .2rem .15rem .55rem;
  border: 1px solid #52665a;
  border-radius: .4rem;
  background: var(--painel-elevado);
  font-size: .85rem;
}
.chat-selecao li span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-remove { min-height: 1.75rem; padding: .15rem .45rem; background: transparent; font-size: 1rem; }
.chat-drop-overlay {
  display: none;
  position: absolute;
  inset: .4rem;
  z-index: 3;
  place-items: center;
  margin: 0;
  border: 2px dashed var(--verde);
  border-radius: .6rem;
  background: #19251df0;
  color: var(--verde);
  font-weight: 700;
  pointer-events: none;
}
.chat-financeiro.is-dragging .chat-drop-overlay { display: grid; }
.chat-texto { white-space: pre-line; overflow-wrap: anywhere; }
.chat-anexos { margin-bottom: 1rem; }
.chat-progresso progress { width: 100%; height: 1rem; accent-color: var(--verde); }
.chat-progresso [data-contagem] { margin: .45rem 0; color: var(--suave); font-size: .87rem; }
.chat-progresso [data-atividade] { max-height: 14rem; overflow: auto; }
.chat-progresso [data-resposta] { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--linha); }
.chat-progresso [data-retomar] { margin-top: .65rem; }
.chat-resposta, .chat-progresso [data-resposta] { scroll-margin-top: 1.4rem; }
.maria-resumo div { display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr); gap: .3rem .7rem; }
.maria-resumo dt { font-weight: 650; }
.maria-resumo dd { color: var(--suave); font-weight: 450; overflow-wrap: anywhere; }
.financial-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .85rem; }
.financial-cards h2 { color: var(--suave); font-size: .9rem; }
.financial-cards strong { font-size: clamp(1.35rem, 3vw, 1.95rem); letter-spacing: -.03em; }
.financial-cards p, .table-scroll + p { margin: .5rem 0 0; }
.table-scroll { overflow-x: auto; margin-top: .7rem; }
.financial-table { border-collapse: collapse; width: 100%; font-size: .87rem; }
.financial-table :is(td, th) { padding: .62rem .6rem; border-bottom: 1px solid var(--linha); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.financial-table :is(th:first-child, td:nth-child(2)) { text-align: left; }
.financial-table thead, .financial-table tfoot, .selected-month { background: var(--painel-elevado); }
.financial-table tfoot { font-weight: 700; }
.cut-workspace { display: grid; grid-template-columns: minmax(14rem, 20rem) minmax(0, 1fr); gap: 1.06rem; align-items: start; }
.cut-browser { min-width: 0; }
.cut-search {
  display: flex;
  align-items: center;
  gap: .42rem;
  min-height: 2.7rem;
  padding: .18rem .36rem .18rem .8rem;
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: .48rem;
}
.cut-search:focus-within { border-color: #8ebc9a; }
.cut-search input { flex: 1; min-width: 0; min-height: 2rem; padding: .23rem; border: 0; background: transparent; font-size: .89rem; }
.search-icon { width: .72rem; height: .72rem; flex: 0 0 auto; position: relative; border: 1.4px solid var(--suave); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; top: .54rem; left: .54rem; width: .28rem; height: 1px; transform: rotate(45deg); background: var(--suave); }
.list-heading { display: flex; align-items: center; justify-content: space-between; margin: .94rem .18rem .48rem; }
.list-heading h2 { margin: 0; font-size: .85rem; }
.list-heading span { color: var(--suave); font-size: .79rem; }
.clear-search { display: inline-block; margin: 0 .18rem .55rem; font-size: .82rem; }
.cut-list { display: flex; flex-direction: column; gap: .51rem; }
.cut-item {
  display: grid;
  gap: .27rem;
  padding: .75rem .82rem;
  border: 1px solid var(--linha);
  border-radius: .55rem;
  color: var(--texto);
  background: var(--painel);
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.cut-item:hover { background: var(--painel-elevado); border-color: #577361; }
.cut-item[aria-current="true"] { background: #2a3e30; border-color: #82ac8c; }
.cut-item strong { font-size: .95rem; letter-spacing: -.015em; }
.cut-item-footer { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: space-between; align-items: center; margin-top: .25rem; font-size: .82rem; }
.list-empty { margin: 0; padding: .82rem; border: 1px dashed var(--linha); border-radius: .55rem; color: var(--suave); font-size: .87rem; }
.badge { display: inline-flex; align-items: center; padding: .15rem .53rem; border-radius: 2rem; font-size: .75rem; font-weight: 670; white-space: nowrap; }
.badge.success { background: #304837; color: #b4e5ba; }
.badge.warning { background: #4a3622; color: var(--laranja); }

.cut-detail { padding: clamp(.9rem, 1.8vw, 1.4rem); }
.detail-header, .detail-actions, .block-heading, .row-actions { display: flex; align-items: center; gap: .52rem; }
.detail-header, .block-heading { justify-content: space-between; }
.detail-header { align-items: flex-start; }
.detail-header h2 { margin: 0 0 .28rem; font-size: clamp(1.33rem, 2vw, 1.75rem); overflow-wrap: anywhere; }
.detail-header p { margin: 0; overflow-wrap: anywhere; }
.detail-actions, .row-actions { flex-wrap: wrap; }
.detail-actions { justify-content: flex-end; flex: 0 0 auto; }
.cut-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: 1.02rem 0 0;
  padding: .88rem 0;
  border-block: 1px solid var(--linha);
}
.cut-metrics dt { color: var(--suave); font-size: .79rem; }
.cut-metrics dd { margin: .12rem 0 0; font-size: clamp(1.12rem, 2vw, 1.45rem); font-weight: 760; letter-spacing: -.025em; overflow-wrap: anywhere; }
.cut-metrics dd small { color: var(--suave); font-size: .68em; }
.weight-note { margin: .65rem 0 0; color: var(--laranja); font-size: .83rem; }
.weight-note span { display: inline-block; width: .43rem; height: .43rem; margin: 0 .3rem .1rem 0; border-radius: 50%; background: currentColor; }
.detail-block { margin-top: 1.17rem; }
.block-heading { min-height: 2.48rem; flex-wrap: wrap; }
.block-heading h3, .block-title { margin: 0; font-size: .96rem; font-weight: 700; }
.inline-editor summary { cursor: pointer; list-style: none; }
.inline-editor summary::-webkit-details-marker { display: none; }
.inline-editor summary:hover .button { background: #304438; }
.inline-editor[open] summary .button > span { transform: rotate(45deg); }
.inline-form { margin: .58rem 0; padding: .8rem; border: 1px solid var(--linha); border-radius: .5rem; background: #19251d; }
.inline-form h3 { margin-bottom: 0; }
.form-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 0 .7rem; }
.form-columns input { width: 100%; }
.detail-list { margin: .2rem 0 0; padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 0; padding: .59rem 0; border-bottom: 1px solid var(--linha); font-size: .87rem; overflow-wrap: anywhere; }
.detail-list li strong { font-weight: 650; }
.detail-list li > div:first-child { min-width: 0; }
.file-label { display: block; }
.detail-footer { margin: .92rem 0 0; }
.invoice-tabs { margin-block: 1rem; gap: 1rem; }
.invoice-tabs [aria-current="page"] { color: var(--texto); font-weight: 700; }
.invoice-config { margin-block: 1rem; }
.invoice-config summary { cursor: pointer; }
.invoice-config form { margin-top: .65rem; }
.invoice-item, .invoice-lines fieldset { margin: 0 0 .8rem; padding: .7rem .9rem; border: 1px solid var(--linha); border-radius: .5rem; background: var(--painel); min-width: 0; }
.invoice-item-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .55rem; overflow-wrap: anywhere; }
.invoice-item-heading label { display: inline-flex; align-items: baseline; gap: .35rem; }
.invoice-item p { margin: .38rem 0; }
.invoice-lines .form-columns p:first-child { grid-column: 1 / -1; }
.invoice-lines legend { padding-inline: .35rem; color: var(--suave); }
.cut-empty { display: grid; justify-items: center; align-content: center; min-height: 24rem; padding: 2rem; text-align: center; }
.cut-empty h2 { margin: .95rem 0 .45rem; font-size: 1.35rem; }
.cut-empty p { max-width: 32ch; color: var(--suave); }
.empty-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border: 1px solid #4b6954; border-radius: .85rem; background: #2a412f; }
.empty-icon .leaf { width: 1.15rem; height: .77rem; }
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 11.2rem minmax(0, 1fr); }
  .sidebar { padding-inline: .57rem; }
  .cut-workspace { grid-template-columns: minmax(12rem, 32%) minmax(0, 1fr); gap: .75rem; }
  .detail-actions { align-items: flex-end; flex-direction: column; gap: .25rem; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; min-height: auto; border-right: 0; padding: 0 .8rem .5rem; }
  .brand { min-height: 3rem; }
  .side-nav { flex-direction: row; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #496b56 transparent; margin: 0; padding: .15rem; }
  .side-nav a { min-height: 2.24rem; white-space: nowrap; }
  .topbar { min-height: 3.15rem; }
  .cut-workspace { grid-template-columns: minmax(0, 1fr); }
  .cut-list { max-height: 14rem; overflow: auto; padding: .17rem; margin: -.17rem; }
  .detail-actions { flex-direction: row; align-items: center; max-width: 50%; }
}
@media (max-width: 400px) {
  .page-heading { flex-wrap: wrap; }
  .detail-actions { flex-direction: column; align-items: flex-end; }
  .cut-metrics dt { font-size: .72rem; }
}
