/* ContrataPUBLIC — identidade PublicSoft (tokens do site publicsoft.com.br) */
:root {
  --bg: #0b0733;
  --panel: #140d48;
  --field: #190f55;
  --navy: #11101d;
  --deeper: #090038;
  --text: #f1eefa;
  --muted: #a9a3c9;
  --coral: #ed785c;
  --coral-2: #f28846;
  --orange: #f7943a;
  --cyan: #0aa9cc;
  --cyan-bright: #2fcdee;
  --grad: linear-gradient(120deg, #f7943a 0%, #ee6e6e 28%, #e05590 52%, #d742b0 76%, #cf25cf 100%);
  --paper: #f7f4ef;
  --paper-white: #ffffff;
  --ink: #1a1530;
  --ink-soft: #4a4560;
  --line: rgba(241, 238, 250, 0.1);
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(207, 37, 207, 0.18), transparent 50%),
    radial-gradient(900px 400px at -10% 0%, rgba(247, 148, 58, 0.12), transparent 45%),
    var(--bg);
  color: var(--text);
}

/* ===== App shell: sidebar + fixed workspace ===== */
.app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}
.app-sidebar {
  flex: 0 0 260px;
  width: 260px;
  max-width: 82vw;
  display: flex;
  flex-direction: column;
  background: #0b0733;
  border-right: 1px solid var(--line);
  z-index: 40;
  height: 100%;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  flex: 0 0 auto;
}
/* PublicSoft logo above the menu (2026.0.0.45) */
.sidebar-ps-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(241, 238, 250, 0.08);
}
.sidebar-ps-logo {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}
.sidebar-brand-text { min-width: 0; flex: 1; }
.sidebar-brand .logo-ps {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
  margin-top: 0.15rem;
}
.sidebar-brand #logo-contratapublic,
.sidebar-brand .logo-cp {
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin-bottom: 0.35rem;
}
.sidebar-close {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}
.sidebar-close:hover { background: rgba(241, 238, 250, 0.08); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.nav-item {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  text-align: left;
  color: var(--text);
  background: transparent;
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  min-height: 44px;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.nav-item:hover {
  box-shadow: inset 0 0 0 1px rgba(47, 205, 238, 0.45);
  color: #fff;
}
.nav-item.is-on {
  background: var(--cyan);
  color: #041820;
  box-shadow: none;
}
.nav-item.is-on:hover { background: var(--cyan-bright); }
.nav-label { display: block; line-height: 1.25; }
/* Grupo com submenu: Arquivos Diversos */
.nav-group { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.nav-caret {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  opacity: 0.8;
}
.nav-group.is-open .nav-caret { transform: rotate(45deg); }
/* Pai ativo: destaque discreto; o destaque cheio fica no submenu escolhido. */
.nav-parent.is-on {
  background: rgba(47, 205, 238, 0.14);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(47, 205, 238, 0.45);
}
.nav-parent.is-on:hover { background: rgba(47, 205, 238, 0.22); }
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.1rem 0 0.25rem 0.85rem;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(47, 205, 238, 0.3);
}
.nav-sub[hidden] { display: none; }
.nav-subitem {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  min-height: 40px;
}
.prosp-crumb {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.prosp-crumb strong { color: var(--text); }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 20, 0.55);
  z-index: 35;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.workspace-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: #0b0733;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 15;
  min-height: 58px;
}
.btn-hamburger {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(241, 238, 250, 0.18);
}
.btn-hamburger:hover { box-shadow: inset 0 0 0 1px var(--cyan-bright); }
.hamburger-bars,
.hamburger-bars::before,
.hamburger-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
}
.hamburger-bars::before,
.hamburger-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.hamburger-bars::before { top: -6px; }
.hamburger-bars::after { top: 6px; }
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}
.topbar-logo {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: none;
}
.topbar-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.workspace-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 1 auto;
}
.workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2.7rem; /* room for fixed version-bar */
}

.logo-ps {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}
.product-mark { display: flex; align-items: center; gap: 0.6rem; }
#logo-contratapublic {
  height: 46px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  background: transparent;
  display: block;
}
#wordmark-contratapublic.is-off { display: none; }
.wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tag { margin: 0.15rem 0 0; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.brand-left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  color: var(--text);
}
.btn.primary {
  background: var(--coral);
  color: #2a0d08;
}
.btn.primary:hover { background: var(--coral-2); }
.btn.cta {
  background: var(--grad);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(241, 238, 250, 0.2);
}
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--cyan-bright); color: #fff; }

.app-body {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
  gap: 1.1rem;
  padding: 1.1rem 1.25rem 1.5rem;
  align-items: start;
}
@media (max-width: 1180px) {
  .app-body { grid-template-columns: minmax(0, 1fr); }
  .editor, .preview, .consultas, .prospeccao { min-width: 0; max-width: 100%; }
}

.editor { display: flex; flex-direction: column; gap: 0.85rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem 1.1rem;
}
.card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-bright);
}

label.field { display: block; margin-bottom: 0.65rem; }
label.field > span, .lbl {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.28rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="search"],
input[type="email"], input[type="tel"], input[type="password"],
select, textarea {
  width: 100%;
  background: var(--field);
  color: var(--text);
  border: 1px solid rgba(241, 238, 250, 0.12);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}
textarea { min-height: 72px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.55rem; }

.search-wrap { position: relative; }
.suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  background: var(--deeper);
  border: 1px solid rgba(47, 205, 238, 0.25);
  border-radius: 10px;
  max-height: 280px;
  overflow: auto;
  z-index: 15;
  box-shadow: var(--shadow);
  display: none;
}
.suggest.open { display: block; }
.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.suggest button:hover, .suggest button.active { background: rgba(237, 120, 92, 0.16); }
.suggest button small { display: block; color: var(--muted); font-size: 0.75rem; }

.mun-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem 0.7rem;
  margin-top: 0.35rem;
}
.mun-meta div {
  background: var(--field);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}
.mun-meta strong { display: block; font-size: 1rem; }
.mun-meta span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pill {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #2a0d08;
  background: var(--coral);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-weight: 700;
}

.orgaos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--field);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.check input { accent-color: var(--coral); width: 1.05rem; height: 1.05rem; }

.mod-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.mod-table th {
  text-align: left;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.35rem 0.45rem;
}
.mod-table td { padding: 0.38rem 0.3rem; border-top: 1px solid var(--line); vertical-align: middle; }
.mod-table input[type="number"] { width: 64px; padding: 0.3rem 0.35rem; text-align: right; }
.mod-table .val { text-align: right; font-variant-numeric: tabular-nums; color: #d8fff8; }
.mod-table .name { font-weight: 600; }
.mod-table .core .name { color: #fff; }

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.tot {
  background: var(--field);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.tot span { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tot strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.tot.grand {
  grid-column: 1 / -1;
  background: var(--grad);
  color: #fff;
}
.tot.grand span { color: rgba(255,255,255,0.85); }
.alert {
  display: none;
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(237, 120, 92, 0.18);
  color: #ffd4c8;
  font-size: 0.85rem;
}
.alert.on { display: block; }

.preview {
  display: flex;
  justify-content: center;
  padding: 0.2rem 0 2rem;
}
.sheet-stage {
  transform-origin: top center;
}
.sheet {
  width: 210mm;
  min-height: 297mm;
  background: var(--paper-white);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 0 0 16mm;
  position: relative;
}
.sheet-head {
  background: #0b0733;
  color: #f1eefa;
  padding: 8mm 12mm 7mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sheet-head .left { display: flex; align-items: center; gap: 10px; }
.sheet-head .logo-ps { width: 44px; height: 44px; }
.sheet-kicker {
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a9a3c9;
}
.sheet-title {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sheet-product {
  text-align: right;
}
.sheet-product .wordmark {
  font-size: 18px;
  display: block;
}
.sheet-product .credit {
  margin: 4px 0 0;
  font-size: 10px;
  color: #a9a3c9;
}
.sheet-rule {
  height: 4px;
  background: var(--grad);
}
.sheet-body { padding: 8mm 14mm 0; }
.sheet h2 {
  margin: 0 0 3mm;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0aa9cc;
}
.meta-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 5mm;
  margin-bottom: 6mm;
}
.box {
  border: 1px solid #e6e1dc;
  border-radius: 6px;
  padding: 3.5mm 4mm;
  background: var(--paper);
}
.box .k { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #7a748f; }
.box .v { font-size: 13px; font-weight: 700; color: #0b0733; margin-top: 1mm; }
.box p { margin: 1mm 0 0; font-size: 11.5px; color: var(--ink-soft); }

table.items {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  margin: 1mm 0 5mm;
}
table.items th {
  background: #0b0733;
  color: #f1eefa;
  font-weight: 650;
  text-align: left;
  padding: 2.2mm 2mm;
}
table.items th.num, table.items td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.items td {
  padding: 2mm;
  border-bottom: 1px solid #ece7e1;
  color: var(--ink);
}
table.items tr.group td {
  background: #f3eefc;
  font-weight: 700;
  color: #0b0733;
  border-bottom-color: #ed785c;
}
table.items tfoot td {
  border-bottom: 0;
  font-weight: 700;
  padding-top: 2.5mm;
}
table.items tfoot .grand {
  color: #0b0733;
  font-size: 12.5px;
}

.conds { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin: 2mm 0 5mm; }
.conds .box { min-height: 18mm; }
.closing {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 8mm;
}
.sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
  margin-top: 8mm;
}
.sign .line { border-top: 1px solid #0b0733; padding-top: 2mm; font-size: 10px; color: var(--ink-soft); }
.sheet-foot {
  margin-top: 8mm;
  padding-top: 3mm;
  border-top: 1px solid #ece7e1;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #8a849c;
}

.preview-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.55rem;
}

@media screen {
  .sheet-stage { transform: scale(0.78); }
  .preview { overflow: auto; }
}

@media print {
  html { color-scheme: light; }
  body {
    background: #fff !important;
    color: #000;
  }
  .no-print { display: none !important; }
  .app-body { display: block; padding: 0; }
  .preview { padding: 0; display: block; }
  .preview-label { display: none; }
  .sheet-stage { transform: none !important; }
  .sheet, .sheet-head, table.items th, .sheet-rule, .tot.grand {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sheet {
    box-shadow: none;
    width: auto;
    min-height: 0;
    margin: 0;
  }
  .sheet-product .logo-cp { height: 52px; max-width: 280px; }
  img.logo-ps, img.logo-cp { background: transparent !important; }
  .wordmark {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #ed785c;
    -webkit-text-fill-color: #ed785c;
  }
  @page { size: A4; margin: 10mm 10mm 12mm; }
}

.app-name { margin: 0; font-weight: 700; font-size: 0.98rem; letter-spacing: 0.01em; }
.brand-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.logo-cp, #logo-contratapublic {
  height: 46px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  background: transparent;
  display: block;
}
.sheet-product .logo-cp {
  height: 42px;
  max-width: 240px;
  margin-left: auto;
}
.sheet-product .wordmark { display: none; }
/* header stack refined in mobile block below (2026.0.0.33) */
@media (max-width: 900px) {
  .logo-cp, #logo-contratapublic { height: 34px; max-width: min(220px, 55vw); }
  .logo-ps { width: 40px; height: 40px; }
}

.app-footer {
  display: none; /* versão só na barra fixa da área principal (desde 2026.0.0.70) */
}
.version-bar {
  position: fixed;
  left: 260px;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.55rem 1.1rem;
  background: #0b0733;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
}
@media print {
  body { padding-bottom: 0; overflow: visible; height: auto; }
  .app-shell, .app-main, .workspace { display: block; height: auto; overflow: visible; }
  .app-sidebar, .sidebar-backdrop, .workspace-topbar,
  .app-footer, .version-bar { display: none !important; }
}

/* Arquivos Diversos sub-tabs still use .btn.mode */
.btn.mode {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(241, 238, 250, 0.22);
}
.btn.mode.is-on {
  background: var(--cyan);
  color: #041820;
  box-shadow: none;
}
.btn.mode:hover { box-shadow: inset 0 0 0 1px var(--cyan-bright); }
.btn.mode.is-on:hover { background: var(--cyan-bright); box-shadow: none; }
.note-poderes {
  margin: 0.75rem 0 0;
  color: #ffd4c8;
  font-size: 0.88rem;
  line-height: 1.4;
}
.tot.pending {
  grid-column: 1 / -1;
  background: rgba(237, 120, 92, 0.16);
}
.tot.pending strong { font-size: 1rem; line-height: 1.35; }
body.mode-estados .only-mun { display: none !important; }
body.mode-municipios .only-uf { display: none !important; }

.org-prices { display: flex; flex-direction: column; gap: 0.28rem; }
.org-prices div { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.org-prices span { color: var(--muted); font-size: 0.72rem; letter-spacing: 0; text-transform: none; }
.org-prices strong { font-weight: 650; color: #d8fff8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mod-table td.val { text-align: left; min-width: 12rem; }

body.mode-memoria .only-quote { display: none !important; }
body:not(.mode-memoria) .only-mem { display: none !important; }
.only-mem h3 {
  margin: 1rem 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-bright);
}
.pct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 0.75rem; }
#btn-restaurar { margin-top: 0.85rem; }

.peso-wrap { max-height: 22rem; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.peso-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.peso-table th, .peso-table td { padding: 0.35rem 0.5rem; text-align: left; border-bottom: 1px solid var(--line); }
.peso-table th { position: sticky; top: 0; background: var(--panel); color: var(--text); }
.peso-table td { color: var(--text); }
.peso-table input { width: 6.5rem; }

body.mode-consultas .editor,
body.mode-consultas .preview { display: none !important; }
body.mode-consultas .app-body { display: block; max-width: none; margin: 0; }
body.mode-consultas #btn-print,
body.mode-consultas #btn-exemplo { display: none; }
body:not(.mode-consultas) .only-con { display: none !important; }
.con-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.65rem; }
.con-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.55rem; margin: 0.35rem 0 0.35rem; }
.consulta-count { margin: 0; color: var(--cyan-bright); font-weight: 700; font-size: 0.92rem; }
#btn-con-csv { padding: 0.35rem 0.85rem; font-size: 0.82rem; border-color: var(--cyan-bright); color: var(--cyan-bright); }
#btn-con-csv:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--coral); color: #fff; border-color: var(--coral); }
#btn-con-csv:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.consulta-nota { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.consulta-wrap { overflow: auto; max-height: calc(100vh - 320px); border: 1px solid var(--line); border-radius: 8px; }
.consulta-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.consulta-table th, .consulta-table td { padding: 0.45rem 0.55rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.consulta-table th { position: sticky; top: 0; background: #0b0733; color: var(--text); z-index: 1; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.consulta-table th[data-sort-key] { cursor: pointer; user-select: none; }
.consulta-table th[data-sort-key]:hover { color: var(--cyan-bright); }
.consulta-table .sort-arrow { color: var(--cyan-bright); font-size: 0.7rem; white-space: pre; }
.consulta-table td { color: var(--text); }
.consulta-table td.num, .consulta-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.consulta-table tbody tr:hover td { background: rgba(10, 169, 204, 0.08); }
@media print {
  body.mode-consultas .preview,
  body.mode-consultas .sheet,
  body.mode-consultas .only-con,
  body.mode-consultas #consultas { display: none !important; }
}


/* ===== Dashboard (2026.0.0.41) ===== */
body.mode-dashboard .editor,
body.mode-dashboard .preview { display: none !important; }
body.mode-dashboard .app-body { display: block; max-width: none; margin: 0; }
body.mode-dashboard #btn-print,
body.mode-dashboard #btn-exemplo { display: none; }
body:not(.mode-dashboard) .only-dash { display: none !important; }
.dashboard { padding: 0 0 1.2rem; min-width: 0; max-width: 100%; }
.dash-head { margin-bottom: 1rem; }
.dash-head .note-poderes { margin: 0; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
@media (min-width: 1280px) {
  .dash-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.85rem; }
}
.dash-card {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 0.35rem;
  min-width: 0;
  padding: 1.15rem 1.15rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dash-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: var(--grad);
}
.dash-label {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--cyan-bright);
}
.dash-num {
  font-size: clamp(1.7rem, 4.2vw, 2.5rem); font-weight: 800; line-height: 1.1;
  color: var(--text); overflow-wrap: anywhere;
}
.dash-valor .dash-num {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-sub { font-size: 0.86rem; color: var(--muted); }
.dash-valor .dash-num { font-size: clamp(1.15rem, 1.65vw, 1.8rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-num small { font-size: 0.55em; font-weight: 700; }
.dash-note { margin: 0.9rem 0 0; font-size: 0.86rem; color: var(--muted); }
.dash-note:empty { display: none; }
@media (max-width: 560px) {
  .dash-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .dash-card { padding: 0.95rem 0.95rem 0.9rem; }
  body.mode-dashboard .app-body { padding-left: 0.85rem; padding-right: 0.85rem; }
}
@media print {
  body.mode-dashboard #dashboard { display: none !important; }
}

/* ===== Clientes (2026.0.0.41) ===== */
body.mode-clientes .editor,
body.mode-clientes .preview { display: none !important; }
body.mode-clientes .app-body { display: block; max-width: none; margin: 0; }
body.mode-clientes #btn-print,
body.mode-clientes #btn-exemplo { display: none; }
body:not(.mode-clientes) .only-cli { display: none !important; }
.clientes { padding: 0 0 1.2rem; min-width: 0; max-width: 100%; }
.clientes .card > .note-poderes, .funil .card > .note-poderes { margin-bottom: 0.9rem; }
.cli-filtros {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 0.55rem; margin-bottom: 0.7rem;
}
#cli-count { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
#clientes textarea { width: 100%; resize: vertical; }
.cli-contatos-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  margin-top: 0.9rem; flex-wrap: wrap;
}
.cli-contatos-head h3 { margin: 0; }
.cli-contatos-note { margin: 0.3rem 0 0.55rem; font-size: 0.82rem; color: var(--muted); }
.cli-contatos { display: flex; flex-direction: column; gap: 0.6rem; }
.cli-contato {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 0.6rem;
  padding: 0.7rem; border-radius: var(--radius);
  background: var(--field); border: 1px solid var(--line);
}
.cli-contato .cli-ct-del { grid-column: 1 / -1; justify-self: end; }
/* Tipos de cliente (detalhe do cliente, 2026.0.0.43) */
.cli-tipos { display: flex; flex-direction: column; gap: 0.75rem; }
.cli-tipo-row {
  padding: 0.75rem 0.8rem 0.8rem; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  background: rgba(255, 255, 255, 0.025);
}
.cli-tipo-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem; }
.cli-tipo-n { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cyan-bright); }
.cli-tipo-row .cli-tp-ct-head { margin-top: 0.4rem; }
.cli-tipo-row h4 { margin: 0; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cli-tipo-row .cli-contato { background: var(--field); }
.cli-ct-vazio { margin: 0.1rem 0 0.2rem; font-size: 0.82rem; color: var(--muted); font-style: italic; }
.btn.tiny { padding: 0.25rem 0.65rem; font-size: 0.8rem; }
.cli-tp-preco {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 0.55rem; align-items: end;
  margin: 0.1rem 0 0.2rem;
}
.cli-tp-val { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.65rem; min-width: 0; }
.cli-tp-val strong { font-size: 1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-tp-val [data-tp-final] { color: var(--cyan-bright); }
.prosp-item .meta b { color: var(--cyan-bright); font-weight: 700; }
.kb-card-tipo.is-sem { color: var(--muted); font-weight: 600; }
@media (max-width: 560px) {
  .cli-contato { grid-template-columns: 1fr; }
  .cli-tp-grid { grid-template-columns: 1fr; }
  .cli-tp-preco { grid-template-columns: 1fr 1fr; }
  .cli-tp-preco .cli-tp-desc { grid-column: 1 / -1; grid-row: 2; }
  .cli-tp-val strong { white-space: normal; font-size: 0.92rem; }
  .cli-contato .cli-ct-del { justify-self: stretch; }
}
.dash-tipos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem; margin-top: 1rem;
}
.dash-tipo {
  display: flex; align-items: baseline; gap: 0.5rem; min-width: 0;
  padding: 0.65rem 0.8rem; border-radius: var(--radius);
  background: var(--field); border: 1px solid var(--line);
}
.dash-tipo-n { font-size: 1.35rem; font-weight: 800; color: var(--cyan-bright); }
.dash-tipo-l { font-size: 0.84rem; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .cli-filtros { grid-template-columns: 1fr; }
  body.mode-clientes .app-body { padding-left: 0.85rem; padding-right: 0.85rem; }
}
@media (max-width: 560px) {
  .dash-tipos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  body.mode-clientes #clientes { display: none !important; }
}

/* ===== Funil de Vendas · Kanban (2026.0.0.41) ===== */
/* Desde a mudança do Marcos o funil fica dentro do Dashboard, abaixo dos cartões. */
.dashboard .funil { margin-top: 1.1rem; padding: 0; min-width: 0; max-width: 100%; }
.dashboard .funil > .card { margin-bottom: 0.8rem; }
/* Filtro do funil pelos cartões do Dashboard */
.dash-card[data-filtro], .dash-tipo[data-filtro] { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.dash-card[data-filtro]:hover, .dash-tipo[data-filtro]:hover { border-color: var(--cyan); transform: translateY(-1px); }
.dash-card[data-filtro]:focus-visible, .dash-tipo[data-filtro]:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 2px; }
.dash-card.is-filtro, .dash-tipo.is-filtro { border-color: var(--cyan-bright); box-shadow: 0 0 0 2px var(--cyan-bright) inset, 0 6px 22px rgba(0, 200, 230, .18); }
.dash-fval { display: block; margin-top: 0.35rem; font-size: 0.8rem; font-weight: 700; color: var(--cyan-bright); }
.dash-tipo .dash-fval { margin-top: 0.1rem; font-size: 0.72rem; }
.kb-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 0.7rem; }
.kb-f-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 0.2rem; }
.kb-chip { border: 1px solid var(--line, rgba(255,255,255,.18)); background: transparent; color: var(--text); border-radius: 999px; padding: 0.28rem 0.75rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.kb-chip:hover { border-color: var(--cyan); }
.kb-chip.is-on { background: var(--cyan); border-color: var(--cyan); color: #0b0830; font-weight: 700; }
.kb-f-res { flex-basis: 100%; font-size: 0.82rem; color: var(--muted); }
.kb-col.kb-dim { opacity: 0.4; }
/* Botão «+ Novo cliente» ao lado do Cliente no funil e modal (2026.0.0.42) */
.fn-cli-wrap { display: flex; align-items: flex-end; gap: 0.5rem; min-width: 0; }
.fn-cli-wrap > label.field { flex: 1 1 auto; min-width: 0; }
.fn-cli-wrap .fn-novo-cli { flex: 0 0 auto; margin-bottom: 0.65rem; white-space: nowrap; }
.cp-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.cp-modal[hidden] { display: none; }
.cp-modal-backdrop { position: fixed; inset: 0; background: rgba(6, 4, 28, 0.72); backdrop-filter: blur(2px); }
.cp-modal-box {
  position: relative; width: min(720px, 100%); background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.14); border-top: 3px solid transparent;
  border-image: var(--grad) 1; border-image-slice: 1 0 0 0;
  border-radius: 14px; padding: 1.1rem 1.25rem 1.2rem; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.cp-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cp-modal-head h2 { margin: 0; }
.cp-modal-x { background: transparent; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--text); border-radius: 8px; width: 2rem; height: 2rem; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.cp-modal-x:hover { border-color: var(--cyan); }
.cp-modal-note { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0.8rem; }
#form-cliente.is-modal > h3:first-child { display: none; }
body.modal-aberto { overflow: hidden; }
@media (max-width: 560px) {
  .fn-cli-wrap { flex-wrap: wrap; }
  .fn-cli-wrap .fn-novo-cli { width: 100%; margin-top: -0.3rem; }
  .cp-modal { padding: 0; }
  .cp-modal-box { border-radius: 0; min-height: 100%; }
}
.funil-form { display: block; margin-top: 0.4rem; }
.funil-form[hidden] { display: none; }
#btn-fn-abrir[hidden] { display: none; }
.fn-row-1 { display: grid; gap: 0.55rem 0.7rem; align-items: start; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.fn-vend-hint { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; min-height: 0; }
.fn-vend-hint:empty { display: none; }
.fn-vend-hint.is-warn { color: #ffb86b; }
.kb-card-vend { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; overflow-wrap: anywhere; }
.fn-tipos { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem 0.75rem 0.7rem; margin: 0.2rem 0 0.7rem; }
.fn-tipos legend { padding: 0 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fn-tipos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.45rem; }
.fn-tp-check {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 0.6rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 0.88rem;
}
.fn-tp-check:has(input[data-fn-tipo]:checked) { border-color: var(--cyan-bright); box-shadow: 0 0 0 1px var(--cyan-bright) inset; }
.fn-tp-check.is-off { opacity: 0.45; cursor: not-allowed; }
.fn-tp-check input[type="checkbox"] { accent-color: var(--cyan); width: 1rem; height: 1rem; }
.fn-tp-nome { font-weight: 600; }
.fn-tp-preco { flex-basis: 100%; font-size: 0.78rem; color: var(--cyan-bright); padding-left: 1.4rem; min-height: 1em; }
/* Desconto por tipo (2026.0.0.47) */
.fn-tp-head { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; flex: 1 1 auto; min-width: 0; }
.fn-tp-desc { display: inline-flex; align-items: center; gap: 0.35rem; padding-left: 1.4rem; font-size: 0.78rem; color: var(--muted); }
.fn-tp-desc input { width: 4.2rem; padding: 0.2rem 0.4rem; }
.fn-tp-desc input.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
.fn-tp-final { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--text); text-align: right; }
.fn-tp-check.is-off .fn-tp-desc input { pointer-events: none; }
.kb-tp-desc { color: var(--muted); font-weight: 600; }
#fn-qtd-fundos { width: 4rem; padding: 0.2rem 0.4rem; margin-left: auto; }
.fn-preco { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 0.55rem; align-items: end; }
#form-funil .cli-contatos-head { margin-top: 0.3rem; }
#form-funil .fn-obs { display: block; margin-top: 0.7rem; }
.funil-form select:disabled { opacity: 0.6; }
.funil-form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.kb-desc { font-size: 0.75em; color: var(--muted); font-weight: 600; }
.kb-card-c { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; overflow-wrap: anywhere; }
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr);
  gap: 0.8rem; margin-top: 1rem; padding-bottom: 0.6rem; overflow-x: auto;
  scroll-snap-type: x proximity;
}
.kb-col {
  display: flex; flex-direction: column; min-width: 0; scroll-snap-align: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem 0.7rem 0.8rem; position: relative; overflow: hidden;
}
.kb-col::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--grad); }
.kb-col.kb-fechado::before { background: #3ddc97; }
.kb-col.kb-perdido::before { background: #8f8aa8; }
.kb-col.kb-licitacao::before { background: var(--cyan); }
.kb-head { display: flex; align-items: center; gap: 0.4rem; }
.kb-title {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cyan-bright); overflow-wrap: anywhere;
}
.kb-rename {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 0.2rem; font-size: 0.85rem;
}
.kb-rename:hover { color: var(--text); }
.kb-count {
  margin-left: auto; min-width: 1.6rem; text-align: center; font-size: 0.75rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--field); color: var(--text);
}
.kb-head { margin-bottom: 0.6rem; }
/* Rodapé da coluna: quantidade e valor da etapa (2026.0.0.49) */
.kb-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.65rem; padding-top: 0.55rem; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted);
}
.kb-foot b { color: var(--text); font-weight: 800; }
.kb-foot-v { font-weight: 800; color: var(--cyan-bright); white-space: nowrap; }
.kb-cards {
  display: flex; flex-direction: column; gap: 0.55rem; min-height: 90px; flex: 1;
  border-radius: 10px; padding: 0.15rem; transition: background 0.15s;
}
.kb-cards.is-over { background: rgba(10, 169, 204, 0.12); outline: 1px dashed var(--cyan); }
.kb-empty { margin: 0; padding: 0.8rem 0.4rem; text-align: center; font-size: 0.82rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.kb-card {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.65rem; cursor: grab; display: flex; flex-direction: column; gap: 0.2rem;
}
.kb-card:hover { border-color: rgba(10, 169, 204, 0.45); }
.kb-card.is-drag { opacity: 0.45; }
.kb-card-t { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.kb-card-s, .kb-card-o { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.kb-card-tipo { font-size: 0.72rem; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: 0.05em; }
.kb-card-v { font-weight: 800; color: var(--coral); }
.kb-card-a { display: flex; gap: 0.3rem; margin-top: 0.35rem; flex-wrap: wrap; }
.kb-card-a button {
  border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 7px;
  font-size: 0.75rem; padding: 0.2rem 0.5rem; cursor: pointer;
}
.kb-card-a button:hover:not(:disabled) { border-color: var(--cyan); }
.kb-card-a button:disabled { opacity: 0.35; cursor: default; }
.kb-card-a .kb-del { margin-left: auto; color: #ffb4a4; }
@media (max-width: 900px) {
  .fn-row-1 { grid-template-columns: 1fr 1fr; }
  .fn-row-1 .fn-cli { grid-column: 1 / -1; }
  .funil-form-actions { justify-content: stretch; }
}
@media (max-width: 560px) {
  .fn-row-1, .fn-preco { grid-template-columns: 1fr; }
  .funil-form-actions .btn { flex: 1; }
  .kanban { grid-auto-columns: 84%; }
}

/* ===== Arquivos Diversos CRM (2026.0.0.33) ===== */
body.mode-prospeccao .editor,
body.mode-prospeccao .preview { display: none !important; }
body.mode-prospeccao .app-body { display: block; max-width: none; margin: 0; }
body.mode-prospeccao #btn-print,
body.mode-prospeccao #btn-exemplo { display: none; }
body:not(.mode-prospeccao) .only-prosp { display: none !important; }
.prospeccao { padding: 0 0 1.2rem; }
.prosp-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.65rem; margin: 0.75rem 0 1rem;
}
.prosp-io { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.prosp-grid {
  display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 1fr);
  gap: 1rem; align-items: start;
}
@media (max-width: 900px) {
  .prosp-grid { grid-template-columns: 1fr; }
}
.prosp-form h3, .prosp-list-wrap h3 {
  margin: 0 0 0.55rem; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan-bright);
}
.prosp-status {
  min-height: 1.2rem; margin: 0 0 0.55rem; font-size: 0.85rem; color: var(--muted);
}
.prosp-status.is-ok { color: #7dffc8; }
.prosp-status.is-err { color: #ffb4a4; }
.prosp-status.is-busy { color: var(--cyan-bright); }
.prosp-status.is-warn { color: #ffd59a; }
/* Arquivos Diversos: cartões + Novo/CSV + grade (2026.0.0.54) */
.td-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem; margin: 0.2rem 0 1rem;
}
.td-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.2rem;
  min-width: 0; padding: 0.85rem 0.95rem 0.8rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.td-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--grad); }
.td-card-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan-bright); }
.td-card-num { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 800; line-height: 1.1; color: var(--text); }
.td-card-sub { font-size: 0.78rem; color: var(--muted); }
.td-card.is-warn .td-card-num { color: #ffd59a; }
.td-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.75rem; margin: 0 0 0.6rem;
}
.td-csv { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.td-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-left: auto; align-items: flex-end; }
.td-filters .field { margin: 0; min-width: 170px; }
.td-msg { margin: 0 0 0.45rem; }
.td-msg:empty { min-height: 0; margin: 0; }
.td-grid-wrap { border: 1px solid var(--line); border-radius: 10px; background: rgba(11, 7, 51, 0.35); overflow: auto; }
.td-grid { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.td-grid th, .td-grid td {
  padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle;
}
.td-grid thead th {
  position: sticky; top: 0; z-index: 1; background: #1a1159;
  color: var(--cyan-bright); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.td-grid tbody tr:hover td { background: rgba(47, 205, 238, 0.06); }
.td-grid tbody tr.is-editing td { background: rgba(47, 205, 238, 0.12); }
.td-grid tbody tr:last-child td { border-bottom: 0; }
.td-grid .td-main { font-weight: 650; color: var(--text); }
.td-grid .td-sub { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 0.1rem; }
.td-grid .td-nw { white-space: nowrap; }
.td-grid .td-num { text-align: right; font-variant-numeric: tabular-nums; }
.td-grid th.td-acoes, .td-grid td.td-acoes { text-align: right; white-space: nowrap; width: 1%; }
.td-acoes-in { display: inline-flex; gap: 0.35rem; justify-content: flex-end; }
.td-grid .btn.tiny { padding: 0.25rem 0.55rem; font-size: 0.74rem; margin: 0; }
.td-nil { color: var(--muted); opacity: 0.7; }
.td-flag {
  display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 999px; font-size: 0.68rem;
  color: #ffd59a; background: rgba(247, 148, 58, 0.16); box-shadow: inset 0 0 0 1px rgba(247, 148, 58, 0.5);
}
.td-empty-row td { text-align: center; padding: 1.1rem 0.75rem; }
.td-modal .td-form { margin-top: 0.6rem; }
.td-modal .cp-modal-box { width: min(680px, 100%); }
@media (max-width: 760px) {
  .td-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .td-toolbar { align-items: stretch; }
  .td-toolbar > .td-add { flex: 1 1 100%; min-height: 44px; }
  .td-csv { flex: 1 1 100%; }
  .td-csv .btn { flex: 1 1 0; min-height: 44px; }
  .td-filters { margin-left: 0; flex: 1 1 100%; }
  .td-filters .field { flex: 1 1 140px; min-width: 0; }
  /* Grade vira lista de cartões no celular */
  .td-grid-wrap { border: 0; background: transparent; overflow: visible; }
  .td-grid thead { display: none; }
  .td-grid, .td-grid tbody, .td-grid tr, .td-grid td { display: block; width: 100%; }
  .td-grid tbody tr {
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
    padding: 0.45rem 0.7rem; margin-bottom: 0.55rem;
  }
  .td-grid td { border: 0; padding: 0.22rem 0; display: flex; gap: 0.6rem; justify-content: space-between; text-align: right; }
  .td-grid td::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 0.1rem;
  }
  .td-grid td.td-num { text-align: right; }
  .td-grid td.td-acoes { width: 100%; padding-top: 0.45rem; }
  .td-grid td.td-acoes::before { content: none; }
  .td-acoes-in { width: 100%; }
  .td-acoes-in .btn.tiny { flex: 1 1 0; min-height: 40px; font-size: 0.82rem; }
  .td-grid .td-empty-row td { display: block; text-align: center; }
  .td-grid .td-empty-row td::before { content: none; }
  .td-grid .td-sub { display: inline; margin-left: 0.3rem; }
  .td-grid tbody tr.is-ativo { box-shadow: inset 3px 0 0 var(--cyan); }
}
.prosp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.btn.danger { color: #ffb4a4; box-shadow: inset 0 0 0 1px rgba(237, 120, 92, 0.55); }
.btn.danger:hover:not(:disabled) { background: rgba(237, 120, 92, 0.18); color: #fff; }
.btn.danger:disabled { opacity: 0.4; cursor: not-allowed; }
.prosp-list-wrap {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem;
  background: rgba(11, 7, 51, 0.35); max-height: calc(100vh - 280px); overflow: auto;
}
.prosp-list { display: flex; flex-direction: column; gap: 0.45rem; }
.prosp-item {
  display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left;
}
.prosp-item:hover { border-color: rgba(10, 169, 204, 0.45); }
.prosp-item.is-on {
  border-color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(10, 169, 204, 0.35);
  background: rgba(10, 169, 204, 0.1);
}
.prosp-item .t { font-weight: 650; color: var(--text); }
.prosp-item .s { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.prosp-item .meta { color: var(--cyan-bright); font-size: 0.75rem; white-space: nowrap; align-self: start; }
.prosp-empty { color: var(--muted); font-size: 0.9rem; padding: 0.5rem 0.15rem; }
.prosp-filter-hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }

#wrap-quote-vendedor,
#wrap-quote-apresentador,
#wrap-quote-contato { margin-bottom: 0.65rem; }
.sheet-body .crm-note { font-size: 0.9em; opacity: 0.92; }
.quote-terr-note {
  margin: -0.25rem 0 0.75rem; padding: 0.45rem 0.65rem; border-radius: 6px;
  font-size: 0.82rem; color: #ffe8c8;
  background: rgba(237, 160, 92, 0.14);
  box-shadow: inset 0 0 0 1px rgba(237, 160, 92, 0.4);
}
.quote-terr-note.is-own {
  color: #b8fff0;
  background: rgba(10, 169, 204, 0.12);
  box-shadow: inset 0 0 0 1px rgba(10, 169, 204, 0.4);
}


.field input.is-invalid, .field select.is-invalid {
  box-shadow: inset 0 0 0 1px rgba(237, 120, 92, 0.85);
}
@media print {
  body.mode-prospeccao .preview,
  body.mode-prospeccao .sheet,
  body.mode-prospeccao .only-prosp,
  body.mode-prospeccao #prospeccao { display: none !important; }
}

/* ===== Proposta multipágina (2026.0.0.33): capa · valores · apresentação ===== */
.sheet-stage { display: flex; flex-direction: column; align-items: center; gap: 10mm; }
.sheet-group { display: flex; flex-direction: column; gap: 10mm; }
.sheet-page { break-inside: auto; }
.sheet-fixed {
  height: 297mm;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Brand dark sheets (capa + apresentação) — hero PublicSoft; #sheet valores fica papel claro */
:is(#sheet-cover, .mod-prev .sheet-cover),
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page {
  background:
    radial-gradient(circle at 80% 50%, rgba(180, 40, 200, 0.22), transparent 52%),
    linear-gradient(135deg, #0a0628 0%, #120a3a 40%, #1e0c42 100%);
  color: #f1eefa;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .sheet-head {
  background: #08051f;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
:is(#sheet-cover, .mod-prev .sheet-cover) .cover-band,
:is(#sheet-cover, .mod-prev .sheet-cover) .cover-body,
:is(#sheet-cover, .mod-prev .sheet-cover) .cover-foot,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-body,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .page-foot,
:is(#sheet-cover, .mod-prev .sheet-cover) .cover-card,
:is(#sheet-cover, .mod-prev .sheet-cover) .cover-card-img,
:is(#sheet-cover, .mod-prev .sheet-cover) .cover-meta div,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-b,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-m,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-disclaimer,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-curadoria,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-cta,
:is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-step {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Capa */
.cover-band {
  background: #08051f;
  color: #f1eefa;
  padding: 7mm 14mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cover-band-left { display: flex; align-items: center; gap: 10px; }
.cover-ps { width: 40px; height: 40px; object-fit: contain; }
.cover-band-name { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: 0.01em; }
.cover-band-sub { margin: 1px 0 0; font-size: 9.5px; color: #a9a3c9; letter-spacing: 0.04em; }
.cover-band-right {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2fcdee;
  font-weight: 700;
}
.cover-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 11mm 16mm 6mm;
  background: transparent;
}
.cover-kicker {
  margin: 0 0 5mm;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ed785c;
}
.cover-title { margin: 0; display: flex; align-items: flex-start; gap: 2px; }
.cover-logo {
  width: 104mm;
  height: auto;
  display: block;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.cover-reg { font-size: 18px; font-weight: 700; color: #f1eefa; margin-top: 2mm; }
.cover-sub {
  margin: 6mm 0 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f1eefa;
  max-width: 150mm;
}
.cover-blurb {
  margin: 5mm 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #a9a3c9;
  max-width: 160mm;
}
.cover-blurb strong { color: #f1eefa; }
.cover-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  margin-top: 8mm;
}
.cover-card {
  border: 1px solid rgba(241, 238, 250, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #140d48;
  display: flex;
  flex-direction: column;
}
.cover-card-img {
  height: 54mm;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 3px solid #0aa9cc;
}
.cover-card-img.sofia {
  background: linear-gradient(160deg, rgba(10, 169, 204, 0.22) 0%, rgba(20, 13, 72, 0.9) 100%);
  align-items: center;
}
.cover-card-img.ronny {
  background: linear-gradient(160deg, rgba(237, 120, 92, 0.22) 0%, rgba(58, 20, 82, 0.85) 100%);
  border-bottom-color: #ed785c;
}
.cover-card-img img { max-height: 100%; max-width: 100%; object-fit: contain; display: block; }
.cover-card-img.sofia img { height: 50mm; }
.cover-card-img.ronny img { height: 54mm; }
.cover-card-txt { padding: 4mm 5mm 5mm; }
.cc-tag { margin: 0; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #0aa9cc; font-weight: 700; }
.cover-card:nth-child(2) .cc-tag { color: #ed785c; }
.cover-card-txt h3 { margin: 1.2mm 0 1.5mm; font-size: 17px; color: #f1eefa; font-weight: 800; }
.cover-card-txt p:not(.cc-tag) { margin: 0; font-size: 11px; line-height: 1.45; color: #a9a3c9; }
.cover-meta {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 1.5fr 1.15fr;
  gap: 3mm;
  padding-top: 6mm;
}
.cover-meta div {
  background: rgba(20, 13, 72, 0.72);
  border: 1px solid rgba(241, 238, 250, 0.12);
  border-left: 3px solid #ed785c;
  border-radius: 6px;
  padding: 2.6mm 3.2mm;
}
.cover-meta .k { display: block; font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #a9a3c9; }
.cover-meta strong { display: block; margin-top: 0.8mm; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f1eefa; }
.cover-foot, .page-foot {
  display: flex;
  justify-content: space-between;
  padding: 3mm 16mm 5mm;
  border-top: 1px solid rgba(241, 238, 250, 0.12);
  font-size: 9px;
  color: #a9a3c9;
}

/* Apresentação */
.ap-body { flex: 1; padding: 7mm 14mm 4mm; display: flex; flex-direction: column; color: #f1eefa; }
.ap-body h2 { margin: 0 0 3mm; color: #2fcdee; }
.ap-body h2 + * { margin-bottom: 6mm; }
.ap-benef { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm; }
.ap-b {
  background: rgba(20, 13, 72, 0.78);
  border: 1px solid rgba(241, 238, 250, 0.12);
  border-top: 3px solid #0aa9cc;
  border-radius: 8px;
  padding: 3.5mm 3.5mm 4mm;
}
.ap-b:nth-child(even) { border-top-color: #ed785c; }
.ap-n { font-size: 10px; font-weight: 800; color: #ed785c; letter-spacing: 0.08em; }
.ap-b h3 { margin: 1mm 0 1.5mm; font-size: 15px; color: #f1eefa; font-weight: 800; }
.ap-b p { margin: 0; font-size: 10.5px; line-height: 1.45; color: #a9a3c9; }
.ap-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2mm 1.2mm;
  margin-bottom: 2mm !important;
}
.ap-step {
  background: #100a35;
  color: #f1eefa;
  font-size: 9px;
  font-weight: 700;
  padding: 1.8mm 2.4mm;
  border-radius: 999px;
  white-space: nowrap;
}
.ap-step:first-child { background: #ed785c; color: #2a0d08; }
.ap-step:last-child { background: #0aa9cc; color: #041820; }
.ap-arrow { color: #ed785c; font-weight: 800; font-size: 11px; }
.ap-cap { margin: 0 0 6mm; font-size: 10.5px; color: #a9a3c9; }
.ap-sofia { display: block; }
.ap-sofia ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; margin-bottom: 3mm !important; }
.ap-sofia .ap-shot { width: 150mm; margin: 0 auto; }
.ap-head { margin: 0 0 3mm; font-size: 15px; line-height: 1.3; font-weight: 800; color: #f1eefa; }
.ap-sofia ul { margin: 0; padding-left: 4.5mm; }
.ap-sofia li { font-size: 10.8px; line-height: 1.45; color: #a9a3c9; margin-bottom: 1.6mm; }
.ap-sofia li::marker { color: #0aa9cc; }
.ap-shot { margin: 0; }
.ap-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(241, 238, 250, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.ap-shot figcaption { margin-top: 2mm; font-size: 9.5px; color: #a9a3c9; text-align: center; }
.ap-disclaimer {
  margin: 5mm 0 0;
  padding: 3mm 4mm;
  background: rgba(237, 120, 92, 0.16);
  border-left: 3px solid #ed785c;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.45;
  color: #f1eefa;
}
.ap-disclaimer strong { color: #ed785c; }
.ap-mods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm; }
.ap-m {
  background: rgba(20, 13, 72, 0.78);
  border: 1px solid rgba(241, 238, 250, 0.12);
  border-radius: 8px;
  padding: 3mm 3.2mm;
}
.ap-m h3 { margin: 0 0 1mm; font-size: 12px; color: #f1eefa; font-weight: 800; }
.ap-m p { margin: 0; font-size: 9.8px; line-height: 1.4; color: #a9a3c9; }
.ap-shot.wide { margin-bottom: 6mm; }
.ap-curadoria {
  display: flex;
  gap: 4mm;
  align-items: center;
  background: rgba(20, 13, 72, 0.78);
  border: 1px solid rgba(241, 238, 250, 0.12);
  border-radius: 8px;
  padding: 3mm 4mm;
}
.ap-curadoria img { width: 26mm; height: 34mm; object-fit: contain; object-position: center bottom; flex: 0 0 auto; }
.ap-curadoria h3 { margin: 0 0 1.2mm; font-size: 12.5px; color: #f1eefa; }
.ap-curadoria p { margin: 0; font-size: 10.3px; line-height: 1.45; color: #a9a3c9; }
.ap-cta {
  margin-top: auto;
  padding: 3.5mm 4mm;
  border: 1px solid #0aa9cc;
  border-radius: 8px;
  background: rgba(10, 169, 204, 0.1);
  font-size: 11px;
  color: #f1eefa;
}
.ap-cta strong { color: #2fcdee; }

@supports (zoom: 1) {
  @media screen {
    .sheet-stage { transform: none; zoom: 0.78; }
  }
}

@media print {
  .sheet-stage { display: block; gap: 0; zoom: 1 !important; }
  .sheet-group { display: block; }
  .sheet-page {
    break-after: page;
    page-break-after: always;
    box-shadow: none;
  }
  .sheet-group .sheet-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .sheet-fixed {
    width: auto;
    height: 272mm;
    min-height: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  :is(#sheet-cover, .mod-prev .sheet-cover),
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page,
  :is(#sheet-cover, .mod-prev .sheet-cover) .cover-band,
  :is(#sheet-cover, .mod-prev .sheet-cover) .cover-body,
  :is(#sheet-cover, .mod-prev .sheet-cover) .cover-card,
  :is(#sheet-cover, .mod-prev .sheet-cover) .cover-card-img,
  :is(#sheet-cover, .mod-prev .sheet-cover) .cover-meta div,
  :is(#sheet-cover, .mod-prev .sheet-cover) .cover-logo,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .sheet-head,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-b,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-m,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-disclaimer,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-curadoria,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-cta,
  :is(#sheet-apresentacao, #sheet-intro, .mod-prev .ap-group) .sheet-page .ap-step {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .ap-shot img { box-shadow: none; }
  body.mode-consultas .sheet-stage { display: none !important; }
}


/* ===== Mobile / narrow screens (2026.0.0.34) — drawer sidebar ===== */
@media (max-width: 900px) {
  html {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
    max-width: 100%;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
  }
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  body.sidebar-open { overflow: hidden; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .btn-hamburger { display: inline-flex; }
  .topbar-logo { display: block; }
  .version-bar { left: 0; }
  .workspace { padding-bottom: 3.2rem; }
  .workspace-topbar {
    padding: 0.55rem 0.75rem;
    gap: 0.55rem;
    flex-wrap: wrap;
  }
  .workspace-actions {
    width: 100%;
    order: 3;
  }
  .workspace-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
    text-align: center;
  }
  .nav-item {
    min-height: 44px;
    font-size: 0.95rem;
    padding: 0.8rem 0.9rem;
  }
  .btn.mode {
    min-height: 44px;
    padding: 0.55rem 0.95rem;
    font-size: 0.88rem;
  }
  .app-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.85rem 0.85rem 1.5rem;
    max-width: 100%;
    width: 100%;
    overflow-x: clip;
  }
  .editor, .preview, .consultas, .prospeccao,
  .card, .prosp-panel, .prosp-form, .prosp-list-wrap {
    min-width: 0;
    max-width: 100%;
  }
  .card {
    padding: 0.9rem 0.85rem 1rem;
  }
  .row-2,
  .row-3,
  .pct-grid,
  .mun-meta,
  .totals,
  .orgaos {
    grid-template-columns: 1fr;
  }
  .orgaos .check {
    min-height: 44px;
    padding: 0.65rem 0.75rem;
  }
  input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="search"],
  input[type="email"], input[type="tel"], input[type="password"],
  select, textarea {
    font-size: 1rem; /* avoid iOS zoom */
    min-height: 44px;
    padding: 0.65rem 0.75rem;
  }
  .mod-table {
    font-size: 0.92rem;
    min-width: 320px;
  }
  .mod-table td.val { min-width: 0; }
  .mod-table input[type="number"] {
    width: 4.5rem;
    min-height: 40px;
    font-size: 1rem;
  }
  .btn {
    min-height: 44px;
    font-size: 0.95rem;
  }
  .btn.tiny {
    min-height: 36px;
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }

  /* Preview A4 — scale to fit; allow scroll if still wide */
  .preview {
    justify-content: flex-start;
    padding: 0.2rem 0 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .preview > div {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-stage {
    transform: scale(0.55);
    transform-origin: top left;
    margin-bottom: calc(-297mm * 0.45);
  }
  @supports (zoom: 1) {
    .sheet-stage {
      transform: none;
      zoom: 0.55;
      margin-bottom: 0;
    }
  }

  /* Consultas */
  body.mode-consultas .app-body,
  body.mode-prospeccao .app-body {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .con-filters {
    grid-template-columns: 1fr;
  }
  .consulta-wrap {
    max-height: calc(100vh - 280px);
  }
  .consulta-table {
    font-size: 0.9rem;
    min-width: 640px;
  }
  .consulta-table th,
  .consulta-table td {
    padding: 0.55rem 0.6rem;
  }
  .consulta-table th:first-child,
  .consulta-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #0b0733;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
  }
  .consulta-table th:first-child { z-index: 3; }
  .consulta-table tbody tr:hover td:first-child {
    background: #0f0a3d;
  }

  /* Arquivos Diversos */
  .prospeccao { padding: 0 0 1.2rem; }
  .prosp-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .prosp-io {
    width: 100%;
  }
  .prosp-io .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
  .prosp-grid {
    grid-template-columns: 1fr;
  }
  .prosp-list-wrap {
    max-height: none;
  }
  .prosp-actions .btn {
    flex: 1 1 auto;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.7rem 1rem 1rem;
    font-size: 0.8rem;
  }
  .version-bar {
    padding: 0.7rem 0.85rem;
    font-size: 0.8rem;
  }
  .wordmark { font-size: 1.15rem; }
  .tag { font-size: 0.78rem; }
  .app-name { font-size: 0.95rem; }
  label.field > span, .lbl {
    font-size: 0.78rem;
  }
  .card h2 {
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  .workspace { padding-bottom: 3.4rem; }
  .topbar-title { font-size: 0.9rem; }
  .btn.mode {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .sheet-stage {
    transform: scale(0.42);
    transform-origin: top left;
    margin-bottom: calc(-297mm * 0.58);
  }
  @supports (zoom: 1) {
    .sheet-stage {
      transform: none;
      zoom: 0.42;
      margin-bottom: 0;
    }
  }
  .mun-meta strong { font-size: 0.95rem; }
  .tot strong { font-size: 1.1rem; }
  .workspace-actions .btn { font-size: 0.88rem; padding: 0.55rem 0.75rem; }
  #btn-exemplo { font-size: 0.82rem; }
}

@media (max-width: 400px) {
  .sheet-stage {
    transform: scale(0.38);
    transform-origin: top left;
    margin-bottom: calc(-297mm * 0.62);
  }
  @supports (zoom: 1) {
    .sheet-stage {
      transform: none;
      zoom: 0.38;
      margin-bottom: 0;
    }
  }
  .brand-left { gap: 0.55rem; }
  .logo-ps { width: 40px; height: 40px; }
}

/* Keep print A4 intact — mobile scales must not apply to print */
@media print {
  .sheet-stage {
    transform: none !important;
    zoom: 1 !important;
    margin-bottom: 0 !important;
  }
  body { overflow-x: visible; overflow: visible; padding-bottom: 0; height: auto; }
  .app-shell, .app-main, .workspace, .app-body, .preview { height: auto !important; overflow: visible !important; }
  .app-sidebar, .sidebar-backdrop, .workspace-topbar, .version-bar, .app-footer { display: none !important; }
}

/* ===== Sidebar logo responsiveness (2026.0.0.45) ===== */
@media (max-width: 900px) {
  .sidebar-ps-logo { max-width: calc(100% - 52px); max-height: 36px; }
  .sidebar-close { width: 40px; height: 40px; margin-left: auto; }
}
@media (max-width: 400px) {
  .sidebar-brand { padding: 0.8rem 0.8rem 0.7rem; gap: 0.55rem; }
  .sidebar-ps-row { padding-bottom: 0.55rem; }
  .sidebar-ps-logo { max-height: 30px; }
}
@media (max-height: 620px) {
  .sidebar-brand { padding-top: 0.6rem; padding-bottom: 0.55rem; gap: 0.45rem; }
  .sidebar-ps-row { padding-bottom: 0.45rem; }
  .sidebar-ps-logo { max-height: 28px; }
  .sidebar-brand .tag { display: none; }
}

/* ===== Contatos da oportunidade escolhidos do cadastro (2026.0.0.49) ===== */
.fn-ct-btns { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.fn-ct-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.fn-ct-row .field { margin: 0; }
.fn-ct-row .fn-ct-info { grid-column: 1 / 2; grid-row: 2; font-size: 0.8rem; color: var(--muted); min-height: 1em; overflow-wrap: anywhere; }
.fn-ct-row .fn-ct-info.is-warn { color: #ffb86b; }
.fn-ct-row .cli-ct-del { grid-column: 2; grid-row: 1; justify-self: end; align-self: end; }
.fn-ct-row select.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
#form-novo-contato .row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
#form-novo-contato .field input.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
#form-novo-contato .funil-form-actions { margin-top: 0.6rem; }
@media (max-width: 560px) {
  .fn-ct-row { grid-template-columns: 1fr; }
  .fn-ct-row .fn-ct-info { grid-column: 1; grid-row: auto; }
  .fn-ct-row .cli-ct-del { grid-column: 1; grid-row: auto; justify-self: stretch; }
  #form-novo-contato .row-2 { grid-template-columns: 1fr; }
  .fn-ct-btns { width: 100%; }
  .fn-ct-btns .btn { flex: 1; }
}

/* Bloqueio de território derivado das oportunidades do funil (2026.0.0.61) */
#fn-vendedor.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
.kb-card-lock { font-size: 0.75rem; color: var(--cyan-bright); margin-top: 0.1rem; overflow-wrap: anywhere; }
.kb-card-a .kb-unlock { color: #ffb86b; }
.kb-card-unlocked { font-size: 0.75rem; color: var(--muted); margin-top: 0.1rem; overflow-wrap: anywhere; }

/* Validação da oportunidade (2026.0.0.55) */
#fn-etapa.is-invalid, #fn-cliente.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
.fn-tipos.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
.fn-tipos.is-invalid legend { color: #ffb4a4; }
#fn-contatos.is-invalid { border-radius: 10px; box-shadow: 0 0 0 1px #ff6b6b; padding: 0.35rem; }
.prosp-status.fn-erros ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.prosp-status.fn-erros li { margin: 0.1rem 0; }
/* Ordenação pelos cabeçalhos das grades de Arquivos Diversos (2026.0.0.55) */
.td-grid th[data-sort] { padding: 0; }
.td-sort {
  appearance: none; border: 0; background: transparent; cursor: pointer; width: 100%;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left;
  padding: 0.55rem 0.65rem; display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}
.td-sort::after { content: "↕"; opacity: 0.35; font-size: 0.9em; }
.td-sort:hover { color: #fff; }
.td-sort:hover::after { opacity: 0.7; }
.td-sort:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: -2px; }
th[aria-sort="ascending"] .td-sort::after { content: "▲"; opacity: 1; }
th[aria-sort="descending"] .td-sort::after { content: "▼"; opacity: 1; }
th.is-sorted .td-sort { color: #fff; }
.td-grid th.td-num-h .td-sort { justify-content: flex-end; }
/* Formulário de cliente aberto pelo funil («+ Novo cliente»): o Limpar já vira Cancelar */
#form-cliente.is-modal .td-cancelar { display: none; }

/* Data e hora do cadastro da oportunidade (2026.0.0.56) */
.kb-card-dt { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.fn-datas { margin: 0.2rem 0 0.4rem; font-size: 0.82rem; color: var(--muted); }
.fn-datas b { color: var(--text); font-weight: 650; }
.fn-dt-lbl { text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--cyan-bright); font-weight: 700; }
.fn-dt-sep { opacity: 0.6; margin: 0 0.15rem; }
.fn-dt-tz { font-size: 0.75rem; opacity: 0.8; }

/* Quem apresenta no Funil (2026.0.0.57) */
.kb-card-apr { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; overflow-wrap: anywhere; }
.fn-apres-add { justify-self: start; margin-top: 0.5rem; }
.fn-apres { border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 0.55rem 0.7rem 0.6rem; margin-top: 0.6rem; }
.fn-apres.is-etapa { border-color: var(--accent, #22c3e6); }
.fn-apres legend { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 0 0.3rem; }
.fn-apres-grid { display: grid; gap: 0.55rem 0.7rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr); }
.fn-apres-hint { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.fn-apres-hint:empty { display: none; }
@media (max-width: 900px) { .fn-apres-grid { grid-template-columns: 1fr 1fr; } .fn-apres-grid .fn-apr { grid-column: 1 / -1; } }

/* Observação por etapa (2026.0.0.58) */
.fn-obs-etapa { margin-top: 0.7rem; }
.fn-obs-etapa textarea { width: 100%; box-sizing: border-box; min-height: 4.2rem; resize: vertical; font: inherit; color: var(--text, #fff); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; padding: 0.5rem 0.6rem; }
.fn-obs-etapa textarea:disabled { opacity: 0.55; }
.fn-obs-etapa textarea.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }
.fn-obs-cont { display: block; text-align: right; font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.fn-obs-cont.is-warn { color: #ffb86b; }
.fn-obs-hist:empty { display: none; }
.fn-obs-hist { margin-top: 0.4rem; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 0.45rem 0.65rem; }
.fn-obs-hist h4 { margin: 0 0 0.35rem; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.fn-oh-item { padding: 0.35rem 0; border-top: 1px dashed rgba(255,255,255,0.1); font-size: 0.82rem; }
.fn-oh-item:first-of-type { border-top: 0; }
.fn-oh-item.is-atual .fn-oh-nome::after { content: " · etapa escolhida"; font-weight: 400; color: var(--muted); }
.fn-oh-nome { font-weight: 600; }
.fn-oh-dt { color: var(--muted); font-size: 0.74rem; margin-left: 0.35rem; }
.fn-oh-txt { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0.15rem 0 0; }
.fn-oh-item details { margin-top: 0.2rem; font-size: 0.78rem; color: var(--muted); }
.fn-oh-item details summary { cursor: pointer; }
.fn-oh-ver { margin: 0.2rem 0 0 0.6rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-card-oe { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Botão «+ Novo» ao lado das listas de cadastro (2026.0.0.59) */
.sel-novo { display: flex; align-items: stretch; gap: 0.4rem; min-width: 0; }
.sel-novo > select { flex: 1 1 auto; min-width: 0; }
.sel-novo > .sel-novo-btn { flex: 0 0 auto; white-space: nowrap; padding: 0.35rem 0.65rem; font-size: 0.8rem; }

/* Filtros de Vendedor e Apresentador do kanban, seleção múltipla (2026.0.0.60) */
.kb-ms-sep { flex-basis: 100%; height: 0; }
.kb-ms { position: relative; }
.kb-ms > summary { list-style: none; display: inline-block; user-select: none; }
.kb-ms > summary::-webkit-details-marker { display: none; }
.kb-ms.is-on > summary { background: var(--cyan); border-color: var(--cyan); color: #0b0830; }
.kb-ms-sum b { font-weight: 700; }
.kb-ms-pop { position: absolute; z-index: 30; top: calc(100% + 0.3rem); left: 0; min-width: 220px; max-width: 320px; max-height: 300px; overflow: auto; background: #1a1446; border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 0.4rem; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.kb-ms-op { display: flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.4rem; border-radius: 6px; font-size: 0.84rem; cursor: pointer; }
.kb-ms-op:hover { background: rgba(255,255,255,0.06); }
.kb-ms-acoes { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 0.3rem; padding-top: 0.35rem; text-align: right; }

/* Memória de Cálculo › Regras de precificação – Municípios (2026.0.0.63; uma linha por degrau desde 2026.0.0.65).
   Na Memória a prévia da proposta some e a coluna fica para as regras. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.mode-memoria .preview-proposta { display: none !important; }
body.mode-memoria #btn-print,
body.mode-memoria #btn-exemplo { display: none; }
@media (min-width: 1181px) {
  body.mode-memoria .app-body { grid-template-columns: minmax(290px, 330px) minmax(0, 1fr); }
}
.regras-mun { min-width: 0; }
.regras-mun .note-poderes { margin-top: 0; }
.rg-ajuda { margin: -0.2rem 0 0.7rem; font-size: 0.78rem; color: var(--muted); max-width: 640px; }
.rg-aviso { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin: 0 0 0.8rem; padding: 0.55rem 0.75rem; border-radius: 8px; background: rgba(255, 224, 138, 0.12); border: 1px solid rgba(255, 224, 138, 0.45); color: #ffe08a; font-size: 0.84rem; }
.rg-aviso[hidden] { display: none; }
.rg-aviso p { margin: 0; flex: 1 1 20rem; }
.rg-local { margin: 0 0 0.8rem; font-size: 0.82rem; color: var(--cyan-bright); }
.rg-gerais { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.55rem 0.75rem; margin-bottom: 0.7rem; max-width: 640px; }
.rg-grupo-barra {
  display: grid; grid-template-columns: minmax(200px, 1.6fr) minmax(110px, 0.8fr) minmax(90px, 0.6fr) auto;
  gap: 0.45rem 0.6rem; align-items: end; padding: 0.6rem 0.7rem; margin-bottom: 0.55rem;
  border: 1px solid rgba(47, 205, 238, 0.28); border-radius: 10px; background: rgba(10, 169, 204, 0.06);
}
.rg-grupo-barra .btn { white-space: nowrap; }
.rg-quedas { margin: 0 0 0.45rem; font-size: 0.84rem; }
.rg-quedas.is-ok { color: #b9f5d8; }
.rg-quedas.is-erro { color: #ffb4a4; font-weight: 650; }
/* Tabela rolável com cabeçalho fixo (também no celular). */
.rg-scroll { max-height: min(70vh, 44rem); overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; }
.rg-scroll:focus { outline: 1px solid var(--cyan-bright); }
.rg-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; min-width: 640px; }
.rg-table th, .rg-table td { padding: 0.22rem 0.25rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rg-table th { position: sticky; top: 0; z-index: 2; background: #0b0733; font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.rg-table th.num, .rg-table td.num { text-align: right; }
.rg-table td.rg-n { color: var(--cyan-bright); font-weight: 700; text-align: right; width: 1.6rem; font-variant-numeric: tabular-nums; }
.rg-table td.rg-grupo { width: 8.4rem; max-width: 8.4rem; }
.rg-grupo-btn { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-size: 0.72rem; line-height: 1.2; color: var(--muted); text-align: left; cursor: pointer; }
.rg-grupo-btn:hover, .rg-grupo-btn:focus { color: var(--cyan-bright); text-decoration: underline; outline: none; }
.rg-table tr.rg-ini-grupo td { border-top: 2px solid rgba(47, 205, 238, 0.5); }
.rg-table tr.rg-ini-grupo .rg-grupo-btn, .rg-table tr:first-child .rg-grupo-btn { color: var(--cyan-bright); font-weight: 650; }
.rg-table input, .rg-table select {
  width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: 0.8rem; color: var(--text);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 6px; padding: 0.26rem 0.35rem;
  font-variant-numeric: tabular-nums;
}
.rg-table select { min-width: 6.4rem; padding-right: 0.1rem; }
.rg-table input:disabled { opacity: 0.4; }
.rg-table input:focus, .rg-table select:focus { outline: none; border-color: var(--cyan-bright); }
.rg-table [data-rg="de"] { min-width: 5.6rem; }
.rg-table [data-rg="ate"] { min-width: 6.3rem; }
.rg-table [data-rg="redutor"] { min-width: 2.9rem; }
.rg-table [data-rg="acrescimo"] { min-width: 6.4rem; text-align: right; }
.rg-table td.rg-preco { white-space: nowrap; min-width: 6.6rem; font-variant-numeric: tabular-nums; cursor: help; }
.rg-table td.rg-preco strong { color: #d8fff8; font-weight: 650; }
.rg-table .rg-queda, .rg-table .rg-antes, .rg-table .rg-bruto { display: block; font-size: 0.7rem; }
.rg-table .rg-bruto { color: var(--muted); }
.rg-table .rg-queda { color: #ffb4a4; font-weight: 700; }
.rg-table .rg-antes { color: var(--muted); }
.rg-table tr.rg-cai td { background: rgba(237, 120, 92, 0.2); }
.rg-table tr.rg-cai td.rg-preco strong { color: #ffd0c4; }
.rg-table tr.is-invalid td { background: rgba(237, 120, 92, 0.12); }
.rg-table tr.is-invalid td.rg-n { color: #ffb4a4; }
.rg-acoes { white-space: nowrap; width: 3.6rem; }
.rg-acoes .btn { padding: 0.1rem 0.45rem; font-size: 0.86rem; line-height: 1.2; }
.rg-acoes .btn + .btn { margin-left: 0.15rem; }
.rg-linha-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin: 0.55rem 0; }
.rg-dica { font-size: 0.76rem; color: var(--muted); flex: 1 1 20rem; }
.rg-valid { font-size: 0.84rem; border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0.4rem 0 0.7rem; }
.rg-valid p, .rg-valid ul { margin: 0.15rem 0; }
.rg-valid ul { padding-left: 1.15rem; }
.rg-valid.is-ok { background: rgba(62, 207, 142, 0.1); color: #b9f5d8; }
.rg-valid.is-erro { background: rgba(237, 120, 92, 0.14); color: #ffd0c4; }
.rg-valid .rg-sujo { color: #ffe08a; font-weight: 650; }
.rg-barra { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.rg-barra #rg-salvar.is-sujo { box-shadow: 0 0 0 3px rgba(255, 224, 138, 0.35); }
.rg-status { min-height: 1.2em; margin: 0.45rem 0 0; font-size: 0.84rem; color: #b9f5d8; }
.rg-status.is-erro { color: #ffb4a4; }
.rg-sim { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.rg-sim-passos { margin: 0; padding: 0.55rem 0.75rem 0.55rem 1.9rem; font-size: 0.86rem; line-height: 1.5; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 8px; }
.rg-sim-passos li + li { margin-top: 0.15rem; }
@media (max-width: 760px) {
  .rg-grupo-barra { grid-template-columns: 1fr 1fr; }
  .rg-grupo-barra .rg-g-grupo, .rg-grupo-barra .btn { grid-column: 1 / -1; }
  .rg-scroll { max-height: 70vh; }
  .rg-table input, .rg-table select, .rg-grupo-barra input, .rg-grupo-barra select { font-size: 16px; }
  .rg-sim { grid-template-columns: 1fr; }
  .rg-barra .btn { flex: 1 1 auto; }
}

/* ===== Links, aviso e janela de sincronização (antes no bloco de backup da 2026.0.0.71, que saiu na 2026.0.0.75) ===== */
.nv-link {
  appearance: none; background: transparent; border: 0; padding: 0.2rem 0; cursor: pointer;
  color: var(--cyan-bright); font: inherit; font-size: 0.8rem; text-decoration: underline; text-align: center;
}
.nv-aviso {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 0.45rem 0.7rem;
  padding: 0.5rem 1.1rem;
  background: rgba(47, 205, 238, 0.1);
  border-bottom: 1px solid rgba(47, 205, 238, 0.45);
  color: var(--cyan-bright); font-size: 0.82rem;
}
.nv-aviso.is-err { background: rgba(255, 224, 138, 0.12); border-bottom-color: rgba(255, 224, 138, 0.45); color: #ffe08a; }
.nv-aviso[hidden] { display: none; }
.nv-aviso p { margin: 0; flex: 1 1 auto; }
.nv-aviso .cp-modal-x { flex: 0 0 auto; }
.nv-resumo { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.nv-resumo th, .nv-resumo td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: right; }
.nv-resumo th:first-child, .nv-resumo tbody th { text-align: left; font-weight: 600; }
.nv-alerta { margin: 0.8rem 0; padding: 0.55rem 0.75rem; border-radius: 8px; background: rgba(255, 224, 138, 0.12); border: 1px solid rgba(255, 224, 138, 0.45); color: #ffe08a; font-size: 0.84rem; }
.nv-modal-acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
@media print { .nv-aviso { display: none !important; } }

/* ===== Login e servidor compartilhado (2026.0.0.72) ===== */
.nv-tela { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(circle at 30% 20%, #1d1260 0%, #07041f 70%); overflow-y: auto; }
.nv-tela[hidden] { display: none; }
body.nv-bloqueado { overflow: hidden; }
.nv-caixa { width: min(400px, 100%); background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; padding: 1.5rem 1.4rem 1.2rem; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55); }
.nv-logo { display: block; height: 46px; width: auto; margin: 0 auto 0.8rem; }
.nv-caixa h1 { font-size: 1.25rem; margin: 0 0 0.9rem; text-align: center; }
.nv-caixa form, #nv-form-semperfil { display: flex; flex-direction: column; gap: 0.7rem; }
.nv-caixa [hidden] { display: none !important; }
.nv-caixa .field input { width: 100%; }
.nv-caixa .nv-ok { width: 100%; min-height: 44px; margin-top: 0.2rem; }
.nv-sub { margin: 0; font-size: 0.86rem; color: var(--muted); }
.nv-msg { margin: 0.8rem 0 0; font-size: 0.86rem; min-height: 1.1em; }
.nv-msg:empty { display: none; }
.nv-msg.is-err { color: #ff9b9b; }
.nv-msg.is-ok { color: var(--cyan-bright); }
.nv-rodape { margin: 0.9rem 0 0; font-size: 0.72rem; color: var(--muted); text-align: center; }
.nv-status { font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.nv-status[data-estado="ok"], .nv-pill[data-estado="ok"] { color: #7ee2a8; }
.nv-status[data-estado="sync"], .nv-pill[data-estado="sync"] { color: var(--cyan-bright); }
.nv-status[data-estado="off"], .nv-pill[data-estado="off"], .nv-status[data-estado="err"], .nv-pill[data-estado="err"] { color: #ffe08a; }
.nv-pill { flex: 0 0 auto; font-size: 0.74rem; font-weight: 650; padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.nv-pill[hidden] { display: none; }
.nv-so-admin { display: none; margin: 0 0 0.7rem; padding: 0.5rem 0.7rem; border-radius: 8px; background: rgba(255, 224, 138, 0.12); border: 1px solid rgba(255, 224, 138, 0.45); color: #ffe08a; font-size: 0.82rem; }
body.nv-nao-admin .nv-so-admin { display: block; }
.nv-resumo th { width: 9rem; }
.nv-resumo td { text-align: left !important; }
@media (max-width: 560px) { .nv-pill { font-size: 0.68rem; padding: 0.2rem 0.45rem; } }
@media print { .nv-tela, .nv-pill, .nv-user { display: none !important; } }

/* ===== 2026.0.0.74 — Perfis (Administrador / Vendedor / Consulta), Administração › Usuários e Auditoria ===== */
body:not(.nv-admin) #nav-group-adm { display: none !important; }
body:not(.mode-adm) .only-adm { display: none !important; }
body.mode-adm .editor,
body.mode-adm .preview { display: none !important; }
body.mode-adm .app-body { display: block; max-width: none; margin: 0; }
body.mode-adm #btn-print,
body.mode-adm #btn-exemplo { display: none; }
body.mode-usuarios #adm-auditoria,
body.mode-auditoria #adm-usuarios { display: none; }
.admin .card { margin-bottom: 1rem; }
@media print { .only-adm, #nav-group-adm, .nv-selo { display: none !important; } }

.nv-selo { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  background: rgba(47, 205, 238, 0.14); border: 1px solid rgba(47, 205, 238, 0.55); color: var(--cyan-bright); white-space: nowrap; }
.nv-selo[hidden] { display: none; }

/* Perfil Consulta: some tudo o que grava. */
body.nv-consulta .td-add,
body.nv-consulta [id$="-csv-imp"],
body.nv-consulta .td-form [id^="btn-"][id$="-excluir"],
body.nv-consulta .td-form [id^="btn-"][id$="-salvar"],
body.nv-consulta .td-form [id^="btn-"][id$="-novo"],
body.nv-consulta #btn-fn-abrir,
body.nv-consulta #btn-fn-salvar,
body.nv-consulta #btn-fn-novo-cli,
body.nv-consulta #btn-fn-novo-contato,
body.nv-consulta #btn-fn-add-contato,
body.nv-consulta #btn-fn-apres,
body.nv-consulta #btn-nc-salvar,
body.nv-consulta #btn-restaurar,
body.nv-consulta [data-bk="restaurar"],
body.nv-consulta [data-novo],
body.nv-consulta .kb-card [data-mv],
body.nv-consulta .kb-card [data-del],
body.nv-consulta .kb-card [data-unlock],
body.nv-consulta .kb-rename,
body.nv-consulta .prosp-form .danger { display: none !important; }
body.nv-consulta .kb-card { cursor: default; }
body.nv-consulta :is(.td-form, #form-funil, #form-novo-contato, .td-modal .prosp-form) :is(input, select, textarea) { pointer-events: none; opacity: 0.8; }
/* Regras de preço: só o Administrador altera (Vendedor e Consulta só leem). */
body.nv-nao-admin :is(#btn-restaurar, #rg-salvar, #rg-descartar, #rg-padrao, #rg-importar, #rg-add, #rg-g-aplicar, [data-rg-excluir], [data-rg-dividir], [data-rg-del]) { display: none !important; }
body.nv-nao-admin :is(#memoria, .only-mem) :is(input, select, textarea):not(#rg-sim-pop):not(.sel-produto-foco) { pointer-events: none; opacity: 0.8; }

/* Usuários */
.adm-legenda { list-style: none; margin: 0.4rem 0 0.9rem; padding: 0.6rem 0.8rem; display: grid; gap: 0.35rem; font-size: 0.82rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.adm-legenda li { line-height: 1.4; }
.adm-papel { display: inline-block; padding: 0.08rem 0.5rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; margin-right: 0.3rem; white-space: nowrap; }
.adm-papel-admin { background: rgba(247, 148, 58, 0.16); color: #ffc58a; border: 1px solid rgba(247, 148, 58, 0.5); }
.adm-papel-vendedor { background: rgba(10, 169, 204, 0.14); color: var(--cyan-bright); border: 1px solid rgba(10, 169, 204, 0.5); }
.adm-papel-consulta { background: rgba(169, 163, 201, 0.14); color: #d9d5ef; border: 1px solid rgba(169, 163, 201, 0.45); }
.adm-tag { display: inline-block; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 6px; font-size: 0.7rem; background: rgba(255, 224, 138, 0.14); color: #ffe08a; }
#td-cards-usu .td-card { cursor: pointer; }
#lista-usuarios tr.is-desativado td { opacity: 0.6; }
#lista-usuarios td.td-chk { text-align: center; }
#lista-usuarios td.td-chk input { width: 1.05rem; height: 1.05rem; accent-color: var(--coral); cursor: pointer; }
.td-sub { font-size: 0.74rem; color: var(--muted); margin-top: 0.1rem; }
#modal-usuario .cp-modal-box { width: min(620px, 100%); }
.usu-papeis { border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.7rem; margin: 0.4rem 0 0.6rem; display: grid; gap: 0.35rem; }
.usu-papeis legend { font-size: 0.8rem; color: var(--muted); padding: 0 0.3rem; }
.usu-papel { display: grid; grid-template-columns: auto 1fr; column-gap: 0.45rem; align-items: center; cursor: pointer; font-size: 0.88rem; }
.usu-papel small { grid-column: 2; color: var(--muted); font-size: 0.76rem; }
.usu-check { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.45rem 0; font-size: 0.86rem; cursor: pointer; }
.usu-check input { margin-top: 0.2rem; accent-color: var(--coral); }
.usu-check span { color: var(--muted); }
.usu-check strong { color: var(--text); }
#usu-wrap-vend.is-off { opacity: 0.5; }

/* Auditoria */
.aud-filtros { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem 0.7rem; align-items: end; margin: 0.4rem 0 0.6rem; }
.aud-filtros .aud-busca { grid-column: span 2; }
.aud-botoes { display: flex; gap: 0.4rem; flex-wrap: wrap; grid-column: 1 / -1; }
.aud-grid tbody tr.aud-linha { cursor: pointer; }
.aud-grid tbody tr.aud-linha:hover td, .aud-grid tbody tr.aud-linha:focus td { background: rgba(47, 205, 238, 0.07); }
.aud-dif { max-width: 34rem; font-size: 0.78rem; color: var(--muted); word-break: break-word; }
.aud-op { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 6px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.aud-op-insert { background: rgba(80, 200, 120, 0.15); color: #8be3a8; }
.aud-op-update { background: rgba(255, 224, 138, 0.14); color: #ffe08a; }
.aud-op-delete { background: rgba(237, 120, 92, 0.18); color: #ffab95; }
.aud-op-convite, .aud-op-reenvio, .aud-op-senha { background: rgba(47, 205, 238, 0.14); color: var(--cyan-bright); }
.aud-pager { display: flex; gap: 0.7rem; align-items: center; justify-content: flex-end; margin-top: 0.6rem; font-size: 0.84rem; color: var(--muted); }
.aud-detalhe-box { width: min(900px, 100%) !important; }
.aud-cab { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.4rem 1rem; margin: 0 0 0.6rem; }
.aud-cab dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.aud-cab dd { margin: 0; font-size: 0.88rem; word-break: break-word; }
.aud-resumo { font-size: 0.84rem; padding: 0.45rem 0.6rem; border-left: 3px solid #ffe08a; background: rgba(255, 224, 138, 0.06); word-break: break-word; }
.aud-antes-depois th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; }
.aud-antes-depois td { word-break: break-word; max-width: 22rem; }
.aud-antes-depois tr.is-mudou th, .aud-antes-depois tr.is-mudou td { background: rgba(255, 224, 138, 0.13); }
.aud-antes-depois tr.is-mudou td:last-child { color: #ffe08a; font-weight: 600; }
.aud-json { display: block; white-space: pre-wrap; font-size: 0.74rem; max-height: 12rem; overflow: auto; }
body.nv-nao-admin .rg-grupo-barra { display: none !important; }

/* ===== 2026.0.0.76 — Foto (avatar), menu do usuário no canto superior direito e Editar perfil ===== */
.cp-avatar { --av-h: 260; --av-t: 34px; position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: var(--av-t); height: var(--av-t); border-radius: 50%; overflow: hidden; user-select: none;
  background: linear-gradient(135deg, hsl(var(--av-h) 62% 46%), hsl(calc(var(--av-h) + 40) 70% 36%));
  color: #fff; font-weight: 750; font-size: calc(var(--av-t) * 0.4); letter-spacing: 0.02em; line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.cp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-avatar-lg { --av-t: 48px; }
.cp-avatar-xl { --av-t: 84px; }
.nv-user { position: relative; flex: 0 0 auto; display: flex; align-items: center; margin-left: 0.15rem; }
.nv-user[hidden] { display: none; }
.nv-avatar-btn { appearance: none; border: 0; padding: 2px; border-radius: 50%; background: transparent; cursor: pointer; display: inline-flex;
  box-shadow: 0 0 0 2px rgba(47, 205, 238, 0.35); transition: box-shadow 0.15s; }
.nv-avatar-btn:hover, .nv-avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--cyan-bright); }
.nv-avatar-btn:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 2px; }
.nv-avatar-btn .cp-avatar { --av-t: 38px; }
.nv-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: min(300px, calc(100vw - 1.5rem));
  background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; padding: 0.45rem;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; gap: 0.15rem; }
.nv-menu[hidden] { display: none; }
.nv-menu-head { display: flex; gap: 0.7rem; align-items: center; padding: 0.45rem 0.5rem 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 0.2rem; }
.nv-menu-id { min-width: 0; display: flex; flex-direction: column; gap: 0.18rem; }
.nv-menu-id .nv-nome { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-menu-email { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-menu .nv-status { padding: 0.1rem 0.55rem 0.35rem; }
.nv-menu-item { appearance: none; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 0.9rem;
  padding: 0.6rem 0.6rem; border-radius: 8px; cursor: pointer; display: flex; gap: 0.55rem; align-items: center; min-height: 42px; }
.nv-menu-item:hover, .nv-menu-item:focus-visible { background: rgba(47, 205, 238, 0.12); outline: none; }
.nv-menu-item[data-nv="sair"] { color: #ffb4a2; }
@media (max-width: 900px) {
  .topbar-brand { flex: 1 1 0; min-width: 0; overflow: hidden; }
  .nv-user { order: 2; margin-left: auto; }
  .workspace-topbar .nv-selo { order: 5; }
  .workspace-topbar .workspace-actions { order: 4; }
  .nv-avatar-btn .cp-avatar { --av-t: 36px; }
}
@media (max-width: 400px) { .topbar-logo { max-width: 104px; } }
.usu-nome-cel { display: flex; gap: 0.55rem; align-items: center; min-width: 0; }
.usu-nome-cel .cp-avatar { --av-t: 32px; }
.av-campo { display: flex; gap: 0.9rem; align-items: center; margin: 0.2rem 0 0.7rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.av-campo-acoes { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.av-campo-rotulo { font-size: 0.8rem; color: var(--muted); }
.av-campo-botoes { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.av-campo-botoes .btn[hidden] { display: none; }
.av-campo-nota { font-size: 0.74rem; color: var(--muted); line-height: 1.35; }
.av-campo-nota.is-err { color: #ff9b9b; }
#modal-perfil .cp-modal-box { width: min(560px, 100%); }
#modal-perfil input[readonly] { opacity: 0.75; cursor: default; }
.pf-senha { border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.7rem 0.6rem; margin: 0.5rem 0 0.6rem; }
.pf-senha legend { font-size: 0.8rem; color: var(--muted); padding: 0 0.3rem; }
@media print { .nv-user, .nv-menu, #modal-perfil { display: none !important; } }

/* ===== Produtos (2026.0.0.77) ===== */
body:not(.mode-prod) .only-prod { display: none !important; }
body.mode-prod .editor,
body.mode-prod .preview { display: none !important; }
body.mode-prod .app-body { display: block; max-width: none; margin: 0; }
body.mode-prod #btn-print,
body.mode-prod #btn-exemplo { display: none; }
body.nv-nao-admin #btn-prod-add { display: none !important; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.9rem; margin-top: 0.4rem; }
.prod-card { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); min-width: 0; }
.prod-card.is-inativo { opacity: 0.62; }
.prod-card-logo { height: 76px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 0.5rem; }
.prod-card-logo img { max-height: 60px; max-width: 100%; object-fit: contain; }
.prod-sem-logo { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; height: 54px; padding: 0 0.6rem; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; letter-spacing: 0.04em; }
.prod-card-info { min-width: 0; }
.prod-card-info h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.prod-card-info h3 small { font-size: 0.72rem; color: var(--muted); font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.45rem; margin-left: 0.25rem; vertical-align: middle; }
.prod-card-desc { margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.prod-card-num { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.8rem; margin: 0; }
.prod-card-num div { min-width: 0; }
.prod-card-num dt { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.prod-card-num dd { margin: 0; font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.prod-card-meta { margin: 0.55rem 0 0; font-size: 0.78rem; color: var(--muted); }
.prod-status { font-weight: 700; color: #ff9b9b; }
.prod-status.is-on { color: #7ee0a1; }
.prod-card-acoes { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: auto; }
.prod-card-acoes .btn { flex: 1 1 auto; min-height: 38px; }
.prod-vazio { color: var(--muted); }
#prod-msg.is-err { color: #ff9b9b; }
#modal-produto .cp-modal-box { width: min(620px, 100%); }
#modal-produto input[readonly] { opacity: 0.75; cursor: default; }
#modal-produto .btn[hidden], #prod-copiar-wrap[hidden] { display: none !important; }
.prod-logo-campo { display: flex; gap: 0.9rem; align-items: center; margin: 0.2rem 0 0.7rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.prod-logo-prev { flex: 0 0 auto; width: 150px; height: 76px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 0.4rem; color: #777; font-size: 0.75rem; }
.prod-logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.prod-logo-prev .prod-sem-logo { background: #eee; color: #888; font-weight: 600; font-size: 0.75rem; height: auto; padding: 0.4rem; }
.prod-ativo { margin: 0.2rem 0 0.6rem; }
.prod-regras-resumo { font-size: 0.8rem; color: var(--muted); line-height: 1.4; margin: 0.1rem 0 0.7rem; }
#prod-status.is-err { color: #ff9b9b; }
.prod-foco { display: flex; gap: 0.7rem; align-items: flex-end; margin: 0.3rem 0 0.4rem; }
.prod-foco .field { flex: 1 1 auto; margin: 0; min-width: 0; }
.prod-foco .sel-produto-foco { font-weight: 700; }
.prod-foco-logo { flex: 0 0 auto; height: 42px; max-width: 120px; display: flex; align-items: center; }
.prod-foco-logo:empty { display: none; }
.prod-foco-logo img { max-height: 38px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 6px; }
.prod-foco-nota { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.6rem; line-height: 1.4; }
.rg-produto { font-size: 0.85em; color: var(--cyan-bright); font-weight: 700; }
#consultas .prod-foco { max-width: 520px; }
body.nv-nao-admin :is(#memoria, .only-mem) .sel-produto-foco { pointer-events: auto; opacity: 1; }
@media (max-width: 600px) {
  .prod-grid { grid-template-columns: 1fr; }
  .prod-logo-campo { flex-direction: column; align-items: flex-start; }
}
@media print { .only-prod, #modal-produto, .prod-foco, .prod-foco-nota { display: none !important; } }

/* ===== Modelos de proposta (2026.0.0.78) ===== */
body:not(.mode-modelos) .only-mod { display: none !important; }
body.mode-modelos .editor,
body.mode-modelos .preview { display: none !important; }
body.mode-modelos .app-body { display: block; max-width: none; margin: 0; }
body.mode-modelos #btn-print,
body.mode-modelos #btn-exemplo { display: none; }
.mod-top { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: flex-end; margin: 0.4rem 0 0.3rem; }
.mod-alvo-f { flex: 1 1 260px; margin: 0; min-width: 0; }
.mod-alvo-f select { font-weight: 700; }
.mod-tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.mod-tab { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: inherit; border-radius: 999px; padding: 0.45rem 0.9rem; font: inherit; font-size: 0.86rem; cursor: pointer; min-height: 38px; }
.mod-tab.is-on { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
.mod-acoes { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.mod-acoes .btn[hidden] { display: none !important; }
.mod-msg { min-height: 1.2em; }
.mod-msg.is-err { color: #ff9b9b; }
.mod-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1rem; align-items: start; }
.mod-form { min-width: 0; }
.mod-grupo { border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.75rem 0.7rem; margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.1rem 0.8rem; min-width: 0; }
.mod-grupo legend { font-size: 0.8rem; color: var(--cyan-bright, #2fcdee); font-weight: 700; padding: 0 0.35rem; }
.mod-f { flex: 1 1 200px; min-width: 0; margin: 0.25rem 0; }
.mod-f.largo, .mod-img, .mod-bloco .mod-f.largo { flex-basis: 100%; }
.mod-f textarea { width: 100%; resize: vertical; min-height: 3.2em; font: inherit; }
.mod-chk { display: flex; align-items: center; gap: 0.45rem; flex-basis: 100%; }
.mod-chk input { width: auto; }
.mod-dica { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.3; }
.mod-nota { font-size: 0.8rem; color: var(--muted); line-height: 1.4; margin: 0 0 0.7rem; }
.mod-img-row { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.mod-img-prev { width: 150px; height: 76px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#e9e9ef 0% 25%, #fff 0% 50%) 50% / 14px 14px; border-radius: 10px; padding: 0.3rem; flex: 0 0 auto; }
.mod-img-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mod-img-prev .prod-sem-logo { background: #eee; color: #777; font-weight: 600; font-size: 0.72rem; height: auto; padding: 0.35rem; text-align: center; }
.mod-img-bts { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }
.mod-img-bts .btn[hidden] { display: none; }
.mod-pagina { position: relative; padding-top: 0.4rem; }
.mod-pagina > .mod-ops { flex-basis: 100%; justify-content: flex-end; }
.mod-ops { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }
.mod-ops .btn { min-width: 34px; min-height: 32px; }
.mod-ops .btn[hidden], .mod-add-bloco[hidden], .mod-add-pg[hidden] { display: none !important; }
.mod-del { color: #ff9b9b; }
.mod-bloco { flex-basis: 100%; border: 1px dashed var(--line); border-radius: 10px; padding: 0.45rem 0.6rem 0.55rem; margin: 0.35rem 0; display: flex; flex-wrap: wrap; gap: 0 0.8rem; min-width: 0; }
.mod-bloco-top { flex-basis: 100%; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.mod-add-bloco { flex-basis: 100%; display: flex; gap: 0.45rem; margin-top: 0.4rem; flex-wrap: wrap; }
.mod-add-bloco select { flex: 1 1 200px; min-width: 0; }
.mod-add-pg { margin: 0 0 0.8rem; }
.mod-prev-col { position: sticky; top: 0.5rem; min-width: 0; }
.mod-prev-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.mod-prev-head .field { margin: 0; }
.mod-prev-aviso { margin: 0 0 0.5rem; padding: 0.45rem 0.6rem; border-radius: 8px; background: rgba(237, 120, 92, 0.16); border-left: 3px solid #ed785c; font-size: 0.8rem; }
.mod-prev { max-height: calc(100vh - 9rem); overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.25); padding: 10px; }
.mod-prev-stage { zoom: 0.5; display: flex; flex-direction: column; align-items: center; gap: 8mm; }
.mod-prev .ap-group { display: flex; flex-direction: column; gap: 8mm; }
/* A prévia usa a área útil da folha impressa (A4 com margens): 190 × 272 mm. */
.mod-prev .sheet { width: 190mm; }
.mod-prev .sheet-fixed { height: 272mm; }
.mod-prev-vazio { color: var(--muted); font-size: 1.6rem; padding: 2rem; }
@media (max-width: 1100px) {
  .mod-wrap { grid-template-columns: 1fr; }
  .mod-prev-col { position: static; }
  .mod-prev { max-height: none; }
}
@media (max-width: 600px) {
  .mod-prev-stage { zoom: 0.42; }
  .mod-acoes .btn { flex: 1 1 auto; }
  .mod-img-row { align-items: flex-start; }
}
@media print { .only-mod { display: none !important; } }

/* Capa: destaques genéricos (posição define a cor, enquadramento define o alinhamento) e lista de produtos da capa PublicSoft */
.cover-cards.um { grid-template-columns: 1fr; }
.cover-card-img.cc-centro { align-items: center; }
.cover-card-img.cc-centro img { height: 50mm; }
.cover-card-img.cc-base { align-items: flex-end; }
.cover-card-img.cc-base img { height: 54mm; }
.cover-card-img.cc-cor1 { background: linear-gradient(160deg, rgba(10, 169, 204, 0.22) 0%, rgba(20, 13, 72, 0.9) 100%); }
.cover-card-img.cc-cor2 { background: linear-gradient(160deg, rgba(237, 120, 92, 0.22) 0%, rgba(58, 20, 82, 0.85) 100%); border-bottom-color: #ed785c; }
.cover-nome { font-size: 40px; font-weight: 800; color: #f1eefa; letter-spacing: -0.01em; }
.cover-prods { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; margin-top: 8mm; }
.cover-prods.n1 { grid-template-columns: 1fr; }
.cover-prods.n3 { grid-template-columns: 1fr 1fr 1fr; }
.cover-prod { border: 1px solid rgba(241, 238, 250, 0.12); border-top: 3px solid #0aa9cc; border-radius: 10px; background: rgba(20, 13, 72, 0.78); padding: 4mm 4.5mm; display: flex; flex-direction: column; gap: 2.5mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cover-prod:nth-child(even) { border-top-color: #ed785c; }
.cover-prod-logo { height: 20mm; display: flex; align-items: center; justify-content: flex-start; }
.cover-prod-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.cover-prod-nome { font-size: 20px; font-weight: 800; color: #f1eefa; }
.cover-prod p { margin: 0; font-size: 10.5px; line-height: 1.45; color: #a9a3c9; }
.cover-prod p strong { color: #f1eefa; }
.ap-par { margin: 0 0 5mm; font-size: 11px; line-height: 1.55; color: #c9c4e6; }
.ap-par strong { color: #f1eefa; }
.sheet-product-nome { margin: 0; font-size: 18px; font-weight: 800; color: #f1eefa; text-align: right; }
.closing-prod { margin-top: -5mm; }

/* ===== Proposta com vários produtos (2026.0.0.79) ===== */
.cot-prod-logo { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 24px; margin-right: 0.45rem; vertical-align: middle; background: #fff; border-radius: 5px; padding: 2px 4px; }
.cot-prod-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cot-prod-nome { vertical-align: middle; }
.prod-linha td.name { white-space: normal; }
.fn-produtos { border: 1px solid var(--line); border-radius: 12px; padding: 0.45rem 0.7rem 0.6rem; margin: 0 0 0.7rem; }
.fn-produtos[hidden] { display: none !important; }
.fn-produtos.is-invalid { border-color: #ff6b6b; }
.fn-produtos legend { font-size: 0.8rem; color: var(--muted); padding: 0 0.3rem; }
.fn-produtos-grid { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.fn-prod-check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; padding: 0.15rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.fn-prod-check input { width: auto; margin: 0; }
.kb-card-prod { font-size: 0.74rem; color: var(--cyan-bright, #2fcdee); margin: 0.1rem 0 0.15rem; }
@media (max-width: 600px) { .fn-prod-check { flex: 1 1 100%; } .cot-prod-logo { width: 42px; } }


/* 2026.0.0.79 — impressão: a área útil do A4 (190 mm ≈ 718 px) cai na regra de "tela estreita" (max-width: 900px),
   que devolvia margens internas ao layout. Isso empurrava a capa 4 mm para baixo e criava páginas em branco
   (uma fatia da capa na página 2 e uma página vazia no fim). Zera as margens só na impressão. */
@media print {
  .app-shell, .app-main, .workspace, .app-body, .preview, .preview-proposta, .sheet-stage {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
  }
}


/* 2026.0.0.81 — Funil: produtos em tabela (um abaixo do outro, colunas = tipos de cliente) */
.fn-prod-tabela-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.fn-prod-tabela { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 560px; }
.fn-prod-tabela th, .fn-prod-tabela td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.fn-prod-tabela thead th { font-size: 0.74rem; color: var(--muted); font-weight: 600; text-transform: none; white-space: normal; vertical-align: bottom; }
.fn-prod-tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.fn-prod-tabela tbody th, .fn-prod-tabela tfoot th { font-weight: 600; }
.fn-prod-tabela .fn-prod-cel .fn-prod-check { border: 0; padding: 0; min-height: 32px; border-radius: 0; gap: 0.45rem; }
.fn-prod-tabela .fn-prod-logo { height: 22px; width: auto; max-width: 70px; object-fit: contain; }
.fn-prod-tabela .fn-prod-tot { font-weight: 700; }
.fn-prod-tabela tr.is-off td, .fn-prod-tabela tr.is-off .fn-prod-nome, .fn-prod-tabela tr.is-off .fn-prod-logo { opacity: 0.45; }
.fn-prod-tabela .is-off { color: var(--muted); opacity: 0.55; }
.fn-prod-tabela tfoot tr.fn-pe-mensal th, .fn-prod-tabela tfoot tr.fn-pe-mensal td { font-weight: 700; border-top: 2px solid var(--line); }
.fn-prod-tabela tfoot tr.fn-pe-anual th, .fn-prod-tabela tfoot tr.fn-pe-anual td { font-size: 0.8rem; color: var(--muted); border-bottom: 0; }
.fn-prod-tabela tfoot [data-fn-pe="total"] { color: var(--accent, #ed785c); }
@media (max-width: 600px) {
  .fn-prod-tabela { font-size: 0.8rem; min-width: 520px; }
  .fn-prod-tabela .fn-prod-cel, .fn-prod-tabela thead th:first-child, .fn-prod-tabela tfoot th { position: sticky; left: 0; background: var(--panel, #1a1240); z-index: 1; }
  .fn-prod-tabela .fn-prod-logo { display: none; }
}
.fn-produtos legend { white-space: normal; max-width: 100%; }

/* 2026.0.0.82 — botão de imprimir no cartão do kanban */
.kb-card-a .kb-print { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 32px; padding: 0 0.45rem; }
.kb-card-a .kb-print svg { display: block; }
@media (pointer: coarse) { .kb-card-a .kb-print { min-width: 44px; min-height: 40px; } }

/* 2026.0.0.82 — login com a logomarca PublicSoft; olhinho da senha; botão imprimir do formulário */
.nv-caixa .nv-logo-ps { width: min(260px, 70%); height: auto; display: block; margin: 0 auto 0.2rem; }
.nv-caixa .nv-app { text-align: center; margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.04em; }
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 2.9rem !important; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; padding: 0; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: inherit; }
.pw-eye:focus-visible { outline: 2px solid var(--accent, #ed785c); outline-offset: 1px; }
.fn-imprimir { display: inline-flex; align-items: center; gap: 0.4rem; }
.fn-imprimir[hidden] { display: none !important; }
.fn-imp-ico svg { display: block; }

/* 2026.0.0.82 — ícones do menu lateral (SVG de linha, sem dependência externa) */
.nav-item { display: flex; align-items: center; gap: 0.6rem; }
.nav-item .nav-ico { flex: 0 0 auto; width: 18px; height: 18px; display: inline-flex; opacity: 0.9; }
.nav-item .nav-ico svg { display: block; width: 18px; height: 18px; }
.nav-item .nav-label { flex: 1 1 auto; min-width: 0; text-align: left; }
.nav-item .nav-caret { margin-left: auto; }
.nav-subitem .nav-ico, .nav-subitem .nav-ico svg { width: 16px; height: 16px; }
