:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #1a2230;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #3b5bdb;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --danger: #c92a2a;
  --danger-soft: #fff0f0;
  --ok: #2b8a3e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --s-orcamento: #667085; --s-orcamento-bg: #eef0f3;
  --s-aberta: #1c64f2; --s-aberta-bg: #e8f0fe;
  --s-em_andamento: #b45309; --s-em_andamento-bg: #fef3c7;
  --s-aguardando: #7e3af2; --s-aguardando-bg: #f1e8ff;
  --s-concluida: #1f7a3a; --s-concluida-bg: #dcf5e4;
  --s-cancelada: #c92a2a; --s-cancelada-bg: #fde8e8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161d; --surface: #1a1f29; --surface-2: #202633; --ink: #e8ecf3; --muted: #9aa5b6;
    --line: #2b3342; --accent: #7c93f5; --accent-ink: #0f1420; --accent-soft: #232b45;
    --danger: #ff8787; --danger-soft: #3a2024; --ok: #69db7c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --s-orcamento: #aab3c2; --s-orcamento-bg: #2a303c;
    --s-aberta: #8db3ff; --s-aberta-bg: #1c2b4d;
    --s-em_andamento: #fcc96b; --s-em_andamento-bg: #3d3216;
    --s-aguardando: #c9a8ff; --s-aguardando-bg: #2e2250;
    --s-concluida: #7be09a; --s-concluida-bg: #173523;
    --s-cancelada: #ff9b9b; --s-cancelada-bg: #3d2024;
  }
}
:root[data-theme="dark"] {
  --bg: #12161d; --surface: #1a1f29; --surface-2: #202633; --ink: #e8ecf3; --muted: #9aa5b6;
  --line: #2b3342; --accent: #7c93f5; --accent-ink: #0f1420; --accent-soft: #232b45;
  --danger: #ff8787; --danger-soft: #3a2024; --ok: #69db7c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --s-orcamento: #aab3c2; --s-orcamento-bg: #2a303c;
  --s-aberta: #8db3ff; --s-aberta-bg: #1c2b4d;
  --s-em_andamento: #fcc96b; --s-em_andamento-bg: #3d3216;
  --s-aguardando: #c9a8ff; --s-aguardando-bg: #2e2250;
  --s-concluida: #7be09a; --s-concluida-bg: #173523;
  --s-cancelada: #ff9b9b; --s-cancelada-bg: #3d2024;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.login-card h1 { margin: 22px 0 4px; }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.login-card .f { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.side .brand { padding: 4px 10px 18px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.nav button.grp { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 600; text-align: left; }
.nav button.grp:hover { color: var(--ink); }
.nav .chev { display: inline-block; transition: transform .15s; font-size: 12px; }
.nav .grp-box.open .chev { transform: rotate(90deg); }
.nav .grp-items { display: none; }
.nav .grp-box.open .grp-items { display: block; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 0; }
.me { padding: 0 6px 8px; }
.me b { display: block; }
.me small { color: var(--muted); }
.side-foot .row { display: flex; gap: 6px; }
.shell > div { min-width: 0; }
.main { padding: 28px 32px 48px; max-width: 1280px; width: 100%; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .search { width: 260px; }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 550; line-height: 1.3; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font-size: 12.5px; font-weight: 550; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.f.chk { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.f.chk > span { font-size: 14px; color: var(--ink); font-weight: 500; order: 2; }

/* ---------- Cartões e tabelas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.num { text-align: right; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
tr.off td { opacity: .55; }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.green { background: var(--s-concluida-bg); color: var(--s-concluida); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--muted); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat small { color: var(--muted); font-weight: 550; }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.two h3 { padding: 16px 18px 6px; font-size: 15px; }
.bars { padding: 6px 18px 16px; display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.list { list-style: none; margin: 0; padding: 4px 18px 14px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
.modal.lg { max-width: 980px; }
.modal.sm { max-width: 420px; }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal > header h2 { font-size: 17px; }
.modal .body { padding: 18px 20px; }
.modal > footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.modal > footer { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -6px 14px rgba(0, 0, 0, .06); } /* botões sempre à vista em janelas longas (OS, pedido) */
.modal > footer .sp { flex: 1; }
.err { color: var(--danger); font-size: 13px; font-weight: 550; flex: 1 1 100%; }
.err:empty { display: none; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.grid > .f { grid-column: span 12; }
.sec { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.sec:first-child { margin-top: 0; }
@media (min-width: 700px) {
  .grid > .c2 { grid-column: span 2; } .grid > .c3 { grid-column: span 3; } .grid > .c4 { grid-column: span 4; }
  .grid > .c5 { grid-column: span 5; } .grid > .c6 { grid-column: span 6; } .grid > .c7 { grid-column: span 7; }
  .grid > .c8 { grid-column: span 8; } .grid > .c9 { grid-column: span 9; }
}

/* ---------- Itens da OS ---------- */
.items { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.items table td, .items table th { padding: 6px 8px; }
.items td input, .items td select { padding: 6px 8px; }
.items .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.items-bar { display: flex; gap: 8px; padding: 10px; background: var(--surface-2); border-top: 1px solid var(--line); flex-wrap: wrap; }
.totals { display: grid; gap: 6px; justify-content: end; padding: 12px 14px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.totals input { width: 120px; text-align: right; }
.totals .grand { font-size: 17px; font-weight: 700; }

.s-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-weight: 550; max-width: 340px; }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Responsivo ---------- */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; max-height: 100dvh; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0, 0, 0, .25); }
  .side.open { transform: none; }
  .main { padding: 18px 14px 40px; }
  .page-head .search { width: 100%; order: 5; }
  .two { grid-template-columns: 1fr; }
  .modal-bg { padding: 0; }
  .modal, .modal.lg { border-radius: 0; min-height: 100%; max-width: none; }
  .modal > footer { border-radius: 0; }
}

/* ---------- Logo ---------- */
.logo { display: block; height: 46px; width: auto; }
.side .logo { margin: 2px 8px 18px; }
.topbar .logo { height: 32px; }
.login-card .logo { height: 96px; margin: 0 auto 6px; }
.login-card h1, .login-card p { text-align: center; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: invert(1) brightness(1.1); } }
:root[data-theme="dark"] .logo { filter: invert(1) brightness(1.1); }

/* ---------- Cobrança / Pix ---------- */
.cobranca { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 32px; background: var(--s-em_andamento-bg); color: var(--s-em_andamento); border-bottom: 1px solid var(--line); }
.pix-valor { text-align: center; font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.pix-qr { display: flex; justify-content: center; margin: 4px 0 12px; }
.pix-qr svg { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pix-code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
@media (max-width: 880px) { .cobranca { padding: 10px 14px; } }

.acts { text-align: right; min-width: 200px; }
.acts .btn { margin: 2px 0 2px 4px; }
.cob-sub { display: block; font-weight: 500; opacity: .9; }
.pix-det { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; font-size: 13.5px; }
.pix-lin { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.login-card.susp { max-width: 460px; }
.susp-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.susp-acts .btn { width: auto; flex: 1 1 auto; justify-content: center; }
.cobranca.info { background: var(--s-aberta-bg); color: var(--s-aberta); }

/* fotos do produto (vitrine) */
.fotos { margin-top: 8px; }
.fotos-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.foto-item { position: relative; width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-item .btn { position: absolute; top: 4px; right: 4px; padding: 0 7px; line-height: 20px; }

/* inscrição pública */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.login-card.wide { max-width: 440px; }
.signup-cta { margin-top: 18px; text-align: center; }
.signup-cta .ou { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.signup-cta .ou::before, .signup-cta .ou::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.signup-cta .muted.small, .login-card .muted.small { font-size: 13px; margin: 10px 0 0; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0 14px; color: var(--muted); }
.check-line input { margin-top: 3px; }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--muted); margin-top: 8px; }

/* logotipo e etiqueta */
.logo-prev { display: flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-width: 180px; min-height: 90px; padding: 14px 18px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.logo-prev img { display: block; height: 120px; width: auto; max-width: 100%; object-fit: contain; }
.etq-prev { border: 1px solid var(--line); border-radius: 4px; overflow: auto; background: #fff; width: fit-content; max-width: 100%; box-shadow: var(--shadow); }

/* máscaras e validação de CPF/CNPJ */
input.invalido { border-color: var(--danger, #d33); }
.campo-erro { color: var(--danger, #d33); font-size: 12px; min-height: 0; }
.campo-erro:empty { display: none; }
input.travado { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* equipe e permissões */
.perm-presets { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.perm-grid { display: grid; gap: 8px; }
.perm-grid.off, .perm-presets.off { opacity: .45; pointer-events: none; }
.perm-row { display: grid; grid-template-columns: 1fr minmax(150px, 220px); gap: 10px; align-items: center; }
.ro .items-bar, .ro .fotos .btn, .ro .icon-btn[aria-label="Remover item"] { display: none; }

/* recuperação de senha e verificação em duas etapas */
.forgot { text-align: center; }
.forgot .btn.link { margin-top: 10px; }
.cod2fa { text-align: center; font-size: 22px; letter-spacing: .25em; font-variant-numeric: tabular-nums; }
.chave2fa { display: inline-block; font-size: 15px; line-height: 1.6; letter-spacing: .08em; background: var(--bg, #f4f6fa); padding: 6px 10px; border-radius: 8px; word-break: break-all; user-select: all; }
.passos2fa { margin: 0 0 10px; padding-left: 20px; }
.passos2fa li { margin: 4px 0; }
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.rec-grid code { background: var(--bg, #f4f6fa); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-align: center; font-size: 15px; letter-spacing: .05em; user-select: all; }
.ts-box { display: flex; justify-content: center; margin: 14px 0 4px; min-height: 65px; }

/* regime tributário */
table.mini { width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 14px; }
table.mini th, table.mini td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.mini th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.mini .sub { display: block; }

/* aparência (claro / escuro / automático) */
.tema-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.tema-opts .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* NCM */
.ncm-desc { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ncm-desc.ok { color: var(--ok); }
.ncm-desc.warn { color: var(--s-em_andamento); }
.ncm-lista { margin: 10px 0 0; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.ncm-lista > p { margin: 0; padding: 12px; }
.ncm-item { display: flex; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; }
.ncm-item:hover { background: var(--accent-soft); }
.ncm-item b { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ncm-item span { min-width: 0; }
.ncm-desc + .btn { align-self: flex-start; width: auto; }

/* ---- financeiro ---- */
.pos { color: var(--s-concluida, #15803d); }
.neg { color: var(--danger, #b91c1c); }
.stat.conta { text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.stat.conta.on { outline: 2px solid var(--accent, #3b52d4); }
.stat.conta.off { opacity: .6; }
.label.inline, label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
label.inline input { width: auto; }
.tit-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
tr.on td { background: var(--surface-2); }
.conc { padding: 12px 16px; margin-bottom: 10px; }
.conc-head { display: flex; align-items: baseline; gap: 12px; }
.conc-data { color: var(--muted); font-size: 13px; min-width: 76px; }
.conc-desc { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.conc-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.conc-acoes .btn { text-align: left; white-space: normal; height: auto; padding: 6px 10px; }
.fin-os { margin-top: 14px; }
.fin-os-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.fin-os-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.fin-os-row input { width: auto; max-width: 150px; }
@media (max-width: 720px) { .conc-head { flex-wrap: wrap; } .conc-desc { flex-basis: 100%; order: 3; } }

/* ---- compras ---- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 36px 16px; border: 2px dashed var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; font: inherit; color: inherit; text-align: center; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.items-bar .muted { align-self: center; }

/* ---------- NFC-e e frente de caixa (PDV) ---------- */
.badge.amber { background: var(--s-em_andamento-bg); color: var(--s-em_andamento); }
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.pdv-esq { display: flex; flex-direction: column; min-height: 60vh; overflow: visible; }
.pdv-busca-box { position: relative; padding: 14px; border-bottom: 1px solid var(--line); }
.pdv-busca { font-size: 17px; padding: 12px 14px; }
.pdv-sug { position: absolute; left: 14px; right: 14px; top: calc(100% - 8px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.pdv-sug-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; cursor: pointer; color: inherit; font: inherit; }
.pdv-sug-item.on, .pdv-sug-item:hover { background: var(--accent-soft); }
.pdv-itens { flex: 1; }
.pdv-itens td { padding: 8px 10px; }
.pdv-qtd, .pdv-vu { width: 76px; text-align: right; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.pdv-vu { width: 104px; }
.pdv-dir { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; }
.pdv-linha { display: flex; justify-content: space-between; font-size: 13px; }
.pdv-rot { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.pdv-total { font-size: 34px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.pdv-fim { justify-content: center; font-size: 16px; padding: 12px; }
.pdv-aviso { border-radius: 8px; margin-bottom: 12px; padding: 8px 14px; }
.pdv-troco { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; margin-bottom: 12px; }
.pdv-troco b { font-size: 30px; font-variant-numeric: tabular-nums; }
.pag-editor { display: flex; flex-direction: column; gap: 8px; }
.pag-atalhos { display: flex; gap: 6px; flex-wrap: wrap; }
.pag-linha { display: grid; grid-template-columns: minmax(0, 1fr) 130px 34px; gap: 8px; align-items: center; }
.pag-valor { text-align: right; font-variant-numeric: tabular-nums; }
.pag-resumo { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.pag-resumo b { font-size: 18px; font-variant-numeric: tabular-nums; }
.pag-resumo.falta { background: var(--danger-soft); color: var(--danger); }
.pag-resumo.troco { background: var(--s-concluida-bg); color: var(--s-concluida); }
@media (max-width: 880px) {
  .pdv { grid-template-columns: 1fr; }
  .pdv-dir { position: static; }
  .pdv-esq { min-height: 0; }
}
.pag-bloco { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.pag-cartao { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-right: 42px; }
@media (max-width: 600px) { .pag-cartao { grid-template-columns: 1fr; margin-right: 0; } }

/* ---------- parcelas do orçamento / pedido ---------- */
.parc { margin-top: 14px; }
.parc-gerar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.parc-gerar > .f { width: 190px; }
.parc-campos { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 240px; }
.parc-campos .f { width: 120px; }
.parc-botoes { display: flex; gap: 6px; }
.parc table td { padding: 6px 8px; }
.parc table input { padding: 6px 8px; }
.parc-soma { margin-top: 8px; font-size: 13px; color: var(--muted); text-align: right; }
.parc-soma.erro { color: var(--danger); font-weight: 600; }

/* ---------- NF-e: notas referenciadas e CFOP por item ---------- */
.ref-add { display: flex; gap: 8px; flex-wrap: wrap; }
.ref-add input { flex: 1; min-width: 240px; font-variant-numeric: tabular-nums; }
.ref-lista { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ref-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 99px; padding: 2px 4px 2px 12px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ref-chip .icon-btn { font-size: 18px; padding: 0 6px; }
.items .col-cfop { display: none; }
.items.mostra-cfop .col-cfop { display: table-cell; }
.chave-linha { font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chave-linha span { word-break: break-all; font-variant-numeric: tabular-nums; }
.chave-linha .btn { padding: 2px 8px; font-size: 12px; }

/* conferência de estoque */
.conf-tab th .sm { display: none; }
.conf-tab input.qtd-conf { width: 96px; text-align: right; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.conf-tab input.qtd-conf.err-in { border-color: var(--danger); }
.conf-tab tr.ok-row td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.conf-tab tr.flash td { background: var(--accent-soft); transition: background .2s; }
@media (max-width: 700px) {
  .conf-tab th:nth-child(1), .conf-tab td:nth-child(1), .conf-tab th:nth-child(3), .conf-tab td:nth-child(3) { display: none; }
  .conf-tab tr.ok-row td:nth-child(2) { box-shadow: inset 3px 0 0 var(--ok); }
  .conf-tab th, .conf-tab td { padding-left: 8px; padding-right: 8px; }
  .conf-tab input.qtd-conf { width: 62px; padding: 6px; }
  .conf-tab th .sm { display: inline; } .conf-tab th .lg { display: none; }
  .conf-tab td { font-size: 13.5px; }
  .conf-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .conf-stats .stat { padding: 10px !important; }
  .conf-stats .stat b { font-size: 17px !important; }
  .conf-stats .stat .sub { display: none; }
}

/* horário de atendimento (configuração da vitrine) */
.hz-tab th, .hz-tab td { padding: 6px 8px; white-space: nowrap; }
.hz-tab tbody th { text-align: left; font-weight: 600; }
.hz-tab .hz-par { display: inline-flex; gap: 6px; align-items: center; }
.hz-tab input.hz-in { width: 104px; padding: 5px 6px; }
.hz-tab .hz-f label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.hz-tab tr.off td:not(.hz-f) { opacity: .35; }

/* seleção em lote nos cadastros */
th.sel-col, td.sel-col { width: 38px; padding-right: 0 !important; cursor: default; }
th.sel-col input, td.sel-col input { width: 17px; height: 17px; cursor: pointer; vertical-align: middle; }
tr.sel td { background: var(--accent-soft); }
.sel-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 4; }
.sel-bar b { margin-right: 6px; }
.btn.link { background: none; border-color: transparent; color: var(--accent); }
/* conferência: filtros */
.conf-filtros { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 13.5px; }

/* envelope de e-mail na lista de NF-e */
.mail-btn { position: relative; color: var(--muted); }
.mail-btn:hover { color: var(--accent); }
.mail-btn.enviado { color: var(--ok); }
.mail-btn .ok-dot { position: absolute; right: 2px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.mail-btn.off { opacity: .35; cursor: not-allowed; }
.mail-btn.off:hover { background: transparent; color: var(--muted); opacity: .55; }

/* crédito do cliente */
.credito-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 16px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.credito-box > div { display: flex; flex-direction: column; }
.credito-box small { font-size: 12px; color: var(--muted); font-weight: 550; }
.credito-box b { font-size: 18px; font-variant-numeric: tabular-nums; }
.credito-box p { margin: 0; font-size: 12.5px; }
.credito-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.credito-saldo small { display: block; font-size: 12px; color: var(--muted); font-weight: 550; }
.credito-saldo b { font-size: 24px; font-variant-numeric: tabular-nums; }
.credito-acoes { display: flex; gap: 8px; }
.pag-cred { font-size: 12.5px; color: var(--muted); padding: 2px 2px 4px; }
.pag-cred.falta { color: var(--danger); }
.pag-atalhos .btn.cred { border-color: color-mix(in srgb, var(--s-concluida) 45%, var(--line)); color: var(--s-concluida); }
.pdv-cli-box { position: relative; }
.pdv-cli-box .pdv-sug { left: 0; right: 0; top: 100%; }
.pdv-cli:empty { display: none; }
.pdv-cli { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 4px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.pdv-cli > span:first-child { flex: 1; min-width: 0; }
.pdv-cli .icon-btn { margin-left: auto; }
@media (max-width: 640px) { .credito-box { grid-template-columns: 1fr; } }

/* nota manual (MEI) */
.nm-totais { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; max-width: 360px; margin-left: auto; font-size: 13.5px; }
.nm-totais .lin { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.nm-totais .lin.g { font-weight: 700; font-size: 15px; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.nm-ciente { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; }

/* abertura e fechamento de caixa */
.cx-fechado { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cx-fechado h2, .cx-topo h2 { margin: 0 0 4px; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.cx-fechado p, .cx-topo p { margin: 0; font-size: 13.5px; }
.cx-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cx-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-stats { margin-bottom: 6px; }
.cx-stats .stat { box-shadow: none; }
.cx-hist { font-size: 17px; margin: 22px 0 10px; }
.cx-valor { text-align: right; font-variant-numeric: tabular-nums; }
.cx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-concluida, #2b8a3e); display: inline-block; }
.cx-aviso { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
tfoot td { border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .cx-stats { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .cx-stats .stat b { font-size: 18px; }
  .cx-fecha td, .cx-fecha th { padding: 8px 6px; }
  .cx-fecha .sub { display: none; }
  .cx-fecha td:nth-child(3) { width: 96px !important; }
}
.cx-receb { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.cx-receb select { width: auto; }

/* lançamento de estoque e contas na lista de notas */
.lanc-grp { display: inline-flex; gap: 2px; margin-right: 4px; vertical-align: middle; }
.lanc-btn { display: inline-flex; align-items: center; padding: 4px 5px; }
.lanc-btn svg { width: 17px; height: 17px; }
.lanc-btn.on { color: var(--ok); }
.lanc-btn.off { color: var(--danger); }
.lanc-btn.on:hover, .lanc-btn.off:hover { background: var(--surface-2); }
.lanc-btn.na { color: var(--muted); opacity: .25; padding: 4px 5px; }
.lanc-btn:disabled { cursor: not-allowed; opacity: .6; }

/* busca e tratamento de fotos dos produtos */
.bf-prod { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.bf-busca { display: flex; gap: 8px; }
.bf-busca input { flex: 1; }
.bf-avisos { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 8px 0; font-size: 12.5px; }
.bf-avisos:empty { display: none; }
.bf-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 8px; }
.bf-cand { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: #667085; font-size: 11px; overflow: hidden; }
.bf-cand img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.bf-cand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-cand:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.bf-cand.falhou { opacity: .35; cursor: not-allowed; }
.bf-vazio { grid-column: 1 / -1; padding: 24px 0; text-align: center; }
.bf-comp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.bf-comp figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bf-comp img { width: 100%; aspect-ratio: 1; object-fit: contain; background: repeating-conic-gradient(#e9ecf1 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--line); border-radius: 10px; }
.bf-comp figure:last-child img { background: #fff; }
.bf-comp figcaption { font-size: 12.5px; color: var(--muted); text-align: center; }
.bf-ops { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.bf-ops select { width: auto; }
.bf-topo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bf-nota { font-size: 12px; margin: 12px 0 0; }
@media (max-width: 640px) { .bf-grade { grid-template-columns: repeat(3, 1fr); } .bf-comp { grid-template-columns: 1fr 1fr; gap: 8px; } }
.bf-ops > select { width: auto; }
.bf-ops-tratar { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bf-grade { grid-template-columns: repeat(auto-fill, minmax(150px, 180px)); }
.bf-mais { align-self: center; justify-self: start; }
.bf-fim { grid-column: 1 / -1; font-size: 12.5px; }
.bf-fim:empty { display: none; }
@media (max-width: 640px) { .bf-grade { grid-template-columns: repeat(3, 1fr); } .bf-mais { grid-column: 1 / -1; justify-self: stretch; } }

/* estatísticas de acesso */
.est-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.est-cab .chips, .page-head .chips { margin: 0; }
.est-tiles { margin-bottom: 14px; }
.est-tile { box-shadow: none; }
.est-tile .sub { display: block; font-size: 12px; margin-top: 2px; }
.est-graficos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 14px; }
.est-fig { margin: 0; }
.est-fig figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.est-fig figcaption b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.est-graf { width: 100%; height: auto; display: block; }
.est-grade { stroke: var(--line); stroke-width: 1; }
.est-base { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.est-eixo { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.est-barra { fill: var(--accent); }
.est-hit { fill: transparent; }
.est-col:hover .est-barra { opacity: .75; }
.est-col:hover .est-hit { fill: var(--accent-soft); opacity: .5; }
.est-listas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.est-lista h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.est-lista table td { padding: 6px 4px; font-size: 13.5px; }
.est-lista .sub { display: block; }
.est-rodape { margin-bottom: 14px; font-size: 13.5px; }
.est-h2 { font-size: 17px; margin: 22px 0 10px; }
@media (max-width: 760px) { .est-graficos { grid-template-columns: 1fr; } .stats.est-tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .est-tile b { font-size: 22px; } .est-tile .sub { font-size: 11.5px; } }

/* novidades */
.nov-card { padding: 18px 20px; margin-bottom: 14px; border-left: 4px solid var(--accent); }
.nov-card h3 { margin: 6px 0 8px; font-size: 18px; }
.nov-rot { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.nov-rot .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.nov-ico svg { width: 15px; height: 15px; display: block; }
.nov-texto { font-size: 14.5px; line-height: 1.55; }
.nov-texto p { margin: 0 0 10px; }
.nov-texto ul { margin: 0 0 10px; padding-left: 20px; }
.nov-texto li { margin: 0 0 4px; }
.nov-texto h3 { font-size: 15px; margin: 14px 0 6px; }
.nov-texto a { color: var(--accent); }
.nov-item { padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.nov-item:last-child { border-bottom: 0; margin-bottom: 0; }
.nov-item h3 { margin: 2px 0 8px; }
.nov-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.nov-edit { font-family: inherit; min-height: 260px; resize: vertical; }
.nov-prev-cab { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-size: 13px; }
.nov-prev { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 10px; background: #f4f5f7; }
@media (max-width: 860px) { .nov-grid { grid-template-columns: 1fr; } .nov-prev { height: 420px; } }
.bol-stats { margin-bottom: 14px; }
.bol-stats .stat .sub { display: block; font-size: 12px; margin-top: 2px; color: var(--muted); }
.bol-regras { font-size: 12.5px; margin: 10px 0 0 18px; padding: 0; }
.bol-regras li { margin-bottom: 3px; }
.lanc-btn.sem { color: var(--muted); opacity: .45; }

/* grade, série, validade */
.item-ctl { display: grid; gap: 6px; margin-top: 6px; }
.item-ctl:empty { display: none; }
.item-ctl select.falta { border-color: var(--danger); }
.ctl-box { margin: 12px 0; padding: 12px 14px; }
.pdv-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pdv-tam { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; gap: 2px; }
.pdv-tam b { font-size: 17px; }
.pdv-tam small { font-size: 11.5px; opacity: .75; }
.pdv-peso { font-size: 22px; text-align: right; }
.val-card { margin-bottom: 14px; border-left: 4px solid var(--danger); }

/* etiquetas */
.etq-palco { background: repeating-conic-gradient(var(--surface-2) 0% 25%, transparent 0% 50%) 50% / 16px 16px; border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: grid; place-items: center; min-height: 220px; overflow: hidden; }
.etq-prev { zoom: 2.2; }
.etq-prev .etq { box-shadow: 0 0 0 .2mm #999; }
.etq-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
input.invalido { border-color: var(--danger); }
