/* Perto Casa — calm coastal identity: dark natural green, warm sand, restrained copper accent. */
:root {
  --green-950: #142820;
  --green-900: #1f3a2e;
  --green-800: #284a3b;
  --green-700: #345c4a;
  --green-100: #e3ece5;
  --sand-50: #fbf8f2;
  --sand-100: #f4eee2;
  --sand-200: #ebe2d0;
  --sand-300: #dccfb5;
  --accent: #b06f3a;
  --accent-dark: #8f5629;
  --ink: #1c2420;
  --muted: #5d6a62;
  --line: #e2d9c7;
  --white: #fff;
  --ok: #2f6b4a;      --ok-bg: #e2efe6;
  --warn: #8a5a12;    --warn-bg: #f8ecd2;
  --bad: #9b3426;     --bad-bg: #f6dfda;
  --info: #2f5470;    --info-bg: #e1ebf3;
  --mute: #6b6b6b;    --mute-bg: #ecebe8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 40, 32, .06), 0 6px 24px rgba(20, 40, 32, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--sand-50);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-800); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--green-950); margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--green-900); color: #fff; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--green-900); color: #fff; font: 600 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--green-800); color: #fff; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--green-900); border-color: var(--sand-300); }
.btn-ghost:hover { background: var(--sand-100); color: var(--green-950); }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #7e2a1e; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green-800); text-decoration: underline; cursor: pointer; font: inherit; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; color: var(--green-950); }
.field { margin-bottom: 1rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .25rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--sand-300); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: 1rem/1.4 var(--sans);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); outline: 2px solid rgba(52, 92, 74, .2); }
input[type=file] { font: .95rem var(--sans); max-width: 100%; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-800); flex: none; }
.checks { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.hp { position: absolute; left: -5000px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem .25rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .35rem; color: var(--green-900); }

/* Cards, tables */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2, .card-head h3 { margin: 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: inherit; display: block; }
.stat .num { font: 600 1.9rem/1.1 var(--serif); color: var(--green-900); }
.stat .lbl { color: var(--muted); font-size: .9rem; }
.stat.alert .num { color: var(--bad); }
a.stat:hover { border-color: var(--green-700); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: .6rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.money, th.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
dl.kv { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: .4rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .9rem; }
dl.kv dd { margin: 0; }
.empty { color: var(--muted); padding: 1rem 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }

/* Badges & alerts */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-mute { background: var(--mute-bg); color: var(--mute); }
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #c5ddcc; }
.alert-error { background: var(--bad-bg); color: var(--bad); border-color: #ecc4bc; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #ecd6a6; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c8d9e7; }
.progress { height: 10px; background: var(--sand-200); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green-700); border-radius: 999px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--sand-300); }
.timeline li { position: relative; padding: 0 0 1rem .5rem; }
.timeline li::before { content: ""; position: absolute; left: -1.62rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--green-700); border: 2px solid var(--sand-50); }
.timeline li.current::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(176, 111, 58, .2); }
.timeline .when { font-size: .82rem; color: var(--muted); }
.steps { display: flex; gap: .35rem; flex-wrap: wrap; margin: .5rem 0 1rem; padding: 0; list-style: none; }
.steps li { font-size: .78rem; padding: .25rem .6rem; border-radius: 999px; background: var(--sand-100); color: var(--muted); }
.steps li.done { background: var(--green-100); color: var(--green-900); }
.steps li.now { background: var(--accent); color: #fff; }

/* Photos */
.photos { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.photos a, .photos figure { display: block; margin: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--sand-100); }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photos figcaption { font-size: .8rem; padding: .3rem .4rem; }

/* ---------- Public website ---------- */
.site-header { background: var(--sand-50); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--green-950); }
.brand svg, .brand .brand-icon { width: 34px; height: 34px; flex: none; }
.brand-logo { display: block; width: auto; max-width: 100%; height: auto; }
.brand b { font: 600 1.3rem/1 var(--serif); letter-spacing: .01em; }
.brand span { display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.site-nav { display: flex; align-items: center; gap: .2rem; }
.site-nav a { padding: .5rem .65rem; border-radius: 999px; text-decoration: none; color: var(--green-950); font-size: .94rem; }
.site-nav a:hover, .site-nav a.active { background: var(--sand-100); }
.site-nav .btn { margin-left: .4rem; color: #fff; }
.lang { display: flex; gap: .15rem; font-size: .8rem; }
.lang a { padding: .2rem .4rem; border-radius: 6px; text-decoration: none; color: var(--muted); }
.lang a.active { color: var(--green-950); font-weight: 700; background: var(--sand-100); }
.menu-toggle { display: none; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; cursor: pointer; padding: .5rem .8rem; border: 1px solid var(--sand-300); border-radius: 999px; font-weight: 600; font-size: .9rem; }
  .site-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; background: var(--sand-50); flex-direction: column; align-items: stretch; padding: .75rem 20px 1.25rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav a { padding: .75rem .5rem; border-radius: 8px; }
  .site-nav .btn { margin: .5rem 0 0; }
  .menu-toggle:checked ~ .site-nav { display: flex; }
}
.hero { background: linear-gradient(160deg, var(--green-950) 0%, var(--green-900) 55%, var(--green-800) 100%); color: var(--sand-50); position: relative; overflow: hidden; }
.hero .container { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3.5rem, 9vw, 7rem); position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5.2vw, 3.4rem); max-width: 17ch; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 46ch; color: var(--sand-200); }
.hero .eyebrow { color: var(--sand-300); }
.hero .waves { position: absolute; right: -40px; bottom: -10px; width: min(640px, 80vw); opacity: .16; z-index: 0; }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }
.section { padding: clamp(2.75rem, 7vw, 5rem) 0; }
.section.alt { background: var(--sand-100); }
.section-head { max-width: 680px; margin-bottom: 2rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.pillars { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pillar { padding: 1.4rem; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.pillar .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--green-100); color: var(--green-900); display: grid; place-items: center; margin-bottom: .8rem; }
.pillar .ico svg { width: 22px; height: 22px; }
.pillar h3 { margin-bottom: .35rem; }
.pillar p { color: var(--muted); margin: 0; font-size: .96rem; }
.how { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); list-style: none; padding: 0; margin: 0; }
.how li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; position: relative; }
.how li::before { counter-increment: step; content: counter(step); font: 600 1.6rem/1 var(--serif); color: var(--accent); display: block; margin-bottom: .5rem; }
.how li h3 { font-size: 1.05rem; }
.how li p { color: var(--muted); margin: 0; font-size: .94rem; }
.plans { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--green-800); box-shadow: 0 10px 30px rgba(31, 58, 46, .12); }
.plan .from { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.plan .price { font: 600 2.2rem/1.1 var(--serif); color: var(--green-900); }
.plan .price small { font: 400 .95rem var(--sans); color: var(--muted); }
.plan ul { padding-left: 1.1rem; color: var(--ink); flex: 1; }
.plan li { margin-bottom: .35rem; }
.note { font-size: .92rem; color: var(--muted); }
.quote-band { background: var(--green-900); color: var(--sand-100); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); }
.quote-band h2 { color: #fff; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--green-950); }
.faq details p { margin: .75rem 0 0; color: var(--muted); }
.site-footer { background: var(--green-950); color: var(--sand-300); padding: 3rem 0 2rem; font-size: .92rem; }
.site-footer a { color: var(--sand-100); }
.site-footer .brand { color: #fff; }
.site-footer .brand span { color: var(--sand-300); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 30; border-radius: 999px; box-shadow: var(--shadow); }

/* ---------- App shell (portal + control) ---------- */
.app-top { background: var(--green-950); color: var(--sand-100); position: sticky; top: 0; z-index: 30; }
.app-top .bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 58px; }
.app-top .brand { color: #fff; }
.app-top .brand svg, .app-top .brand .brand-icon { width: 32px; height: 32px; }
.app-top .brand b { font-size: 1.1rem; }
.app-top .brand span { color: var(--sand-300); }
.app-top a { color: var(--sand-100); }
.app-top .actions { display: flex; align-items: center; gap: .5rem; }
.app-top .actions form { margin: 0; }
.app-top .icon-link { position: relative; display: inline-flex; padding: .45rem; border-radius: 999px; text-decoration: none; }
.app-top .icon-link:hover { background: rgba(255, 255, 255, .1); }
.app-top .icon-link svg { width: 22px; height: 22px; }
.dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.app-top .linkbtn { color: var(--sand-200); font-size: .9rem; }
.tabs { background: var(--green-900); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: .4rem 0; white-space: nowrap; }
.tabs a { display: block; color: var(--sand-200); text-decoration: none; padding: .45rem .85rem; border-radius: 999px; font-size: .92rem; }
.tabs a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tabs a.active { background: var(--sand-50); color: var(--green-950); font-weight: 600; }
.app-main { padding: 1.5rem 0 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 3.5vw, 2rem); }
.page-head .sub { color: var(--muted); margin: .2rem 0 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 160px; }

/* Control: wider shell with side navigation on desktop */
.ctl-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 58px); }
.ctl-side { background: var(--green-900); padding: 1rem .75rem; }
.ctl-side ul { list-style: none; margin: 0; padding: 0; }
.ctl-side a { display: flex; align-items: center; gap: .55rem; color: var(--sand-200); text-decoration: none; padding: .55rem .75rem; border-radius: 10px; font-size: .94rem; }
.ctl-side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ctl-side a.active { background: var(--sand-50); color: var(--green-950); font-weight: 600; }
.ctl-side .group { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--sand-300); opacity: .75; padding: 1rem .75rem .3rem; }
.ctl-main { padding: 1.5rem clamp(1rem, 3vw, 2rem) 4rem; min-width: 0; }
.ctl-menu-toggle { display: none; }
.ctl-menu-btn { display: none; }
@media (max-width: 900px) {
  .ctl-shell { grid-template-columns: 1fr; }
  .ctl-side { display: none; }
  .ctl-menu-btn { display: inline-flex; padding: .4rem .7rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; font-size: .88rem; cursor: pointer; color: #fff; }
  .ctl-menu-toggle:checked ~ .ctl-shell .ctl-side { display: block; }
}

/* ---------- Mobile visit flow ---------- */
.visit-head { position: sticky; top: 58px; z-index: 10; background: var(--sand-50); padding: .6rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.visit-section { margin-bottom: 1.5rem; }
.visit-section > h2 { font-size: 1.15rem; display: flex; justify-content: space-between; align-items: center; }
.vitem { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.vitem.st-OK { border-left: 6px solid var(--ok); }
.vitem.st-OBSERVAR { border-left: 6px solid #c98d24; }
.vitem.st-ACAO_NECESSARIA { border-left: 6px solid var(--bad); }
.vitem.st-NAO_APLICAVEL { border-left: 6px solid #b5b5b5; }
.vitem .vlabel { font-weight: 600; margin-bottom: .25rem; }
.vitem .req { color: var(--bad); }
.statusbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .75rem 0; }
.statusbar input { position: absolute; opacity: 0; pointer-events: none; }
.statusbar label { margin: 0; min-height: 56px; display: flex; align-items: center; justify-content: center; text-align: center; border: 2px solid var(--sand-300); border-radius: 12px; font-size: .82rem; font-weight: 700; cursor: pointer; padding: .3rem; background: #fff; user-select: none; line-height: 1.15; }
.statusbar input:focus-visible + label { outline: 3px solid var(--accent); }
.statusbar input[value=OK]:checked + label { background: var(--ok); border-color: var(--ok); color: #fff; }
.statusbar input[value=OBSERVAR]:checked + label { background: #c98d24; border-color: #c98d24; color: #fff; }
.statusbar input[value=ACAO_NECESSARIA]:checked + label { background: var(--bad); border-color: var(--bad); color: #fff; }
.statusbar input[value=NAO_APLICAVEL]:checked + label { background: #8a8a8a; border-color: #8a8a8a; color: #fff; }
@media (max-width: 420px) { .statusbar { grid-template-columns: repeat(2, 1fr); } }
.vitem details summary { cursor: pointer; color: var(--green-800); font-weight: 600; font-size: .9rem; }
.vitem .saved { font-size: .8rem; color: var(--ok); }
.vitem .saving { font-size: .8rem; color: var(--muted); }
.vitem .err { font-size: .85rem; color: var(--bad); }
.finish-bar { position: sticky; bottom: 0; background: var(--sand-50); border-top: 1px solid var(--line); padding: .75rem 0; z-index: 10; }

/* ---------- Report (screen + print) ---------- */
.report { background: #fff; max-width: 900px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--radius); }
.report-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--green-900); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.report-overall { font: 600 1.4rem/1.2 var(--serif); padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.report-overall.ov-OK { background: var(--ok-bg); color: var(--ok); }
.report-overall.ov-OBSERVAR { background: var(--warn-bg); color: var(--warn); }
.report-overall.ov-ACAO_NECESSARIA { background: var(--bad-bg); color: var(--bad); }
.report table td:first-child { width: 55%; }
.report .rsec { break-inside: avoid; margin-bottom: 1.25rem; }
.report .rsec h3 { border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.print-actions { max-width: 900px; margin: 0 auto 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .app-top, .tabs, .ctl-side, .print-actions, .no-print, .site-header, .site-footer, .wa-float { display: none !important; }
  .ctl-shell { display: block; }
  .ctl-main, .app-main { padding: 0; }
  .report { border: 0; padding: 0; max-width: none; }
  .photos { grid-template-columns: repeat(4, 1fr); }
  a { color: inherit; text-decoration: none; }
  .badge { border: 1px solid currentColor; }
}

/* Auth / minimal */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: linear-gradient(160deg, var(--green-950), var(--green-800)); }
.auth-card { width: 100%; max-width: 420px; background: var(--sand-50); border-radius: 18px; padding: 2rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.auth-card .brand { margin-bottom: 1.25rem; }
.auth-logo { display: block; width: min(260px, 100%); margin: 0 auto 1.5rem; }
.report-logo { width: 200px; }

/* Compact staff header on phones */
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .app-top .brand span { display: none; }
}

/* ---- Additional-services catalog: portal request flow and Control (shared) ---- */
.subtabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; }
.subtabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .95rem; }
.subtabs a.active, .subtabs a:hover { color: var(--green-900); border-bottom-color: var(--accent); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.chips a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--sand-300); text-decoration: none; color: var(--green-900); font-size: .875rem; background: #fff; }
.chips a.active { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.pkg { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pkg-included { background: var(--ok-bg); color: var(--ok); }
.pkg-additional_fee { background: var(--warn-bg); color: var(--warn); }
.pkg-quote_required { background: var(--info-bg); color: var(--info); }
.pkg-note { border-radius: var(--radius-sm); padding: .9rem 1rem; margin: 0 0 1rem; border: 1px solid var(--line); background: var(--sand-100); }
.pkg-note p { margin: .25rem 0 0; font-size: .95rem; }
.pkg-note .pkg-head { font-weight: 700; color: var(--green-950); }
.pkg-note-included { background: var(--ok-bg); border-color: #c6dfce; }
.pkg-note-additional_fee { background: var(--warn-bg); border-color: #ecd8ae; }
.pkg-note-quote_required { background: var(--info-bg); border-color: #c9d9e7; }
.req-property { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.req-property select { width: auto; min-width: 220px; }
.req-property-one { margin: 0 0 1rem; color: var(--muted); }
.req-steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.25rem; counter-reset: s; flex-wrap: wrap; }
.req-steps li { counter-increment: s; font-size: .875rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.req-steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--sand-300); background: #fff; font-weight: 700; }
.req-steps li + li::after { order: -1; content: ''; width: 1.5rem; height: 1px; background: var(--sand-300); }
.req-steps li.now { color: var(--green-950); font-weight: 600; }
.req-steps li.now::before { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.req-steps li.done::before { content: '✓'; background: var(--ok-bg); color: var(--ok); border-color: #c6dfce; }
.cat-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.cat-tile { display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem 1.1rem; min-height: 132px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.cat-tile:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--ink); }
.cat-tile .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green-100); color: var(--green-900); }
.cat-tile .ico svg { width: 24px; height: 24px; }
.cat-tile .name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--green-950); }
.cat-tile .count { font-size: .85rem; color: var(--muted); }
.req-other { margin-top: 1.5rem; color: var(--muted); font-size: .95rem; }
.svc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.svc-item { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; min-height: 64px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.svc-item:hover { border-color: var(--accent); color: var(--ink); }
.svc-item .txt { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.svc-item .go { font-size: 1.6rem; color: var(--muted); line-height: 1; }
.req-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.req-card { margin: 0; }
.req-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .5rem 1rem; margin: .6rem 0 0; }
.req-meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.req-meta dd { margin: 0; font-size: .95rem; }
tr.due-overdue td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tr.due-soon td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.is-inactive td { opacity: .55; }
.catalog-table td, .rules-table td { vertical-align: middle; }
.rule-select { min-width: 140px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .2rem 1rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--sand-50); padding: .75rem 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .req-steps li + li::after { width: .6rem; }
  .req-property select { min-width: 0; width: 100%; }
}

/* ---- CRM (Vendas): leads, pipeline, propostas, agenda ---- */
.stage { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--mute-bg); color: var(--mute); white-space: nowrap; }
.stage-novo { background: var(--info-bg); color: var(--info); }
.stage-contato, .stage-qualificado { background: #e8eee9; color: var(--green-800); }
.stage-visita, .stage-proposta, .stage-negociacao { background: var(--warn-bg); color: var(--warn); }
.stage-ganho { background: var(--ok-bg); color: var(--ok); }
.stage-perdido { background: var(--mute-bg); color: var(--mute); }
.due-late { color: var(--bad); font-weight: 600; }
.crm-table td { vertical-align: top; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .6rem 1.25rem; margin: 0; }
.kv dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.activity-form { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.kanban { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.kanban-col { flex: 0 0 min(82vw, 270px); scroll-snap-align: start; background: var(--sand-100); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: flex; flex-direction: column; }
.kanban-col h2 { font-size: 1rem; margin: 0 0 .6rem; display: flex; justify-content: space-between; align-items: center; }
.kanban-col .count { font: 600 .8rem var(--sans); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; color: var(--muted); }
.kanban-col.drop-over { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.kanban-ganho h2 { color: var(--ok); }
.kanban-perdido { opacity: .85; }
.kanban-drop { display: grid; gap: .6rem; min-height: 60px; align-content: start; flex: 1; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm, 10px); padding: .7rem .75rem; display: grid; gap: .25rem; box-shadow: var(--shadow); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcard.saving { opacity: .6; pointer-events: none; }
.kcard-name { font-weight: 600; text-decoration: none; color: var(--green-950, var(--ink)); }
.kcard-move { display: flex; gap: .35rem; margin-top: .35rem; }
.kcard-move select { flex: 1; min-width: 0; font-size: .85rem; min-height: 36px; padding: .2rem .4rem; }
.kanban-empty { margin: .25rem 0; }
.items-table input, .items-table select { min-height: 40px; }
.items-table td { vertical-align: middle; }
.items-table td:nth-child(2) input { width: 100%; min-width: 220px; }
.agenda-day { font-size: 1rem; text-transform: capitalize; margin: 1.1rem 0 .4rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.agenda-day:first-child { margin-top: 0; }
.agenda-day.is-today { color: var(--accent); }
.agenda-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.agenda-item { display: grid; grid-template-columns: 3.2rem auto 1fr auto; gap: .5rem; align-items: baseline; }
.agenda-item.is-done .agenda-text a { text-decoration: line-through; color: var(--muted); }
.agenda-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .875rem; }
.agenda-text { min-width: 0; overflow-wrap: anywhere; }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.attention-list li { padding-left: .75rem; border-left: 3px solid var(--warn); }
.attention-list li.att-bad { border-left-color: var(--bad); }
.proposal-doc { background: #fff; max-width: 820px; margin: 1.5rem auto; padding: clamp(1.25rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--radius); }
.proposal-doc .print-actions { margin-bottom: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.proposal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--green-900); padding-bottom: 1rem; margin-bottom: 1rem; }
.proposal-head img { width: 180px; height: auto; }
.proposal-meta { text-align: right; font-size: .95rem; }
.proposal-promise { font: italic 1.1rem/1.4 var(--serif); color: var(--green-800); }
.proposal-items { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.proposal-items th, .proposal-items td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.proposal-items .right { text-align: right; }
.proposal-items tfoot th { border-bottom: 0; }
.proposal-foot { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: .75rem; }
@media print {
  .proposal-doc { border: 0; margin: 0; padding: 0; max-width: none; }
}
@media (max-width: 640px) {
  .agenda-item { grid-template-columns: 2.8rem 1fr; }
  .agenda-item .badge { grid-column: 2; justify-self: start; }
  .agenda-item .agenda-text, .agenda-item form { grid-column: 2; }
  .proposal-meta { text-align: left; }
}