/* Live & Co — sistema do grupo. Uma cor: preto + amarelo da marca. UI pt-PT. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --fundo: #f6f5f1;
  --cartao: #ffffff;
  --tinta: #141414;
  --tinta-suave: #6f6e67;
  --contorno: #e6e4dc;
  --acento: #f2dc26;
  --ok: #2e7d4f;    --ok-f: #e2f1e8;
  --pend: #a97f00;  --pend-f: #fdf3d2;
  --mau: #c0392b;   --mau-f: #fbe4df;
  --info: #51618f;  --info-f: #e9ecf4;
  --raio: 14px;
  --sombra: 0 1px 3px rgba(20,20,20,.06), 0 8px 24px rgba(20,20,20,.05);
}
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo); color: var(--tinta);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: inherit; }

/* ── Barra de topo ── */
.topo {
  position: sticky; top: 0; z-index: 40;
  background: #141414; color: #fff;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
}
.topo .marca { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .01em; }
.topo .marca img { width: 26px; height: 26px; }
.topo .marca small { font-weight: 400; color: #bdbcb4; display: block; font-size: 11px; letter-spacing: .06em; }
.trocador { display: flex; gap: 6px; margin-left: auto; }
.trocador button {
  border: 1px solid #3a3a38; background: transparent; color: #cfcec6;
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
}
.trocador button.ativo { background: var(--acento); border-color: var(--acento); color: #141414; }
.topo .sino { position: relative; background: none; border: 0; color: #fff; font-size: 19px; padding: 4px 6px; }
.topo .sino .ponto {
  position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--acento); color: #141414; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Estrutura ── */
.miolo { max-width: 1120px; margin: 0 auto; padding: 20px 16px 90px; }
@media (min-width: 900px) { .miolo { padding-bottom: 40px; } }
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--contorno);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav button {
  background: none; border: 0; color: var(--tinta-suave);
  font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 8px; border-radius: 10px; min-width: 58px;
}
.nav button .ic { font-size: 19px; }
.nav button.ativo { color: var(--tinta); }
.nav button.ativo .ic { filter: none; }
.nav button.ativo::after { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--acento); }
@media (min-width: 900px) {
  .nav { top: 54px; bottom: auto; left: 0; right: 0; border-top: 0; border-bottom: 1px solid var(--contorno);
         justify-content: flex-start; gap: 4px; padding: 6px 16px; }
  .nav button { flex-direction: row; gap: 7px; font-size: 13px; padding: 7px 13px; }
  .nav button .ic { font-size: 16px; }
  .nav button.ativo { background: #f2f0e9; }
  .nav button.ativo::after { display: none; }
  .miolo { padding-top: 78px; }
}

/* ── Cartões e blocos ── */
.cartao { background: var(--cartao); border: 1px solid var(--contorno); border-radius: var(--raio); box-shadow: var(--sombra); }
.cartao + .cartao { margin-top: 14px; }
.cartao .cab { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--contorno); flex-wrap: wrap; }
.cartao .cab h2 { font-size: 16px; }
.cartao .cab .sub { color: var(--tinta-suave); font-size: 13px; }
.cartao .corpo { padding: 16px; }
.grelha { display: grid; gap: 14px; }
@media (min-width: 760px) { .grelha.c2 { grid-template-columns: 1fr 1fr; } .grelha.c3 { grid-template-columns: repeat(3, 1fr); } }
h1.titulo { font-size: 21px; margin-bottom: 4px; }
p.sub { color: var(--tinta-suave); font-size: 14px; margin-bottom: 16px; }

/* ── Botões ── */
.bt { border: 0; border-radius: 11px; padding: 10px 16px; font-weight: 700; font-size: 14px;
      background: #141414; color: #fff; display: inline-flex; align-items: center; gap: 7px; }
.bt:hover { box-shadow: 0 0 0 3px var(--acento); }
.bt.sec { background: #fff; color: var(--tinta); border: 1px solid var(--contorno); }
.bt.sec:hover { box-shadow: none; border-color: #141414; }
.bt.perigo { background: #fff; color: var(--mau); border: 1px solid var(--mau-f); }
.bt.mini { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.bt[disabled] { opacity: .5; pointer-events: none; }
.bt.amarelo { background: var(--acento); color: #141414; }

/* ── Etiquetas de estado ── */
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.paga, .tag.impresso, .tag.validada { background: var(--ok-f); color: var(--ok); }
.tag.enviada, .tag.pendente { background: var(--pend-f); color: var(--pend); }
.tag.atrasada { background: var(--mau-f); color: var(--mau); }
.tag.rascunho, .tag.recebida { background: var(--info-f); color: var(--info); }
.tag.livre { background: #f0efe9; color: var(--tinta-suave); }

/* ── Formulários ── */
label.campo { display: block; font-size: 12.5px; font-weight: 700; color: var(--tinta-suave); margin: 10px 0 4px; }
input.cx, textarea.cx, select.sel {
  width: 100%; border: 1px solid var(--contorno); border-radius: 10px; padding: 10px 12px;
  background: #fff; color: var(--tinta); font-size: 14px;
}
input.cx:focus, textarea.cx:focus, select.sel:focus { outline: 2px solid var(--acento); border-color: #141414; }
select.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #141414 50%), linear-gradient(135deg, #141414 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ── Tabelas ── */
.rolagem { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th { text-align: left; color: var(--tinta-suave); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--contorno); }
table.tb td { padding: 10px; border-bottom: 1px solid #f0efe9; vertical-align: middle; }
table.tb tr:last-child td { border-bottom: 0; }

/* ── Planta ── */
.planta-envelope { position: relative; }
.planta-svg { width: 100%; height: auto; max-height: 72vh; display: block; margin: 0 auto; touch-action: none; }
.sala-rect { stroke-width: 1.6; rx: 6; transition: filter .12s ease, transform .12s ease; cursor: pointer; }
.sala-rect.livre { fill: #f3f2ec; stroke: #c9c7bd; stroke-dasharray: 5 4; }
.sala-rect.paga { fill: #e0f0e6; stroke: #2e7d4f; }
.sala-rect.enviada, .sala-rect.validada { fill: #fdf3d2; stroke: #a97f00; }
.sala-rect.atrasada { fill: #fbe4df; stroke: #c0392b; }
.sala-rect.rascunho, .sala-rect.sem-fatura { fill: #e9ecf4; stroke: #51618f; }
.sala-rect.gestao { fill: #141414; stroke: #141414; }
.sala-rect.comum { fill: #eceae4; stroke: #c9c7bd; cursor: default; }
.sala-rect.realce { filter: drop-shadow(0 0 0.4rem rgba(242, 220, 38, .95)); stroke: #141414; stroke-width: 2.4; }
.sala-rect.alvo-drag { stroke: #141414; stroke-width: 3; stroke-dasharray: 0; filter: drop-shadow(0 0 0.5rem rgba(242,220,38,1)); }
.sala-num { font-size: 13px; font-weight: 800; fill: #141414; pointer-events: none; }
.sala-num.clara { fill: #f2dc26; }
.sala-nome { font-size: 7.5px; font-weight: 600; fill: #4a4944; pointer-events: none; }
.sala-nome.clara { fill: #cfcec6; }
.zona-nome { font-size: 9px; font-weight: 700; fill: #a3a199; letter-spacing: .12em; pointer-events: none; }
.dica {
  position: absolute; z-index: 30; pointer-events: none; min-width: 190px; max-width: 250px;
  background: #141414; color: #fff; border-radius: 12px; padding: 11px 13px; font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); display: none;
}
.dica .t { font-weight: 800; font-size: 13.5px; display: flex; justify-content: space-between; gap: 10px; }
.dica .l { color: #bdbcb4; margin-top: 3px; }
.dica .tag { margin-top: 7px; }
.legenda { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 12px; color: var(--tinta-suave); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid transparent; }
.vista-alterna { display: inline-flex; border: 1px solid var(--contorno); border-radius: 999px; overflow: hidden; }
.vista-alterna button { border: 0; background: #fff; padding: 7px 15px; font-size: 13px; font-weight: 700; color: var(--tinta-suave); }
.vista-alterna button.ativo { background: #141414; color: #fff; }
.chip-arrasto { position: fixed; z-index: 60; pointer-events: none; background: #141414; color: var(--acento);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.sem-sala { display: flex; flex-wrap: wrap; gap: 8px; }
.sem-sala .pilula { background: #fff; border: 1.5px dashed #c9c7bd; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: grab; user-select: none; }
.sem-sala .pilula:active { cursor: grabbing; }

/* ── Números do painel ── */
.numero { padding: 16px; }
.numero .v { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.numero .r { font-size: 12.5px; color: var(--tinta-suave); font-weight: 600; margin-top: 2px; }
.numero.destaque { background: #141414; color: #fff; border-radius: var(--raio); }
.numero.destaque .r { color: #bdbcb4; }
.numero.destaque .v { color: var(--acento); }

/* ── Listas de tarefas (central) ── */
.tarefa { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #f0efe9; }
.tarefa:last-child { border-bottom: 0; }
.tarefa .ic { width: 38px; height: 38px; border-radius: 11px; background: #f2f0e9; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.tarefa .tx { flex: 1; min-width: 0; }
.tarefa .tx b { font-size: 14px; display: block; }
.tarefa .tx span { font-size: 12.5px; color: var(--tinta-suave); }

/* ── Login ── */
.ecra-login { min-height: 100vh; display: grid; place-items: center; background: #141414; padding: 20px; }
.ecra-login .caixa { width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 28px; }
.ecra-login .logotipo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.ecra-login .logotipo img { width: 42px; height: 42px; }
.ecra-login h1 { font-size: 20px; text-align: center; }
.ecra-login p.grupo { text-align: center; color: var(--tinta-suave); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px; }
.aviso-erro { background: var(--mau-f); color: var(--mau); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; display: none; }

/* ── Modal ── */
.veu { position: fixed; inset: 0; background: rgba(15,15,14,.5); z-index: 50; display: none; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .veu { align-items: center; } }
.veu.aberto { display: flex; }
.modal { background: #fff; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto; }
@media (min-width: 700px) { .modal { border-radius: 20px; } }
.modal .cab-m { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; border-bottom: 1px solid var(--contorno); }
.modal .cab-m h3 { font-size: 17px; }
.modal .cab-m button { background: #f2f0e9; border: 0; border-radius: 50%; width: 30px; height: 30px; font-size: 15px; }
.modal .corpo-m { padding: 16px 18px 22px; }

/* ── Diversos ── */
.linha-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.espaco { flex: 1; }
.vazio { text-align: center; color: var(--tinta-suave); padding: 34px 16px; font-size: 14px; }
.vazio .ic { font-size: 30px; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 70;
  background: #141414; color: #fff; border-left: 4px solid var(--acento); padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.3); opacity: 0; transition: opacity .2s; max-width: 92vw; }
@media (min-width: 900px) { .toast { bottom: 30px; } }
.toast.visivel { opacity: 1; }
.selo-ia { font-size: 11.5px; color: var(--tinta-suave); border-top: 1px dashed var(--contorno); margin-top: 10px; padding-top: 8px; }
.pre-email { white-space: pre-wrap; background: #f7f6f1; border: 1px solid var(--contorno); border-radius: 10px; padding: 12px; font-size: 13px; }
.check-lista td:first-child { width: 34px; }
input[type="checkbox"].cq { width: 17px; height: 17px; accent-color: #141414; }
