:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #16181d;
  --mut: #6b7180;
  --line: #e3e6eb;
  --acc: #1f3a5f;
  --acc-2: #c8a96a;
  --acc-soft: #e8eef6;
  --ok: #1f8a4c;
  --ok-soft: #e4f4ea;
  --erro: #c4372d;
  --erro-soft: #fbeae8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 8px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--mut); }
small { font-size: 13px; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.marca b { display: block; font-size: 15px; }
.marca small { display: block; color: var(--mut); font-size: 12px; }
.marca-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--acc); display: grid; place-items: center; }
.marca-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--acc-2); stroke-width: 2.4; stroke-linejoin: round; }
.topo nav { display: flex; gap: 4px; }
.topo nav a { text-decoration: none; color: var(--mut); font-weight: 500; padding: 8px 14px; border-radius: 999px; }
.topo nav a.ativo { background: var(--acc-soft); color: var(--acc); }

main { max-width: 1240px; margin: 0 auto; padding: 28px 28px 80px; }
.pagina-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pagina-cab p { margin-top: 6px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: #c9ced6; background: #fafbfc; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primario { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primario:hover { background: #18304f; }
.btn.grande { padding: 14px 22px; font-size: 15px; }
.btn.perigo { color: var(--erro); }
.btn svg, .icone svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icone {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: transparent; color: var(--mut); cursor: pointer;
}
.icone:hover { background: #eef0f3; color: var(--ink); }
.icone.perigo:hover { background: var(--erro-soft); color: var(--erro); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: gira 0.7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Painéis e formulários ---------- */
.painel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.painel + .painel, .duas-col + .painel, .painel + .duas-col, .duas-col + .duas-col { margin-top: 18px; }
.painel-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.painel > h2 { margin-bottom: 6px; }
.painel > p.muted { margin-bottom: 14px; }
.duas-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .duas-col { grid-template-columns: 1fr; } }

label.campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #3b404b; }
label.campo small { font-weight: 400; color: var(--mut); }
input[type='text'], input[type='number'], input[type='password'], input[type='email'], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12); }
.grade-form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.grade-form .c2 { grid-column: span 2; } .grade-form .c3 { grid-column: span 3; } .grade-form .c6 { grid-column: span 6; }
@media (max-width: 700px) { .grade-form { grid-template-columns: repeat(2, 1fr); } .grade-form .c3, .grade-form .c6 { grid-column: span 2; } }
.linha-acoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.proximo { display: flex; justify-content: flex-end; margin-top: 22px; }

/* ---------- Lista de imóveis ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card-im {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card-im:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08); }
.card-im .thumb { aspect-ratio: 4 / 3; background: #e9ecf0 center/cover no-repeat; display: grid; place-items: center; color: #9aa1ad; }
.card-im .thumb svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.card-im .corpo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.card-im .titulo { font-weight: 600; }
.card-im .excluir { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.92); }
.selos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.selo { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eef0f3; color: var(--mut); }
.selo.ok { background: var(--ok-soft); color: var(--ok); }
.vazio { text-align: center; padding: 60px 20px; }
.vazio svg { width: 54px; height: 54px; fill: none; stroke: #a9b0bb; stroke-width: 1.4; margin-bottom: 12px; }
.vazio h2 { margin-bottom: 6px; }
.vazio .btn { margin-top: 18px; }
.alerta { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff7e6; border: 1px solid #f3dfb2; color: #6b4e12; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.alerta.info { background: var(--acc-soft); border-color: #cfdbea; color: #1f3a5f; }

/* ---------- Editor ---------- */
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--mut); text-decoration: none; font-weight: 500; margin-bottom: 10px; }
.voltar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.editor-cab { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.status-salvo { font-size: 13px; color: var(--mut); }
.status-salvo.erro { color: var(--erro); }
.passos { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; margin-bottom: 20px; overflow-x: auto; }
.passo { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 14px; border-radius: 10px; text-decoration: none; color: var(--mut); font-weight: 600; white-space: nowrap; }
.passo b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #eef0f3; color: var(--mut); }
.passo.ativo { background: var(--acc); color: #fff; }
.passo.ativo b { background: rgba(255, 255, 255, 0.18); color: #fff; }
.passo .qtd { font-size: 12px; font-weight: 600; opacity: 0.75; }

/* Fotos */
.soltar {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 2px dashed #cdd3dc; border-radius: var(--radius); padding: 34px 20px; cursor: pointer; background: #fafbfc;
  transition: border-color 0.15s, background 0.15s;
}
.soltar:hover, .soltar.sobre { border-color: var(--acc); background: var(--acc-soft); }
.soltar svg { width: 34px; height: 34px; fill: none; stroke: var(--acc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.soltar b { font-size: 16px; }
.soltar small { color: var(--mut); max-width: 560px; }
.progresso { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.progresso .barra { flex: 1; height: 8px; border-radius: 99px; background: #e7eaee; overflow: hidden; }
.progresso .barra i { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 99px; transition: width 0.3s; }
.progresso span { font-size: 13px; color: var(--mut); min-width: 260px; }
.fotos-cab { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 26px 0 14px; }
.grade-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.foto { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: opacity 0.2s, outline-color 0.15s; outline: 2px solid transparent; }
.foto.fora { opacity: 0.5; }
.foto.arrastando { opacity: 0.35; }
.foto.alvo { outline-color: var(--acc); }
.foto-img { position: relative; aspect-ratio: 4 / 3; background: #e9ecf0; cursor: grab; }
.foto-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.foto .ordem { position: absolute; top: 8px; left: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.foto .selo-capa { position: absolute; top: 8px; right: 8px; background: var(--acc-2); color: #1d1608; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; }
.foto input.leg { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; }
.foto input.leg:focus { box-shadow: none; background: #fafbfc; }
.foto-acoes { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #3b404b; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--acc); }
.link-btn { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--acc); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.link-btn:hover { background: var(--acc-soft); }
.link-btn:disabled { color: var(--mut); cursor: default; background: none; }

/* Opções do carrossel e do vídeo */
.opcoes { display: flex; flex-wrap: wrap; gap: 22px 28px; margin-bottom: 20px; }
.grupo { display: flex; flex-direction: column; gap: 8px; }
.grupo > span { font-size: 13px; font-weight: 600; color: #3b404b; }
.segmentado { display: inline-flex; background: #eef0f3; border-radius: 10px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.segmentado button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--mut); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.segmentado button.sel { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.segmentado button:disabled { opacity: 0.5; cursor: not-allowed; }
.estilos { display: flex; gap: 10px; flex-wrap: wrap; }
.estilo { font: inherit; text-align: left; display: flex; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; min-width: 210px; }
.estilo.sel { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12); }
.estilo b { display: block; font-size: 14px; }
.estilo small { color: var(--mut); font-size: 12px; }
.amostra { width: 44px; height: 55px; border-radius: 6px; flex: none; position: relative; overflow: hidden; }
.amostra i { position: absolute; display: block; }
input[type='range'] { accent-color: var(--acc); width: 180px; }

.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.slide { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: #e9ecf0; box-shadow: var(--shadow); cursor: zoom-in; }
.slide img { width: 100%; display: block; }
.slide figcaption { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; }
.slide figcaption span { background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.slide figcaption a { background: rgba(255, 255, 255, 0.95); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--ink); opacity: 0; transition: opacity 0.15s; }
.slide:hover figcaption a { opacity: 1; }
.slide figcaption a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
#legenda { font-size: 14px; min-height: 260px; }

.video-res { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 24px; align-items: start; }
.video-res video { width: 100%; border-radius: 12px; background: #000; display: block; }
.video-res .info { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 760px) { .video-res { grid-template-columns: 1fr; } }
.avisos { margin: 0; padding-left: 18px; color: #6b4e12; font-size: 13px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 16, 0.88); display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.lightbox img { max-width: min(90vw, 760px); max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lightbox button { font: inherit; font-size: 22px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; flex: none; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox .fechar { position: absolute; top: 18px; right: 18px; }
.lightbox .cont { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 600; }

/* Marca */
.arquivos-marca { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.arq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.arq .prev { height: 120px; display: grid; place-items: center; padding: 16px; background: #fff; }
.arq .prev.escuro { background: #1b1d22; }
.arq .prev img { max-height: 88px; max-width: 100%; object-fit: contain; }
.arq .prev .nada { color: var(--mut); font-size: 13px; }
.arq .prev.escuro .nada { color: #9aa1ad; }
.arq .rod { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.cores { display: flex; gap: 18px; flex-wrap: wrap; }
.cor { display: flex; align-items: center; gap: 10px; }
.cor input[type='color'] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; }
.cor input[type='text'] { width: 110px; font-family: ui-monospace, monospace; }
.barra-salvar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 18px; }
.barra-salvar .btn { box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18); }

/* Login e administração */
body.deslogado .so-logado { display: none; }
.topo nav { align-items: center; }
.seletor-cliente { width: auto; max-width: 240px; padding: 8px 12px; font-weight: 600; margin-right: 8px; background: var(--acc-soft); border-color: #cfdbea; color: var(--acc); }
.tela-login { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.cartao-login { width: min(420px, 100%); }
.cartao-login h1 { margin-bottom: 6px; }
.cartao-login form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.cartao-login .btn { width: 100%; }
.erro-form { color: var(--erro); font-size: 14px; min-height: 20px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mut); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tabela td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .acoes { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.tabela-rolagem { overflow-x: auto; }
.selo.admin { background: #efe7d6; color: #6b4e12; }
.selo.inativo { background: var(--erro-soft); color: var(--erro); }
.form-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

.topo nav a { white-space: nowrap; }
@media (max-width: 960px) {
  .topo { padding: 10px 16px; }
  .marca > span:last-child { display: none; }
  .topo nav a { padding: 8px 10px; }
}

/* Avisos rápidos */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: #1b1d22; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); font-size: 14px; animation: entra 0.2s ease-out; }
.toast.erro { background: var(--erro); }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } }
