/* =============================================================
   Feira Nordestina — painel e instalador. Mesma identidade da Feira Potiguar (claro, verde, Montserrat).
   ============================================================= */
:root {
  --cor: #157A3E; --cor-esc: #0B4D2C; --cor2: #3DB54A; --cor-fundo: #EEF7F0;
  --papel: #F4F7F5; --tinta: #0F1A14; --texto2: #4B5A51; --texto3: #7A867F; --linha: #E1E8E3; --erro: #B3261E;
  --cinza: #C7CDD1;
  --sombra: 0 1px 2px rgba(11, 77, 44, .05), 0 10px 26px rgba(11, 77, 44, .08);
  --f: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--f); color: var(--tinta); background: var(--papel); -webkit-font-smoothing: antialiased; font-size: 15px; }
a { color: var(--cor); }
button, input, select, textarea { font: inherit; }
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.muted { color: var(--texto3); }
code { background: var(--cor-fundo); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
h1, h2 { letter-spacing: -.02em; }

/* botões */
.bt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.bt-pri { background: linear-gradient(180deg, #2E9E4B, var(--cor)); color: #fff; box-shadow: 0 12px 26px -12px rgba(21, 122, 62, .8); }
.bt-pri:hover { filter: brightness(1.06); }
.bt-sec { background: #fff; color: var(--cor-esc); border: 1.5px solid var(--linha); }
.bt-sec:hover { border-color: var(--cor2); }
.bt-perigo { background: #fff; color: var(--erro); border: 1.5px solid #F1D3D0; }
.bt-perigo:hover { background: #FBECEA; }
.bt-bloco { display: flex; width: 100%; }
.bt-peq { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

/* alertas e selos */
.alerta { padding: 12px 16px; border-radius: 14px; font-size: 14px; margin: 0 0 14px; line-height: 1.45; }
.alerta-erro { background: #FBECEA; color: #8C1D18; }
.alerta-ok { background: var(--cor-fundo); color: var(--cor-esc); }
.alerta-aviso { background: #FFF6E0; color: #7A5300; }
.selo { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.selo-ok { background: #EEF7F0; color: #157A3E; }
.selo-aviso { background: #FFF6E0; color: #8A5D00; }
.selo-cinza { background: #EEF0F1; color: var(--texto3); }

/* formulários */
.form { display: grid; gap: 14px; }
.form label { display: block; font-size: 13.5px; font-weight: 600; color: var(--texto2); }
.form label > input:not([type=checkbox]):not([type=color]), .form label > select, .form label > textarea { display: block; margin-top: 6px; }
.form label small { font-weight: 500; color: var(--texto3); }
.form input:not([type=checkbox]):not([type=hidden]):not([type=color]):not([type=file]), .form select, .form textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linha); background: var(--papel); color: var(--tinta); font-size: 15.5px; outline: 0; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--cor2); background: #fff; box-shadow: 0 0 0 3px rgba(61, 181, 74, .15); }
.form input[type=file] { width: 100%; max-width: 100%; font-size: 14px; padding: 10px; border: 1.5px dashed var(--linha); border-radius: 12px; background: var(--papel); }
.form fieldset { border: 1px solid var(--linha); border-radius: 16px; padding: 14px 16px 16px; margin: 0; display: grid; gap: 14px; }
.form legend { font-weight: 800; font-size: 13px; color: var(--cor-esc); padding: 0 6px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; line-height: 1.45; }
.form .check input { width: 20px; height: 20px; accent-color: var(--cor); flex: none; margin-top: 1px; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-acoes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 4px; }
@media (max-width: 560px) { .grade-2 { grid-template-columns: 1fr; } .form-acoes .bt { flex: 1; } }

/* chave liga/desliga */
.chave { display: flex !important; grid-template-columns: none; align-items: center; gap: 12px !important; cursor: pointer; padding: 12px 14px; border-radius: 14px; background: var(--papel); }
.chave input { position: absolute; opacity: 0; pointer-events: none; }
.chave span { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #CBD3CE; transition: background .15s; flex: none; }
.chave span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.chave input:checked + span { background: var(--cor2); }
.chave input:checked + span::after { transform: translateX(18px); }
.chave input:focus-visible + span { outline: 3px solid rgba(61, 181, 74, .4); outline-offset: 2px; }
.chave b { color: var(--tinta); font-size: 15px; }

/* cores */
.cores__lista { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cores__op { width: 36px; height: 36px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--linha); cursor: pointer; padding: 0; }
.cores__op.sel { box-shadow: 0 0 0 2px var(--tinta); }
.cores__livre { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px !important; padding: 4px 10px 4px 4px; border: 1px solid var(--linha); border-radius: 12px; cursor: pointer; background: #fff; }
.cores__livre input { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.cores__livre span { font-size: 12.5px; font-weight: 700; color: var(--texto2); font-variant-numeric: tabular-nums; }

/* ---------- entrar / instalar ---------- */
.pn-entrar { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 60% at 50% 0%, var(--cor-fundo) 0%, var(--papel) 60%) var(--papel); }
.entrar-caixa { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--linha); border-radius: 24px; padding: 28px; box-shadow: var(--sombra); }
.entrar-caixa--larga { max-width: 580px; }
.entrar-caixa h1 { font-size: 24px; margin: 18px 0 8px; }
.entrar-caixa > .muted { margin: 0 0 16px; line-height: 1.5; font-size: 14px; }
.entrar-marca { display: flex; align-items: center; gap: 12px; }
.entrar-marca > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(150deg, var(--cor2), var(--cor)); color: #fff; }
.entrar-marca > span .ic { width: 26px; height: 26px; }
.entrar-marca div { display: flex; flex-direction: column; line-height: 1.2; }
.entrar-marca b { font-size: 18px; }
.entrar-marca small { color: var(--texto3); font-size: 12.5px; font-weight: 600; }
.entrar-voltar { display: block; text-align: center; margin-top: 16px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.inst-config { width: 100%; font: 12px ui-monospace, Menlo, monospace; border-radius: 12px; border: 1px solid var(--linha); padding: 10px; margin-bottom: 14px; }

/* ---------- moldura do painel ---------- */
.pn { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.pn-lado { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--linha); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.pn-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); padding: 4px 6px; }
.pn-marca > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(150deg, var(--cor2), var(--cor)); color: #fff; flex: none; }
.pn-marca div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pn-marca b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-marca small { color: var(--texto3); font-size: 12px; font-weight: 600; }
.pn-menu { display: flex; flex-direction: column; gap: 4px; }
.pn-menu a, .pn-ver, .pn-sair { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 13px; text-decoration: none; color: var(--texto2); font-weight: 600; font-size: 14.5px; }
.pn-menu a:hover, .pn-ver:hover, .pn-sair:hover { background: var(--papel); color: var(--tinta); }
.pn-menu a.ativo { background: var(--cor-fundo); color: var(--cor-esc); font-weight: 700; }
.pn-menu a.ativo .ic { color: var(--cor); }
.pn-lado__pe { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.pn-quem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--linha); margin-top: 6px; }
.pn-quem > span, .pn-admins__av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--cor-fundo); color: var(--cor); font-weight: 800; flex: none; }
.pn-quem div { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pn-quem b { font-size: 13.5px; }
.pn-quem small { font-size: 11.5px; color: var(--texto3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-miolo { padding: 26px clamp(16px, 3vw, 36px) 48px; min-width: 0; max-width: 1240px; width: 100%; }
.pn-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pn-cab h1 { margin: 0; font-size: 26px; }
.pn-voltar { display: inline-block; font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.pn-intro { margin: -6px 0 18px; color: var(--texto2); line-height: 1.55; max-width: 760px; }

@media (max-width: 900px) {
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn-lado { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--linha); overflow-x: auto; scrollbar-width: none; }
  .pn-lado::-webkit-scrollbar { display: none; }
  .pn-marca div, .pn-quem { display: none; }
  .pn-menu { flex-direction: row; gap: 4px; }
  .pn-menu a, .pn-ver, .pn-sair { height: 42px; padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
  .pn-lado__pe { margin: 0 0 0 auto; flex-direction: row; }
  .pn-ver span { display: none; }
  .pn-miolo { padding-top: 18px; }
  .pn-cab h1 { font-size: 22px; }
}
@media (max-width: 560px) { .pn-menu a span, .pn-sair span { display: none; } .pn-menu a.ativo span { display: inline; } }

/* ---------- cartões e dashboard ---------- */
.pn-cartao { background: #fff; border: 1px solid var(--linha); border-radius: 22px; padding: 20px; box-shadow: var(--sombra); margin-bottom: 18px; min-width: 0; }
.pn-cartao__cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pn-cartao__cab h2 { margin: 0; font-size: 17px; }
.pn-cartao__cab small { color: var(--texto3); font-size: 12.5px; font-weight: 600; }
.pn-cartao__cab small.ok { color: var(--cor); }
.pn-cartao__cab small.aviso { color: #8A5D00; }
.pn-estreito { max-width: 640px; }

.pn-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.pn-stat { position: relative; background: #fff; border: 1px solid var(--linha); border-radius: 20px; padding: 18px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pn-stat__ic { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--cor-fundo); color: var(--cor); }
.pn-stat small { color: var(--texto3); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.pn-stat b { font-size: 32px; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; }
.pn-stat b em { font-style: normal; color: var(--texto3); font-size: 18px; font-weight: 700; }
.pn-stat b.pn-stat__txt { font-size: 17px; letter-spacing: -.01em; line-height: 1.25; padding-right: 36px; }
.pn-stat b.pn-stat__txt em { font-size: 15px; }
.pn-stat__sub { color: var(--texto2); font-size: 12.5px; font-weight: 600; }
.pn-stat a { font-size: 12.5px; font-weight: 700; text-decoration: none; margin-top: auto; }
@media (max-width: 1100px) { .pn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pn-stat__ic { display: none; } .pn-stat b.pn-stat__txt { padding-right: 0; } .pn-stat b { font-size: 26px; } .pn-stats { gap: 10px; } .pn-stat { padding: 14px; } }

.pn-duas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pn-duas > .pn-cartao { margin-bottom: 0; }
.pn-duas + * { margin-top: 18px; }
.pn-duas--form { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.pn-duas--estados { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
@media (max-width: 900px) { .pn-duas, .pn-duas--form, .pn-duas--estados { grid-template-columns: 1fr; } }

/* mapa do painel */
.pn-cartao--mapa { display: flex; flex-direction: column; }
.pn-mapa { width: 100%; max-height: 520px; display: block; }
.pn-uf path { fill: var(--cinza); stroke: #fff; stroke-width: 2.4; stroke-linejoin: round; transition: fill .15s, filter .15s; }
.pn-uf--cor path { fill: var(--cor); }
.pn-uf text { fill: #fff; font: 800 28px var(--f); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.pn-uf[data-uf="RN"] text, .pn-uf[data-uf="PB"] text, .pn-uf[data-uf="AL"] text, .pn-uf[data-uf="SE"] text { font-size: 20px; }
.pn-uf:hover path { filter: brightness(.92) drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); }

/* agenda */
.pn-agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pn-agenda a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; text-decoration: none; color: var(--tinta); border: 1px solid var(--linha); }
.pn-agenda a:hover { background: var(--papel); }
.pn-agenda__uf, .pn-estado__uf { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--cor); color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.pn-agenda__txt, .pn-estado__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pn-agenda__txt b, .pn-estado__txt b { font-size: 14.5px; }
.pn-agenda__txt small, .pn-estado__txt small { color: var(--texto2); font-size: 12.5px; }
.pn-vazio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 10px; color: var(--texto3); }
.pn-vazio .ic { width: 34px; height: 34px; color: var(--cor2); }
.pn-vazio b { color: var(--tinta); }
.pn-vazio .bt { margin-top: 10px; }

/* gráfico de barras */
.pn-barras { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-bottom: 22px; }
.pn-barra { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.pn-barra span { display: block; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--cor2), var(--cor)); opacity: .75; min-height: 2px; }
.pn-barra:hover span, .pn-barra.hoje span { opacity: 1; }
.pn-barra small { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--texto3); white-space: nowrap; font-weight: 600; }

/* tabela */
.tabela-rolar { overflow-x: auto; margin: 0 -4px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto3); padding: 8px 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.tabela td { padding: 11px 10px; border-bottom: 1px solid var(--linha); }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.pn-tab-uf { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--tinta); white-space: nowrap; }
.pn-tab-uf i { width: 12px; height: 12px; border-radius: 4px; }

/* lista de estados */
.pn-estados { display: grid; gap: 10px; }
.pn-estado { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--linha); box-shadow: var(--sombra); text-decoration: none; color: var(--tinta); }
.pn-estado:hover { border-color: var(--cor); }

/* prévia do estado */
.pn-previa { position: sticky; top: 20px; display: flex; flex-direction: column; align-items: center; }
.pn-previa .pn-cartao__cab { width: 100%; }
.pn-previa__uf { width: 100%; max-height: 260px; display: block; margin-bottom: -30px; }
.pn-previa__uf path { stroke: #fff; stroke-width: 3; transition: fill .15s; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18)); }
.pn-previa__nota { font-size: 12.5px; text-align: center; margin: 14px 0 0; }
.ne-card { position: relative; width: 100%; max-width: 300px; padding: 16px 18px 16px 22px; border-radius: 20px; background: #fff; border: 1px solid var(--linha);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 22px 46px -12px rgba(15, 26, 20, .28); display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.ne-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--card-cor, var(--cor)); }
.ne-card__uf { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--card-cor, var(--cor)); }
.ne-card__nome { font-size: 18px; line-height: 1.2; }
.ne-card__data, .ne-card__cidade { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--texto2); }
.ne-card__data .ic, .ne-card__cidade .ic { color: var(--card-cor, var(--cor)); }
.ne-card__bt { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; height: 44px; border-radius: 14px; background: var(--card-cor, var(--cor)); color: #fff; font-weight: 700; font-size: 14px; }

/* site e conta */
.logo-atual { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; border-radius: 16px; background: repeating-conic-gradient(#F3F5F4 0 25%, #fff 0 50%) 0 0 / 18px 18px; text-align: center; }
.logo-atual img { max-width: 260px; max-height: 120px; object-fit: contain; }
.logo-atual small { font-size: 12.5px; }
.ne-marca-mini { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ne-marca-mini span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(150deg, var(--cor2), var(--cor)); color: #fff; }
.ne-marca-mini b:last-child { color: var(--cor); }
.pn-admins { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.pn-admins li { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--linha); border-radius: 16px; }
.pn-admins li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pn-admins b { font-size: 14px; }
.pn-admins b em { font-style: normal; color: var(--texto3); font-weight: 600; }
.pn-admins small { color: var(--texto3); font-size: 12px; overflow-wrap: anywhere; }
.pn-novo summary { list-style: none; display: inline-flex; }
.pn-novo summary::-webkit-details-marker { display: none; }
.pn-novo[open] summary { margin-bottom: 14px; }
