/* =====================================================================
   Vendas 3D — sistema visual "mesa de impressão"
   Base fria (cor de mesa PEI), tipografia Bricolage Grotesque + Manrope,
   cores de marca configuráveis por empresa (--brand / --brand-2).
   ===================================================================== */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/assets/fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/assets/fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/assets/fonts/manrope-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/assets/fonts/manrope-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand: #2f6fde; --brand-contrast: #fff; --brand-fill: #2f6fde; --brand-fill-contrast: #fff; --brand-text: #2a62c4; --brand-2: #1f2a2e; --brand-2-contrast: #fff;
  /* mesa de impressão */
  --canvas: #f2f3f0;
  --surface: #ffffff;
  --surface-2: #f7f8f5;
  --surface-3: #eceee9;
  --line: #dcdfd8;
  --line-strong: #c3c8bf;
  --ink: #21272a;
  --ink-2: #3c4547;
  --muted: #5b6460;
  /* estados */
  --success: #0f6e48; --success-bg: #e2f3ea; --success-line: #b9e0cb;
  --danger: #bf3328;  --danger-bg: #fbe8e5;  --danger-line: #f1c2bb;
  --warning: #8a4f00; --warning-bg: #fcf0db; --warning-line: #f0d39f;
  --info: #2457b5;    --info-bg: #e7eefb;    --info-line: #c3d4f3;
  /* forma */
  --r-xl: 20px; --r-lg: 16px; --r: 12px; --r-sm: 10px;
  --shadow-1: 0 1px 0 rgba(33, 39, 42, .03), 0 1px 3px rgba(33, 39, 42, .06);
  --shadow-pop: 0 18px 40px -18px rgba(33, 39, 42, .35), 0 2px 6px rgba(33, 39, 42, .06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 26%, transparent);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;
  --sidebar-w: 256px;
  /* linhas de camada (textura usada só em login, catálogo e proposta) */
  --layers: repeating-linear-gradient(180deg, rgba(255, 255, 255, .055) 0 1px, transparent 1px 7px);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 15px/1.55 var(--font); color: var(--ink); background: var(--canvas); font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5rem; color: var(--ink); font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.95rem; letter-spacing: -.025em; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; margin-top: 1rem; }
p { margin: 0 0 .75rem; }
strong, b { font-weight: 700; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.mt { margin-top: .75rem; }
.mt-lg { margin-top: 20px; }
.mb { margin-bottom: 16px; }
.num, .price, .totals dd, .stat-value, .when-date, .line-total, .pi-total, .split-value { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon-sm { width: .9em; height: .9em; margin-left: auto; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ===== Estrutura da área interna ===== */
.main { padding: 28px 24px 64px; max-width: 1280px; margin: 0 auto; }
body.has-shell .main { margin-left: var(--sidebar-w); max-width: none; padding: 32px 40px 72px; }
@media (min-width: 1560px) { body.has-shell .main { padding-left: calc((100vw - var(--sidebar-w) - 1240px) / 2); padding-right: calc((100vw - var(--sidebar-w) - 1240px) / 2); } }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40; overflow-y: auto;
  display: flex; flex-direction: column; padding: 20px 16px 16px;
  background: var(--brand-2); color: var(--brand-2-contrast);
}
.sidebar a { color: inherit; text-decoration: none; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 18px; font-family: var(--display); font-weight: 650; font-size: 1.08rem; letter-spacing: -.01em; line-height: 1.2; }
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; flex: none; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-fill); color: var(--brand-fill-contrast); font-family: var(--display); font-weight: 750; font-size: 1.15rem; flex: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14); }
.brand-mark--lg { width: 68px; height: 68px; font-size: 1.9rem; border-radius: 18px; }
.sidebar-cta { margin-bottom: 18px; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .94rem; opacity: .78; }
.nav a:hover { opacity: 1; background: color-mix(in srgb, currentColor 8%, transparent); }
.nav a.active { opacity: 1; background: color-mix(in srgb, currentColor 13%, transparent); }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav-title { font-size: .8rem; font-weight: 600; opacity: .55; margin: 22px 12px 6px; }
.sidebar-user { margin-top: auto; padding-top: 14px; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); display: flex; align-items: center; gap: 6px; }
.sidebar-user-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 10px; }
.sidebar-user-link:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.sidebar-user-link span { display: grid; min-width: 0; }
.sidebar-user-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.sidebar-user-link small { opacity: .65; font-size: .76rem; }
.sidebar .icon-btn { color: inherit; }
.company-switch { display: grid; gap: 6px; margin-bottom: 14px; padding: 10px 12px 12px; border-radius: 12px; background: color-mix(in srgb, currentColor 7%, transparent); }
.company-switch label { font-size: .78rem; font-weight: 600; opacity: .65; }
.company-switch select { min-height: 36px; padding: 6px 10px; font-size: .9rem; color: var(--ink); border-color: transparent; }
.topbar { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(20, 24, 26, .5); z-index: 35; }

@media (max-width: 899px) {
  body.has-shell .main { margin-left: 0; padding: 18px 16px 64px; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; height: 58px; padding: 0 10px; background: var(--brand-2); color: var(--brand-2-contrast); }
  .topbar .icon-btn { color: inherit; }
  .topbar-brand { flex: 1; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--display); font-weight: 650; min-width: 0; }
  .topbar-brand span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .topbar-brand img { width: 32px; height: 32px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open { overflow: hidden; }
  h1 { font-size: 1.55rem; }
}

/* ===== Cabeçalho de página ===== */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.page-head p { margin: 6px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.section-title { font-family: var(--display); font-size: 1.05rem; font-weight: 650; color: var(--ink-2); margin: 28px 0 12px; }

/* ===== Superfícies ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-1); }
.card > h2:first-child, .card-head h2 { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.stack { display: grid; gap: 18px; align-content: start; }
.stack-sm { display: grid; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.grid-2:first-child, .stack > .grid-2 { margin-top: 0; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .grid-3-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-2, .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); } .card { padding: 18px; } }

/* ===== Formulários ===== */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child, .field > label, .label-row > label:first-child { font-weight: 650; font-size: .87rem; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-weight: 500; color: var(--ink); width: 100%; min-height: 44px; padding: 10px 13px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9aa29e; }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover, textarea:hover { border-color: #aeb4ab; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); flex: none; margin: 2px 0 0; padding: 0; }
input[type="file"] { padding: 9px; background: var(--surface-2); cursor: pointer; }
input[type="color"] { width: 52px; padding: 3px; height: 44px; cursor: pointer; }
input[type="date"] { font-variant-numeric: tabular-nums; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.hint { color: var(--muted); font-size: .84rem; margin: 0; font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.check-pad { padding-top: 30px; }
.check-inline { font-size: .84rem; font-weight: 650; gap: 7px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 9px; }
.check-inline input { margin: 0; width: 16px; height: 16px; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.input-affix { display: flex; align-items: stretch; }
.input-affix input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-affix > span, .input-affix select {
  display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--muted); font-size: .84rem; font-weight: 600; white-space: nowrap;
}
.input-affix select { width: auto; color: var(--ink); padding-right: 32px; }
.input-affix--pre > span { border-left: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-affix--pre input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-sm { min-height: 36px; padding: 6px 10px; text-align: right; max-width: 130px; }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input code { font-size: .86rem; color: var(--muted); }
.form-narrow { max-width: 760px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--canvas) 40%); z-index: 3; }
.form-danger { margin-top: 18px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: .92rem; margin-bottom: 10px; padding: 0; }
legend small { font-weight: 500; color: var(--muted); }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; background: var(--surface-3); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 7px 15px; border-radius: 9px; font-weight: 650; font-size: .9rem; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(33, 39, 42, .12), 0 0 0 1px var(--line); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.field-error { color: var(--danger); font-weight: 650; font-size: .88rem; margin: 6px 0 0; }
.url-prefix { color: var(--muted); font-size: .85rem; }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  font: inherit; font-weight: 700; font-size: .92rem; letter-spacing: .005em; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  box-shadow: 0 1px 0 rgba(33, 39, 42, .04);
}
.btn:hover { background: var(--surface-2); border-color: #aeb4ab; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--brand-fill); color: var(--brand-fill-contrast); border-color: transparent; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14), 0 1px 2px rgba(33, 39, 42, .12); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand-fill) 86%, #000); color: var(--brand-fill-contrast); border-color: transparent; }
.btn-success { background: var(--success); color: #fff; border-color: transparent; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.btn-success:hover { background: #106845; }
.btn-whatsapp { background: #167a42; color: #fff; border-color: transparent; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.btn-whatsapp:hover { background: #11633a; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); box-shadow: none; }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: .85rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 1.3rem; flex: none; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn--brand { background: var(--brand-fill); color: var(--brand-fill-contrast) !important; }

/* ===== Mensagens e selos ===== */
.alert { padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; border: 1px solid transparent; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.stack > .alert { margin-bottom: 0; }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--r-lg); margin-bottom: 18px; border: 1px solid; }
.callout form { margin: 0; }
.callout .actions form { display: inline; }
.callout-success { background: var(--success-bg); border-color: var(--success-line); }
.callout-danger { background: var(--danger-bg); border-color: var(--danger-line); }
.callout-warning { background: var(--warning-bg); border-color: var(--warning-line); }
.callout-info { background: var(--info-bg); border-color: var(--info-line); }
.callout-link { text-decoration: none; color: inherit; }
.callout-link:hover { text-decoration: none; filter: brightness(.985); }
.notice { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--surface)); padding: 12px 15px; border-radius: var(--r); font-size: .92rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; line-height: 1.45; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-lg { font-size: .84rem; padding: 4px 12px 4px 10px; }
.badge-muted { background: var(--surface-3); color: #535c58; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-brand { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); color: color-mix(in srgb, var(--brand-text) 85%, #000); }
.badge-done { background: #e3e6e1; color: var(--ink-2); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-family: var(--font); font-size: .76rem; font-weight: 750; letter-spacing: 0; }
.count-alert, .tabs .count.count-alert { background: var(--brand-fill); color: var(--brand-fill-contrast); }
.count-danger, .tabs .count.count-danger { background: var(--danger); color: #fff; }

/* ===== Indicadores ===== */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .stats-5 > :first-child { grid-column: 1 / -1; } }
.stat { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: inherit; box-shadow: var(--shadow-1); }
a.stat:hover { border-color: var(--line-strong); text-decoration: none; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 650; color: var(--muted); }
.stat-label::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--info); flex: none; }
.stat--success .stat-label::before { background: var(--success); }
.stat--danger .stat-label::before { background: var(--danger); }
.stat--warning .stat-label::before { background: #d48a12; }
.stat--brand .stat-label::before { background: var(--brand); }
.stat--done .stat-label::before { background: var(--ink-2); }
.stat-value { font-family: var(--display); font-size: 2rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.stat-value--money { font-size: 1.45rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat-sub { font-size: .82rem; color: var(--muted); }
.stat .up { color: var(--success); font-weight: 750; }
.stat .down { color: var(--danger); font-weight: 750; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mini-stats strong { display: block; font-family: var(--display); font-size: 1.1rem; font-weight: 650; }
.mini-stats span { font-size: .76rem; color: var(--muted); }

/* ===== Listas e tabelas ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item > a:not(.btn) { color: inherit; text-decoration: none; min-width: 0; }
.list-item > a:not(.btn):hover strong { color: var(--brand-text); }
.list-item form { margin: 0; }
.list-item--block { display: block; }
.list-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.list-more { display: block; margin-top: 10px; font-weight: 600; }
.user-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.empty { color: var(--muted); padding: 6px 0; margin: 0; }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state p { color: var(--muted); }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; font-weight: 650; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.table a { color: inherit; text-decoration: none; }
.table tfoot td { padding: 13px 18px; font-weight: 750; border-top: 2px solid var(--line); background: var(--surface-2); }
.num { text-align: right; }
.card > .table-wrap { margin: 0 -22px; }
.card.table-wrap { overflow: hidden; }
.table-items td:first-child { width: 60%; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100% !important; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); font-weight: 650; color: var(--muted); font-size: .82rem; text-align: left; }
  .table td:first-child { display: block; text-align: left; }
  .table td:first-child::before { content: none; }
  .card > .table-wrap { margin: 0 -18px; }
  .table tfoot, .table tfoot tr, .table tfoot td { display: block; }
  .table tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 16px; }
  .table tfoot td { padding: 0; border: 0; background: none; }
  .table.table-keep { display: table; }
  .table.table-keep thead { display: table-header-group; }
  .table.table-keep tbody { display: table-row-group; }
  .table.table-keep tfoot { display: table-footer-group; }
  .table.table-keep tr, .table.table-keep tfoot tr { display: table-row; padding: 0; }
  .table.table-keep td, .table.table-keep tfoot td { display: table-cell; width: auto !important; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .9rem; }
  .table.table-keep th { padding: 10px 8px; }
  .table.table-keep td::before { content: none; }
  .table.table-keep tfoot td { background: var(--surface-2); border-top: 2px solid var(--line); }
  .table.table-keep td.num { text-align: right; }
}
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl-stack { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.dl-stack dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
@media (max-width: 480px) { .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .dl dd { margin-bottom: 8px; } }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 13px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px; margin-bottom: 18px; max-width: 480px; color: var(--muted); }
.searchbar input { border: 0; box-shadow: none !important; padding-left: 0; background: transparent; }
.searchbar:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { width: auto; min-width: 130px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 16px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.timeline-date { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); }
.progress { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; margin: 0 0 20px; }
.progress[data-steps="4"] { grid-template-columns: repeat(4, 1fr); }
.progress li { font-size: .8rem; font-weight: 650; color: var(--muted); padding-top: 10px; border-top: 5px solid var(--line); border-radius: 2px; }
.progress li.done { border-top-color: color-mix(in srgb, var(--brand) 45%, var(--surface)); color: var(--ink-2); }
.progress li.current { border-top-color: var(--brand); color: var(--ink); }
@media (max-width: 600px) { .progress span { display: none; } .progress li.current span { display: inline; } .progress, .progress[data-steps="4"] { grid-template-columns: repeat(5, auto); } }
.add-note { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; margin-bottom: 20px; }
@media (max-width: 600px) { .add-note { grid-template-columns: minmax(0, 1fr); } }

/* ===== Painel ===== */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-date { color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.dash-head h1 { font-size: 2.3rem; margin: 0; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 1100px) { .dash-top { grid-template-columns: minmax(0, 1fr); } }
/* pilha de camadas: o andamento dos pedidos como uma peça sendo impressa */
.layer-stack { display: block; width: 100%; height: 76px; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.layer-stack .seg { transform-box: fill-box; transform-origin: left center; animation: layer-print .9s cubic-bezier(.2, .7, .2, 1) both; }
.layer-stack .seg:nth-of-type(2) { animation-delay: .12s; }
.layer-stack .seg:nth-of-type(3) { animation-delay: .24s; }
.layer-stack .seg:nth-of-type(4) { animation-delay: .36s; }
@keyframes layer-print { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.seg-1 { fill: color-mix(in srgb, var(--brand) 22%, var(--surface)); }
.seg-2 { fill: color-mix(in srgb, var(--brand) 45%, var(--surface)); }
.seg-3 { fill: color-mix(in srgb, var(--brand) 72%, var(--surface)); }
.seg-4 { fill: var(--brand); }
.layer-lines line { stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.stack-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.stack-legend a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.stack-legend a:hover { background: var(--surface-2); border-color: var(--line); text-decoration: none; }
.stack-legend .lg-label { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 650; color: var(--muted); }
.stack-legend .lg-label::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.stack-legend li:nth-child(1) .lg-label::before { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent); }
.stack-legend li:nth-child(2) .lg-label::before { background: color-mix(in srgb, var(--brand) 45%, var(--surface)); }
.stack-legend li:nth-child(3) .lg-label::before { background: color-mix(in srgb, var(--brand) 72%, var(--surface)); }
.stack-legend li:nth-child(4) .lg-label::before { background: var(--brand); }
.stack-legend .lg-value { font-family: var(--display); font-size: 1.7rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.stack-empty { display: grid; place-items: center; height: 76px; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--muted); font-weight: 600; }
.stack-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.stack-foot strong { color: var(--ink); }
@media (max-width: 640px) { .stack-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } .layer-stack, .stack-empty { height: 56px; } .dash-head h1 { font-size: 1.8rem; } }
.quote-funnel { list-style: none; margin: 0; padding: 0; display: grid; }
.quote-funnel a { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.quote-funnel li:last-child a { border-bottom: 0; }
.quote-funnel a:hover .qf-label { color: var(--ink); text-decoration: underline; }
.qf-dot { width: 10px; height: 10px; border-radius: 3px; }
.qf-dot.info { background: var(--info); } .qf-dot.success { background: var(--success); } .qf-dot.danger { background: var(--danger); } .qf-dot.warning { background: #d48a12; }
.qf-label { font-weight: 650; color: var(--ink-2); }
.qf-label small { display: block; font-weight: 500; color: var(--muted); }
.qf-value { font-family: var(--display); font-size: 1.45rem; font-weight: 650; letter-spacing: -.02em; }
.onboarding { margin-bottom: 18px; }
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 8px; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.list-item--dated { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; }
.when { display: grid; line-height: 1.25; }
.when-date { font-weight: 750; font-size: .9rem; }
.when-ago { font-size: .78rem; color: var(--muted); font-weight: 600; }
.when-ago.old { color: var(--warning); }
@media (max-width: 560px) {
  .list-item--dated { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .list-item--dated .when { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
}
.catalog-alert { border: 2px solid var(--brand); margin-bottom: 18px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Catálogo (gestão) e produtos ===== */
.share-catalog { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.share-catalog p { margin: 2px 0 0; }
.share-catalog .copy-field { flex: 1; max-width: 540px; min-width: 260px; }
.category-block { margin-bottom: 32px; scroll-margin-top: 70px; }
.category-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.category-head h2 { margin: 0; font-size: 1.3rem; display: flex; gap: 10px; align-items: center; }
.category-head p { margin: 4px 0 0; }
.category-head form { display: flex; gap: 2px; margin: 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-thumb, .catalog-thumb { position: relative; display: block; background: var(--surface-3); }
.product-thumb { aspect-ratio: 4 / 3; }
.product-thumb img, .catalog-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: grid; place-items: center; width: 100%; height: 100%; color: #a9b0ab; }
.thumb-empty .icon { width: 44px; height: 44px; }
.thumb-empty--lg { aspect-ratio: 1; background: var(--surface-3); border-radius: var(--r-lg); }
.thumb-count { position: absolute; right: 10px; bottom: 10px; background: rgba(24, 29, 31, .74); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.product-body { padding: 14px 16px 16px; display: grid; gap: 7px; flex: 1; }
.product-title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.product-title a { color: inherit; text-decoration: none; }
.price { font-weight: 750; }
.price-lg { font-family: var(--display); font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.product-actions { display: flex; gap: 4px; align-items: center; margin-top: auto; padding-top: 6px; }
.product-actions form { margin: 0; }
.image-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.image-list img { aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); width: 100%; }
.image-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 4px; }
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.preview-grid:empty { display: none; }
.preview-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.logo-field { display: flex; gap: 16px; align-items: flex-start; }
.logo-preview { width: 100px; height: 100px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); display: grid; place-items: center; overflow: hidden; flex: none; background: var(--surface-2); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-sample { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.brand-sample-header { background: var(--brand-2); color: var(--brand-2-contrast); padding: 9px 14px; border-radius: 8px; font-family: var(--display); font-weight: 650; font-size: .92rem; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { background: var(--surface-2); font-size: .9rem; color: var(--ink-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches-sm { gap: 4px; }
.swatch { display: inline-flex; line-height: 0; }
.swatch-text { line-height: 1.4; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.swatch-svg { flex: none; }
.swatch-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 650; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px 2px 4px; vertical-align: middle; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.company-card { display: grid; gap: 12px; align-content: start; }
.company-card.inactive { opacity: .62; }
.company-card h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; }
.company-card h2 a { color: inherit; text-decoration: none; }
.company-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.company-actions form { margin: 0; }
.share h2 { display: flex; gap: 8px; align-items: center; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.share-actions form { margin: 0; }

/* ===== Editor de orçamento e calculadora ===== */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.summary { position: sticky; top: 24px; }
@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: sticky; bottom: 0; top: auto; z-index: 5; box-shadow: 0 -10px 30px -10px rgba(33, 39, 42, .25); }
  .summary .totals { grid-template-columns: 1fr auto 1fr auto; font-size: .9rem; }
  .summary .totals .grand { font-size: 1.05rem; }
  .summary h2 { display: none; }
}
@media (max-width: 520px) { .summary .totals { grid-template-columns: 1fr auto; } .summary { padding: 14px; } }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-fill); color: var(--brand-fill-contrast); font-family: var(--font); font-size: .82rem; font-weight: 750; margin-right: 8px; vertical-align: 2px; }
.item { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; background: var(--surface-2); }
.item--project { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 4%, var(--surface-2)); }
.item-head { display: flex; justify-content: space-between; align-items: center; }
.item-head strong { font-family: var(--display); font-weight: 650; font-size: 1.02rem; }
.item input, .item select, .item textarea { background: var(--surface); }
.mode-toggle { display: inline-flex; align-items: center; justify-self: start; }
.mode-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mode-hint { margin-top: -6px; }
.mode-note { margin: 0; }
.item-total { text-align: right; color: var(--muted); }
.line-total { font-family: var(--display); font-weight: 650; font-size: 1.15rem; color: var(--ink); }
.item-total .line-total { display: inline; }
[data-per-unit]:empty { display: none; }
.price-hint:empty { display: none; }
.item-calc .calc-host { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.add-row { display: flex; gap: 8px; }
.extra-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 150px 40px; gap: 8px; align-items: center; }
@media (max-width: 700px) { .extra-row { grid-template-columns: 1fr 1fr; } .extra-row > input:nth-child(2) { grid-column: 1 / -1; order: 3; } }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 9px 0; margin: 0 0 16px; align-items: center; }
.totals dt { color: var(--muted); font-weight: 600; }
.totals dd { margin: 0; padding-left: 12px; text-align: right; font-weight: 650; }
.totals dd .badge { display: flex; width: fit-content; margin: 4px 0 0 auto; }
.totals .grand { font-family: var(--display); font-size: 1.4rem; font-weight: 650; letter-spacing: -.02em; color: var(--ink); padding-top: 10px; border-top: 1px solid var(--line); }
.totals-lg { margin: 18px 0 0; }
.calc { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, 1fr); gap: 22px; }
.calc-inputs { display: grid; gap: 20px; }
.calc-scope { margin: 0; padding: 11px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .88rem; }
.calc-scope--project { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 28%, var(--surface)); }
.calc-result { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; align-content: start; position: sticky; top: 16px; }
.calc-result h3 { margin: 0; }
.calc-host, #calculator { container-type: inline-size; }
@container (max-width: 760px) { .calc { grid-template-columns: minmax(0, 1fr); } .calc-result { position: static; } }
@container (max-width: 980px) { .calc .extra-row { grid-template-columns: minmax(0, 1fr) 130px 40px; } .calc .extra-row > input:nth-child(2) { grid-column: 1 / -1; order: 3; } }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } .calc-result { position: static; } }
.breakdown { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.breakdown td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.breakdown td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; font-weight: 650; }
.breakdown .total td { font-weight: 750; border-bottom-style: solid; }
.breakdown .grand td { font-family: var(--display); font-weight: 650; font-size: 1.25rem; color: var(--brand-text); border-bottom: 0; padding-top: 12px; }
.breakdown-details { margin-top: 8px; }
.breakdown-details summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 600; }
.breakdown-details .breakdown { margin-top: 6px; max-width: 440px; }
.calc-footer { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.calc-footer .field input { width: 100px; }
.calc-total { flex: 1; font-size: 1.05rem; padding-bottom: 8px; }
.calc-total strong { font-family: var(--display); font-size: 1.35rem; font-weight: 650; }
details > summary { cursor: pointer; }

/* ===== Gráfico (Financeiro) ===== */
.chart-scroll { overflow-x: auto; margin: 0 -4px; }
.chart { width: 100%; min-width: 620px; height: auto; display: block; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-weight: 600; }
.chart .axis-strong { fill: var(--ink); font-weight: 800; }
.chart .value-label { fill: var(--ink); font-size: 12px; font-weight: 800; }
.chart .bar { fill: var(--brand); }
.chart .hit { fill: transparent; }
.chart .bar-link:hover .hit, .chart .bar-link:focus .hit, .chart .bar-link.active .hit { fill: color-mix(in srgb, var(--brand) 8%, transparent); }
.chart .bar-link.dim .bar { opacity: .32; }
.chart .bar-link:focus { outline: none; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; font-size: .82rem; font-weight: 600; padding: 7px 11px; border-radius: 8px; max-width: 280px; box-shadow: var(--shadow-pop); }
.card-danger { border: 2px solid var(--danger-line); }

/* ===== Login ===== */
body.bare .main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; max-width: none;
  background: var(--layers), var(--brand-2); }
.auth { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 22px; display: grid; justify-items: center; gap: 6px; color: var(--brand-2-contrast); }
.auth-brand img { max-height: 76px; max-width: 220px; object-fit: contain; margin-bottom: 4px; background: #fff; border-radius: 14px; padding: 6px; }
.auth-brand h1 { margin: 8px 0 0; font-size: 1.6rem; color: inherit; }
.auth-brand .muted { color: inherit; opacity: .7; }
.auth .card { padding: 26px; box-shadow: var(--shadow-pop); border: 0; }
body.bare .center-card { background: var(--surface); }
.center-card { max-width: 480px; margin: 40px auto; text-align: center; }

/* ===== Páginas públicas (catálogo, carrinho, proposta) ===== */
body.public { background: var(--surface); display: flex; flex-direction: column; min-height: 100vh; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.public-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.public-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.public-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.public-brand img { max-height: 48px; max-width: 170px; object-fit: contain; }
.public-brand span { display: grid; }
.public-brand strong { font-family: var(--display); font-weight: 650; font-size: 1.08rem; }
.public-brand small { color: var(--muted); }
.public-main { flex: 1; padding-bottom: 56px; }
.public-main .back { margin-top: 20px; }
.hero { background: var(--layers), var(--brand-2); color: var(--brand-2-contrast); padding: 56px 0 48px; margin-bottom: 30px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); color: inherit; letter-spacing: -.035em; margin-bottom: 10px; }
.hero p { opacity: .82; max-width: 620px; font-size: 1.05rem; }
.searchbar--hero { margin: 22px 0 0; border-color: transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; margin-bottom: 8px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 17px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--ink); font-weight: 650; font-size: .9rem; background: var(--surface); }
.chip:hover { border-color: var(--ink-2); text-decoration: none; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.catalog-section { margin: 14px 0 44px; }
.catalog-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.catalog-section-head h2 { font-size: 1.55rem; margin: 0 0 8px; letter-spacing: -.025em; }
.catalog-section > .muted { margin-top: -4px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
@media (max-width: 520px) { .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.catalog-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.catalog-card:hover { text-decoration: none; }
.catalog-card:hover .catalog-thumb { box-shadow: inset 0 0 0 2px var(--ink); }
.catalog-thumb { aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; }
.catalog-body { display: grid; gap: 4px; padding: 12px 2px 6px; }
.catalog-body strong { font-size: 1rem; }
.catalog-body .price { color: var(--ink); font-size: 1.02rem; }
.catalog-cta { margin-top: 4px; font-size: .86rem; font-weight: 750; color: var(--brand-text); }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding: 24px 26px; border-radius: var(--r-xl); background: var(--canvas); border: 1px solid var(--line); }
.cta-band p { margin: 4px 0 0; color: var(--muted); max-width: 640px; }
.breadcrumb { font-size: .88rem; font-weight: 600; color: var(--muted); margin: 22px 0 8px; }
.breadcrumb a { color: var(--muted); }
.product-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; margin-top: 12px; }
@media (max-width: 820px) { .product-page { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
.product-info h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 6px; letter-spacing: -.03em; }
.carousel { position: relative; min-width: 0; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: var(--r-xl); background: var(--surface-3); scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn { position: absolute; top: calc(50% - 46px); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-pop); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); display: grid; place-items: center; padding-bottom: 3px; }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-btn:disabled { opacity: 0; pointer-events: none; }
.carousel-dots { display: none; justify-content: center; gap: 8px; margin-top: 12px; }
.carousel-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; }
.carousel-dots button.active { background: var(--ink); width: 24px; border-radius: 999px; }
.carousel-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.carousel-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; width: 72px; height: 72px; cursor: pointer; background: none; }
.carousel-thumbs button.active { border-color: var(--ink); }
.carousel-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 820px) { .carousel-thumbs { display: none; } .carousel-dots { display: flex; } .carousel-btn { top: calc(50% - 32px); } }
.buy-box { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface-2); }
.buy-box .stepper { justify-self: start; }
.buy-box .field { justify-items: start; }
.buy-row { grid-template-columns: auto; }
.color-options { display: flex; flex-wrap: wrap; gap: 8px; }
.color-option { position: relative; cursor: pointer; }
.color-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; inset: 0; cursor: pointer; }
.color-option-body { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 650; font-size: .9rem; }
.color-option:hover .color-option-body { border-color: var(--line-strong); }
.color-option input:checked + .color-option-body { border-color: var(--ink); }
.color-option input:focus-visible + .color-option-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.stepper button { width: 44px; border: 0; background: var(--surface-2); font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--surface-3); }
.stepper input { width: 58px; border: 0; border-radius: 0; text-align: center; min-height: 44px; box-shadow: none !important; font-weight: 700; }
.stepper-sm button { width: 34px; }
.stepper-sm input { width: 46px; min-height: 36px; padding: 4px; }
.cart-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 10px 8px 15px; background: var(--surface); }
.cart-link:hover { border-color: var(--ink); text-decoration: none; }
.cart-count { min-width: 24px; height: 24px; border-radius: 999px; background: var(--surface-3); color: var(--muted); display: inline-grid; place-items: center; font-size: .78rem; font-weight: 800; padding: 0 7px; }
.cart-count.has-items { background: var(--brand-fill); color: var(--brand-fill-contrast); }
@media (max-width: 480px) { .cart-link-text { display: none; } .cart-link { padding: 8px 10px; } .public-brand small { display: none; } }
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; background: #167a42; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-pop); }
.wa-float .icon { width: 28px; height: 28px; }
.wa-float:hover { background: #167a42; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px; box-shadow: var(--shadow-pop); font-weight: 650; max-width: calc(100vw - 32px); }
.toast a { color: #fff; text-decoration: underline; margin-left: 4px; white-space: nowrap; }
.cart-page h1 { margin: 0 0 18px; font-size: 2.1rem; letter-spacing: -.03em; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: minmax(0, 1fr); } }
.cart-item { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-item:last-child { border-bottom: 0; }
.cart-thumb { width: 80px; height: 80px; border-radius: 12px; overflow: hidden; background: var(--surface-3); display: block; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: grid; gap: 5px; justify-items: start; }
.cart-name { font-weight: 750; color: var(--ink); text-decoration: none; }
.cart-side { display: grid; gap: 6px; justify-items: end; }
.cart-line { font-weight: 750; }
@media (max-width: 520px) { .cart-item { grid-template-columns: 64px minmax(0, 1fr); } .cart-thumb { width: 64px; height: 64px; } .cart-side { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; justify-items: stretch; } .cart-line { text-align: right; } }
.cart-empty { text-align: center; padding: 34px 0; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.sent-card { display: grid; justify-items: center; gap: 8px; margin-top: 48px; padding: 36px 24px; }
.sent-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; }
.sent-icon .icon { width: 36px; height: 36px; }
.center-actions { justify-content: center; }
.public-footer { background: var(--brand-2); color: var(--brand-2-contrast); padding: 30px 0; font-size: .9rem; }
.public-footer strong { font-family: var(--display); font-weight: 650; font-size: 1.05rem; }
.public-footer a { color: inherit; }
.contact-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; opacity: .85; }

/* proposta */
.proposal { padding-top: 0; display: grid; gap: 18px; }
.proposal .alert { margin: 0; }
.proposal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 0 -20px; padding: 40px 20px 28px; background: var(--layers), var(--brand-2); color: var(--brand-2-contrast); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.proposal-head h1 { margin: 0 0 6px; color: inherit; font-size: clamp(1.8rem, 4.5vw, 2.5rem); letter-spacing: -.03em; }
.proposal-head p { margin: 0; }
.proposal-head .muted { color: inherit; opacity: .72; }
.eyebrow { font-weight: 700; font-size: .9rem; opacity: .8; margin-bottom: 4px !important; }
.proposal-status .badge { background: rgba(255, 255, 255, .94); }
.client-name { font-family: var(--display); font-size: 1.3rem; font-weight: 650; margin: 0; }
.proposal-items { list-style: none; padding: 0; margin: 0; }
.proposal-items li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pi-main { display: grid; gap: 3px; min-width: 0; }
.pi-total { font-weight: 750; white-space: nowrap; }
.payment-box .split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.payment-box .split > div { display: grid; gap: 2px; padding: 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.payment-box .split > div:first-child { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 26%, var(--surface)); }
.split-label { font-size: .86rem; font-weight: 650; color: var(--muted); }
.split-value { font-family: var(--display); font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; }
@media (max-width: 480px) { .payment-box .split { grid-template-columns: minmax(0, 1fr); } }
.respond { border: 2px solid var(--ink); }
.reject { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.reject summary { color: var(--muted); font-size: .9rem; font-weight: 600; }
.proposal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

@media print {
  .no-print, .public-header, .public-footer, .respond, .topbar, .sidebar, .alert, .wa-float { display: none !important; }
  body.public { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Ajustes finos ===== */
.stack-legend a { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.card-head > a { white-space: nowrap; }
.card-head { flex-wrap: wrap; }
.card .btn-block.btn-ghost, .card .btn-block.btn-danger-ghost { justify-content: flex-start; }
.proposal-for { margin: 14px 0 0; font-size: 1.05rem; }
.proposal-for strong { font-family: var(--display); font-weight: 650; font-size: 1.25rem; }

/* ===== Pix e Instagram na proposta ===== */
.pix-box { display: grid; gap: 14px; border: 2px solid color-mix(in srgb, var(--brand) 35%, var(--line)); }
.pix-head { display: flex; gap: 14px; align-items: flex-start; }
.pix-head h2 { margin: 0 0 2px; }
.pix-head p { margin: 0; }
.pix-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-text); flex: none; }
.pix-icon .icon { width: 24px; height: 24px; }
.pix-key { display: grid; gap: 6px; }
.pix-key input { font-size: 1.02rem; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.pix-dl { margin: 0; }
.pix-box > p { margin: 0; }
@media (max-width: 480px) { .pix-key .copy-field { flex-direction: column; } }
.insta-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; background: var(--surface); }
.insta-card:hover { border-color: var(--line-strong); text-decoration: none; }
.insta-card > span:nth-child(2) { display: grid; }
.insta-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.insta-icon .icon { width: 24px; height: 24px; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; margin-bottom: 18px; }
.list-toolbar .searchbar { margin-bottom: 0; flex: 1 1 320px; }
.period-summary { margin: 0; color: var(--muted); }
.period-summary strong { color: var(--ink); }
.editor-layout > *, .grid-3-1 > *, .dash-top > * { min-width: 0; }
.stack, .stack-sm { grid-template-columns: minmax(0, 1fr); }
.table td:first-child strong { white-space: nowrap; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 700; font-size: .86rem; margin-right: 12px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
.center-card { margin-top: 12vh; }
/* Editor no celular: resumo no fim do formulário + barra fina fixa com total e botão principal */
.mobile-savebar { display: none; }
@media (max-width: 760px) {
  .summary { position: static; box-shadow: var(--shadow-1); }
  .summary h2 { display: block; }
  .summary .totals { grid-template-columns: 1fr auto; }
  .mobile-savebar { display: flex; position: sticky; bottom: 0; z-index: 6; margin: 18px -16px -64px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(33, 39, 42, .3); }
  .mobile-savebar > div { display: grid; line-height: 1.2; }
  .mobile-savebar strong { font-family: var(--display); font-size: 1.25rem; font-weight: 650; }
}

/* ===== Cadastro de clientes (PF/PJ) ===== */
.person-type { justify-self: start; }
.address-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.address-grid .f-cep { grid-column: span 2; }
.address-grid .f-street { grid-column: span 3; }
.address-grid .f-number { grid-column: span 1; }
.address-grid .f-compl, .address-grid .f-district { grid-column: span 3; }
.address-grid .f-city { grid-column: span 5; }
.address-grid .f-uf { grid-column: span 1; }
@media (max-width: 640px) {
  .address-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .address-grid .f-cep { grid-column: span 2; }
  .address-grid .f-street, .address-grid .f-compl, .address-grid .f-district { grid-column: 1 / -1; }
  .address-grid .f-number { grid-column: span 2; }
  .address-grid .f-city { grid-column: span 3; }
  .address-grid .f-uf { grid-column: span 1; }
}
[data-client-form][data-type="pf"] [data-for="pj"], [data-client-form][data-type="pf"] [data-label-pj],
[data-client-form][data-type="pj"] [data-label-pf] { display: none; }
.nf-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid; }
.nf-status.ok { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.nf-status.missing { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.nf-status p { margin: 2px 0 0; color: var(--ink-2); }
.nf-text { white-space: pre-line; font-size: .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 0; }
.client-type { font-size: .76rem; }
.nf-text { field-sizing: content; resize: none; min-height: 0; width: 100%; font: inherit; font-size: .88rem; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 640px) {
  .person-type { display: grid; grid-template-columns: 1fr 1fr; justify-self: stretch; }
  .person-type span { text-align: center; padding: 8px 6px; height: 100%; display: grid; place-items: center; line-height: 1.25; }
}
