/* =============================================================================
   Layout do beta (padrão Rillet): trilho de ícones, barra de empresa no topo,
   conteúdo centralizado, cartões cinza sem borda, valores em fonte mono.
   Carregado depois do app.css: sobrescreve tokens e o shell; as telas antigas
   herdam o visual sem mudar o HTML delas.
   ============================================================================= */
:root {
  /* Grillus: tinta #19191D, violeta #7653F6 (marca), violeta profundo #5633C7 (ação), névoa #F4F3F8 */
  --bg: #ffffff; --card: #ffffff; --ink: #19191d; --muted: #5e5d6a; --line: #e4e3ea; --soft: #f4f3f8; --hover: #eeedf4;
  --brand: #5633c7; --brand-d: #4a2ab0; --brand-dd: #4527a8; --brand-l: #eeeafe; --login: #5633c7; --violeta: #7653f6;
  --accent: #e0a526; --ok: #1a7a4c; --warn: #8a5a00; --bad: #b4231b; --dark: #19191d;
  --mono: 'DejaVu Sans Mono', ui-monospace, Menlo, monospace;
}
body { background: var(--bg); color: var(--ink); }
body::before { display: none; }
a { color: var(--brand-dd); }

/* ---------- Shell ---------- */
#app { display: grid; grid-template-columns: 60px minmax(0, 1fr); min-height: 100vh; }
body.is-login #app { display: flex; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; border-right: 1px solid var(--line); background: var(--bg); z-index: 50; }
.rail .ent { width: 34px; height: 34px; border-radius: 9px; border: 0; padding: 0; background: var(--brand-l); color: var(--brand); font: 700 12px/34px var(--fonte-texto); margin-bottom: 8px; cursor: pointer; }
.rail .ri { position: relative; width: 38px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); border: 0; background: none; padding: 0; text-decoration: none; cursor: pointer; }
.rail .ri i { font-size: 20px; }
.rail .ri:hover, .rail .ri:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.rail .ri.on { background: var(--brand-l); color: var(--brand); }
.rail .tip { position: absolute; left: 46px; top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 60; font-weight: 500; }
/* o nome aparece com o mouse por cima, pelo teclado ou por um instante depois do toque (js/app.js põe .tip-on) */
.rail .ri.tip-on .tip, .rail .ri:focus-visible .tip { opacity: 1; }
.qual-nota { display: grid; gap: 8px; margin: 6px 0 12px; }
.qual-nota button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; }
.qual-nota button:hover, .qual-nota button:focus-visible { border-color: var(--brand); }
.qual-nota i { font-size: 22px; color: var(--brand); }
.qual-nota span { display: grid; gap: 2px; }
.qual-nota small { color: var(--muted); font-size: 12.5px; }
.rail .grow { flex: 1; }
.main { min-width: 0; padding: 0; display: flex; flex-direction: column; }
.tb { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 40; }
.tb-r { display: flex; gap: 14px; align-items: center; font-size: 12.5px; }
.emp-sel { position: relative; }
.sel { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.sel i { color: var(--muted); font-size: 16px; }
.emp-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; max-height: 60vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(40, 30, 120, .12); padding: 6px; display: grid; gap: 2px; z-index: 70; }
.emp-menu[hidden] { display: none; }
.emp-menu button { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.emp-menu button:hover { background: var(--hover); }
.emp-menu button.on { background: var(--brand-l); color: var(--brand-dd); }
.emp-menu .nova { color: var(--brand); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.av-s { width: 24px; height: 24px; border-radius: 6px; background: var(--soft); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.ct { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 28px 80px; min-width: 0; }
.ph { margin-bottom: 14px; }
.ph[hidden] { display: none; }
.ph h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.subnav { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.subnav:empty { display: none; }
.subnav a { padding: 8px 0; font-size: 13.5px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--ink); font-weight: 600; border-color: var(--ink); }

/* ---------- Componentes das telas antigas ---------- */
.card { border: 1px solid var(--line); box-shadow: none; border-radius: 14px; }
.kpi { background: var(--soft); border: 0; border-radius: 12px; }
.kpi .l { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.kpi .v { font-size: 24px; letter-spacing: -.02em; }
.pos { color: var(--ink); }
th { background: var(--soft); border-bottom: 0; text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 500; padding: 9px 10px; }
th:first-child { border-radius: 9px 0 0 9px; } th:last-child { border-radius: 0 9px 9px 0; }
td { border-bottom: 1px solid var(--line); padding: 10px; }
tr:hover td { background: #fafafd; }
td.r { font-family: var(--fonte-texto); font-size: 14px; font-weight: 500; }
td.r button, td.r a { font-family: var(--fonte-texto); }
tr.sint td, tr.sub td { background: #fafafd; }
tr.tot td { border-top: 1px solid var(--ink); background: var(--soft); }
button, .btn { border-color: var(--line); }
button:hover { background: var(--hover); }
button.pri, .btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
button.pri:hover { background: var(--brand-d); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
input, select, textarea { border: 1px solid var(--line); }
.tabs button { border-color: transparent; background: none; color: var(--muted); }
.tabs button.on { background: var(--soft); color: var(--ink); border-color: transparent; font-weight: 600; }
.pill { font-family: var(--mono); font-weight: 500; border-radius: 6px; background: var(--soft); color: var(--muted); }
.pill.ok { background: #e1f5ec; color: var(--ok); }
.pill.bad { background: #fde8e6; color: var(--bad); }
.pill.warn { background: #fdf1dc; color: var(--warn); }
.badge { background: #fdf1dc; border-color: #f6dfb2; color: var(--warn); }
.b.rec { background: var(--brand); } .b.des { background: var(--accent); }
.modal { border-radius: 16px; }
.toast { background: var(--ink); }

/* ---------- Tela inicial ---------- */
.hero { display: grid; gap: 14px; justify-items: center; padding: 18px 0 26px; }
.hero h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ask { width: 100%; max-width: 680px; display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 4px 18px rgba(40, 30, 120, .08); }
.ask input { flex: 1; border: 0; padding: 6px 2px; font-size: 14.5px; background: transparent; }
.ask input:focus { outline: none; }
.ask:focus-within { border-color: var(--brand); }
.orb { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #9b82fa, var(--brand)); color: #fff; flex: none; box-shadow: 0 0 0 5px var(--brand-l); }
.ask-go { width: 34px; height: 34px; border-radius: 10px; border: 0; padding: 0; background: var(--ink); color: #fff; display: grid; place-items: center; }
.ask-go:hover { background: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 760px; }
.chip { font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); font-weight: 400; }
.sl { display: flex; gap: 6px; align-items: center; font: 500 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.sl i { font-size: 15px; }
.kg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.kpi-l { display: grid; gap: 6px; padding: 16px; text-decoration: none; color: inherit; transition: background .12s; }
.kpi-l:hover { background: var(--hover); }
.kl { display: flex; gap: 6px; align-items: center; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kl i { font-size: 15px; }
.kv { font-size: 26px; font-weight: 700; letter-spacing: -.02em; display: flex; gap: 6px; align-items: baseline; }
.ks { font-size: 12px; color: var(--muted); }
.tr { font-size: 18px; } .tr.up { color: var(--ok); } .tr.down { color: var(--bad); }
.c3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.na { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.na li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.na li > a, .na li > span { display: flex; gap: 8px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.na li > a:hover { color: var(--brand); }
.na li > a > i:not(.ti) { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
.na li.zero { color: var(--muted); } .na li.zero > a > i:not(.ti) { background: var(--line); }
.na .n { font-family: var(--mono); font-weight: 400; }
.na .ti { color: var(--muted); font-size: 16px; }
.neg-s { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #7fd1bd; flex: none; display: inline-block; }
.dot.warn { background: var(--accent); } .dot.bad { background: #f08a8a; }
.vazio-ini { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 20px; border-radius: 14px; background: var(--soft); }
.vazio-ini > i { font-size: 28px; color: var(--muted); }
.vazio-ini > div { flex: 1; min-width: 220px; }

/* ---------- Assistente ---------- */
#ia-fab { background: radial-gradient(circle at 35% 30%, #9b82fa, var(--brand)); box-shadow: 0 0 0 6px var(--brand-l), 0 8px 22px rgba(40, 30, 120, .25); }
#ia-panel { border-radius: 16px; border-color: var(--line); box-shadow: 0 16px 44px rgba(40, 30, 120, .18); }
.ia-top { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.ia-top button { background: var(--soft); color: var(--ink); }
.ia-m.user .ia-b { background: var(--soft); } .ia-m.assistant .ia-b { background: var(--brand-l); }

/* ---------- Login ---------- */
.lg-page { background: var(--soft); }
.logo { background: var(--brand); }
.lg-box { border-color: var(--line); border-radius: 14px; }
.lg-field input { border-color: var(--line); border-radius: 8px; }
.lg-btn { border-radius: 8px; }
.lg-btn:hover { background: var(--brand-d); }

/* ---------- Impressão e telas pequenas ---------- */
@media print { .rail, .tb, .subnav { display: none !important; } #app { display: block; } .ct { padding: 0; max-width: none; } }
@media (max-width: 980px) { .kg { grid-template-columns: repeat(2, minmax(0, 1fr)); } .c3 { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  #app { grid-template-columns: 1fr; display: grid; }
  .rail { position: sticky; top: auto; bottom: 0; order: 2; height: auto; flex-direction: row; overflow-x: auto; padding: 6px 8px; border-right: 0; border-top: 1px solid var(--line); }
  .rail .grow, .rail .tip { display: none; }
  .rail .ent { margin: 0 6px 0 0; }
  .main { order: 1; }
  .ct, .tb { padding-left: 16px; padding-right: 16px; }
  .kg { grid-template-columns: 1fr; }
  #ia-fab { bottom: 70px; }
}

/* =============================================================================
   A CONSTRUIR: o que ainda não existe aparece em vermelho (chave no topo oculta)
   ============================================================================= */
:root { --x: #e0261d; --x-soft: #fff0ef; }
.rail .ri.x { color: var(--x); }
.rail .ri.x::after { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--x); }
.rail .ri.x.on { background: var(--x-soft); color: var(--x); }
.subnav a.x { color: var(--x); }
.subnav a.x::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--x); margin-left: 6px; vertical-align: 2px; }
.subnav a.x.on { border-color: var(--x); }
h1.x-tit { color: var(--x); }
.x { position: relative; }
.kpi.x { background: var(--x-soft); outline: 1.5px dashed var(--x); outline-offset: -1.5px; }
.kpi.x::before { content: attr(data-x); position: absolute; top: 10px; right: 10px; font: 500 10px/1 var(--mono); color: #fff; background: var(--x); padding: 4px 6px; border-radius: 5px; }
.kpi.x .kv { color: var(--x); }
.na li.xl, .na li.xl a, .na li.xl b { color: var(--x); }
.na li.xl > a > i:not(.ti) { background: var(--x); }
.falta-lnk { display: inline-flex; gap: 6px; align-items: center; color: var(--x); font-weight: 600; text-decoration: none; padding: 4px 10px; border: 1px dashed var(--x); border-radius: 8px; background: var(--x-soft); }
.falta-tg { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.falta-tg input { accent-color: var(--x); }
.ac-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--x-soft); border: 1.5px dashed var(--x); color: #7a1410; margin-bottom: 18px; }
.ac-banner > i { font-size: 22px; color: var(--x); }
.ac-banner > div { flex: 1; min-width: 240px; }
.ac-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.ac-box { background: var(--soft); border-radius: 12px; padding: 14px 16px; }
.ac-box p { margin: 0; }
.ac-previa { border: 1.5px dashed var(--x); border-radius: 14px; padding: 18px; margin-bottom: 16px; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(224, 38, 29, .025) 14px 28px); }
.ac-previa .kg { margin-bottom: 14px; }
.btn.fake { cursor: default; pointer-events: none; }
.acts-l { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; justify-content: flex-end; }
.why { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--brand-l); margin: 12px 0; }
.drop-f { display: grid; justify-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--line); border-radius: 14px; text-align: center; margin-bottom: 12px; }
.drop-f i { font-size: 30px; color: var(--brand); }
.dlbl { display: inline-flex; gap: 7px; align-items: center; }
.pb { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pb b { display: block; height: 100%; background: var(--accent); }
td .wrap, .wrap { white-space: normal; }
/* chave desligada: o sistema aparece só com o que existe */
body.sem-falta .rail .ri.x, body.sem-falta .subnav a.x, body.sem-falta .so-falta { display: none !important; }
@media (max-width: 800px) { .ac-grid { grid-template-columns: 1fr; } .falta-tg { display: none; } }

/* Entradas > XML de notas: área para soltar arquivos */
.drop { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border: 1.5px dashed var(--line); border-radius: 12px; cursor: pointer; background: var(--soft); }
.drop > i { font-size: 28px; color: var(--brand); }
.drop:hover, .drop.on, .drop:focus-visible { border-color: var(--brand); outline: none; }
.drop .sm { margin-top: 2px; }
td select { max-width: 260px; }
.av { min-width: 240px; } .av div + div { margin-top: 4px; }
.alert.warn { background: #fff7e8; border-color: #f3d9a4; color: #7a4a00; }
/* Enviar documentos */
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
label.btn { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; margin: 0; }
.drop-bts { display: flex; gap: 8px; flex-wrap: wrap; }
#ddrop { cursor: default; flex-wrap: wrap; }
/* Busca global */
.modal.bq-modal, .modal.wide.bq-modal { padding: 0 !important; max-width: 680px; overflow: hidden; }
.bq-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.bq-in > i { font-size: 20px; color: var(--muted); }
.bq-in input { border: 0; outline: none; flex: 1; font-size: 16px; padding: 4px 0; background: transparent; min-width: 0; }
.bq-in kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.bq-lista { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px 8px 10px; }
.bq-tela .bq-lista { max-height: none; }
.bq-tela { padding: 0; }
.bq-g { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; }
.bq-r { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.bq-r:hover, .bq-r.on { background: var(--soft); }
.bq-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-r b { font-weight: 500; white-space: nowrap; }
.bq-vazio { padding: 18px 12px; }
.warn-t { color: #b45309; }

/* comando na tela inicial e na busca */
.c2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 980px) { .c2 { grid-template-columns: 1fr; } }
.ask-prev { min-height: 20px; font-size: 13px; color: var(--ink, #222); max-width: 680px; width: 100%; padding: 0 14px; }
.ask-prev .ti { color: var(--brand, #4b3fd6); }
.chip .ti { font-size: 14px; vertical-align: -2px; }
.bq-r.bq-cmd .bq-t { font-weight: 600; }
.lista-emp td .pill { margin-left: 6px; }

/* primeiros passos */
.passos-topo { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.passos-barra { width: 220px; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.passos-barra i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.passos-l { list-style: none; margin: 0; padding: 0; }
.passos-l li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.passos-l .pn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--soft); color: var(--muted); }
.passos-l li.ok .pn { background: var(--ok); color: #fff; }
.passos-l li.prox .pn { background: var(--brand); color: #fff; }
.passos-l li.pulado .pn { background: var(--soft); color: var(--muted); }
.passos-acoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .passos-l li:has(.passos-acoes) { grid-template-columns: 34px minmax(0, 1fr); } .passos-l .passos-acoes { grid-column: 2; justify-content: flex-start; } }
.passos-l li.ok b { color: var(--muted); font-weight: 500; }
.passos-aviso { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 0 22px; border-radius: 12px; background: var(--brand-l); color: var(--ink); text-decoration: none; }
.passos-aviso .ti { font-size: 20px; color: var(--brand); }
.passos-aviso .pa-ir { margin-left: auto; color: var(--brand); font-weight: 600; white-space: nowrap; }
.srv-lista { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; padding: 2px 0; }
.srv-op { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; cursor: pointer; }
.srv-op:hover { background: var(--hover); }
.srv-op.on { border-color: var(--brand); background: var(--brand-l); }
.srv-op b { color: var(--brand); margin-right: 6px; }
@media (max-width: 560px) { .passos-l li { grid-template-columns: 30px minmax(0, 1fr); } .passos-l li > :last-child { grid-column: 2; justify-self: start; } }

/* padrão de tabelas (cabeçalho ordenável, status com bolinha, código em chip) */
th.th-s { cursor: pointer; user-select: none; white-space: nowrap; }
th.th-s:hover { color: var(--ink); }
th .ar { display: inline-block; width: 12px; margin-left: 4px; opacity: .35; font-style: normal; }
th .ar::after { content: "↓"; }
th[aria-sort="ascending"] .ar, th[aria-sort="descending"] .ar { opacity: 1; color: var(--brand); }
th[aria-sort="ascending"] .ar::after { content: "↑"; }
.sd { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; }
.sd::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #c9c7d6; flex: none; }
.sd.ok::before { background: #6fd3b0; } .sd.bad::before { background: #f59a9a; } .sd.warn::before { background: #f3c26b; } .sd.info::before { background: var(--brand); }
.cod { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--muted); margin-right: 6px; }
.var { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12.5px; padding: 3px 9px; border-radius: 7px; }
.var.up { background: #fde8e6; color: var(--bad); } .var.down { background: #e1f5ec; color: var(--ok); } .var.pos { background: #e1f5ec; color: var(--ok); } .var.neg { background: #fde8e6; color: var(--bad); }
/* aging */
.aging { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr); gap: 24px; align-items: end; }
.ag-b { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.ag-b button { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--muted); font-size: 12px; }
.ag-b i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; min-height: 3px; }
.ag-b button.on span { color: var(--ink); font-weight: 600; }
.ag-v { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ag-v div { padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.ag-v b { display: block; font-family: var(--mono); font-size: 14px; color: var(--ink); }
.ag-v span { font-size: 11.5px; color: var(--muted); }
@media (max-width: 900px) { .aging { grid-template-columns: 1fr; } .ag-v { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* linhas densas: ações lado a lado */
td.r:last-child { white-space: nowrap; }
td.r:last-child button + button { margin-left: 4px; }
.sub-l { margin-top: 3px; font-size: 12px; color: var(--muted); }
.sub-l .cod { font-size: 11px; padding: 1px 6px; }
button.sm.ico { padding: 4px 7px; line-height: 1; }
button.sm.ico .ti { font-size: 15px; }
body.v-simples .sub-l { display: none; }
/* conciliação no padrão banco x sistema */
.rec-topo { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 6px 0 10px; }
.rec-topo > div { padding: 10px 14px; display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.rec-topo > div:first-child { background: var(--soft); }
.rec-topo b { color: var(--ink); }
.rec-d { font-weight: 600; }
.rec-x { color: var(--muted); background: var(--soft); border-radius: 50%; padding: 5px; font-size: 14px; }
.conf { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.conf.alta { background: #eeeafe; color: #4527a8; } .conf.media { background: #fdf1dc; color: var(--warn); } .conf.baixa { background: var(--soft); color: var(--muted); }
@media (max-width: 760px) { .rec-topo { grid-template-columns: 1fr; } }
/* variação do mês */
.expl { max-width: 52ch; font-size: 13px; line-height: 1.45; margin-bottom: 4px; white-space: normal; }
.ia-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--brand-l); color: var(--brand-dd); }
.ia-tag::before { content: "✦"; }
.sd.sm { font-size: 11.5px; }
/* minigráfico nos números da tela inicial */
.kpi-sp { position: relative; }
.kpi-sp .spark { position: absolute; right: 16px; top: 18px; width: 110px; height: 34px; }
.spark .l { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark.up .l { stroke: var(--brand); } .spark.down .l { stroke: var(--bad); }
.spark .a { stroke: none; opacity: .12; }
.spark.up .a { fill: var(--brand); } .spark.down .a { fill: var(--bad); }
@media (max-width: 560px) { .kpi-sp .spark { width: 80px; } }
.lista-expl { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lista-expl li { display: grid; gap: 2px; }
.lista-expl p { margin: 0; color: var(--muted); max-width: 75ch; }

.cob-lista{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}.cob-lista button.on{border-color:var(--pri,#5633c7);font-weight:600}

/* ---- celular: tabelas viram cartões, números em 2 colunas, abas numa linha só ---- */
@media (max-width: 640px) {
  .tbl-wrap table.cartao { border: 0; }
  .tbl-wrap table.cartao thead { display: none; }
  .tbl-wrap table.cartao, .tbl-wrap table.cartao tbody, .tbl-wrap table.cartao tr, .tbl-wrap table.cartao td { display: block; width: 100%; }
  .tbl-wrap table.cartao tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; background: var(--card, #fff); }
  .tbl-wrap table.cartao td { padding: 4px 0; border: 0; text-align: right; white-space: normal; overflow: hidden; }
  .tbl-wrap table.cartao td::before { content: attr(data-l); float: left; max-width: 42%; margin-right: 12px; text-align: left; color: var(--muted); font-size: 12px; line-height: 1.9; }
  .tbl-wrap table.cartao td[data-l=""]::before { display: none; }
  .tbl-wrap table.cartao td[data-l=""] { padding-top: 8px; }
  .tbl-wrap table.cartao td:empty { display: none; }
  .tbl-wrap table.cartao td .sub-l { display: none; }
  .tbl-wrap { overflow: visible; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid .kpi { padding: 12px; } .grid .kpi .v { font-size: 18px; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; gap: 16px; scrollbar-width: none; } .subnav::-webkit-scrollbar { display: none; } .subnav a { white-space: nowrap; }
  .aging .ag-v { display: none; }
  .filtros > div:not(.spacer) { flex: 1 1 140px; } .filtros input, .filtros select { width: 100%; }
  .ov .acts { flex-wrap: wrap; } .ov .acts button { flex: 1 1 auto; }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ---- emissão da nota ---- */
.modal.nf-modal { max-width: 980px; width: min(980px, calc(100vw - 32px)); }
.nf-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .nf-top h3 { margin: 0; }
.nf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.nf-form section { margin-bottom: 14px; }
.nf-form h4, .nf-depois h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nf-form select, .nf-form input, .nf-form textarea { width: 100%; }
.nf-linha { display: flex; gap: 8px; align-items: center; } .nf-linha select { flex: 1; }
.nf-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.nf-mais { border-top: 1px solid var(--line); padding-top: 10px; } .nf-mais summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.nf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-chk { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.chip-chk input { width: auto; margin: 0; }
.nf-lado { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.nf-resumo { background: var(--soft); border-radius: 12px; padding: 14px; font-size: 13px; }
.nf-total { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; } .nf-total span { color: var(--muted); font-size: 12px; } .nf-total b { font-size: 22px; }
.nf-l { display: flex; justify-content: space-between; padding: 3px 0; } .nf-l b { font-weight: 500; font-variant-numeric: normal; }
.nf-pend { margin-top: 10px; font-size: 12.5px; } .nf-pend ul { margin: 4px 0 0; padding-left: 16px; }
.nf-depois { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.nf-op { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; } .nf-op input { width: auto; margin-top: 3px; }
.nf-op small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
@media (max-width: 760px) { .nf-grid { grid-template-columns: 1fr; } .nf-3 { grid-template-columns: 1fr 1fr; } .nf-lado { position: static; } }

/* ---- bancos de cobrança ---- */
.bk-lista { display: flex; flex-direction: column; }
.bk-row { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.bk-row:first-child { border-top: 0; }
.bk-nome { display: flex; flex-direction: column; } .bk-nome span { color: var(--muted); font-size: 12px; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.bk-acts { display: flex; gap: 6px; }
.bk-escolha { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
@media (max-width: 760px) { .bk-row { grid-template-columns: 1fr; gap: 6px; } }
.nf-form section > label { display: block; margin-top: 10px; }

/* aviso de versão nova */
.aviso-versao { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1200; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.28); font-size: 14px; }
.aviso-versao button:not(.pri) { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }

/* fechamento do mês */
.fc-lista { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.fc-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-weight: 400; }
.fc-item:hover { background: rgba(0,0,0,.035); }
.fc-item input { width: 18px; height: 18px; flex: none; margin: 0; }
.fc-item .fc-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fc-item .fc-txt small { color: var(--mut, #777); font-size: 12px; }
.fc-item.feito .fc-txt b { color: var(--mut, #777); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.fc-item a.sd { text-decoration: none; }
@media (max-width: 640px) { .fc-item { flex-wrap: wrap; } .fc-item .sd { margin-left: 30px; } }
.fc-alertas { display: flex; flex-direction: column; }
.fc-alerta { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.06); }
.fc-alerta:first-child { border-top: 0; }
.fc-alerta > div { flex: 1; }
.fc-alerta .sd { margin-top: 6px; }

/* orçamento: grade de 12 meses */
.orc-grade { max-height: 60vh; overflow: auto; margin-top: 8px; }
.orc-grade td:first-child { white-space: nowrap; min-width: 220px; }
.orc-grade .orc-in { width: 84px; padding: 4px 6px; text-align: right; font-size: 13px; }
td.pos { color: var(--ok, #0b7a57); } td.neg { color: var(--bad, #c62828); }

/* início padronizável */
.ini-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.ini-grade .ini-full { grid-column: 1 / -1; }
@media (max-width: 980px) { .ini-grade { grid-template-columns: 1fr; } }
.chip-cfg { opacity: .75; }
.ip-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin: 12px 0; }
.ip-grupo { display: flex; flex-direction: column; gap: 6px; }
.ip-grupo label { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; }
.ip-grupo input { width: 16px; height: 16px; margin: 0; }
/* checklist do cliente */
.chk-mes .barra { height: 8px; border-radius: 6px; background: rgba(0,0,0,.07); overflow: hidden; margin: 10px 0 6px; }
.chk-mes .barra span { display: block; height: 100%; background: var(--ok, #0b7a57); }
/* chamados */
.ch-conversa { max-height: 46vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; padding: 4px; }
.ch-msg { max-width: 82%; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.04); font-size: 14px; line-height: 1.45; }
.ch-msg.esc { align-self: flex-end; background: rgba(91, 76, 230, .08); }
.ch-msg .ch-meta { font-size: 12px; color: var(--muted, #777); margin-bottom: 4px; }
.pd-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; max-height: 40vh; overflow: auto; margin: 8px 0; } .pd-lista label { display: flex; gap: 8px; align-items: center; font-weight: 400; }

/* pendências do cliente em cartões: uma ação por cartão */
.pd-cards { display: grid; gap: 10px; }
.pd-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.pd-card.atrasado { border-color: var(--bad); }
.pd-ico { font-size: 22px; color: var(--brand); line-height: 1; padding-top: 2px; }
.pd-txt { flex: 1; min-width: 0; }
.pd-txt input.pd-obs { width: 100%; margin-top: 8px; }
.pd-bts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pd-opc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pd-opc .chip { cursor: pointer; }
.chip.on { border-color: var(--brand); color: var(--brand); font-weight: 600; background: color-mix(in srgb, var(--brand) 10%, transparent); }
@media (max-width: 640px) { .pd-card { flex-wrap: wrap; } .pd-bts { width: 100%; } .pd-bts button { flex: 1; } }
.perg-resp { margin-top: 4px; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 8%, transparent); }
/* manuais */
.man-ind { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13.5px; }
.man-sec { scroll-margin-top: 70px; line-height: 1.55; }
.man-sec li { margin: 4px 0; }
@media print { .sidebar, .topbar, header, nav.man-ind, #man-q, [data-imprimir] { display: none !important; } .man-sec { break-inside: avoid; border: 0; } }
/* fechamento: responsável e prazo por item */
.fc-tarefa { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.fc-tarefa select, .fc-tarefa input { font-size: 12px; padding: 3px 6px; height: auto; width: auto; max-width: 220px; }
.fc-tarefa input.atrasado { border-color: var(--bad); color: var(--bad); }

/* fila de trabalho */
.fl-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.fl-g { width: 9px; height: 9px; border-radius: 99px; display: inline-block; background: var(--line); flex: none; }
.fl-g.atrasado { background: var(--bad); } .fl-g.hoje { background: var(--accent); } .fl-g.semana { background: var(--brand); }
.fl-lista { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fl-item { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fl-item:last-child { border-bottom: 0; }
.fl-ic { font-size: 20px; color: var(--brand); flex: none; }
.fl-txt { flex: 1; min-width: 0; } .fl-txt .sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-meta { text-align: right; font-size: 13px; min-width: 90px; }
.fl-bts { display: flex; gap: 6px; }
.fila-ini a { display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 640px) { .fl-item { flex-wrap: wrap; } .fl-meta { text-align: left; } .fl-bts { width: 100%; } .fl-bts button { flex: 1; } }
/* aprovações */
.pr-cards { display: grid; gap: 12px; }
.pr-card h3 { font-size: 16px; }
.pr-motivo { background: color-mix(in srgb, var(--brand) 7%, transparent); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 10px 0; }
table.pr-part { width: 100%; font-size: 13px; margin: 8px 0; } table.pr-part td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
/* tabelas: barra comum, lote e edição na célula */
.tb-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.tb-bar input[type=search] { max-width: 240px; padding: 6px 10px; font-size: 13px; }
.tb-salvos { display: flex; gap: 6px; flex-wrap: wrap; } .tb-salvos .chip span { margin-left: 6px; opacity: .55; cursor: pointer; } .tb-salvos .chip { cursor: pointer; }
.lote-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, transparent); margin: 4px 0 8px; position: sticky; top: 60px; z-index: 3; }
th.chk, td.chk { width: 28px; } td.chk input, th.chk input { width: auto; margin: 0; }
td.ed { cursor: text; } td.ed:hover { box-shadow: inset 0 -1px 0 var(--brand); } td.ed .ed-in { width: 100%; min-width: 110px; padding: 3px 6px; font-size: 13px; } td.salvando { opacity: .5; }
/* consolidação */
table.cons td, table.cons th { white-space: nowrap; } table.cons tr.tot td { font-weight: 600; border-top: 1px solid var(--line); }
/* conta do escritório: aviso de licença, planos, primeiro acesso, entrada */
.aviso-lic { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.aviso-lic.warn { background: color-mix(in srgb, var(--accent) 16%, transparent); } .aviso-lic.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); }
.aviso-lic a { font-weight: 600; margin-left: 6px; }
.plano-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 10px; }
.plano-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.plano-card.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.plano-card button, .plano-card .pill { margin-top: auto; align-self: flex-start; }
.pa-passo.feito { opacity: .7; } .pa-n { width: 30px; height: 30px; border-radius: 99px; background: var(--brand-l); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.pa-passo.feito .pa-n { background: var(--ok); color: #fff; }
.lg-op { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; } .lg-op p { margin: 4px 0 10px; font-size: 14px; }
.lg-btn.sec { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.crono { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 10px 0 4px; }
.crono div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; display: flex; flex-direction: column; } .crono span { color: var(--muted); }
a.rz-l { color: inherit; text-decoration: none; } a.rz-l:hover { color: var(--brand); text-decoration: underline; }
table.rel-cols td, table.rel-cols th { white-space: nowrap; }
/* fluxos automáticos */
.fx-modelos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; } .fx-modelos .chip { cursor: pointer; }
.fx-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); } .fx-item:last-of-type { border-bottom: 0; }
.fx-st { width: 10px; height: 10px; border-radius: 99px; background: var(--line); margin-top: 6px; flex: none; } .fx-st.on { background: var(--ok); } .fx-st.pause { background: var(--accent); }
.fx-resumo { background: color-mix(in srgb, var(--brand) 8%, transparent); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.fx-bloco { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; } .fx-bloco > b { display: block; margin-bottom: 4px; }
.fx-acao { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; align-items: flex-end; }
@media (max-width: 640px) { .fx-item { flex-wrap: wrap; } }
td.nw, th.nw { white-space: nowrap; }

/* ---- celular, segunda passada ----
   iPhone: campo com letra menor que 16px faz o Safari dar zoom sozinho e a tela fica cortada dos lados. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 800px) {
  input, select, textarea, .ask input { font-size: 16px !important; }
  html, body { overflow-x: hidden; }
  .tb { padding-top: 8px; padding-bottom: 8px; gap: 6px; }
  .tb-r { gap: 8px; font-size: 12px; }
  .tb-r > .mut { display: none; }                                   /* mês do topo: já aparece nas telas */
  .ct { padding-bottom: 96px; }                                     /* o botão da IA não cobre o fim da tela */
  #ia-fab { width: 46px; height: 46px; font-size: 21px; right: 14px; bottom: 74px; }
  #ia-panel { right: 8px; left: 8px; width: auto; bottom: 128px; height: min(560px, calc(100vh - 150px)); }
  .hero { padding: 6px 0 16px; justify-items: stretch; }
  .hero h2 { font-size: 21px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { white-space: nowrap; flex: 0 0 auto; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: 0 0 auto; }
  .ini-grade { gap: 20px; }
  .card { padding: 14px; }
  .filtros { gap: 8px; } .filtros .spacer { display: none; }
  .filtros > button, .filtros > .btn, .filtros > a.btn { flex: 1 1 auto; }
  .rail { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .filtros input[type=date] { min-width: 0; }
  .filtros > .tabs { flex: 1 1 100%; min-width: 0; }                 /* abas dentro da barra de filtros: linha própria, rolando de lado */
}

/* ---- nota rápida ---- */
.nr-modal { max-width: 520px; }
.nr-modal label { margin-top: 10px; }
.nr-cli { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.nr-cli b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.nr-lista { display: grid; gap: 4px; margin: 6px 0; }
.nr-op { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.nr-linha { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
.nr-modal input, .nr-modal select, .nr-modal textarea { width: 100%; box-sizing: border-box; min-width: 0; }
.nr-modal .nf-op input { width: auto; }
.nr-cli .mut { white-space: nowrap; }
@media (max-width: 420px) { .nr-cli .mut { display: none; } }
.nr-valor { font-size: 22px !important; font-weight: 700; }
.nr-resumo { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.nr-resumo b { color: var(--ink); }
.ask-mic { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); padding: 0; background: var(--bg); color: var(--ink); display: grid; place-items: center; font-size: 18px; }
.ask-mic.on { background: #e5484d; border-color: #e5484d; color: #fff; animation: mic-pulsa 1.2s infinite; }
@keyframes mic-pulsa { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .45); } 50% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); } }

/* =============================================================================
   CELULAR: navegação de baixo com 4 atalhos + "Mais", tipografia única e
   tabelas em cartões compactos (rótulo pequeno em cima, valor embaixo, duas colunas)
   ============================================================================= */
.bn, .bn-sheet, .tb-busca { display: none; }
@media (max-width: 800px) {
  .rail { display: none; }
  .bn { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; background: var(--bg); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bn a, .bn button { display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border: 0; background: none; color: var(--muted); text-decoration: none; font: 500 10.5px/1.1 var(--fonte-texto); border-radius: 10px; min-width: 0; }
  .bn i { font-size: 21px; }
  .bn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bn .on { color: var(--brand); }
  .bn-sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 950; }
  .bn-fundo { position: absolute; inset: 0; background: rgba(27, 22, 56, .35); }
  .bn-painel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; background: var(--bg); border-radius: 16px 16px 0 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); }
  .bn-top { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg); padding: 10px 0; font-size: 15px; }
  .bn-g { padding: 10px 0; border-top: 1px solid var(--line); }
  .bn-gt { display: flex; gap: 8px; align-items: center; font: 600 12px/1 var(--fonte-texto); color: var(--muted); margin-bottom: 8px; }
  .bn-gt i { font-size: 16px; }
  .bn-ls { display: flex; flex-wrap: wrap; gap: 6px; }
  .bn-ls a { padding: 8px 14px; border-radius: 999px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 13.5px; }
  .bn-sair { margin-top: 12px; width: 100%; display: flex; gap: 8px; justify-content: center; align-items: center; }
  .tb-busca { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 18px; }
  #ia-fab { bottom: calc(68px + env(safe-area-inset-bottom)); }
  #ia-panel { bottom: calc(122px + env(safe-area-inset-bottom)); }
  .ct { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

  /* tipografia: uma escala só */
  body { font-size: 14px; }
  .ph { margin-bottom: 10px; }
  .ph h1 { font-size: 20px; }
  .card h3, .card h2 { font-size: 15px; }
  .filtros > p.mut, .card > p.mut { font-size: 13px; line-height: 1.45; }
  .pill { font-family: var(--fonte-texto); font-size: 11px; font-weight: 600; padding: 2px 7px; letter-spacing: 0; }
  td.r, .kv, .na .n { font-variant-numeric: normal; }
  .emp-sel .sel { max-width: calc(100vw - 90px); font-size: 14px; padding: 7px 10px; }
  .emp-sel .sel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
  .tbl-wrap table.cartao tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; row-gap: 8px; padding: 12px 14px; border-radius: 12px; }
  .tbl-wrap table.cartao td { text-align: left; padding: 0; font: 400 14px/1.3 var(--fonte-texto); font-variant-numeric: normal; min-width: 0; overflow-wrap: anywhere; }
  .tbl-wrap table.cartao td::before { float: none; display: block; max-width: none; margin: 0 0 2px; font: 400 11.5px/1.2 var(--fonte-texto); letter-spacing: 0; text-transform: none; color: var(--muted); }
  .tbl-wrap table.cartao td:first-child { grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
  .tbl-wrap table.cartao td:first-child::before { display: none; }
  .tbl-wrap table.cartao td.chk:first-child + td { grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
  .tbl-wrap table.cartao td.chk:first-child { grid-column: auto; }
  .tbl-wrap table.cartao td[data-l=""] { grid-column: 1 / -1; padding-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
  .tbl-wrap table.cartao td[data-l=""] button, .tbl-wrap table.cartao td[data-l=""] .btn { flex: 1 1 auto; }
  .tbl-wrap table.cartao td.vz { display: none; }
  .tbl-wrap table.cartao td .pill { margin: 2px 4px 0 0; }
}
@media (max-width: 800px) {
  .tb { flex-wrap: nowrap; }
  .emp-sel { flex: 1 1 auto; min-width: 0; }
  .emp-sel .sel { max-width: 100%; }
  .tb-r { flex: 0 0 auto; }
  .tb-r .badge { font-size: 10.5px; padding: 2px 7px; }
  .tb-r .falta-tg { display: none; }
  .kpi .l, .sl, .kl, .bq-g { font-family: var(--fonte-texto); letter-spacing: .04em; }
  .kpi .v { font-size: 19px; } .kv { font-size: 20px; }
  .kg { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
  .kpi-l { padding: 12px; gap: 4px; }
  .ag-b { height: 90px; gap: 8px; }
  .subnav { margin-bottom: 12px; }
  .subnav a { font-size: 13.5px; }
}
@media (max-width: 640px) {
  .tbl-wrap table.cartao td, .tbl-wrap table.cartao tr:hover td { background: transparent; }
}
@media (max-width: 640px) {
  .card:has(table.cartao) { border: 0; padding: 0; background: transparent; box-shadow: none; }      /* sem cartão dentro de cartão */
  .card:has(table.cartao) > .filtros { margin-bottom: 10px; }
}
.fz-bt { display: none; }
@media (max-width: 640px) {
  .filtros.fz > .fz-bt { display: inline-flex; gap: 6px; align-items: center; flex: 0 0 auto; }
  .filtros.fz:not(.aberto) > div:not(.spacer) { display: none; }
  .filtros.fz.aberto > .fz-bt { background: var(--brand-l); border-color: var(--brand-l); color: var(--brand-dd); }
  .tb-bar [data-tb-salvar], .tb-bar [data-tb-cols], .tb-bar .spacer, .tb-bar [data-tb-n] { display: none; }
  .tb-bar { flex-wrap: nowrap; gap: 8px; }
  .tb-bar input[type=search] { flex: 1 1 auto; min-width: 0; }
  .kpi-sp .spark { display: none; }
  .kpi .v, .kv { font-size: 18px; }
  .hero h2 { font-size: 19px; }
}

/* NAVEGAÇÃO: no computador, trilho de ícones (nome ao passar o mouse) e as telas do grupo em abas no topo;
   no celular, o menu flutuante de baixo. A versão com nomes na lateral (16/10) foi desfeita a pedido. */
.rail .lb, .rail .rs { display: none; }
.ph-d { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 75ch; }
.ph-d[hidden] { display: none; }
@media (min-width: 1100px) {
  .ct { max-width: 1240px; }
}
.rail .ent .ent-av { display: inline-grid; place-items: center; }
.como { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.como > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--soft); }
.como i { grid-row: span 2; font-size: 20px; color: var(--brand); }
.como b { font-size: 13.5px; } .como span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 800px) { .como { grid-template-columns: 1fr; } }
.filtros:has(> .tabs) { align-items: center; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
/* lista vazia: o grilo da marca sentado, esperando (no lugar do ícone de lista) */
.empty::before { content: ''; width: 78px; height: 50px; background: url("../img/grilo.svg") center bottom / contain no-repeat; opacity: .92; }

.lote-bar[hidden] { display: none !important; }
.pill { font-family: var(--fonte-texto); font-weight: 600; font-size: 11.5px; letter-spacing: 0; }
.tb-r .falta-tg { padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; }
.tb-r .falta-tg:has(input:checked) { background: var(--brand-l); border-color: var(--brand-l); color: var(--brand-dd); }
@media (max-width: 640px) { .ph-d { display: none; } }
.tb-r .falta-tg { position: relative; } .tb-r .falta-tg input { position: absolute; opacity: 0; pointer-events: none; }
.tb-r .falta-tg::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tb-r .falta-tg:has(input:checked)::before { background: var(--brand); }
/* cabeçalho padrão: título + descrição à esquerda, ação principal à direita */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-t { min-width: 0; flex: 1 1 320px; }
.ph-a { display: flex; gap: 8px; flex: 0 0 auto; }
.ph-a:empty { display: none; }
.ph-a .ph-bt { height: 38px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.no-topo { display: none !important; }
@media (max-width: 640px) { .ph { align-items: stretch; } .ph-a { flex: 1 1 100%; } .ph-a .ph-bt { flex: 1; justify-content: center; } }
/* visão: contador x cliente (só para quem é do escritório) */
.visao { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--soft); gap: 2px; }
.visao button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.visao button i { font-size: 15px; }
.visao button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 22, 56, .12); font-weight: 600; }
.faixa-cli { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 16px; border-radius: 12px; background: #fff7e6; color: #6b4a00; font-size: 13.5px; }
.faixa-cli > i { font-size: 18px; } .faixa-cli > span { flex: 1; min-width: 200px; }
.rsec { font: 600 10.5px/1 var(--fonte-texto); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 800px) {
  .visao button { padding: 6px 8px; } .visao button span { display: none; }
  .visao button.on span { display: inline; }
  .faixa-cli { font-size: 12.5px; padding: 8px 12px; } .faixa-cli button { flex: 1 1 100%; }
}
@media (max-width: 800px) {
  .tb-r .badge { display: none; }
  .visao button span, .visao button.on span { display: none; }
}
.papeis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.papeis > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; row-gap: 3px; padding: 14px 16px; border-radius: 12px; background: var(--soft); }
.papeis > div > i:first-child { grid-row: span 2; font-size: 20px; color: var(--brand); }
.papeis b { font-size: 13.5px; } .papeis span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 900px) { .papeis { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .kv, .kpi .v { font-size: 17px !important; letter-spacing: -.01em; min-width: 0; }
  .kpi-l { min-width: 0; overflow: hidden; }
  .kl { font-size: 10.5px; }
}
/* etapas de formulário */
.passo-h { list-style: none; display: flex; gap: 6px; padding: 0; margin: -6px 0 16px; flex-wrap: wrap; }
.passo-h li { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); padding: 5px 10px 5px 5px; border-radius: 99px; background: var(--soft); cursor: default; }
.passo-h li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 11px/1 var(--fonte-texto); background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.passo-h li.on { background: var(--brand-l); color: var(--brand-dd); font-weight: 600; }
.passo-h li.on span { background: var(--brand); color: #fff; border-color: var(--brand); }
.passo-h li.ok { cursor: pointer; } .passo-h li.ok span { background: var(--ok); color: #fff; border-color: var(--ok); }
.passo[hidden] { display: none !important; }

/* =============================================================================
   INÍCIO mais limpo: saudação à esquerda, pedido em linha, números primeiro, só o que pede ação
   ============================================================================= */
.hero { justify-items: stretch; padding: 4px 0 18px; gap: 12px; }
.hero-t { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-t h2 { font-size: 22px; } .hero-t .mut { font-size: 13px; text-transform: lowercase; }
.hero .ask { max-width: none; width: 100%; }
.hero .chips { justify-content: flex-start; }
.passos-aviso { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; align-items: center; gap: 16px; padding: 10px 14px; margin: 0 0 20px; border-radius: 12px; background: var(--soft); }
.pa-txt { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; min-width: 0; } .pa-txt span { color: var(--muted); }
.pa-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; } .pa-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.passos-aviso .pa-ir { font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.passos-aviso .pa-ir .ti { font-size: 15px; color: inherit; }
.ok-dia span { display: inline-flex; gap: 6px; align-items: center; color: var(--ok); }
.ini-grade .ini-full:first-child .kg { margin-bottom: 0; }
@media (max-width: 640px) {
  .hero { padding: 0 0 12px; gap: 10px; }
  .hero-t h2 { font-size: 20px; }
  /* atalhos viram uma grade de 4 ícones, como em app de banco */
  .hero .chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: visible; margin: 0; padding: 0; }
  .hero .chips .chip { display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border-radius: 12px; font-size: 11px; line-height: 1.15; text-align: center; white-space: normal; background: var(--soft); border: 0; }
  .hero .chips .chip .ti { font-size: 20px; color: var(--brand); }
  .hero .chips .chip:nth-child(n+5) { display: none; }
  .passos-aviso { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; margin-bottom: 16px; }
  .passos-aviso .pa-bar { grid-column: 1 / -1; grid-row: 2; }
  .pa-txt span { display: none; }
  .ini-grade { gap: 18px; }
  .ini-sec .sl { margin-bottom: 6px; }
}
@media (max-width: 640px) {
  .tbl-wrap table.cartao td.so-desk { display: none; }
  .ask-prev:empty { display: none; }
  /* as abas do Início (Início, Planner, Implantação) ficam também no celular */
  .kpi-l { padding: 12px 14px; gap: 2px; }
  .kpi-l .ks { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .kpi-l .ks br { display: none; }
}
/* tela de bloqueio */
.trava { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.trava-box { width: min(380px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 24px; border-radius: 18px; background: var(--card, #fff); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(27, 22, 56, .18); }
.trava-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-l); color: var(--brand); font-size: 28px; }
.trava-box h2 { margin: 0; font-size: 20px; } .trava-box .mut { margin: -6px 0 6px; font-size: 13px; }
.trava-bio { width: 100%; height: 46px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-size: 15px; }
.trava-bio .ti { font-size: 22px; }
.trava-ou { font-size: 12px; color: var(--muted); }
.trava form { display: flex; gap: 8px; width: 100%; } .trava form input { flex: 1; min-width: 0; }
.trava-err { min-height: 18px; font-size: 13px; color: var(--bad); }
.trava-sair { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; }
/* minha segurança */
.seg-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.seg-grade .card { margin: 0; display: grid; gap: 8px; align-content: start; }
.seg-h { display: flex; gap: 12px; align-items: center; } .seg-h > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-l); color: var(--brand); font-size: 20px; flex: none; }
.seg-h h3 { margin: 0 0 2px; } .seg p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.seg-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; } .seg-acts .mut { flex: 1; }
.seg-dicas { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.seg-passos { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.seg-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px; border-radius: 12px; background: var(--soft); margin-bottom: 12px; }
.seg-qr img { width: 168px; height: 168px; background: #fff; border-radius: 10px; padding: 6px; }
.seg-qr > div { display: grid; gap: 6px; min-width: 0; flex: 1; } .seg-qr code { word-break: break-all; font-size: 13px; }
.faixa-2fa { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 16px; border-radius: 12px; background: var(--brand-l); color: var(--ink); font-size: 13.5px; }
.faixa-2fa > i { font-size: 20px; color: var(--brand); } .faixa-2fa > span { flex: 1; min-width: 220px; }
@media (max-width: 800px) { .seg-grade { grid-template-columns: 1fr; } }
/* lista compacta no celular: uma linha por registro */
.lc-cel { display: none; }
@media (max-width: 640px) {
  .lc-desk { display: none; } .lc-cel { display: block; }
  .lc { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card, #fff); }
  .lc li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; padding: 11px 14px; border-top: 1px solid var(--line); }
  .lc li:first-child { border-top: 0; }
  .lc li[role=button]:active { background: var(--hover); }
  .lc-p { min-width: 0; display: grid; gap: 2px; }
  .lc-p b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lc-p span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lc-v { display: grid; justify-items: end; gap: 2px; text-align: right; }
  .lc-v b { font-size: 14.5px; font-variant-numeric: normal; white-space: nowrap; }
  .lc-v span { font-size: 11.5px; white-space: nowrap; }
  .lc-a { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; } .lc-a:empty { display: none; }
  .lc-a button, .lc-a .pill { font-size: 12.5px; }
  .lc-a button { padding: 5px 10px; }
}
@media (max-width: 640px) {
  .card:has(> .aging), .card:has(.aging) { display: none; }
  .kg > .kpi:nth-child(3):last-child { display: none; }
}
@media (max-width: 640px) {
  .card:has(.lc-cel) { border: 0; padding: 0; background: transparent; box-shadow: none; }
  .lc li { padding: 10px 12px; row-gap: 4px; }
  .lc-a { gap: 6px; }
  .lc-a button { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
}
@media (max-width: 640px) {
  a.btn.nf-rec { display: none; }            /* Recorrências já está nas abas de cima */
  .filtros:has(.nf-mes) > .tabs { flex: 1 1 100%; }
  .nf-mes { flex: 1 1 100%; } .nf-mes select { width: 100%; }
}
/* marca e domínio */
.mc-grade { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.mc-grade .card { margin: 0 0 16px; }
.mc-grade input[type=color] { height: 40px; padding: 4px; width: 100%; }
.mc-tela { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); }
.mc-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 3px solid var(--brand); }
.mc-logo img { max-height: 28px; max-width: 110px; display: block; }
.mc-corpo { padding: 18px 14px; display: grid; gap: 10px; }
.mc-l { height: 10px; border-radius: 6px; background: var(--soft); } .mc-l.c { width: 60%; }
.mc-bt { justify-self: start; color: #fff; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 13px; }
.mc-dns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.mc-dns span { font-size: 12px; color: var(--muted); }
.rail-marca { display: none; }
.lg-logo { max-height: 28px; max-width: 120px; margin-right: 10px; }
@media (min-width: 1100px) { .rail-marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; } .rail-marca img { max-height: 26px; max-width: 90px; } .rail-marca span { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
@media (max-width: 900px) { .mc-grade { grid-template-columns: 1fr; } }

/* ---------- Avisos ao cliente ---------- */
.av-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.av-grade h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted, #6b6b78); }
.av-liga { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.av-liga h3 { margin: 0 0 4px; }
label.chk { display: flex; gap: 8px; align-items: center; font-weight: 400; cursor: pointer; }
label.chk input { width: auto; margin: 0; }
.chave { position: relative; flex: none; width: 44px; height: 26px; cursor: pointer; }
.chave input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chave span { position: absolute; inset: 0; border-radius: 999px; background: var(--line, #d9d9e0); transition: background .15s; pointer-events: none; }
.chave span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.chave input:checked + span { background: var(--brand, #5633c7); }
.chave input:checked + span::after { transform: translateX(18px); }
.chave input:focus-visible + span { outline: 2px solid var(--brand, #5633c7); outline-offset: 2px; }
.chave input:disabled + span { opacity: .5; }
.av-prev iframe { width: 100%; height: 620px; border: 0; border-radius: 10px; background: #f4f4f6; }
@media (max-width: 1000px) { .av-grade { grid-template-columns: 1fr; } .av-prev iframe { height: 560px; } }


/* ---------- menu inferior flutuante (celular): barra em cápsula com vidro fosco, botão central para todas as telas ---------- */
@media (max-width: 800px) {
  .bn { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px;
    background: rgba(246, 246, 250, .72); -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px);
    box-shadow: 0 10px 30px -10px rgba(27, 22, 56, .35), 0 1px 0 rgba(255, 255, 255, .6) inset; align-items: center; }
  .bn a { padding: 7px 0 6px; border-radius: 999px; color: var(--ink); font-size: 11px; gap: 3px; transition: background .15s, color .15s; }
  .bn a i { font-size: 22px; }
  .bn a.on { background: rgba(27, 22, 56, .08); color: var(--brand); }
  .bn a:active { background: rgba(27, 22, 56, .12); }
  .bn .bn-centro { justify-self: center; width: 54px; height: 54px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
    background: rgba(255, 255, 255, .55); border: 1.5px solid rgba(27, 22, 56, .55); }
  .bn .bn-centro i { font-size: 26px; }
  .bn .bn-centro.on { border-color: var(--brand); color: var(--brand); }
  #ia-fab { bottom: calc(92px + env(safe-area-inset-bottom)); }
  #ia-panel { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .ct { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
}
html[data-tema="escuro"] nav.bn { background: rgba(32, 29, 44, .72); border-color: rgba(255, 255, 255, .08); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
html[data-tema="escuro"] .bn a { color: var(--ink); }
html[data-tema="escuro"] .bn a.on { background: rgba(255, 255, 255, .1); color: #fff; }
html[data-tema="escuro"] .bn .bn-centro { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .55); color: #fff; }

/* abas das seções no celular: cápsulas roláveis lado a lado */
@media (max-width: 800px) {
  .subnav { flex-wrap: nowrap; overflow-x: auto; gap: 8px; border-bottom: 0; margin: 0 -16px 18px; padding: 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: none; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; margin: 0; font-size: 13px; color: var(--ink); background: var(--soft); white-space: nowrap; }
  .subnav a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
  .subnav a.x.on { background: var(--x); border-color: var(--x); color: #fff; }
  html[data-tema="escuro"] .subnav a.on { background: #fff; color: #111; border-color: #fff; }
}

/* carregando: esqueleto em vez de tela em branco */
.esq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.esq i { height: 92px; border-radius: 14px; background: linear-gradient(90deg, var(--soft) 0%, var(--hover) 50%, var(--soft) 100%); background-size: 200% 100%; animation: esq 1.2s ease-in-out infinite; }
.esq i.g { grid-column: 1 / -1; height: 260px; }
@keyframes esq { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (max-width: 640px) { .esq { grid-template-columns: 1fr 1fr; } .esq i:nth-child(3) { display: none; } }
@media (prefers-reduced-motion: reduce) { .esq i { animation: none; } }
.lento { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.volta-fluxo { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 7px 14px 7px 10px; border-radius: 999px; background: var(--brand-l); color: var(--brand-dd); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.volta-fluxo:hover { filter: brightness(.97); }
.card.destaque { box-shadow: 0 0 0 2px var(--brand); transition: box-shadow .4s; }
html[data-tema="escuro"] .volta-fluxo { background: rgba(133, 121, 255, .16); color: #c9c3ff; }

/* janelas no celular: sobem de baixo, ocupam a altura necessária e os botões ficam sempre à vista */
@media (max-width: 640px) {
  .ov { align-items: flex-end; padding: 0; }
  .ov .modal, .ov .modal.wide { max-width: none; width: 100%; max-height: 92dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 22px 18px 0; animation: sobe .2s ease-out; }
  .ov .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: -10px auto 14px; }
  .ov .modal > .acts, .ov .modal .acts:last-child { position: sticky; bottom: 0; background: var(--card, #fff); margin: 14px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 2; }
}
@keyframes sobe { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ov .modal { animation: none; } }

/* importação em segundo plano: cápsula discreta acima do menu */
.imp-capsula { position: fixed; z-index: 850; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 999px;
  background: var(--card, #fff); border: 1px solid var(--line); box-shadow: 0 10px 30px -12px rgba(27, 22, 56, .4); max-width: calc(100vw - 32px); }
.imp-capsula .gira { font-size: 20px; color: var(--brand); animation: gira 1s linear infinite; }
.imp-capsula .ic-t { display: grid; gap: 3px; min-width: 0; font-size: 13px; }
.imp-capsula .ic-t b { font-size: 13.5px; } .imp-capsula .ic-t span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-capsula .ic-bar { display: block; height: 4px; width: 180px; max-width: 100%; border-radius: 4px; background: var(--soft); overflow: hidden; }
.imp-capsula .ic-bar i { display: block; height: 100%; background: var(--brand); transition: width .4s; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (max-width: 800px) { .imp-capsula { bottom: calc(92px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .imp-capsula .gira { animation: none; } }

/* ---------- marca Grillus: logo oficial (SVG em curvas, nunca recomposto pela fonte) ---------- */
.lg-gr { height: 28px; width: auto; display: block; }
.lg-gr-escuro { display: none; }
html[data-tema="escuro"] .lg-gr:not(.lg-gr-escuro) { display: none; }
html[data-tema="escuro"] .lg-gr-escuro { display: block; }
.rail-g { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 9px; }
.rail-g img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.rail-g:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 800px) { .rail-g { display: none; } }
:focus-visible { outline-color: var(--brand); }
.lg-top .lg-gr { height: 36px; }
@media (max-width: 640px) { .lg-top .lg-gr { height: 30px; } }
.lg-foot { background: var(--dark); }
.lg-help a, .lg-box a { color: var(--brand-dd); }
html[data-tema="escuro"] .lg-foot { background: #0c0c0f; }

/* ---------- Antenas da Grillus (kit da marca, sistema/grillus-ui.css) ---------- */
:root { --gr-ink: #19191d; --gr-violet: #7653f6; --gr-action: #5633c7; --gr-action-hover: #6844db; --gr-lavender: #bba5ff; --gr-muted: #62626f; --gr-border: #dedee7; --gr-input: #85818f; }
.gr-antennae { display: inline-block; vertical-align: middle; flex-shrink: 0; overflow: visible; width: var(--gr-ant-size, 32px); height: var(--gr-ant-size, 32px); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gr-antennae.gr-ico { stroke-width: 6; }
.gr-ant-left, .gr-ant-right { transform-box: fill-box; transform-origin: bottom center; transition: transform .45s ease; }
.gr-antenna-host:hover:not(:disabled) .gr-ant-left, .gr-antenna-host:focus-visible .gr-ant-left { transform: rotate(-12deg); }
.gr-antenna-host:hover:not(:disabled) .gr-ant-right, .gr-antenna-host:focus-visible .gr-ant-right { transform: rotate(12deg); }
.gr-antennae[data-state="loading"] .gr-ant-left { animation: gr-feel-left 1.5s ease-in-out infinite; }
.gr-antennae[data-state="loading"] .gr-ant-right { animation: gr-feel-right 1.5s ease-in-out .15s infinite; }
.gr-antennae[data-state="success"] { animation: gr-nod .55s ease-out 1; }
.gr-antennae[data-state="greeting"] .gr-ant-left { animation: gr-feel-left 1.6s ease-in-out 1; }
.gr-antennae[data-state="greeting"] .gr-ant-right { animation: gr-feel-right 1.6s ease-in-out .15s 1; }
@keyframes gr-feel-left { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(-12deg); } 70% { transform: rotate(4deg); } }
@keyframes gr-feel-right { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(12deg); } 70% { transform: rotate(-4deg); } }
@keyframes gr-nod { 45% { transform: translateY(-4px); } 75% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .gr-antennae, .gr-antennae * { animation: none !important; transition: none !important; transform: none !important; } }
#ia-fab .gr-antennae { color: #fff; margin-top: 4px; }
.ia-top b { display: inline-flex; align-items: center; gap: 6px; }
.ia-top .gr-antennae { color: var(--brand); }
.gr-sobre { display: flex; align-items: center; gap: 10px; margin: 18px 4px 4px; }
.gr-grilo { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--brand); display: grid; place-items: center; cursor: pointer; padding: 0; }
.gr-grilo:hover { background: var(--soft); }
.gr-grilo:focus-visible, #ia-fab:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.gr-egg { text-align: center; }
.gr-egg > .gr-antennae { color: var(--violeta); margin: 6px auto 4px; display: block; }
.gr-egg .gr-egg-grilo { display: block; width: 132px; height: auto; margin: 4px auto 2px; animation: gr-egg-pula 1.6s cubic-bezier(.3,.7,.4,1) .2s 2; transform-origin: 50% 100%; }
@keyframes gr-egg-pula { 0%, 100% { transform: none } 15% { transform: scaleY(.92) } 42% { transform: translateY(-18%) rotate(-4deg) } 66% { transform: none } 74% { transform: scaleY(.95) } }
@media (prefers-reduced-motion: reduce) { .gr-egg .gr-egg-grilo { animation: none } }
.gr-egg h3 { margin: 6px 0; text-wrap: balance; }
.gr-egg p { color: var(--muted); margin: 0 0 14px; }
.gr-egg .acts { justify-content: center; }
.orb .gr-antennae { color: #fff; margin-top: 2px; }
.pend-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pend-chips .chip { font-size: 12px; padding: 2px 8px; text-decoration: none; }
td.nowrap, th.nowrap { white-space: nowrap; }
.nf-txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 110px; max-width: 220px; }
.nf-l-aj { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; align-items: center; gap: 6px; }
.nf-l-aj > b { display: flex; align-items: center; justify-content: flex-end; gap: 2px; white-space: nowrap; }
.nf-pc { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.nf-aj { width: 58px; padding: 2px 6px; font-size: 13px; text-align: right; font-variant-numeric: normal; min-height: 0; height: 26px; }
.nf-l-aj b .nf-aj { width: 92px; }
.nf-l-aj > b:not(:has(input)) { padding-right: 7px; }
.nf-mud { font-style: normal; font-size: 11px; color: var(--warn, #b26a00); }
tr.destaque td { background: var(--brand-l); }
@media (max-width: 1200px) { th.larga, td.larga { display: none; } }
@media (max-width: 1200px) {
  td.nowrap, td.r.nowrap:last-child { white-space: normal; }
  td.r.nowrap:last-child button + button { margin-left: 0; }
  td.r.nowrap:last-child .sm { margin: 2px 0 2px 4px; }
  .ct td, .ct th { padding-left: 7px; padding-right: 7px; }
}

/* ---------- Início no padrão de blocos (uma coisa por bloco) ---------- */

/* Início: números, agenda e notas */
.hm { display: grid; gap: 0; max-width: 820px; margin: 8px auto 0; }
.hm-sec { padding: 22px 0 6px; }
.hm-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; min-height: 32px; }
.hm-h h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hm-mais { font-size: 13px; color: var(--muted); text-decoration: none; }
.hm-num { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 6px 0 4px; }
.hm-num .kpi { background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.hm-num .kpi .kl { font-size: 13px; color: var(--muted); display: block; }
.hm-num .kpi .kl .ti, .hm-num .kpi svg, .hm-num .kpi .tr { display: none; }
.hm-num .kpi .kv { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: normal; line-height: 1.15; }
.hm-num .kpi .ks { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-num .kpi .ks br { display: none; }
.hm-lista { display: grid; }
.hm-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 11px 0; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.hm-lista > .hm-row:first-child { border-top: 0; }
.hm-q { font-size: 13px; color: var(--muted); text-transform: capitalize; white-space: nowrap; }
.hm-q.hoje { color: var(--ink); font-weight: 700; }
.hm-q.bad { color: var(--bad); font-weight: 700; }
.hm-t { display: grid; gap: 2px; min-width: 0; }
.hm-t b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-t small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-v { font-variant-numeric: normal; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.hm-vazio { margin: 4px 0; color: var(--muted); font-size: 14px; }
.hm-emitir { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; background: var(--brand); border: 1px solid var(--brand); color: #fff; font-weight: 600; font-size: 14px; }
.hm-notas { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; text-decoration: none; color: var(--ink); }
.hm-notas b { font-size: 24px; font-weight: 700; font-variant-numeric: normal; letter-spacing: -.01em; }
.hm-notas span { color: var(--muted); font-size: 13px; }
.hm-notas .warn { color: var(--accent); text-decoration: none; }
.hm-bar { height: 4px; border-radius: 99px; background: var(--line); margin-top: 12px; overflow: hidden; }
.hm-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.hm-tambem { margin: 22px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.hm-tambem a { color: var(--ink); text-decoration: none; }
.hm-tambem a + a::before { content: ' · '; color: var(--muted); }
@media (max-width: 640px) {
  .hm-num { grid-template-columns: 1fr; gap: 0; }
  .hm-num .kpi { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "s s"; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
  .hm-num .kpi:first-child { border-top: 0; }
  .hm-num .kpi .kl { grid-area: l; font-size: 14.5px; color: var(--ink); font-weight: 600; }
  .hm-num .kpi .kv { grid-area: v; font-size: 16px; }
  .hm-num .kpi .ks { grid-area: s; }
  .hm-row { grid-template-columns: 62px minmax(0, 1fr) auto; }
}
.hm a, .hm a:visited { color: var(--ink); text-decoration: none; }
.hm .hm-row b, .hm .hm-notas b, .hm .hm-v { color: var(--ink); }
.hm .hm-v.neg-s { color: var(--muted); }
.hm .hm-notas span, .hm .hm-mais, .hm .hm-tambem { color: var(--muted); }
.hm .hm-notas .warn { color: var(--accent); }
.hm .hm-num .kpi { border-radius: 0; }
.hm .hm-num .kpi .kl { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hm button.hm-emitir { background: var(--brand); border-color: var(--brand); color: #fff; }
.hm { margin: 8px 0 0; max-width: 880px; }
.hm .hm-num .kpi .kl { font-family: inherit; }
.hm .hm-notas em { font-style: normal; }
@media (hover: hover) {
  .hm-mais:hover { color: var(--brand); }
  .hm-num .kpi:hover .kv { color: var(--brand); }
  .hm-row:hover b { color: var(--brand); }
  .hm-tambem a:hover { color: var(--brand); }
  .hm .hm-row:hover b, .hm .hm-notas:hover b, .hm .hm-tambem a:hover { color: var(--brand); }
  .hm button.hm-emitir:hover { background: var(--brand2, var(--brand)); }
}
/* Início: tipografia mais leve */
.hm .hm-h h3 { font-size: 11px; font-weight: 600; letter-spacing: .1em; }
.hm .hm-num .kpi .kl { font-size: 12.5px; font-weight: 400; }
.hm .hm-num .kpi .kv { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.hm .hm-num .kpi .ks { font-size: 12px; }
.hm .hm-row { padding: 10px 0; }
.hm .hm-q { font-size: 12.5px; }
.hm .hm-q.hoje, .hm .hm-q.bad { font-weight: 600; }
.hm .hm-t b { font-size: 13.5px; font-weight: 500; }
.hm .hm-t small { font-size: 12px; }
.hm .hm-v { font-size: 13.5px; font-weight: 500; }
.hm .hm-notas b { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.hm .hm-notas span { font-size: 12.5px; }
.hm button.hm-emitir { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 8px; }
.hm .hm-tambem { font-size: 12.5px; }
@media (max-width: 640px) {
  .hm .hm-num .kpi .kl { font-size: 13.5px; font-weight: 400; color: var(--ink); }
  .hm .hm-num .kpi .kv { font-size: 14.5px; font-weight: 600; }
  .hm .hm-num .kpi { padding: 9px 0; }
}
.hero .hero-t h2 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.hero .hero-t .mut { font-size: 13px; }
.passos-aviso .pa-txt b, .passos-aviso .pa-ir { font-weight: 500; font-size: 13px; }
.hm .hm-num .kpi .kv { font-weight: 500; }
/* DejaVu só tem regular e negrito: no Início, negrito só no que pede atenção */
.hero .hero-t h2 { font-weight: 400; font-size: 21px; }
.hm .hm-h h3 { font-weight: 400; letter-spacing: .12em; }
.hm .hm-num .kpi .kv, .hm .hm-notas b { font-weight: 400; }
.hm .hm-q.hoje { font-weight: 400; color: var(--ink); }
.hm .hm-q.bad { font-weight: 400; }
.passos-aviso .pa-txt b { font-weight: 400; }
@media (max-width: 640px) { .hero .hero-t h2 { font-size: 20px; } .hm .hm-num .kpi .kv { font-size: 15px; } }
/* Preencher dados fiscais por uma nota emitida */
.nx-lista { display: grid; gap: 6px; }
.nx-it { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; text-align: left; padding: 10px 12px; border-radius: 10px; }
.nx-it span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-tab td:first-child { width: 28px; }
.nx-sv { display: flex; gap: 8px; align-items: baseline; }
.nx-av { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .nx-tab thead { display: none; }
  .nx-tab, .nx-tab tbody { display: block; }
  .nx-tab tr { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nx-tab td { border: 0; padding: 0; background: none; }
  .nx-tab td:first-child { grid-row: span 3; padding-top: 2px; }
  .nx-tab td:nth-child(2) { font-weight: 600; }
  .nx-tab td:nth-child(3), .nx-tab td:nth-child(4) { font-size: 13px; overflow-wrap: anywhere; }
  .nx-tab td:nth-child(3)::before { content: 'Hoje: '; color: var(--muted); }
  .nx-tab td:nth-child(4)::before { content: 'Da nota: '; color: var(--muted); font-weight: 400; }
}
/* Antenas do grilo em verde: claro sobre o violeta (botão da assistente), folha sobre fundo claro */
:root { --gr-antena: #2f9e5b; --gr-antena-orb: #a6ec7a; }
html[data-tema="escuro"] { --gr-antena: #7fd99a; }
#ia-fab .gr-antennae, .orb .gr-antennae { color: var(--gr-antena-orb); }
.ia-top .gr-antennae, .gr-egg > .gr-antennae, .gr-grilo, .gr-grilo .gr-antennae { color: var(--gr-antena); }
.sv-achados { display: grid; }
.sv-ach { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sv-achados > .sv-ach:first-child { border-top: 0; }
.sv-ach-t { display: grid; gap: 2px; min-width: 0; }
.sv-ach-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-ach-t small { color: var(--muted); font-size: 12.5px; }
/* códigos do serviço com descrição, para conferir */
.cod-conf { width: 100%; margin: 10px 0 0; border-collapse: collapse; font-size: 13px; }
.cod-conf td { padding: 7px 8px 7px 0; vertical-align: top; border-top: 1px solid var(--line); background: none; }
.cod-conf td:first-child { width: 38%; white-space: nowrap; }
.cod-conf tr:first-child td { border-top: 0; }
@media (max-width: 640px) { .cod-conf td:first-child { width: auto; white-space: normal; } }
.cod-conf tr:hover td, html[data-tema="escuro"] .cod-conf tr:hover td { background: none; }
.hm .hm-notas .warn { color: var(--warn); }
html[data-tema="escuro"] .hm .hm-notas .warn { color: var(--accent); }
@media (max-width: 800px) { .aviso-versao { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); } }
/* Antenas vivas: paradas a maior parte do tempo e, de vez em quando, uma tremidinha de grilo (cada antena no seu ritmo).
   Só no ícone da assistente em repouso; quem pediu menos movimento no aparelho vê paradas (regra prefers-reduced-motion acima). */
@keyframes gr-vivo-esq { 0%, 82%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 88% { transform: rotate(5deg); } 91% { transform: rotate(-8deg); } 94% { transform: rotate(2deg); } }
@keyframes gr-vivo-dir { 0%, 70%, 100% { transform: rotate(0); } 73% { transform: rotate(12deg); } 76% { transform: rotate(-4deg); } 79% { transform: rotate(9deg); } 83% { transform: rotate(0); } 90% { transform: rotate(6deg); } 93% { transform: rotate(0); } }
.gr-antennae[data-ia][data-state="idle"] .gr-ant-left { animation: gr-vivo-esq 5.2s ease-in-out infinite; }
.gr-antennae[data-ia][data-state="idle"] .gr-ant-right { animation: gr-vivo-dir 6.7s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .gr-antennae[data-ia] .gr-ant-left, .gr-antennae[data-ia] .gr-ant-right { animation: none !important; } }
/* App instalado no iPhone: a página vai até o topo (status bar translúcida) e a barra da empresa desce o tamanho da
   faixa do relógio, para ficar sempre visível e clicável. No navegador comum o recuo é zero. */
.tb { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
@media (max-width: 800px) { .tb { padding-top: calc(8px + env(safe-area-inset-top, 0px)); } }
.rail { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }

/* Tela de abertura: o grilo chega em dois saltos, pousa e fica pulando no lugar enquanto o sistema carrega
   (some sozinha quando a primeira tela desenha). Em endereço de escritório com marca própria: fundo neutro e sem o nome Grillus. */
#arranque { position: fixed; inset: 0; z-index: 9999; display: grid; grid-template-rows: 1fr auto; justify-items: center; overflow: hidden; background: radial-gradient(120% 80% at 50% 42%, #A48BFF 0%, #7653F6 45%, #4B2BC4 100%); color: #fff; padding: 24px 24px calc(44px + env(safe-area-inset-bottom, 0px)); font-family: var(--fonte-texto); text-align: center }
#arranque .ar-palco { position: relative; align-self: center; width: min(62vw, 260px); aspect-ratio: 240 / 150 }
#arranque .ar-corpo { position: absolute; inset: 0; animation: ar-chega 1.9s both }
#arranque .ar-grilo { width: 100%; height: auto; overflow: visible; display: block; transform-origin: 50% 100%; animation: ar-pula 2.1s cubic-bezier(.3,.7,.4,1) 2.3s infinite }
#arranque .ar-sombra { position: absolute; left: 12%; right: 12%; bottom: -2%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.32), transparent); animation: ar-sombra 1.9s both }
#arranque .ar-po { position: absolute; bottom: 0; width: 4%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.6); opacity: 0; animation: ar-po .9s ease-out 1.45s both }
#arranque .ar-po.a { left: 26% } #arranque .ar-po.b { left: 66%; animation-delay: 1.52s }
#arranque .ar-ant { fill: none; stroke: #7FE0A0; stroke-width: 3; stroke-linecap: round; transform-box: fill-box; transform-origin: 0% 100% }
#arranque .ar-e { animation: ar-ant-e 2.1s ease-in-out 1.7s infinite } #arranque .ar-d { animation: ar-ant-d 2.1s ease-in-out 1.85s infinite }
#arranque .ar-olho { animation: ar-pisca 3.4s infinite; transform-box: fill-box; transform-origin: center }
#arranque .ar-base { display: grid; justify-items: center; gap: 10px }
#arranque .ar-marca { width: 150px; height: auto; animation: ar-nome 1s cubic-bezier(.2,.7,.2,1) 1.6s both }
#arranque .ar-tag { font-size: 13px; color: rgba(255,255,255,.75); animation: ar-sobe .8s ease-out 2.2s both }
#arranque .ar-msg { margin: 0; font-size: 14px; max-width: 30ch; line-height: 1.5 }
#arranque .ar-msg:empty { display: none }
#arranque button { font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 10px; border: 0; background: #fff; color: #5633C7; margin-top: 12px; cursor: pointer }
#arranque.neutro { background: #F4F3F8; color: #19191D }
#arranque.neutro .ar-marca, #arranque.neutro .ar-tag { display: none }
#arranque.neutro .ar-ant { stroke: #2F9E5B }
#arranque.neutro button { background: #19191D; color: #fff }
@keyframes ar-chega { 0% { transform: translate(-120vw, 0) rotate(-10deg); animation-timing-function: cubic-bezier(.3,0,.6,.4) } 28% { transform: translate(-55vw, -95%) rotate(-12deg); animation-timing-function: cubic-bezier(.4,.6,.7,1) } 52% { transform: translate(-16vw, 0) scale(1.06, .86) } 60% { transform: translate(-13vw, 0) scale(.96, 1.06); animation-timing-function: cubic-bezier(.3,0,.6,.4) } 78% { transform: translate(-4vw, -50%) rotate(-7deg); animation-timing-function: cubic-bezier(.4,.6,.7,1) } 90% { transform: translate(0, 0) scale(1.05, .9) } 100% { transform: none } }
@keyframes ar-sombra { 0% { transform: translateX(-120vw) scale(.5); opacity: .2 } 28% { transform: translateX(-55vw) scale(.45); opacity: .15 } 52% { transform: translateX(-16vw) scale(1.05); opacity: 1 } 78% { transform: translateX(-4vw) scale(.6); opacity: .4 } 100% { transform: none; opacity: 1 } }
@keyframes ar-po { 0% { opacity: .9; transform: scale(.3) } 100% { opacity: 0; transform: scale(1.8) translateY(-140%) } }
@keyframes ar-pula { 0%, 100% { transform: translateY(0) scaleY(1) } 12% { transform: translateY(0) scaleY(.93) } 38% { transform: translateY(-26%) rotate(-4deg) } 60% { transform: translateY(0) } 68% { transform: scaleY(.95) } 78% { transform: none } }
@keyframes ar-ant-e { 0%, 100% { transform: rotate(0) } 30% { transform: rotate(-16deg) } 50% { transform: rotate(7deg) } 70% { transform: rotate(-4deg) } }
@keyframes ar-ant-d { 0%, 100% { transform: rotate(0) } 30% { transform: rotate(14deg) } 50% { transform: rotate(-6deg) } 70% { transform: rotate(4deg) } }
@keyframes ar-pisca { 0%, 90%, 100% { transform: scaleY(1) } 93% { transform: scaleY(.08) } }
@keyframes ar-nome { 0% { clip-path: inset(0 100% 0 0); transform: translateY(8px); opacity: 0 } 10% { opacity: 1 } 100% { clip-path: inset(0 -5% 0 0); transform: none; opacity: 1 } }
@keyframes ar-sobe { 0% { opacity: 0; transform: translateY(6px) } 100% { opacity: 1; transform: none } }
/* a abertura fica por cima do sistema até a chegada terminar (js/arranque.js) e some devagar */
#arranque { transition: opacity .5s ease, visibility .5s }
#arranque.saindo { opacity: 0; visibility: hidden; pointer-events: none }
@media (prefers-reduced-motion: reduce) { #arranque * { animation: none !important } #arranque { transition: none } }

/* Mascote dentro do app: o grilo ao lado da saudação do Início (pula uma vez por sessão), na base vazia e no Assistente vazio */
.hero-t .gr-mascote { width: 52px; height: auto; align-self: center; margin-right: -2px; transform-origin: 50% 100%; }
.hero-t .gr-mascote.pula { animation: gr-mascote-chega 1.4s cubic-bezier(.3,.7,.4,1) .2s both; }
@keyframes gr-mascote-chega { 0% { transform: translate(-60px, 0) rotate(-8deg); opacity: 0 } 35% { transform: translate(-28px, -60%) rotate(-10deg); opacity: 1 } 62% { transform: translate(0, 0) scale(1.08, .86) } 76% { transform: scale(.96, 1.05) } 100% { transform: none } }
.vazio-ini .gr-vazio { width: 84px; height: auto; flex: none; }
.ia-vazio .gr-ia-grilo { display: block; width: 96px; height: auto; margin: 0 0 8px; }
@media (prefers-reduced-motion: reduce) { .hero-t .gr-mascote.pula { animation: none } }

/* Caixa (PDV) no site: itens à esquerda, total e ações à direita; no celular um embaixo do outro */
.pdvs-grade { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.pdvs-ini { max-width: 520px; }
.pdvs-lado { position: sticky; top: 12px; display: grid; gap: 12px; }
.pdvs-lado .kpi .v { font-size: 30px; }
.pdvs-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pdvs-acoes .pri { grid-column: 1 / -1; }
.pdvs-sug { display: grid; gap: 4px; margin: 8px 0; }
.pdvs-it { display: flex; justify-content: space-between; gap: 12px; text-align: left; width: 100%; }
.pdvs-it b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .pdvs-grade { grid-template-columns: minmax(0, 1fr); } .pdvs-lado { position: static; } }
.pdvs-parc { padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; gap: 10px; }
.pdvs-parc span { min-width: 0; }
.pdvs-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.pdvs-kpis .kpi .v { font-size: 18px; }

/* NF-e de produto: cada item numa linha com quantidade, preço, desconto e CFOP; no celular os campos quebram */
.nf-item { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 92px) auto; gap: 8px; align-items: end; padding: 8px 0; border-top: 1px solid var(--line); }
/* linha de campo com botão ao lado (destinatário + Novo, chave + NFC-e): o campo estica, o botão não */
.nf-linha { display: flex; gap: 8px; align-items: center; }
.nf-linha > select, .nf-linha > input { flex: 1 1 auto; min-width: 0; }
.nf-linha > button { flex: none; white-space: nowrap; }
.nf-linha > .nf-curto { flex: 0 0 84px; }
.nf-item label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.nf-item input { width: 100%; min-width: 0; }
.nf-item-n { min-width: 0; display: grid; }
.nf-item-n b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .nf-item { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nf-item-n { grid-column: 1 / -1; } .nf-item > button { justify-self: end; grid-column: 2; } }
/* assistente que prepara o caixa: um passo por linha, com o que já está pronto marcado */
.pdvs-prep { display: grid; gap: 0; }
.pdvs-passo { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.pdvs-passo:first-child { border-top: 0; }
.pdvs-passo .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--card); border: 1.5px solid var(--line); color: var(--muted); }
.pdvs-passo.ok .ic { background: var(--ok); border-color: transparent; color: var(--card); }
.pdvs-passo .tx { min-width: 0; }
.pdvs-passo > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 360px; }
.pdvs-passo .tx b { display: block; font-weight: 500; }
.pdvs-passo .tx span { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .pdvs-passo { grid-template-columns: 28px minmax(0, 1fr); } .pdvs-passo > div:last-child { grid-column: 2; justify-content: flex-start; max-width: none; } }

/* trabalho em andamento (emitir nota, gerar boleto): aviso fixo no rodapé até terminar */
.ocupado { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1200; display: flex; align-items: center; gap: 12px;
  width: min(460px, calc(100vw - 32px)); padding: 14px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.4;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .45); animation: ocupado-entra .2s ease-out; }
.ocupado-giro { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: ocupado-gira .8s linear infinite; opacity: .9; }
@media (max-width: 800px) { .ocupado { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
@keyframes ocupado-gira { to { transform: rotate(360deg); } }
@keyframes ocupado-entra { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .ocupado-giro { animation-duration: 2.4s; } .ocupado { animation: none; } }
/* notas ainda não emitidas, no topo da lista */
.nf-pend { display: grid; gap: 8px; }
.nf-pend-l { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.nf-pend-l > span { min-width: 0; flex: 1 1 220px; }
.nf-pend-b { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* grilo nos momentos da nota: conferindo (lupa), autorizada (festa), na dúvida e tudo em dia */
.gr-pose { display: block; height: auto; }
.ocupado .ocupado-grilo { flex: none; width: 64px; margin: -6px -2px -6px -6px; animation: gr-confere 1.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes gr-confere { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-3deg); } }
.modal .gr-duvida { width: 108px; margin: 0 0 4px; }
.nf-ok { display: grid; justify-items: center; text-align: center; gap: 6px; }
.nf-ok .gr-festa { width: 150px; animation: gr-festa .7s cubic-bezier(.3, 1.6, .5, 1) both; transform-origin: 50% 100%; }
.nf-ok h3 { margin: 4px 0 0; font-size: 21px; }
.nf-ok .acts { width: 100%; }
@keyframes gr-festa { 0% { transform: translateY(14px) scale(.9); opacity: 0; } 60% { transform: translateY(-8px) scale(1.03); opacity: 1; } 100% { transform: none; } }
.empty.tranquilo::before { background-image: url("../img/grilo-dorme.svg"); width: 96px; height: 69px; }
body.marca-propria .empty::before { display: none; }
@media (prefers-reduced-motion: reduce) { .ocupado .ocupado-grilo, .nf-ok .gr-festa { animation: none; } }
.lg-op summary { cursor: pointer; list-style-position: inside; } details.lg-op[open] summary { margin-bottom: 6px; }
/* Meu plano: próxima fatura e códigos de pagamento (PIX e boleto dentro do Grillus) */
.fat-prox { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 16px; }
.fat-prox .fat-v { font-family: var(--fonte-titulo); font-size: 30px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: normal; }
.fat-cod { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; margin: 12px 0; }
.fat-cod .mut { grid-column: 1 / -1; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11.5px; }
.fat-cod code { min-width: 0; word-break: break-all; font-size: 12.5px; background: var(--bg); color: var(--ink); padding: 10px 12px; border-radius: 8px; }

/* simulador do aluguel na reforma (js/pages-locacao.js) */
.sl-quem { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.sl-mais { margin-top: 12px; }
.sl-mais > summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.sl-motivo { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; }
.sl-motivo .ti { font-size: 20px; color: var(--brand); flex: none; }
.sl-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.sl-ano { border-top: 1px solid var(--line); }
.sl-ano > summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; list-style: none; }
.sl-ano > summary::-webkit-details-marker { display: none; }
.sl-it { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 4px 12px; font-size: 14px; }
.sl-it > span { min-width: 0; }

/* abertura do Grillus Agro: o grilo de chapéu de palha (html.ramo-agro, guardado do último acesso) */
#arranque .ar-agro { display: none }
html.ramo-agro #arranque .ar-agro { display: inline }
