:root {
  color-scheme: light;
  --ink: #0b1830;
  --ink-soft: #4b5b73;
  --navy: #0b1830;
  --blue: #087ea4;
  --cyan: #28b8d8;
  --ice: #eaf7fa;
  --paper: #f5f7fa;
  --white: #ffffff;
  --line: #d8e0e9;
  --orange: #e87543;
  --green: #18865e;
  --shadow: 0 18px 45px rgba(11, 24, 48, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center;
  justify-content: space-between; color: white; background: var(--navy);
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--cyan); color: var(--navy); font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: #a9b7cb; font-size: .75rem; }
.database-status { display: flex; align-items: center; gap: 8px; color: #c9d4e2; font-size: .82rem; }
.database-status > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #f1b64c; box-shadow: 0 0 0 4px rgba(241,182,76,.13); }
.database-status.is-ready > span:first-child { background: #35ca8a; box-shadow: 0 0 0 4px rgba(53,202,138,.13); }

main { width: min(1440px, 100%); margin: 0 auto; }
.search-panel { padding: 38px clamp(20px, 4vw, 64px) 42px; background: linear-gradient(115deg, #0b1830 0%, #112748 65%, #093d50 100%); color: white; }
.search-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.eyebrow { margin: 0 0 7px; font-size: .72rem; line-height: 1.2; letter-spacing: .14em; font-weight: 800; color: var(--blue); }
.search-panel .eyebrow { color: #62d7ef; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin-bottom: 5px; font-size: clamp(1.45rem, 2vw, 2rem); letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 1.08rem; }
.search-note { max-width: 420px; margin: 0 0 3px; color: #bfcde0; line-height: 1.5; font-size: .9rem; }
.search-form { display: grid; grid-template-columns: minmax(280px, 1fr) 150px 150px; gap: 12px; margin-top: 25px; }
label span, .period-control label { display: block; margin: 0 0 8px; font-size: .78rem; color: #c6d3e4; font-weight: 700; }
input, select { width: 100%; height: 50px; border: 1px solid transparent; border-radius: 10px; background: white; color: var(--ink); padding: 0 15px; outline: none; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(40,184,216,.2); }
.primary-button { align-self: end; height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-radius: 10px; padding: 0 18px; background: var(--cyan); color: var(--navy); font-weight: 800; }
.primary-button:hover { background: #62d7ef; }
.form-message { min-height: 20px; margin-top: 12px; color: #ffd1bd; font-size: .86rem; }

.candidate-section, .workspace { padding: 34px clamp(20px, 4vw, 64px) 64px; }
.section-title-row, .property-header, .panel-heading, .table-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.muted { margin: 0; color: var(--ink-soft); font-size: .86rem; }
.candidate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-top: 18px; }
.candidate-card { min-height: 174px; padding: 20px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.candidate-card:hover, .candidate-card:focus-visible { transform: translateY(-2px); border-color: var(--cyan); box-shadow: var(--shadow); outline: none; }
.candidate-card h3 { font-size: 1.02rem; }
.candidate-card .address { color: var(--ink-soft); font-size: .85rem; line-height: 1.45; }
.candidate-stats { display: flex; gap: 18px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.candidate-stats strong, .candidate-stats span { display: block; }
.candidate-stats strong { font-size: 1.06rem; }
.candidate-stats span { margin-top: 2px; color: var(--ink-soft); font-size: .72rem; }
.candidate-arrow { float: right; color: var(--blue); font-size: 1.25rem; }

.workspace { padding-top: 30px; }
.property-header { align-items: flex-end; }
.text-button { border: 0; background: transparent; color: var(--blue); padding: 6px 0; font-weight: 750; }
#backToCandidates { margin-bottom: 14px; }
.property-meta { margin: 0; color: var(--ink-soft); }
.period-control { width: 200px; }
.period-control label { color: var(--ink-soft); }
.period-control select { border-color: var(--line); background: white; }

.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 25px 0 18px; }
.stat-card { min-height: 125px; padding: 18px; border-radius: 13px; background: white; border: 1px solid var(--line); }
.stat-card.primary { background: var(--navy); color: white; border-color: var(--navy); }
.stat-label { display: block; min-height: 35px; color: var(--ink-soft); font-size: .76rem; line-height: 1.35; font-weight: 700; }
.stat-card.primary .stat-label { color: #b9c8da; }
.stat-value { display: block; margin-top: 9px; font-size: clamp(1.35rem, 2vw, 1.85rem); line-height: 1; font-weight: 850; letter-spacing: -.04em; }
.stat-detail { display: block; margin-top: 7px; color: var(--ink-soft); font-size: .7rem; }
.stat-card.primary .stat-detail { color: #9eb1c8; }

.content-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(260px, .85fr); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: white; padding: 20px; box-shadow: 0 3px 12px rgba(11,24,48,.025); }
.legend { color: var(--ink-soft); font-size: .72rem; white-space: nowrap; }
.legend-band, .legend-line { display: inline-block; width: 18px; height: 8px; margin: 0 5px 0 12px; vertical-align: middle; border-radius: 3px; background: rgba(40,184,216,.22); }
.legend-line { height: 3px; background: var(--blue); }
.chart { min-height: 280px; margin-top: 10px; }
.chart svg { display: block; width: 100%; height: 280px; overflow: visible; }
.chart-footnote { margin: 6px 0 0; color: var(--ink-soft); font-size: .72rem; }
.reading-panel { background: var(--ice); border-color: #c5e8ef; }
.reading-item { padding: 15px 0; border-top: 1px solid #c9e4ea; }
.reading-item:first-child { border-top: 0; }
.reading-item strong { display: block; margin-bottom: 5px; font-size: .9rem; }
.reading-item p { margin: 0; color: #40576b; font-size: .82rem; line-height: 1.5; }

.tabs { display: flex; gap: 4px; margin-top: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 13px 16px; color: var(--ink-soft); font-weight: 750; white-space: nowrap; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--cyan); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: #e2eaf2; color: var(--ink); font-size: .7rem; }
.tab-panel { padding-top: 20px; }
.table-toolbar { align-items: center; margin-bottom: 13px; }
.table-toolbar h3 { margin-bottom: 3px; }
.secondary-button { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); padding: 0 14px; font-weight: 750; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 13px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e7edf3; }
th { position: sticky; top: 0; background: #f3f6f9; color: #46566b; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #f5fbfc; }
.quality-tag { display: inline-flex; border-radius: 99px; padding: 4px 8px; font-size: .68rem; font-weight: 750; background: #e8f6f0; color: var(--green); }
.quality-tag.warning { background: #fff0e9; color: #ad4f27; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 16px; color: var(--ink-soft); font-size: .82rem; }
.criteria { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.criteria > div { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.criteria p { margin: 0; color: var(--ink-soft); font-size: .84rem; line-height: 1.58; }

.loading-overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; background: rgba(245,247,250,.8); backdrop-filter: blur(3px); color: var(--ink); font-weight: 750; }
.loading-overlay[hidden] { display: none; }
.spinner { width: 36px; height: 36px; border: 4px solid #cae7ee; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-overlay p { margin: 13px 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { display: grid; place-items: center; min-height: 180px; color: var(--ink-soft); text-align: center; }

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .reading-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .reading-panel > .eyebrow, .reading-panel > h3 { grid-column: 1 / -1; }
  .reading-item { border-top: 0; border-left: 1px solid #c9e4ea; padding: 0 0 0 14px; }
  .reading-item:first-child { border-left: 0; padding-left: 0; }
}
@media (max-width: 720px) {
  .topbar { height: auto; min-height: 72px; padding-block: 12px; }
  .database-status { display: none; }
  .search-heading, .section-title-row, .property-header { align-items: stretch; flex-direction: column; }
  .search-form { grid-template-columns: 1fr 110px; }
  .primary-button { grid-column: 1 / -1; }
  .period-control { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid .stat-card:last-child { grid-column: 1 / -1; }
  .reading-panel, .criteria { grid-template-columns: 1fr; }
  .reading-item, .reading-item:first-child { border-left: 0; border-top: 1px solid #c9e4ea; padding: 14px 0 0; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .legend { white-space: normal; }
}
@media (max-width: 430px) {
  .search-form { grid-template-columns: 1fr; }
  .primary-button { grid-column: auto; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid .stat-card:last-child { grid-column: auto; }
}

.product-tabs{display:flex;align-items:center;gap:8px;margin-left:auto;margin-right:clamp(12px,3vw,40px)}.product-tabs a{color:#d8deea;text-decoration:none;font-size:13px;font-weight:700;padding:10px 14px;border:1px solid transparent;border-radius:10px;transition:background .15s ease,color .15s ease}.product-tabs a:hover{background:rgba(255,255,255,.09);color:#fff}.product-tabs a[aria-current="page"]{background:#fff;color:var(--ink)}@media(max-width:760px){.topbar{height:auto;min-height:72px;flex-wrap:wrap;padding-top:10px;padding-bottom:10px;gap:8px}.product-tabs{order:3;width:100%;margin:0}.product-tabs a{flex:1;text-align:center}}

/* Faixa institucional do Radar Imóvel SP */
.editorial-header { width: 100%; color: #fff; background: linear-gradient(112deg, #152744 0%, #1b3154 68%, #203b62 100%); }
.editorial-inner { width: min(1600px, 100%); min-height: 258px; margin: 0 auto; padding: 32px clamp(24px, 3vw, 48px) 36px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: 48px; }
.editorial-copy { min-width: 0; }
.editorial-brand { margin: 0 0 16px; color: #ff7048; font-size: 13px; line-height: 1.2; font-weight: 900; letter-spacing: .18em; }
.editorial-copy h1 { max-width: 780px; margin: 0 0 14px; color: #fff; font-size: clamp(32px, 3.8vw, 42px); line-height: 1.06; font-weight: 850; letter-spacing: -.04em; }
.editorial-description { max-width: 790px; margin: 0; color: #d9e2ef; font-size: 18px; line-height: 1.5; }
.editorial-actions { display: grid; gap: 12px; }
.editorial-link { min-height: 60px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid transparent; border-radius: 12px; color: #fff; text-decoration: none; font-size: 15px; font-weight: 850; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.editorial-link:hover { transform: translateY(-1px); }
.editorial-link.is-primary { background: #f2693d; border-color: #f2693d; }
.editorial-link.is-primary:hover { background: #d94f27; border-color: #d94f27; }
.editorial-link.is-secondary { background: rgba(255,255,255,.04); border-color: rgba(206,220,241,.4); }
.editorial-link.is-secondary:hover { background: rgba(255,255,255,.1); }
@media (max-width: 820px) { .editorial-inner { grid-template-columns: 1fr; gap: 24px; padding-block: 30px; } .editorial-actions { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .editorial-inner { padding: 27px 20px 30px; gap: 22px; } .editorial-copy h1 { font-size: 32px; } .desktop-break { display: none; } .editorial-description { font-size: 16px; } .editorial-actions { grid-template-columns: 1fr; gap: 9px; } .editorial-link { min-height: 52px; } }


/* Paleta alinhada à página de Leilões; preserva a estrutura da consulta */
:root {
  --ink: #121b2d;
  --ink-soft: #68758a;
  --navy: #121b2d;
  --blue: #d94f27;
  --cyan: #f2693d;
  --ice: #fff4ed;
  --paper: #f4f6fa;
  --white: #ffffff;
  --line: #dce2eb;
  --orange: #f2693d;
  --green: #17845b;
  --shadow: 0 18px 45px rgba(18, 27, 45, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.search-panel { background: var(--white); color: var(--ink); }
.search-panel .eyebrow { color: #d94f27; }
.search-note { color: var(--ink-soft); }
.search-panel label span { color: var(--ink-soft); }
.form-message { color: #ad4f27; }
.primary-button { background: var(--cyan); color: #fff; }
.primary-button:hover { background: #d94f27; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(242,105,61,.16); }
.candidate-card:hover, .candidate-card:focus-visible { border-color: var(--cyan); }
.reading-panel { border-color: #f0d7cb; }
.reading-item, .reading-item:first-child { border-color: #f0d7cb; }
.legend-band { background: rgba(242,105,61,.22); }
.legend-line { background: var(--blue); }
.spinner { border-color: #f8d8cc; border-top-color: var(--blue); }

.search-panel input, .search-panel select { border-color: #cbd4e2; }
