*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.admin {
  margin: 0; min-height: 100svh;
  font: 400 16px/1.5 var(--f-texto);
  color: var(--tinta); background: var(--algodao);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2 { font-family: var(--f-display); font-weight: 400; margin: 0; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; }
::selection { background: var(--junco); color: var(--mel-claro); }
:focus-visible { outline: 3px solid var(--junco); outline-offset: 2px; border-radius: 8px; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* topo trançado */
.adm-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(.75rem, env(safe-area-inset-top)) 1rem .75rem;
  background-color: var(--mel); background-image: var(--trancado); background-size: 56px;
  box-shadow: inset 0 -40px 40px -30px rgba(42,23,8,.45);
}
.adm-brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--junco); }
.adm-brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(246,244,240,.6); }
.adm-brand span {
  font-family: var(--f-display); font-size: 1.15rem; line-height: 1;
  background: rgba(246,244,240,.94); padding: .5rem .85rem; border-radius: 999px; box-shadow: var(--sombra-baixa);
}
.adm-link {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--algodao); color: var(--junco); text-decoration: none; font-weight: 600; font-size: .9rem;
  padding: .5rem .85rem; border-radius: 999px; box-shadow: var(--sombra-baixa);
}

.adm-top-acoes { display: flex; align-items: center; gap: .45rem; }
button.adm-link { border: 0; font-family: var(--f-texto); cursor: pointer; min-height: 38px; }
[hidden] { display: none !important; }

/* tela de senha */
.adm-entrar { max-width: 24rem; margin: 2.5rem auto 0; display: grid; gap: 1.25rem; }
.adm-entrar h1 { font-size: 2.1rem; }
.adm-entrar-intro { color: var(--tinta-2); margin-top: .5rem; }
.adm-entrar .btn-primary { width: 100%; }
.adm-entrar .fld-check { min-height: 40px; font-weight: 500; font-size: .92rem; }
.adm-entrar .fld-check input { width: 20px; height: 20px; }
.adm-esqueci {
  justify-self: center; min-height: 44px; padding: .5rem .75rem;
  background: none; border: 0; cursor: pointer;
  font: 600 .95rem var(--f-texto); color: var(--junco);
  text-decoration: underline; text-underline-offset: .2em;
}
.adm-esqueci:hover { color: var(--tinta); }

.adm-tabs {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: .25rem; padding: .5rem 1rem;
  background: rgba(246,244,240,.96); border-bottom: 1px solid var(--algodao-sombra);
  overflow-x: auto;
}
.adm-tabs a {
  flex: none; text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--tinta-2);
  padding: .55rem 1rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.adm-tabs a[aria-current] { background: var(--junco); color: var(--algodao); }

.adm-main { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 6rem; outline: none; }
.adm-main > h1 { font-size: 2rem; margin: .4rem 0 1.25rem; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1.25rem; }
.adm-head h1 { font-size: 2rem; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: .7rem 1.2rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 .98rem/1.1 var(--f-texto); text-decoration: none;
  transition: transform .25s var(--ease-out), background-color .2s, box-shadow .25s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--junco); color: var(--algodao); box-shadow: var(--sombra-baixa); }
.btn-primary:hover { background: #3a200c; }
.btn-quiet { background: var(--algodao-dobra); color: var(--tinta); }
.btn-quiet:hover { background: var(--algodao-sombra); }
.btn-danger { background: transparent; color: #9B2C1F; margin-left: auto; }
.btn-danger:hover { background: #F6E1DC; }

/* listas */
.adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.adm-row {
  display: flex; align-items: center; gap: .6rem;
  background: #fff; border-radius: 16px; padding: .5rem .6rem .5rem .5rem;
  box-shadow: 0 1px 2px rgba(42,23,8,.08), 0 4px 12px -6px rgba(42,23,8,.18);
}
.adm-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.adm-thumb { flex: none; width: 60px; height: 60px; border-radius: 12px; overflow: hidden; background: var(--algodao-dobra); display: grid; place-items: center; color: var(--tinta-2); }
.adm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.adm-row-text { min-width: 0; display: grid; gap: .1rem; }
.adm-row-text strong { font-weight: 700; font-size: 1.02rem; }
.adm-row-text span { font-size: .86rem; color: var(--tinta-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-tag { font-style: normal; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--algodao-dobra); color: var(--tinta-2); padding: .12rem .45rem; border-radius: 999px; vertical-align: middle; }
.adm-tag-off { background: #EFE3D6; }

.adm-status-quick select {
  appearance: none; font: 600 .82rem/1 var(--f-texto); border: 0; border-radius: 999px;
  padding: .55rem 1.7rem .55rem .75rem; min-height: 38px; cursor: pointer; max-width: 9.5rem;
  background: var(--algodao-dobra) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235A4636' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .65rem center;
  color: var(--tinta);
}
.adm-status-quick select.st-disponivel { background-color: #E5EFD9; color: #2F4A17; }
.adm-status-quick select.st-em-breve { background-color: #F6E7CF; color: #6A4210; }
.adm-status-quick select.st-reservado { background-color: #E9E1F1; color: #45305E; }
.adm-status-quick select.st-vendido { background-color: #E6E2DC; color: #5A4E44; }

.adm-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  background: #FBF3E6; border: 1px solid #EBD8BA; border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem;
  font-size: .9rem; color: var(--tinta-2);
}
.adm-note p { margin: 0; flex: 1 1 16rem; line-height: 1.45; }
.adm-note .btn { min-height: 40px; padding: .5rem .9rem; font-size: .88rem; }
@media (max-width: 479px) { /* celular estreito: a situação desce para baixo do nome */
  .adm-row { flex-wrap: wrap; row-gap: .4rem; }
  .adm-status-quick { flex: 1 0 100%; padding-left: calc(60px + .8rem); }
  .adm-status-quick select { max-width: none; }
}
.adm-empty { text-align: center; padding: 3rem 1rem; display: grid; gap: 1rem; justify-items: center; color: var(--tinta-2); }

/* formulário */
.adm-back { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-weight: 600; color: var(--tinta-2); padding: .4rem 0; min-height: 44px; }
.adm-form { display: grid; gap: 1.25rem; }
.adm-form fieldset { border: 0; margin: 0; padding: 0; }
.adm-form legend, .fld > span:first-child { font-weight: 700; font-size: .92rem; margin-bottom: .45rem; display: block; padding: 0; }
.fld em, .adm-form legend em { font-style: normal; font-weight: 500; color: var(--tinta-2); }
.fld { display: grid; }
.fld input, .fld select, .fld textarea {
  width: 100%; font: 400 1rem/1.4 var(--f-texto); color: var(--tinta);
  background: #fff; border: 1.5px solid var(--algodao-sombra); border-radius: 12px;
  padding: .75rem .85rem; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.fld textarea { resize: vertical; }
.fld input::placeholder, .fld textarea::placeholder { color: #8A7766; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--junco); box-shadow: 0 0 0 3px rgba(196,132,60,.35); }
.fld-err { color: #9B2C1F; font-size: .86rem; margin-top: .35rem; }
.fld-money { display: flex; align-items: stretch; }
.fld-money b { display: grid; place-items: center; padding: 0 .8rem; background: var(--algodao-dobra); border: 1.5px solid var(--algodao-sombra); border-right: 0; border-radius: 12px 0 0 12px; font-weight: 600; color: var(--tinta-2); }
.fld-money input { border-radius: 0 12px 12px 0; }
.fld-check { display: flex; align-items: center; gap: .7rem; font-weight: 600; min-height: 44px; cursor: pointer; }
.fld-check input { width: 22px; height: 22px; accent-color: var(--junco); }
.adm-hint { font-size: .84rem; color: var(--tinta-2); margin-top: .4rem; }

.adm-seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.adm-seg label { position: relative; cursor: pointer; }
.adm-seg input { position: absolute; opacity: 0; inset: 0; }
.adm-seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .95rem; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--algodao-sombra); font-weight: 600; font-size: .92rem; color: var(--tinta-2);
  transition: background-color .2s, color .2s, border-color .2s;
}
.adm-seg input:checked + span { background: var(--junco); border-color: var(--junco); color: var(--algodao); }
.adm-seg input:focus-visible + span { outline: 3px solid var(--mel); outline-offset: 2px; }

.adm-photos.is-busy { opacity: .6; pointer-events: none; }
.adm-photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.adm-photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--algodao-dobra); }
.adm-photo img { width: 100%; height: 100%; object-fit: cover; }
.adm-photo-capa, .adm-photo-btn {
  position: absolute; left: .35rem; bottom: .35rem; display: inline-flex; align-items: center; gap: .25rem;
  font: 700 .7rem/1 var(--f-texto); padding: .35rem .5rem; border-radius: 999px; border: 0;
  background: rgba(246,244,240,.94); color: var(--junco);
}
.adm-photo-btn { cursor: pointer; font-weight: 600; }
.adm-photo-del {
  position: absolute; top: .3rem; right: .3rem; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: rgba(23,19,15,.72); color: #fff;
}
.adm-photo-add {
  aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: .35rem; cursor: pointer;
  border: 2px dashed var(--algodao-sombra); border-radius: 14px; color: var(--tinta-2); font-size: .82rem; font-weight: 600; text-align: center; padding: .5rem;
  background: #fff;
}
.adm-photo-add:hover { border-color: var(--mel); color: var(--junco); }
.adm-photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.adm-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  margin: .5rem -1rem 0; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  background: rgba(246,244,240,.97); border-top: 1px solid var(--algodao-sombra);
}
.adm-actions .btn-primary { flex: 1 1 8rem; max-width: 14rem; }

.adm-card { background: #fff; border-radius: 18px; padding: 1.2rem; display: grid; gap: .7rem; justify-items: start; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(42,23,8,.08), 0 4px 12px -6px rgba(42,23,8,.18); }
.adm-card h2 { font-size: 1.4rem; }
.adm-card p { color: var(--tinta-2); max-width: 52ch; }
.adm-card .adm-form-senha { justify-self: stretch; max-width: 26rem; gap: 1rem; }
.adm-form-senha .btn-primary { justify-self: start; }

.adm-toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 150%); opacity: 0;
  background: var(--pelo); color: var(--algodao); padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .92rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  transition: transform .45s var(--ease-out), opacity .3s;
  pointer-events: none; max-width: calc(100vw - 2rem);
}
.adm-toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ===== Página do site ===== */
.adm-intro { color: var(--tinta-2); max-width: 52ch; margin: -.5rem 0 1.25rem; }
.adm-pagina { gap: .7rem; }
.adm-bloco {
  background: #fff; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(42,23,8,.08), 0 4px 12px -6px rgba(42,23,8,.18);
}
.adm-bloco summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .75rem;
  min-height: 64px; padding: .8rem 1rem; border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}
.adm-bloco summary::-webkit-details-marker { display: none; }
.adm-bloco summary:hover { background: #FCFAF6; }
.adm-bloco-nome { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.adm-bloco-nome strong { font: 400 1.25rem/1.15 var(--f-display); }
.adm-bloco-nome small { font-size: .86rem; color: var(--tinta-2); }
.adm-bloco-seta { flex: none; color: var(--tinta-2); transition: rotate .25s var(--ease-out); }
.adm-bloco[open] .adm-bloco-seta { rotate: 180deg; }
.adm-bloco[open] summary { border-bottom: 1px solid var(--algodao-dobra); border-radius: 18px 18px 0 0; }
.adm-bloco-corpo { display: grid; gap: 1.25rem; padding: 1.1rem 1rem 1.2rem; }
.adm-restaurar { justify-self: start; min-height: 42px; font-size: .9rem; }
.adm-pagina code { font-size: .88em; background: var(--algodao-dobra); padding: .05rem .3rem; border-radius: 5px; }

/* vídeo da abertura: o quadro mostra o que entra no ninho */
.adm-video { display: grid; gap: 1rem; align-items: start; }
.adm-video.is-busy, .fld.is-busy { opacity: .55; pointer-events: none; }
.adm-video-quadro {
  position: relative; overflow: hidden; width: min(100%, 15rem);
  border-radius: 16px; background: var(--pelo); cursor: crosshair; touch-action: none;
  outline-offset: 3px;
}
.adm-video-quadro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.adm-video-sombra { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.adm-foco { position: absolute; z-index: 2; aspect-ratio: 1; border-radius: 50%; translate: -50% -50%; pointer-events: none; }
.adm-foco-celular { border: 3px solid var(--algodao); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.adm-foco-computador { border: 2px dashed rgba(246,244,240,.95); }
.adm-video-lado, .adm-foto-lado { display: grid; gap: .55rem; align-content: start; }
.adm-video-lado .adm-hint, .adm-foto-lado .adm-hint { margin: 0; }
.adm-video-status { font-weight: 700; font-size: .95rem; }
.adm-video-botoes { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-video-botoes .btn { min-height: 44px; padding: .55rem 1rem; font-size: .92rem; }
@media (min-width: 560px) { .adm-video { grid-template-columns: 15rem minmax(0, 1fr); } }

.adm-foto { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.adm-foto img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; background: var(--algodao-dobra); }
.adm-foto-alt { margin-top: .9rem; }

/* assuntos de cuidados */
.adm-formato { display: grid; gap: .35rem; margin: 0; }
.adm-formato ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem; }
.adm-assuntos { display: grid; gap: .9rem; }
.adm-assunto-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.adm-assunto { display: grid; gap: .9rem; padding: .9rem; border: 1.5px solid var(--algodao-dobra); border-radius: 16px; background: #FDFCFA; }
.adm-assunto-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.adm-assunto-num { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.adm-assunto-num svg, .adm-icones svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.adm-assunto-mover { display: inline-flex; gap: .25rem; }
.adm-ico-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--algodao-dobra); color: var(--tinta);
}
.adm-ico-btn:hover { background: var(--algodao-sombra); }
.adm-ico-btn:disabled { opacity: .35; cursor: default; }
.adm-ico-perigo { color: #9B2C1F; }
.adm-ico-perigo:hover { background: #F6E1DC; }
.adm-icones { display: flex; flex-wrap: wrap; gap: .4rem; }
.adm-icones label { position: relative; cursor: pointer; }
.adm-icones input { position: absolute; opacity: 0; inset: 0; }
.adm-icones label > span {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--algodao-sombra); color: var(--tinta-2);
  transition: background-color .2s, color .2s, border-color .2s;
}
.adm-icones input:checked + span { background: var(--mel-claro); border-color: var(--mel-escuro); color: var(--junco); }
.adm-icones input:focus-visible + span { outline: 3px solid var(--junco); outline-offset: 2px; }

/* carregando (botão de arquivo enviando) */
.btn.is-busy { opacity: .55; pointer-events: none; }

/* senha por cima, quando a sessão acaba no meio do trabalho */
.adm-dialogo {
  width: min(24rem, calc(100vw - 2rem)); border: 0; border-radius: 20px; padding: 1.4rem;
  background: var(--algodao); color: var(--tinta); box-shadow: 0 24px 60px -20px rgba(42,23,8,.5);
}
.adm-dialogo::backdrop { background: rgba(23,19,15,.55); }
.adm-dialogo h2 { font-size: 1.6rem; }
.adm-dialogo .adm-hint { margin: .4rem 0 1.1rem; }
.adm-dialogo .btn-primary { width: 100%; }

/* topo no celular: "Painel", "Ver o site" e "Sair" numa linha só */
.adm-brand span, .adm-link { white-space: nowrap; }
@media (max-width: 430px) {
  .adm-top { gap: .5rem; }
  .adm-brand-extra { display: none; }
  .adm-link { padding: .5rem .75rem; }
}
