/* ===========================================================================
   EXATA · layout + componentes
   =========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg-app);
  color: var(--tx);
  font-family: var(--ff);
  font-size: var(--fs-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: var(--gold-soft); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* scrollbars ------------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--bg-app); }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ SHELL ==================================== */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  transition: grid-template-columns var(--dur) var(--ease);
}
#app.sidebar-min { grid-template-columns: var(--sidebar-w-min) 1fr; }
/* --- estado recolhido: some com tudo que é texto, deixa só os ícones --- */
#app.sidebar-min .sidebar__brand-txt,
#app.sidebar-min .nav-sec__label,
#app.sidebar-min .nav-item__txt,
#app.sidebar-min .nav-item__badge,
#app.sidebar-min .nav-sub,
#app.sidebar-min .nav-sec__toggle > span:last-child,
#app.sidebar-min .sidebar__toggle span { display: none; }
#app.sidebar-min .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
#app.sidebar-min .sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }
#app.sidebar-min .sidebar__toggle { justify-content: center; }

/* ============================ SIDEBAR ================================== */
/* volta pro navy da marca (ela pediu de volta um pouco do azul depois do
   tema claro) - só a sidebar, o conteúdo continua claro pra ficar fácil de
   ler. Redefine os tokens de texto/linha/hover LOCALMENTE (a cascata do CSS
   custom property faz todo mundo dentro de .sidebar usar essa versão navy
   em vez da versão clara global), reaproveitando os tons já calibrados do
   tema escuro original. */
.sidebar {
  --tx-hi:  #f3f6f8;
  --tx:     #c8d6df;
  --tx-mut: #8ba0ac;
  --tx-dim: #5f7787;
  --bg-surface-2: rgba(255,255,255,.07);
  --line-soft: rgba(255,255,255,.08);
  --gold:    #d0a24a;
  --gold-hi: #e7bd63;
  --gold-soft: #d0a24a1f;
  background: #0f1f2e;
  border-right: 1px solid #0a1420;
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative; z-index: 30;
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-4);
  min-height: var(--topbar-h);
}
.sidebar__brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.sidebar__brand-txt { overflow: hidden; }
.sidebar__brand-txt b {
  display: block; font-size: var(--fs-16); letter-spacing: .16em;
  color: var(--tx-hi); font-weight: 700; white-space: nowrap;
}
.sidebar__brand-txt span {
  font-size: 9px; letter-spacing: .22em; color: var(--tx-dim);
  text-transform: uppercase; white-space: nowrap;
}
.sidebar-min .sidebar__brand-txt { opacity: 0; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: var(--s-2) var(--s-3) var(--s-4); }
.nav-sec { margin-top: var(--s-4); }
.nav-sec:first-child { margin-top: 0; }
.nav-sec__label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tx-dim); padding: var(--s-3) var(--s-3) var(--s-2); white-space: nowrap;
}
.sidebar-min .nav-sec__label { opacity: 0; height: 10px; }

.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px var(--s-3); border-radius: var(--r-sm);
  color: var(--tx-mut); white-space: nowrap; position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--bg-surface-2); color: var(--tx); }
.nav-item.is-active { background: var(--gold-soft); color: var(--gold-hi); }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--gold); border-radius: 0 3px 3px 0;
}
.nav-item__badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--err); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.sidebar-min .nav-item__txt, .sidebar-min .nav-item__badge { opacity: 0; }
.nav-sub { margin: 2px 0 2px 8px; padding-left: 12px; border-left: 1px solid var(--line-soft); }
.sidebar-min .nav-sub { display: none; }

.sidebar__foot { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line-soft); }
.sidebar__toggle {
  display: flex; align-items: center; gap: var(--s-3); color: var(--tx-dim);
  font-size: var(--fs-12); padding: var(--s-2); width: 100%; border-radius: var(--r-sm);
  white-space: nowrap; overflow: hidden;
}
.sidebar__toggle svg { flex: none; }
.sidebar-min .sidebar__toggle span { opacity: 0; }
.sidebar__toggle:hover { background: var(--bg-surface-2); color: var(--tx); }
.sidebar__toggle svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.sidebar-min .sidebar__toggle svg { transform: rotate(180deg); }

/* ============================ MAIN + TOPBAR =========================== */
.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  --tx-hi:  #f3f6f8;
  --tx:     #c8d6df;
  --tx-mut: #8ba0ac;
  --tx-dim: #5f7787;
  --bg-app: #0f1f2e;              /* pro anel do .icon-btn__dot combinar com o fundo daqui */
  --bg-input: rgba(255,255,255,.09);
  --bg-surface-2: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.16);
  --line-soft: rgba(255,255,255,.08);
  --cyan: #3fd8d8;
  --cyan-soft: #3fd8d81a;
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: var(--s-4);
  padding: 0 var(--s-6); border-bottom: 1px solid var(--line-soft);
  background: #0f1f2e;
}
.search {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px var(--s-4); width: 340px; max-width: 40vw;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search:focus-within { border-color: var(--cyan-line); box-shadow: var(--glow-cyan); }
.search svg { width: 15px; height: 15px; color: var(--tx-dim); flex: none; }
.search input { flex: 1; background: none; border: 0; color: var(--tx-hi); outline: none; font-size: var(--fs-13); }
.search input::placeholder { color: var(--tx-dim); }

.topbar__spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--tx-mut); position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--bg-surface-2); color: var(--tx-hi); }
.sitax-mini-acao:hover { background: var(--cyan-soft); color: var(--cyan); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: var(--r-pill); background: var(--err); color: #fff; font-size: 9px;
  font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg-app);
}
.user {
  display: flex; align-items: center; gap: var(--s-3); padding: 5px var(--s-3);
  border-radius: var(--r-pill); border: 1px solid var(--line);
}
.user:hover { background: var(--bg-surface-2); }
.user__av {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-hi)); color: var(--gold-ink);
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-12);
}
.user__name { font-size: var(--fs-13); color: var(--tx-hi); }

/* ============================ VIEW =================================== */
.view { flex: 1; overflow-y: auto; padding: var(--s-7) var(--s-8) var(--s-9); }
.view > * { animation: rise var(--dur) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* -- hero navy do Dashboard (ela pediu um pouco de azul aqui também) -- */
/* redefine --tx-hi/--tx-mut localmente (mesmo truque do .sidebar/.topbar) -
   assim .page-head .lead / .page-head p (regras já existentes, que esse
   bloco reaproveita via `class="dash-hero page-head"`) resolvem pra cor
   clara sozinhas, sem precisar duplicar font-size/weight aqui. */
.dash-hero {
  --tx-hi: #ffffff;
  --tx-mut: #9db2bf;
  background: linear-gradient(135deg, #122436, #0c1826 65%);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-7);
  position: relative; overflow: hidden;
}
.dash-hero::after {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 260px; height: 260px;
  background: radial-gradient(closest-side, #d0a24a2e, transparent);
  pointer-events: none; z-index: 0;
}
.dash-hero .lead, .dash-hero p, .dash-hero .live { position: relative; z-index: 1; }
.dash-hero .live {
  display: inline-flex; align-items: center; gap: 7px; margin-top: var(--s-4);
  font-size: var(--fs-11); font-family: var(--ff-mono); color: #7fd4d4;
}
.dash-hero .live i {
  width: 6px; height: 6px; border-radius: 50%; background: #3fd8d8; font-style: normal;
  box-shadow: 0 0 0 0 #3fd8d866; animation: livepulse 1.8s ease-out infinite;
}
@keyframes livepulse {
  0%   { box-shadow: 0 0 0 0 #3fd8d866; }
  70%  { box-shadow: 0 0 0 7px #3fd8d800; }
  100% { box-shadow: 0 0 0 0 #3fd8d800; }
}

/* -- indicador "ao vivo" reutilizável (Pendências, etc.) -- */
.live-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-11); font-family: var(--ff-mono); color: var(--tx-dim);
}
.live-chip i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); font-style: normal;
  box-shadow: 0 0 0 0 #0e8f8f55; animation: livepulse2 1.8s ease-out infinite;
}
@keyframes livepulse2 {
  0%   { box-shadow: 0 0 0 0 #0e8f8f55; }
  70%  { box-shadow: 0 0 0 7px #0e8f8f00; }
  100% { box-shadow: 0 0 0 0 #0e8f8f00; }
}

.page-head { margin-bottom: var(--s-6); }
.page-head h1 { font-size: var(--fs-24); color: var(--tx-hi); font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--tx-mut); font-size: var(--fs-13); margin-top: 2px; }
.page-head .lead { font-size: var(--fs-30); font-weight: 700; color: var(--tx-hi); }

.section-title {
  display: flex; align-items: center; gap: var(--s-3); margin: var(--s-7) 0 var(--s-4);
  font-size: var(--fs-13); letter-spacing: .12em; text-transform: uppercase; color: var(--tx-mut);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* ============================ KPI ================================== */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 1500px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
/* 5 cards (Faturamento SITAX) -- classe própria, não repete(6), pra não
   sobrar coluna vazia/card espremido; mesmos breakpoints do .kpi-grid. */
.kpi-grid--5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 1100px) { .kpi-grid--5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .kpi-grid--5 { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--s-5); position: relative; overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.kpi:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent, var(--gold)); opacity: .8;
}
.kpi__val { font-size: var(--fs-30); font-weight: 700; color: var(--tx-hi); font-family: var(--ff-mono); letter-spacing: -.02em; }
.kpi__lbl { font-size: var(--fs-12); color: var(--tx-mut); margin-top: 2px; }
.kpi__ico { position: absolute; top: var(--s-4); right: var(--s-4); color: var(--tx-dim); }
.kpi__ico svg { width: 18px; height: 18px; }
.kpi--gold { --accent: var(--gold); }
.kpi--cyan { --accent: var(--cyan); }
.kpi--ok   { --accent: var(--ok); }
.kpi--warn { --accent: var(--warn); }
.kpi--err  { --accent: var(--err); }

/* ============================ CARDS DE AUTOMAÇÃO ==================== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.acard {
  background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3);
  position: relative; transition: border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.acard:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--sh-md); }
.acard__top { display: flex; align-items: flex-start; gap: var(--s-3); }
.acard__ico {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  background: var(--gold-soft); color: var(--gold-hi); display: grid; place-items: center;
}
.acard__ico svg { width: 19px; height: 19px; }
.acard__hd { flex: 1; min-width: 0; }
.acard__name { font-size: var(--fs-14); font-weight: 700; color: var(--tx-hi); }
.acard__desc { font-size: var(--fs-12); color: var(--tx-mut); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard__menu { flex: none; }

.acard__meta { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-12); color: var(--tx-dim); font-family: var(--ff-mono); }
.acard__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.acard__meta .next { color: var(--cyan); }

.acard__resumo {
  background: var(--bg-input); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
}
.acard__resumo-hd { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-12); font-weight: 600; color: var(--tx); }
.acard__metrics { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.acard__raw { font-family: var(--ff-mono); font-size: var(--fs-11); color: var(--tx-mut); margin-top: var(--s-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.acard__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); margin-top: auto; padding-top: var(--s-2); }

/* seletor de mês (competência) ao lado do botão Executar */
.acard__comp {
  background: var(--bg-input); border: 1px solid var(--line); color: var(--tx-hi);
  border-radius: var(--r-sm); padding: 6px 8px; font: inherit; font-size: var(--fs-12);
  font-family: var(--ff-mono); cursor: pointer;
  transition: border-color var(--dur) var(--ease);
  /* sem isso, o seletor de CLIENTE (137 opções, nomes longos) estica pra
     caber a opção mais comprida e fica enorme/desproporcional ao lado do
     seletor de competência -- trava a largura fechada, a lista aberta
     continua mostrando o nome inteiro normalmente. */
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acard__comp:hover { border-color: var(--line-strong); }
.acard__comp:focus { outline: none; border-color: var(--cyan-line); }

/* barra ciano quando rodando */
.acard.is-running { border-color: var(--cyan-line); }
.acard.is-running::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  background-size: 40% 100%; animation: sweep 1.4s linear infinite; border-radius: var(--r-md) var(--r-md) 0 0;
}
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ============================ BADGES / PILLS ====================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; }
.badge--ok      { background: var(--ok-soft);   color: var(--ok);   border-color: #1f9d5c33; }
.badge--ok .badge__dot { background: var(--ok); }
.badge--warn    { background: var(--warn-soft); color: var(--warn); border-color: #b5690c33; }
.badge--warn .badge__dot { background: var(--warn); }
.badge--erro    { background: var(--err-soft);  color: var(--err);  border-color: #d1453d33; }
.badge--erro .badge__dot { background: var(--err); }
.badge--andamento { background: var(--cyan-soft); color: var(--cyan); border-color: #0e8f8f33; }
.badge--andamento .badge__dot { background: var(--cyan); animation: pulse 1.2s var(--ease) infinite; }
.badge--neutro  { background: var(--bg-surface-2); color: var(--tx-mut); border-color: var(--line); }
.badge--neutro .badge__dot { background: var(--neutral); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }

.metric {
  display: inline-flex; align-items: baseline; gap: 4px; font-size: var(--fs-11);
  padding: 2px 7px; border-radius: var(--r-xs); background: var(--bg-surface-2); color: var(--tx-mut);
}
.metric b { font-family: var(--ff-mono); font-size: var(--fs-12); color: var(--tx-hi); }
.metric--ok b   { color: var(--ok); }
.metric--warn b { color: var(--warn); }
.metric--erro b { color: var(--err); }

/* ============================ BOTÕES ============================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px;
  border-radius: var(--r-sm); font-size: var(--fs-13); font-weight: 600;
  border: 1px solid var(--line); color: var(--tx);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--bg-surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-hi)); color: var(--gold-ink);
  border-color: #0000;
}
.btn--primary:hover { box-shadow: var(--glow-gold); background: var(--gold-hi); }
.btn--ghost { border-color: transparent; color: var(--tx-mut); }
.btn--ghost:hover { color: var(--tx-hi); background: var(--bg-surface-2); }
.btn--sm { padding: 6px 11px; font-size: var(--fs-12); }
.btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn--running { background: var(--cyan-soft); color: var(--cyan); border-color: var(--cyan-line); }

/* ============================ INPUTS ========================== */
.cfg-in {
  background: var(--bg-input); border: 1px solid var(--line); color: var(--tx-hi);
  border-radius: var(--r-sm); padding: 7px 11px; font: inherit; font-size: var(--fs-13);
  outline: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.cfg-in:focus { border-color: var(--cyan-line); box-shadow: var(--glow-cyan); }
select.cfg-in { cursor: pointer; }

/* ============================ TABELA ============================ */
.table-wrap { border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.tbl thead th {
  text-align: left; padding: var(--s-3) var(--s-4); font-size: var(--fs-11);
  letter-spacing: .08em; text-transform: uppercase; color: var(--tx-dim);
  background: var(--bg-sidebar); border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line-soft); color: var(--tx); }
/* coluna de ação sempre visível mesmo com a tabela rolando pro lado (tabela
   larga demais empurrava o botão pra fora da tela sem dar pra perceber que
   dava pra rolar -- achado 2026-09-15, Controle de Envios). */
.envios-col-acao { position: sticky; right: 0; background: var(--bg-surface); box-shadow: -6px 0 8px -6px rgb(0 0 0 / .12); }
.tbl thead th.envios-col-acao { background: var(--bg-sidebar); }
.tbl tbody tr:hover td.envios-col-acao { background: var(--bg-surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--dur) var(--ease); }
.tbl tbody tr:hover { background: var(--bg-surface-2); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .mono { font-family: var(--ff-mono); color: var(--tx-mut); }

/* ============================ PENDÊNCIAS ======================= */
.pend-group { margin-bottom: var(--s-6); }
.pend-group__hd { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); font-weight: 700; color: var(--tx-hi); }
.pend-item {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4);
  background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  margin-bottom: var(--s-2); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.pend-item:hover { border-color: var(--line-strong); transform: translateX(3px); }
.pend-item .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--err); flex: none; }
.pend-item.alerta .bar { background: var(--warn); }
.pend-item .txt { flex: 1; min-width: 0; }
.pend-item .txt b { display: block; font-size: var(--fs-13); color: var(--tx-hi); }
.pend-item .txt span { font-size: var(--fs-12); color: var(--tx-mut); font-family: var(--ff-mono);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================ MODAL =========================== */
.modal-bg {
  position: fixed; inset: 0; background: #060c11cc; backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: var(--s-6);
  animation: fade var(--dur) var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); width: min(760px, 100%); max-height: 82vh; display: flex; flex-direction: column;
  animation: pop var(--dur) var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.modal__hd { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line); }
.modal__hd h3 { font-size: var(--fs-16); color: var(--tx-hi); flex: 1; }
.modal__body { padding: var(--s-6); overflow-y: auto; }
.modal__foot { padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--s-2); }
pre.raw {
  background: var(--bg-input); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: var(--s-4); font-family: var(--ff-mono); font-size: var(--fs-12); color: var(--tx);
  white-space: pre-wrap; word-break: break-word; max-height: 46vh; overflow-y: auto;
}

/* ============================ DROPDOWN ======================== */
.dropdown {
  position: absolute; z-index: 60; background: var(--bg-elevated); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--sh-lg); min-width: 240px; padding: var(--s-2);
  animation: pop calc(var(--dur) * .8) var(--ease);
}
.dropdown__item {
  display: flex; align-items: center; gap: var(--s-3); padding: 9px var(--s-3);
  border-radius: var(--r-xs); font-size: var(--fs-13); color: var(--tx); width: 100%; text-align: left;
}
.dropdown__item:hover { background: var(--bg-surface-2); color: var(--tx-hi); }
.dropdown__item svg { width: 15px; height: 15px; color: var(--tx-mut); }
.dropdown__sep { height: 1px; background: var(--line-soft); margin: var(--s-2) 0; }
.dropdown__head { padding: var(--s-3) var(--s-3) var(--s-2); font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .1em; color: var(--tx-dim); }

/* ============================ TOAST ========================== */
.toasts { position: fixed; right: var(--s-6); bottom: var(--s-6); z-index: 200; display: flex; flex-direction: column; gap: var(--s-2); }
.toast {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4);
  background: var(--bg-elevated); border: 1px solid var(--line-strong); border-left-width: 3px;
  border-radius: var(--r-sm); box-shadow: var(--sh-md); font-size: var(--fs-13); color: var(--tx-hi);
  min-width: 260px; animation: slide-in var(--dur) var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } }
.toast.ok   { border-left-color: var(--ok); }
.toast.err  { border-left-color: var(--err); }
.toast.info { border-left-color: var(--cyan); }
.toast svg { width: 16px; height: 16px; flex: none; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--err); } .toast.info svg { color: var(--cyan); }

/* ============================ SKELETON / EMPTY =============== */
.skel { background: linear-gradient(100deg, var(--bg-surface) 30%, var(--bg-surface-2) 50%, var(--bg-surface) 70%);
  background-size: 220% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -220% 0; } }
.skel-card { height: 172px; }
.empty { text-align: center; padding: var(--s-9) var(--s-6); color: var(--tx-mut); }
.empty svg { width: 40px; height: 40px; color: var(--tx-dim); margin-bottom: var(--s-3); }
.empty b { display: block; color: var(--tx-hi); font-size: var(--fs-16); margin-bottom: 4px; }

/* ============================ TOOLTIP ======================= */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); color: var(--tx-hi); border: 1px solid var(--line-strong);
  padding: 5px 9px; border-radius: var(--r-xs); font-size: var(--fs-11); white-space: nowrap;
  box-shadow: var(--sh-md); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); z-index: 90;
}
[data-tip]:hover::after { opacity: 1; }

/* ============================ SPLASH ======================= */
.splash {
  position: fixed; inset: 0; z-index: 500; background: radial-gradient(120% 90% at 50% 0%, #fbf3e2, var(--bg-app));
  display: grid; place-items: center; animation: fade .3s var(--ease);
}
.splash.out { animation: fade-out .4s var(--ease) forwards; }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }
.splash__box { text-align: center; animation: rise .5s var(--ease) both; }
.splash__box img { width: 118px; height: 118px; object-fit: contain; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.splash__box h1 { font-size: var(--fs-24); letter-spacing: .28em; color: var(--tx-hi); margin-top: var(--s-4); font-weight: 700; }
.splash__box p { font-size: var(--fs-12); letter-spacing: .3em; text-transform: uppercase; color: var(--tx-dim); margin-top: 4px; }
.splash__box .btn { margin-top: var(--s-7); padding: 11px 34px; }
.splash__line { width: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: var(--s-6) auto 0; animation: grow 1s var(--ease) .3s both; }
@keyframes grow { to { width: 240px; } }

/* ============================ FECHAMENTO MENSAL ============ */
.fech-bar {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.fech-bar__sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 2px; }
.fech-bar__spacer { flex: 1; }
.fech-bar__gerado { font-size: var(--fs-11); color: var(--tx-dim); font-family: var(--ff-mono); }
.fech-select {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--tx-mut);
}
.fech-select select {
  background: none; border: 0; color: var(--tx-hi); font: inherit; font-size: var(--fs-12);
  outline: none; cursor: pointer;
}
.fech-select select option { background: var(--bg-elevated); }

.fech-resumo {
  display: grid; grid-template-columns: 220px 1fr; gap: var(--s-4);
  margin-bottom: var(--s-5);
}
@media (max-width: 900px) { .fech-resumo { grid-template-columns: 1fr; } }
.fech-kpi {
  background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--s-4); display: flex; flex-direction: column; gap: 6px; justify-content: center;
}
.fech-kpi__big { font-size: 40px; font-weight: 700; color: var(--gold-hi); line-height: 1; font-family: var(--ff-mono); }
.fech-kpi__big i { font-size: 18px; font-style: normal; color: var(--tx-mut); margin-left: 2px; }
.fech-kpi__sub { font-size: var(--fs-12); color: var(--tx-mut); }
.fech-kpi__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tag {
  font-size: var(--fs-11); padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--bg-surface-2); color: var(--tx-mut); border: 1px solid var(--line);
}
.tag--warn { background: var(--warn-soft); color: var(--warn); border-color: #b5690c33; }
.tag--erro { background: var(--err-soft); color: var(--err); border-color: #d1453d33; }

/* -- resumo compacto: cabeçalho + barra + chips + falta -- */
.fech-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); }
.fech-head__side { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.fech-resumo {
  background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.fech-prog { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-12); color: var(--tx-mut); flex-wrap: wrap; }
.fech-prog__bar { flex: 1; min-width: 120px; max-width: 320px; height: 8px; border-radius: 4px; background: var(--bg-surface-2); overflow: hidden; }
.fech-prog__bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .4s var(--ease); }
.fech-prog b { color: var(--tx-hi); font-family: var(--ff-mono); }
.fech-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.fech-chip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 11px;
  border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line-strong));
  border-radius: var(--r-pill); background: var(--bg-surface);
  font: inherit; font-size: var(--fs-12); color: var(--tx-mut); cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.fech-chip:hover:not(:disabled) { background: var(--bg-surface-2); }
.fech-chip.is-on { background: var(--c); border-color: var(--c); color: #fff; }
.fech-chip.is-on b { color: #fff; }
/* dourado puro não tem contraste com texto branco — escurece só quando ativo */
.fech-chip[data-sit="andamento"].is-on { background: var(--gold-hi); border-color: var(--gold-hi); }
.fech-chip b { color: var(--tx-hi); font-family: var(--ff-mono); font-size: var(--fs-13); }
.fech-chip:disabled { opacity: .4; cursor: default; }
/* chip "sem movimento" — mais apagado, não é uma pendência */
.fech-chip--mut { border-left-color: var(--line-strong); color: var(--tx-dim); }
.fech-chip--mut b { color: var(--tx-mut); }
.fech-chip--mut.is-on { background: var(--tx-mut); border-color: var(--tx-mut); color: #fff; }
.fech-chip--mut.is-on b { color: #fff; }
.fech-falta2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fech-falta2 > span { color: var(--tx-dim); text-transform: uppercase; letter-spacing: .09em; font-size: var(--fs-11); margin-right: 2px; }
.fech-falta2__it {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 9px;
  border: 1px solid #b5690c33; border-radius: var(--r-pill); background: var(--warn-soft);
  font: inherit; font-size: var(--fs-12); color: var(--tx-mut); cursor: pointer;
}
.fech-falta2__it:hover { background: #b5690c1f; }
.fech-falta2__it.is-on { background: var(--warn); border-color: var(--warn); color: #fff; }
.fech-falta2__it.is-on b, .fech-falta2__it.is-on i { color: #fff; }
.fech-falta2__it b { color: var(--tx-hi); font-family: var(--ff-mono); }
.fech-falta2__it i { color: var(--err); font-style: normal; }

/* -- legenda da matriz -- */
.fech-legenda {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center;
  padding: var(--s-3) var(--s-1) 0; font-size: var(--fs-11); color: var(--tx-mut);
}
.fech-legenda > span { display: inline-flex; align-items: center; gap: 6px; }
.fech-cell--mini { width: 18px; height: 18px; font-size: 11px; cursor: default; }
.fech-cell--mini:hover { transform: none; box-shadow: none; }
.fech-mbadge {
  font-style: normal; font-size: 9px; font-weight: 700; line-height: 1;
  background: var(--gold); color: var(--gold-ink); border-radius: 3px; padding: 2px 3px;
}
.fech-pop__ver {
  background: none; border: none; padding: 2px 0 0; font: inherit; font-size: var(--fs-11);
  color: var(--gold-hi); cursor: pointer; text-align: left;
}
.fech-pop__ver:hover { text-decoration: underline; }

/* -- a matriz -- */
/* sem scroll interno: a tabela flui na altura toda da .view e o cabeçalho
   das colunas gruda no topo enquanto ela rola (uma barra de rolagem só). */
.fech-wrap { overflow: visible; border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.fech-tbl { border-collapse: separate; border-spacing: 0; }
/* -s-7 = padding-top da .view: faz o cabeçalho grudar rente ao topo da área
   de conteúdo (sem deixar meia-linha aparecer acima dele). */
.fech-tbl thead th { position: sticky; top: calc(-1 * var(--s-7)); z-index: 3; box-shadow: 0 1px 0 var(--line); }
.fech-tbl thead th:not(.fech-cli) { text-align: center; }
.fech-tbl th.fech-cli, .fech-tbl td.fech-cli {
  position: sticky; left: 0; z-index: 2; background: var(--bg-surface);
  min-width: 220px; max-width: 260px;
}
.fech-tbl thead th.fech-cli { z-index: 4; background: var(--bg-sidebar); }
/* cabeçalho de grupo (RECEBIMENTO/FISCAL/...) NÃO gruda no topo -- só a
   linha de baixo (etapa a etapa) fica fixa, senão as duas linhas sticky
   tentariam ocupar o mesmo "top" e ficariam uma em cima da outra. */
.fech-tbl thead th.fech-tbl__grupo {
  position: static; background: var(--bg-surface-2); color: var(--tx-dim);
  font-size: var(--fs-11); letter-spacing: .08em; text-transform: uppercase;
  font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line-soft);
}
.fech-tbl thead th { white-space: nowrap; }
.fech-tbl td { text-align: center; padding: 5px 6px; border-bottom: 1px solid var(--line-soft); }
.fech-tbl tbody tr:hover td { background: var(--bg-surface-2); }
.fech-tbl tbody tr:hover td.fech-cli { background: var(--bg-elevated); }
.fech-cli b { display: block; color: var(--tx-hi); font-size: var(--fs-12); cursor: pointer; }
.fech-cli b:hover { color: var(--gold-hi); }
.fech-cli__cnpj { font-size: 10px; color: var(--tx-dim); font-family: var(--ff-mono); }
.fech-cli { text-align: left !important; }

.fech-grp td {
  background: var(--bg-sidebar) !important; color: var(--tx-mut);
  font-size: var(--fs-11); letter-spacing: .1em; text-transform: uppercase;
  padding: 7px var(--s-4) !important; text-align: left !important; position: sticky; left: 0;
}
.fech-grp td span { color: var(--tx-dim); font-family: var(--ff-mono); margin-left: 6px; }

.fech-cell {
  width: 26px; height: 26px; border-radius: var(--r-xs); border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  font-size: var(--fs-13); font-weight: 700; cursor: pointer; line-height: 1;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.fech-cell:hover { transform: scale(1.12); box-shadow: var(--sh-sm); }
.fech-cell i {
  position: absolute; top: -4px; right: -4px; font-style: normal; font-size: 8px;
  background: var(--gold); color: var(--gold-ink); border-radius: 3px; padding: 0 2px; font-weight: 700;
}
.fech-cell--ok    { background: var(--ok-soft);   color: var(--ok);   border-color: #1f9d5c33; }
.fech-cell--pend  { background: var(--warn-soft); color: var(--warn); border-color: #b5690c33; }
.fech-cell--erro  { background: var(--err-soft);  color: var(--err);  border-color: #d1453d33; }
.fech-cell--warn  { background: var(--warn-soft); color: var(--warn); border-color: #b5690c55; }
/* "sem movimento" e "não se aplica": marca única, bem discreta */
.fech-cell--nada  { background: transparent; color: var(--line-strong); font-weight: 400; cursor: default; }
.fech-cell--nada:hover { transform: none; box-shadow: none; }

/* -- popover de célula -- */
.fech-pop { width: 300px; padding: var(--s-3); display: flex; flex-direction: column; gap: 8px; }
.fech-pop__hd { display: flex; flex-direction: column; }
.fech-pop__hd b { color: var(--tx-hi); font-size: var(--fs-13); }
.fech-pop__hd span { font-size: var(--fs-11); color: var(--tx-mut); text-transform: uppercase; letter-spacing: .08em; }
.fech-pop__st {
  display: inline-flex; align-self: flex-start; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-11); font-weight: 600;
}
.fech-pop p { font-size: var(--fs-12); color: var(--tx); margin: 0; }
.fech-pop__meta { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--tx-dim); font-family: var(--ff-mono); }
.fech-pop textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--r-xs);
  color: var(--tx-hi); font: inherit; font-size: var(--fs-12); padding: 6px 8px; resize: vertical;
}
.fech-pop__acoes { display: flex; gap: 5px; flex-wrap: wrap; }
.fech-pop__acoes .btn { padding: 5px 9px; font-size: var(--fs-11); }

/* ============================ CONFERÊNCIA DAS =============== */
.das-tabs {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  margin-bottom: var(--s-6); border-bottom: 1px solid var(--line-soft); padding-bottom: var(--s-3);
}
.das-tab {
  padding: 7px 14px; border-radius: var(--r-pill); font-size: var(--fs-13); font-weight: 600;
  color: var(--tx-mut); transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.das-tab:hover { background: var(--bg-surface-2); color: var(--tx-hi); }
.das-tab.is-active { background: var(--gold-soft); color: var(--gold-hi); }
.das-tabs__spacer { flex: 1; }

/* ============================ RESPONSIVO =================== */
@media (max-width: 1180px) {
  #app { grid-template-columns: var(--sidebar-w-min) 1fr; }
  #app .sidebar__brand-txt, #app .nav-sec__label, #app .nav-item__txt,
  #app .nav-item__badge, #app .nav-sub, #app .sidebar__toggle span { opacity: 0; }
  #app.sidebar-open { grid-template-columns: var(--sidebar-w) 1fr; }
  #app.sidebar-open .sidebar__brand-txt, #app.sidebar-open .nav-sec__label,
  #app.sidebar-open .nav-item__txt, #app.sidebar-open .nav-item__badge,
  #app.sidebar-open .nav-sub, #app.sidebar-open .sidebar__toggle span { opacity: 1; }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); transform: translateX(-100%);
    transition: transform var(--dur) var(--ease); box-shadow: var(--sh-lg); }
  #app.sidebar-open .sidebar { transform: none; }
  #app.sidebar-open::before { content: ""; position: fixed; inset: 0; background: #000a; z-index: 20; }
  .search { width: 200px; }
  .view { padding: var(--s-5) var(--s-5) var(--s-8); }
  .user__name { display: none; }
}

/* ================= Rotina do Mês (sequência de automações) ============= */
.seq-card {
  background: var(--bg-surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: var(--s-5); margin-bottom: var(--s-5);
}
.seq-card--historico { opacity: .9; }
.seq-card__hd { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-14); color: var(--tx-hi); margin-bottom: var(--s-3); }
.seq-card__acoes { margin-top: var(--s-5); }
.seq-nota, .seq-form-lbl { color: var(--tx-mut); font-size: var(--fs-12); }
.seq-nota { margin: 0 0 var(--s-3); }
.seq-form-lbl { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.seq-form-linha { display: flex; align-items: center; gap: var(--s-3); }

.seq-lista { display: flex; flex-direction: column; gap: 2px; }
.seq-passo {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-13);
  background: var(--bg-app); border: 1px solid transparent;
}
.seq-passo__ico { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.seq-passo__ico svg { width: 15px; height: 15px; }
.seq-passo__nome { color: var(--tx-hi); }
.seq-passo__status { margin-left: auto; color: var(--tx-mut); font-family: var(--ff-mono); font-size: var(--fs-11); }
.seq-passo--rodando { border-color: var(--cyan); }
.seq-passo--rodando .seq-passo__ico { color: var(--cyan); animation: seq-spin 1s linear infinite; }
.seq-passo--ok      .seq-passo__ico { color: var(--ok); }
.seq-passo--atencao .seq-passo__ico { color: var(--warn); }
.seq-passo--erro    .seq-passo__ico { color: var(--err); }
.seq-passo--erro    { border-color: var(--err); }
@keyframes seq-spin { to { transform: rotate(360deg); } }

.seq-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.seq-dot--pulado { background: var(--tx-dim); opacity: .5; }

.seq-checks { display: flex; flex-direction: column; gap: 4px; }
.seq-check {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px 10px; border-radius: var(--r-sm); background: var(--bg-app);
  cursor: pointer; font-size: var(--fs-13); color: var(--tx-hi);
}
.seq-check:hover { background: var(--bg-surface-2); }
.seq-check--off { opacity: .5; cursor: not-allowed; }
.seq-check__n {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--bg-surface-2); color: var(--tx-mut);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-11); font-family: var(--ff-mono);
}
.seq-check__aviso { margin-left: auto; color: var(--err); font-size: var(--fs-11); }

.seq-confirma { margin: 4px 0 10px; padding-left: 20px; color: var(--tx-hi); font-size: var(--fs-13); }
.seq-confirma li { margin: 2px 0; }
.seq-callout {
  display: block; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: var(--fs-12); margin: 8px 0 0;
}
.seq-callout--warn { background: var(--warn-soft); color: var(--warn); }

/* =======================================================================
   Central de Pendências + torre de controle do Dashboard (Etapa 2)
   ======================================================================= */
.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kpi.is-active { border-color: var(--accent); background: var(--bg-surface-2); }

/* -- faixa de alerta no topo do dashboard (rotina rodando / parada) -- */
.tower-alert {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bg-surface);
  margin-top: var(--s-5); font-size: var(--fs-13); color: var(--tx-hi);
}
.tower-alert--run { border-color: var(--cyan-line); background: var(--cyan-soft); }
.tower-alert--warn { border-color: #b5690c44; background: var(--warn-soft); }
.tower-alert span { flex: 1; min-width: 180px; }
.tower-alert__bar { width: 140px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tower-alert__bar i { display: block; height: 100%; background: var(--cyan); }

.tower-card {
  background: var(--bg-surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: var(--s-5);
}

/* -- barras de progresso do fechamento no dashboard -- */
.fechbar { display: flex; flex-direction: column; gap: var(--s-3); }
.fechbar__row {
  display: grid; grid-template-columns: 130px 1fr 54px auto; align-items: center;
  gap: var(--s-3); font-size: var(--fs-12);
}
.fechbar__nome { color: var(--tx-hi); font-weight: 600; }
.fechbar__track { height: 7px; border-radius: 4px; background: var(--bg-surface-2); overflow: hidden; }
.fechbar__track i { display: block; height: 100%; border-radius: 4px; transition: width var(--dur) var(--ease); }
.fechbar__num { font-family: var(--ff-mono); color: var(--tx-mut); text-align: right; }
.fechbar__extra { color: var(--tx-dim); font-size: var(--fs-11); }
@media (max-width: 720px) {
  .fechbar__row { grid-template-columns: 1fr 46px; grid-auto-flow: row; }
  .fechbar__track { grid-column: 1 / -1; }
  .fechbar__extra { grid-column: 1 / -1; }
}

/* -- item de pendência (Central + Dashboard) -- */
.cpend .txt b { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.cpend__prio { font-size: var(--fs-11); font-weight: 600; font-family: var(--ff-mono); }
.cpend__meta {
  font-size: var(--fs-12); color: var(--tx-mut); font-family: var(--ff-mono);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cpend__det {
  font-size: var(--fs-12); color: var(--tx-dim); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.cpend__acoes { display: flex; align-items: center; gap: var(--s-1); flex: none; flex-wrap: wrap; justify-content: flex-end; }
.cpend--oculta { opacity: .6; }
.cpend--oculta:hover { opacity: 1; }
@media (max-width: 900px) {
  .cpend { flex-wrap: wrap; }
  .cpend__acoes { width: 100%; justify-content: flex-start; margin-top: var(--s-2); }
}

/* -- chips-resumo -- */
.cchips { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-5) 0 var(--s-3); }
.cchips__spacer { flex: 1; }
.cchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--bg-surface);
  font-size: var(--fs-12); color: var(--tx-mut); cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.cchip:hover { border-color: var(--line-strong); color: var(--tx-hi); }
.cchip.is-on { border-color: var(--gold); color: var(--gold-hi); background: var(--gold-soft); }
.cchip--flat { cursor: default; }
.cchip--flat:hover { border-color: var(--line); color: var(--tx-mut); }

/* -- barra de filtros -- */
.cfilters { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-4); }
.cfilters .fech-select { flex: 0 1 auto; }
.cfilters .fech-select input { min-width: 120px; }
.fech-select__sel {
  appearance: none; border: 1px solid var(--line); background: var(--bg-input);
  color: var(--tx); border-radius: var(--r-sm); padding: 7px 11px; font-size: var(--fs-12);
  font-family: var(--ff); max-width: 220px; cursor: pointer;
}
.fech-select__sel:hover { border-color: var(--line-strong); }

/* -- modal de detalhe -- */
.cpend-det__tags { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-4); }
.cpend-det__dl {
  display: grid; grid-template-columns: 130px 1fr; gap: 6px var(--s-3);
  font-size: var(--fs-13); margin: 0 0 var(--s-4);
}
.cpend-det__dl dt { color: var(--tx-dim); }
.cpend-det__dl dd { color: var(--tx-hi); margin: 0; }
.cpend-det__linha {
  font-family: var(--ff-mono); font-size: var(--fs-12); color: var(--tx);
  background: var(--bg-surface-2); border-radius: var(--r-sm); padding: var(--s-3);
  white-space: pre-wrap; word-break: break-word;
}

/* -- Dashboard: resumo do fechamento + estados das automações (Etapa 2b) -- */
.fech-resumo-linha {
  display: flex; flex-wrap: wrap; gap: var(--s-6); padding-bottom: var(--s-4);
  margin-bottom: var(--s-4); border-bottom: 1px solid var(--line-soft);
}
.fech-mini { display: flex; flex-direction: column; gap: 2px; }
.fech-mini b { font-size: var(--fs-19); color: var(--tx-hi); font-family: var(--ff-mono); }
.fech-mini span { font-size: var(--fs-11); color: var(--tx-dim); }

.est-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.est-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--r-pill); border: 1px solid var(--line-soft);
  background: var(--bg-surface); font-size: var(--fs-11); color: var(--tx-mut);
}
.est-chip i { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* =======================================================================
   Fechamento Mensal — visão gerencial (Etapa 3)
   ======================================================================= */
.fech-falta {
  background: var(--warn-soft); border: 1px solid #b5690c33; border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); font-size: var(--fs-12);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3);
}
.fech-falta > b { color: var(--tx-hi); }
.fech-falta__it { color: var(--tx-mut); }
.fech-falta__it b { color: var(--tx-hi); font-family: var(--ff-mono); }

.fech-sit-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  vertical-align: middle; margin-left: 4px; flex: none;
}
.fech-tbl tbody tr.fech-row--erro td.fech-cli { box-shadow: inset 3px 0 0 var(--err); }
.fech-tbl tbody tr.fech-row--atraso td.fech-cli { box-shadow: inset 3px 0 0 var(--err); }
.fech-tbl tbody tr.fech-row--erro:hover td,
.fech-tbl tbody tr.fech-row--atraso:hover td { background: var(--err-soft); }
.fech-tbl tbody tr[data-cnpj-row] { cursor: pointer; }
.fech-bar input { border: none; background: transparent; font: inherit; color: var(--tx); outline: none; min-width: 130px; }

/* =======================================================================
   Clientes — ficha fiscal (Etapa 4)
   ======================================================================= */
.cli-acoes { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-4) 0 var(--s-5); }
.cli-acoes__spacer { flex: 1; }
.cli-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-bottom: var(--s-4); }
@media (max-width: 900px) { .cli-grid { grid-template-columns: 1fr; } }

.cli-pend-mini {
  display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-12);
  color: var(--tx-mut); padding: 4px 0; cursor: pointer;
}
.cli-pend-mini:hover { color: var(--tx-hi); }
.cli-pend-mini .bar { width: 3px; height: 14px; border-radius: 2px; flex: none; }

.cli-hist {
  background: var(--bg-surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
  display: flex; flex-direction: column; gap: 2px;
}
.cli-hist__it {
  font-size: var(--fs-12); color: var(--tx); padding: 5px 0;
  border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: var(--s-3);
}
.cli-hist__it:last-child { border-bottom: none; }
.cli-hist__por { color: var(--tx-dim); font-family: var(--ff-mono); font-size: var(--fs-11); flex: none; }

.cli-form { display: flex; flex-direction: column; gap: 4px; }
.cli-form__grupo {
  font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .1em;
  color: var(--tx-mut); margin: var(--s-4) 0 var(--s-1); font-weight: 700;
}
.cli-form__grupo:first-child { margin-top: 0; }
.cli-form__linha {
  display: grid; grid-template-columns: 1fr 1.2fr; align-items: center;
  gap: var(--s-3); font-size: var(--fs-13); padding: 3px 0;
}
.cli-form__linha > span { color: var(--tx-mut); }
.cli-form__linha input, .cli-form__linha select, .cli-form__linha textarea {
  border: 1px solid var(--line); background: var(--bg-input); color: var(--tx);
  border-radius: var(--r-sm); padding: 6px 9px; font: inherit; font-size: var(--fs-12); width: 100%;
}
.cli-form__linha textarea { resize: vertical; }

.cli-det {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--cyan); background: var(--cyan-soft); border: 1px solid var(--cyan-line);
  border-radius: var(--r-pill); padding: 1px 6px; margin-left: 6px; white-space: nowrap;
}

/* ---- Emitir NFS-e (#/emissao) — identidade EXATA premium ---------------- */
/* azul-marinho e dourado da marca (mesmas cores do logo/painel tkinter:
   navy #182b39, dourado #c9922e); o resto usa os tokens do painel. */
#view { --nfse-navy: #182b39; --nfse-navy-2: #22394b; --nfse-navy-3: #2d4a60;
        --nfse-ouro: #c9922e; --nfse-ouro-2: #e2b35a; --nfse-ouro-soft: #c9922e1a; }

/* faixa do topo */
.nfse-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: var(--s-6);
  align-items: center; justify-content: space-between; margin-bottom: var(--s-5);
  padding: var(--s-6) var(--s-7); border-radius: var(--r-lg); color: #eef2f5;
  background: radial-gradient(120% 140% at 100% 0%, var(--nfse-navy-3) 0%, var(--nfse-navy) 55%, #101f2b 100%);
  box-shadow: var(--sh-md); }
.nfse-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--nfse-ouro) 30%, var(--nfse-ouro-2) 60%, transparent); }
.nfse-hero--prod::after { background: linear-gradient(90deg, transparent, #e0673f 30%, var(--nfse-ouro-2) 60%, transparent); }
.nfse-hero__txt { max-width: 640px; }
.nfse-hero__kicker { display: inline-block; font-size: var(--fs-11); letter-spacing: .14em; text-transform: uppercase;
  color: var(--nfse-ouro-2); font-weight: 700; margin-bottom: 6px; }
.nfse-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #fff; line-height: 1.1; }
.nfse-hero p { color: #b7c4cf; font-size: var(--fs-13); margin-top: 8px; line-height: 1.5; }
.nfse-hero__amb { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.nfse-hero__rot { font-size: var(--fs-11); letter-spacing: .12em; text-transform: uppercase; color: #8fa2b2; font-weight: 700; }
.nfse-hero__amb-txt { font-size: var(--fs-12); color: #b7c4cf; max-width: 260px; text-align: right; }

/* controle segmentado (ambiente e modo) */
.nfse-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-pill);
  background: #ffffff14; border: 1px solid #ffffff22; }
.nfse-seg__btn { border: 0; background: transparent; color: #c9d4dd; font: inherit; font-size: var(--fs-13);
  font-weight: 600; padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.nfse-seg__btn:hover { color: #fff; }
.nfse-seg__btn.is-on { background: var(--nfse-ouro); color: var(--gold-ink); box-shadow: 0 2px 10px #c9922e55; }
.nfse-seg__btn--prod.is-on { background: #e0673f; color: #fff; box-shadow: 0 2px 10px #e0673f66; }
.nfse-seg--claro { background: var(--bg-input); border-color: var(--line); }
.nfse-seg--claro .nfse-seg__btn { color: var(--tx-mut); }
.nfse-seg--claro .nfse-seg__btn:hover { color: var(--tx-hi); }
.nfse-seg--claro .nfse-seg__btn.is-on { background: var(--nfse-navy); color: #fff; box-shadow: var(--sh-sm); }

/* passos */
.nfse-passos { list-style: none; display: flex; gap: var(--s-3); margin: 0 0 var(--s-5); padding: 0; }
.nfse-passos__i { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--r-md); background: var(--bg-surface); border: 1px solid var(--line-soft);
  color: var(--tx-dim); font-size: var(--fs-13); font-weight: 600; }
.nfse-passos__i b { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--bg-input); color: var(--tx-dim); font-size: var(--fs-12); border: 1px solid var(--line); }
.nfse-passos__i.is-ativo { color: var(--tx-hi); border-color: var(--nfse-ouro); box-shadow: 0 0 0 3px var(--nfse-ouro-soft); }
.nfse-passos__i.is-ativo b { background: var(--nfse-ouro); color: var(--gold-ink); border-color: var(--nfse-ouro); }
.nfse-passos__i.is-feito { color: var(--tx); }
.nfse-passos__i.is-feito b { background: var(--nfse-navy); color: var(--nfse-ouro-2); border-color: var(--nfse-navy); }

/* cartões */
.nfse-card { background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); margin-bottom: var(--s-5); overflow: hidden; }
.nfse-card--destaque { border-color: #c9922e55; box-shadow: 0 0 0 3px var(--nfse-ouro-soft), var(--sh-md); }
.nfse-card__hd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fbfcfd, var(--bg-surface)); }
.nfse-card__hd > div { display: flex; align-items: center; gap: 10px; }
.nfse-card__hd h2 { font-size: var(--fs-16, 16px); font-weight: 700; color: var(--tx-hi); letter-spacing: -.01em; }
.nfse-card__num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px;
  background: var(--nfse-navy); color: var(--nfse-ouro-2); font-weight: 800; font-size: var(--fs-13); }
.nfse-card__ico { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px;
  background: var(--nfse-ouro-soft); color: var(--nfse-ouro); }
.nfse-card__ico svg { width: 15px; height: 15px; }
.nfse-card__cont { font-size: var(--fs-12); font-weight: 700; color: var(--nfse-ouro); background: var(--nfse-ouro-soft);
  border-radius: var(--r-pill); padding: 2px 9px; }
.nfse-card__bd { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }

/* campos */
.nfse-linha { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-end; }
.nfse-campo { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-12); color: var(--tx-mut); font-weight: 600; }
.nfse-campo select { min-width: 320px; }
.nfse-campo--largo { flex: 1; min-width: 320px; }
.nfse-campo--largo input { width: 100%; }
.nfse-busca__box { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg-input);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.nfse-busca__box:focus-within { border-color: var(--nfse-ouro); box-shadow: 0 0 0 3px var(--nfse-ouro-soft); background: #fff; }
.nfse-busca__box svg { width: 17px; height: 17px; color: var(--nfse-ouro); flex: none; }
.nfse-busca__box input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit;
  font-size: var(--fs-14); color: var(--tx-hi); }
.nfse-texto { min-height: 150px; font-family: var(--ff-mono); font-size: var(--fs-12); resize: vertical; width: 100%; }
.nfse-dica { color: var(--tx-mut); font-size: var(--fs-12); display: flex; align-items: center; gap: 6px; }
.nfse-dica svg { width: 14px; height: 14px; }
.nfse-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--tx-mut); cursor: pointer; }

/* catálogo de notas anteriores */
.nfse-cat { max-height: 440px; overflow: auto; }
.nfse-cat td { vertical-align: top; }
.nfse-cat tbody tr:hover td { background: #fbf6ec; }
.nfse-cat thead th { position: sticky; top: 0; z-index: 1; }

/* resumo da prévia (faixa azul-marinho) */
.nfse-resumo { display: flex; flex-wrap: wrap; background: var(--nfse-navy); }
.nfse-resumo__i { flex: 1; min-width: 140px; padding: 14px 20px; border-right: 1px solid #ffffff14; }
.nfse-resumo__i:last-child { border-right: 0; }
.nfse-resumo__i span { display: block; font-size: var(--fs-11); letter-spacing: .1em; text-transform: uppercase; color: #8fa2b2; font-weight: 700; }
.nfse-resumo__i b { display: block; margin-top: 4px; font-size: 20px; font-family: var(--ff-mono); color: #fff; font-weight: 700; }
.nfse-resumo__i--ouro b { color: var(--nfse-ouro-2); }
.nfse-resumo__i.is-alerta b { color: #f3b04d; }
.nfse-resumo__i.is-erro b { color: #ff8a80; }

/* tabela da prévia */
.nfse-tabela td { vertical-align: top; }
.nfse-contas { margin-top: 6px; font-size: var(--fs-12); line-height: 1.55; white-space: nowrap; }
.nfse-contas--zero { margin-top: 0; font-size: var(--fs-13, 13px); white-space: normal; }
.nfse-valor { width: 120px; text-align: right; font-family: var(--ff-mono); font-weight: 700; }
.nfse-desc { width: 100%; min-width: 240px; font-size: var(--fs-12); resize: vertical; }
.nfse-sub { color: var(--tx-mut); font-size: var(--fs-12); }
.nfse-aviso { color: var(--warn); font-size: var(--fs-12); margin-top: 6px; padding: 6px 8px;
  background: var(--warn-soft); border-radius: var(--r-xs); border-left: 3px solid var(--warn); }
.nfse-nbs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: var(--fs-12); color: var(--tx-mut); }
.nfse-nbs select { max-width: 100%; }
.nfse-off td { opacity: .45; }
.nfse-erro td { background: var(--err-soft); }
.nfse-rodape { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.nfse-amb-tag { font-size: var(--fs-11); font-weight: 800; letter-spacing: .1em; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--cyan-soft); color: var(--cyan); }
.nfse-amb-tag--prod { background: #e0673f1f; color: #c4502b; }
.nfse-btn-emitir { padding: 12px 26px; font-size: var(--fs-14); font-weight: 700; border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--nfse-ouro-2), var(--nfse-ouro)); color: var(--gold-ink); border: 0;
  box-shadow: 0 6px 18px -6px #c9922eaa; }
.nfse-btn-emitir:hover { filter: brightness(1.05); box-shadow: 0 8px 22px -6px #c9922ecc; }

/* andamento e notas emitidas */
.nfse-lote-hd { display: flex; align-items: center; gap: var(--s-3); color: var(--tx); font-weight: 600; }
.nfse-lote-hd svg { width: 15px; height: 15px; }
.nfse-emit tbody tr:hover td { background: #fbf6ec; }
.nfse-num { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: var(--r-xs);
  background: var(--nfse-navy); color: var(--nfse-ouro-2); font-family: var(--ff-mono); font-weight: 700; font-size: var(--fs-12); }
.nfse-dir { text-align: right; }
.nfse-arqs { display: inline-flex; gap: 6px; white-space: nowrap; }
.nfse-arqs a { font-weight: 700; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 4px 10px; font-size: var(--fs-12); }
.nfse-arqs a:first-child { color: #b3261e; border-color: #b3261e33; background: #b3261e0d; }
.nfse-arqs a:last-child { color: var(--cyan); border-color: #0e8f8f33; background: var(--cyan-soft); }
.nfse-vazio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s-7) var(--s-4); color: var(--tx-mut); text-align: center; }
.nfse-vazio svg { color: var(--nfse-ouro); opacity: .7; }
.nfse-vazio b { color: var(--tx-hi); font-size: var(--fs-14); }

/* NFC-e: ficha do item, tributação recomendada, cadastro de produtos */
.nfce-item { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--bg-surface-2); }
.nfce-item + .nfce-item { margin-top: var(--s-3); }
.nfce-item [data-trib], .nfce-prod-form, .nfce-prod-form [data-trib] { display: flex; flex-direction: column; gap: var(--s-3); }
.nfce-item__tot { height: 38px; display: flex; align-items: center; justify-content: flex-end; min-width: 90px; color: var(--tx-hi); font-size: var(--fs-14); }
.nfce-prep { height: 38px; }
.nfce-cest { flex: 1; min-width: 320px; }
.nfce-cest select { width: 100%; }
.nfce-motivos { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-12); color: var(--tx-mut); }
.nfce-motivos svg { width: 13px; height: 13px; vertical-align: -2px; color: var(--cyan); }
.nfce-difere { color: var(--warn); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nfce-difere svg { color: var(--warn); }
.nfce-prod-campo { position: relative; }
.nfce-prod-campo input { width: 100%; }
.nfce-prod-lista { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; max-height: 300px; }
.em-emp .nfce-prod-preco { font-family: var(--ff-mono); font-size: var(--fs-13); font-weight: 700; color: var(--tx-hi); }
.nfce-prod-pend { color: var(--warn); font-weight: 700; }
.nfce-prods { max-height: 520px; overflow: auto; }
.nfce-prods thead th { position: sticky; top: 0; z-index: 1; }

@media (max-width: 1180px) {
  .nfse-passos { flex-direction: column; }
  .nfse-hero__amb { align-items: flex-start; }
  .nfse-hero__amb-txt { text-align: left; }
}
.nfse-card td.mono, .nfse-resumo__i b { white-space: nowrap; }

/* tomador novo (#/emissao) */
.nfse-link { border: 0; background: none; padding: 0; margin-left: 6px; font: inherit; font-size: var(--fs-12);
  color: var(--nfse-ouro); font-weight: 700; cursor: pointer; text-decoration: underline dotted; }
.nfse-link:hover { color: var(--gold-hi); }
.nfse-troca { display: flex; flex-direction: column; gap: 6px; }
.nfse-serv { min-width: 190px; }
.nfse-serv .nfse-zlista { max-height: 220px; }
.nfse-link--serv { margin-left: 0; white-space: nowrap; }
.nfse-troca__box { display: flex; align-items: center; gap: 6px; }
.nfse-troca__box svg { width: 14px; height: 14px; color: var(--nfse-ouro); }
.nfse-troca__box input { width: 190px; font-family: var(--ff-mono); }
.nfse-troca__acoes { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--tx-mut); }
.nfse-troca__acoes svg { width: 13px; height: 13px; }
.nfse-toma-novo { padding: 8px 10px; border-radius: var(--r-sm); background: var(--nfse-ouro-soft); border: 1px solid #c9922e44; }
.nfse-toma-novo__tag { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--nfse-ouro); margin-bottom: 2px; }
.nfse-toma-novo .nfse-link { margin-left: 0; margin-top: 4px; display: inline-block; }

/* nova nota do zero (#/emissao) */
.nfse-zchips { display: flex; flex-wrap: wrap; gap: 6px; }
.nfse-zchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--nfse-navy); color: #dfe7ee; font-size: var(--fs-12); font-weight: 600; }
.nfse-zchip svg { width: 13px; height: 13px; color: var(--nfse-ouro-2); }
.nfse-zbloco { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); background: #fcfdfd; }
.nfse-zbloco h3 { font-size: var(--fs-13); font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--nfse-ouro); margin-bottom: var(--s-3); }
.nfse-zgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
.nfse-zc { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-12); color: var(--tx-mut); font-weight: 600; min-width: 0; }
.nfse-zc--2 { grid-column: span 2; }
.nfse-zc--4 { grid-column: 1 / -1; }
.nfse-zc input, .nfse-zc select, .nfse-zc textarea { width: 100%; font-weight: 400; }
.nfse-zc input:disabled { opacity: .75; }
.nfse-seg--mini .nfse-seg__btn { padding: 5px 14px; font-size: var(--fs-12); }
.nfse-zserv { font-size: var(--fs-13); color: var(--tx); font-weight: 400; line-height: 1.4; }
.nfse-zserv b { color: var(--nfse-navy); font-family: var(--ff-mono); margin-right: 4px; }
.nfse-zlista { display: flex; flex-direction: column; max-height: 260px; overflow: auto; margin-top: 4px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: #fff; }
.nfse-zlista:empty { display: none; }
.nfse-zlista button { text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: none; padding: 8px 10px;
  font: inherit; font-size: var(--fs-12); color: var(--tx); cursor: pointer; font-weight: 400; }
.nfse-zlista button:hover { background: #fbf6ec; }
.nfse-zlista button b { font-family: var(--ff-mono); color: var(--nfse-navy); margin-right: 6px; }
.nfse-zult { align-self: flex-start; margin: 2px 0 0 !important; font-weight: 600 !important; text-align: left; }
.nfse-zacoes { justify-content: flex-end; }
@media (max-width: 1180px) { .nfse-zgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nfse-zdica { font-size: 11px; color: var(--tx-dim); font-weight: 400; }

/* ---- cores mais destacadas (pedido da Marta, 01/10/2026): nota do zero e NFC-e ---- */
.nfse-zbloco { background: #fff; border: 1px solid var(--line-strong); border-left: 5px solid var(--nfse-ouro);
  box-shadow: 0 1px 3px #18243014; }
.nfse-zbloco h3 { color: var(--gold-hi); font-size: var(--fs-14); }
.nfse-zc, .nfce-item .nfse-campo, .nfce-prod-form .nfse-campo { color: var(--tx-hi); font-weight: 700; }
.nfse-zc input, .nfse-zc select, .nfse-zc textarea,
.nfce-item .cfg-in, .nfce-prod-form .cfg-in { border: 1.5px solid var(--line-strong); background: #fff; color: var(--tx-hi); }
.nfse-zc input:focus, .nfse-zc select:focus, .nfse-zc textarea:focus,
.nfce-item .cfg-in:focus, .nfce-prod-form .cfg-in:focus { border-color: var(--nfse-ouro); box-shadow: 0 0 0 3px #c9922e33; outline: 0; }
.nfse-zdica { font-size: var(--fs-12); color: #7a4706; font-weight: 600; background: #fdf3e1; border-left: 3px solid var(--nfse-ouro);
  border-radius: var(--r-xs); padding: 5px 9px; }
.nfse-seg--claro { border: 1.5px solid var(--line-strong); background: #fff; }
.nfse-seg--claro .nfse-seg__btn { color: var(--tx); font-weight: 700; }
.nfse-seg--claro .nfse-seg__btn.is-on { background: var(--nfse-ouro); color: var(--gold-ink); box-shadow: 0 2px 8px #c9922e66; }
.nfse-zchip { font-weight: 700; }

.nfce-item { background: #fff; border: 1px solid var(--line-strong); border-left: 5px solid var(--nfse-navy); box-shadow: 0 1px 3px #18243014; }
.nfce-item__tot { font-size: 17px; font-weight: 800; color: var(--nfse-navy); }
.nfce-item select.is-rec, .nfce-prod-form select.is-rec { border-color: var(--ok); background: #e9f7ef; color: #14613a; font-weight: 700; }
.nfce-item select.is-fora, .nfce-prod-form select.is-fora { border-color: #d98a1f; background: #fff4e0; color: #7a4706; font-weight: 700; }
.nfce-motivos { color: var(--tx); font-size: var(--fs-13); background: #e8f5f5; border-left: 3px solid var(--cyan);
  border-radius: var(--r-xs); padding: 8px 10px; }
.nfce-difere { color: #9a5200; font-weight: 700; }
.nfce-prep { color: var(--tx-hi); font-weight: 700; }
.nfce-prods tbody tr:hover td { background: #fbf6ec; }

/* botão "E-mail" das notas */
.em-email { margin-left: 4px; color: var(--nfse-navy); border: 1px solid var(--line-strong); font-weight: 700; white-space: nowrap; }
.em-email svg { width: 12px; height: 12px; vertical-align: -1px; }
.em-email.is-enviado { color: #14613a; border-color: #1f9d5c66; background: #e9f7ef; }
.modal textarea.em-modal-campo { width: 100%; resize: vertical; font-size: var(--fs-13); }

/* conferência com a prévia da nota (NF-e / NFC-e) */
.modal.modal--previa { width: min(1040px, 100%); max-height: 94vh; }
.modal--previa .modal__body { display: flex; flex-direction: column; gap: 10px; }
.previa-resumo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-14); color: var(--tx-hi); }
.previa-resumo .nfse-sub { flex-basis: 100%; }
.previa-pdf { width: 100%; height: 62vh; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: #5a6168; }
.nfse-conf-lista { max-height: 52vh; overflow: auto; margin-top: 10px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); }
.nfse-conf-lista thead th { position: sticky; top: 0; z-index: 1; }
.nfse-conf-lista td.nfse-dir { white-space: nowrap; }

/* Pedidos do WhatsApp (16/11/2026) */
.nfse-peds .nfse-card__bd { display: flex; flex-direction: column; gap: 10px; }
.nfse-ped { border: 1px solid var(--line, #0002); border-radius: 10px; padding: 10px 12px; }
.nfse-ped__hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nfse-ped__resumo { margin-top: 4px; }
.nfse-ped__trecho { white-space: pre-wrap; margin-top: 4px; max-height: 160px; overflow: auto; }
.nfse-ped__campos { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; }
.nfse-ped__campos > span { display: flex; flex-direction: column; min-width: 120px; max-width: 100%; }
.nfse-ped__campos small { color: var(--tx-mut); font-size: var(--fs-12); }
.nfse-ped__campos select { max-width: 320px; }
.nfse-ped__acoes { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.nfse-ped-tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: var(--fs-12);
  background: var(--nfse-ouro-soft); font-weight: 600; }
.nfse-ped__feitos summary { cursor: pointer; color: var(--tx-mut); font-size: var(--fs-12); }
.nfse-ped__feito { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; }

/* NFC-e · relatório do mês (24/11/2026) */
.nrel-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }
.nrel-grade > .nfse-card { min-width: 0; }
