/* =========================================================
   RT Imports · Gestão & Fluxo de Caixa — folha de estilo
   ---------------------------------------------------------
   Direção visual: minimalista e funcional.
   • Menu lateral com a identidade da marca (preto + dourado).
   • Conteúdo sóbrio: superfícies planas, bordas finas, números
     em Manrope, dourado só como acento (botão principal, ativo).

   1. Tokens (tema escuro padrão / tema claro)
   2. Base
   3. Layout (sidebar, topbar, conteúdo, barra inferior mobile)
   4. Componentes (botões, cards, stats, listas, tabelas, forms)
   5. Módulos (catálogo, CMV, entregas, clientes…)
   6. Gráficos
   7. Modal, toast, tooltip
   8. Responsivo
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --f-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --f-brand: 'Cinzel', 'Cormorant Garamond', serif;
  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 9px;
  --r: 14px;
  --sidebar: 256px;
  --bnav: 64px;
}

:root,
:root[data-theme="dark"] {
  --bg: #0b0a08;
  --bg-2: #100f0c;
  --surface: #151411;
  --surface-2: #1b1a16;
  --surface-3: #25231e;
  --line: rgba(255, 240, 210, .075);
  --line-2: rgba(255, 240, 210, .14);
  --text: #efe9df;
  --text-2: #c2b9aa;
  --muted: #8b8374;
  --gold: #cfa962;
  --gold-2: #e3c68d;
  --gold-ink: #17120a;
  --gold-grad: linear-gradient(135deg, #8a6a2e 0%, #e9cc8e 40%, #c89b4c 68%, #f3dca6 100%);
  --gold-soft: rgba(207, 169, 98, .10);
  --pos: #7cc49f;
  --pos-soft: rgba(124, 196, 159, .11);
  --neg: #e38c7f;
  --neg-soft: rgba(227, 140, 127, .11);
  --warn: #dcb366;
  --warn-soft: rgba(220, 179, 102, .12);
  --info: #8fb0d8;
  --info-soft: rgba(143, 176, 216, .12);
  /* Categóricas dos gráficos — validadas (luminosidade, croma, daltonismo) */
  --c1: #b8862c;
  --c2: #4a8be0;
  --c3: #cf5b86;
  --c4: #9170e8;
  --overlay: rgba(4, 3, 2, .62);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f1ea;
  --bg-2: #efe9df;
  --surface: #fdfbf7;
  --surface-2: #f6f1e8;
  --surface-3: #ece4d6;
  --line: rgba(90, 70, 30, .10);
  --line-2: rgba(90, 70, 30, .20);
  --text: #2a241b;
  --text-2: #51473a;
  --muted: #847766;
  --gold: #9c7430;
  --gold-2: #7a5920;
  --gold-ink: #fffaf0;
  --gold-grad: linear-gradient(135deg, #8a6a2e 0%, #c49a4c 45%, #a37830 75%, #cfa964 100%);
  --gold-soft: rgba(156, 116, 48, .09);
  --pos: #2d8659;
  --pos-soft: rgba(45, 134, 89, .09);
  --neg: #b5473b;
  --neg-soft: rgba(181, 71, 59, .08);
  --warn: #a26c17;
  --warn-soft: rgba(162, 108, 23, .10);
  --info: #3d6aa3;
  --info-soft: rgba(61, 106, 163, .09);
  --c1: #a47c35;
  --c2: #3f6fa8;
  --c3: #b04d72;
  --c4: #6d5bb8;
  --overlay: rgba(42, 34, 24, .34);
  color-scheme: light;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--f-ui);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
.i { width: 18px; height: 18px; flex: none; }
.num, .tbl td, .st-val, .lamt { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.gold { color: var(--gold); }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--gold); color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- 3. Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* Sidebar — identidade da marca */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; margin-bottom: 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.brand-mark { font-family: var(--f-display); font-weight: 600; font-size: 42px; line-height: .9; letter-spacing: -.09em; padding-right: .08em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-name { font-family: var(--f-brand); font-size: 14px; letter-spacing: .42em; font-weight: 600; color: var(--text); display: block; }
.brand-sub { font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-top: 2px; display: block; }

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 5px; font-weight: 600; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, var(--gold-soft), transparent 90%); color: var(--gold-2); }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-grad); }
.nav .count { margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; background: var(--warn-soft); color: var(--warn); }
.nav .new { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cash-card { position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--surface); text-decoration: none; color: inherit; display: block; }
.cash-card .lbl { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.cash-card .val { font-size: 20px; font-weight: 700; color: var(--gold-2); margin-top: 4px; }
.cash-card .sub { font-size: 11.5px; color: var(--muted); }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.foot-row { display: flex; gap: 6px; }
.foot-row .btn { flex: 1; justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-head { min-width: 0; }
.page-title { font-family: var(--f-display); font-size: 26px; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.view { padding: 22px 28px 64px; width: 100%; max-width: 1360px; }
.backdrop { display: none; }

/* Barra inferior (somente celular) */
.bnav { display: none; }

/* ---------- 4. Componentes ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font: 600 13px var(--f-ui);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn .i { width: 16px; height: 16px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-pos .i { color: var(--pos); }
.btn-neg .i { color: var(--neg); }
.btn-danger { color: var(--neg); border-color: transparent; }
.btn-danger:hover { background: var(--neg-soft); }
.btn-wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-wa:hover { background: #22ad5e; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; justify-content: center; }

.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55); display: none; z-index: 50; }
.dropdown.open .menu { display: block; }
.menu button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.menu b { display: block; font-size: 13px; font-weight: 600; }
.menu small { color: var(--muted); font-size: 11.5px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 14.5px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--muted); }
.section-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 26px 0 10px; }
.link { color: var(--gold); font-size: 12.5px; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; padding: 0; }
.link .i { width: 14px; height: 14px; }
.spacer { flex: 1; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }

/* Faixa de números (stats) */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stats.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.st:first-child { border-left: 0; }
.st.click { cursor: pointer; }
.st.click:hover { background: var(--surface-2); }
.st-lbl { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.st-lbl .i { width: 14px; height: 14px; }
.st-val { font-size: 20px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; white-space: nowrap; }
.st-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bloco do saldo */
.balance { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.balance-lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.balance-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.balance-sub { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: flex; gap: 14px; flex-wrap: wrap; }
.balance-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .i { width: 12px; height: 12px; }
.b-pos { background: var(--pos-soft); color: var(--pos); }
.b-neg { background: var(--neg-soft); color: var(--neg); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-gold { background: var(--gold-soft); color: var(--gold); }
.b-line { background: transparent; border: 1px solid var(--line-2); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; }

/* Listas compactas */
.list { display: flex; flex-direction: column; }
.lrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow.click { cursor: pointer; }
.lrow.click:hover { background: linear-gradient(90deg, transparent, var(--surface-2) 20%, var(--surface-2) 80%, transparent); }
.lico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.lico .i { width: 16px; height: 16px; }
.lico.pos { background: var(--pos-soft); color: var(--pos); }
.lico.neg { background: var(--neg-soft); color: var(--neg); }
.lico.warn { background: var(--warn-soft); color: var(--warn); }
.lico.info { background: var(--info-soft); color: var(--info); }
.lico.gold { background: var(--gold-soft); color: var(--gold); }
.ltitle { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmeta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lright { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lamt { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.lamt.pos { color: var(--pos); }
.lamt.neg { color: var(--neg); }
.lamt.ext { color: var(--muted); }
.day-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 16px 0 4px; border-bottom: 1px solid var(--line); }
.day-head:first-child { padding-top: 0; }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); font-size: 13px; }
.empty .i { width: 24px; height: 24px; color: var(--muted); opacity: .7; margin-bottom: 6px; }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.t-main { font-weight: 600; }
.t-sub { font-size: 11.5px; color: var(--muted); }
.amt { font-weight: 700; white-space: nowrap; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl-sm { font-size: 12px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 11.5px; color: var(--muted); }
.input {
  height: 38px; width: 100%;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  padding: 0 11px;
  font: 500 14px var(--f-ui);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .8; }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--surface); color: var(--text); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input.big { height: 50px; font-size: 24px; font-weight: 700; }
.input.sm { height: 32px; font-size: 13px; padding: 0 9px; }
input[type="date"].input::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }
:root[data-theme="light"] input[type="date"].input::-webkit-calendar-picker-indicator { filter: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }

.search { position: relative; min-width: 200px; flex: 0 1 280px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 33px; height: 36px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 11px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font: 600 12.5px var(--f-ui); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.seg button .i { width: 14px; height: 14px; }
.seg.full { display: flex; flex-wrap: wrap; }
.seg.full button { flex: 1; justify-content: center; height: 34px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 600 12px var(--f-ui); cursor: pointer; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }

.meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.meter.warn > i { background: var(--warn); }
.meter.neg > i { background: var(--neg); }
.meter.pos > i { background: var(--pos); }

.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 8px 0 10px; border: 0; background: none; color: var(--muted); font: 600 13.5px var(--f-ui); cursor: pointer; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs .on { color: var(--text); border-color: var(--gold); }

/* Miniatura de produto (foto com frasco ilustrado de reserva) */
.thumb { position: relative; width: 40px; height: 40px; border-radius: 10px; flex: none; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #b8862c) 14%, var(--surface-2)); }
.thumb svg { width: 22px; height: 22px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 56px; height: 56px; border-radius: 12px; }
.thumb .liq { fill: var(--c, #b8862c); opacity: .85; }
.thumb .glass { fill: none; stroke: color-mix(in srgb, var(--c, #b8862c) 70%, var(--text)); stroke-width: 1.3; }
.thumb .cap { fill: var(--gold); }
.prod { display: flex; align-items: center; gap: 11px; min-width: 0; }
.prod-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 11px; font-size: 12.5px; background: var(--surface-2); color: var(--text-2); }
.callout .i { color: var(--gold); margin-top: 1px; width: 16px; height: 16px; }
.callout.neg { background: var(--neg-soft); color: var(--neg); }
.callout.neg .i { color: var(--neg); }
.callout.warn { background: var(--warn-soft); }
.callout.warn .i { color: var(--warn); }
.callout.pos { background: var(--pos-soft); }
.callout.pos .i { color: var(--pos); }

.summary { margin-top: 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); padding: 12px 14px; }
.summary .ln { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; color: var(--text-2); }
.summary .ln.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; font-size: 14px; color: var(--text); font-weight: 700; }
.summary .ln.total b { font-size: 20px; }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.detail-grid div { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); }
.detail-grid span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.detail-grid b { font-size: 14px; }

.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; margin-bottom: 11px; }
.hbar .meter { grid-column: 1 / -1; }
.hbar span { font-size: 12.5px; color: var(--text-2); }
.hbar b { font-size: 12.5px; }

.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.sw-pos { background: var(--pos); } .sw-neg { background: var(--neg); } .sw-gold { background: var(--gold); }

/* ---------- 5. Módulos ---------- */

/* Itens de venda / nota */
.items-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 104px 96px 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row .sub { text-align: right; font-weight: 700; font-size: 13px; }
.item-cols { display: grid; grid-template-columns: minmax(0, 1fr) 70px 104px 96px 30px; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.item-cols span:nth-child(4) { text-align: right; }

/* Catálogo (admin e público) */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pcard.off { opacity: .55; }
.pcard-img { position: relative; aspect-ratio: 1 / 1; background: color-mix(in srgb, var(--c, #b8862c) 12%, var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
.pcard-img svg { width: 42%; height: 42%; }
.pcard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard-img .liq { fill: var(--c, #b8862c); opacity: .85; }
.pcard-img .glass { fill: none; stroke: color-mix(in srgb, var(--c, #b8862c) 70%, var(--text)); stroke-width: .8; }
.pcard-img .cap { fill: var(--gold); }
.pcard-img .badge { position: absolute; left: 10px; top: 10px; z-index: 1; background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.pcard-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pcard-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.pcard-meta { font-size: 12px; color: var(--muted); }
.pcard-notes { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.pcard-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; }
.pcard-price { font-size: 16px; font-weight: 700; }
.pcard-foot .btn { margin-left: auto; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; margin-left: auto; }
.qty button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; color: var(--text); font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 13px; }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share .input { flex: 1 1 260px; font-size: 12.5px; color: var(--text-2); }
.photo-pick { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; }
.photo-pick .pcard-img { border-radius: 12px; border: 1px solid var(--line); }

/* CMV */
.cmv-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.cmv-bar i { display: block; height: 100%; }
.cmv-bar .p { background: var(--c2); }
.cmv-bar .k { background: var(--c4); }
.cmv-bar .l { background: var(--pos); }
.cmv-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.cmv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmv-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.kit-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 70px 86px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kit-row:last-child { border-bottom: 0; }
.kit-row .r { text-align: right; }
.extra-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 30px; gap: 8px; margin-top: 8px; }
.verdict { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-top: 14px; }
.verdict b { display: block; font-size: 14px; }
.verdict p { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.verdict.pos { background: var(--pos-soft); } .verdict.pos .i { color: var(--pos); }
.verdict.warn { background: var(--warn-soft); } .verdict.warn .i { color: var(--warn); }
.verdict.neg { background: var(--neg-soft); } .verdict.neg .i { color: var(--neg); }
.verdict.info { background: var(--info-soft); } .verdict.info .i { color: var(--info); }

/* Entregas */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.tl-item.late::before { border-color: var(--neg); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title { font-weight: 700; }
.tl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.k-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; min-height: 160px; }
.k-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; padding: 0 2px 2px; }
.k-head .dot { width: 7px; height: 7px; border-radius: 50%; }
.k-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-top: 8px; }
.k-card .row { justify-content: space-between; }
.k-card .who { font-weight: 700; font-size: 13px; }
.k-card .what { font-size: 12px; color: var(--text-2); margin: 4px 0 6px; }
.k-card .where { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.k-card .where .i { width: 12px; height: 12px; margin-top: 2px; }
.k-actions { display: flex; gap: 6px; margin-top: 9px; }

.supplier-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.supplier-stats div { padding: 8px 10px; border-radius: 9px; background: var(--bg-2); }
.supplier-stats span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.supplier-stats b { font-size: 15px; }

/* Clientes */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.client { cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.client:hover { border-color: var(--line-2); }
.client-head { display: flex; align-items: center; gap: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; color: var(--gold-2); background: var(--surface-3); }
.avatar.lg { width: 54px; height: 54px; font-size: 18px; }
.client-name { font-weight: 700; font-size: 14px; }
.client-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.client-sub .i { width: 12px; height: 12px; }
.client-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.client-stats span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.client-stats b { font-size: 13px; }
.note { font-size: 12.5px; color: var(--text-2); background: var(--bg-2); border-radius: 10px; padding: 9px 11px; }

.rank { display: flex; flex-direction: column; gap: 12px; }
.rank-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rank-pos { font-weight: 700; color: var(--muted); font-size: 12px; text-align: center; }
.rank-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-val { text-align: right; font-weight: 700; font-size: 13px; white-space: nowrap; }
.rank-val small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }

/* Catálogo público */
.pub-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.pub-top-in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.pub-top .brand-sub { white-space: nowrap; }
.pub-hero { max-width: 1180px; margin: 0 auto; padding: 26px 20px 8px; }
.pub-hero h1 { font-family: var(--f-display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.pub-hero p { color: var(--text-2); margin-top: 6px; max-width: 56ch; }
.pub-main { max-width: 1180px; margin: 0 auto; padding: 14px 20px 120px; }
.pub-cart { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; width: min(560px, calc(100% - 24px)); display: none; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); }
.pub-cart.on { display: flex; }
.pub-cart b { font-size: 15px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

/* Catálogo público — detalhe do perfume (tela expandida) */
.pcard.ver { cursor: pointer; transition: border-color .15s, transform .15s; }
.pcard.ver:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pcard .pc-fotos { position: absolute; right: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 600; }
.pcard .pc-fotos .i { width: 12px; height: 12px; }

.pd { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: var(--overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .18s ease both; }
.pd-box { position: relative; width: min(1060px, 100%); height: min(720px, calc(100vh - 48px)); height: min(720px, calc(100dvh - 48px)); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); animation: pop .22s ease both; }
.pd-gal { position: relative; background: #0a0907; display: flex; flex-direction: column; min-height: 0; }
.pd-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; min-height: 0; }
.pd-track::-webkit-scrollbar { display: none; }
.pd-slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #b8862c) 14%, #0e0d0b); }
.pd-slide svg { width: 30%; height: 30%; }
.pd-slide .liq { fill: var(--c, #b8862c); opacity: .85; } .pd-slide .glass { fill: none; stroke: color-mix(in srgb, var(--c, #b8862c) 70%, #fff); stroke-width: .8; } .pd-slide .cap { fill: var(--gold); }
.pd-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pd-dots { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; gap: 6px; z-index: 2; pointer-events: none; }
.pd-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: width .2s, background .2s; }
.pd-dots i.on { width: 20px; border-radius: 4px; background: #fff; }
.pd-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pd-arrow:hover { background: rgba(0, 0, 0, .75); }
.pd-arrow.prev { left: 12px; } .pd-arrow.next { right: 12px; }
.pd-arrow.prev .i { transform: rotate(180deg); }
.pd-thumbs { display: flex; gap: 8px; padding: 10px 12px; background: var(--bg-2); overflow-x: auto; }
.pd-thumbs button { flex: none; }
.pd-thumbs button { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--surface-2); display: grid; place-items: center; }
.pd-thumbs button.on { border-color: var(--gold); }
.pd-thumbs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs svg { width: 50%; height: 50%; }
.pd-close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pd-info { display: flex; flex-direction: column; min-height: 0; }
.pd-scroll { flex: 1; overflow-y: auto; padding: 24px 26px 18px; }
.pd-brand { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.pd-name { font-family: var(--f-display); font-size: 34px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.pd-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pd-text { font-family: var(--f-display); font-style: italic; font-size: 19px; line-height: 1.45; color: var(--text-2); margin-top: 16px; }
.pd-sec { margin-top: 22px; }
.pd-sec-t { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.scale { margin-bottom: 14px; }
.scale-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.scale-top b { color: var(--text); }
.scale-track { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); }
.scale-track .fill { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, transparent, var(--gold-soft) 20%, var(--gold)); }
.scale-track .dot { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid var(--surface); transform: translate(-50%, -50%); box-shadow: 0 0 0 1px var(--gold); }
.pd-when { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pd-when > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.pd-when span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.pd-when b { font-size: 13.5px; }
.pd-when .dots5, .dots5 { display: inline-flex; gap: 3px; margin-right: 7px; vertical-align: middle; }
.dots5 i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.dots5 i.on { background: var(--gold); }
.pd-foot { display: flex; align-items: center; gap: 12px; padding: 14px 26px; border-top: 1px solid var(--line); background: var(--bg-2); }
.pd-price { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.pd-price small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.pd-foot .qty, .pd-foot .btn { margin-left: auto; }
.pd-track { width: 100%; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pd-foot .qty button { width: 38px; height: 40px; font-size: 18px; }
.pd-foot .btn { height: 44px; padding: 0 18px; font-size: 14px; }

/* ---------- 6. Gráficos ---------- */
.chart { position: relative; width: 100%; min-height: 40px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.ax text { fill: var(--muted); font: 500 11px var(--f-ui); }
.ax .grid { stroke: var(--line); stroke-width: 1; }
.ax .grid.zero { stroke: var(--line-2); }
.stop-a { stop-color: var(--gold); stop-opacity: .18; }
.stop-b { stop-color: var(--gold); stop-opacity: 0; }
.c-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-end { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.c-cursor { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.c-dot { fill: var(--surface); stroke: var(--gold); stroke-width: 2; opacity: 0; }
svg:hover .c-cursor, svg:hover .c-dot { opacity: 1; }
.c-pos { fill: var(--pos); }
.c-neg { fill: var(--neg); }
.c-band { fill: var(--text); opacity: .05; }
.hit { fill: transparent; cursor: crosshair; }
.track { stroke: var(--surface-3); }
.dseg.c1 { stroke: var(--c1); } .dseg.c2 { stroke: var(--c2); } .dseg.c3 { stroke: var(--c3); } .dseg.c4 { stroke: var(--c4); }
.dseg { cursor: pointer; }
.d-center { fill: var(--text); font: 700 17px var(--f-ui); }
.d-sub { fill: var(--muted); font: 600 10px var(--f-ui); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- 7. Modal, toast, tooltip ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: var(--overlay); animation: fade .15s ease both; }
.modal-wrap.out { animation: fade .12s ease reverse both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-wrap.out { pointer-events: none; }
.modal { width: min(600px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7); animation: pop .18s ease both; overflow: hidden; }
.modal.lg { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 20px 12px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.modal-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.modal-head .btn-icon { margin-left: auto; }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.modal-error { margin-bottom: 12px; }

#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 11px 14px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 16px 36px -16px rgba(0, 0, 0, .55); font-weight: 600; font-size: 13px; animation: pop .2s ease both; }
.toast .i { color: var(--pos); }
.toast.err .i { color: var(--neg); }

.tip { position: fixed; z-index: 300; pointer-events: none; min-width: 130px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.55; color: var(--text); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .55); transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip .t-date { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.tip .t-row { display: flex; justify-content: space-between; gap: 14px; }
.tip .t-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tip .t-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tip b { font-variant-numeric: tabular-nums; }

/* ---------- 7b. Sessão, estados de envio, extras ---------- */
body.carregando .app, body.carregando .bnav { visibility: hidden; }
body.deslogado .app, body.deslogado .bnav { display: none; }
body.modal-aberto { overflow: hidden; }
.login { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; padding-top: calc(20px + env(safe-area-inset-top)); background: var(--bg); overflow-y: auto; }
.login[hidden] { display: none; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 26px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .7); }
.login-card .brand { padding: 0 0 16px; margin: 0; }
.login-title { font-family: var(--f-display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.login-card .btn-block { height: 46px; font-size: 14px; margin-top: 4px; }
.login-card .hint { text-align: center; }
.foot-user { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 4px; font-size: 13px; font-weight: 600; }
.foot-user small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }

/* Honeypot do catálogo: invisível para gente, visível para robô de formulário. */
.isca { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Botão enviando: trava e mostra um giro no lugar do ícone. */
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--text-2); border-right-color: transparent; animation: gira .7s linear infinite; }
.btn-gold.busy::after { border-color: var(--gold-ink); border-right-color: transparent; }
.btn.busy[disabled] { opacity: .8; }
@keyframes gira { to { transform: rotate(360deg); } }
[data-slot].enviando .slot-img::after { content: "Enviando…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 700; z-index: 2; }
.slot-img { border-radius: 12px; border: 1px solid var(--line); }
.slot-img .badge { z-index: 3; }
.slot-add { cursor: pointer; border-style: dashed; align-content: center; gap: 6px; color: var(--text-2, inherit); font-size: 13px; font-weight: 600; }
.slot-add svg { width: 26px; height: 26px; }
.slot-add:hover { border-color: var(--gold); color: var(--gold); }

.riscado { text-decoration: line-through; color: var(--muted) !important; }
.mais { display: flex; justify-content: center; padding-top: 12px; }
.card.destaque { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--line-2); }
.check-box { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.range { width: 100%; accent-color: var(--gold); height: 24px; }

/* ---------- 8. Responsivo ---------- */
@media (max-width: 1180px) {
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: 100%; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 30px 0 60px -30px rgba(0, 0, 0, .7); z-index: 70; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: var(--overlay); }
  .topbar { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .sidebar { padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toolbar > .chips { max-width: 100%; }
  .balance-actions .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .k-col { min-height: 0; }
  .page-title { font-size: 22px; }
  .page-sub, .hide-md { display: none; }
  .view { padding: 14px 14px calc(var(--bnav) + 30px); }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats.s3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .st:nth-child(odd) { border-left: 0; }
  .stats .st:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stats.s3 .st:last-child { grid-column: 1 / -1; }
  .st { padding: 11px 13px; }
  .st-val { font-size: 17px; }
  .balance-val { font-size: 26px; }
  .balance-actions { margin-left: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .balance-actions .btn { justify-content: center; padding: 0 6px; }
  .table-wrap { margin: 0 -18px; }
  .search { flex: 1 1 100%; }
  #toast-root { left: 14px; right: 14px; bottom: calc(var(--bnav) + 14px); }

  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--bnav) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg-2) 94%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .bnav a, .bnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--muted); text-decoration: none; font: 600 10.5px var(--f-ui); cursor: pointer; padding: 6px 0; }
  .bnav .i { width: 20px; height: 20px; }
  .bnav .on { color: var(--gold); }
  .bnav .plus span.pl { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); margin-top: -6px; }
  .bnav .plus .i { width: 22px; height: 22px; }
  .topbar-actions .btn-label { display: none; }
  .topbar-actions .btn { padding: 0 10px; }
  .topbar-actions .btn-gold { display: none; }
}
@media (max-width: 640px) {
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .item-cols { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 1fr 30px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  .item-row select { grid-column: 1 / -1; }
  .item-row .sub { text-align: left; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.lg { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .modal-foot .spacer { display: none; }
  .balance-actions .btn { font-size: 12px; }
  .slots { gap: 6px; }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard-body { padding: 10px; }
  .pcard-name { font-size: 13px; }
  .pcard-notes { display: none; }
  .pcard-foot { flex-wrap: wrap; }
  .hide-sm { display: none; }
  .photo-pick { grid-template-columns: 1fr; }
  .photo-pick .pcard-img { max-width: 160px; }
  .pub-hero h1 { font-size: 28px; }
  .pub-top-in { padding: 10px 14px; gap: 10px; }
  .pub-top .brand-name { font-size: 12px; letter-spacing: .32em; }
  .pub-top .wa-label { display: none; }
}
@media (max-width: 760px) {
  .pd { padding: 0; place-items: stretch; }
  .pd-box { display: block; width: 100%; height: 100%; border-radius: 0; border: 0; overflow-y: auto; animation: rise .22s ease both; }
  .pd-gal { display: block; }
  .pd-track { aspect-ratio: 1 / 1; }
  .pd-thumbs, .pd-arrow { display: none; }
  .pd-info { display: block; }
  .pd-scroll { overflow: visible; padding: 20px 18px 24px; }
  .pd-name { font-size: 30px; }
  .pd-foot { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .pd-close { position: fixed; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Tela de toque: alvo de no mínimo ~44px e texto de 16px nos campos (o iPhone dá zoom abaixo disso). */
@media (pointer: coarse), (max-width: 920px) {
  .input, .input.sm, select.input, textarea.input { font-size: 16px; }
}
@media (pointer: coarse) {
  .btn { height: 44px; }
  .btn-sm { height: 40px; padding: 0 12px; }
  .btn-icon { width: 44px; }
  .btn-sm.btn-icon { width: 40px; }
  .input { height: 44px; }
  .input.sm { height: 40px; }
  .search .input { height: 44px; }
  .seg button { height: 38px; padding: 0 13px; }
  .seg.full button { height: 42px; }
  .chip { height: 38px; padding: 0 14px; }
  .tabs a, .tabs button { padding: 12px 0 13px; }
  .link { min-height: 40px; }
  .qty button { width: 42px; height: 42px; }
  .check { min-height: 40px; }
  .check input, .check-box { width: 20px; height: 20px; }
  .menu button { padding: 12px 10px; }
  .nav a { padding: 11px 12px; }
  .pd-close { width: 44px; height: 44px; }
  .item-row { grid-template-columns: minmax(0, 1fr) 70px 104px 96px 40px; }
  .item-cols { grid-template-columns: minmax(0, 1fr) 70px 104px 96px 40px; }
  .kit-row { grid-template-columns: 24px minmax(0, 1fr) 80px 80px; }
  .extra-row { grid-template-columns: minmax(0, 1fr) 100px 40px; }
  .lrow { min-height: 52px; }
}
@media (pointer: coarse) and (max-width: 640px) {
  .item-row { grid-template-columns: 1fr 1fr 1fr 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
