[x-cloak] { display: none !important; }

/* =====================================================================
   MARCA — para mudar a cara do sistema, edite só este bloco.
   Cada tema define os mesmos nomes; o resto do CSS usa só eles.
   Ideia futura: cada operador poderia sobrescrever estes valores
   (ex.: <html style="--cera:#...">) sem tocar no restante.
   ===================================================================== */
:root, [data-theme=light] {
  /* superfícies */
  --papel: #eef0ec;        /* fundo da página (papel de maca) */
  --folha: #fbfbf9;        /* superfícies: folha do dia, modal, campos */
  --gaze: #cfd3cc;         /* réguas e bordas */
  /* texto e ação */
  --tinta: #1e3b33;        /* texto e títulos (verde frasco) */
  --acao: #1e3b33;         /* fundo do botão principal */
  --acao-texto: #eef0ec;   /* texto sobre o botão principal */
  --acao-detalhe: #e0a248; /* detalhe sobre a ação (o + do botão central) */
  /* acento */
  --cera: #b5731a;         /* acento em preenchimentos: pontos, marcas (3:1 sobre o papel) */
  --cera-texto: #85530e;   /* acento em texto pequeno e contornos (passa AA) */
  --argila: #d9b8a6;       /* realces suaves */
  /* estados */
  --ok-bg: #dce8e2;   --ok-fg: #1e3b33;
  --warn-bg: #f4e4c6; --warn-fg: #85530e;
  --neg-bg: #f6dfdb;  --neg-fg: #9b2a1f;
  /* tipos */
  --fonte-ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fonte-titulo: "Young Serif", Georgia, "Times New Roman", serif;
}
[data-theme=dark] {
  --papel: #121c19;
  --folha: #1a2723;
  --gaze: #2c3a35;
  --tinta: #e7ebe6;
  --acao: #e0a248;
  --acao-texto: #1b1406;
  --acao-detalhe: #1b1406;
  --cera: #e0a248;
  --cera-texto: #e0a248;
  --argila: #4a3a33;
  --ok-bg: #1f3a32;   --ok-fg: #9fd8be;
  --warn-bg: #3a2e15; --warn-fg: #e0a248;
  --neg-bg: #3d1c1f;  --neg-fg: #ff9b94;
}

/* ---------- derivados (não editar para trocar cores) ---------- */
:root, [data-theme] {
  --raio: 10px;            /* controles; selos usam pílula; a folha do dia é quase reta */
  --raio-folha: 2px;
  --muda: color-mix(in srgb, var(--tinta) 74%, var(--papel));
  --borda: color-mix(in srgb, var(--tinta) 45%, var(--gaze));
  --foco: var(--cera-texto);
  --leve: color-mix(in srgb, var(--gaze) 45%, transparent);
  color-scheme: light;
}
[data-theme=dark] { color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 93.75%; -webkit-text-size-adjust: 100%; }   /* 15 px */
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 1rem/1.5 var(--fonte-ui); -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4 { margin: 0 0 .6rem; font-family: var(--fonte-titulo); font-weight: 400; line-height: 1.2; letter-spacing: -.005em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.467rem; }
h3, h4 { font-size: 1.133rem; }
p { margin: 0 0 .9rem; }
small { font-size: .867rem; }
strong, b { font-weight: 600; }
a { color: var(--cera-texto); text-underline-offset: .18em; }
a:hover { color: var(--tinta); }
table a { color: inherit; text-decoration-color: var(--cera); text-decoration-thickness: 2px; }
ul { padding-left: 1.2rem; }
fieldset { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .4rem; font-weight: 500; }
hr { border: 0; border-top: 1px solid var(--gaze); }
.overflow-auto { overflow: auto; }

:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------- ícones ---------- */
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; flex: none; }

/* ---------- botões ---------- */
button, [role=button] {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.6rem; margin: 0; padding: .5rem 1.1rem;
  border: 1px solid var(--acao); border-radius: var(--raio); background: var(--acao); color: var(--acao-texto);
  font: 600 .933rem/1.2 var(--fonte-ui); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
button:not(:disabled):hover, [role=button]:hover { background: color-mix(in srgb, var(--acao) 86%, var(--tinta)); }
button:not(:disabled):active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.outline { background: transparent; color: var(--tinta); border-color: var(--borda); }
button.outline:not(:disabled):hover { background: var(--leve); }
button.secondary { background: color-mix(in srgb, var(--gaze) 60%, var(--folha)); border-color: transparent; color: var(--tinta); }
button.secondary:not(:disabled):hover { background: var(--gaze); }
button.outline.secondary { background: transparent; border-color: var(--gaze); color: var(--muda); }
button.outline.secondary:not(:disabled):hover { background: var(--leve); color: var(--tinta); }
button.outline.secondary.perigo { color: var(--neg-fg); border-color: color-mix(in srgb, var(--neg-fg) 35%, transparent); }
button.outline.secondary.perigo:not(:disabled):hover { background: var(--neg-bg); color: var(--neg-fg); }
button.mini { min-height: 2rem; padding: .2rem .7rem; font-size: .8rem; }
.quieto, .quieto:not(:disabled):hover { background: transparent; border-color: transparent; color: var(--tinta); font-weight: 500; justify-content: flex-start; }
.quieto:not(:disabled):hover { background: var(--leve); }
.icone-btn {
  width: 2.6rem; min-width: 2.6rem; padding: 0; border-radius: 50%;
  background: transparent; color: var(--muda); border: 1px solid var(--gaze);
}
.icone-btn:not(:disabled):hover { background: var(--leve); color: var(--tinta); }

/* ---------- campos ---------- */
label { display: block; font-weight: 500; font-size: .933rem; }
label > small { display: block; margin-top: -.6rem; margin-bottom: 1rem; font-weight: 400; color: var(--muda); }
input:not([type=checkbox], [type=radio]), select, textarea {
  display: block; width: 100%; min-height: 2.6rem; margin: 0 0 1rem; padding: .5rem .75rem;
  border: 1px solid var(--borda); border-radius: var(--raio); background: var(--folha); color: var(--tinta);
  font: 400 1rem/1.4 var(--fonte-ui);
}
label > input:not([type=checkbox], [type=radio]), label > select { margin-top: .3rem; }
input::placeholder { color: var(--muda); opacity: .8; }
input:not([type=checkbox], [type=radio]):focus, select:focus, textarea:focus { outline: 2px solid var(--foco); outline-offset: 0; border-color: var(--foco); }
select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muda) 50%), linear-gradient(135deg, var(--muda) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 52%, calc(100% - .8rem) 52%; background-size: .3rem .3rem; background-repeat: no-repeat;
}
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; margin: 0 .5rem 0 0; accent-color: var(--acao); vertical-align: -.2em; }

/* ---------- selos, avisos, legendas ---------- */
.selo { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.selo.ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.selo.warn { background: var(--warn-bg); color: var(--warn-fg); }
.selo.neg  { background: var(--neg-bg);  color: var(--neg-fg); }
.selo.neutro { background: var(--gaze); color: var(--tinta); }
button.selo { min-height: 0; padding: .1rem .6rem; border: 0; font-size: .8rem; }
button.selo.ok { background: var(--ok-bg); color: var(--ok-fg); }
button.selo.warn { background: var(--warn-bg); color: var(--warn-fg); }
button.selo:not(:disabled):hover { filter: brightness(.95); }
button.selo.ok:not(:disabled):hover { background: var(--ok-bg); }
button.selo.warn:not(:disabled):hover { background: var(--warn-bg); }

.legenda { font-size: .867rem; color: var(--muda); }
.legenda .selo { margin: 0 .15rem; }
.pendente { color: var(--warn-fg); }
.confirmado { color: var(--ok-fg); }
.carregando { color: var(--muda); }

.aviso {
  position: sticky; top: .5rem; z-index: 40; cursor: pointer; margin: 0 0 1rem; padding: .65rem .9rem;
  background: var(--neg-bg); color: var(--neg-fg); border-left: 4px solid var(--neg-fg); border-radius: var(--raio);
  animation: abrir .2s ease both;
}
/* faixa de assinatura: aviso, não erro (mesmos tokens de "pendente") */
.aviso.confirmado { background: var(--ok-bg); color: var(--ok-fg); border-left-color: var(--ok-fg); }
.aviso.faixa-assinatura { cursor: default; background: var(--warn-bg); color: var(--warn-fg); border-left-color: var(--warn-fg); }
@keyframes abrir { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes carimbar { 0% { opacity: 0; transform: scale(1.5) rotate(-4deg); } 60% { opacity: 1; transform: scale(.96); } 100% { transform: none; } }

/* ---------- estrutura: celular primeiro ---------- */
.conteudo { width: 100%; max-width: 112rem; margin: 0 auto; padding: 1rem 1rem 7.5rem; }   /* largo: as tabelas usam o espaço da tela */
section > p.legenda { max-width: 75ch; }
.trilho { display: none; }
/* logotipos em PNG (assets/logos): a versão do tema ativo aparece, a outra some */
.logo-img { display: block; max-width: 100%; height: auto; }
.logo-escuro, :root[data-theme="dark"] .logo-claro { display: none; }
:root[data-theme="dark"] .logo-escuro { display: block; }
.login .logo-img { margin: 0 0 1.25rem; }
.so-leitor { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.titulo-aba { margin: 0 0 1rem; font-size: 1.467rem; }

.marca { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.marca-logo { flex: none; width: 2.6rem; height: 2.6rem; fill: none; stroke: var(--tinta); }
.marca-nome .hub { color: var(--cera-texto); }   /* "Estetic" + "hub" em dois tons, como no logotipo */
.marca-nome { font-family: var(--fonte-titulo); font-size: 1.133rem; line-height: 1.15; }
.marca-sub { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--muda); }
.topo { display: flex; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* barra inferior (celular): três destinos, Mais e a ação central */
.barra-inferior {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr 4.6rem 1fr 1fr; align-items: end;
  padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom)); background: var(--folha); border-top: 1px solid var(--gaze);
}
.barra-inferior button {
  position: relative; flex-direction: column; gap: .1rem; width: 100%; min-height: 3.2rem; padding: .3rem 0;
  background: none; border: 0; color: var(--muda); font-size: .733rem; font-weight: 500;
}
.barra-inferior button:not(:disabled):hover { background: none; color: var(--tinta); }
.barra-inferior button.ativa { color: var(--tinta); font-weight: 600; }
.barra-inferior button.ativa::before { content: ""; position: absolute; top: -.3rem; left: 50%; margin-left: -.8rem; width: 1.6rem; height: 3px; border-radius: 0 0 3px 3px; background: var(--cera); }
.barra-inferior .acao-central {
  width: 3.4rem; height: 3.4rem; min-height: 0; margin: -1.3rem auto .1rem; padding: 0; border-radius: 14px;
  background: var(--acao); color: var(--acao-detalhe); border: 3px solid var(--papel);
}
.barra-inferior .acao-central:not(:disabled):hover { background: color-mix(in srgb, var(--acao) 86%, var(--tinta)); color: var(--acao-detalhe); }
.acao-central .ic { width: 1.6rem; height: 1.6rem; stroke-width: 2.2; }
.mais-menu {
  position: fixed; right: .75rem; bottom: 4.8rem; z-index: 31; min-width: 14rem; padding: .35rem;
  background: var(--folha); border: 1px solid var(--gaze); border-radius: var(--raio); animation: abrir .18s ease both;
}
.mais-menu button { width: 100%; }
.mais-menu hr { margin: .3rem 0; }

.barra { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.barra > select, .barra > input { width: auto; margin: 0; max-width: 20rem; flex: 1 1 9rem; }
.barra > input[type=search] { flex: 1 1 100%; max-width: none; }
@media (min-width: 768px) { .barra > input[type=search] { flex: 1 1 14rem; max-width: 20rem; } }

/* ---------- tabelas ---------- */
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--gaze); vertical-align: middle; }
th { color: var(--muda); font-size: .8rem; font-weight: 600; }
tfoot th { color: var(--tinta); font-size: .933rem; border-bottom: 0; border-top: 2px solid var(--tinta); }
table.striped tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--gaze) 22%, transparent); }
table.compacta th, table.compacta td { padding: .4rem .45rem; font-size: .9rem; white-space: nowrap; }
table.compacta td:first-child { white-space: normal; }
table.compacta input, table.compacta select { margin: 0; padding: .3rem .5rem; min-height: 2.1rem; font-size: .9rem; min-width: 8rem; }
table.compacta select { padding-right: 2rem; }
table.compacta input.curto { min-width: 5.5rem; width: 6.5rem; text-align: right; }
table.compacta select.un { min-width: 11rem; }
table.compacta tr.novo td { background: color-mix(in srgb, var(--papel) 60%, var(--folha)); }
.n { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1599px) { .so-tela { display: none; } }   /* colunas que a Ficha técnica já detalha */
.acoes { text-align: right; }
.acoes .mini + .mini { margin-left: .25rem; }

/* cabeçalho que ordena (computador) e seletor "Ordenar por" (celular) */
button.th-ordem {
  position: relative; min-height: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit;
  font: inherit; font-weight: 600; justify-content: flex-start; text-align: inherit;
}
button.th-ordem:not(:disabled):hover { background: transparent; color: var(--tinta); }
button.th-ordem::after {
  content: ""; position: absolute; right: -.8rem; top: calc(50% - .22rem); width: .5rem; height: .45rem; background: currentColor; opacity: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
button.th-ordem:hover::after { opacity: .35; }
th[aria-sort=ascending] button.th-ordem::after, th[aria-sort=descending] button.th-ordem::after { opacity: 1; }
th[aria-sort=descending] button.th-ordem::after { transform: rotate(180deg); }
th[aria-sort=ascending], th[aria-sort=descending] { color: var(--tinta); }
.ordenar { display: flex; gap: .5rem; align-items: center; flex: 1 1 100%; }
.ordenar select { margin: 0; }
.icone-btn.inverso .ic { transform: scaleY(-1); }
.barra > .legenda, .contagem { margin: 0; }
.paginacao { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: .25rem 0 1.25rem; }
.paginacao .legenda { margin: 0; }
.pag-botoes { display: flex; flex-wrap: wrap; gap: .25rem; }
button.mini.pag-num { min-width: 2rem; padding: .2rem .5rem; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .pag-num { display: none; } }

/* ---------- resumo em linhas (extrato) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); column-gap: 3rem; margin: 0 0 1.25rem; }
.kpi { display: flex; align-items: baseline; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--gaze); }
.kpi small { flex: 1; font-size: .933rem; color: var(--muda); }
.kpi strong { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.05rem; }

.conta-pagina { max-width: 34rem; }
.grade-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2.5rem; align-items: start; }
.grade-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; }
.conversor { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; align-items: end; }
.conversor > button { margin-bottom: 1rem; }

/* ---------- navegação por período ---------- */
.mes-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.mes-nav h2 { flex: 1; margin: 0; text-align: center; }
.mes-nav .curto-sel { width: auto; margin: 0; min-height: 2.2rem; padding-top: .25rem; padding-bottom: .25rem; }

/* ---------- agenda ---------- */
.agenda-grade { display: grid; gap: 1.75rem; }
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-sem { padding: .25rem 0; text-align: center; font-size: .8rem; font-weight: 500; color: var(--muda); }
.cal-dia {
  flex-direction: column; gap: .2rem; width: 100%; aspect-ratio: 1 / .94; min-height: 2.75rem; padding: 0;
  border: 1.5px solid transparent; border-radius: 8px; background: transparent; color: var(--tinta);
  font-size: .967rem; font-weight: 500;
}
.cal-dia:not(:disabled):hover { background: var(--leve); }
.cal-dia.fora { opacity: .45; }
.cal-dia.hoje { border-color: var(--cera-texto); }
.cal-dia.sel, .cal-dia.sel:not(:disabled):hover { background: var(--acao); color: var(--acao-texto); border-color: var(--acao); }
.cal-pontos { display: flex; align-items: center; gap: 3px; height: 6px; }
.cal-pontos i { width: 5px; height: 5px; border-radius: 50%; background: var(--cera); }
.cal-pontos b { font-size: .67rem; line-height: 1; }
.cal-dia.sel .cal-pontos i { background: var(--acao-texto); }

/* folha do dia: papel de maca com borda picotada */
.folha {
  position: relative; max-width: 42rem; padding: 1.7rem 1.25rem 1.5rem;
  background: var(--folha); border: 1px solid var(--gaze); border-radius: var(--raio-folha);
}
.folha::before, .folha::after {
  content: ""; position: absolute; left: -1px; right: -1px; height: 8px; pointer-events: none;
  background: radial-gradient(circle at 7px 0, var(--papel) 4.5px, transparent 5px) 0 0 / 14px 8px repeat-x;
}
.folha::before { top: -1px; }
.folha::after { bottom: -1px; transform: scaleY(-1); }
.folha-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--gaze); }
.folha-cab h3 { margin: 0; font-size: 1.267rem; }
.folha-vazia { margin: 1.1rem 0 .2rem; }

.atend { display: grid; grid-template-columns: 3.1rem minmax(0, 1fr) auto; gap: .1rem .75rem; padding: .95rem 0; border-bottom: 1px dashed var(--gaze); }
.atend .hora { padding-top: .15rem; font-size: .9rem; font-weight: 500; color: var(--muda); font-variant-numeric: tabular-nums; }
.atend h4 { margin: 0; overflow-wrap: anywhere; }
.atend .preco { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.atend .detalhes { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.atend .estado { grid-column: 3; grid-row: 2; justify-self: end; margin-top: .15rem; }
.atend .hora small { display: block; font-size: .75rem; font-weight: 400; opacity: .8; }
.linhas-serv { margin: .1rem 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--muda); }
.linhas-serv li { display: flex; justify-content: space-between; gap: 1rem; }
.atend .legenda { margin: .1rem 0 0; }
.atend .acoes { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; text-align: left; }
.atend.st-cancelado { opacity: .55; }
.atend.st-cancelado h4 { text-decoration: line-through; }
.selo.recente { animation: carimbar .45s cubic-bezier(.2, .8, .3, 1) both; }

.folha-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: .3rem; padding-top: .9rem; border-top: 2px solid var(--tinta); }
.folha-total span { color: var(--muda); }
.folha-total strong { font-family: var(--fonte-titulo); font-size: 1.467rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.folha .legenda { margin: .35rem 0 0; text-align: right; }

/* ---------- despesas ---------- */
.despesa-form { display: grid; grid-template-columns: 1fr; gap: .5rem; align-items: center; margin-bottom: 1.25rem; padding: 1rem 0; border-top: 1px solid var(--gaze); border-bottom: 1px solid var(--gaze); }
.despesa-form > * { margin: 0 !important; }
.despesa-form .marcar { display: flex; align-items: center; }

/* ---------- relatórios: receita por período ---------- */
.barras { position: relative; display: flex; gap: 4px; height: 13rem; margin: .5rem 0 1rem; padding: 2rem 0 0 3.4rem; overflow-x: auto; }
.barras-max { position: absolute; left: 0; top: 2rem; width: 100%; border-top: 1px dashed var(--gaze); pointer-events: none; }
.barras-max span { position: absolute; left: 0; top: -.75rem; padding-right: .3rem; font-size: .7rem; color: var(--muda); font-variant-numeric: tabular-nums; background: var(--papel); }
.barra-col { position: relative; flex: 1 0 1.1rem; max-width: 2.4rem; height: 100%; min-height: 0; padding: 0; flex-direction: column; border: 0; border-radius: 0; background: none; color: var(--tinta); }
.barra-col:not(:disabled):hover { background: var(--leve); }
.barra-area { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--borda); }
.barra-v { display: block; width: 60%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--acao); }
.barra-col small { height: 1.4rem; line-height: 1.4rem; font-size: .67rem; font-weight: 400; color: var(--muda); }
.barra-col .dica {
  position: absolute; bottom: calc(100% + 2px); left: 50%; z-index: 5; transform: translateX(-50%); padding: .3rem .55rem; border-radius: 8px;
  background: var(--tinta); color: var(--papel); font-size: .75rem; font-weight: 500; white-space: nowrap; pointer-events: none; visibility: hidden;
}
.barra-col:hover .dica, .barra-col:focus-visible .dica { visibility: visible; }
.tabela-alt { margin-bottom: 1.25rem; }
.tabela-alt summary { cursor: pointer; font-size: .867rem; color: var(--muda); margin-bottom: .5rem; }

/* ---------- modais ---------- */
dialog {
  position: fixed; inset: 0; z-index: 60; display: none; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: color-mix(in srgb, var(--tinta) 45%, transparent); color: var(--tinta);
}
dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
dialog > article {
  width: min(100%, 34rem); max-height: 92vh; overflow-y: auto; margin: 0; padding: 1.25rem 1.25rem 1.5rem;
  background: var(--folha); border: 1px solid var(--gaze); border-radius: 14px 14px 0 0; animation: abrir .22s ease both;
}
dialog > article.modal-atend { width: min(100%, 38rem); }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
dialog header p { margin: 0; font-family: var(--fonte-titulo); font-size: 1.467rem; line-height: 1.2; }
dialog footer { display: flex; justify-content: flex-end; gap: .5rem; }
.servicos-atend { margin-bottom: 1rem; }
.linha-serv { display: grid; grid-template-columns: 1fr 4.5rem 6rem auto; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.linha-serv > * { margin: 0 !important; }
.total-atend { display: flex; justify-content: space-between; align-items: baseline; margin: .25rem 0 1rem; padding-top: .7rem; border-top: 2px solid var(--tinta); }
.total-atend strong { font-family: var(--fonte-titulo); font-size: 1.467rem; font-weight: 400; }

/* ---------- login ---------- */
.login { max-width: 25rem; margin: 9vh auto 0; padding: 0 1rem; }
.login > p.legenda { margin-top: 1rem; }
.login .marca-logo { width: 3.6rem; height: 3.6rem; margin-bottom: .75rem; }
.login form { margin-top: 1.25rem; }
.completar-cadastro { margin: 0 0 1rem; }
.completar-cadastro form button + button { margin-left: .5rem; }
.google-entrar { margin-top: .25rem; }
.separador { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0 .9rem; font-size: .867rem; color: var(--muda); }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--gaze); }
/* botão do Google: a face acompanha o tema; o iframe oficial (transparente) cobre a face e recebe o clique */
.google-botao { position: relative; height: 2.6rem; overflow: hidden; border-radius: var(--raio); }
.google-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .6rem;
  border: 1px solid var(--borda); border-radius: var(--raio); background: var(--folha); color: var(--tinta);
  font: 600 .933rem/1.2 var(--fonte-ui); transition: background-color .15s ease;
}
.google-botao:hover .google-face { background: var(--leve); }
.google-botao:focus-within .google-face { outline: 2px solid var(--foco); outline-offset: 2px; }
#botao-google { position: absolute; top: 0; left: 0; width: 400px; opacity: .01; }
.login-links { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: 1.25rem; text-align: center; }
.login-links .legenda { margin: 0; }
.login form button[type=submit] { width: 100%; margin-top: .5rem; }
.tema-flutuante { position: fixed; top: .75rem; right: .75rem; z-index: 20; }

/* ---------- assinatura ---------- */
.assinatura .paywall, .assinatura .plano, .assinatura .cancelar-form {
  padding: 1rem 1.1rem; background: var(--folha); border: 1px solid var(--gaze); border-radius: var(--raio);
}
.assinatura .paywall { margin-bottom: 1.25rem; border-left: 4px solid var(--neg-fg); }
.assinatura .paywall h2 { margin-top: 0; }
.assinatura .cancelar-form { max-width: 34rem; margin: 0 0 1.25rem; }
.assinatura .cancelar-form h3 { margin-top: 0; }
.assinatura .cancelar-form button.perigo { background: var(--neg-fg); border-color: var(--neg-fg); color: var(--papel); }
.assin-acoes { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1.25rem; }
.assinatura [role=button].outline { background: transparent; color: var(--tinta); border-color: var(--borda); }
.segmento { display: inline-flex; gap: 2px; padding: 2px; margin: .25rem 0 1rem; border: 1px solid var(--borda); border-radius: 999px; }
.segmento button { min-height: 2rem; padding: .2rem .95rem; border-radius: 999px; background: transparent; border-color: transparent; color: var(--tinta); font-weight: 500; }
.segmento button:not([aria-pressed=true]):not(:disabled):hover { background: var(--leve); }
.segmento button[aria-pressed=true] { background: var(--acao); border-color: var(--acao); color: var(--acao-texto); }
.planos { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.plano { display: flex; flex-direction: column; gap: .35rem; }
.plano h3 { margin: 0; }
.plano p { margin: 0; }
.plano.atual { border-color: var(--acao); box-shadow: inset 0 0 0 1px var(--acao); }
.plano .preco { font-family: var(--fonte-titulo); font-size: 1.7rem; line-height: 1.15; margin-top: .35rem; }
.plano .preco small { font-family: var(--fonte-ui); font-size: .867rem; color: var(--muda); }
.plano button { margin-top: .75rem; }

/* ---------- administração (plano 27) ---------- */
/* casca: menu lateral (gaveta no celular) + cabeçalho com breadcrumb */
.admin-shell { min-height: 100vh; }
.admin-principal { min-width: 0; display: flex; flex-direction: column; }
.admin-menu {
  position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; gap: 1.25rem; width: min(18rem, 86vw);
  padding: 1rem; overflow-y: auto; background: var(--folha); border-right: 1px solid var(--gaze);
  transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
}
.menu-aberto .admin-menu { transform: none; visibility: visible; transition: transform .2s ease; }
.admin-veu { position: fixed; inset: 0; z-index: 49; background: color-mix(in srgb, var(--tinta) 45%, transparent); }
.admin-menu-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.admin-menu a.marca { color: var(--tinta); text-decoration: none; }
.admin-menu img { flex: none; }
.marca-textos { display: flex; flex-direction: column; min-width: 0; }
.admin-menu nav { display: flex; flex-direction: column; gap: 1.1rem; }
.menu-grupo { display: flex; flex-direction: column; gap: 2px; }
.menu-titulo { margin: 0 0 .25rem .25rem; font-size: .733rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muda); }
.menu-item {
  position: relative; display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem .55rem 1rem; border-radius: var(--raio);
  color: var(--tinta); font-weight: 500; text-decoration: none;
}
.menu-item:hover { background: var(--leve); }
.menu-item.ativa { background: color-mix(in srgb, var(--gaze) 55%, transparent); font-weight: 600; }
.menu-item.ativa::before { content: ""; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 3px; border-radius: 3px; background: var(--cera); }
.admin-menu-rodape { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--gaze); }
.menu-usuario { display: flex; flex-direction: column; padding: 0 .75rem .5rem; min-width: 0; }
.menu-usuario strong, .menu-usuario small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-usuario small { color: var(--muda); }
.menu-versao { display: block; padding: 0 .75rem .5rem; color: var(--muda); font-size: .75rem; }
.admin-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; min-height: 3.5rem; padding: .5rem 1rem;
  background: var(--papel); border-bottom: 1px solid var(--gaze);
}
.admin-header-acoes { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.migalhas { min-width: 0; }
.migalhas ol { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .4rem; margin: 0; padding: 0; list-style: none; font-size: .933rem; }
.migalhas li { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.migalhas li + li::before { content: "/"; color: var(--muda); }
.migalhas a { color: var(--muda); text-decoration: none; }
.migalhas a:hover { color: var(--tinta); text-decoration: underline; }
.migalhas [aria-current] { color: var(--tinta); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24rem; }
@media (min-width: 900px) {
  .admin-shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }
  .admin-menu { position: sticky; top: 0; z-index: 1; height: 100vh; width: auto; transform: none; visibility: visible; }
  .admin-veu, .menu-abrir, .menu-fechar { display: none !important; }
  .admin-header { padding: .5rem 2.5rem; }
}
.admin { padding-bottom: 3rem; }
.admin h2 { margin: 1.75rem 0 .6rem; }
.admin-acoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.admin-cartao { padding: 1rem 1.1rem; background: var(--folha); border: 1px solid var(--gaze); border-radius: var(--raio); }
.admin-cartao h3 { margin: 0 0 .5rem; }
.admin-cartao label { margin-bottom: .6rem; }
.admin-cartao label small, .assinatura .cancelar-form label small { display: inline; margin-left: .3rem; font-weight: 400; color: var(--muda); }
.admin-cartao button.perigo { background: var(--neg-fg); border-color: var(--neg-fg); color: var(--papel); }
.admin-cartao .assin-acoes { margin: .5rem 0 0; }
.admin-desfazer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1rem; padding: .85rem 1.1rem; background: var(--warn-bg); color: var(--warn-fg); border-left: 4px solid var(--warn-fg); border-radius: var(--raio); }
.admin-desfazer p { margin: .15rem 0 0; color: inherit; }
.admin-desfazer button { flex: none; }
.admin td.acoes, .estabelecimentos td.acoes { white-space: nowrap; }
.novo-operador { max-width: 34rem; margin: 1rem 0; }
.admin td.acoes input { max-width: 12rem; margin-right: .4rem; }
.estabelecimentos h2 { margin: 1.75rem 0 .6rem; }
.estabelecimentos td small { font-family: var(--fonte-ui); overflow-wrap: anywhere; }
.estabelecimentos .novo-estab { max-width: 34rem; margin: 1rem 0; }
.estabelecimentos .admin-cartao + .admin-cartao { margin-top: 1rem; }
.estabelecimentos .admin-cartao label { margin-bottom: .6rem; }
.estabelecimentos .admin-cartao label small { display: inline; margin-left: .3rem; font-weight: 400; color: var(--muda); }
.estab-sel { max-width: 14rem; min-height: 2rem; padding: .15rem 2rem .15rem .6rem; font-size: .8rem; }
.conta-cel { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-width: 0; }
.admin td small { font-family: var(--fonte-ui); overflow-wrap: anywhere; }
@media (max-width: 767px) { .conta-cel { align-items: flex-end; text-align: right; } }

/* ---------- guia de primeiros passos (plano 30) ---------- */
.guia { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: var(--folha); border: 1px solid var(--gaze); border-left: 4px solid var(--cera); border-radius: var(--raio); }
.guia-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; }
.guia h2 { margin: 0 0 .15rem; font-size: 1.2rem; }
.guia .legenda { margin: 0; }
.guia-lado { display: flex; gap: .25rem; }
.guia-barra { height: 4px; margin: .7rem 0 .2rem; background: var(--gaze); border-radius: 999px; overflow: hidden; }
.guia-barra span { display: block; height: 100%; background: var(--cera); border-radius: inherit; transition: width .3s ease; }
.guia-passos { list-style: none; margin: .4rem 0 0; padding: 0; }
.guia-passos li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .75rem 0; border-top: 1px solid var(--gaze); }
.guia-texto { flex: 1 1 22rem; min-width: 0; }
.guia-texto strong { margin-right: .4rem; }
.guia-texto .legenda { margin-top: .2rem; max-width: 62ch; }
.guia-passos li.feito strong { color: var(--muda); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--gaze); }
.guia-passos li:not(.atual):not(.feito) .guia-texto .legenda { display: none; }
.guia-acoes { display: flex; flex-wrap: wrap; gap: .4rem; }
.importar-erros { margin: .4rem 0 .6rem; padding-left: 1.1rem; font-weight: 400; font-size: .867rem; }
.estado-vazio { max-width: 60ch; padding: 1.1rem 0 1.4rem; }
.estado-vazio p { margin: 0 0 .8rem; color: var(--muda); line-height: 1.55; }
.estado-vazio .acoes-linha { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- celular: tabelas viram linhas separadas por régua ---------- */
@media (max-width: 767px) {
  table.cartoes, table.cartoes tbody, table.cartoes tfoot, table.cartoes tr, table.cartoes th, table.cartoes td { display: block; width: 100%; }
  table.cartoes thead { position: absolute; left: -9999px; }
  table.cartoes tr { padding: .75rem 0; border-bottom: 1px solid var(--gaze); }
  table.cartoes tbody tr > *, table.cartoes tfoot tr > * { border: 0; background: transparent; }
  table.cartoes.striped tbody tr:nth-child(odd) { background: transparent; }
  table.cartoes td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .25rem 0; white-space: normal; text-align: right; }
  table.cartoes td::before { content: attr(data-label); flex: none; color: var(--muda); font: 400 .8rem/1.5 var(--fonte-ui); text-align: left; }
  table.cartoes td.so-tela { display: none; }
  table.cartoes td[data-label=""]::before { display: none; }
  table.cartoes td:first-child { font-family: var(--fonte-titulo); font-size: 1.133rem; font-weight: 400; }
  table.cartoes td:empty { display: none; }
  table.cartoes td.acoes { justify-content: flex-end; gap: .5rem; padding-top: .5rem; }
  table.cartoes input, table.cartoes select { min-width: 0; width: 60%; max-width: 60%; }
  table.cartoes input.curto { width: 45%; }
  table.cartoes tfoot tr { border-top: 2px solid var(--tinta); border-bottom: 0; }
  table.cartoes tfoot th { display: flex; justify-content: space-between; border: 0; }
}
@media (max-width: 520px) {
  .linha-serv { grid-template-columns: 1fr 4rem; }
  .linha-serv .preco { grid-column: 1; }
  .linha-serv button { grid-column: 2; }
}

/* ---------- computador ---------- */
@media (min-width: 640px) {
  dialog[open] { align-items: center; }
  dialog > article { border-radius: 14px; }
}
@media (min-width: 768px) {
  .ordenar { display: none; }
}
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }
  .trilho {
    position: sticky; top: 0; display: flex; flex-direction: column; gap: 1.5rem; height: 100vh; padding: 1.5rem 1rem;
    border-right: 1px solid var(--gaze);
  }
  .trilho nav { display: flex; flex-direction: column; gap: 2px; }
  .trilho nav button { position: relative; padding-left: 1rem; }
  .trilho nav button.ativa { background: color-mix(in srgb, var(--gaze) 55%, transparent); font-weight: 600; }
  .trilho nav button.ativa::before { content: ""; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 3px; border-radius: 3px; background: var(--cera); }
  .trilho .novo-atend { width: 100%; }
  .trilho .rodape { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
  .topo { display: none; }
  .conteudo { padding: 2rem 2.5rem 3rem; }
  .titulo-aba { font-size: 2rem; }
  .barra-inferior, .mais-menu { display: none !important; }
  .agenda-grade { grid-template-columns: minmax(19rem, 26rem) minmax(0, 1fr); gap: 3rem; align-items: start; }
  .despesa-form { grid-template-columns: 2fr 1fr 1fr 1.2fr auto auto auto; }
  .login { margin-top: 14vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- novidades e posts (plano 34) ---------- */
.bolinha {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; margin-left: auto;
  border-radius: 999px; background: var(--cera); color: var(--acao-texto); font-size: .72rem; font-weight: 700; line-height: 1;
}
[data-theme=dark] .bolinha { color: #1b1406; }
.bolinha.ponto { position: absolute; top: .15rem; right: 22%; min-width: .7rem; width: .7rem; height: .7rem; padding: 0; margin: 0; }
.posts { max-width: 46rem; }
.posts-vazio { padding: 1.5rem 0; }
.posts-mes-titulo { margin: 1.4rem 0 .6rem; font-size: 1.133rem; color: var(--muda); }
.posts-mes:first-of-type .posts-mes-titulo { margin-top: 0; }
.post { padding: .9rem 1rem; margin-bottom: .75rem; background: var(--folha); border: 1px solid var(--gaze); border-left: 3px solid var(--gaze); border-radius: var(--raio); }
.post.nova { border-left-color: var(--cera); }
.post header { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .35rem; }
.post h3 { margin: 0 0 .35rem; }
.post-texto { margin: 0 0 .6rem; white-space: pre-line; overflow-wrap: anywhere; }
.post footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.post footer .legenda { margin: 0; }

/* administração: lista e editor de posts */
.admin-posts-editor { max-width: 40rem; }
.admin-posts-editor textarea { min-height: 9rem; resize: vertical; }
.admin-posts-linha { display: flex; flex-wrap: wrap; gap: .75rem; }
.admin-posts-linha > label { flex: 1 1 11rem; }

/* ---------- suporte: tickets (plano 37) ---------- */
.suporte { max-width: 46rem; }
button.ticket-linha, button.ticket-linha:not(:disabled):hover {
  display: flex; flex-direction: column; align-items: stretch; gap: .3rem; width: 100%; margin-bottom: .6rem; padding: .8rem 1rem; text-align: left;
  background: var(--folha); color: var(--tinta); border: 1px solid var(--gaze); border-left: 3px solid var(--gaze); border-radius: var(--raio); font-weight: 400;
}
button.ticket-linha:not(:disabled):hover { border-color: var(--borda); border-left-color: var(--borda); }
button.ticket-linha.nova, button.ticket-linha.nova:not(:disabled):hover { border-left-color: var(--cera); }
.ticket-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ticket-meta .legenda { margin: 0; }
.ticket-form { max-width: 40rem; }
.ticket-form textarea, .ticket-detalhe textarea { min-height: 8rem; resize: vertical; }
label.opcao { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.opcao input { width: auto; margin-top: .25rem; }
.ticket-detalhe h2 { margin-top: .6rem; }
.msg { max-width: 85%; margin: 0 0 .7rem; padding: .7rem .9rem; background: var(--folha); border: 1px solid var(--gaze); border-radius: var(--raio); }
.msg .post-texto { margin-bottom: .3rem; }
.msg .legenda { margin: 0; }
.msg.minha { margin-left: auto; background: var(--ok-bg); border-color: transparent; color: var(--ok-fg); }
.msg.minha .legenda { color: inherit; opacity: .8; }
.msg.interna { background: var(--warn-bg); border-color: transparent; color: var(--warn-fg); max-width: 100%; }
.msg.interna .legenda { color: inherit; opacity: .8; }
.msg.sistema { max-width: 100%; background: transparent; border-style: dashed; }
.admin-contexto { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem; margin: 0 0 .75rem; }
.admin-contexto > div { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .8rem; background: var(--folha); border: 1px solid var(--gaze); border-radius: var(--raio); min-width: 0; }
.admin-contexto small:first-child { color: var(--muda); }
.admin-contexto strong { overflow-wrap: anywhere; }

/* ---------- lixeira (plano 39) ---------- */
.lixeira { max-width: 60rem; }
.lixeira-conflito { max-width: 40rem; margin-bottom: 1rem; }
.lixeira-conflito ul { margin: 0 0 .5rem; }
.desfazer {
  position: fixed; left: 1rem; right: 1rem; bottom: 5.2rem; margin-inline: auto; width: max-content; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: .9rem;
  max-width: min(30rem, calc(100vw - 2rem)); padding: .6rem .6rem .6rem 1rem; background: var(--tinta); color: var(--papel); border-radius: var(--raio);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--tinta) 30%, transparent); animation: abrir .2s ease both;
}
.desfazer button { background: var(--acao-detalhe); color: var(--acao); border-color: transparent; }
@media (min-width: 900px) { .desfazer { bottom: 1.5rem; } }

/* ---------- caixa de confirmação (substitui o confirm() do navegador) ---------- */
dialog.dialogo-confirmar { z-index: 80; }
dialog.dialogo-confirmar > article { width: min(100%, 26rem); }
dialog.dialogo-confirmar header { margin-bottom: .6rem; }
dialog.dialogo-confirmar header p { font-size: 1.267rem; }
.dialogo-texto { margin: 0 0 1.25rem; color: var(--muda); overflow-wrap: anywhere; }
dialog.dialogo-confirmar footer button { min-width: 6.5rem; }
button.perigo-solido, button.perigo-solido:not(:disabled):hover { background: var(--neg-fg); border-color: var(--neg-fg); color: var(--neg-bg); }
button.perigo-solido:not(:disabled):hover { filter: brightness(.92); }

/* ---------- clientes: cadastro e seletor do atendimento ---------- */
.cliente-form { max-width: 60rem; margin-bottom: 1.25rem; }
.combo-cliente { position: relative; margin-bottom: 1rem; }
.combo-cliente > input { margin-bottom: .25rem; }
.combo-lista {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 17rem; overflow-y: auto; margin: 0; padding: .25rem; list-style: none;
  background: var(--folha); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: 0 6px 20px color-mix(in srgb, var(--tinta) 18%, transparent);
}
.combo-lista li { display: flex; flex-direction: column; padding: .5rem .65rem; border-radius: calc(var(--raio) - 3px); cursor: pointer; }
.combo-lista li small { color: var(--muda); }
.combo-lista li.ativa, .combo-lista li:hover { background: var(--leve); }
.combo-dica { display: block; color: var(--muda); }
.combo-dica.novo { color: var(--cera-texto); }
