[hidden] { display: none !important; }
/* Prumo — sistema visual próprio. Sem fontes ou bibliotecas externas. */
:root {
  --bg: #f4f6f5; --surface: #ffffff; --surface-2: #f9faf9; --text: #17201d; --muted: #5a6863;
  --border: #dde3e0; --border-strong: #c3ccc8;
  --primary: #0e6b58; --primary-strong: #0a5243; --primary-soft: #e3f1ed; --on-primary: #ffffff;
  --ok: #067647; --ok-soft: #e4f5ea; --warn: #9a5b00; --warn-soft: #fdf1dc;
  --bad: #b42318; --bad-soft: #fde8e6; --info: #1d55b8; --info-soft: #e5edfb; --muted-soft: #eef1f0;
  --focus: #1d55b8; --radius: 8px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 1px 3px rgba(16, 24, 20, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111615; --surface: #171e1c; --surface-2: #1c2422; --text: #e6ecea; --muted: #9aa8a3;
    --border: #2a3431; --border-strong: #3a4744;
    --primary: #3fb99c; --primary-strong: #62cdb3; --primary-soft: #16332c; --on-primary: #06201a;
    --ok: #4cc38a; --ok-soft: #13301f; --warn: #f0b451; --warn-soft: #33270f; --bad: #ff7b6e; --bad-soft: #3a1a17;
    --info: #7aa7ff; --info-soft: #172542; --muted-soft: #222b29; --focus: #7aa7ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111615; --surface: #171e1c; --surface-2: #1c2422; --text: #e6ecea; --muted: #9aa8a3;
  --border: #2a3431; --border-strong: #3a4744;
  --primary: #3fb99c; --primary-strong: #62cdb3; --primary-soft: #16332c; --on-primary: #06201a;
  --ok: #4cc38a; --ok-soft: #13301f; --warn: #f0b451; --warn-soft: #33270f; --bad: #ff7b6e; --bad-soft: #3a1a17;
  --info: #7aa7ff; --info-soft: #172542; --muted-soft: #222b29; --focus: #7aa7ff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-strong); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; padding: .25rem .5rem .9rem; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); display: grid; place-items: center; color: var(--on-primary); font-size: .9rem; font-weight: 800; box-shadow: 0 1px 2px rgba(16,24,20,.18); }
.brand small { font-weight: 500; font-size: .75rem; display: block; color: var(--muted); }
.nav-group { margin: .9rem 0 .25rem; padding: 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: .55rem; padding: .46rem .6rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .93rem; }
.nav a:hover { background: var(--muted-soft); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav .count { margin-left: auto; font-size: .75rem; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 0 .45rem; }
.ic { display: inline-block; vertical-align: -.18em; flex: none; }
.nav-ic { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a:hover .nav-ic { color: var(--text); }
.nav a[aria-current="page"] .nav-ic { color: var(--primary); }
.btn .ic { width: 17px; height: 17px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 56px; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.context-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; background: var(--surface-2); }
.context-chip img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
.content { padding: 1.25rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.breadcrumb a { color: var(--muted); }

.nav-mobile { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .nav-mobile { display: block; }
  .nav-mobile > summary { list-style: none; cursor: pointer; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; }
  .nav-mobile > summary::-webkit-details-marker { display: none; }
  .nav-mobile[open] .nav-panel { position: absolute; left: 0; right: 0; top: 56px; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 1rem 1rem; z-index: 50; max-height: 75vh; overflow-y: auto; box-shadow: var(--shadow); }
  .content { padding: 1rem .9rem; }
  .topbar { padding: .5rem .9rem; position: relative; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* miniatura de foto de produto */
.thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.thumb-lg { width: 56px; height: 56px; }
.thumb-ph { display: grid; place-items: center; color: var(--border-strong); }
.table td.thumb-cell { width: 52px; padding-right: 0; }
.media { display: flex; align-items: center; gap: .6rem; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .0; }
.kpi:hover::before { opacity: .55; }
.kpi .label { font-size: .8rem; color: var(--muted); display: block; }
.kpi .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; display: block; margin-top: .15rem; }
.kpi .sub { font-size: .8rem; color: var(--muted); }
.kpi a.value { color: var(--text); text-decoration: none; }
.kpi a.value:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 38px; }
.btn:hover { background: var(--muted-soft); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); }
.btn-danger { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .3rem .6rem; font-size: .84rem; min-height: 30px; }
.btn-lg { padding: .75rem 1.2rem; font-size: 1.05rem; min-height: 48px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
form.inline { display: inline; }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--muted-soft); color: var(--muted); }
.tag { display: inline-block; padding: 0 .45rem; border-radius: 4px; background: var(--muted-soft); color: var(--muted); font-size: .78rem; font-weight: 600; }
.tag-test { background: var(--warn-soft); color: var(--warn); }

.alert { padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--text); }
.alert-error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--text); }
.alert-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--text); }
.alert strong { white-space: nowrap; }
.banner { padding: .55rem 1.25rem; font-size: .9rem; font-weight: 600; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.banner-support { background: #5b21b6; color: #fff; }
.banner-warn { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--border); }
.banner-bad { background: var(--bad-soft); color: var(--bad); border-bottom: 1px solid var(--border); }
.banner form { margin-left: auto; }
.banner .btn { min-height: 28px; padding: .2rem .6rem; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table-compact td, .table-compact th { padding: .35rem .55rem; }
.pager { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }

/* ---------- Formulários ---------- */
.field { margin-bottom: .85rem; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field input, .field select, .field textarea, input.input, select.input, textarea.input {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; min-height: 40px;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 0; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: .84rem; margin: .25rem 0 0; font-weight: 600; }
.field-error::before { content: "⚠ "; }
.help { color: var(--muted); font-size: .82rem; margin: .25rem 0 0; }
.req { color: var(--bad); }
.field-check { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .5rem; }
.field-check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--primary); }
.field-check label { font-weight: 500; }
.field-check .help { flex-basis: 100%; margin-left: 1.6rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .span-2, .form-grid-3 .span-3 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .35rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .1rem 1rem; }

/* ---------- Estados ---------- */
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: .25rem; }
.denied { max-width: 520px; margin: 3rem auto; text-align: center; }
.denied .code { font-size: 3rem; font-weight: 800; color: var(--border-strong); }
.progress { height: 10px; background: var(--muted-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); }
.progress.warn > span { background: var(--warn); } .progress.ok > span { background: var(--ok); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 .9rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .4rem; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline time { font-size: .8rem; color: var(--muted); display: block; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--muted-soft); font-weight: 700; flex: none; }
.steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.steps li.current::before { background: var(--primary); color: var(--on-primary); }
.steps li .grow { flex: 1; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; font-weight: 500; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .5rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.tabs a[aria-current="page"] { color: var(--primary-strong); border-bottom-color: var(--primary); }
details.box { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .9rem; background: var(--surface); margin-bottom: .75rem; }
details.box > summary { cursor: pointer; font-weight: 600; }
.pos-num { font-variant-numeric: tabular-nums; }
.pill-list { display: flex; flex-wrap: wrap; gap: .35rem; }

/* barras simples (SVG/CSS) */
.bars { display: grid; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 110px; gap: .5rem; align-items: center; font-size: .88rem; }
.bar-track { background: var(--muted-soft); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }
@media (max-width: 600px) { .bar-row { grid-template-columns: 90px 1fr 90px; } }

/* ---------- Autenticação ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; padding-bottom: 1.25rem; font-size: 1.3rem; }
.auth-wide { max-width: 680px; }

@media print {
  .sidebar, .topbar, .no-print, .banner, .nav-mobile { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* menu do usuário */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem; min-width: 240px; z-index: 60; }
.usermenu-panel a { display: block; padding: .35rem .25rem; text-decoration: none; }
.usermenu-panel form { margin-top: .5rem; }
.js .no-js-only { display: none; }

/* ---------- PDV ---------- */
.pos-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .6rem .9rem; }
.pos-selectors { display: flex; gap: .6rem; flex-wrap: wrap; }
.pos-selectors label { font-size: .8rem; font-weight: 600; display: flex; flex-direction: column; gap: .15rem; }
.pos-selectors .input { min-height: 34px; padding: .25rem .5rem; }
.pos-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.6fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1150px) { .pos-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pos-pay { grid-column: 1 / -1; } }
@media (max-width: 760px) { .pos-grid { grid-template-columns: minmax(0, 1fr); } }
.pos-grid > *, .grid > * { min-width: 0; }
.pos-search { font-size: 1.1rem; min-height: 46px; }
.pos-results { list-style: none; margin: .35rem 0 0; padding: 0; max-height: 330px; overflow-y: auto; }
.pos-results li { padding: .45rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .3rem; cursor: pointer; display: flex; justify-content: space-between; gap: .5rem; background: var(--surface); }
.pos-results li[aria-selected="true"], .pos-results li:hover { border-color: var(--primary); background: var(--primary-soft); }
.pos-results .stock-zero { color: var(--bad); font-weight: 600; }
.pos-customer { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.pos-customer-sel { margin-top: .5rem; padding: .5rem; border-radius: var(--radius-sm); background: var(--primary-soft); display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.pos-totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.pos-totals dt { color: var(--muted); } .pos-totals dd { margin: 0; text-align: right; font-weight: 600; }
.pos-totals .big { font-size: 1.35rem; color: var(--text); font-weight: 800; }
.pos-methods { display: flex; flex-wrap: wrap; gap: .35rem; }
.pay-row { display: grid; grid-template-columns: 1fr 110px auto; gap: .35rem; align-items: center; padding: .4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pay-row .extra { grid-column: 1 / -1; display: flex; gap: .35rem; flex-wrap: wrap; }
.pay-row .input { min-height: 34px; padding: .25rem .5rem; }
.qty-input { width: 64px; text-align: right; }
.pos-done { border-color: var(--ok); text-align: center; }
.pos-change { font-size: 1.4rem; }
.help-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 760px) { .help-grid { grid-template-columns: minmax(0, 1fr); } }
