/* Painel de Gestão — Mult Variedades */
body { font-size: 14px; }
:root { --side-text: #B9BCE3; --side-hover: rgba(255, 255, 255, .07); --side-active: rgba(255, 255, 255, .11); }

.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

/* menu lateral */
.side { background: linear-gradient(180deg, var(--azul-escuro) 0%, var(--tinta) 100%); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; overflow: hidden; }
.side > .telhado { left: -40px; bottom: 90px; width: 300px; opacity: .05; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 14px; }
.brand img { width: 58px; height: 38px; object-fit: cover; border-radius: 9px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .6); }
.brand .b1 { color: #fff; font-family: var(--f-titulo); font-weight: 800; font-size: .98rem; letter-spacing: -.01em; line-height: 1.15; }
.brand .b2 { font-size: .74rem; margin-top: 2px; color: var(--amarelo); font-weight: 600; letter-spacing: .02em; }
.nav-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: #7377AE; padding: 12px 12px 6px; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 600; margin-bottom: 3px; position: relative; transition: background .2s, color .2s, transform .2s var(--ease); }
.nav svg { width: 19px; height: 19px; flex: none; opacity: .9; transition: color .2s; }
.nav:hover { background: var(--side-hover); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav.on { background: var(--side-active); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.nav.on svg { color: var(--amarelo); }
.nav.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--amarelo); box-shadow: 0 0 14px rgba(245, 233, 42, .6); }
.nav .count { margin-left: auto; background: var(--amarelo); color: var(--tinta); font-size: .7rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; animation: pop .3s var(--ease); }
.side .foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; position: relative; }
.user { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--amarelo); color: var(--tinta); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; font-family: var(--f-titulo); }
.user .n { color: #fff; font-weight: 600; font-size: .86rem; white-space: nowrap; }
.user .e { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user button { margin-left: auto; background: none; border: 0; color: var(--side-text); cursor: pointer; padding: 7px; border-radius: 8px; display: grid; transition: background .2s, color .2s; }
.user button:hover { background: rgba(200, 36, 43, .25); color: #fff; }
.user svg { width: 17px; height: 17px; }

/* área principal */
.main { padding: 30px 34px 56px; max-width: 1380px; width: 100%; animation: fade .3s ease; }
.crumb { font-size: .84rem; color: var(--muted); margin-bottom: 8px; display: inline-block; font-weight: 600; }
.crumb:hover { color: var(--azul); text-decoration: none; }

/* painel de lista: abas + barra de filtros + tabela num só bloco */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sombra-1); overflow: hidden; animation: subir .4s var(--ease) both; }
.panel .table-wrap { border: 0; border-radius: 0; }
.seg { display: flex; gap: 2px; padding: 0 14px; overflow-y: hidden; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.seg button { font: inherit; font-weight: 600; background: none; border: 0; padding: 15px 12px 13px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 8px; transition: color .2s, border-color .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--azul); border-bottom-color: var(--amarelo-escuro); }
.seg .n { background: var(--mute-bg); color: var(--muted); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; min-width: 24px; text-align: center; transition: background .2s, color .2s; }
.seg button.on .n { background: var(--azul); color: #fff; }
.toolbar { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; background: #FBFBFE; }
.toolbar input, .toolbar select { min-height: 38px; padding: 6px 10px; width: auto; background: var(--surface); }
.toolbar .search { position: relative; flex: 1 1 240px; }
.toolbar .search input { width: 100%; padding-left: 36px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.toolbar .range { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.toolbar .clear { color: var(--muted); background: none; border: 0; cursor: pointer; font: inherit; font-size: .85rem; padding: 6px 8px; font-weight: 600; }
.toolbar .clear:hover { color: var(--vermelho); }
.foot-info { padding: 11px 16px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); background: #FBFBFE; }

/* tabelas: uma linha por registro, sem quebra */
.main th, .main td { white-space: nowrap; }
.main td { padding: 12px 10px; } .main th { padding: 11px 10px; font-size: .7rem; letter-spacing: .06em; }
.main tbody tr.click { position: relative; }
.main tbody tr.click td:first-child { box-shadow: inset 3px 0 0 transparent; transition: box-shadow .2s; }
.main tbody tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--amarelo-escuro); }
.trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.strong { font-weight: 700; color: var(--text); }
.mono { font-variant-numeric: tabular-nums; }
.cell-prod { display: flex; align-items: center; gap: 12px; }
.cell-prod .thumb { width: 44px; height: 44px; object-fit: contain; background: #F5F5F5; border: 0; border-radius: 10px; mix-blend-mode: multiply; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.ghost { font: inherit; font-size: .82rem; font-weight: 600; border: 1px solid transparent; background: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: all .15s; }
.ghost:hover { background: var(--info-bg); color: var(--azul); }
.ghost.danger:hover { color: var(--vermelho); background: var(--bad-bg); }
.badge { font-size: .73rem; padding: 4px 10px; }
.badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 16px; box-shadow: var(--sombra-1); min-width: 0; position: relative; overflow: hidden; animation: subir .45s var(--ease) both; transition: transform .25s var(--ease), box-shadow .25s; }
.kpi:nth-child(2) { animation-delay: 50ms; } .kpi:nth-child(3) { animation-delay: 100ms; } .kpi:nth-child(4) { animation-delay: 150ms; } .kpi:nth-child(5) { animation-delay: 200ms; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sombra-2); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--azul); }
.kpi.ok::before { background: var(--verde); } .kpi.bad::before { background: var(--vermelho); } .kpi.warn::before { background: var(--amarelo-escuro); }
.kpi::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 70px; height: 70px; border-radius: 50%; background: currentColor; opacity: .05; }
.kpi .l { color: var(--muted); font-size: clamp(.6rem, 5.4cqi, .76rem); font-weight: 700; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
.kpi { container-type: inline-size; }
/* o valor encolhe conforme a largura do cartão, sem cortar com reticências */
.kpi .v { font-family: var(--f-titulo); font-size: clamp(.95rem, 10cqi, 1.4rem); font-weight: 800; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.kpi.bad .v { color: var(--vermelho); } .kpi.ok .v { color: var(--verde); }

/* detalhe */
.card h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; font-family: var(--f-texto); }
.card h3::before { content: ""; width: 14px; height: 4px; border-radius: 4px; background: var(--amarelo-escuro); }
.actionbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra-1); }
.actionbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.cols > .stack > * { animation: subir .45s var(--ease) both; }
.kv { gap: 8px 18px; } .kv dt { font-size: .85rem; white-space: nowrap; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { padding: 0 0 14px 18px; border-left: 2px solid var(--line); position: relative; margin: 0 0 0 5px; }
.hist li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--azul); }
.hist li:first-child::before { background: var(--amarelo); }
.hist li:last-child { padding-bottom: 0; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; } .photos .ph { position: relative; } .photos img { width: 90px; height: 90px; object-fit: contain; background: #F5F5F5; border-radius: 10px; border: 1px solid var(--line); }
.photos .ph button { position: absolute; top: -6px; right: -6px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; width: 22px; height: 22px; line-height: 1; }
.btn { font-size: .88rem; min-height: 38px; }
.valor-destaque { font-family: var(--f-titulo); font-weight: 900; font-size: 1.6rem; color: var(--azul); align-self: center; }

/* login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-page .lado { background: radial-gradient(120% 120% at 0% 0%, #3C3FB3, var(--azul) 38%, var(--azul-escuro) 75%, var(--tinta)); color: #D5D7F2; padding: 56px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.login-page .lado::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(160deg, transparent 20%, #000 85%); }
.login-page .lado .telhado { right: -70px; bottom: -40px; width: 520px; opacity: .14; animation: flutuar2 9s ease-in-out infinite; }
@keyframes flutuar2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.login-page .lado { gap: 22px; }
.login-page .lado img { flex: none; width: 150px; border-radius: 16px; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .6); position: relative; animation: pop .5s var(--ease) both; }
.login-page .lado h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 900; line-height: 1.12; margin: 0 0 12px; max-width: 460px; position: relative; }
.login-page .lado h2 em { font-style: normal; color: var(--amarelo); }
.login-page .lado p { position: relative; max-width: 420px; margin: 0; }
.login-page .form { display: grid; place-items: center; padding: 32px; }
.login { width: 100%; max-width: 380px; animation: subir .5s var(--ease) both; }
.login .eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--azul); display: inline-flex; align-items: center; gap: 8px; }
.login .eyebrow::before { content: ""; width: 18px; height: 4px; border-radius: 4px; background: var(--amarelo-escuro); }
.login h1 { font-size: 2rem; margin: 8px 0 4px; }
.login .btn.primary { width: 100%; justify-content: center; min-height: 48px; font-size: .98rem; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toolbar, :root:not([data-theme="light"]) .foot-info { background: #14173F; }
  :root:not([data-theme="light"]) .main tbody tr.click:hover { background: #1E2260; }
}
@media (max-width: 1500px) { .hide-md { display: none; } }
@media (max-width: 1100px) { .hide-xx { display: none; } .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .login-page { grid-template-columns: 1fr; } .login-page .lado { min-height: 0; padding: 28px; } .login-page .lado img { width: 110px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 4px; overflow-x: auto; }
  .side > .telhado, .brand .b2, .brand .b1, .nav-label, .user .n, .user .e, .nav span.lbl-cfg { display: none; }
  .brand { border: 0; padding: 0 6px 0 0; margin: 0; }
  .nav { margin: 0; white-space: nowrap; } .nav.on::before { display: none; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; }
  .main { padding: 18px 14px 40px; } .cols { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cli-link { color: var(--text); display: block; font-weight: 600; } .cli-link:hover { color: var(--azul); }
h3.sec { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; margin: 22px 0 10px; font-family: var(--f-texto); }
.modal .kpis { margin-bottom: 4px; }
.modal td, .modal th { white-space: nowrap; }
.modal.wide { max-width: 1040px; }
/* comprovantes */
.ghost { display: inline-flex; align-items: center; gap: 5px; }
.ghost svg, .btn svg { width: 15px; height: 15px; }
label.ghost, label.btn { cursor: pointer; margin: 0; color: inherit; font-size: .84rem; }
label.ghost { color: var(--muted); }
.clip { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--azul); font-size: .74rem; font-weight: 700; background: var(--info-bg); border-radius: 999px; padding: 1px 7px 1px 5px; vertical-align: 1px; }
.clip svg { width: 12px; height: 12px; }

/* ================= CELULAR ================= */
.bnav { display: none; }
@media (max-width: 860px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; } /* evita o zoom automático do iPhone */
  .shell { display: block; }

  /* topo: só a marca e o usuário; a navegação vai para baixo */
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; gap: 10px; overflow: visible; border-bottom: 3px solid var(--amarelo); }
  .side > .telhado, .nav-label, .side > .nav, .brand .b2, .user .n, .user .e { display: none; }
  .brand { border: 0; padding: 0; margin: 0; } .brand .b1 { display: block; font-size: .95rem; } .brand img { width: 48px; height: 32px; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0; } .user { padding: 0; }

  /* barra inferior estilo aplicativo */
  .bnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--tinta); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px -12px rgba(14, 16, 50, .6); }
  .bnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: var(--side-text); font-size: .68rem; font-weight: 700; position: relative; transition: color .2s, background .2s; }
  .bnav a:hover { text-decoration: none; color: #fff; }
  .bnav a svg { width: 22px; height: 22px; }
  .bnav a.on { color: #fff; background: rgba(255, 255, 255, .1); } .bnav a.on svg { color: var(--amarelo); }
  .bnav a b { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--amarelo); color: var(--tinta); font-size: .62rem; border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; }

  .main { padding: 16px 12px 32px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 12px 14px; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .toolbar { padding: 10px; } .toolbar .search { flex-basis: 100%; }
  .toolbar .range { flex-wrap: wrap; width: 100%; } .toolbar .range input { flex: 1; min-width: 0; }
  .toolbar select { flex: 1; }
  .main td { padding: 11px 8px; font-size: .86rem; } .main th { padding: 10px 8px; }
  .trunc { max-width: 140px; }

  /* colunas essenciais por tela */
  [data-pag="orcamentos"] .panel th:nth-child(2), [data-pag="orcamentos"] .panel td:nth-child(2),
  [data-pag="orcamentos"] .panel th:nth-child(4), [data-pag="orcamentos"] .panel td:nth-child(4),
  [data-pag="orcamentos"] .panel th:nth-child(6), [data-pag="orcamentos"] .panel td:nth-child(6),
  [data-pag="orcamentos"] .panel th:nth-child(7), [data-pag="orcamentos"] .panel td:nth-child(7),
  [data-pag="conciliacao"] .panel th:nth-child(2), [data-pag="conciliacao"] .panel td:nth-child(2),
  [data-pag="conciliacao"] .panel th:nth-child(7), [data-pag="conciliacao"] .panel td:nth-child(7),
  [data-pag="conciliacao"] .panel th:nth-child(8), [data-pag="conciliacao"] .panel td:nth-child(8),
  [data-pag="produtos"] .panel th:nth-child(2), [data-pag="produtos"] .panel td:nth-child(2),
  [data-pag="produtos"] .panel th:nth-child(5), [data-pag="produtos"] .panel td:nth-child(5),
  [data-pag="produtos"] .panel th:nth-child(6), [data-pag="produtos"] .panel td:nth-child(6) { display: none; }
  [data-pag="produtos"] .row-actions { flex-direction: column; align-items: flex-end; gap: 0; }
  [data-pag="produtos"] .cell-prod .trunc { max-width: 120px; white-space: normal; }

  /* detalhe do orçamento */
  .actionbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px; }
  .actionbar::-webkit-scrollbar { display: none; }
  .actionbar .btn { flex: none; } .actionbar .grow { display: none; }
  .valor-destaque { font-size: 1.3rem; }
  .cols { grid-template-columns: 1fr; gap: 12px; }

  /* janelas ocupam a tela toda, com os botões fixos embaixo */
  .overlay { padding: 0; align-items: stretch; }
  .modal, .modal.wide { max-width: none; min-height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-b { flex: 1; padding: 14px; }
  .modal-f { position: sticky; bottom: 0; background: var(--surface); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1 1 auto; justify-content: center; }
  .modal .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* login */
  .login-page .lado { flex-direction: row; align-items: center; padding: 20px; gap: 14px; }
  .login-page .lado img { width: 80px; } .login-page .lado h2 { font-size: 1.1rem; margin: 0; } .login-page .lado p { display: none; }
  .login-page .lado .telhado { width: 240px; }
  .login-page .form { padding: 24px 18px 40px; place-items: start center; }
  body:has(.login-page) { padding-bottom: 0; }
}
/* celular: cada linha da tabela vira um cartão de duas colunas */
@media (max-width: 860px) {
  .panel thead { display: none; }
  .panel tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 3px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
  .panel tbody tr:last-child { border-bottom: 0; }
  .panel tbody td { padding: 0 !important; border: 0; min-width: 0; }
  .panel tbody td.empty { grid-column: 1 / -1; padding: 28px 0 !important; }
  .panel tbody td:nth-child(n) { grid-column: 1; }
  .panel .trunc { max-width: 100%; }

  /* orçamentos: nº | valor  /  cliente | status */
  [data-pag="orcamentos"] .panel td:nth-child(1) { grid-row: 1; }
  [data-pag="orcamentos"] .panel td:nth-child(3) { grid-row: 2; color: var(--muted); font-size: .82rem; }
  [data-pag="orcamentos"] .panel td:nth-child(8) { grid-row: 1; grid-column: 2; }
  [data-pag="orcamentos"] .panel td:nth-child(9) { grid-row: 2; grid-column: 2; justify-self: end; }

  /* recebimentos: nº | saldo  /  cliente | status  /  vencimento */
  [data-pag="conciliacao"] .panel td:nth-child(2) { display: block; grid-row: 2; font-size: .82rem; }
  [data-pag="conciliacao"] .panel td:nth-child(2) .cli-link { color: var(--muted); font-weight: 500; }
  [data-pag="conciliacao"] .panel td:nth-child(1) { grid-row: 1; }
  [data-pag="conciliacao"] .panel td:nth-child(6) { grid-row: 3; font-size: .78rem; color: var(--muted); }
  [data-pag="conciliacao"] .panel td:nth-child(6)::before { content: "Vence "; }
  [data-pag="conciliacao"] .panel td:nth-child(9) { grid-row: 1; grid-column: 2; }
  [data-pag="conciliacao"] .panel td:nth-child(10) { grid-row: 2 / span 2; grid-column: 2; justify-self: end; }

  /* produtos: produto | preço  /  produto | status  /  ações */
  [data-pag="produtos"] .panel td:nth-child(1) { grid-row: 1 / span 2; }
  [data-pag="produtos"] .panel td:nth-child(4) { grid-row: 1; grid-column: 2; font-weight: 700; }
  [data-pag="produtos"] .panel td:nth-child(7) { grid-row: 2; grid-column: 2; justify-self: end; }
  [data-pag="produtos"] .panel td:nth-child(8) { grid-row: 3; grid-column: 1 / -1; margin-top: 6px; }
  [data-pag="produtos"] .row-actions { flex-direction: row; justify-content: flex-start; gap: 4px; }
  [data-pag="produtos"] .cell-prod .trunc { max-width: 100%; }
}
/* Receita Federal */
.rf-alerta { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; background: var(--bad-bg); color: var(--vermelho); font-size: .68rem; font-weight: 800; border-radius: 999px; padding: 1px 7px 1px 5px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .03em; }
.rf-alerta svg { width: 12px; height: 12px; }
.rf-faixa { display: flex; gap: 12px; align-items: flex-start; background: var(--bad-bg); color: #7d1418; border: 1px solid rgba(200, 36, 43, .25); border-left: 5px solid var(--vermelho); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; animation: subir .4s var(--ease) both; }
.rf-faixa svg { width: 24px; height: 24px; flex: none; color: var(--vermelho); }
.rf .rf-st { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.rf .rf-st svg { width: 22px; height: 22px; }
.rf.ok .rf-st { color: var(--ok); } .rf.bad .rf-st { color: var(--vermelho); } .rf.mute .rf-st { color: var(--muted); }
.rf.bad { border-color: rgba(200, 36, 43, .35); box-shadow: 0 0 0 3px rgba(200, 36, 43, .08); }
.girando svg { animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
/* barra de ações numa linha só, com rolagem horizontal */
.trilho { position: relative; margin-bottom: 22px; }
.trilho .actionbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scroll-snap-type: x proximity; scrollbar-width: none; margin-bottom: 0; }
.trilho .actionbar::-webkit-scrollbar { display: none; }
.trilho .actionbar > * { flex: none; scroll-snap-align: start; }
.trilho .actionbar .grow { flex: 1 0 8px; }
.trilho.tem-dir .actionbar { mask-image: linear-gradient(90deg, #000 calc(100% - 70px), transparent); }
.trilho.tem-esq .actionbar { mask-image: linear-gradient(90deg, transparent, #000 70px); }
.trilho.tem-esq.tem-dir .actionbar { mask-image: linear-gradient(90deg, transparent, #000 70px, #000 calc(100% - 70px), transparent); }
.trilho-seta { position: absolute; top: 50%; transform: translateY(-50%) scale(.8); z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--azul); font-size: 1.3rem; line-height: 1; font-weight: 700; cursor: pointer; box-shadow: var(--sombra-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); display: grid; place-items: center; padding: 0 0 3px; }
.trilho-seta.esq { left: -6px; } .trilho-seta.dir { right: -6px; }
.trilho.tem-esq .esq, .trilho.tem-dir .dir { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }
.trilho-seta:hover { background: var(--azul); color: #fff; }
@media (max-width: 860px) { .trilho-seta { display: none; } } /* no celular basta deslizar o dedo */
.pedido .thumb { width: 44px; height: 44px; object-fit: contain; background: #F5F5F5; border: 0; border-radius: 8px; }
.pedido td { padding: 8px 6px; } .btn.sm svg { width: 15px; height: 15px; }
/* card compacto com os campos numa linha só (compensação por forma de pagamento) */
.card.compacta { padding: 14px 16px; }
.card.compacta h3 { margin-bottom: 6px; }
.card.compacta > p { margin: 0 0 10px; }
.fields.linha-unica { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.fields.linha-unica label { font-size: .74rem; white-space: nowrap; margin-bottom: 3px; }
.fields.linha-unica input { min-height: 32px; padding: 4px 8px; text-align: center; }
@media (max-width: 860px) { .fields.linha-unica { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ===== Conciliação: abas Lançamentos | Análises ===== */
.vistas { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: -6px 0 16px; box-shadow: var(--sombra-1); }
.vistas a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: .88rem; transition: background .2s, color .2s; }
.vistas a svg { width: 17px; height: 17px; }
.vistas a:hover { color: var(--azul); text-decoration: none; background: var(--info-bg); }
.vistas a.on { background: var(--azul); color: #fff; box-shadow: 0 6px 14px -6px rgba(46, 48, 149, .6); }

/* indicadores das análises */
.viz-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.viz-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--sombra-1); }
.viz-tile .l { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.viz-tile .v { font-family: var(--f-titulo); font-size: 1.7rem; font-weight: 800; color: var(--text); margin-top: 6px; }
.viz-tile .d { color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* grade de gráficos */
.viz-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.viz-card { min-width: 0; animation: subir .45s var(--ease) both; }
.viz-card.largo { grid-column: 1 / -1; }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-eixo { font-size: 11px; fill: #898781; font-family: var(--f-texto); font-variant-numeric: tabular-nums; }
.viz-eixo.atual { fill: var(--text); font-weight: 700; }
.viz-mark { transition: opacity .15s; cursor: default; }
.viz-card:has(.viz-mark:hover) .viz-mark:not(:hover) { opacity: .45; } /* realça só a barra sob o mouse */
.viz-legenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: var(--texto); margin: -4px 0 8px; }
.viz-legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-barras { display: flex; flex-direction: column; gap: 10px; }
.vb-linha { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 10px; align-items: center; }
.vb-rot { font-size: .84rem; color: var(--texto); display: flex; align-items: center; gap: 5px; min-width: 0; }
.vb-rot svg { width: 14px; height: 14px; color: var(--vermelho); flex: none; }
.vb-trilho { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vb-barra { height: 14px; border-radius: 0 4px 4px 0; display: block; animation: crescer .7s var(--ease) both; transform-origin: left; }
@keyframes crescer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.vb-val { font-size: .82rem; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.viz-tab { margin-top: 12px; font-size: .84rem; }
.viz-tab summary { cursor: pointer; color: var(--azul); font-weight: 600; width: max-content; }
.viz-tab .table-wrap { margin-top: 8px; }
.viz-tip { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; background: var(--tinta); color: #fff; font-size: .82rem; font-weight: 600; padding: 7px 11px; border-radius: 8px; box-shadow: 0 10px 24px -8px rgba(14, 16, 50, .5); opacity: 0; transition: opacity .12s; max-width: 280px; }
.viz-tip.on { opacity: 1; }
@media (max-width: 1100px) { .viz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .viz-grade { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .vistas { width: 100%; } .vistas a { flex: 1; justify-content: center; } .viz-tile .v { font-size: 1.35rem; } .vb-linha { grid-template-columns: 1fr; gap: 4px; } }
.vb-rot { white-space: nowrap; }

/* ===== Auditoria ===== */
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-tag { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
.app-tag.gestao { background: var(--tinta); color: var(--amarelo); }
.app-tag.cliente { background: var(--info-bg); color: var(--azul); }
@media (max-width: 1100px) { .kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* barra inferior com 5 itens no celular */
@media (max-width: 860px) {
  .bnav { grid-template-columns: repeat(5, 1fr); }
  .bnav a { font-size: .62rem; }
  /* auditoria em cartões: data | resultado / ação / quem · app / referência */
  [data-pag="auditoria"] .panel td:nth-child(1) { grid-row: 1; color: var(--muted); font-size: .78rem; }
  [data-pag="auditoria"] .panel td:nth-child(7) { grid-row: 1; grid-column: 2; justify-self: end; }
  [data-pag="auditoria"] .panel td:nth-child(4) { grid-row: 2; font-weight: 700; color: var(--text); }
  [data-pag="auditoria"] .panel td:nth-child(3) { grid-row: 2; grid-column: 2; justify-self: end; }
  [data-pag="auditoria"] .panel td:nth-child(2) { grid-row: 3; grid-column: 1 / -1; font-size: .84rem; }
  [data-pag="auditoria"] .panel td:nth-child(5) { grid-row: 4; grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
}
/* telhado do menu lateral: mesmo desenho do logo, um pouco mais visível e flutuando de leve */
.side > .telhado { opacity: .09; animation: flutuar2 9s ease-in-out infinite; }

/* barra de ações: setas com espaço próprio (não cobrem os botões), sem "encaixe" que impedia chegar à ponta */
.trilho .actionbar { scroll-snap-type: none; transition: padding .2s var(--ease); }
.trilho.tem-esq .actionbar { padding-left: 50px; }
.trilho.tem-dir .actionbar { padding-right: 50px; }
.trilho.tem-dir .actionbar { mask-image: linear-gradient(90deg, #000 calc(100% - 46px), transparent calc(100% - 8px)); }
.trilho.tem-esq .actionbar { mask-image: linear-gradient(90deg, transparent 8px, #000 46px); }
.trilho.tem-esq.tem-dir .actionbar { mask-image: linear-gradient(90deg, transparent 8px, #000 46px, #000 calc(100% - 46px), transparent calc(100% - 8px)); }
.trilho-seta.esq { left: 8px; } .trilho-seta.dir { right: 8px; }
/* divisor entre decisões e documentos */
.actionbar .sep { width: 1px; height: 26px; background: var(--line); margin: 0 6px; flex: none; }
.actionbar .grow { flex: 1 0 0; }
.caret { font-size: .7rem; opacity: .7; margin-left: 2px; }
/* menu "Documentos" */
.menu-docs { position: fixed; z-index: 60; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sombra-2); padding: 6px; animation: pop .18s var(--ease) both; }
.menu-docs a, .menu-docs button { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text); background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.menu-docs a:hover, .menu-docs button:hover { background: var(--info-bg); color: var(--azul); text-decoration: none; }
.menu-docs button { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--azul); }
/* aviso de reenvio de WhatsApp */
.aviso-reenvio { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); border-left: 4px solid var(--amarelo-escuro); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: .92rem; }
.aviso-reenvio svg { width: 22px; height: 22px; flex: none; }
.aviso-reenvio b { color: var(--text); }

/* WhatsApp (automação) */
.note { background: var(--info-bg); color: var(--info); border-radius: 12px; padding: 12px 14px; font-size: .9rem; border-left: 4px solid var(--azul); }
.note.warn { background: var(--warn-bg); color: var(--warn); border-left-color: var(--amarelo-escuro); }
.note.ok { background: var(--ok-bg); color: var(--ok); border-left-color: var(--verde); }
.note.danger { background: var(--bad-bg); color: var(--bad); border-left-color: var(--vermelho); }
.wa-bolha { background: #E7FFDB; color: #111B21; border-radius: 10px 10px 10px 2px; padding: 10px 12px; margin-top: 8px; font-size: .92rem; line-height: 1.45; white-space: normal; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; min-height: 42px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--azul); }
.count.bad { background: var(--vermelho); color: #fff; }

.vistas a.on { background: var(--azul); color: #fff; }
.abas-wa { margin: 16px 0; }
.destinos { display: grid; gap: 12px; }
.destino { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.destino textarea { min-height: 48px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .destino { grid-template-columns: 1fr; } .abas-wa { display: flex; width: 100%; overflow-x: auto; } .abas-wa a { flex: 1; justify-content: center; white-space: nowrap; } }

/* barra de baixo do celular com 6 botões */
@media (max-width: 860px) { .bnav { grid-template-columns: repeat(6, 1fr) !important; } .bnav a { font-size: .62rem; padding: 6px 0; } .bnav a span { white-space: nowrap; } }
