/* OrçaFala — identidade própria: limpa, mobile-first.
   Verde-petróleo como cor de marca, superfícies claras, sem ruído. */

:root {
  --brand: #0b5c4d;
  --brand-dark: #084438;
  --brand-soft: #e3f0ed;
  --accent: #d97a2b;
  --bg: #f6f7f6;
  --surface: #ffffff;
  --text: #1c2422;
  --text-dim: #5c6a66;
  --rule: #e2e7e5;
  --danger: #b3382c;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(28, 36, 34, .08), 0 4px 14px rgba(28, 36, 34, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
/* Trava o deslize lateral no celular: nada pode alargar a página. */
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
}

.view { max-width: 560px; margin: 0 auto; padding: 16px 16px 110px; overflow-x: hidden; }
.view * { min-width: 0; }
img, svg, video { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- marca ---------- */
.brand { text-align: center; padding: 40px 0 24px; }
.brand h1 { font-size: 28px; letter-spacing: -0.5px; color: var(--brand-dark); }
.tagline { color: var(--text-dim); margin-top: 4px; font-size: 15px; }
.brand-mark {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: var(--brand); color: #fff;
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
}
.brand-mark.small { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; margin: 0; }

/* ---------- auth ---------- */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 0 16px 40px; }
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 12px;
}
.card-title { font-size: 16px; margin-bottom: 10px; color: var(--brand-dark); }
.seg {
  display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 18px;
}
.seg-btn {
  flex: 1; border: 0; background: transparent; padding: 10px;
  border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--text-dim);
  cursor: pointer;
}
.seg-btn.active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow); }

/* ---------- campos ---------- */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], textarea {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface);
  color: var(--text); outline: none; font-family: inherit;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; }
/* campo de senha com botão "mostrar/ocultar" (olhinho) */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 4px; top: 0; bottom: 0; margin: auto 0; height: 40px; width: 42px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--text-dim); cursor: pointer; padding: 0;
}
.pw-toggle:active { color: var(--brand); }
.color-input {
  width: 100%; height: 46px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface); padding: 4px; cursor: pointer;
}
.block-input { width: 100%; margin-bottom: 10px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 13px 18px;
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: filter .12s ease;
}
.btn:active { filter: brightness(.92); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:disabled { background: #9db8b2; cursor: default; }
.btn.secondary { background: var(--brand-soft); color: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.danger { background: #fbeae8; color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.listening { background: #d03b3b; color: #fff; animation: pulseRec 1.1s ease-in-out infinite; }
@keyframes pulseRec { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }

/* fotos do cliente (documento + rosto) */
.cm-photos { display: flex; gap: 12px; margin: 12px 0 4px; }
.cm-photo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cm-photo-label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.cm-photo-box {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid var(--rule);
  background: var(--brand-soft); display: flex; align-items: center; justify-content: center;
  font-size: 30px; overflow: hidden;
}
.cm-photo-box img { width: 100%; height: 100%; object-fit: cover; }

/* checkboxes de acesso da equipe */
.perm-grid { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.perm { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--brand-soft); cursor: pointer; font-size: 15px; }
.perm input { width: 18px; height: 18px; accent-color: var(--brand); }
.seat-pill { font-size: 12px; color: var(--text-dim); }

/* cards de plano (assinar) */
.plan-card { position: relative; border: 1px solid var(--rule); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--surface); }
.plan-card.destaque { border: 2px solid var(--brand); }
.plan-tag { position: absolute; top: -10px; left: 14px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.plan-name { font-weight: 700; font-size: 16px; }
.plan-price { font-weight: 800; font-size: 20px; color: var(--brand-dark); white-space: nowrap; }
.plan-price small { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.plan-inc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }
/* formas de pagar — 3 botões sempre visíveis, cada um com título + subtexto */
.pay-opts { display: flex; flex-direction: column; gap: 8px; }
.pay-opt { flex-direction: column; align-items: stretch; text-align: center; gap: 2px; padding: 11px 14px; line-height: 1.25; height: auto; }
.pay-main { font-size: 15px; font-weight: 700; }
.pay-sub { font-size: 12px; font-weight: 500; opacity: .82; }
.btn.ghost.pay-opt { border: 1px solid var(--rule); color: var(--brand-dark); }

/* card compacto "Meu plano" nos Ajustes */
.plano-mini-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

/* tela dedicada Meu plano */
.plano-status { display: flex; flex-direction: column; gap: 3px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff;
  border-radius: 14px; padding: 16px 18px; }
.plano-status.danger { background: linear-gradient(135deg, #8a2b22, #b23b2e); }
.plano-status .ps-lbl { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .8; font-weight: 700; }
.plano-status strong { font-size: 22px; }
.plano-status .ps-sub { font-size: 13.5px; opacity: .95; margin-top: 4px; line-height: 1.4; }
.plan-pick { position: relative; border: 1px solid var(--rule); border-radius: 14px;
  padding: 14px; margin-bottom: 12px; background: var(--surface); }
.plan-pick.destaque { border: 2px solid var(--brand); }
.pp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pp-name { font-weight: 700; font-size: 17px; }
.pp-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.pp-price { font-weight: 800; font-size: 21px; color: var(--brand-dark); white-space: nowrap; }
.pp-price small { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.plan-pick .pay-opts { margin-top: 10px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--rule);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-brand strong {
  font-size: 15px; line-height: 1.2; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw;
}
.topbar-brand #top-logo { flex-shrink: 0; overflow: hidden; background: var(--brand); }
.topbar-brand #top-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.app-tag { color: var(--text-dim); font-size: 11px; font-weight: 600; letter-spacing: .02em; opacity: .7; }

/* ---------- abas ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--surface); border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: 0; background: transparent; padding: 8px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--text-dim); cursor: pointer;
  font-family: inherit;
}
.tab.active { color: var(--brand); }

/* ---------- páginas ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; }
.page-head h2 { font-size: 22px; letter-spacing: -0.3px; }
.back { margin-left: -8px; }
.pill {
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.pill-danger { background: #fbeae8; color: var(--danger); }

/* ---------- Controle Total (superadmin) ---------- */
.admin-badge {
  background: #c99a2e; color: #3a2b06; font-weight: 800; letter-spacing: .4px;
  border: 1px solid #e6c15c;
}
.admin-badge:active { filter: brightness(.95); }
.admin-hero {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.admin-hero h2 { font-size: 22px; margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-hero .app-tag { background: rgba(255,255,255,.18); color: #fff; opacity: 1; padding: 3px 10px; border-radius: 999px; letter-spacing: .5px; }
.admin-hero .btn.ghost { color: #fff; background: rgba(255,255,255,.14); }
.kpi.kpi-hero { grid-column: 1 / -1; background: var(--brand); }
.kpi.kpi-hero .kpi-label { color: rgba(255,255,255,.8); }
.kpi.kpi-hero strong { color: #fff; font-size: 30px; }
.kpi.kpi-hero .kpi-sub { color: rgba(255,255,255,.75); }
.hint { color: var(--text-dim); font-size: 14px; margin-bottom: 14px; }
.hint.center { text-align: center; }
.section-label { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  font-weight: 700; color: var(--text-dim); margin: 22px 4px 8px; }
.section-label:first-of-type { margin-top: 4px; }
.lgpd-note { font-size: 12.5px; color: var(--text-dim); background: var(--brand-soft);
  border-radius: 10px; padding: 9px 12px; margin: 10px 0 4px; line-height: 1.45; }
.error { color: var(--danger); font-size: 14px; margin: 10px 0; }

/* ---------- captura por voz ---------- */
.capture { text-align: center; padding: 24px 18px; }
.mic {
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; margin: 6px auto 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(11, 92, 77, .35);
  transition: transform .12s ease, background .2s ease;
}
.mic:active { transform: scale(.94); }
.mic.rec {
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
  box-shadow: 0 6px 18px rgba(179, 56, 44, .4);
}
.mic.mini {
  width: 46px; height: 46px; margin: 0; box-shadow: none; flex-shrink: 0;
}
.mic .rec-bars { display: none; }
.mic.rec .mic-icon { display: none; }
.mic.rec .rec-bars { display: flex; gap: 4px; align-items: flex-end; height: 26px; }
.mic.rec .rec-bars i {
  width: 5px; background: #fff; border-radius: 3px;
  animation: recbar .9s ease-in-out infinite;
}
.mic.rec .rec-bars i:nth-child(1) { height: 10px; animation-delay: 0s; }
.mic.rec .rec-bars i:nth-child(2) { height: 22px; animation-delay: .14s; }
.mic.rec .rec-bars i:nth-child(3) { height: 14px; animation-delay: .28s; }
.mic.rec .rec-bars i:nth-child(4) { height: 24px; animation-delay: .42s; }
.mic.rec .rec-bars i:nth-child(5) { height: 11px; animation-delay: .56s; }
@keyframes recbar {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1.1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.typed-row { display: flex; gap: 8px; align-items: center; }
.typed-row input { flex: 1; }

/* ---------- orçamento editor ---------- */
.orc-item {
  display: flex; gap: 10px; background: var(--surface); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); align-items: flex-start;
}
.orc-item .thumb {
  width: 46px; height: 46px; border-radius: 8px; background: var(--brand-soft);
  color: var(--brand-dark); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex-shrink: 0; overflow: hidden;
}
.orc-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.orc-item .body { flex: 1; min-width: 0; }
.orc-item input.i-name { font-size: 15px; font-weight: 600; padding: 8px 10px; margin-bottom: 6px; }
.orc-item .i-row { display: flex; gap: 6px; align-items: center; }
.orc-item .i-row input { padding: 8px 10px; font-size: 15px; }
.orc-item input.i-qty { width: 62px; text-align: center; }
.orc-item input.i-value { flex: 1; text-align: right; }
.orc-item .i-line { font-size: 13px; color: var(--text-dim); margin-top: 5px; text-align: right; }
.orc-item .i-line strong { color: var(--brand-dark); }
.orc-item .locked-badge {
  font-size: 10px; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft);
  border-radius: 999px; padding: 2px 8px; letter-spacing: .3px;
}
.orc-item .review-badge {
  font-size: 10px; font-weight: 700; color: #8a5a00; background: #fdefcf;
  border-radius: 999px; padding: 2px 8px; letter-spacing: .3px;
}
.orc-item.needs-review { box-shadow: 0 0 0 2px #f0c65a, var(--shadow); }
.orc-item .i-remove {
  border: 0; background: transparent; color: var(--text-dim);
  font-size: 20px; cursor: pointer; padding: 6px; line-height: 1; flex-shrink: 0;
}
.orc-item .i-remove:active { color: var(--danger); }
.orc-head-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.totals-card { margin-top: 12px; }
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 17px; padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.total-row strong { font-size: 22px; color: var(--brand-dark); }
.voice-edit { margin-top: 12px; }
.actions-row { margin-top: 14px; }
.actions-row .btn { flex: 1; }

/* ---------- logo / foto ---------- */
.logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.logo-preview {
  width: 86px; height: 86px; border-radius: 10px; border: 1px dashed var(--rule);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: var(--text-dim); font-size: 12px; background: var(--bg); text-align: center;
  flex-shrink: 0;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- estado vazio ---------- */
.empty {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 20px; text-align: center; margin-top: 24px;
}
.empty h3 { font-size: 19px; margin-bottom: 8px; color: var(--brand-dark); }
.empty p { color: var(--text-dim); font-size: 15px; margin-bottom: 20px; }

/* ---------- importar ---------- */
.dropzone {
  display: block; text-align: center; padding: 28px 16px;
  background: var(--surface); border: 2px dashed var(--brand);
  border-radius: var(--radius); cursor: pointer; margin-bottom: 4px;
}
.dropzone strong { display: block; color: var(--brand-dark); font-size: 17px; margin-bottom: 4px; }
.dropzone span { color: var(--text-dim); font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-dim); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.loading { text-align: center; padding: 48px 20px; }
.loading h3 { margin: 18px 0 8px; }
.loading p { color: var(--text-dim); font-size: 15px; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto;
  border: 4px solid var(--brand-soft); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.import-progress { max-width: 320px; margin: 18px auto 0; }
.ip-track { height: 12px; border-radius: 7px; background: var(--brand-soft); overflow: hidden; }
/* a barra enche por transform (scaleX), não por width — animação leve */
.ip-track > i { display: block; height: 100%; width: 100%; border-radius: 7px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform .4s ease; }
.import-progress .hint { margin-top: 8px; font-weight: 600; color: var(--brand-dark); }
/* barra animada enquanto a IA lê (antes de saber as partes) — usa transform
   (não width/margin) pra não travar a animação */
.import-progress.indet .ip-track > i { width: 38%; transition: none; transform: none;
  animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }

/* ---------- listas ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.toolbar .search { flex: 1; }
.list { display: flex; flex-direction: column; gap: 8px; }
.cat-head {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-dim); margin: 14px 2px 2px;
}
.item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer;
}
.item .thumb {
  width: 42px; height: 42px; border-radius: 8px; background: var(--brand-soft);
  color: var(--brand-dark); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0; overflow: hidden;
}
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .price { font-weight: 700; color: var(--brand-dark); white-space: nowrap; font-size: 15px; }
.picker-list { max-height: 50dvh; overflow-y: auto; }

/* ---------- conferência ---------- */
.review-item {
  background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.review-item .r-top { display: flex; gap: 8px; align-items: flex-start; }
.review-item .r-thumb {
  width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
  flex-shrink: 0; background: var(--bg); border: 1px solid var(--rule);
}
.review-item .r-thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-item input.r-name { flex: 1; font-size: 15px; font-weight: 600; }
.review-item .r-bottom { display: flex; gap: 8px; margin-top: 8px; }
.review-item input.r-price { width: 120px; }
.review-item input.r-cat { flex: 1; }
.review-item .r-remove {
  border: 0; background: transparent; color: var(--text-dim);
  font-size: 20px; cursor: pointer; padding: 8px; line-height: 1; margin: -4px -6px 0 0;
}
.review-item .r-remove:active { color: var(--danger); }

.savebar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  background: var(--surface); border-top: 1px solid var(--rule);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.savebar .btn, .savebar .check, .savebar .error { max-width: 528px; margin-left: auto; margin-right: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); margin-bottom: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 36, 34, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; }
.row2 { display: flex; gap: 10px; }
.row2 .field { flex: 1; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.flex1 { flex: 1; }

@media (min-width: 700px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 16px; }
}

/* ---------- painel do gestor ---------- */
.kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.kpi {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.kpi strong { font-size: 22px; letter-spacing: -0.5px; color: var(--brand-dark);
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub { font-size: 12px; color: var(--text-dim); }

.card-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-head-row .card-title { margin-bottom: 0; }

.chart-wrap svg { display: block; width: 100%; height: auto; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.legend-item .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-item .lbl { flex: 1; }
.legend-item .val { font-weight: 700; color: var(--text); }

.vend-row { margin-bottom: 10px; }
.vend-row .vr-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; gap: 8px; }
.vend-row .vr-top .vr-meta { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.vend-row .vr-bar { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.vend-row .vr-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }

/* funil do mês (enviado → visto → aprovado) */
.funil-row { margin-bottom: 12px; }
.funil-row:last-child { margin-bottom: 0; }
.funil-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.funil-top .funil-n { font-weight: 700; color: var(--brand-dark); }
.funil-bar { height: 14px; border-radius: 7px; background: var(--bg); overflow: hidden; }
.funil-bar > i { display: block; height: 100%; border-radius: 7px;
  transform-origin: left; animation: growX .45s ease; }
@keyframes growX { from { transform: scaleX(0); } }

/* alerta de orçamentos quentes / retornos vencidos no topo do painel */
.alerta-quentes {
  background: #fdefcf; color: #6b4e12; border: 1px solid #f0d896;
  border-radius: 12px; padding: 11px 14px; margin-bottom: 12px;
  font-size: 14px; line-height: 1.45;
}

.orc-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 10px; padding: 10px 12px;
}
.orc-row .info { flex: 1; min-width: 0; }
.orc-row .info .name { font-weight: 600; font-size: 14px; }
.orc-row .info .meta { font-size: 12px; color: var(--text-dim); }
.orc-row .val { font-weight: 700; font-size: 14px; white-space: nowrap; }
.orc-row select {
  border: 1px solid var(--rule); border-radius: 8px; padding: 6px 8px;
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text);
}

/* checklist do onboard fiscal (card Nota fiscal em Ajustes) */
.nfsteps { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.nfstep {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 10px; padding: 8px 10px;
}
.nfstep .nfs-n {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--rule); color: var(--text-dim); font-size: 13px; font-weight: 800;
}
.nfstep.ok .nfs-n { background: var(--brand); color: #fff; }
.nfstep .nfs-t { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.nfstep .nfs-t small { display: block; font-weight: 400; color: var(--text-dim); font-size: 12px; }
.nfstep.ok .nfs-t { color: var(--brand-dark); }

/* miniatura do item clicável: toca pra adicionar/trocar a FOTO do item */
.orc-item .thumb-btn { position: relative; cursor: pointer; }
.orc-item .thumb-btn:hover, .orc-item .thumb-btn:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.orc-item .thumb-btn .cam {
  position: absolute; bottom: -5px; right: -5px; font-size: 13px;
  background: var(--surface); border-radius: 99px; padding: 1px 2px;
  box-shadow: 0 1px 4px rgba(28, 36, 34, .25); line-height: 1;
}

/* prévia AO VIVO: itens montando embaixo do microfone enquanto fala */
#live-preview {
  background: var(--brand-soft); border-radius: 14px;
  padding: 12px 14px; margin: 10px 0 4px; text-align: left;
}
.lp-head {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand-dark); margin-bottom: 6px;
}
.lp-item {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(11, 92, 77, 0.12);
  font-size: 14px; animation: pop .35s ease;
}
.lp-item small { color: var(--text-dim); }
.lp-item b { white-space: nowrap; }
.lp-total {
  display: flex; justify-content: space-between; padding-top: 8px;
  font-size: 15px; font-weight: 800; color: var(--brand-dark);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* guia do primeiro orçamento: destaca a dica e chama pro microfone */
#capture-hint.guia {
  background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 12px; padding: 12px 14px; font-size: 15px;
}
.mic.chama { animation: chamaPulse 1.6s ease-in-out infinite; }
@keyframes chamaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 92, 77, 0.35); }
  50%      { box-shadow: 0 0 0 14px rgba(11, 92, 77, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mic.chama { animation: none; }
}

/* selo "o cliente abriu o link" — o sinal mais importante da lista */
.visto {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
/* acabou de abrir AGORA (chegou pela atualização em tempo real): pisca */
.orc-row.acabou-abrir {
  background: var(--brand-soft);
  animation: piscaVisto 2.4s ease-out 2;
}
@keyframes piscaVisto {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 92, 77, 0); }
  50%      { box-shadow: 0 0 0 3px rgba(11, 92, 77, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
  .orc-row.acabou-abrir { animation: none; }
}

.fu-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 10px; padding: 10px 12px;
}
.fu-row.vencido { background: #faedec; }
.fu-row .info { flex: 1; min-width: 0; }
.fu-row .info .name { font-weight: 600; font-size: 14px; }
.fu-row .info .meta { font-size: 12px; color: var(--text-dim); }
.fu-row .fu-date { font-size: 12px; font-weight: 700; white-space: nowrap; }
.fu-row.vencido .fu-date { color: #d03b3b; }
.fu-actions { display: flex; gap: 6px; }
.fu-actions .btn { padding: 6px 10px; font-size: 13px; }

/* ---------- compartilhar / ask ---------- */
.share-bar { margin-top: 12px; }
.ask-answer {
  background: var(--brand-soft); border-radius: 10px; padding: 12px 14px;
  font-size: 15px; color: var(--brand-dark); margin-top: 10px; white-space: pre-wrap;
}

/* ---------- financeiro ---------- */
.month-input {
  border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px;
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
  margin-left: auto;
}
.select-input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface);
  color: var(--text); font-family: inherit;
}
.bill-thumb {
  max-height: 180px; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--rule); margin-bottom: 12px; background: var(--bg);
}
.bill-thumb img { width: 100%; object-fit: contain; max-height: 180px; }
.bill-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.bill-row.vencida { background: #faedec; }
.bill-row .info { flex: 1; min-width: 0; }
.bill-row .info .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-row .info .meta { font-size: 12px; color: var(--text-dim); }
.bill-row .val { font-weight: 700; font-size: 14px; white-space: nowrap; }
.bill-row .chip {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.chip.paga { background: #e2f5e2; color: #0a7a0a; }
.chip.aberta { background: #fdf2d4; color: #8a6200; }
.chip.alerta { background: #fbeae8; color: var(--danger); }
.bill-actions { display: flex; gap: 6px; }
.bill-actions .btn { padding: 6px 9px; font-size: 12.5px; }
.rep-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--rule); }
.rep-row:last-child { border-bottom: 0; }
.rep-row .val { font-weight: 700; }
.rep-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); margin: 12px 0 4px; }

/* ---------- aprendizado ---------- */
.learn-details { margin-top: 12px; }
.learn-details summary {
  font-size: 14px; font-weight: 600; color: var(--brand-dark); cursor: pointer;
}

/* ---------- confete ---------- */
.confetti {
  position: fixed; top: -14px; z-index: 70; width: 9px; height: 14px;
  border-radius: 2px; pointer-events: none;
  animation: confall linear forwards;
}
@keyframes confall {
  to { transform: translateY(105vh) rotate(660deg); opacity: .9; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px;
  border-radius: 16px; font-size: 14px; font-weight: 600; z-index: 60;
  box-shadow: var(--shadow); white-space: normal; text-align: center;
  max-width: min(92vw, 520px); line-height: 1.35;
}
/* campos lado a lado dentro de modais encolhem no celular (sem estourar) */
.modal .row2 .field, .modal .row2 input, .modal input, .modal .field { min-width: 0; }
