/* =====================================================================
 * Mapa de Condomínios TF — Design System
 * Marca: TF Assessoria Condominial · fonte Muli · símbolo isolado
 * ===================================================================== */

/* ---------- Fonte da marca (auto-hospedada) ---------- */
@font-face { font-family: 'Muli'; font-weight: 400; font-style: normal; font-display: swap; src: url('../assets/fontes/Muli-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Muli'; font-weight: 600; font-style: normal; font-display: swap; src: url('../assets/fontes/Muli-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Muli'; font-weight: 700; font-style: normal; font-display: swap; src: url('../assets/fontes/Muli-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Muli'; font-weight: 800; font-style: normal; font-display: swap; src: url('../assets/fontes/Muli-ExtraBold.ttf') format('truetype'); }

/* ---------- Tokens ---------- */
:root {
  /* Paleta oficial TF */
  --amarelo: #f2bb16;
  --laranja: #f9a932;
  --azul-claro: #d1e8f4;
  --cinza-azul: #a9b6bd;
  --cinza: #606163;
  --branco: #ffffff;
  --preto: #000000;

  /* Derivados */
  --texto: #1f2933;            /* títulos (preto suavizado) */
  --texto-2: var(--cinza);     /* apoio */
  --texto-3: #8a9299;          /* placeholders */
  --fundo: #fbf8f2;            /* creme dos mockups */
  --fundo-2: #f4f0e8;
  --borda: #e6e3dc;
  --borda-2: #d9dee2;
  --amarelo-suave: #fff4d6;
  --laranja-suave: #ffe9c9;
  --azul-suave: #eef6fb;

  /* Status (semânticos) */
  --em-dia: #2fa84f;      --em-dia-suave: #e6f6ea;
  --atencao: var(--amarelo); --atencao-suave: #fff3cc;
  --atrasado: #e5484d;    --atrasado-suave: #fde8e9;
  --sem-status: var(--cinza-azul); --sem-status-suave: #eef1f3;

  /* Forma */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px;
  --sombra-1: 0 2px 10px rgba(31, 41, 51, .06);
  --sombra-2: 0 8px 28px rgba(31, 41, 51, .12);
  --sombra-3: 0 18px 48px rgba(31, 41, 51, .18);
  --grad-primario: linear-gradient(135deg, var(--amarelo) 0%, var(--laranja) 100%);

  --topbar-h: 60px;
  --tabbar-h: 74px;
  --sidebar-w: 224px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}
.hidden { display: none !important; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--texto); }
::placeholder { color: var(--texto-3); }
a { color: inherit; }

/* Brilho amarelo de fundo (assinatura visual dos mockups) */
.brilho {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vw 40vh at 100% 0%, rgba(242,187,22,.16), transparent 60%),
    radial-gradient(50vw 40vh at 0% 100%, rgba(249,169,50,.12), transparent 60%);
}

/* ---------- Ícones (SVG inline) ---------- */
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 18px; min-height: 46px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
/* Sem sombra colorida: o degradê já dá destaque suficiente e o brilho amarelo
   sujava o fundo claro. A elevação fica só no FAB, que precisa flutuar. */
.btn-primario { background: var(--grad-primario); color: var(--texto); }
.btn-primario:hover { filter: brightness(1.04); }
.btn-secundario { background: var(--branco); color: var(--texto); border: 1.5px solid var(--borda-2); }
.btn-secundario:hover { background: var(--fundo-2); }
.btn-suave { background: var(--fundo-2); color: var(--texto); }
.btn-perigo { background: var(--atrasado); color: #fff; }
.btn-texto { background: transparent; color: var(--texto-2); padding: 10px 12px; min-height: 40px; }
.btn-bloco { width: 100%; }
.btn-icone {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--fundo-2); color: var(--texto); cursor: pointer;
}
.btn-icone:hover { background: var(--borda); }

/* ---------- Campos ---------- */
.campo { display: block; margin-bottom: 14px; }
.campo > .rotulo { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--texto); }
.campo .obrig { color: var(--atrasado); }
.controle {
  display: flex; align-items: center; gap: 10px;
  background: var(--branco); border: 1.5px solid var(--borda-2); border-radius: 12px; padding: 0 12px; min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
.controle:focus-within { border-color: var(--amarelo); box-shadow: 0 0 0 3px rgba(242,187,22,.22); }
.controle > .ic { color: var(--texto-3); }
.controle input, .controle select, .controle textarea {
  flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; padding: 12px 0;
}
.controle select { appearance: none; -webkit-appearance: none; padding-right: 22px; cursor: pointer; }
.controle.select { position: relative; }
.controle.select::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--texto-2); border-bottom: 2px solid var(--texto-2); transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
/*
 * RESPIRO DENTRO DA LISTA ABERTA DO SELECT.
 *
 * A lista que aparece ao clicar num <select> é desenhada pelo NAVEGADOR, não
 * por nós: os itens nascem colados na borda esquerda da caixa branca. Chrome e
 * Edge respeitam padding e altura de linha em <option>; navegadores mais
 * antigos ignoram e a lista continua como era — não quebra nada, só não
 * melhora. É o quanto de controle existe aqui sem trocar o <select> por um
 * componente próprio (ver `comboHtml()` no app.js, usado nas listas longas).
 */
.controle select option {
  padding: 8px 12px;
  line-height: 1.7;
  color: var(--texto);
}

.controle textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.controle.travado { background: var(--fundo-2); color: var(--texto-2); }
.contador { text-align: right; font-size: 12px; color: var(--texto-3); margin-top: 4px; }
.olho { background: transparent; border: 0; color: var(--texto-3); cursor: pointer; display: inline-flex; padding: 4px; }

/* Checkbox marca */
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .caixa { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--borda-2); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--texto); transition: all .12s; }
.check .caixa .ic { width: 14px; height: 14px; opacity: 0; stroke-width: 3; }
.check input:checked + .caixa { background: var(--grad-primario); border-color: var(--amarelo); }
.check input:checked + .caixa .ic { opacity: 1; }

/* Mensagens */
.msg { font-size: 14px; min-height: 20px; margin-top: 10px; }
.msg.erro { color: var(--atrasado); font-weight: 600; }
.msg.ok { color: var(--em-dia); font-weight: 600; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.em-dia { background: var(--em-dia-suave); color: var(--em-dia); }
.badge.atencao { background: var(--atencao-suave); color: #a27600; }
.badge.atrasado { background: var(--atrasado-suave); color: var(--atrasado); }
.badge.sem-status { background: var(--sem-status-suave); color: var(--cinza); }
.ponto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ponto.em-dia { background: var(--em-dia); } .ponto.atencao { background: var(--atencao); }
.ponto.atrasado { background: var(--atrasado); } .ponto.sem-status { background: var(--sem-status); }

/* ---------- Cards ---------- */
.card { background: var(--branco); border-radius: var(--r-lg); box-shadow: var(--sombra-1); border: 1px solid rgba(0,0,0,.03); }
.card-p { padding: 16px; }
.titulo { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.subtitulo { font-size: 14px; color: var(--texto-2); margin: 4px 0 0; }
.sub { font-size: 13px; color: var(--texto-2); }

/* =====================================================================
 * LOGIN
 * ===================================================================== */
.login-screen {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--fundo);
}
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 400px;
  background: var(--branco); border-radius: var(--r-xl); box-shadow: var(--sombra-3); padding: 32px 26px 24px;
}
.login-marca { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.login-marca img { width: 74px; height: 74px; object-fit: contain; }
.login-marca .nome { font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--cinza); margin-top: 10px; }
.login-titulo { font-size: 24px; font-weight: 800; margin: 0; text-align: center; letter-spacing: -.01em; }
.login-sub { text-align: center; color: var(--texto-2); font-size: 14px; margin: 6px 0 22px; }
.login-linha { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.login-nota { display: flex; align-items: center; gap: 10px; background: var(--azul-suave); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--texto-2); margin-top: 18px; }
.login-nota .ic { color: var(--cinza); }
.login-tag { text-align: center; margin-top: 18px; font-size: 13px; color: var(--laranja); font-weight: 700; font-style: italic; }

/* =====================================================================
 * APP SHELL
 * ===================================================================== */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: var(--topbar-h) 1fr var(--tabbar-h); grid-template-columns: 1fr; }

/* Topbar */
.topbar {
  position: relative; z-index: 1200; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--borda);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marca img { width: 38px; height: 38px; object-fit: contain; }
.marca .marca-txt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.marca .marca-nome { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca .marca-sub { font-size: 11px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-dir { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--azul-claro); color: var(--texto); font-weight: 800; font-size: 13px; letter-spacing: .02em;
  overflow: hidden; flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* O avatar do topo abre "Trocar minha senha" — precisa parecer clicável. */
#usuarioAvatar { cursor: pointer; transition: box-shadow .15s ease; }
#usuarioAvatar:hover { box-shadow: 0 0 0 3px rgba(242,187,22,.35); }
#usuarioAvatar:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 2px; }

/* Escolha da foto no formulário de colaborador */
.foto-perfil { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.foto-perfil .avatar { width: 76px; height: 76px; font-size: 24px; }
.foto-perfil .acoes { display: flex; flex-direction: column; gap: 6px; }
.foto-perfil .acoes .btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.foto-perfil .dica { font-size: 12px; color: var(--texto-2); }
.usuario-bloco { display: none; align-items: center; gap: 10px; }
.usuario-bloco .u-nome { font-weight: 700; font-size: 14px; line-height: 1.1; }
.usuario-bloco .u-papel { font-size: 12px; color: var(--texto-2); }

/* Sidebar (desktop) */
.sidebar { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 0; background: transparent;
  color: var(--texto-2); font-weight: 700; font-size: 14px; cursor: pointer; width: 100%; text-align: left; position: relative;
}
.nav-item:hover { background: var(--fundo-2); color: var(--texto); }
.nav-item.ativo { background: var(--amarelo-suave); color: var(--texto); }
.nav-item.ativo::before { content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--amarelo); }
.nav-item .ic { color: inherit; }
.nav-grupo { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--borda); }
.nav-grupo-tit { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-3); padding: 0 14px 8px; }
.sidebar-frase {
  margin-top: auto; background: var(--fundo-2); border-radius: 14px; padding: 14px; font-size: 13px; color: var(--texto-2); line-height: 1.4;
}

/* ===== Governança: lista de colaboradores ===== */
.pessoa { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.pessoa:last-child { border-bottom: 0; }
.pessoa .avatar { flex: 0 0 auto; }
.pessoa .txt { flex: 1; min-width: 0; }
.pessoa .nome { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pessoa .email { font-size: 12px; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pessoa .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pessoa .dir { text-align: right; flex: 0 0 auto; }
.pessoa .dir .num { font-size: 20px; font-weight: 800; line-height: 1; }
.pessoa .dir .rot { font-size: 11px; color: var(--texto-2); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.admin { background: var(--amarelo-suave); color: #a27600; }
.tag.colab { background: var(--azul-suave); color: #4a6b80; }
.tag.ativo { background: var(--em-dia-suave); color: var(--em-dia); }
.tag.inativo { background: var(--sem-status-suave); color: var(--cinza); }
.tag .ic { width: 12px; height: 12px; }

/* ===== Governança: carteira ===== */
.mini-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.mini-cards .cartao { background: var(--fundo-2); border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.mini-cards .cartao .ico { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mini-cards .cartao .num { font-size: 22px; font-weight: 800; line-height: 1; }
.mini-cards .cartao .rot { font-size: 11px; color: var(--texto-2); font-weight: 700; }
.ico.i-total { background: var(--azul-suave); color: #4a6b80; }
.ico.i-emdia { background: var(--em-dia-suave); color: var(--em-dia); }
.ico.i-atencao { background: var(--atencao-suave); color: #a27600; }
.ico.i-atrasado { background: var(--atrasado-suave); color: var(--atrasado); }
.ico.i-sem { background: var(--atrasado-suave); color: var(--atrasado); }

.bloco-alerta { border: 1.5px solid #f5c7c9; background: #fff8f8; border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.bloco-alerta .cab { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.bloco-alerta .cab .t { font-weight: 800; color: var(--atrasado); flex: 1; }
.bloco-alerta .cab .n { background: var(--atrasado); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; }
.bloco-alerta .s { font-size: 12px; color: var(--texto-2); margin-bottom: 8px; }

.sec-tit { font-weight: 800; font-size: 15px; margin: 16px 0 8px; }
.cond-linha { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--borda); }
.cond-linha:last-child { border-bottom: 0; }
.cond-linha .txt { flex: 1; min-width: 0; }
.cond-linha .nome { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cond-linha .sub { font-size: 12px; }
.cond-linha .check { flex: 0 0 auto; }

.resp-card { border: 1px solid var(--borda); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.resp-card .cab { display: flex; align-items: center; gap: 10px; }
.resp-card .cab .txt { flex: 1; min-width: 0; }
.resp-card .cab .nome { font-weight: 800; }
.resp-card .cab .num { font-size: 22px; font-weight: 800; }
.resp-card .barras { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.resp-card .conds { margin-top: 8px; border-top: 1px solid var(--borda); padding-top: 4px; }
.resp-card .expansor { cursor: pointer; border-radius: 10px; margin: -4px; padding: 4px; }
.resp-card .expansor:hover { background: var(--fundo-2); }
.resp-card .expansor:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 2px; }
.resp-card .seta { color: var(--texto-2); display: inline-flex; transition: transform .18s; flex: 0 0 auto; }
.resp-card .seta.aberta { transform: rotate(180deg); }

/* ===== Painel gerencial: produtividade ===== */
.prod-destaque { border-radius: 16px; padding: 18px; text-align: center; margin-bottom: 14px; }
.prod-destaque .rot { font-size: 13px; font-weight: 700; opacity: .8; }
.prod-destaque .valor { font-size: 46px; font-weight: 800; line-height: 1.05; margin: 4px 0; }
.prod-destaque .faixa { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.6); }
.f-excelente { background: var(--em-dia-suave); color: #14663a; }
.f-bom { background: var(--azul-suave); color: #2d5d78; }
.f-atencao { background: var(--atencao-suave); color: #a27600; }
.f-critico { background: var(--atrasado-suave); color: var(--atrasado); }
.f-nulo { background: var(--sem-status-suave); color: var(--cinza); }

.componentes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.componente { background: var(--fundo-2); border-radius: 12px; padding: 10px; text-align: center; }
.componente .n { font-size: 19px; font-weight: 800; }
.componente .r { font-size: 11px; color: var(--texto-2); font-weight: 700; }
.componente .peso { font-size: 10px; color: var(--texto-3); }

.barra-prog { height: 7px; border-radius: 999px; background: var(--borda); overflow: hidden; margin-top: 6px; }
.barra-prog i { display: block; height: 100%; border-radius: 999px; background: var(--grad-primario); }
.barra-prog.b-excelente i { background: var(--em-dia); }
.barra-prog.b-bom i { background: #4a90c4; }
.barra-prog.b-atencao i { background: var(--atencao); }
.barra-prog.b-critico i { background: var(--atrasado); }

.colab-linha { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.colab-linha:last-child { border-bottom: 0; }
.colab-linha .txt { flex: 1; min-width: 0; }
.colab-linha .nome { font-weight: 700; font-size: 14px; }
.colab-linha .dir { text-align: right; flex: 0 0 auto; min-width: 68px; }
.colab-linha .dir .n { font-size: 19px; font-weight: 800; }
.colab-linha .dir .r { font-size: 11px; color: var(--texto-2); }

/* Gráfico de barras simples (visitas por colaborador) */
.grafico { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding: 8px 0 0; }
.grafico .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.grafico .col .v { font-size: 13px; font-weight: 800; }
.grafico .col .bar { width: 100%; max-width: 46px; background: var(--grad-primario); border-radius: 8px 8px 0 0; min-height: 4px; }
.grafico .col .lab { font-size: 10px; color: var(--texto-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ===== Governança: pendências ===== */
.sino { margin-left: auto; background: var(--atrasado); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; }
/* Na barra do celular o contador vira uma bolinha sobre o ícone. O
   `margin-left:auto` da versão da sidebar não serve aqui: a aba é uma coluna
   centralizada, e o badge caía embaixo do rótulo, em cima da aba vizinha. */
.tab { position: relative; }
.tab .sino {
  position: absolute; top: 2px; left: calc(50% + 7px);
  padding: 0 5px; min-width: 17px; line-height: 17px; text-align: center;
}
.bloco-pend { border: 1.5px solid var(--borda); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.bloco-pend .cab { display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; }
.bloco-pend .cab:hover { background: var(--fundo-2); }
.bloco-pend .cab .ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bloco-pend .cab .txt { flex: 1; min-width: 0; }
.bloco-pend .cab .t { font-weight: 800; font-size: 14px; }
.bloco-pend .cab .s { font-size: 12px; color: var(--texto-2); }
.bloco-pend .cab .n { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; }
.bloco-pend .corpo { padding: 0 12px 12px; }
.bloco-pend.p-atrasado { border-color: #f5c7c9; } .bloco-pend.p-atrasado .cab .ico { background: var(--atrasado-suave); color: var(--atrasado); }
.bloco-pend.p-atrasado .cab .n { background: var(--atrasado); color: #fff; }
.bloco-pend.p-atencao { border-color: #f0dca8; } .bloco-pend.p-atencao .cab .ico { background: var(--atencao-suave); color: #a27600; }
.bloco-pend.p-atencao .cab .n { background: var(--atencao); color: #4a3800; }
.bloco-pend.p-info { border-color: #bcd9ea; } .bloco-pend.p-info .cab .ico { background: var(--azul-suave); color: #2d5d78; }
.bloco-pend.p-info .cab .n { background: #4a90c4; color: #fff; }
.bloco-pend.p-ok { border-color: #cdebd5; background: var(--em-dia-suave); }
.bloco-pend.p-ok .cab .ico { background: #fff; color: var(--em-dia); }
.bloco-pend.p-ok .cab .n { background: var(--em-dia); color: #fff; }

.item-pend { border-top: 1px solid var(--borda); padding: 10px 0; }
.item-pend .topo { display: flex; align-items: flex-start; gap: 8px; }
.item-pend .nome { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; }
.item-pend .meta { font-size: 12px; color: var(--texto-2); margin-top: 2px; }
.item-pend .acoes { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.item-pend .acoes .btn { min-height: 36px; padding: 7px 12px; font-size: 12px; flex: 1; }
.atraso-tag { background: var(--atrasado-suave); color: var(--atrasado); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }

/* ===== Campo com busca (listas longas, ex.: condomínio) ===== */
.combo { position: relative; }
.combo-lista {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: #fff; border: 1px solid var(--borda-2); border-radius: 12px;
  box-shadow: var(--sombra-2); max-height: 240px; overflow-y: auto;
}
.combo-lista .item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--borda); }
.combo-lista .item:last-child { border-bottom: 0; }
.combo-lista .item:hover, .combo-lista .item.marcado { background: var(--amarelo-suave); }
.combo-lista .item .n { font-weight: 700; font-size: 14px; }
.combo-lista .item .s { font-size: 12px; color: var(--texto-2); }
.combo-lista .vazio { padding: 12px; }
.combo .limpar-combo { background: transparent; border: 0; color: var(--texto-3); cursor: pointer; display: inline-flex; padding: 4px; }

/*
 * MODO LISTA CURTA (`busca: false`): parece igual, mas não é campo de texto.
 * O cursor precisa dizer isso — seta, não barra de digitação — e a seta à
 * direita repete o gesto que o antigo <select> ensinava: "isto abre".
 */
.combo-fixo .controle { cursor: pointer; }
.combo-fixo .controle input { cursor: pointer; }
.combo-fixo .controle::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--texto-2); border-bottom: 2px solid var(--texto-2);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.combo-fixo .controle { position: relative; padding-right: 30px; }

/* ===== Demandas ===== */
.dem-card { border: 1px solid var(--borda); border-left-width: 4px; border-radius: 14px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: box-shadow .15s; }
.dem-card:hover { box-shadow: var(--sombra-2); }
.dem-card.p-urgente { border-left-color: var(--atrasado); }
.dem-card.p-alta { border-left-color: var(--laranja); }
.dem-card.p-normal { border-left-color: var(--cinza-azul); }
.dem-card.p-baixa { border-left-color: var(--borda-2); }
.dem-card .topo { display: flex; align-items: flex-start; gap: 8px; }
.dem-card .titulo { font-weight: 800; font-size: 15px; flex: 1; min-width: 0; }
.dem-card .meta { font-size: 12px; color: var(--texto-2); margin-top: 3px; }
.dem-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.pri { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pri.urgente { background: var(--atrasado-suave); color: var(--atrasado); }
.pri.alta { background: var(--laranja-suave); color: #a05a00; }
.pri.normal { background: var(--azul-suave); color: #4a6b80; }
.pri.baixa { background: var(--fundo-2); color: var(--texto-2); }
.st { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.st.aberta { background: var(--azul-suave); color: #2d5d78; }
.st.em_andamento { background: var(--atencao-suave); color: #a27600; }
.st.concluida { background: var(--em-dia-suave); color: var(--em-dia); }
.st.cancelada { background: var(--sem-status-suave); color: var(--cinza); }

/* Barra flutuante de seleção */
.barra-selecao {
  position: sticky; bottom: 0; z-index: 5; margin: 12px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--borda); display: flex; align-items: center; gap: 10px;
}
.barra-selecao .cont { flex: 1; font-weight: 700; font-size: 14px; }

/* Interruptor (toggle) */
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.interruptor .txt .t { font-weight: 700; font-size: 14px; }
.interruptor .txt .s { font-size: 12px; color: var(--texto-2); }
.chave { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.chave input { position: absolute; opacity: 0; width: 0; height: 0; }
.chave .trilho { position: absolute; inset: 0; background: var(--borda-2); border-radius: 999px; transition: background .18s; cursor: pointer; }
.chave .trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .18s; }
.chave input:checked + .trilho { background: var(--grad-primario); }
.chave input:checked + .trilho::after { transform: translateX(22px); }
.sidebar-frase strong { color: var(--texto); }

/* Área principal */
.principal { position: relative; overflow: hidden; }
#map { position: absolute; inset: 0; z-index: 1; background: var(--azul-suave); }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { border-radius: 10px !important; color: var(--texto) !important; }
.leaflet-bar { border: 0 !important; box-shadow: var(--sombra-2) !important; border-radius: 12px !important; overflow: hidden; }

/* Tab bar (mobile) */
.tabbar {
  /* Colunas pelo número de abas que existirem, e não um `repeat(4, 1fr)` fixo:
     ao tirar "Registrar" (07/09/2026) a barra tinha ficado com uma coluna
     vazia à direita. */
  position: relative; z-index: 1200; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: stretch; overflow: visible;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--borda); padding-bottom: env(safe-area-inset-bottom);
}
.tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 8px 6px 10px; color: var(--texto-2); font-size: 12px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.tab.ativo { color: var(--laranja); }
.tab .ic { width: 24px; height: 24px; }
/* A aba "Registrar" já foi um círculo amarelo saltando acima da barra.
   Removido a pedido do dono (06/09/2026): as quatro abas são do mesmo tipo de
   ação e o destaque só criava hierarquia onde não havia. */

/* =====================================================================
 * PAINEL DO MAPA (busca + filtros + contagem)
 * ===================================================================== */
.painel {
  position: absolute; z-index: 1100; left: 12px; right: 12px; top: 12px;
  background: var(--branco); border-radius: var(--r-lg); box-shadow: var(--sombra-2); overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100% - 24px);
}
.painel-cab { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.painel-cab h2 { margin: 0; font-size: 17px; font-weight: 800; }
.painel-alca { width: 44px; height: 4px; border-radius: 4px; background: var(--borda-2); margin: 8px auto 0; }
.painel-corpo { padding: 6px 16px 14px; overflow-y: auto; }
.painel.fechado .painel-corpo { display: none; }
.painel.fechado .painel-cab { padding-bottom: 12px; }
.painel .btn-icone.girar .ic { transform: rotate(180deg); }
.filtros-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/*
 * ITEM DE GRADE PRECISA PODER ENCOLHER.
 *
 * Por padrão um filho de `grid` não fica menor do que o conteúdo dele exige, e
 * um <input type="text"> exige o equivalente a 20 caracteres. Enquanto os
 * campos de escolha eram <select> isso não aparecia — a largura mínima de um
 * <select> é pequena. Quando viraram campo de texto (08/09/2026), as duas
 * colunas passaram a exigir mais do que o painel tem, e nasceu uma barra de
 * rolagem horizontal no painel de busca do mapa.
 *
 * `min-width: 0` desfaz esse piso e devolve o controle ao `1fr`.
 */
.filtros-2 > *, .rel-topo > *, .acoes-filtro > * { min-width: 0; }
.acoes-filtro { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 4px; }
.totais { border-top: 1px solid var(--borda); margin-top: 14px; padding-top: 12px; }
.totais .linha { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totais .linha.destaque { font-weight: 700; }
.totais .linha .num { font-weight: 800; font-size: 20px; }
.totais .linha .rot { display: flex; align-items: center; gap: 8px; color: var(--texto-2); }
.totais .linha .rot.destaque { color: var(--texto); font-weight: 700; }
.resultados { border-top: 1px solid var(--borda); margin-top: 8px; padding-top: 6px; }
.resultado { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; cursor: pointer; }
.resultado:hover { background: var(--fundo-2); }
.resultado .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--azul-suave); display: inline-flex; align-items: center; justify-content: center; color: var(--cinza); }
.resultado .txt { flex: 1; min-width: 0; }
.resultado .nome { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resultado .sub { font-size: 12px; }
.vazio { padding: 16px; text-align: center; color: var(--texto-2); font-size: 14px; }

/* Legenda flutuante */
.legenda {
  position: absolute; z-index: 1100; left: 12px; bottom: 12px; display: flex; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,.95); border-radius: 999px; padding: 8px 14px; box-shadow: var(--sombra-1); font-size: 12px; font-weight: 700; color: var(--texto-2);
}
.legenda span { display: inline-flex; align-items: center; gap: 6px; }

/* Botão localizar */
.localizar { position: absolute; z-index: 1100; right: 12px; bottom: 66px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--sombra-2); display: inline-flex; align-items: center; justify-content: center; color: var(--texto); cursor: pointer; }

/*
 * No celular, o painel de busca aberto ocupa quase a tela toda — e tanto o
 * botão de localização quanto a legenda flutuante ficam POR CIMA da lista de
 * status. Não adianta mandá-los para trás: os dois são irmãos do #map, que é
 * uma camada isolada; eles desenham sempre acima dele. Some enquanto o painel
 * está aberto. A legenda ali seria redundante: o próprio painel já lista a
 * contagem de cada status.
 */
.painel:not(.fechado) ~ .localizar,
.painel:not(.fechado) ~ .legenda { display: none; }

/* ---------- Pinos ---------- */
/*
 * `transform-origin` na PONTA do pino (50% 100%): é ali que fica o ponto do
 * mapa. Encolher a partir do centro faria o pino escorregar do endereço.
 * A escala vem de `ajustarPinosAoZoom()` no app.js.
 */
.pino {
  position: relative; width: 34px; height: 42px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.28));
  transform: scale(var(--pino-escala, 1));
  transform-origin: 50% 100%;
  /*
   * SEM transição de propósito. Ela parecia boa e é armadilha: o tamanho muda
   * no fim do zoom, quando o mapa já parou, e animar 53 pinos nesse instante
   * disputa quadro a quadro com a animação do próprio Leaflet. Sem transição a
   * troca acontece junto com o mapa assentando — e some.
   */
}
/* Longe: sombra fina. Uma sombra forte por pino, com dezenas empilhados,
   vira uma mancha preta que apaga as ruas embaixo. */
.pinos-longe .pino { filter: drop-shadow(0 1px 2px rgba(0,0,0,.16)); }
.pino svg { position: absolute; inset: 0; width: 34px; height: 42px; }
.pino .glifo { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); width: 14px; height: 14px; color: #fff; }
.pino.em-dia svg path { fill: var(--em-dia); } .pino.atencao svg path { fill: var(--atencao); }
.pino.atrasado svg path { fill: var(--atrasado); } .pino.sem-status svg path { fill: var(--sem-status); }
/* Selecionado: fica maior e com sombra, mas MANTÉM a cor do status — trocar a
   cor faria o pino parecer ter mudado de situação. */
/* O selecionado cresce SOBRE a escala do zoom, não no lugar dela: longe ele
   fica maior que os vizinhos, perto continua sendo o destaque de sempre. */
.pino.sel { transform: scale(calc(var(--pino-escala, 1) * 1.25)); z-index: 1000 !important; filter: drop-shadow(0 6px 10px rgba(0,0,0,.42)); }
.pino.sel svg path { stroke-width: 3; }
.eu { width: 18px; height: 18px; border-radius: 50%; background: #2f7ff5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,127,245,.22); }

/* =====================================================================
 * OVERLAYS (folha inferior no mobile, modal centrado no desktop)
 * ===================================================================== */
/*
 * CAMADAS DAS JANELAS — definidas explicitamente.
 * Não confiar na ordem do HTML: janelas com o mesmo z-index empilham por ordem
 * de escrita, e mover/adicionar um <div> passa a esconder outro sem aviso
 * (foi o que aconteceu com a ficha da demanda atrás da lista).
 *
 *   1500  telas de lista (mapa, demandas, governança, histórico…)
 *   1600  ficha aberta a partir de uma lista (visita, demanda)
 *   1650  formulário aberto a partir de uma ficha (concluir, reabrir, editar)
 *   1700  diálogo de confirmação   1800  galeria   1900  aviso   2000  carregando
 */
.overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(31,41,51,.45); display: flex; align-items: flex-end; justify-content: center; }
#overlayDetalhe { z-index: 1600; }
#overlayGovForm { z-index: 1650; }
.folha {
  position: relative; background: var(--branco); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sombra-3); animation: subir .22s ease-out;
}
@keyframes subir { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.folha-alca { width: 44px; height: 4px; border-radius: 4px; background: var(--borda-2); margin: 10px auto 0; }
.folha-cab { display: flex; align-items: center; gap: 12px; padding: 12px 18px 10px; position: sticky; top: 0; background: #fff; z-index: 2; }
.folha-cab h2 { margin: 0; font-size: 19px; font-weight: 800; flex: 1; min-width: 0; }
.folha-cab .ico-tit { width: 40px; height: 40px; border-radius: 12px; background: var(--amarelo-suave); color: #a27600; display: inline-flex; align-items: center; justify-content: center; }
.folha-corpo { padding: 4px 18px 18px; }
.folha-acoes { display: flex; flex-direction: column; gap: 10px; padding: 4px 18px 22px; }
.folha-acoes .linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Ação secundária que ocupa a linha inteira, centralizada, abaixo dos botões
   principais — ex.: "Alterar a próxima visita" na ficha do condomínio. */
.folha-acoes .acao-linha { width: 100%; justify-content: center; }

/* =====================================================================
 * LINHA DO TEMPO DA DEMANDA
 * Cada andamento é um acontecimento datado. O fio à esquerda liga os
 * eventos e deixa claro que se lê de cima para baixo, na ordem em que
 * as coisas aconteceram.
 * ===================================================================== */
.linha-tempo { position: relative; padding-left: 18px; }
.linha-tempo::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--borda); border-radius: 2px;
}
.linha-tempo .and { position: relative; margin-bottom: 14px; }
.linha-tempo .and::before {
  content: ''; position: absolute; left: -17px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad-primario); border: 2px solid #fff;
}
.and-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.and-cab strong { font-size: 13px; font-weight: 800; }
.and-cab .sub { font-size: 11.5px; white-space: nowrap; }
.and-txt { font-size: 14px; margin-top: 2px; white-space: pre-wrap; }

.and-anexos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.and-foto { display: block; width: 62px; height: 62px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--borda); background: var(--fundo-2); }
.and-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.and-arquivo {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 7px 11px; border-radius: 999px; border: 1px solid var(--borda);
  background: var(--fundo-2); color: var(--texto); font-size: 12px; font-weight: 700;
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.and-arquivo:hover { border-color: var(--amarelo); }

/* Etiqueta de demanda restrita: o cadeado deixa claro à distância que aquele
   chamado não é visível para a equipe, sem precisar abrir a ficha. */
.badge.admin { display: inline-flex; align-items: center; gap: 4px; }
.badge.admin .ic { width: 12px; height: 12px; }
.fechar { margin-left: auto; }

/* Info rows (card do condomínio) */
.info { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--borda); font-size: 14px; }
.info:last-child { border-bottom: 0; }
.info .ic { color: var(--cinza-azul); }
.info .rot { color: var(--texto-2); flex: 1; }
/* `min-width:0` + quebra: razão social e e-mail são longos e, sem isso,
   empurrariam o botão de copiar para fora da folha no celular. */
.info .val { font-weight: 700; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Bloco que abre e fecha (sanfona) ----------
   Um cabeçalho clicável com resumo à esquerda e seta à direita. A seta gira ao
   abrir: é o sinal de que aquilo tem mais coisa dentro. */
.expansivel { border: 1px solid var(--borda); border-radius: 14px; margin: 10px 0; overflow: hidden; }
.expansivel-cab {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--fundo-2); border: 0; cursor: pointer; text-align: left;
  font: inherit; color: var(--texto);
}
.expansivel-cab:hover { background: var(--borda); }
.expansivel-tit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-weight: 800; font-size: 14px; }
.expansivel-resumo { font-weight: 600; font-size: 12px; color: var(--texto-2); }
.expansivel-seta { color: var(--texto-2); flex: 0 0 auto; transition: transform .18s; }
.expansivel.aberta .expansivel-seta { transform: rotate(180deg); }
.expansivel-corpo { padding: 2px 14px 10px; }
/* Dentro da sanfona a última linha não precisa de risco: a borda do bloco
   já fecha o desenho. */
.expansivel-corpo .info:last-child, .expansivel-corpo .cond-linha:last-child { border-bottom: 0; }

/* Botão copiar/revelar das linhas da ficha ampliada (Fase 8). Menor que o
   `.btn-icone` do cabeçalho: aqui ele acompanha uma linha de texto. */
.btn-copiar {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 9px;
  background: var(--fundo-2); color: var(--texto-2); cursor: pointer;
}
.btn-copiar:hover { background: var(--borda); color: var(--texto); }
.cond-cab { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.cond-cab .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--azul-suave); display: inline-flex; align-items: center; justify-content: center; color: var(--cinza); flex: 0 0 auto; }
.cond-cab .txt { flex: 1; min-width: 0; }
.cond-cab .pre { font-size: 12px; color: var(--texto-2); font-weight: 700; }
.cond-cab .nome { font-size: 18px; font-weight: 800; line-height: 1.2; }

/* Cartões de status do registro (Data / GPS) */
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 14px; }
.mini-card { background: var(--fundo-2); border-radius: 14px; padding: 12px; }
.mini-card .rot { font-size: 12px; font-weight: 700; color: var(--texto-2); display: flex; align-items: center; justify-content: space-between; }
.mini-card .val { font-weight: 800; font-size: 16px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.mini-card .val small { font-weight: 600; color: var(--texto-2); font-size: 12px; }
.mini-card .nota { font-size: 11px; color: var(--texto-2); margin-top: 4px; }
.gps { padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.gps.ok { background: var(--em-dia-suave); color: var(--em-dia); }
.gps.espera { background: var(--atencao-suave); color: #a27600; }
.gps.erro { background: var(--atrasado-suave); color: var(--atrasado); }

/* Fotos / anexos */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.foto { position: relative; }
.foto img, .foto .pdf { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--borda); background: var(--fundo-2); display: block; }
.foto .pdf { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--cinza); font-size: 12px; }
.foto .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: var(--texto); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.foto .x .ic { width: 12px; height: 12px; stroke-width: 3; }
/* ATENÇÃO ao nome: NÃO usar `.legenda` aqui. Essa classe já é a legenda
   flutuante do mapa (position:absolute, canto inferior) — reaproveitá-la fazia
   o campo de texto pousar EM CIMA da miniatura da foto. Nome próprio resolve. */
.foto input.foto-legenda {
  width: 100%; margin-top: 6px; border: 0; border-bottom: 1px solid var(--borda);
  font-size: 11px; padding: 3px 2px; outline: 0; background: transparent; color: var(--texto);
}
.foto input.foto-legenda:focus { border-bottom-color: var(--amarelo); }
.foto-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--borda-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--texto-2); font-size: 11px; font-weight: 700; cursor: pointer; background: var(--fundo-2); }
.foto-add:hover { border-color: var(--amarelo); color: var(--texto); }
.miniaturas { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 10px; }
.miniatura { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--borda); cursor: pointer; background: var(--fundo-2); }
.miniatura.pdf { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--cinza); text-decoration: none; font-size: 12px; }

/* Timeline (histórico) */
.linha-tempo { position: relative; padding-left: 62px; }
.linha-tempo::before { content: ''; position: absolute; left: 50px; top: 8px; bottom: 8px; width: 2px; background: var(--borda); }
.evento { position: relative; margin-bottom: 14px; }
.evento .data { position: absolute; left: -62px; top: 4px; width: 42px; text-align: center; line-height: 1.05; }
.evento .data .d { font-size: 18px; font-weight: 800; }
.evento .data .m { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--texto-2); }
.evento .data .a { font-size: 10px; color: var(--texto-3); }
.evento::before { content: ''; position: absolute; left: -17px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--amarelo); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--borda); }
.evento .card { padding: 14px; }
.evento .topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.evento .quem { font-weight: 800; }
.evento .det { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-2); margin: 4px 0; }
.evento .det .ic { color: var(--cinza-azul); }
.evento .obs { font-size: 14px; margin: 6px 0 0; }
.evento .acoes { display: flex; gap: 8px; margin-top: 10px; }
.evento .acoes .btn { min-height: 40px; padding: 8px 14px; font-size: 13px; flex: 1; }
.card.clicavel { cursor: pointer; transition: box-shadow .15s, transform .08s; }
.card.clicavel:hover { box-shadow: var(--sombra-2); }
.card.clicavel:active { transform: translateY(1px); }
.card.clicavel:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 2px; }

/* Total card */
.total-card { display: flex; align-items: center; gap: 12px; }
.total-card .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--azul-suave); color: var(--cinza); display: inline-flex; align-items: center; justify-content: center; }
.total-card .rot { flex: 1; font-size: 13px; color: var(--texto-2); font-weight: 700; }
.total-card .num { font-size: 26px; font-weight: 800; }

/* Relatório */
.rel-topo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rel-cartoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rel-cartao { background: var(--fundo-2); border-radius: 14px; padding: 14px; text-align: center; }
.rel-cartao .num { font-size: 26px; font-weight: 800; }
.rel-cartao .rot { font-size: 12px; color: var(--texto-2); font-weight: 700; }

/* Diálogo de confirmação */
.dialogo { position: fixed; inset: 0; z-index: 1700; background: rgba(31,41,51,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialogo .caixa { background: #fff; border-radius: var(--r-xl); padding: 24px 22px; width: 100%; max-width: 360px; text-align: center; box-shadow: var(--sombra-3); }
.dialogo .ico { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; display: inline-flex; align-items: center; justify-content: center; }
.dialogo .ico.aviso { background: var(--atrasado-suave); color: var(--atrasado); }
.dialogo .ico.info { background: var(--amarelo-suave); color: #a27600; }
.dialogo h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.dialogo p { margin: 0 0 18px; color: var(--texto-2); font-size: 14px; }
.dialogo .acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Galeria */
.galeria { position: fixed; inset: 0; z-index: 1800; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.galeria img { max-width: 96vw; max-height: 86vh; border-radius: 8px; object-fit: contain; }
.galeria .fechar { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.15); color: #fff; }
.galeria .leg { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 14px); transform: translateX(-50%); z-index: 1900; background: var(--em-dia-suave); color: var(--em-dia); border: 1px solid #cdebd5; border-radius: 12px; padding: 12px 16px; font-weight: 700; font-size: 14px; box-shadow: var(--sombra-2); display: flex; align-items: center; gap: 8px; }
.toast.erro { background: var(--atrasado-suave); color: var(--atrasado); border-color: #f5c7c9; }

/* Loading */
.loading { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(251,248,242,.6); }
.spinner { width: 44px; height: 44px; border: 4px solid var(--borda); border-top-color: var(--amarelo); border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* =====================================================================
 * DESKTOP (≥ 900px): sidebar à esquerda, painel flutuante, modais centrados
 * ===================================================================== */
@media (min-width: 900px) {
  .app { grid-template-rows: var(--topbar-h) 1fr; grid-template-columns: var(--sidebar-w) 1fr; }
  .topbar { grid-column: 1 / -1; padding: 0 20px; }
  .marca img { width: 42px; height: 42px; }
  .usuario-bloco { display: flex; }
  .tabbar { display: none; }
  /*
   * A COLUNA DA ESQUERDA TEM DE CABER INTEIRA, ATÉ CONFIGURAÇÕES.
   *
   * São 16 itens depois que Fornecedores entrou, e no respiro antigo (12px em
   * cada item, 4px de intervalo) os últimos ficavam espremidos ou fora da
   * tela num monitor comum — justamente Configurações, que é para onde se vai
   * mexer nos tipos e nos pesos.
   *
   * O `overflow-y: auto` é a rede de segurança: aperto de espaçamento resolve
   * hoje, mas o 17º item traria o problema de volta. Com ele, a lista rola e
   * nenhum item fica inalcançável — não importa quantos venham depois.
   */
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-right: 1px solid var(--borda);
    background: rgba(255,255,255,.7); position: relative; z-index: 2;
    overflow-y: auto;
  }
  .sidebar .nav-item { padding: 9px 14px; }
  .sidebar .nav-item.ativo::before { top: 7px; bottom: 7px; }
  .sidebar .nav-grupo { margin-top: 10px; padding-top: 10px; }
  .sidebar .nav-grupo-tit { padding: 0 14px 6px; }
  /* A frase do rodapé não pode encolher e empurrar a lista. */
  .sidebar .sidebar-frase { flex: 0 0 auto; padding: 12px; }
  .painel { left: 16px; top: 16px; right: auto; width: 340px; max-height: calc(100% - 32px); }
  .painel-alca { display: none; }
  .legenda { left: auto; right: 16px; bottom: 16px; }
  .localizar { right: 16px; bottom: 64px; }
  /* No computador o painel é estreito, no alto à esquerda: não encosta nem no
     botão (canto inferior direito) nem na legenda. Os dois voltam. */
  .painel:not(.fechado) ~ .localizar { display: inline-flex; }
  .painel:not(.fechado) ~ .legenda { display: flex; }
  .overlay { align-items: center; padding: 20px; }
  .folha { border-radius: var(--r-xl); max-height: 88vh; animation: aparecer .18s ease-out; }
  .folha-alca { display: none; }
  @keyframes aparecer { from { transform: scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
  .toast { bottom: 24px; }
  .folha-acoes { flex-direction: row; flex-wrap: wrap; }
  .folha-acoes .btn { flex: 1; }
  .folha-acoes .linha-2 { display: contents; }
  /* Depois de .btn, para vencer o `flex: 1` acima (mesma especificidade,
     quem vem por último manda). Sem isto a ação de linha inteira entraria
     como mais um botão na mesma fileira e estouraria a largura do cartão. */
  .folha-acoes .acao-linha { flex: 0 0 100%; }
}

/*
 * TELA BAIXA: a lista da esquerda se ajusta sozinha, sem pedir zoom a ninguém.
 *
 * Num monitor de 1366x768 — ou em qualquer janela onde a barra de tarefas e a
 * de favoritos comem espaço — sobra pouca altura útil, e os últimos itens da
 * navegação ficavam escondidos. A saída que apareceu na prática foi diminuir o
 * zoom do navegador para 90%: isso é empurrar o nosso problema para quem usa.
 *
 * Aqui a coluna aperta mais e a frase do rodapé sai. Ela é decoração; a lista
 * de navegação, não. Vem DEPOIS do bloco de desktop de propósito — as duas
 * regras se somam, e a última é que manda.
 */
@media (min-width: 900px) and (max-height: 780px) {
  .sidebar { padding: 8px 10px; gap: 0; }
  .sidebar .nav-item { padding: 7px 12px; font-size: 13px; gap: 10px; }
  .sidebar .nav-item .ic { width: 18px; height: 18px; }
  .sidebar .nav-item.ativo::before { top: 5px; bottom: 5px; }
  .sidebar .nav-grupo { margin-top: 7px; padding-top: 7px; }
  .sidebar .nav-grupo-tit { padding: 0 12px 4px; font-size: 10px; }
  .sidebar .sidebar-frase { display: none; }
}
