/* Inventário Vila Brisê — mobile-first, tema claro/escuro automático */
/* Fontes da marca: New Astro (títulos) e Inter (textos) */
@font-face { font-family: "New Astro"; src: url("/fonts/new-astro-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "New Astro"; src: url("/fonts/new-astro-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "New Astro"; src: url("/fonts/new-astro-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "New Astro"; src: url("/fonts/new-astro-semibold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* Paleta Vila Brisê (manual da marca)
   Bege areia #E8E1D6 · Verde oliva suave #6F7C6A · Azul lagoa acinzentado #7F9BA1
   Madeira clara #B8A99A · Dourado fosco #BFA980 · Terracota #C48A6A
   Tons mais escuros derivados são usados onde é preciso contraste de leitura (texto/botões). */
:root {
  --brand-areia: #E8E1D6; --brand-oliva: #6F7C6A; --brand-lagoa: #7F9BA1;
  --brand-madeira: #B8A99A; --brand-dourado: #BFA980; --brand-terracota: #C48A6A;

  --bg: #F6F2EC;
  --surface: #ffffff;
  --surface-2: #FAF7F2;
  --surface-3: #EEE8DE;
  --text: #2B3230;
  --muted: #6E726B;
  --border: #E6DFD3;
  --primary: #557379;
  --primary-2: #46636A;
  --primary-ink: #ffffff;
  --primary-soft: #E4ECED;
  --brand-title: #6F8D93;
  --sand: var(--brand-dourado);
  --accent: var(--brand-terracota);
  --ok: #56704C; --ok-soft: #E7EDE3;
  --info: #4F7380; --info-soft: #E2EBEE;
  --warn: #93702F; --warn-soft: #F5EDDC;
  --danger: #B0573A; --danger-soft: #F7E5DC;
  --neutral: #7D6F62; --neutral-soft: #EFE9E2;
  --shadow-1: 0 1px 2px rgb(60 50 40 / .05), 0 1px 1px rgb(60 50 40 / .03);
  --shadow-2: 0 8px 26px rgb(60 50 40 / .12), 0 2px 6px rgb(60 50 40 / .06);
  --shadow-3: 0 -10px 40px rgb(40 30 20 / .16);
  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: "New Astro", "Inter", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
/* logotipos: versão colorida ou branca conforme o tema */
.logo-dark { display: none !important; }
html.theme-escuro .logo-dark { display: block !important; }
html.theme-escuro .logo-light { display: none !important; }
/* Tema Escuro */
html.theme-escuro {
  --bg: #151918; --surface: #1D2221; --surface-2: #222827; --surface-3: #2B3230;
  --text: #EDE8E0; --muted: #A8A69E; --border: #323937;
  --primary: #9DB8BE; --primary-2: #B5CBD0; --primary-ink: #142224; --primary-soft: #26363A;
  --brand-title: #A9C1C6;
  --ok: #A3B898; --ok-soft: #263224;
  --info: #9DB8BE; --info-soft: #233236;
  --warn: #D9C08E; --warn-soft: #3A3122;
  --danger: #E3A283; --danger-soft: #3F2A22;
  --neutral: #C2B5A7; --neutral-soft: #2E2B28;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-2: 0 8px 28px rgb(0 0 0 / .5);
  --shadow-3: 0 -10px 40px rgb(0 0 0 / .55);
  color-scheme: dark;
}

/* Tema Claro: branco e neutro, mesma paleta da marca */
html.theme-claro {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7F7F5; --surface-3: #EFEEEA;
  --text: #262B29; --muted: #6A6E69; --border: #E7E5DF;
  --primary-soft: #E8EFF0;
  --shadow-1: 0 1px 2px rgb(30 30 30 / .05); --shadow-2: 0 8px 24px rgb(30 30 30 / .10);
}
html.theme-claro .hero { background: linear-gradient(160deg, #FFFFFF, #F4F6F6); }
html.theme-claro .card, html.theme-claro .kpi, html.theme-claro .rows, html.theme-claro .menu, html.theme-claro .card-flat { box-shadow: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
html.sheet-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); min-height: 100dvh; overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.005em; }
.top-title, .hero h1, .sheet-titles h2, .block-title, .sub-title, .empty h3, .progress-card h2, .card-flat h3, .login-card h1 { font-family: var(--font-brand); font-weight: 500; }
.hero h1, .login-card h1 { color: var(--brand-title); }
p { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 12px 16px; }
.center { text-align: center; }
.danger-text { color: var(--danger) !important; }
.tone-text-ok { color: var(--ok); } .tone-text-warn { color: var(--warn); } .tone-text-danger { color: var(--danger); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- boot / login ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.boot.error .ic { width: 40px; height: 40px; color: var(--danger); }
.boot.error p { color: var(--muted); max-width: 320px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 80% at 50% 0%, var(--primary-soft), var(--bg) 70%); }
.login-card { width: min(360px, 100%); background: var(--surface); border-radius: 24px; padding: 32px 24px; box-shadow: var(--shadow-2); display: grid; gap: 12px; text-align: center; }
.login-card .login-logo { display: block; width: 190px; justify-self: center; margin-bottom: 6px; }
.login-card .login-logo img, .brand-logo img, .top-symbol img, .wordmark img { display: block; width: 100%; height: auto; }
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--muted); margin-bottom: 8px; }
.login-card input { height: 52px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; font-size: 20px; letter-spacing: .3em; }

/* ---------- shell ---------- */
.sidebar { display: none; }
.main { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0 12px;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.top-brand { display: grid; place-items: center; }
.top-symbol { display: block; width: 46px; }
.top-wordmark { flex: 1; display: flex; }
.top-wordmark[hidden], .top-title[hidden] { display: none; }
.wordmark { display: block; width: 132px; }
.back:not([hidden]) + .top-brand { display: none; }
.top-title { font-size: 18px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--muted); flex: none; transition: background .15s; }
.icon-btn:hover, .icon-btn:active { background: var(--surface-3); color: var(--text); }
.icon-btn[hidden] { display: none; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.icon-btn.spin .ic { animation: spin .7s linear infinite; }
.sync.off { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--danger); background: var(--danger-soft); padding: 4px 8px; border-radius: 99px; }
.sync.off .ic { width: 14px; height: 14px; }
#view { outline: none; }
.page { padding: 12px 16px 24px; max-width: 1180px; margin: 0 auto; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar a .ic { width: 24px; height: 24px; padding: 2px 0; border-radius: 99px; transition: all .2s; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on .ic { background: var(--primary-soft); width: 52px; }
.nav-n:empty { display: none; }
.nav-n { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }

.fab {
  position: fixed; z-index: 25; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  height: 56px; padding: 0 22px 0 18px; border-radius: 18px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: var(--primary-ink); font-weight: 700; box-shadow: var(--shadow-2); transition: transform .15s;
}
.fab:active { transform: scale(.96); }
.fab .ic { width: 24px; height: 24px; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 650; white-space: nowrap; transition: background .15s, transform .1s, opacity .15s; position: relative; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: var(--surface-3); color: var(--text); }
.btn.ghost:hover { background: color-mix(in srgb, var(--surface-3) 70%, var(--border)); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 4px; }
.btn.xs .ic { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.loading > * { opacity: 0; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.link { color: var(--primary); font-weight: 650; font-size: 14px; }

/* ---------- badges e tons ---------- */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral); }
.badge.xs { height: 19px; padding: 0 7px; font-size: 11px; }
.tone-ok { --t: var(--ok); --ts: var(--ok-soft); }
.tone-info { --t: var(--info); --ts: var(--info-soft); }
.tone-warn { --t: var(--warn); --ts: var(--warn-soft); }
.tone-danger { --t: var(--danger); --ts: var(--danger-soft); }
.tone-neutral { --t: var(--neutral); --ts: var(--neutral-soft); }
.badge[class*="tone-"] { background: var(--ts); color: var(--t); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; }
.count.big { min-width: 30px; height: 28px; font-size: 14px; background: var(--warn-soft); color: var(--warn); }

/* ---------- toolbar / busca / chips ---------- */
.toolbar { display: grid; gap: 10px; margin: 4px 0 14px; }
.search { position: relative; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 48px; padding: 0 44px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 16px; box-shadow: var(--shadow-1); outline: none; transition: border-color .15s, box-shadow .15s; }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-btn { position: absolute; right: 6px; }
.search.sticky { position: sticky; top: -1px; z-index: 2; padding: 2px 0 10px; background: var(--surface); }
.tools { display: grid; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--muted); transition: all .15s; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-n { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.selects { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.selects::-webkit-scrollbar { display: none; }
.mini-select { position: relative; flex: none; display: inline-flex; align-items: center; }
.mini-select select { appearance: none; -webkit-appearance: none; height: 34px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; color: var(--muted); max-width: 210px; }
.mini-select.on select { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.mini-select .ic { position: absolute; right: 8px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.list-summary { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 600; margin: 0 2px 10px; font-variant-numeric: tabular-nums; }

/* ---------- cartões de lista ---------- */
.cards { display: grid; gap: 10px; }
.card { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-1); transition: transform .12s, box-shadow .15s; }
button.card:active, .card:has(.card-hit:active) { transform: scale(.99); }
.card-hit { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.card-main { flex: 1; min-width: 0; display: grid; gap: 2px; pointer-events: none; position: relative; }
.card-title { font-size: 15.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-side { display: grid; gap: 4px; justify-items: end; flex: none; }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 15px; font-family: var(--font-brand); background: var(--surface-3); color: var(--muted); }
/* tons da paleta da marca: lagoa, oliva, dourado, terracota, madeira */
.av-0 { background: #E3EBEC; color: #4C6A70; }
.av-1 { background: #E6EAE3; color: #56644F; }
.av-2 { background: #F3ECDD; color: #7F6634; }
.av-3 { background: #F5E5DC; color: #9A5A3B; }
.av-4 { background: #EFE9E2; color: #6F6153; }
html.theme-escuro .av-0 { background: #26363A; color: #A9C1C6; } html.theme-escuro .av-1 { background: #283026; color: #AFBDA6; }
html.theme-escuro .av-2 { background: #3A3224; color: #D9C59C; } html.theme-escuro .av-3 { background: #3E2B23; color: #E2AE91; } html.theme-escuro .av-4 { background: #332D28; color: #CFC2B4; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.est-card { padding-right: 10px; }
.stock-line { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.stock-line small { color: var(--muted); font-size: 12.5px; }
.stock-line .badge { align-self: center; height: 20px; font-size: 11px; }
.saldo { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; }
.saldo.tone-ok { color: var(--text); } .saldo.tone-warn { color: var(--warn); } .saldo.tone-danger { color: var(--danger); }
.stock-bar { position: relative; display: block; height: 6px; border-radius: 99px; background: var(--surface-3); margin-top: 6px; overflow: visible; }
.stock-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--t); transition: width .3s; }
.stock-bar > i { position: absolute; top: -3px; width: 2px; height: 12px; border-radius: 2px; background: var(--muted); opacity: .6; }
.stepper { position: relative; z-index: 1; display: grid; gap: 6px; flex: none; }
.step { width: 44px; height: 40px; border-radius: 12px; display: grid; place-items: center; transition: transform .1s; }
.step:active { transform: scale(.92); }
.step.plus { background: var(--ok-soft); color: var(--ok); }
.step.minus { background: var(--danger-soft); color: var(--danger); }
.step .ic { width: 22px; height: 22px; stroke-width: 2.5; }

/* ---------- linhas ---------- */
.rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; min-height: 60px; }
.rows > .row + .row, .rows > div.row + .row { border-top: 1px solid var(--border); }
a.row:active, button.row:active { background: var(--surface-2); }
.row-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--ts, var(--surface-3)); color: var(--t, var(--muted)); }
.row-ic .ic { width: 19px; height: 19px; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-main strong { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; color: var(--muted); }
.row-side .ic { width: 18px; height: 18px; }
.row-qty { flex: none; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-qty.tone-ok { color: var(--ok); } .row-qty.tone-danger { color: var(--danger); } .row-qty.tone-warn { color: var(--warn); }
.row-qty small { font-weight: 500; color: var(--muted); font-size: 12px; }
.group + .group { margin-top: 16px; }
.group-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 4px 8px; }
.group-title::first-letter { text-transform: uppercase; }

/* ---------- estado vazio ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 20px; color: var(--muted); }
.empty > .ic { width: 44px; height: 44px; padding: 12px; box-sizing: content-box; border-radius: 22px; background: var(--primary-soft); color: var(--primary); margin-bottom: 4px; }
.empty h3 { color: var(--text); font-size: 18px; }
.empty p { max-width: 380px; }
.empty .btn { margin-top: 10px; }
.empty.small { padding: 32px 16px; }
.empty.small > .ic { width: 26px; height: 26px; padding: 10px; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(8 14 12 / .45); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100dvh - 24px - var(--safe-t)); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-3);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet-wrap.tall .sheet { height: calc(100dvh - 24px - var(--safe-t)); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--border); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 8px 20px; flex: none; }
.sheet-titles { flex: 1; min-width: 0; padding-top: 8px; }
.sheet-titles h2 { font-size: 19px; font-weight: 750; overflow-wrap: anywhere; }
.sheet-titles p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-foot { flex: none; display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost.danger-text { flex: 0 0 auto; }
.confirm-msg { color: var(--muted); font-size: 15px; }
.confirm-msg strong { color: var(--text); }

/* ---------- formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.form-grid.tight { gap: 10px; margin: 12px 0; }
.field { grid-column: 1 / -1; display: grid; gap: 6px; align-content: start; min-width: 0; border: 0; margin: 0; padding: 0; }
.field.half { grid-column: span 1; }
.field > label, .field > legend { font-size: 13px; font-weight: 650; color: var(--muted); padding: 0; }
.req { color: var(--danger); margin-left: 2px; }
.field input:not([type=radio]):not([type=file]), .field select, .field textarea, .ref-btn {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus, .ref-btn:focus-visible { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); outline: none; }
.field input[readonly] { color: var(--muted); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .ref-btn, .field.invalid .seg { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent); }
.field.invalid > label, .field.invalid > legend { color: var(--danger); }
.hint { color: var(--muted); font-size: 12.5px; }
.hint strong { color: var(--text); }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .affix { position: absolute; left: 14px; color: var(--muted); font-size: 15px; pointer-events: none; }
.input-affix .affix.end { left: auto; right: 14px; }
.input-affix .affix:not(.end) + input { padding-left: 42px; }
.input-affix input { font-variant-numeric: tabular-nums; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 40px !important; }
.select .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--surface-3); border: 1px solid transparent; }
.seg.wrap { flex-wrap: wrap; }
.seg-opt { flex: 1 1 auto; position: relative; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span, .seg-btn { display: grid; place-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 620; color: var(--muted); text-align: center; white-space: nowrap; cursor: pointer; transition: all .15s; }
.seg-opt input:checked + span, .seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--primary); }
.seg.full { width: 100%; }
.seg.full .seg-btn { flex: 1; }
.form-section { grid-column: 1 / -1; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.form-more { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.form-more summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; font-weight: 650; color: var(--primary); cursor: pointer; }
.form-more summary::-webkit-details-marker { display: none; }
.form-more summary .ic { transition: transform .2s; }
.form-more[open] summary .ic { transform: rotate(180deg); }
.form-more > .form-grid { padding: 0 16px 16px; }
.ref-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.ref-btn .ic { color: var(--muted); }
.ref-btn.has { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.ref-main { display: grid; min-width: 0; }
.ref-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-main small { color: var(--muted); font-size: 13px; }
.photo-field { display: flex; align-items: center; gap: 12px; }
.photo-preview { position: relative; width: 76px; height: 76px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview.loading::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 60%, transparent) url() center/24px no-repeat; }
.photo-preview.loading::before { content: ""; position: absolute; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* seletor */
.pick-list { display: grid; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 6px; border-bottom: 1px solid var(--border); min-height: 58px; }
.pick-row:active, .pick-row.sel { background: var(--primary-soft); border-radius: 10px; }
.pick-main { flex: 1; min-width: 0; display: grid; }
.pick-main strong { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-main small { color: var(--muted); font-size: 13px; }
.pick-right { flex: none; font-variant-numeric: tabular-nums; }
.pick-right small { color: var(--muted); }

/* ---------- detalhes ---------- */
.detail-photo { display: block; margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: var(--surface-3); aspect-ratio: 16 / 10; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat-row > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.stat-row span { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.stat-row strong { font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv { margin: 0 0 14px; display: grid; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.kv > div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; padding: 11px 14px; }
.kv > div + div { border-top: 1px solid var(--border); }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; white-space: pre-line; }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.quick-actions.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-actions.two { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.qa { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 76px; padding: 10px 6px; border-radius: 15px; background: var(--ts, var(--surface-2)); color: var(--t, var(--text)); border: 1px solid color-mix(in srgb, var(--t, var(--border)) 18%, transparent); font-size: 13px; font-weight: 650; text-align: center; line-height: 1.2; transition: transform .1s; }
.qa:not([class*="tone-"]) { border-color: var(--border); }
.qa:not([class*="tone-"]) .ic { color: var(--primary); }
.qa:active { transform: scale(.96); }
.qa .ic { width: 24px; height: 24px; }
.sub-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 20px 0 10px; }
.meta-line { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.saldo-hero { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.saldo-hero span { color: var(--muted); font-size: 13px; font-weight: 600; }
.saldo-hero strong { display: block; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.saldo-hero strong small { font-size: 16px; color: var(--muted); font-weight: 600; }
.saldo-hero .stock-bar { height: 8px; margin: 10px 0 8px; }
.saldo-legend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.callout { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--ts); color: var(--text); margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--t) 25%, transparent); }
.callout > .ic { color: var(--t); margin-top: 2px; }
.callout p { color: var(--muted); font-size: 13.5px; margin: 2px 0 10px; }

/* ---------- banner / blocos ---------- */
.banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius); background: linear-gradient(135deg, #557379, #7F9BA1 70%, #BFA980); color: #fff; box-shadow: var(--shadow-2); }
.banner::after { content: ""; position: absolute; right: 30px; top: 50%; width: 130px; height: 66px; transform: translateY(-50%); background: url("/brand/simbolo-branco.svg") center/contain no-repeat; opacity: .22; pointer-events: none; }
.banner > * { position: relative; z-index: 1; }
.banner > span { flex: 1; display: grid; }
.banner small { opacity: .85; font-size: 13px; }
.banner .ic:first-child { width: 26px; height: 26px; }
.card-flat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); }
.card-flat + .card-flat { margin-top: 12px; }
.card-flat h3 { font-size: 16px; margin-bottom: 4px; }
.card-flat > p { margin-bottom: 12px; }
.lead { color: var(--muted); margin: 0 2px 14px; }

/* ---------- painel ---------- */
.hero { position: relative; overflow: hidden; padding: 20px 18px 22px; margin: 0 0 14px; border-radius: 22px; background: linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--brand-areia) 70%, var(--surface)) 100%); border: 1px solid var(--border); }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -18px; width: 240px; height: 120px; background: url("/brand/simbolo.svg") center/contain no-repeat; opacity: .55; pointer-events: none; }
html.theme-escuro .hero { background: linear-gradient(160deg, var(--surface), var(--surface-2)); }
html.theme-escuro .hero::after { background-image: url("/brand/simbolo-branco.svg"); opacity: .12; }
.hero > div { position: relative; z-index: 1; }
.hero-date { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero-date::first-letter { text-transform: uppercase; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 2px; }
.hero-sub { color: var(--muted); font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { position: relative; display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); min-width: 0; transition: transform .12s; }
.kpi:active { transform: scale(.98); }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ts, var(--primary-soft)); color: var(--t, var(--primary)); margin-bottom: 6px; }
.kpi-ic .ic { width: 18px; height: 18px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi[class*="tone-"] .kpi-value { color: var(--t); }
.kpi small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block { margin-top: 22px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block-title { font-size: 16px; font-weight: 750; margin-bottom: 10px; }
.block-head .block-title { margin: 0; }
.quick-block { margin: 0 0 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 4px; }
.steps li { counter-increment: s; }
.steps li a { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; padding: 10px 0; }
.steps li a::before { content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 14px; }
.steps li.done a::before { content: "✓"; background: var(--ok); color: #fff; }
.steps li span { color: var(--muted); font-size: 13.5px; }
.steps li.done strong { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.all-good { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); font-weight: 650; }

/* ---------- contagem rápida ---------- */
.cr-setup { margin-bottom: 14px; }
.cr-setup .search input { box-shadow: none; background: var(--surface-2); }
.cr-list { display: grid; gap: 8px; padding-bottom: 76px; }
.cr-row { display: grid; grid-template-columns: 1fr auto 84px 44px; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: background .2s, border-color .2s; }
.cr-row.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
.cr-row.div { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.cr-main { min-width: 0; display: grid; }
.cr-main strong { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-main small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-exp { display: grid; justify-items: end; line-height: 1.1; }
.cr-exp small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cr-exp strong { font-variant-numeric: tabular-nums; }
.cr-input { width: 100%; height: 44px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; }
.cr-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.ok-btn { background: var(--ok-soft); color: var(--ok); width: 44px; height: 44px; }
.cr-bar { position: fixed; z-index: 26; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); font-size: 14px; }
.cr-bar > span { flex: 1; min-width: 0; }

/* ---------- checklist ---------- */
.progress-card { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.progress-card h2 { font-size: 17px; }
.progress-card p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.progress-ring { --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.progress-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.ck-list { display: grid; gap: 10px; padding-bottom: 60px; }
.ck-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.ck-group summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.ck-group summary::-webkit-details-marker { display: none; }
.ck-group summary > .ic { color: var(--muted); transition: transform .2s; }
.ck-group[open] summary > .ic { transform: rotate(180deg); }
.ck-head { flex: 1; display: grid; }
.ck-head small { color: var(--muted); font-size: 12.5px; }
.mini-progress { width: 64px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mini-progress span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.ck-items { border-top: 1px solid var(--border); }
.ck-row { display: grid; gap: 8px; padding: 12px 16px; }
.ck-row + .ck-row { border-top: 1px solid var(--border); }
.ck-main { display: grid; gap: 4px; }
.ck-main strong { font-weight: 620; }
.ck-main small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ck-obs { color: var(--muted); font-size: 12.5px; }
.ck-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ck-opts { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); gap: 2px; }
.ck-opt { min-width: 52px; height: 34px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--muted); transition: all .15s; }
.ck-opt.on[data-v="Sim"] { background: var(--ok); color: #fff; }
.ck-opt.on[data-v="Não"] { background: var(--danger); color: #fff; }
.ck-opt.on[data-v="Não se aplica"] { background: var(--neutral); color: var(--surface); }

/* ---------- mais / listas / dados ---------- */
.menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 14px; min-height: 64px; }
.menu-row + .menu-row { border-top: 1px solid var(--border); }
.menu-row:active { background: var(--surface-2); }
.menu-row > .ic { color: var(--muted); width: 18px; height: 18px; }
.menu-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.menu .count { background: var(--warn-soft); color: var(--warn); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.tag { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 4px 0 12px; border-radius: 99px; background: var(--surface-3); font-size: 14px; font-weight: 550; }
.tag button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.tag button:hover { background: var(--danger-soft); color: var(--danger); }
.tag button .ic { width: 14px; height: 14px; }
.tag-add { display: flex; gap: 8px; }
.tag-add input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 16px; outline: none; }
.tag-add input:focus { border-color: var(--primary); }
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.export-grid .btn { justify-content: flex-start; }
.export-grid .btn small { margin-left: auto; color: var(--muted); font-weight: 600; }
.card-flat .btn + .btn, .card-flat label.btn { margin-top: 4px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 200; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2); transform: translateY(-16px); opacity: 0; transition: all .25s cubic-bezier(.2, .8, .2, 1); }
.toast.show { transform: none; opacity: 1; }
.toast .ic { color: var(--t, var(--ok)); flex: none; }
.toast.tone-ok .ic { color: #4ade80; }
.toast.tone-danger { background: var(--danger); color: #fff; }
.toast.tone-danger .ic { color: #fff; }
.toast.tone-warn .ic { color: #fbbf24; }
.toast.tone-info .ic { color: #93c5fd; }

/* ---------- telas pequenas ---------- */
@media (max-width: 380px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .chips, .selects { margin: 0 -12px; padding: 0 12px; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row strong { font-size: 14.5px; }
  .kpi-value { font-size: 21px; }
  .cr-row { grid-template-columns: 1fr 72px 44px; }
  .cr-exp { display: none; }
  .fab span { display: none; }
  .fab { padding: 0; width: 56px; justify-content: center; }
}

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sheet-wrap.small .sheet { left: 50%; right: auto; bottom: 50%; width: 440px; border-radius: 22px; transform: translate(-50%, 60%) scale(.96); opacity: 0; transition: transform .25s, opacity .2s; }
  .sheet-wrap.small.open .sheet { transform: translate(-50%, 50%); opacity: 1; }
  .sheet-wrap.small .sheet-grab { display: none; }
  .export-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ck-row { grid-template-columns: 1fr auto; align-items: center; }
  .page-checklist .ck-list, .page-checklist .progress-card { max-width: 900px; }
}

/* ---------- computador ---------- */
@media (min-width: 960px) {
  body { font-size: 15px; }
  .app-shell { display: grid; grid-template-columns: 252px 1fr; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface); }
  .brand { display: grid; justify-items: center; gap: 6px; padding: 10px 10px 22px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
  .brand-logo { display: block; width: 150px; }
  .brand small { color: var(--muted); font-family: var(--font-brand); font-size: 13px; letter-spacing: .04em; }
  .top-wordmark { display: none !important; }
  .top-title[hidden] { display: block; }
  .sidebar nav { display: grid; gap: 2px; }
  .sidebar nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 11px; color: var(--muted); font-weight: 600; transition: background .15s; }
  .sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
  .sidebar nav a.on { background: var(--primary-soft); color: var(--primary); }
  .sidebar nav .nav-n { position: static; margin-left: auto; border: 0; }
  .sidebar hr { border: 0; border-top: 1px solid var(--border); margin: 10px 8px; }
  .side-foot { margin-top: auto; padding: 10px; }
  .tabbar, .top-brand { display: none; }
  .main { padding-bottom: 40px; }
  .topbar { padding: 0 24px; height: 64px; }
  .top-title { font-size: 20px; }
  .page { padding: 20px 28px 40px; }
  .chips, .selects { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .toolbar { grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; }
  .fab { bottom: 28px; right: 28px; }
  .cr-bar { left: calc(252px + 28px); right: 28px; bottom: 24px; max-width: 900px; }
  .cr-list { max-width: 900px; }
  .cr-setup { max-width: 900px; }
  .page-mais .menu, .page-mais .sub-title, .page-listas section, .page-dados section, .page-listas .lead { max-width: 760px; }
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .page-painel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-content: start; }
  .page-painel > .hero, .page-painel > .kpis, .page-painel > .quick-block, .page-painel > .banner { grid-column: 1 / -1; }
  .page-painel > .quick-block { margin-top: 0; margin-bottom: 18px; }
  .page-painel > .banner { margin-top: 22px; }
  /* sheet vira painel lateral */
  .sheet-wrap:not(.small) .sheet { left: auto; top: 0; width: min(560px, 100vw); max-height: none; height: 100dvh; border-radius: 22px 0 0 22px; transform: translateX(100%); }
  .sheet-wrap:not(.small).open .sheet { transform: none; }
  .sheet-wrap:not(.small) .sheet-grab { display: none; }
  .sheet-head { padding-top: 14px; }
  #toasts { top: auto; bottom: 24px; left: 252px; }
}
@media (min-width: 1280px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.quick-actions.n1 { grid-template-columns: 1fr; }
.quick-actions.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-actions.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- login ---------- */
.login-field { display: grid; gap: 6px; text-align: left; }
.login-field span { font-size: 13px; font-weight: 650; color: var(--muted); }
.login-card .login-field input { height: 50px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 14px; font-size: 16px; text-align: left; letter-spacing: 0; outline: none; }
.login-card .login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.login-card p strong { color: var(--text); }
.login-help { font-size: 13px; margin-top: 4px; }

/* ---------- conta / usuários ---------- */
.avatar.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.avatar.lg { width: 60px; height: 60px; border-radius: 18px; font-size: 20px; }
.account-card { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.account-card h3 { margin: 0 0 2px; }
.account-card .badge { margin-top: 6px; }
.account-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.account-strip > .ic { color: var(--muted); }
.badge.role-master { background: var(--danger-soft); color: var(--danger); }
.badge.role-gerente { background: var(--info-soft); color: var(--info); }
.badge.role-colaborador { background: var(--ok-soft); color: var(--ok); }
.role-desc { margin: -4px 2px 10px; }
.menu-ic.tone-danger-ic { background: var(--danger-soft); color: var(--danger); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; margin-bottom: 6px; }
.side-user:hover { background: var(--surface-2); }
.side-user > span:last-child { display: grid; line-height: 1.2; min-width: 0; }
.side-user strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: var(--muted); font-size: 12px; }

/* ---------- aparência ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-opt { position: relative; display: grid; gap: 6px; padding: 10px 10px 12px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--border); text-align: left; transition: border-color .15s; }
.theme-opt.on { border-color: var(--primary); }
.theme-txt { display: flex; align-items: center; gap: 6px; }
.theme-txt .ic { width: 18px; height: 18px; color: var(--primary); }
.theme-opt small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.theme-check { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.theme-check .ic { width: 16px; height: 16px; }
.theme-prev { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 14px 30px; gap: 5px; padding: 8px; height: 76px; border-radius: 12px; border: 1px solid rgb(0 0 0 / .08); }
.theme-prev i { border-radius: 6px; }
.theme-prev i:first-child { grid-column: 1 / -1; }
.prev-padrao { background: #F6F2EC; } .prev-padrao i { background: #fff; } .prev-padrao i:first-child { background: #7F9BA1; }
.prev-claro { background: #fff; } .prev-claro i { background: #F1F0EC; } .prev-claro i:first-child { background: #7F9BA1; }
.prev-escuro { background: #151918; } .prev-escuro i { background: #232A28; } .prev-escuro i:first-child { background: #9DB8BE; }
.prev-auto { background: linear-gradient(135deg, #F6F2EC 50%, #151918 50%); } .prev-auto i { background: rgb(255 255 255 / .55); } .prev-auto i:first-child { background: #7F9BA1; }

/* ---------- permissões ---------- */
.perm-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.perm-head, .perm-row { display: grid; grid-template-columns: 1fr 76px 92px; align-items: center; gap: 6px; padding: 12px 14px; }
.perm-head { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.perm-head span:not(:first-child), .perm-cell { text-align: center; justify-self: center; }
.perm-row + .perm-row { border-top: 1px solid var(--border); }
.perm-row.perm-money { background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.perm-label { display: grid; gap: 1px; min-width: 0; }
.perm-label strong { font-weight: 620; font-size: 14.5px; }
.perm-label small { color: var(--muted); font-size: 12.5px; }
.switch { position: relative; display: inline-block; width: 46px; height: 28px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- relatórios ---------- */
.rel-controls { display: grid; gap: 10px; margin-bottom: 14px; }
.rel-tabs .chip .ic { width: 16px; height: 16px; }
.mini-date { height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary); font-size: 13.5px; flex: none; }
.rel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rel-head h2 { font-family: var(--font-brand); font-weight: 500; font-size: 22px; color: var(--brand-title); margin-bottom: 4px; }
.rel-head strong { color: var(--text); }
.rel-actions { display: flex; gap: 8px; }
.rel-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.rel-tile { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); min-width: 0; }
.rel-tile span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rel-tile strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rel-tile small { font-size: 12px; color: var(--muted); }
.rel-chart { margin-bottom: 12px; }
.rel-chart h3 { font-size: 15px; margin-bottom: 12px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 2px 4px; border-radius: 8px; }
.bar-row:hover { background: var(--surface-2); }
.bar-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 12px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--brand-lagoa); }
html.theme-escuro .bar-fill { background: #9DB8BE; }
.bar-row:hover .bar-fill { background: var(--primary); }
.bar-val { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.rel-table-wrap { padding: 0; overflow: hidden; }
.rel-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rel-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rel-table th, .rel-table td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.rel-table th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rel-table td.num, .rel-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rel-table tbody tr:hover { background: var(--surface-2); }
.rel-table .badge { height: 21px; font-size: 11.5px; }
.rel-count { padding: 10px 12px; }
.print-only { display: none; }
@media (min-width: 640px) { .rel-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #222 !important; }
  .sidebar, .topbar, .tabbar, .fab, .rel-controls, .rel-actions, #toasts, .sheet-wrap { display: none !important; }
  .app-shell { display: block !important; }
  .main { padding: 0 !important; }
  .page { padding: 0 !important; max-width: none; animation: none; }
  .print-only { display: block; }
  .rel-logo img { width: 130px; margin-bottom: 8px; }
  .rel-head { border-bottom: 2px solid #7F9BA1; padding-bottom: 10px; }
  .rel-head h2 { color: #557379; }
  .rel-tiles { grid-template-columns: repeat(4, 1fr); }
  .rel-tile, .card-flat, .rel-table-wrap { box-shadow: none !important; border-color: #ddd !important; background: #fff !important; break-inside: avoid; }
  .rel-table-scroll { overflow: visible; }
  .rel-table th, .rel-table td { white-space: normal; padding: 6px 8px; font-size: 11px; }
  .rel-table th { position: static; background: #f3f0ea !important; color: #555; }
  .bar-fill { background: #7F9BA1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { border: 1px solid #ccc; background: #fff !important; color: #333 !important; }
}
.ck-opt[disabled] { opacity: .55; cursor: default; }

/* ---------- leitor de código de barras ---------- */
.input-scan { position: relative; display: flex; }
.input-scan input { padding-right: 52px !important; }
.input-scan .scan-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--primary); }
.search .scan-in { position: absolute; right: 6px; color: var(--primary); }
.search:has(.scan-in) input { padding-right: 84px; }
.search:has(.scan-in) [data-act=clearSearch] { right: 44px; }
.sheet-wrap.scanner .sheet-body { display: flex; flex-direction: column; gap: 12px; }
.scan-view { position: relative; flex: 1; min-height: 300px; border-radius: 18px; overflow: hidden; background: #0b0f0e; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 10%; right: 10%; top: 50%; height: 34%; transform: translateY(-50%); border-radius: 16px; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .38); border: 2px solid rgb(255 255 255 / .85); transition: border-color .15s; }
.scan-frame i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #C48A6A; box-shadow: 0 0 12px #C48A6A; animation: scanline 1.6s ease-in-out infinite; }
.scan-frame.hit { border-color: #8fd19e; }
@keyframes scanline { 0%, 100% { transform: translateY(-34px); } 50% { transform: translateY(34px); } }
.scan-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; color: #fff; font-weight: 600; }
.scan-msg .ic { width: 30px; height: 30px; opacity: .8; }
.scan-msg.err { background: rgb(0 0 0 / .55); }
.scan-torch { position: absolute; right: 12px; bottom: 12px; background: rgb(0 0 0 / .45); color: #fff; }
.scan-torch.on { background: #BFA980; color: #222; }
.scan-hint { color: var(--muted); font-size: 13.5px; text-align: center; }
.scan-result { display: none; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; }
.scan-result.show { display: flex; }
.scan-result.ok { background: var(--ok-soft); color: var(--ok); }
.scan-result.bad { background: var(--danger-soft); color: var(--danger); }
.scan-result span { color: var(--text); }
.scan-manual { display: flex; gap: 8px; }
.scan-manual input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 16px; outline: none; }
.scan-manual input:focus { border-color: var(--primary); }
.sheet-wrap.scanner .sheet-foot { align-items: center; }
.sheet-wrap.scanner .sheet-foot .muted { flex: 1; }
.cr-search-row { display: flex; gap: 8px; align-items: center; }
.cr-search-row .search { flex: 1; }
.cr-search-row .btn { height: 48px; }
.cr-tip { margin: 8px 2px 0; }

/* ---------- importação de NF-e ---------- */
.nf-drop { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 18px; }
.nf-drop-ic .ic { width: 30px; height: 30px; padding: 14px; box-sizing: content-box; border-radius: 22px; background: var(--primary-soft); color: var(--primary); }
.nf-drop p { max-width: 460px; }
.nf-tips { text-align: left; color: var(--muted); font-size: 13.5px; margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; max-width: 460px; }
.nf-head-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.nf-chave { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); word-break: break-all; margin-bottom: 4px; }
.nf-defaults h3 { margin-bottom: 0; }
.check-row { display: flex !important; align-items: center; gap: 10px; font-size: 14px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--primary); }
.nf-lines { display: grid; gap: 10px; padding-bottom: 84px; }
.nf-line { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.nf-line.ignorar { opacity: .7; }
.nf-line.novo { border-color: color-mix(in srgb, var(--brand-dourado) 55%, var(--border)); }
.nf-line-head { display: flex; gap: 10px; align-items: flex-start; }
.nf-n { flex: none; min-width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; }
.nf-prod { display: grid; gap: 2px; min-width: 0; }
.nf-prod strong { font-weight: 640; }
.nf-prod small { color: var(--muted); font-size: 12.5px; }
.nf-prod b { color: var(--text); }
.nf-acao .seg-btn { flex: 1; min-height: 36px; font-size: 13px; padding: 0 8px; }
.nf-novo { margin: 0; }
.nf-novo input, .nf-novo select { min-height: 44px !important; font-size: 15px !important; }
.nf-conv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.nf-conv input { width: 76px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; font-size: 15px; font-weight: 650; outline: none; }
.nf-conv input:focus { border-color: var(--primary); }
.nf-entra { margin-left: auto; color: var(--text); }
.nf-entra strong { color: var(--ok); }
.nf-bar > span { font-size: 13px; }
@media (min-width: 960px) { .nf-lines, .nf-head, .nf-defaults, .page-importar-nfe .sub-title { max-width: 900px; } }
.scan-msg[hidden] { display: none; }
.nf-head .stat-row strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field.check-row input[type=checkbox] { width: 22px !important; height: 22px; min-height: 0 !important; padding: 0 !important; flex: none; }
.nf-defaults .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.2; }

/* ---------- NF-e: opções de importação e chave ---------- */
.nf-drop { margin-bottom: 12px; }
.nf-options { display: grid; gap: 10px; }
.nf-opt { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); cursor: pointer; transition: border-color .15s, transform .1s; }
.nf-opt:hover { border-color: var(--primary); }
.nf-opt:active { transform: scale(.99); }
.nf-opt-ic { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.nf-opt-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.nf-opt-txt small { color: var(--muted); font-size: 13px; }
.nf-opt.loading { pointer-events: none; opacity: .7; }
.nf-opt.loading .nf-opt-ic::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.nf-opt.loading .nf-opt-ic .ic { opacity: 0; }
.nf-opt-form { cursor: default; }
.nf-chave-input { display: flex; gap: 8px; margin-top: 6px; }
.nf-chave-input input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 16px; letter-spacing: .02em; outline: none; }
.nf-chave-input input:focus { border-color: var(--primary); }
.nf-tips { margin-top: 14px; }
.nf-key { display: grid; gap: 12px; }
.nf-key .nf-head-top { margin-bottom: 0; }
.nf-chave.big { font-size: 15px; color: var(--text); text-align: center; line-height: 1.6; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); letter-spacing: .04em; }
.small-strong { font-size: 12.5px !important; }
.nf-key .stat-row { margin-bottom: 0; }
.nf-key .callout { margin-bottom: 0; }
.nf-manual { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; }
.nf-manual h4 { font-size: 14px; }
.nf-manual ol, .integ-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; display: grid; gap: 4px; }
.nf-manual ol strong, .integ-steps strong { color: var(--text); }
.nf-manual-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nf-manual-btns .btn { white-space: normal; line-height: 1.2; text-align: center; }
/* ---------- integrações ---------- */
.integ-card { display: grid; gap: 14px; max-width: 760px; }
.integ-head { display: flex; gap: 12px; align-items: flex-start; }
.integ-head h3 { margin-bottom: 2px; }
.integ-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; }
.integ-status.on { background: var(--ok-soft); color: var(--ok); }
.integ-status span { color: var(--text); font-weight: 500; }
.integ-form { display: grid; gap: 10px; }
.integ-form .lbl { font-size: 13px; font-weight: 650; color: var(--muted); }
.integ-form input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 16px; outline: none; }
.integ-form input:focus { border-color: var(--primary); }
.integ-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.integ-card h4 { font-size: 14px; }
/* evita que o campo da chave alargue a coluna além da tela */
.nf-options { grid-template-columns: minmax(0, 1fr); }
.nf-chave-input input { width: 0; }
.nf-chave.big { word-break: normal; overflow-wrap: normal; font-size: 14.5px; letter-spacing: .02em; }

/* ---------- ajuda ---------- */
.help-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); }
.help-banner > span { flex: 1; display: grid; }
.help-banner small { color: var(--muted); font-size: 13px; }
.help-banner strong { color: var(--text); }
.help-hero { padding: 18px 16px; margin-bottom: 6px; border-radius: 22px; background: linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--brand-areia) 60%, var(--surface))); border: 1px solid var(--border); display: grid; gap: 12px; }
html.theme-escuro .help-hero { background: linear-gradient(160deg, var(--surface), var(--surface-2)); }
.help-hero h2 { font-family: var(--font-brand); font-weight: 500; font-size: 22px; color: var(--brand-title); }
.help-hero-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-ic { width: 17px; height: 17px; color: var(--primary); }
.help-cards { display: grid; gap: 8px; }
@media (min-width: 640px) { .help-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.help-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); min-height: 68px; }
.help-card:active { transform: scale(.99); }
.help-card > .ic { color: var(--muted); width: 18px; height: 18px; }
.help-card .row-main small { white-space: normal; }
.help-card-ic, .help-art-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.help-toggle { display: flex; align-items: center; gap: 10px; margin: 16px 2px 4px; font-size: 13.5px; color: var(--muted); }
.help-toggle input { width: 20px; height: 20px; accent-color: var(--primary); }
.help-back { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 650; font-size: 14px; margin-bottom: 12px; }
.help-back .ic { width: 18px; height: 18px; }
.help-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow-1); max-width: 820px; }
.sheet .help-article { background: none; border: 0; padding: 0; box-shadow: none; }
.help-art-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.help-art-head h2 { font-family: var(--font-brand); font-weight: 500; font-size: 21px; color: var(--brand-title); margin-bottom: 4px; }
.help-who { display: flex; gap: 6px; margin-bottom: 12px; }
.help-who .badge { gap: 4px; }
.xs-ic { width: 12px; height: 12px; }
.help-body { display: grid; gap: 12px; font-size: 15px; line-height: 1.55; }
.help-body p { margin: 0; }
.help-steps { margin: 0; padding: 0; list-style: none; counter-reset: passo; display: grid; gap: 10px; }
.help-steps li { counter-increment: passo; position: relative; padding-left: 40px; min-height: 28px; }
.help-steps li::before { content: counter(passo); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: 13.5px; }
.help-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; font-size: 14.5px; }
.help-callout .ic { flex: none; margin-top: 2px; width: 18px; height: 18px; }
.help-callout.tip { background: var(--ok-soft); } .help-callout.tip .ic { color: var(--ok); }
.help-callout.warn { background: var(--warn-soft); } .help-callout.warn .ic { color: var(--warn); }
.help-callout.info { background: var(--info-soft); margin-bottom: 12px; } .help-callout.info .ic { color: var(--info); }
.help-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.help-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.help-table th, .help-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.help-table th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.help-table tr:last-child td { border-bottom: 0; }
.help-table td:not(:first-child) { text-align: center; }
.help-table td:first-child { font-weight: 600; }
.help-go { justify-self: start; }
.help-faq { display: grid; gap: 8px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; font-weight: 620; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .ic { flex: none; color: var(--muted); transition: transform .2s; }
.faq-item[open] summary .ic { transform: rotate(180deg); }
.faq-a { padding: 0 14px 14px; display: grid; gap: 8px; color: var(--muted); font-size: 14.5px; }
.faq-a strong { color: var(--text); }
.help-gloss { margin: 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.help-gloss > div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 10px 14px; }
.help-gloss > div + div { border-top: 1px solid var(--border); }
.help-gloss dt { font-weight: 750; color: var(--primary); }
.help-gloss dd { margin: 0; font-size: 14px; }
/* tutorial */
.sheet-wrap.tour .sheet-body { padding-top: 8px; }
.tour-slide { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 8px 4px 4px; min-height: 250px; align-content: center; }
.tour-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.tour-ic .ic { width: 36px; height: 36px; }
.tour-logo { width: 150px; }
.tour-slide h3 { font-family: var(--font-brand); font-weight: 500; font-size: 21px; color: var(--brand-title); }
.tour-slide p { color: var(--muted); font-size: 15.5px; line-height: 1.5; max-width: 360px; }
.tour-slide strong { color: var(--text); }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--border); transition: all .2s; }
.tour-dots i.on { width: 22px; background: var(--primary); }
.tour-count { text-align: center; margin-top: 6px; }
/* manual */
.manual-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.manual-bar .help-toggle { margin: 0; flex: 1; min-width: 200px; }
.manual { display: grid; gap: 14px; max-width: 860px; }
.manual-capa { text-align: center; padding: 28px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.manual-logo { width: 190px; margin-bottom: 10px; }
.manual-capa h1 { font-family: var(--font-brand); font-weight: 500; font-size: 28px; color: var(--brand-title); }
.manual-indice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.manual-indice h2, .manual-cat { font-family: var(--font-brand); font-weight: 500; font-size: 20px; color: var(--brand-title); margin-bottom: 8px; }
.manual-indice ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.manual-indice ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.manual-sec { display: grid; gap: 12px; }
.manual-faq { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.manual-faq p { margin: 0; color: var(--muted); }
@media print {
  .no-print, .manual-bar { display: none !important; }
  .manual, .help-article { max-width: none; }
  .manual-capa { border: 0; padding-top: 60px; break-after: page; }
  .manual-indice { break-after: page; border: 0; }
  .manual-sec { break-before: page; }
  .help-article, .manual-faq, .help-gloss, .manual-indice { box-shadow: none !important; background: #fff !important; border-color: #ddd !important; break-inside: avoid; }
  .help-steps li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .help-callout { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  .manual-capa h1, .manual-cat, .help-art-head h2 { color: #557379 !important; }
}
@media print {
  .manual .help-article { break-inside: auto; }
  .help-steps li, .help-table-wrap, .help-art-head { break-inside: avoid; }
  .help-art-head { break-after: avoid; }
}

/* ---------- avisos, manutenção e reposição ---------- */
.field[hidden], fieldset.field[hidden] { display: none !important; }
.so-pc { display: none; }
@media (min-width: 960px) { .so-pc { display: inline-grid; } }
@media (max-width: 420px) { .topbar .icon-btn:not(.back) { width: 38px; } }
.sino { position: relative; }
.sino .nav-n { top: 3px; left: auto; right: 1px; }
.boot.small { min-height: 200px; }
/* fechamento: checklist */
.checks-list { display: grid; gap: 6px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; cursor: pointer; }
.check-item input { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.check-item:has(input:checked) { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.ck-result { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.ck-result li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); }
.ck-result li .ic { width: 16px; height: 16px; }
.ck-result li.ok { color: var(--text); } .ck-result li.ok .ic { color: var(--ok); }
/* histórico */
.timeline { list-style: none; margin: 0 0 14px; padding: 0 0 0 18px; border-left: 2px solid var(--border); display: grid; gap: 12px; }
.timeline li { position: relative; display: grid; gap: 1px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.timeline li:first-child::before { background: var(--brand-terracota); }
.timeline small { color: var(--muted); font-size: 12.5px; }
.manut-fotos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.manut-fotos a { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-3); }
.manut-fotos img { width: 100%; height: 100%; object-fit: cover; }
.manut-fotos span { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 99px; background: rgb(0 0 0 / .55); color: #fff; font-size: 12px; font-weight: 600; }
.dot-urgente { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--danger-soft); }
.manut-links { display: grid; gap: 10px; margin-bottom: 14px; }
.manut-links .banner { margin: 0; }
.banner.alt { background: linear-gradient(135deg, #6F7C6A, #8E9A84 70%, #BFA980); }
@media (min-width: 640px) { .manut-links { grid-template-columns: 1fr 1fr; } }
.agenda-legenda { margin: 10px 2px 14px; }
.agenda .group-title .count { margin-left: 4px; }
.consumo { margin-top: 8px; font-size: 13px; color: var(--muted); }
.consumo strong { color: var(--text); }
/* central de avisos */
.avisos { display: grid; }
.aviso { display: flex; align-items: flex-start; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.aviso.novo { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); border-radius: 12px; }
.aviso .row-main small { white-space: normal; }
.aviso-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.aviso-ic .ic { width: 18px; height: 18px; }
.aviso-ic.t-estoque, .aviso-ic.t-prazos { background: var(--warn-soft); color: var(--warn); }
.aviso-ic.t-urgente { background: var(--danger-soft); color: var(--danger); }
.aviso-ic.t-atribuido, .aviso-ic.t-validacao { background: var(--info-soft); color: var(--info); }
.aviso-ic.t-resumo { background: var(--ok-soft); color: var(--ok); }
.aviso-quando { flex: none; font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
/* notificações */
.push-card { display: grid; gap: 12px; }
.push-status { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; background: var(--warn-soft); }
.push-status .ic { color: var(--warn); flex: none; margin-top: 2px; }
.push-status.on { background: var(--ok-soft); } .push-status.on .ic { color: var(--ok); }
.push-status div { display: grid; gap: 2px; } .push-status small { color: var(--muted); }
.push-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pref-row { cursor: pointer; }
.convite-push { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; margin-bottom: 14px; border-radius: var(--radius); background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.convite-push > .ic { color: var(--info); flex: none; }
.convite-push > span { flex: 1; display: grid; min-width: 0; }
.convite-push small { color: var(--muted); font-size: 12.5px; }
.field .check-item input[type=checkbox] { width: 22px !important; height: 22px; min-height: 0 !important; padding: 0 !important; flex: none; }
.check-item span { flex: 1; min-width: 0; }
.saldo-hero .consumo strong { display: inline; font-size: inherit; font-weight: 700; letter-spacing: 0; }
/* barra lateral: só a lista de itens rola; logo e usuário ficam fixos */
@media (min-width: 960px) {
  .sidebar { overflow: hidden; }
  .brand, .side-foot { flex: none; }
  .sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; margin: 0 -6px; padding: 0 6px 8px;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
  .sidebar nav::-webkit-scrollbar { width: 6px; }
  .sidebar nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
  .side-foot { margin-top: 0; border-top: 1px solid var(--border); padding-top: 10px; }
}
/* telas de notebook baixas: itens um pouco mais compactos */
@media (min-width: 960px) and (max-height: 820px) {
  .brand { padding: 4px 10px 12px; } .brand-logo { width: 120px; }
  .sidebar nav a { height: 38px; }
}
