:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --primary: #18181b;
  --primary-text: #ffffff;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --ok-bg: #dcfce7;
  --ok-text: #166534;
  --info-bg: #e0f2fe;
  --info-text: #075985;
  --danger: #b91c1c;
  --shadow: 0 24px 48px rgba(24, 24, 27, 0.12);
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --sidebar: 240px;
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 16px; font-weight: 600; text-wrap: balance; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand-linha { display: flex; align-items: center; gap: 4px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; flex: 0 1 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { font-weight: 500; font-size: 11px; color: var(--muted); }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark img.logo-encaixar { object-fit: contain; }
.logo-linha { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.logo-linha .field-foto { width: auto; }
.logo-linha .field-logo-modo { width: 168px; }
.brand-config {
  width: 28px;
  height: 28px;
  margin-left: auto;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  color: var(--muted);
}
.brand-config svg { width: 16px; height: 16px; display: block; }
.brand-config:hover, .brand-config.is-active { background: var(--bg); color: var(--text); }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; }
.nav-rotulo {
  margin: 16px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.nav-rotulo:first-child { margin-top: 0; }
.nav a {
  padding: 8px 12px;
  border-radius: var(--radius-control);
  color: var(--muted);
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.is-active { background: var(--bg); color: var(--text); font-weight: 600; }
.sidebar-foot { position: relative; margin-top: auto; }
.profile-trigger {
  width: 100%;
  min-height: 52px;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] { background: var(--bg); border-color: var(--border); }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.profile-identity strong,
.profile-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity strong { font-size: 13px; font-weight: 500; }
.profile-identity small { color: var(--muted); font-size: 11px; }
.profile-chevron { color: var(--muted); transition: transform 150ms ease; }
.profile-trigger[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }
.profile-panel[hidden] { display: none; }
.profile-panel {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 28px rgba(24, 24, 27, 0.12);
}
.profile-panel-title {
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-menu-link {
  display: flex;
  justify-content: space-between;
  padding: 9px 8px;
  border-radius: 6px;
}
.profile-menu-link:hover { background: var(--bg); }
.profile-language {
  margin-top: 4px;
  padding: 8px;
  border-top: 1px solid var(--border);
}
.profile-language > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}
.profile-logout {
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--danger);
  text-align: left;
  cursor: pointer;
}
.profile-logout:hover { background: var(--bg); }
.idiomas { display: flex; gap: 4px; }
.idiomas button {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.idiomas button.is-active { background: var(--text); color: #fff; border-color: var(--text); }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-top .idiomas { width: 108px; }
.main { flex: 1; padding: 32px; min-width: 0; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.muted { color: var(--muted); }
.meta { display: block; color: var(--muted); font-size: 13px; }
.back { margin-bottom: 8px; color: var(--muted); }
.pad { padding: 0 16px 16px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-mais { font-size: 16px; line-height: 1; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: #27272a; }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary:disabled:hover { background: var(--primary); }
.btn-seta { width: 36px; padding: 0; border: 0; background: transparent; color: var(--text); }
.btn-seta:hover { background: var(--bg); }
.btn-icone { width: 36px; padding: 0; }
.btn-seta svg, .btn-icone svg { width: 20px; height: 20px; display: block; }
.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.icon-btn:hover { background: var(--bg); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; margin-bottom: 16px; }
.card, .bloco, .stat, .empty, .login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card-foto { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; }
.card:hover { border-color: #d4d4d8; }
.card.is-escolhido { border-color: var(--text); }
.card-corpo { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: inherit; }
.card .row-actions { margin-top: auto; justify-content: flex-start; }
.remover-vinculo { align-self: flex-start; }
.card-top, .bloco-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bloco { margin-bottom: 16px; }
.bloco-head { padding: 16px; }
.bloco-cliente { overflow: hidden; }
.bloco-cliente:not([open]) > :not(summary) { display: none; }
.bloco-cliente > summary { cursor: pointer; list-style: none; }
.bloco-cliente > summary::-webkit-details-marker { display: none; }
.bloco-cliente > summary .chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  flex: none;
}
.bloco-cliente[open] > summary .chevron { transform: rotate(45deg); }
.resumo-nome { flex: 1; min-width: 0; }
.resumo-nome h2 { font-size: 16px; }
.filtro-lista { max-width: 320px; }
.busca {
  position: relative;
  display: block;
  max-width: 320px;
  margin-bottom: 16px;
}
.busca-icone {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}
.busca-icone svg { width: 16px; height: 16px; }
.busca-abrir { display: none; }
.busca input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 0 12px 0 36px;
  background: var(--surface);
}
.busca input:focus { outline: 2px solid #d4d4d8; border-color: #a1a1aa; }
.scroll-status { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 0; }
.scroll-sentinel { height: 1px; }
[data-scroll-vazio][hidden],
[data-scroll-status][hidden],
[data-scroll-tabela][hidden] { display: none !important; }
.field-check { flex-direction: row; align-items: center; }
.field-check input { width: 16px; height: 16px; }
.switch-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch-trilho {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #e4e4e7;
  pointer-events: none;
}
.switch-trilho::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-trilho { background: #18181b; }
.switch input:checked + .switch-trilho::after { transform: translateX(18px); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-trilho { opacity: 0.45; }
.switch input:focus-visible + .switch-trilho { outline: 2px solid #d4d4d8; outline-offset: 2px; }
.acesso-celula { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.acesso-celula small { color: var(--muted); font-size: 12px; }
.usuario-rodape { justify-content: flex-start; }
.usuario-rodape form { margin: 0; }
.usuario-rodape .btn-primary { margin-left: auto; }
[data-filtro-item][hidden] { display: none !important; }
.filtro-vazio { margin-bottom: 16px; }
.bloco-cliente[hidden] { display: none; }
.empty { padding: 32px; color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.pill-warn, .pill-comissao_a_receber, .pill-a_receber_cliente { background: var(--warn-bg); color: var(--warn-text); }
.pill-ok, .pill-quitada, .pill-concluida { background: var(--ok-bg); color: var(--ok-text); }
.pill-aberta, .pill-em_andamento, .pill-etapa_pagamento { background: var(--info-bg); color: var(--info-text); }
.pill-ganha { background: var(--ok-bg); color: var(--ok-text); }
.pill-na_conta { background: var(--info-bg); color: var(--info-text); }
.pill-cancelada { background: var(--bg); color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; font-weight: 500; color: var(--muted); border-top: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.is-muted { color: var(--muted); }

.senha-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.senha-valor {
  display: block;
  margin: 8px 0;
  font-size: 22px;
  letter-spacing: 0.06em;
}
.usuario-secao { display: flex; flex-direction: column; gap: 12px; }
.usuario-secao + .usuario-secao { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.usuario-secao h3 { font-size: 14px; }
.usuario-pedido {
  position: relative;
  padding: 12px 44px 12px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overflow-wrap: anywhere;
}
.usuario-pedido .icon-btn { position: absolute; top: 4px; right: 4px; }
.usuario-pedido .icon-btn:hover { background: var(--surface); }
.usuario-secao form { margin: 0; }
.usuario-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field[hidden] { display: none !important; }
.chave-rotulo { display: inline-flex; align-items: center; gap: 6px; }
.chave-bloqueio {
  position: relative;
  display: inline-flex;
  color: var(--danger);
  cursor: help;
}
.chave-bloqueio svg { width: 16px; height: 16px; display: block; }
.chave-bloqueio::after {
  content: attr(data-dica);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  z-index: 3;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
}
.chave-bloqueio:hover::after,
.chave-bloqueio:focus-visible::after { opacity: 1; }
.usuario-segredo, .usuario-confirma {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}
.usuario-segredo .senha-valor {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
  word-break: break-all;
}
.btn[hidden],
.usuario-confirma[hidden] { display: none !important; }
.row-actions form { margin: 0; }

.toasts {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.toast {
  --vida: 1600ms;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow);
  padding: 12px 12px 16px 16px;
  animation: toast-entra 220ms ease;
  transition: opacity 280ms ease, transform 280ms ease;
}
.toast-success { border-color: #bbf7d0; }
.toast-error { border-color: #fecaca; }
.toast-fechar {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.toast-vida {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--primary);
  transform-origin: left center;
  animation: toast-vida var(--vida) linear forwards;
}
.toast-success .toast-vida { background: #16a34a; }
.toast-error .toast-vida { background: var(--danger); }
.toast.is-saindo { opacity: 0; transform: scale(0.96); }
@keyframes toast-entra {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes toast-vida {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 24px; }
.abas { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 24px; border-bottom: 1px solid var(--border); }
.abas a {
  padding: 10px 14px;
  margin-bottom: -1px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.abas a.is-active { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
.abas a:hover { color: var(--text); }
.aba-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.adicionar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.adicionar-opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.adicionar [hidden] { display: none !important; }
.adicionar-menu {
  position: relative;
  z-index: 5;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 100%;
}
.adicionar-menu > [data-adicionar-abrir] { width: 100%; }
.adicionar-menu.is-aberto > [data-adicionar-abrir] {
  opacity: 0.45;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  cursor: default;
}
.adicionar-painel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  width: 100%;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.adicionar-painel .adicionar-item {
  display: block;
  width: 100%;
  white-space: normal;
  text-decoration: none;
  color: var(--primary-text);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  text-align: left;
}
.adicionar-painel .adicionar-item:hover { background: #27272a; color: var(--primary-text); }
.adicionar-painel .adicionar-busca { flex: none; max-width: none; padding: 8px 12px 12px; }
.adicionar-painel .adicionar-busca .field span,
.adicionar-painel .muted { color: rgba(255, 255, 255, 0.72); }
.adicionar-painel input { color: var(--text); background: var(--surface); }
.adicionar-painel .adicionar-lista {
  margin-top: 8px;
  background: var(--primary);
  border-color: rgba(255, 255, 255, 0.16);
}
.adicionar-busca { flex: 1 1 240px; max-width: 420px; }
.adicionar-lista { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.adicionar-lista:empty { display: none; }
.adicionar-item {
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.adicionar-item:last-child { border-bottom: 0; }
.adicionar-item:hover { background: var(--bg); }
.pasta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
}
.pasta-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px;
}
.pasta-barra h2 { font-size: 16px; }
.pasta-barra .row-actions { flex: 1 1 280px; }
.pasta-corpo { padding: 0 16px 16px; }
.pasta-corpo .roteiro-leitura { margin: 0; }
.pasta-vazio { padding: 24px; background: var(--bg); border-radius: 8px; color: var(--muted); }
.pasta-link { margin-bottom: 8px; overflow-wrap: anywhere; }
.row-actions-inicio { justify-content: flex-start; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 16px; }
.stat p { color: var(--muted); font-size: 13px; min-height: 40px; }
.stat strong { display: block; margin-top: 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.stat small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.dinheiro-saida,
.dinheiro-sobra-neg { color: var(--danger); }
.dinheiro-sobra-pos,
.dinheiro-caixa,
.dinheiro-meta-ok { color: var(--ok-text); }
.stat.lucro { background: var(--ok-bg); }
.stat.lucro p { color: var(--ok-text); }
.dinheiro-espera,
.dinheiro-meta-falta { color: var(--warn-text); }
.dinheiro-conta { color: var(--info-text); }
.bloco-head p { margin-top: 4px; font-size: 12px; }
.ano-resumo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 16px; }
.ano-resumo strong { display: block; margin-top: 4px; font-size: 18px; }
.ano-grade { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 16px; }
.ano-mes { min-width: 0; padding: 8px; background: var(--bg); border-radius: 8px; }
.ano-mes.is-current { outline: 1px solid var(--border); background: var(--surface); }
.ano-mes small { color: var(--muted); }
.ano-mes strong { display: block; margin-top: 4px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.meta-trilho { height: 6px; margin-top: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.meta-trilho span { display: block; height: 100%; background: var(--text); }
.meta-trilho span.dinheiro-meta-ok { background: var(--ok-text); }
.meta-trilho span.dinheiro-meta-falta { background: var(--warn-text); }

.graficos-balanco {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.grafico-card {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.grafico-card header { margin-bottom: 20px; }
.grafico-card header p { margin-top: 4px; font-size: 12px; }
.grafico-colunas {
  display: grid;
  grid-template-columns: repeat(6, minmax(48px, 1fr));
  gap: 10px;
  min-height: 210px;
  align-items: end;
}
.grafico-coluna {
  min-width: 0;
  display: grid;
  grid-template-rows: 34px 132px 20px;
  gap: 6px;
  align-items: end;
  text-align: center;
}
.grafico-coluna strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grafico-coluna small { color: var(--muted); font-size: 11px; }
.grafico-coluna-trilho {
  height: 132px;
  display: flex;
  align-items: flex-end;
  background: var(--bg);
  border-radius: 6px 6px 3px 3px;
  overflow: hidden;
}
.grafico-coluna-trilho span {
  width: 100%;
  min-height: 2px;
  background: #d4d4d8;
  border-radius: 6px 6px 0 0;
}
.grafico-coluna.is-current .grafico-coluna-trilho span { background: var(--primary); }
.grafico-coluna.is-current strong,
.grafico-coluna.is-current small { color: var(--text); }
.grafico-barras { display: flex; flex-direction: column; gap: 16px; }
.grafico-barra-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
}
.grafico-barra-label strong { font-weight: 500; }
.grafico-barra-trilho {
  height: 10px;
  overflow: hidden;
  background: var(--bg);
  border-radius: 999px;
}
.grafico-barra-trilho span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}
.grafico-vazio { padding: 32px 0; text-align: center; }

.perfil-card { max-width: 640px; padding: 24px; }
.perfil-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.perfil-form { max-width: 440px; }
.perfil-actions { display: flex; justify-content: flex-end; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { min-width: 160px; }
.field input, .field select, .field textarea, .login-card input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 0 12px;
  background: var(--surface);
}
.field textarea { height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .login-card input:focus {
  outline: 2px solid #d4d4d8;
  border-color: #a1a1aa;
}
.field-cor .cor-linha { display: flex; align-items: center; gap: 8px; }
.field-cor .cor-quadrado {
  width: 38px;
  height: 38px;
  padding: 3px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.field-cor .cor-quadrado::-webkit-color-swatch-wrapper { padding: 0; }
.field-cor .cor-quadrado::-webkit-color-swatch { border: 0; border-radius: 4px; }
.field-cor .cor-linha input[type="text"] { flex: 1; min-width: 0; }
.field small, .erro { color: var(--muted); font-size: 12px; }
.erro { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-pagina { padding: 24px; }
.form-grade {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.form-grade .field:has(textarea),
.form-grade .field:has(input[name="titulo"]),
.form-grade .field-largo,
.form-grade .form-acoes { grid-column: 1 / -1; }
.form-acoes { display: flex; justify-content: flex-end; }

.combo { position: relative; }
.combo-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  max-height: 180px;
  overflow: auto;
  background: var(--surface);
}
.combo-list li {
  padding: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.combo-list li:hover, .combo-list li.is-active { background: var(--bg); }
.combo-list[hidden] { display: none; }
.combo-registrar { align-self: flex-start; }
.combo-registrar[hidden], [data-registrar-erro][hidden] { display: none; }
.repasse-only { display: none; }
form.is-repasse .repasse-only { display: flex; }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(24, 24, 27, 0.4);
  cursor: pointer;
}
.modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-panel-lg { width: min(640px, 100%); }
.modal-panel-sm { width: min(440px, 100%); }
.modal-header, .modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  padding-right: calc(24px + var(--barra, 0px));
}
.modal-header { border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-panel > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.modal-footer { border-top: 1px solid var(--border); justify-content: flex-end; flex-shrink: 0; }
.modal-body {
  overflow: auto;
  padding: 24px;
  min-height: 0;
  flex: 1 1 auto;
}
body:has(.modal:not([hidden])) { overflow: hidden; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .graficos-balanco { grid-template-columns: 1fr; }
  .ano-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ano-resumo { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .nav { flex-direction: column; flex-wrap: nowrap; margin-top: 8px; }
  .nav a { flex: none; min-height: 44px; }
  .nav-rotulo { flex: 1 0 100%; margin: 8px 0 0; }
  .sidebar-foot { margin-top: 16px; }
  .main { padding: 16px; }
  .page-head { flex-direction: column; }
  .form-grade { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: stretch; }
  .modal-panel, .modal-panel-lg, .modal-panel-sm {
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
}

.faixa { display: block; margin-bottom: 8px; }
.faixa .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin-bottom: 0; }
.home-bloco { margin-top: 8px; }
.home-bloco h2 { margin-bottom: 12px; }
.avisos { display: flex; flex-direction: column; gap: 8px; }
.aviso {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.aviso-corpo { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.aviso-corpo .muted { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .aviso { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.roteiro-leitura { margin: 16px 0; }
.roteiro-leitura .icone {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.roteiro-leitura .icone svg { width: 18px; height: 18px; }
.roteiro-leitura .peca-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.roteiro-leitura .peca-capa {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  margin: 8px 0 12px;
}
.roteiro-leitura .itinerario > h2 { margin: 16px 0 8px; font-size: 18px; }
.roteiro-leitura .roteiro-dia {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.roteiro-leitura .dia-foto {
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.roteiro-leitura .dia-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.roteiro-leitura .roteiro-peca { margin-top: 8px; }
.roteiro-leitura .separador { display: flex; align-items: center; gap: 6px; margin: 16px 0; color: var(--border); }
.roteiro-leitura .separador::before, .roteiro-leitura .separador::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.roteiro-leitura .separador span { width: 5px; height: 5px; background: var(--text); transform: rotate(45deg); }
.roteiro-leitura .dia-resumo {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.roteiro-leitura .dia-quando { grid-column: 2; color: var(--muted, #71717a); font-size: 13px; }
.roteiro-leitura .secao, .roteiro-leitura .itinerario { position: relative; }
.roteiro-leitura .secao-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.roteiro-leitura .secao-seta {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.roteiro-leitura .secao-seta svg { width: 24px; height: 24px; }
.roteiro-leitura .secao-seta[aria-expanded="true"] svg { transform: rotate(180deg); }
.roteiro-leitura .super .secao-seta,
.roteiro-leitura .itinerario .secao-seta { position: static; }
.roteiro-leitura .secao.recolhida .secao-miolo > .roteiro-peca > :not(.peca-topo),
.roteiro-leitura .super.recolhida .secao-miolo { display: none; }
.roteiro-leitura .super-hospedagem .peca-topo { display: none; }
.roteiro-leitura .secao-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.roteiro-leitura .dia-corpo[hidden] { display: none !important; }
.roteiro-leitura .itinerario-abertura { margin: 4px 0 12px; }
.roteiro-leitura .itinerario-divisor { width: min(460px, 100%); margin: 0 0 12px; border: 0; border-top: 1px solid var(--border); }
.roteiro-leitura .dia-acoes { display: flex; justify-content: flex-end; gap: 4px; }
.roteiro-leitura .dia-acoes button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.roteiro-leitura .dia-acoes button[aria-pressed="true"] { background: var(--bg); }
.roteiro-leitura .dia { display: grid; grid-template-columns: 88px minmax(0, 1fr); position: relative; background: #fafafa; border-radius: 4px; padding: 4px 8px 4px 0; }
.roteiro-leitura .dia + .dia { margin-top: 16px; }
.roteiro-leitura .dia:not(:last-child)::after { content: ""; position: absolute; left: 43px; top: 32px; bottom: -16px; width: 2px; background: var(--border); }
.roteiro-leitura .dia-resumo { grid-column: 1 / -1; display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 8px; background: transparent; border-radius: 0; padding: 8px 0; }
.roteiro-leitura .dia-eixo { display: flex; justify-content: center; }
.roteiro-leitura .dia-selo { background: var(--text); color: #fff; border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.roteiro-leitura .dia-linha { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roteiro-leitura .dia-quando { grid-column: auto; text-align: right; }
.roteiro-leitura .itinerario.modo-cartoes .dia-corpo { display: flex; gap: 12px; overflow-x: auto; }
.roteiro-leitura .itinerario.modo-cartoes .atividade { flex: 0 0 220px; }
.roteiro-leitura .dia-corpo { grid-column: 2; }
.roteiro-leitura .atividade-corpo { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; }
.roteiro-leitura .atividade-foto { width: 160px; height: 220px; object-fit: cover; border-radius: 12px; }
.roteiro-leitura .atividade-paragrafo { white-space: pre-line; }
.roteiro-leitura .btn-linha { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.roteiro-leitura .quadro { position: fixed; inset: 0; z-index: 60; background: rgba(24, 24, 27, 0.45); display: grid; place-items: center; padding: 24px; }
.roteiro-leitura .quadro[hidden] { display: none !important; }
.roteiro-leitura .quadro-painel { width: min(720px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 16px; padding: 24px; position: relative; }
.roteiro-leitura .quadro .atividade-foto { width: 100%; height: 280px; }
.roteiro-leitura .lista { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 720px) {
  .roteiro-leitura .roteiro-dia { grid-template-columns: 1fr; }
  .roteiro-leitura .dia-foto { height: 180px; }
}
.roteiro-edicao { padding: 12px 0; border-top: 1px solid var(--border); }
.roteiro-edicao-peca { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.marca-logo { max-height: 48px; margin-bottom: 16px; }

.miniatura { position: relative; }
.miniatura-foto { border-radius: 8px; overflow: hidden; background: var(--bg); }
.miniatura img, .miniatura-vazia { width: 100%; height: 176px; object-fit: cover; display: block; }
.miniatura-vazia { background: linear-gradient(160deg, #f4f4f5, #e4e4e7); }
.miniatura-acoes {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.card:hover .miniatura-acoes,
.card:focus-within .miniatura-acoes { opacity: 1; pointer-events: auto; }
.miniatura-acoes form { margin: 0; }
.acoes-menu { display: none; }
.acao-icone {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.16);
  cursor: pointer;
  text-decoration: none;
}
.acao-icone svg { width: 18px; height: 18px; display: block; }
.acao-icone:hover { background: var(--bg); }
.acao-perigo { color: var(--danger); }
.acao-icone::after {
  content: attr(data-dica);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.acao-icone:hover::after,
.acao-icone:focus-visible::after { opacity: 1; }
@media (hover: none) {
  .miniatura-acoes { opacity: 1; pointer-events: auto; }
}
.opcoes { position: relative; flex: none; margin-left: auto; }
.opcoes-linha { display: flex; align-items: center; gap: 8px; min-width: 0; }
.opcoes-linha > strong,
.opcoes-linha > span:not(.pill):not(.meta) { flex: 1; min-width: 0; }
.opcoes-abrir {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.16);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.icon-btn svg,
.toast-fechar svg,
.opcoes-abrir svg,
.profile-menu-link svg { width: 18px; height: 18px; display: block; }
.opcoes-abrir:hover { background: var(--bg); }
.opcoes-painel {
  position: fixed;
  z-index: 35;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.12);
}
.opcoes-painel[hidden] { display: none !important; }
.opcoes-painel form { margin: 0; }
.opcoes-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.opcoes-item:hover { background: var(--bg); }
.opcoes-item.is-perigo { color: var(--danger); }

.editor-pagina { min-height: 100vh; background: #f4f4f5; display: flex; flex-direction: column; }
.editor-pagina .construtor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.editor-pagina .construtor-topo {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.editor-pagina .construtor-tela { flex: 1; border: 0; border-radius: 0; }
.construtor-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.construtor-titulo { flex: 1 1 180px; min-width: min(100%, 140px); display: flex; flex-direction: column; }
.construtor-tela { background: #f4f4f5; border: 1px solid var(--border); border-radius: 12px; padding: 24px 16px; }
.construtor-folha { background: #fff; border-radius: 12px; overflow: hidden; }
.construtor-marca { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.construtor-marca img { height: 36px; width: auto; }
.construtor-corpo { padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; min-height: 360px; }
.construtor-blocos { display: flex; flex-direction: column; gap: 16px; }
.construtor-vazio { border: 1px dashed var(--border); border-radius: 12px; padding: 48px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.construtor-incluir { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.construtor-bloco { background: #f4f4f5; border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.construtor-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.construtor-barra > strong { flex: 1; min-width: 0; }
.construtor-foto { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; }
.construtor-capa { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; display: block; }
.construtor-capa-vazia { background: linear-gradient(160deg, #f4f4f5, #e4e4e7); }
.construtor-par { position: relative; height: 260px; }
.construtor-par img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.construtor-par img:last-child {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 52%;
  height: 68%;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(24, 24, 27, 0.2);
}
.construtor-mosaico { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.construtor-mosaico img { width: 100%; height: 86px; object-fit: cover; border-radius: 8px; display: block; }
.construtor-mosaico img:first-child { grid-row: span 2; height: 180px; }
.fotos-capa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field-foto .foto-slot { width: 88px; }
.fotos-capa .foto-slot { width: auto; }
.foto-slot { position: relative; height: 88px; min-width: 0; border-radius: 8px; background: var(--bg); }
.foto-slot img { width: 100%; height: 88px; object-fit: cover; border-radius: 8px; display: block; }
.foto-slot-vazia { border: 1px dashed var(--border); background: #fff; }
.foto-mais {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.foto-acoes { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.foto-acoes .acao-icone { width: 28px; height: 28px; }
.foto-acoes .acao-icone svg { width: 15px; height: 15px; }
.foto-slot input[type="file"],
.foto-acoes input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.foto-slot [hidden] { display: none !important; }
.field-foto .field-check input { width: 16px; height: 16px; padding: 0; }
.foto-campo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.campo-miniatura { width: min(100%, 280px); height: 160px; object-fit: cover; border-radius: 8px; display: block; background: var(--bg); }
.form-grade .field:has(input[type="file"]) { grid-column: 1 / -1; }
.construtor-itinerario > .construtor-barra { position: relative; z-index: 2; }
.construtor-itinerario > .construtor-barra:has(.adicionar-painel:not([hidden])) { z-index: 6; }
.construtor-itinerario > .construtor-barra > .seletor { width: 148px; }
.construtor-itinerario > .construtor-barra > .seletor > .btn { width: 100%; }
.construtor-itinerario > .construtor-barra > .seletor:has(.adicionar-painel:not([hidden])) > .btn {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.construtor-itinerario > .construtor-barra > .seletor .adicionar-painel {
  left: 0;
  width: 100%;
  min-width: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  box-shadow: none;
}
.construtor-itinerario > .construtor-barra > .seletor .adicionar-item {
  color: var(--text);
  border-bottom-color: var(--border);
  white-space: nowrap;
}
.construtor-itinerario > .construtor-barra > .seletor .adicionar-item:hover {
  background: var(--bg);
  color: var(--text);
}
.construtor-dia {
  position: relative;
  margin: 0 0 0 16px;
  padding: 12px 12px 12px 18px;
  background: #e4e4e7;
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.construtor-dia:has(.adicionar-painel:not([hidden])) { z-index: 6; }
.construtor-dia > .arrastar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #d4d4d8;
}
.construtor-dias, .construtor-atividades { display: flex; flex-direction: column; gap: 8px; }
.construtor-atividades {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 2px solid #a1a1aa;
}
.construtor-dia .seletor-mais { margin: 2px auto 0; align-self: center; }
.seletor-mais > .btn {
  position: relative;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  border-color: transparent;
}
.seletor-mais > .btn:hover { background: transparent; }
.seletor-mais > .btn::after {
  content: attr(data-dica);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.seletor-mais > .btn:hover::after,
.seletor-mais > .btn:focus-visible::after { opacity: 1; }
.seletor.construtor-incluir { align-self: center; }
.construtor-incluir > .btn::after { top: calc(100% + 6px); bottom: auto; }
.construtor-incluir .adicionar-painel { top: auto; bottom: calc(100% + 4px); }
.construtor-incluir:has(.adicionar-painel:not([hidden])) { z-index: 6; }
.seletor-mais .adicionar-painel { left: 50%; width: max-content; transform: translateX(-50%); }
.seletor .adicionar-painel form { margin: 0; }
.seletor .adicionar-painel form:last-child .adicionar-item { border-bottom: 0; }
.construtor-trecho { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: 28px; }
.atividade-linha { display: flex; align-items: center; gap: 8px; min-width: 0; }
.atividade-linha > strong { flex: 1; min-width: 0; }
.dia-miolo { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dia-miolo strong { min-width: 0; }
.linha-acoes { display: flex; align-items: center; gap: 2px; flex: none; }
.linha-acoes form { margin: 0; }
.construtor-dia > .construtor-barra { flex-wrap: nowrap; align-items: flex-start; }
@media (max-width: 800px) {
  .atividade-linha { flex-wrap: wrap; }
  .atividade-linha > .linha-acoes { order: 1; margin-left: auto; }
  .atividade-linha > strong { order: 2; flex: 1 0 100%; padding-left: 36px; }
}
.atividade-linha time { color: var(--muted); font-size: 13px; flex: none; }
.atividade-marca {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f4f4f5;
  color: var(--text);
}
.atividade-marca svg { width: 16px; height: 16px; }
.arrastar {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
}
.arrastar svg { width: 16px; height: 16px; }
.construtor-dia.is-arrastando, .atividade-bloco.is-arrastando { opacity: 0.45; }
.atividade-bloco {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.construtor-rodape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.construtor-rodape strong { color: var(--text); }
.seletor { position: relative; display: inline-flex; align-self: flex-start; }
.seletor .adicionar-painel { width: max-content; min-width: 220px; }
.seletor .adicionar-item { display: flex; align-items: center; gap: 10px; }
.seletor-icone { width: 18px; height: 18px; display: inline-flex; flex: none; }
.seletor-icone svg { width: 18px; height: 18px; }
.construtor-barra .acao-icone, .atividade-linha .acao-icone, .construtor-trecho .acao-icone {
  background: transparent;
  box-shadow: none;
}
@media (max-width: 800px) {
  .construtor-tela { padding: 16px 8px; }
  .construtor-corpo { padding: 16px 12px; }
  .construtor-foto { width: 100%; height: 160px; }
}

.pular {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: var(--radius-control);
  transform: translateY(-160%);
}
.pular:focus { transform: none; }
.so-celular, .barra-app { display: none; }
.menu-corpo { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mes-linha { display: contents; }
.linha-abre {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.linha-abre:hover { text-decoration: underline; }
.card:has(> .opcoes) { position: relative; }
.card > .opcoes { position: absolute; top: 12px; right: 12px; }
.card:has(> .opcoes) .card-top { padding-right: 36px; }
.num, .stat strong { font-variant-numeric: tabular-nums; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
button, a, input, select, textarea { touch-action: manipulation; }
.modal, .menu-corpo, .opcoes-painel { overscroll-behavior: contain; }

@media (max-width: 800px) {
  * {
    scrollbar-width: none;
  }
  *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  .shell { padding-top: calc(56px + env(safe-area-inset-top)); }
  .sidebar { padding: 0; border-bottom: 0; background: transparent; }
  .sidebar.is-menu-aberto { background: var(--surface); }
  .brand-linha {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 25;
    min-height: 56px;
    padding: max(6px, env(safe-area-inset-top)) 16px 6px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .sidebar.is-menu-aberto .menu-corpo { padding: 8px 12px 12px; }
  .barra-app, .so-celular { display: flex; }
  .brand-config { display: none; }
  .menu-corpo { display: none; }
  .sidebar.is-menu-aberto .menu-corpo { display: flex; }
  .sidebar-foot { margin-top: 12px; }
  .profile-panel {
    position: static;
    margin-top: 8px;
    box-shadow: none;
  }
  .nav a { display: flex; align-items: center; }
  .barra-app {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: calc(56px + env(safe-area-inset-bottom));
    padding: 4px 4px env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .barra-app a, .barra-app button {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    line-height: 1.1;
    padding: 4px 2px;
    cursor: pointer;
  }
  .barra-app svg { width: 22px; height: 22px; }
  .barra-app .is-active, .barra-app button[aria-expanded="true"] {
    color: var(--text);
    font-weight: 600;
    background: var(--bg);
    border-radius: var(--radius-control);
  }
  .main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .main:has(.page-head .btn-primary),
  .main:has(.acao-pagina),
  .main:has(.adicionar-menu) { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
  .page-head .btn-primary,
  .acao-pagina,
  .aba-topo .adicionar-menu {
    position: fixed;
    z-index: 21;
    left: auto;
    right: 16px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 32px);
    height: 36px;
  }
  .aba-topo .adicionar-menu > [data-adicionar-abrir] { width: max-content; }
  .aba-topo .adicionar-menu { display: flex; }
  .aba-topo .adicionar-menu.is-aberto > [data-adicionar-abrir] {
    border-radius: 0 0 var(--radius-control) var(--radius-control);
  }
  .aba-topo .adicionar-painel {
    top: auto;
    bottom: 100%;
    left: auto;
    right: 0;
    width: max-content;
    min-width: 220px;
    border-radius: var(--radius-control) var(--radius-control) 0 0;
  }
  .main { position: relative; }
  .filtro-lista { max-width: none; margin: 0; }
  .page-head.tem-busca > div:first-child { padding-right: 48px; }
  .busca {
    position: absolute;
    z-index: 2;
    width: 44px;
    height: 44px;
    margin: 0;
    max-width: none;
  }
  .busca > label,
  .busca .busca-icone { display: none; }
  .busca-abrir {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .busca-abrir svg { width: 20px; height: 20px; }
  .busca.is-aberta {
    display: flex;
    align-items: center;
    gap: 4px;
    height: auto;
    padding: 0;
    background: transparent;
  }
  .busca.is-aberta > label { display: block; flex: 1; min-width: 0; position: relative; }
  .busca.is-aberta .busca-abrir { flex: none; }
  .busca.is-aberta input { height: 44px; font-size: 16px; padding-left: 12px; }
  .abas { flex-wrap: nowrap; overflow-x: auto; }
  .abas a { flex: none; min-height: 44px; display: flex; align-items: center; }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    margin-bottom: 12px;
    padding: 6px 0;
  }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 16px;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .table-wrap td[data-rotulo]::before {
    content: attr(data-rotulo);
    color: var(--muted);
    font-weight: 500;
    text-align: left;
    flex: none;
  }
  .table-wrap td[colspan] { display: block; text-align: left; }
  .table-wrap td.celula-acao:not(:has(.opcoes)) { display: none; }
  .table-wrap.extrato tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 8px;
    row-gap: 2px;
    align-items: start;
    margin: 0;
    padding: 12px 16px;
    background: transparent;
    border: 0;
    border-radius: 0;
    border-top: 1px solid var(--border);
  }
  .table-wrap.extrato td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .table-wrap.extrato td[data-rotulo]::before { content: none; }
  .table-wrap.extrato td:nth-child(2) { grid-column: 1; grid-row: 1; min-width: 0; }
  .table-wrap.extrato td:nth-child(2) strong { display: block; }
  .table-wrap.extrato td:nth-child(2) .meta { display: inline; font-size: 13px; }
  .table-wrap.extrato td:nth-child(2) .meta + .meta::before { content: " · "; }
  .table-wrap.extrato td:nth-child(6) { grid-column: 2; grid-row: 1; }
  .table-wrap.extrato td:nth-child(7) { grid-column: 3; grid-row: 1; }
  .table-wrap.extrato td:nth-child(1) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; }
  .table-wrap.extrato td:nth-child(5) { grid-column: 2 / 4; grid-row: 2; text-align: right; font-weight: 600; }
  .table-wrap.extrato td:nth-child(3),
  .table-wrap.extrato td:nth-child(4),
  .table-wrap.extrato td.row-actions:not(:has(.opcoes)) { display: none; }
  .table-wrap.extrato tr:has(td[colspan]) {
    display: block;
    padding: 0 16px 12px;
    border-top: 0;
  }
  .table-wrap.extrato td[colspan] { color: var(--muted); font-size: 13px; text-align: left; }
  .mes-linha { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
  .mes-linha .field { flex: 1; min-width: 0; }
  .filters .field-inline { width: 100%; }
  .mes-linha .field-inline { width: auto; }
  .faixa {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 4px 16px 8px;
  }
  .faixa > .muted { display: block; padding: 12px 0 4px; }
  .faixa .stats { display: flex; flex-direction: column; gap: 0; }
  .faixa .stat {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid var(--border);
  }
  .faixa .stat:last-child { border-bottom: 0; }
  .faixa .stat p { min-height: 0; }
  .construtor-barra > strong { order: -1; flex: 1 0 100%; }
  .construtor-dia > .construtor-barra { flex-wrap: wrap; }
  .dia-miolo { flex: 1 0 100%; flex-direction: column; align-items: flex-start; }
  .dia-miolo strong { width: 100%; }
  .fotos-capa {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .fotos-capa .foto-slot { flex: none; width: 140px; scroll-snap-align: start; }
  .miniatura-acoes { display: none; }
  .acoes-menu { display: block; }
  body:has(.modal:not([hidden])) .barra-app,
  body:has(.modal:not([hidden])) .page-head .btn-primary,
  body:has(.modal:not([hidden])) .acao-pagina,
  body:has(.modal:not([hidden])) .aba-topo .adicionar-menu { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat p { min-height: 0; }
  .ano-grade { grid-template-columns: 1fr 1fr; }
}
@media (pointer: coarse) {
  .arrastar, .icon-btn, .opcoes-abrir, .acao-icone, .opcoes-item, .idiomas button, .btn-icone {
    min-width: 44px;
    min-height: 44px;
  }
  .field input, .field select, .busca input, .login-card input { height: 44px; font-size: 16px; }
  .field textarea { min-height: 88px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

