/* Shared presentation only: dynamic regions remain owned by the existing scripts. */
body[data-theme="oliva"] { --wine: #465b46; --wine-dark: #304430; --soft: #edf1e9; }
body[data-theme="azul"] { --wine: #35566e; --wine-dark: #243c50; --soft: #e9eff4; }
.settings-page { max-width: 1100px; margin: 0 auto; }
.settings-page details { margin: 24px 0; }
.settings-page summary { font-weight: 600; cursor: pointer; }
.settings-lists { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-top: 16px; }
.settings-page form > button { margin: 8px 12px 8px 0; }
.attention-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; margin: 20px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); }
.attention-summary p { margin: 4px 0 0; font-size: .875rem; }
.followup-alert { padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--sand); border-radius: 5px; font-size: .875rem; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.account-row p { margin: 4px 0 0; font-size: .875rem; }
.related-customers article { padding: 16px 0; border-top: 1px solid var(--line); }
.related-customers article p { font-size: .875rem; }
.related-customers button { margin: 4px 4px 4px 0; }
.team-page .sidebar-brand .brand { font-size: 1.9rem; letter-spacing: -.04em; line-height: 1.15; }
@media (max-width: 700px) {
  .settings-lists { grid-template-columns: 1fr; }
  .attention-summary, .account-row { align-items: stretch; flex-direction: column; }
}
:root {
  color-scheme: light;
  --cream: #fbf9f6;
  --paper: #ffffff;
  --plum: #332c2d;
  --wine: #6b3449;
  --wine-dark: #4e2436;
  --muted: #6f6265;
  --line: #e6dfd9;
  --soft: #f2e7e9;
  --sand: #f4f0eb;
  --gold: #806037;
  --shadow: 0 5px 20px #44312a08;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--plum);
  background: var(--cream);
}
* { box-sizing: border-box; }
body { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3, legend {
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 3.4vw, 2.6rem); margin: 8px 0 14px; }
h2 { font-size: 1.8rem; margin: 8px 0 20px; color: var(--wine); }
h3 { font-size: 1.35rem; margin: 24px 0 14px; }
p { margin: 12px 0; }
a { color: var(--wine); }
small, .muted, .help { color: var(--muted); }
small { font-size: .875rem; }
.help { display: block; font-size: .875rem; font-weight: 400; margin-top: 8px; }
.eyebrow { font-size: .75rem; letter-spacing: .16em; font-weight: 650; color: var(--gold); }
.brand { font: 2.8rem/1 Georgia, serif; letter-spacing: -.07em; color: var(--wine); }
.brand span { display: block; font: .65rem/1.5 system-ui, sans-serif; letter-spacing: .32em; margin: 10px 0 0 5px; }
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 30px max(24px, calc((100% - 1328px) / 2));
  background: var(--sand);
  border-bottom: 1px solid var(--line);
}
.team-heading { display: flex; align-items: center; gap: 32px; min-width: 0; }
.team-heading .brand { flex: 0 0 auto; padding-right: 32px; border-right: 1px solid #d6c7bd; }
.top h1 { font-size: clamp(1.6rem, 2.7vw, 2.1rem); margin: 6px 0; }
.top .eyebrow { margin: 0; }
.header-note { margin: 6px 0 0; font-size: .9rem; }
.session { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 100%; font-size: .875rem; }
#identity { max-width: 34ch; }
main#app { max-width: 1400px; margin: auto; padding: 28px 36px 56px; }
#app, #workspace, #body, #detail, #versions-body { min-width: 0; }
.skip-link {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  background: var(--wine);
  color: white;
  border-radius: 8px;
  transform: translateY(calc(-100% - 20px));
}
.skip-link:focus { transform: translateY(0); }
.public { width: 100%; max-width: 860px; margin: 32px auto; padding: 24px; }
.narrow { max-width: 520px; }
.public-heading { text-align: center; margin: 0 auto 28px; }
.public-heading .brand { margin: 0 0 32px; font-size: 3.2rem; }
.public-heading > p:last-child { color: var(--muted); }
.public-footer { text-align: center; color: var(--muted); font-size: .875rem; margin: 24px 0 8px; }
.card, fieldset, details {
  min-width: 0;
  margin: 18px 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.card { box-shadow: var(--shadow); }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
fieldset { margin-inline: 0; }
fieldset fieldset { padding: 20px; background: #fcf9f6; border-radius: 12px; }
legend { max-width: 100%; padding: 0 8px; font-size: 1.25rem; color: var(--wine); }
label { display: block; min-width: 0; font-size: .9375rem; font-weight: 600; margin-bottom: 20px; }
input, select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  font: inherit;
  font-size: 1rem;
  color: var(--plum);
  background: white;
  border: 1px solid #bba8ae;
  border-radius: 8px;
  padding: 11px 12px;
  margin-top: 8px;
  accent-color: var(--wine);
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--wine); }
input:disabled, select:disabled, textarea:disabled { background: var(--sand); color: var(--muted); opacity: 1; }
textarea[readonly] { background: #faf7f3; }
button {
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  min-height: 48px;
  min-width: 44px;
  max-width: calc(100% - 8px);
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  padding: 12px 18px;
  margin: 4px;
  border: 1px solid var(--wine);
  border-radius: 9px;
  background: var(--wine);
  color: white;
  touch-action: manipulation;
}
button.secondary, nav button { background: var(--paper); color: var(--wine); border-color: #cbb7be; }
button:disabled { opacity: .55; cursor: not-allowed; }
button[aria-current="page"] { background: var(--wine); color: white; border-color: var(--wine); box-shadow: inset 0 -3px 0 #ffffff70; }
@media (hover: hover) {
  button:hover:not(:disabled) { background: var(--wine-dark); color: white; border-color: var(--wine-dark); }
  .queue button:hover:not(:disabled) { background: var(--soft); color: var(--wine-dark); }
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
#detail:focus, #success:focus, main:focus { outline: 3px solid var(--gold); outline-offset: 5px; }
button, input, select, textarea, summary, [tabindex] { scroll-margin-block: 24px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.grid > *, .item > *, .split > *, .counts > *, .dados-kpis > * { min-width: 0; }
.wide { grid-column: 1 / -1; }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.counts > div { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--muted); font-size: .875rem; }
.counts strong { display: block; font: 2rem/1.2 Georgia, serif; color: var(--wine); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding: 14px; background: var(--sand); border: 1px solid var(--line); border-radius: 14px; }
nav button { flex: 1 1 130px; max-width: 100%; margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 18px 0 24px; font-size: .875rem; color: var(--muted); }
.toolbar button { margin: 0; max-width: 100%; }
.toolbar span { flex: 1 1 240px; }
.split { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }
.queue { padding: 5px; }
.queue-panel { min-width: 0; padding: 20px 14px; background: var(--sand); border: 1px solid var(--line); border-radius: 16px; }
.queue-panel h2 { font-size: 1.45rem; margin: 0 0 20px; }
.queue-panel label { font-size: .875rem; margin-bottom: 14px; }
.queue-panel > button { margin: 0; max-width: 100%; }
#queue-count { font-size: .8125rem; }
.quote-reference { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 24px; background: var(--soft); border: 1px solid #e2cfd5; border-radius: 16px; }
.quote-reference p { margin: 8px 0; }
.quote-amount { display: block; font: 1.9rem/1.3 Georgia, serif; color: var(--wine); font-variant-numeric: tabular-nums; }
.quote-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 16px; }
.quote-option { min-width: 0; padding: 22px; background: white; border: 1px solid var(--line); border-top: 3px solid var(--wine); border-radius: 12px; }
.quote-option .eyebrow { margin-top: 0; }
.quote-option h4 { margin: 10px 0 16px; font: 1.3rem/1.3 Georgia, serif; }
.quote-option ul { padding-left: 20px; font-size: .875rem; }
.quote-option li { margin: 8px 0; }
.quote-preview-note { font-size: .875rem; margin: 20px 0 28px; }
.queue button { display: block; width: 100%; max-width: 100%; margin: 0 0 12px; padding: 18px; text-align: left; background: var(--paper); color: var(--plum); border-color: var(--line); box-shadow: var(--shadow); }
.queue button strong { font-size: 1rem; }
.queue button small { display: inline-block; margin-top: 6px; font-weight: 400; }
.queue button.active { border-color: var(--wine); background: var(--soft); box-shadow: inset 4px 0 0 var(--wine); }
#detail > h2 { margin-top: 6px; }
.badge { display: inline-block; max-width: 100%; padding: 5px 10px; background: var(--soft); color: var(--wine-dark); border: 1px solid #e2cfd5; border-radius: 20px; font-size: .8125rem; margin: 3px 4px 3px 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 0; margin-bottom: 8px; font-weight: 400; cursor: pointer; }
.check input { flex: 0 0 22px; width: 22px; height: 22px; min-height: 22px; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr); gap: 0 20px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.actions button { margin: 0; max-width: 100%; }
.notice, #notice:not(:empty), #dados-status:not(:empty), #dados-goal-status:not(:empty) { background: var(--soft); border-left: 4px solid var(--wine); border-radius: 0 10px 10px 0; padding: 16px 18px; white-space: pre-wrap; }
#notice:empty { margin: 0; }
.team-page #notice:not(:empty) { position: sticky; top: 8px; z-index: 30; box-shadow: 0 5px 18px #35202a20; max-height: 34vh; overflow-y: auto; }
.record-detail { scroll-margin-top: 130px; }
.money { font-weight: 650; font-variant-numeric: tabular-nums; }
.readout { white-space: pre-wrap; overflow-wrap: anywhere; }
dl { margin: 18px 0 0; }
dt { color: var(--muted); font-size: .875rem; }
dd { margin: 4px 0 18px; }
.history { padding-left: 24px; }
.history li { margin: 16px 0; }
summary { min-height: 48px; padding: 12px 0; cursor: pointer; font-weight: 600; color: var(--wine); }
summary::marker { color: var(--wine); }
details { padding-block: 12px; }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); }
dialog { width: min(850px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: 88vh; max-height: 88dvh; overflow-y: auto; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); color: var(--plum); box-shadow: 0 20px 60px #332c2d30; }
dialog::backdrop { background: #281c28a6; }
.form-intro { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-intro h2 { font-size: 1.6rem; margin-top: 0; margin-bottom: 12px; }
.form-intro p { margin: 8px 0 0; }
#intake { padding: 32px; }
.submit-intake { justify-self: start; margin: 0; max-width: 100%; }
#success { text-align: center; padding-block: 40px; }
.success-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #e8f1eb; color: #315f4c; margin-bottom: 12px; font-size: 1.5rem; }
#login button { width: 100%; max-width: 100%; margin: 8px 0 0; }

/* Dados is injected by equipe.js; these selectors cover that existing markup. */
.dados { max-width: 1180px; min-width: 0; margin: auto; }
.dados-intro { padding: 8px 0 12px; }
.dados-intro h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin: 8px 0 16px; }
.dados .grid { align-items: start; }
.dados-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dados-kpis .card { margin: 0; padding: 22px; border-top: 3px solid var(--wine); }
.dados-kpis h3 { font: 600 .9375rem/1.5 system-ui, sans-serif; margin: 0 0 12px; }
.dados-kpis strong { font: 2rem/1.3 Georgia, serif; color: var(--wine); font-variant-numeric: tabular-nums; }
.dados-origins > h3 { margin-top: 8px; }
.dados-origin-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.dados-origin-summary > div { padding: 18px; border-radius: 12px; background: var(--sand); }
.dados-origin-summary span, .dados-origin-summary small { display: block; }
.dados-origin-summary strong { display: block; font: 2rem/1.4 Georgia, serif; color: var(--wine); margin: 8px 0; }
.dados-origin-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; }
.dados-origin-layout > * { min-width: 0; }
.dados-origin-layout figure { margin-inline: 0; }
.dados-scroll { min-width: 0; max-width: 100%; }
.dados table { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: .9375rem; text-align: left; }
.dados th, .dados td { padding: 14px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.dados th { color: var(--wine); font-weight: 650; }
.dados tbody tr:last-child td { border-bottom: 0; }
.dados-goal { padding: 4px 0 16px; }
.dados-goal h4 { margin-bottom: 8px; }
.dados progress { display: block; width: 100%; max-width: 100%; height: 18px; accent-color: var(--wine); }
.dados [aria-busy="true"] { opacity: .6; }
.dados #dados-filters { margin-top: 8px; }
.dados-chart { margin: 24px 0 12px; }
.dados-chart figcaption { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 20px; font-size: .9rem; }
.dados-legend { display: inline-flex; align-items: center; gap: 8px; }
.dados-legend::before { content: ""; flex: 0 0 16px; height: 10px; border-radius: 3px; background: var(--wine); }
.dados-legend-contracts::before { background: #9b7846; }
.dados-month { border-top: 1px solid var(--line); padding: 14px 0; }
.dados-month h4 { margin: 0 0 10px; font-size: 1rem; color: var(--wine); }
.dados-bar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 3fr) minmax(0, .5fr); align-items: center; gap: 12px; margin: 12px 0; font-size: .875rem; }
.dados-bar strong { text-align: right; font-variant-numeric: tabular-nums; }
.dados-bar meter { display: block; min-width: 0; width: 100%; height: 18px; border: 0; border-radius: 6px; background: #eee4d9; appearance: none; --dados-bar-color: var(--wine); }
.dados-bar meter.dados-bar-contracts { --dados-bar-color: #9b7846; }
.dados-bar meter::-webkit-meter-bar { background: #eee4d9; border: 0; border-radius: 6px; box-shadow: none; }
.dados-bar meter::-webkit-meter-optimum-value { background: var(--dados-bar-color); border-radius: 6px; }
.dados-bar meter::-moz-meter-bar { background: var(--dados-bar-color); border-radius: 6px; }
.dados-flow { margin: 24px 0; }
.dados-flow .dados-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .5fr); }
.dados-pending { margin: 20px 0 0; }
.dados-pending > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.dados-pending dt { color: var(--plum); }
.dados-pending dd { font: 1.55rem Georgia, serif; color: var(--wine); margin: 0; }
.dados-consultants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; margin: 20px 0; }
.dados-consultants article { min-width: 0; background: var(--sand); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.dados-consultants h4 { margin: 0 0 14px; font: 1.25rem Georgia, serif; color: var(--wine); }
.dados-consultants dl { margin: 0; }
.dados-consultants dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: .9rem; }
.dados-consultants dd { margin: 0; font-weight: 650; }
.dados .card > details { box-shadow: none; border-radius: 10px; padding: 12px 14px; background: transparent; }
.dados-help { font-size: .9375rem; }
.dados-help p { max-width: 85ch; }

@media (max-width: 1100px) {
  .dados-origin-layout { grid-template-columns: minmax(0, 1fr); }
  .item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .dados #dados-results > .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .top { padding: 24px; }
  main#app { padding: 24px 24px 40px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .queue { max-height: 320px; overflow-y: auto; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dados-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dados-origin-summary { grid-template-columns: minmax(0, 1fr); }
  .quote-reference { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 20px; }
  .top { padding: 22px 16px; gap: 18px; }
  .team-heading { align-items: flex-start; gap: 18px; flex-direction: column; }
  .team-heading .brand { padding: 0; border: 0; font-size: 2.4rem; }
  .session { width: 100%; justify-content: space-between; }
  #identity { flex: 1 1 180px; }
  main#app { padding: 20px 16px 32px; }
  .public { margin: 12px auto; padding: 20px 16px; }
  .public-heading .brand { margin-bottom: 26px; font-size: 2.8rem; }
  .card, fieldset { padding: 20px; }
  fieldset fieldset { padding: 16px; }
  details { padding-inline: 16px; }
  #intake { padding: 22px 18px; }
  .grid, .item { grid-template-columns: minmax(0, 1fr); }
  .counts { gap: 10px; }
  .counts > div { padding: 16px; }
  nav { gap: 8px; padding: 10px; margin-top: 20px; }
  nav button { flex-basis: 120px; padding-inline: 10px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar span { flex: auto; }
  .actions button { flex: 1 1 100%; }
  .submit-intake { width: 100%; }
  dialog { padding: 20px 16px; }
  .dados-kpis { gap: 10px; }
  .dados-kpis .card { padding: 16px 12px; }
  .dados-kpis strong { font-size: 1.65rem; }
  .dados th, .dados td { padding: 12px 5px; font-size: .875rem; }
  .dados-bar, .dados-flow .dados-bar { grid-template-columns: minmax(0, 1fr) minmax(0, .25fr); gap: 6px; }
  .dados-bar > span { grid-column: 1 / -1; }
  .dados-bar meter { grid-column: 1; }
  .dados-chart figcaption { gap: 10px; }
}
.workflow-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin: 8px 0 24px; }
.workflow-heading h2 { margin: 6px 0 12px; }
.workflow-heading p { margin: 8px 0; }
.workflow-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.workflow-filters label { flex: 1 1 320px; margin: 0; max-width: 650px; }
.workflow-filters button { margin: 0; }
.workflow-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.workflow-tabs button { margin: 0; font-size: .875rem; }
.workflow-tabs button span { display: inline-block; margin-left: 5px; font-variant-numeric: tabular-nums; }
.workflow-tabs button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: white; }
.funnel-board { display: grid; grid-template-columns: repeat(4, minmax(245px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 16px; }
.funnel-column { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--sand); }
.funnel-column > header { border-bottom: 2px solid #d9c6cd; margin-bottom: 18px; padding-bottom: 12px; }
.funnel-column h3 { margin: 8px 0; font-size: 1.35rem; }
.stage-step { color: var(--gold); font-size: .7rem; letter-spacing: .12em; }
.stage-count { display: inline-block; font: 600 .8rem system-ui, sans-serif; background: white; padding: 5px 9px; border-radius: 15px; vertical-align: middle; }
.stage-cards { display: grid; gap: 12px; }
.workflow-card { min-width: 0; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.workflow-card .card-open { display: block; width: 100%; max-width: 100%; text-align: left; border: 0; border-radius: 7px; margin: 0; padding: 6px 4px; color: var(--wine); background: transparent; }
.workflow-card .card-open:hover { background: var(--soft); color: var(--wine-dark); }
.card-open strong, .card-open span { display: block; }
.card-open span { font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: 8px; }
.workflow-card p { font-size: .875rem; margin: 12px 4px 0; }
.task-date { color: var(--wine); font-weight: 600; }
.archive-board { grid-template-columns: minmax(0, 1fr); }
.archive-board .stage-cards, .send-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.calendar-panel, .agenda-day-panel { min-width: 0; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.calendar-heading h3 { font-size: 1.4rem; margin: 0; text-align: center; }
.calendar-heading button { margin: 0; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekdays { text-align: center; color: var(--muted); font-size: .8rem; padding-bottom: 10px; }
.calendar-grid .calendar-day { display: flex; flex-direction: column; gap: 6px; align-items: stretch; justify-content: flex-start; min-width: 0; width: 100%; max-width: 100%; min-height: 104px; margin: 0; padding: 10px 6px; border: 1px solid var(--line); background: var(--cream); color: var(--plum); text-align: left; font-weight: 400; }
.calendar-number { font-weight: 650; font-variant-numeric: tabular-nums; }
.calendar-count { font-size: .68rem; line-height: 1.2; }
.calendar-client { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; line-height: 1.2; }
.calendar-grid .calendar-day.is-today { border: 2px solid var(--gold); }
.calendar-grid .calendar-day.is-selected { background: var(--wine); border-color: var(--wine); color: white; }
.calendar-panel > p { font-size: .8rem; }
.agenda-day-panel .workflow-tabs { margin-top: 0; }
.agenda-tasks { display: grid; gap: 14px; }
.detail-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.detail-toolbar > button { margin: 0; }
.record-detail { max-width: 1120px; margin: auto; }
.action-current { padding: 20px 24px; border: 1px solid #d9c6cd; border-left: 4px solid var(--wine); border-radius: 10px; background: var(--soft); }
.action-current p { margin-bottom: 0; }
.action-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.action-forms .card { margin: 12px 0; }
.action-forms fieldset { padding: 0; border: 0; margin-bottom: 0; }
.quote-context { background: var(--sand); }
@media (max-width: 1100px) { .agenda-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .funnel-board { grid-template-columns: repeat(4, minmax(260px, 85%)); scroll-snap-type: x proximity; }
  .funnel-column { scroll-snap-align: start; }
  .archive-board { grid-template-columns: minmax(0, 1fr); }
  .calendar-panel, .agenda-day-panel { padding: 14px; }
  .calendar-grid { gap: 3px; }
  .calendar-grid .calendar-day { min-height: 72px; padding: 8px 4px; }
  .calendar-client { display: none; }
  .calendar-count { font-size: .62rem; }
  .calendar-heading h3 { font-size: 1.2rem; }
  .action-forms { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
/* Preserve every script-controlled visibility state, including forms and Dados. */
.record-heading { padding: 12px 0 4px; }
.record-heading h2 { margin: 0 0 12px; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.record-contact { line-height: 1.8; }
.next-step { background: var(--soft); border: 1px solid var(--line); padding: 16px 20px; border-radius: 12px; line-height: 1.6; }
.stage-help { font-size: .8rem; line-height: 1.5; margin: 10px 0 0; min-height: 2.5em; }
.loss-summary { color: #875232; border-top: 1px solid var(--line); padding-top: 10px; }
.quote-actions { position: sticky; bottom: 8px; z-index: 10; background: #fffaf7; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 -4px 18px #35202a10; }
.next-task-fields { background: var(--cream); border-radius: 12px; padding: 18px; margin: 20px 0; }
.next-task-fields h4 { margin-top: 0; }
.outcome-options { margin: 32px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.outcome-card { background: #f5f1e9; border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 24px; }
.loss-panel { border-left: 4px solid #a56c42; }
button.danger { background: #874c35; border-color: #874c35; }
summary { cursor: pointer; line-height: 1.6; }
summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
details[open] > summary { margin-bottom: 20px; }
.dados-legend-losses::before { background: #a56c42; }
.dados-bar-losses { accent-color: #a56c42; }
.dados-bar-losses::-webkit-meter-optimum-value { background: #a56c42; }
.dados-bar-losses::-moz-meter-bar { background: #a56c42; }
@media (max-width: 640px) {
  .item { grid-template-columns: minmax(0, 1fr); }
  .quote-actions { position: static; padding: 12px; }
  .next-task-fields, .outcome-card { padding: 16px; }
}
/* Team workspace · stable navigation, quiet surfaces, task-first hierarchy. */
.team-page { --sidebar-width: 224px; font-size: 14px; line-height: 1.55; background: #fbf9f6; }
.team-page main#app { max-width: 1760px; margin: 0 auto 0 var(--sidebar-width); padding: 0 40px 64px; }
.team-page .app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 70; display: flex; flex-direction: column; padding: 40px 18px 22px; background: #f3efea; border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.sidebar-brand .brand { font-size: 2.55rem; }
.sidebar-brand .brand span { font-size: .55rem; margin-top: 10px; }
.sidebar-label { margin: 48px 12px 14px; font-size: .65rem; letter-spacing: .16em; color: var(--gold); font-weight: 600; }
.team-page #nav { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.team-page #nav button { display: flex; flex: none; gap: 12px; align-items: center; width: 100%; max-width: 100%; margin: 0; min-height: 46px; padding: 12px 14px; text-align: left; border: 1px solid transparent; background: transparent; color: #67565c; font-weight: 500; border-radius: 7px; box-shadow: none; }
.team-page #nav button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.team-page #nav button[aria-current="page"] { background: var(--wine); color: white; font-weight: 600; }
.team-page #nav button:not([aria-current="page"]):hover { background: #e9e1dc; color: var(--wine-dark); }
.sidebar-session { margin-top: auto; padding: 30px 12px 0; font-size: .75rem; color: var(--muted); }
.sidebar-session #identity { display: block; padding-top: 18px; border-top: 1px solid #e1d7d0; }
.team-page .sidebar-session button { margin: 8px 0 0; padding: 8px 0; min-height: 44px; border: 0; background: transparent; font-size: .75rem; text-align: left; }
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.app-bar > div { display: flex; align-items: center; gap: 12px; }
.app-bar-label { color: var(--muted); font-size: .75rem; }
.team-page .app-bar button { margin: 0; min-height: 44px; font-size: .75rem; padding: 8px 14px; }
.team-page button { min-height: 44px; font-size: .8125rem; font-weight: 550; padding: 10px 16px; border-radius: 6px; }
.team-page input, .team-page select, .team-page textarea { min-height: 44px; font-size: .875rem; padding: 10px 12px; border-color: #d8cbd0; border-radius: 6px; margin-top: 6px; }
.team-page label { font-size: .8125rem; font-weight: 500; margin-bottom: 18px; }
.team-page .check { min-height: 44px; }
.team-page .check input { min-height: 20px; height: 20px; flex-basis: 20px; width: 20px; }
.team-page h1 { font-size: clamp(1.8rem, 2.4vw, 2.2rem); margin: 4px 0 10px; }
.team-page h2 { color: var(--plum); }
.team-page h3 { font-size: 1.3rem; }
.team-page .eyebrow { font-size: .625rem; letter-spacing: .15em; font-weight: 500; }
.team-page .card, .team-page fieldset, .team-page details { border-radius: 9px; box-shadow: none; }
.team-page .card, .team-page fieldset { padding: 22px; }
.team-page .help, .team-page .muted { font-size: .8125rem; }
.team-page summary { min-height: 44px; font-size: .8125rem; font-weight: 500; padding: 10px 0; }
.team-page details[open] > summary { margin-bottom: 12px; }
.team-page .counts { gap: 12px; margin: 6px 0 28px; }
.team-page .counts > div { display: flex; align-items: center; flex-direction: row-reverse; justify-content: space-between; gap: 12px; padding: 14px 18px; min-height: 62px; font-size: .75rem; border-radius: 8px; box-shadow: none; }
.team-page .counts strong { display: inline; font-size: 1.55rem; margin: 0; }
.team-page .workflow-heading { margin: 12px 0 24px; gap: 12px; }
.team-page .workflow-heading h2 { font-size: 1.95rem; margin: 6px 0 8px; }
.team-page .workflow-heading p { color: var(--muted); font-size: .8125rem; margin: 6px 0; }
.team-page .workflow-heading .eyebrow { color: var(--gold); font-size: .625rem; }
.team-page .workflow-filters { margin: 0 0 18px; }
.team-page .workflow-filters label { max-width: 460px; }
.team-page .workflow-tabs { gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.team-page .workflow-tabs button { border-color: transparent; background: transparent; color: var(--muted); padding: 8px 12px; }
.team-page .workflow-tabs button[aria-pressed="true"] { color: var(--wine); background: #efe5e8; border-color: #e6d5dc; }
.team-page .workflow-tabs button span { font-size: .6875rem; padding: 1px 5px; border-radius: 4px; background: #ffffff80; }
.team-page .funnel-board { gap: 14px; grid-template-columns: repeat(4,minmax(220px,1fr)); }
.team-page .funnel-column { background: #f5f1ec; padding: 14px; border: 0; border-radius: 9px; }
.team-page .funnel-column > header { border-bottom: 1px solid #ded2d7; padding-bottom: 14px; }
.team-page .funnel-column h3 { font-size: 1.15rem; }
.team-page .stage-step { font-size: .6rem; }
.team-page .stage-help { font-size: .75rem; color: var(--muted); }
.team-page .stage-count { font-size: .7rem; }
.team-page .workflow-card { box-shadow: none; border-radius: 7px; padding: 12px; }
.team-page .workflow-card .card-open { padding: 4px 2px; }
.team-page .workflow-card p, .team-page .card-open span { font-size: .75rem; }
.team-page .archive-board { grid-template-columns: minmax(0,1fr); }
.team-page .detail-toolbar { margin: 0 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); gap: 12px; }
.team-page .detail-toolbar > button { border-color: transparent; background: transparent; padding-left: 0; font-weight: 400; }
.detail-sections { display: flex; gap: 2px; background: #eee8e4; padding: 3px; border-radius: 7px; }
.team-page .detail-sections button { margin: 0; border: 1px solid transparent; background: transparent; color: var(--muted); box-shadow: none; }
.team-page .detail-sections button[aria-current="page"] { border-color: var(--line); background: white; color: var(--wine); }
.team-page .record-detail { max-width: none; margin: 0; scroll-margin-top: 24px; }
.team-page .record-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 0; margin: 0 0 22px; }
.team-page .record-heading .eyebrow { margin: 0 0 6px; }
.team-page .record-heading > p { margin: 0; }
.team-page .record-contact { font-size: .8125rem; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.team-page .badge { font-size: .6875rem; padding: 4px 8px; background: #f2ecee; border-color: #e7dbdf; }
.team-page #draft-state { background: transparent; border-color: transparent; color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; align-items: start; gap: 24px; }
.detail-main, .detail-context { min-width: 0; }
.detail-main > :first-child, .detail-main > form > fieldset:first-child { margin-top: 0; }
.detail-context .card { margin: 0 0 18px; }
.team-page .client-context { padding: 22px; }
.client-context .eyebrow { margin: 0 0 10px; }
.client-context h2 { font-size: 1.35rem; margin: 0 0 20px; }
.client-context dl { margin: 0; }
.client-context dl > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.client-context dl > div:first-child { padding-top: 0; }
.client-context dl > div:last-child { border-bottom: 0; }
.client-context dt { font-size: .6875rem; }
.client-context dd { font-size: .8125rem; margin: 4px 0 0; }
.team-page .client-context details { border: 0; border-top: 1px solid var(--line); background: transparent; border-radius: 0; padding: 0; margin: 10px 0 0; }
.client-context .context-guidance p { font-size: .8125rem; color: var(--muted); }
.team-page .detail-context .quote-reference { display: block; background: white; padding: 20px; border: 1px solid var(--line); border-radius: 9px; }
.detail-context .quote-reference > .muted { font-size: .75rem; }
.team-page .quote-amount { font-size: 1.8rem; }
.detail-context .quote-options { grid-template-columns: minmax(0,1fr); gap: 12px; }
.team-page .quote-option { border: 1px solid var(--line); border-radius: 9px; padding: 20px; }
.team-page .quote-option h4 { font-size: 1.15rem; }
.team-page .quote-option ul { font-size: .75rem; }
.detail-context .quote-preview-note { font-size: .6875rem; margin: 14px 0; }
.team-page #quote fieldset fieldset { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 10px; margin: 20px 0 0; }
.team-page #quote legend { font-size: 1.15rem; }
.team-page #quote fieldset fieldset legend { color: var(--muted); font: 500 .75rem system-ui,sans-serif; padding: 0 10px 0 0; }
.team-page #quote .item { grid-template-columns: minmax(0,2fr) minmax(140px,1fr); gap: 16px; }
.team-page #quote .item label { margin-bottom: 10px; }
.team-page #quote [data-remove-item], .team-page #quote [data-remove-package] { border-color: transparent; padding: 8px 0; margin: 0; background: transparent; color: var(--muted); font-size: .75rem; }
.team-page .quote-actions { background: #fff; border: 0; border-top: 1px solid var(--line); padding: 16px 0 0; border-radius: 0; box-shadow: none; bottom: 0; }
.team-page .quote-actions button { flex: 0 1 auto; }
.team-page .action-current { padding: 16px 20px; background: #f6f1f2; border: 1px solid #e4d8dd; border-left: 3px solid var(--wine); }
.team-page .quote-context { background: white; }
.team-page .next-task-fields { background: #faf8f5; padding: 16px; }
.team-page .outcome-options { margin-top: 28px; }
.team-page .outcome-options > p { color: var(--muted); font-size: .8125rem; }
.team-page .outcome-options .card { padding-block: 8px; }
.team-page .outcome-options .loss-panel { border-left-width: 1px; }
.team-page .calendar-panel, .team-page .agenda-day-panel { padding: 20px; border-radius: 9px; }
.team-page .calendar-grid .calendar-day { min-height: 96px; font-size: .75rem; padding: 8px; border-radius: 6px; }
.team-page .calendar-client { font-size: .65rem; }
.team-page .dados { max-width: none; }
.team-page .dados-kpis .card { border-top: 1px solid var(--line); padding: 18px; }
.team-page .dados-kpis h3 { font-size: .8125rem; font-weight: 500; color: var(--muted); }
.team-page .dados-kpis strong { font-size: 1.75rem; }
.team-page .dados-consultants article { background: #faf8f5; }
.team-page .dados .card > details { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 8px 0; }
.team-page .feedback { position: fixed; bottom: 22px; right: 24px; z-index: 80; display: flex; align-items: flex-start; max-width: min(540px,calc(100vw - 32px)); padding: 16px 12px 16px 18px; border: 1px solid #d7c4cb; border-radius: 9px; background: #fff; box-shadow: 0 6px 24px #36212b18; }
.team-page #notice:not(:empty) { position: static; flex: 1; max-height: 30vh; overflow-y: auto; font-size: .8125rem; margin: 0; padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.team-page #notice-dismiss { flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; margin: -8px 0 -8px 8px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; }
.team-page .menu-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; z-index: 90; margin: 0; padding: 0; border: 0; border-radius: 0; background: #2e23294d; }
.team-page #detail:focus:not(:focus-visible) { outline: none; }
@media (min-width: 1800px) { .team-page main#app { padding-inline: 56px; } }
@media (max-width: 1200px) {
  .team-page { --sidebar-width: 200px; }
  .team-page main#app { padding-inline: 24px; }
  .detail-layout { grid-template-columns: minmax(0,1fr); }
  .detail-context { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
  .detail-context > :only-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .team-page main#app { margin-left: 0; padding: 0 24px 48px; }
  .team-page .app-sidebar { width: min(280px,85vw); z-index: 100; padding-top: 26px; box-shadow: 8px 0 30px #332c2d20; }
  .sidebar-brand { padding-inline: 10px; }
  .sidebar-brand #close-menu { margin: 0; padding: 0; width: 44px; font-size: 1.4rem; border: 0; background: transparent; }
  .app-bar { min-height: 66px; margin-bottom: 20px; }
  .team-page .agenda-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 640px) {
  .team-page main#app { padding-inline: 16px; }
  .app-bar-label { display: none; }
  .team-page .counts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 22px; }
  .team-page .counts > div { padding: 12px; font-size: .6875rem; }
  .team-page .counts strong { font-size: 1.3rem; }
  .team-page .detail-toolbar { align-items: stretch; }
  .detail-sections { width: 100%; }
  .team-page .detail-sections button { flex: 1; padding-inline: 6px; }
  .team-page .record-heading { margin-bottom: 18px; }
  .team-page .card, .team-page fieldset { padding: 18px; }
  .detail-context { grid-template-columns: minmax(0,1fr); }
  .team-page #quote .item { grid-template-columns: minmax(0,1fr); }
  .team-page .quote-actions { position: static; gap: 8px; }
  .team-page .quote-actions button { flex: 1 1 100%; }
  .team-page .funnel-board { grid-template-columns: repeat(4,minmax(260px,85%)); }
  .team-page .archive-board { grid-template-columns: minmax(0,1fr); }
  .team-page .calendar-panel, .team-page .agenda-day-panel { padding: 14px; }
  .team-page .calendar-grid .calendar-day { padding: 6px 4px; min-height: 72px; }
  .team-page .feedback { bottom: 12px; right: 16px; }
}
[hidden] { display: none !important; }

/* Comissões: foco no fechamento, conferência e acerto individual. */
.commission-entry { margin: 24px 0; padding: 20px; background: var(--sand); border-radius: 12px; }
.commission-split { display: grid; grid-template-columns: minmax(160px,2fr) minmax(120px,1fr) auto; align-items: end; gap: 14px; margin: 14px 0; }
.commission-split button { margin-bottom: 0; }
.commission-payments article { border-top: 1px solid var(--line); padding: 20px 0; }
.commission-contracts article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.commission-contracts p { margin: 5px 0; color: var(--muted); }
.commission-panel > details { margin-top: 20px; }
.visit-card form { margin-top: 16px; }
.commission-panel [data-commission-preview], .commission-entry [data-commission-preview] { line-height: 1.8; }
@media(max-width:700px) { .commission-split { grid-template-columns: 1fr; } .commission-contracts article { flex-direction: column; align-items: stretch; } }

/* Senhas */
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#password-dialog { width: min(480px, calc(100% - 32px)); }
#password-dialog label { display: block; margin-bottom: 14px; }
#password-dialog input { width: 100%; }
#password-error { min-height: 1.2em; color: #9b2c2c; }
#password-dialog button { margin-right: 8px; }
