/* Localizzy: tema claro corporativo, laranja como acento e neutros quentes. Sem fontes externas (rápido e privado). */
:root {
  color-scheme: light;
  --bg: #f6f3ef; --surface: #fff; --surface2: #fbf8f5; --ink: #1e1a16; --muted: #6f665d; --line: #ece5dd;
  --acc: #ff7a1a; --acc-ink: #fff; --acc-soft: #fff0e2; --acc-deep: #c85400;
  --ok: #1b9a5f; --ok-soft: #e5f6ed; --warn: #a87100; --warn-soft: #fff4d6; --bad: #c9302f; --bad-soft: #fde8e8;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .06);
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* botões e formulários */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; transition: border-color .15s, background .15s, color .15s; }
.btn:hover { border-color: var(--acc); color: var(--acc-deep); }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); box-shadow: 0 4px 14px rgba(255, 122, 26, .3); }
.btn.pri:hover { background: var(--acc-deep); border-color: var(--acc-deep); color: var(--acc-ink); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #d8cfc4; border-radius: 10px; background: var(--surface); font-weight: 400; font-size: 16px; }
input:focus { border-color: var(--acc); outline: 3px solid var(--acc-soft); outline-offset: 0; }
.pw { position: relative; display: block; }
.pw input { padding-right: 84px; }
.link { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 8px; color: var(--acc-deep); font-weight: 600; font-size: 13px; }
.stack { display: grid; gap: 14px; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 14px 0; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: #136b41; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: #136b41; }
.pill.mut { background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }

/* login */
.is-auth { min-height: 100vh; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-brand { padding: 48px max(32px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: center; gap: 18px; background: linear-gradient(150deg, #ff9a45, #ef6200); color: #fff; }
.auth-brand h1 { font-size: 40px; }
.auth-brand p { max-width: 38ch; font-size: 17px; opacity: .95; }
.auth-brand ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-brand li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.logo-lg { width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.logo-lg .ic { width: 30px; height: 30px; }
.auth-card { display: grid; place-items: center; padding: 32px var(--gutter-r) 32px var(--gutter-l); }
.auth-card form { width: min(100%, 380px); display: grid; gap: 14px; }
.auth-card h2 { font-size: 26px; }

/* estrutura interna */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; }
.brand i { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #ffa45c, #ff6a00); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(255, 106, 0, .35); color: #fff; font-style: normal; }
.brand b { display: block; font-size: 17px; font-weight: 700; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav .off { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface2); color: var(--ink); }
.nav a.on { background: var(--acc-soft); color: var(--acc-deep); font-weight: 600; }
.nav .off { opacity: .55; cursor: default; }
.nav .off em { margin-left: auto; font-style: normal; font-size: 11px; border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; }
.foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; min-width: 0; }
.who:hover, .who.on { background: var(--surface2); }
.who-t { min-width: 0; display: grid; }
.who-t b, .who-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t small { color: var(--muted); font-size: 12px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--acc-soft); color: var(--acc-deep); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.foot form { margin: 0; }
.main { min-width: 0; padding: 28px var(--gutter-r) 60px 32px; }
.topbar { display: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font-size: 26px; }
.head p { margin-top: 2px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.pad { padding: 20px 22px; }
.narrow { max-width: 520px; }
.sec { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sec h2 { font-size: 17px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps p { font-size: 13px; margin-top: 2px; }
.dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 13px; }
.steps .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.scrim { position: fixed; inset: 0; background: rgba(30, 26, 22, .45); z-index: 20; }
.erro { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px var(--gutter-r) 24px var(--gutter-l); }
.erro .cod { font-size: 56px; color: var(--acc); line-height: 1; }

/* celular: menu vira gaveta */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px var(--gutter-l); gap: 10px; }
  .auth-brand h1 { font-size: 30px; }
  .auth-brand ul, .auth-brand p { display: none; }
  .logo-lg { width: 44px; height: 44px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .side { transform: none; }
  .topbar { display: flex; align-items: center; gap: 8px; margin: -12px 0 14px -8px; }
  .main { padding: 14px var(--gutter-r) 48px var(--gutter-l); }
  .head h1 { font-size: 22px; }
  .steps li { grid-template-columns: 30px minmax(0, 1fr); }
  .steps .pill { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Etapa 2: listas, tabelas, formulários de cadastro ---------- */
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #a82524; border-color: #a82524; color: #fff; }
.btn.perigo { color: var(--bad); margin-left: auto; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.forte { font-weight: 700; }
.forte:hover { color: var(--acc-deep); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: block; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { display: block; font-size: 26px; margin-top: 2px; font-variant-numeric: tabular-nums; }
a.kpi:hover { border-color: var(--acc); }
.kpi.ok { border-left-color: var(--ok); } .kpi.warn { border-left-color: #e0a100; } .kpi.bad { border-left-color: var(--bad); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros input[type=search] { flex: 1 1 220px; width: auto; min-height: 40px; }
.filtros select, textarea, select { min-height: 40px; padding: 8px 12px; border: 1px solid #d8cfc4; border-radius: 10px; background: var(--surface); font: inherit; font-size: 16px; width: 100%; }
.filtros select { width: auto; }
textarea { min-height: 96px; resize: vertical; font-weight: 400; }
select:focus, textarea:focus { border-color: var(--acc); outline: 3px solid var(--acc-soft); outline-offset: 0; }
.card + .card, .alert + .card, .card + form { margin-top: 16px; }
.tablew { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: var(--surface2); }
.tabela th.r, .tabela td.r { text-align: right; }
.lin-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.lin-warn td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
.acoes { display: inline-flex; gap: 4px; }
.vazio { padding: 28px 20px; text-align: center; color: var(--muted); }
.abas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.abas a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted); }
.abas a.on { background: var(--acc-soft); border-color: var(--acc); color: var(--acc-deep); }
.migalhas { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.migalhas a:hover { color: var(--acc-deep); }
.dados { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; margin: 6px 0 0; }
.dados dt { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.dados dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.obs { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.grade2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.req { color: var(--bad); }
.ajuda { color: var(--muted); font-weight: 400; font-size: 12px; }
.erro-campo { color: var(--bad); font-weight: 500; font-size: 12px; }
label.tem-erro input { border-color: var(--bad); }
.head .pill { font-size: 13px; }

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.tres { grid-template-columns: minmax(0, 1fr); }
  .dados { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade2 { grid-template-columns: minmax(0, 1fr); }
  /* tabela vira lista de cartões no celular */
  .tabela thead { display: none; }
  .tabela, .tabela tbody { display: block; }
  .tabela tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tabela tr:last-child { border-bottom: 0; }
  .tabela td { display: block; padding: 0; border: 0; }
  .tabela td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .tabela td:first-child { grid-column: 1 / -1; font-size: 16px; }
  .tabela td.r { text-align: left; }
  .lin-bad td:first-child, .lin-warn td:first-child { box-shadow: none; }
  .lin-bad { box-shadow: inset 3px 0 0 var(--bad); } .lin-warn { box-shadow: inset 3px 0 0 #e0a100; }
}
@media (max-width: 480px) { .dados { grid-template-columns: minmax(0, 1fr); } }
.rot { display: block; }
.hora { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.tabela td[data-label="Locatário"] { min-width: 190px; }
.tabela th, .tabela td { padding-left: 12px; padding-right: 12px; }

/* painel */
.duas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.duas > .card { margin: 0; }
.lista { display: grid; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); min-width: 0; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--surface2); }
.item .grow { flex: 1 1 auto; min-width: 0; display: grid; }
.item .grow b, .item .grow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .dir { display: grid; text-align: right; font-size: 13px; white-space: nowrap; }
.barras { display: grid; gap: 14px; }
.barras .linha { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 4px; }
progress { width: 100%; height: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface2); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--surface2); }
progress::-webkit-progress-value { background: var(--acc); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--acc); border-radius: 99px; }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.nav a { align-items: center; }

/* calendário da chácara */
.meses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mes { padding: 14px; }
.mes h3 { font-size: 15px; margin-bottom: 8px; }
.semana, .dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.semana b { font-size: 11px; color: var(--muted); }
.dia { display: block; padding: 5px 0; border-radius: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.dia.vazio { visibility: hidden; }
.dia.ocupado { background: var(--acc); color: var(--acc-ink); font-weight: 700; }
.dia.ocupado.passado { background: #f3c9a5; color: #6a3500; }
.dia.hoje { outline: 2px solid var(--ink); outline-offset: -2px; font-weight: 700; }
a.dia:hover { filter: brightness(.93); }
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.legenda .dia { display: inline-block; width: 22px; padding: 2px 0; }
@media (max-width: 860px) { .duas { grid-template-columns: minmax(0, 1fr); } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* modelos e geração de contrato */
.clausula { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
.clausula.nova { border-style: dashed; }
.clausula-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.clausula textarea { width: 100%; min-height: 0; padding: 10px 12px; border: 1px solid #d8cfc4; border-radius: 10px; background: var(--surface); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; }
label.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; }
label.chk input { width: 18px; height: 18px; min-height: 0; accent-color: var(--acc); }
code { background: var(--surface2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: 13px; }
.card .stack textarea, form.card textarea, .card.stack textarea { width: 100%; }

/* Imóveis gerais (grupos) */
.grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.grupo { display: grid; gap: 6px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
a.grupo:hover { border-color: var(--acc); }
.grupo-nome { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.grupo-sub { color: var(--muted); font-size: 13px; }
.grupo-num { display: grid; margin-top: 8px; }
.grupo-num b { font-size: 22px; font-variant-numeric: tabular-nums; }
.grupo-num small { color: var(--muted); font-size: 12px; }
.grupo-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
