/* Administração → Escritório: partes Geral e Luz (public/admin-clima.js). Mesma cara do admin.css; tudo com
   prefixo adm-cl- (classes curtas como .voz e .pendente já colidiram com o CSS do chat). */

/* Geral */
.adm-cl-geral { display: grid; gap: 14px; max-width: 600px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--a-linha); }
.adm-cl-geral .adm-campo > label { color: var(--a-suave); }
.adm-cl-busca { display: flex; gap: 8px; }
.adm-cl-busca input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid #DCD4E6; border-radius: 10px; background: #fff; color: var(--a-tinta); font: 14px var(--corpo); }
.adm-cl-busca input:focus-visible, .adm-cl-tempo-sel select:focus-visible { outline: 2px solid var(--a-acento); outline-offset: 1px; }
.adm-cl-busca .adm-sec { flex: none; }
.adm-cl-busca-estado { margin: 0; min-height: 1.4em; font-size: 12.5px; font-weight: 400; color: var(--a-suave); }
.adm-cl-busca-estado:empty { display: none; }
.adm-cl-resultados { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; border: 1px solid var(--a-linha); border-radius: 12px; max-height: 260px; overflow: auto; }
.adm-cl-resultados button { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--a-tinta); text-align: left; font-size: 13.5px; cursor: pointer; }
.adm-cl-resultados button:hover { background: var(--a-acento-suave); }
.adm-cl-resultados svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--a-acento); }
.adm-cl-resultados small, .adm-cl-cidade small { white-space: normal; }
.adm-cl-credito { margin: 0; font-size: 11.5px; font-weight: 400; color: var(--a-suave); }
.adm-cl-credito a { color: inherit; text-underline-offset: 2px; }
.adm-cl-credito a:hover { color: var(--a-tinta); }
.adm-cl-cidade { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--a-acento-suave); }
.adm-cl-cidade strong { font-size: 14.5px; font-weight: 600; }
.adm-cl-cidade-icone, .adm-cl-tempo-icone { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--a-acento); }
.adm-cl-cidade-icone svg, .adm-cl-tempo-icone svg { width: 18px; height: 18px; }
.adm-cl-coord { font-family: var(--mono) !important; font-size: 11.5px !important; }
.adm-cl-cidade .adm-link { flex: none; height: 30px; font-size: 13px; }
.adm-cl-vazio { margin: 0; font-size: 13px; color: var(--a-suave); }
.adm-cl-cidade:has(.adm-cl-vazio) { background: var(--a-fundo); }
.adm-cl-tempo { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--a-linha); border-radius: 14px; }
.adm-cl-tempo strong { font-size: 16px; font-weight: 600; }
.adm-cl-tempo .adm-cl-tempo-icone { background: #EAF4FB; color: #2F80B8; }
.adm-cl-tempo .adm-cl-credito { flex-basis: 100%; }
.adm-cl-tempo:has(> .adm-cl-vazio:only-child) { border-style: dashed; }

/* salvar dentro do painel (Geral e Luz não usam o rodapé do modal) */
.adm-cl-acoes { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--a-linha); }
.adm-cl-estado { flex: 1; min-width: 0; margin: 0; font-size: 13px; color: var(--a-suave); }
.adm-cl-pendente { font-size: 12.5px; color: var(--a-alerta); font-weight: 500; white-space: nowrap; }
.adm-cl-pendente[hidden] { display: none; }

/* Luz */
.adm-cl-icone-sol { background: #FFF3D6; color: #B7791F; }
.adm-cl-icone { background: var(--a-acento-suave); color: var(--a-acento); }
.adm-cl-semcidade { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0 52px; font-size: 13px; color: var(--a-alerta); }
.adm-cl-semcidade[hidden] { display: none; }
.adm-cl-semcidade svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.adm-cl-semcidade .adm-link { height: auto; padding: 0; color: inherit; font: inherit; font-weight: 600; }

/* a planta com as quatro faixas de parede de fora em volta (fundo em cima, frente embaixo, entrada à direita, sacada à
   esquerda); --borda é o espaço das faixas */
.adm-cl-quadro { --borda: 24px; --faixa: 16px; position: relative; padding: var(--borda); border-radius: 16px; background: #FBF9F6; border: 1px solid var(--a-linha); user-select: none; -webkit-user-select: none; }
.adm-cl-quadro .adm-planta { border-radius: 6px; }
.adm-cl-quadro.arrastando, .adm-cl-quadro.arrastando * { cursor: grabbing !important; }
.adm-cl-paredes { position: absolute; inset: var(--borda); pointer-events: none; }
.adm-cl-parede { position: absolute; pointer-events: auto; touch-action: none; cursor: copy; border-radius: 5px;
  background: repeating-linear-gradient(135deg, #E6DFD6 0 6px, #EFEAE3 6px 12px); box-shadow: inset 0 0 0 1px #DDD4C8; transition: box-shadow .12s; }
.adm-cl-parede:hover { box-shadow: inset 0 0 0 1.5px #7FB8DE, 0 0 0 3px rgba(127, 184, 222, .25); }
.adm-cl-p-fundo { left: 0; right: 0; bottom: calc(100% + 4px); height: var(--faixa); }
.adm-cl-p-frente { left: 0; right: 0; top: calc(100% + 4px); height: var(--faixa); }
.adm-cl-p-entrada { top: 0; bottom: 0; left: calc(100% + 4px); width: var(--faixa); }
.adm-cl-sacada { position: absolute; top: 0; bottom: 0; right: calc(100% + 4px); width: var(--faixa); display: grid; place-items: center; overflow: hidden; border-radius: 5px; border: 1.5px dashed #8CC4E6; background: #EEF7FD; color: #2F80B8; }
.adm-cl-sacada span { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 10px/1 var(--corpo); white-space: nowrap; letter-spacing: .02em; }
.adm-cl-porta { position: absolute; left: -2px; right: -2px; border-radius: 3px; cursor: not-allowed; background: repeating-linear-gradient(0deg, #C9A57A 0 3px, #E8D3B5 3px 6px); box-shadow: 0 0 0 1px #B8925F; }
.adm-cl-janela { position: absolute; box-sizing: border-box; border-radius: 4px; cursor: grab; outline: none; border: 2px solid #2F8FCB;
  background: linear-gradient(135deg, #D9F0FC, #9FD3F2); box-shadow: 0 1px 3px rgba(31, 27, 45, .18); }
.adm-cl-p-fundo .adm-cl-janela, .adm-cl-p-frente .adm-cl-janela { top: -2px; bottom: -2px; }
.adm-cl-p-entrada .adm-cl-janela { left: -2px; right: -2px; }
.adm-cl-janela.sel, .adm-cl-janela:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--a-acento); z-index: 1; }
.adm-cl-ponta { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #2F8FCB; opacity: 0; transition: opacity .12s; }
.adm-cl-janela.sel .adm-cl-ponta, .adm-cl-janela:hover .adm-cl-ponta, .adm-cl-janela:focus-visible .adm-cl-ponta { opacity: 1; }
/* a ponta tem área de toque maior que o desenho */
.adm-cl-ponta::after { content: ''; position: absolute; inset: -9px; }
.adm-cl-p-fundo .adm-cl-ponta, .adm-cl-p-frente .adm-cl-ponta { top: 50%; margin-top: -7px; cursor: ew-resize; }
.adm-cl-p-entrada .adm-cl-ponta { left: 50%; margin-left: -7px; cursor: ns-resize; }
.adm-cl-p-fundo [data-ponta="de"], .adm-cl-p-frente [data-ponta="de"] { left: -7px; }
.adm-cl-p-fundo [data-ponta="ate"], .adm-cl-p-frente [data-ponta="ate"] { right: -7px; }
.adm-cl-p-entrada [data-ponta="de"] { top: -7px; }
.adm-cl-p-entrada [data-ponta="ate"] { bottom: -7px; }

/* luzes */
.adm-cl-luzes { position: absolute; inset: 0; touch-action: none; }
/* a área que cada luz acende de verdade (aflClima.mapaDeLuz): enche o cômodo e para nas paredes */
.adm-cl-luzmapa { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: multiply; }
.adm-cl-luz { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; display: grid; place-items: center; box-sizing: border-box; border-radius: 50%; cursor: grab; outline: none;
  background: #FFD36B; border: 2px solid #fff; color: #7A5200; box-shadow: 0 1px 4px rgba(31, 27, 45, .3); }
.adm-cl-luz svg { width: 16px; height: 16px; }
.adm-cl-luz.sel, .adm-cl-luz:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--a-acento); z-index: 2; }
.adm .adm-cl-janela:focus-visible, .adm .adm-cl-luz:focus-visible { outline: none; }

/* norte: rosa pequena sobre a planta (só mostra) e a bússola ao lado (gira) */
.adm-cl-rosa { position: absolute; left: 6px; top: 6px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .9); box-shadow: 0 1px 4px rgba(31, 27, 45, .2); pointer-events: none; }
.adm-cl-rosa::before { content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -6px 0 0 -4px; border: 4px solid transparent; border-bottom: 8px solid #C9333A; border-top-width: 0;
  transform: rotate(var(--norte, 0deg)); transform-origin: 50% 6px; }
.adm-cl-rosa span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 10px/1 var(--corpo); color: #C9333A; transform: rotate(var(--norte, 0deg)) translateY(-11px) rotate(calc(-1 * var(--norte, 0deg))); }
.adm-cl-norte { display: grid; gap: 10px; }
.adm-cl-norte-txt { display: grid; gap: 2px; }
.adm-cl-norte-txt strong { font-size: 14px; font-weight: 600; }
.adm-cl-norte-txt small { color: var(--a-suave); font-size: 12.5px; }
.adm-cl-norte-ctl { display: flex; align-items: center; justify-content: center; gap: 14px; }
.adm-cl-girar { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--a-linha); border-radius: 11px; background: #fff; color: var(--a-tinta); cursor: pointer; }
.adm-cl-girar:hover { background: var(--a-acento-suave); }
.adm-cl-girar svg { width: 18px; height: 18px; color: var(--a-acento); }
.adm-cl-bussola { position: relative; width: 76px; height: 76px; flex: none; border-radius: 50%; background: #fff; border: 1px solid var(--a-linha); box-shadow: inset 0 0 0 5px var(--a-fundo); }
.adm-cl-mini { position: absolute; left: 50%; top: 50%; width: 34px; height: 24px; margin: -12px 0 0 -17px; border-radius: 3px; background: #F6F1EA; border: 1.5px solid #D9CFC2; }
.adm-cl-agulha { position: absolute; inset: 0; transform: rotate(var(--norte, 0deg)); transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
.adm-cl-agulha::before { content: ''; position: absolute; left: 50%; top: 9px; margin-left: -5px; border: 5px solid transparent; border-bottom: 22px solid #C9333A; border-top-width: 0; }
.adm-cl-agulha b { position: absolute; left: 50%; top: -1px; width: 14px; margin-left: -7px; text-align: center; font: 700 10px/1 var(--corpo); color: #C9333A; }
.adm-cl-norte-valor { text-align: center; font-size: 12.5px; color: var(--a-tinta); }

/* propriedades do escolhido */
.adm-cl-dica { margin: 0; font-size: 12.5px; color: var(--a-suave); }
.adm-cl-campos-janela { --cor: #2F8FCB; }
.adm-cl-campos-luz { --cor: #E0A526; }
.adm-cl-campos-janela strong, .adm-cl-campos-luz strong { font-size: 14px; font-weight: 600; }
.adm-cl-alcances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 11px; background: #fff; border: 1px solid var(--a-linha); }
.adm-cl-alcances button { display: grid; gap: 1px; justify-items: center; padding: 6px 4px; border: 0; border-radius: 8px; background: none; color: var(--a-tinta); font: 600 13px/1.2 var(--corpo); cursor: pointer; }
.adm-cl-alcances button small { font: 500 11px/1.2 var(--mono); color: var(--a-suave); }
.adm-cl-alcances button[aria-checked="true"] { background: #FFF1CC; box-shadow: inset 0 0 0 1.5px #E0A526; }
.adm-cl-novas { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-cl-novas .adm-sec { height: 32px; padding: 0 10px; font-size: 13px; }
.adm-cl-novas .adm-sec svg { width: 15px; height: 15px; }
#adm-cl-props .adm-resumo { margin: 10px 0 12px; }

/* clima de teste ("Mudar clima"): barra flutuante sobre o mapa */
.adm-cl-previa-ctl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; }
.adm-cl-hora, .adm-cl-tempo-sel { display: grid; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--a-suave); }
.adm-cl-hora { grid-template-columns: minmax(0, 1fr) auto; }
.adm-cl-hora span { grid-column: 1 / -1; }
.adm-cl-hora input { width: 100%; min-width: 0; accent-color: var(--a-acento); }
.adm-cl-hora output { font: 600 13px/1 var(--mono); color: var(--a-tinta); min-width: 5ch; text-align: right; align-self: center; }
.adm-cl-tempo-sel select { height: 38px; padding: 0 10px; border: 1px solid #DCD4E6; border-radius: 10px; background: #fff; color: var(--a-tinta); font: 14px var(--corpo); }
.adm-cl-previa-botoes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }

.adm-cl-espiar {
  --a-tinta: #1F1B2D; --a-suave: #6A6480; --a-linha: #ECE6F2; --a-fundo: #F8F6FB; --a-acento: #6B4EE6; --a-acento-suave: #EFEBFE; --a-alerta: #9A5B0C;
  color-scheme: light; position: fixed; z-index: 1000; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(680px, calc(100vw - 24px)); box-sizing: border-box;
  padding: 12px 14px; border-radius: 18px; background: #fff; color: var(--a-tinta); font: 15px/1.5 var(--corpo);
  box-shadow: 0 1px 2px rgba(31, 27, 45, .08), 0 18px 48px -12px rgba(31, 27, 45, .35); animation: adm-cl-sobe .2s cubic-bezier(.2, .8, .2, 1);
}
.adm-cl-espiar[hidden] { display: none; }
.adm-cl-espiar-txt { margin: 0 0 8px; font-size: 12.5px; color: var(--a-suave); }
.adm-cl-espiar-txt strong { color: var(--a-acento); font-weight: 600; }
/* atalho no topo do admin */
.adm-cl-topo { flex: none; height: 36px; padding: 0 12px; font-size: 13.5px; }
.adm-cl-topo[hidden] { display: none; }
.adm-cl-topo svg { width: 16px; height: 16px; }
.adm-cl-espiar .adm-cl-previa-ctl { grid-template-columns: minmax(0, 1fr) auto auto; }
.adm-cl-espiar .adm-cl-previa-botoes { grid-column: auto; flex-wrap: nowrap; }
.adm-cl-espiar :is(button, input, select):focus-visible { outline: 2px solid var(--a-acento); outline-offset: 2px; }
@keyframes adm-cl-sobe { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 860px) {
  .adm-cl-espiar .adm-cl-previa-ctl { grid-template-columns: minmax(0, 1fr) auto; }
  .adm-cl-espiar .adm-cl-previa-botoes { grid-column: 1 / -1; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .adm-cl-quadro { --borda: 22px; --faixa: 15px; border-radius: 12px; }
  .adm-cl-semcidade { margin-left: 0; }
  .adm-cl-acoes { flex-wrap: wrap; }
  .adm-cl-estado { flex-basis: 100%; order: 3; }
  .adm-cl-pendente { margin-right: auto; }
  .adm-cl-previa-ctl { grid-template-columns: 1fr; }
  .adm-cl-previa-botoes .adm-sec, .adm-cl-previa-botoes .adm-pri { flex: 1; }
  .adm-cl-espiar { bottom: 8px; padding: 10px 12px; }
  .adm-cl-topo { width: 36px; padding: 0; justify-content: center; }
  .adm-cl-topo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .adm-cl-espiar .adm-cl-previa-ctl { grid-template-columns: 1fr; gap: 8px; }
  .adm-cl-luz { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
}
@media (prefers-reduced-motion: reduce) {
  .adm-cl-agulha, .adm-cl-parede, .adm-cl-ponta { transition: none; }
  .adm-cl-espiar { animation: none; }
}

/* cor das luzes: quatro amostras em grade, a escolhida com o contorno da ferramenta de luz */
.adm-cl-cor { display: grid; gap: 10px; }
.adm-cl-cores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; border-radius: 11px; background: #fff; border: 1px solid var(--a-linha); }
.adm-cl-cores button { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--a-tinta); font: 600 13px/1.2 var(--corpo); text-align: left; cursor: pointer; }
.adm-cl-cores button:hover { background: var(--a-fundo); }
.adm-cl-cores button i { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #fff 0 22%, var(--amostra) 72%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.adm-cl-cores button small { font: 500 11px/1.2 var(--corpo); color: var(--a-suave); }
.adm-cl-cores button[aria-checked="true"] { background: #FFF1CC; box-shadow: inset 0 0 0 1.5px #E0A526; }
