/* Painel do profissional — herda as cores da landing (--brand / --brand-2, setadas inline). */
:root {
  --ink: #15191b;
  --ink-2: #4a565a;
  --bg: color-mix(in srgb, var(--brand) 5%, #f6f7f8);
  --surface: #ffffff;
  --line: color-mix(in srgb, var(--brand) 12%, #e5e8ea);
  --tint: color-mix(in srgb, var(--brand) 8%, #ffffff);
  --brand-ink: #ffffff;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --wrap: 980px;
  --ok: #0a7d4d; --warn: #b26a00; --danger: #b42318; --info: #1d63c9;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Figtree", system-ui, sans-serif; font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .pn-brand, .pn-metric-v, .pn-top-name {
  font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto; font-weight: 600; letter-spacing: -0.015em;
}
/* textarea entrou aqui: sem ele o navegador usava monoespaçada nos campos de texto */
input, button, select, textarea { font: inherit; }
.pn-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
.pn-auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.pn-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45; pointer-events: none; }
.pn-blob-a { width: 40vw; height: 40vw; background: color-mix(in srgb, var(--brand) 55%, transparent); top: -12vw; right: -8vw; }
.pn-blob-b { width: 32vw; height: 32vw; background: color-mix(in srgb, var(--brand-2) 55%, transparent); bottom: -12vw; left: -8vw; }
.pn-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: clamp(26px, 4vw, 40px);
  box-shadow: 0 40px 90px -50px color-mix(in srgb, var(--brand) 60%, transparent);
}
.pn-brand { display: inline-block; font-weight: 700; font-size: 0.95rem; color: var(--brand); background: var(--tint); padding: 5px 13px; border-radius: 999px; margin-bottom: 18px; }
.pn-title { font-size: 1.7rem; font-weight: 800; margin: 0 0 0.2em; }
.pn-sub { color: var(--ink-2); margin: 0 0 1.6em; text-wrap: pretty; }

.pn-field { margin-bottom: 15px; }
.pn-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.pn-field input {
  width: 100%; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.pn-field input::placeholder { color: var(--ink-2); opacity: 0.7; }
.pn-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }

.pn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; border: 0; cursor: pointer;
  border-radius: 4px; padding: 13px 20px; font-size: 1rem; margin-top: 6px;
  transition: filter 0.2s var(--ease), transform 0.2s var(--ease);
}
.pn-btn:hover { filter: brightness(1.06); }
.pn-btn:active { transform: translateY(1px); }
.pn-btn[disabled] { opacity: 0.7; cursor: progress; }
.pn-spin { width: 1.05em; height: 1.05em; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.45); border-top-color: #fff; animation: pn-spin 0.7s linear infinite; }
@keyframes pn-spin { to { transform: rotate(360deg); } }
.pn-msg { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); border-radius: 11px; padding: 10px 13px; font-size: 0.9rem; margin: 0 0 15px; }
.pn-back { display: inline-block; margin-top: 18px; color: var(--ink-2); text-decoration: none; font-size: 0.9rem; }
.pn-back:hover { color: var(--brand); }

/* ---------- Dashboard ---------- */
.pn-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.pn-top-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; }
.pn-top-id { display: flex; flex-direction: column; line-height: 1.2; }
.pn-top-name { font-weight: 700; font-size: 1.1rem; }
.pn-top-role { font-size: 0.82rem; color: var(--ink-2); }
.pn-top-actions { display: flex; align-items: center; gap: 8px; }
.pn-link { color: var(--brand); font-weight: 600; text-decoration: none; padding: 8px 12px; border-radius: 4px; white-space: nowrap; }
.pn-link:hover { background: var(--tint); }
/* inline-flex + sem sublinhado: o .pn-ghost também é usado em <a> (Ver página) */
.pn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 8px 14px; cursor: pointer; font-weight: 600;
  text-decoration: none; white-space: nowrap; }
.pn-ghost:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
/* Botão de atualizar: o ícone gira enquanto busca os dados */
#pnReload { display: inline-flex; align-items: center; gap: 7px; }
#pnReload svg { width: 15px; height: 15px; }
#pnReload[disabled] { opacity: .7; cursor: progress; }
#pnReload.is-loading svg { animation: pn-gira .8s linear infinite; }
@keyframes pn-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #pnReload.is-loading svg { animation: none; } }
@media (max-width: 520px) { .pn-reload-txt { display: none; } }

.pn-main { padding: clamp(20px, 4vw, 36px) 0 80px; }
.pn-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: clamp(24px, 4vw, 40px); }
.pn-metric { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.pn-metric-v { display: block; font-size: 2.1rem; font-weight: 800; color: var(--brand); line-height: 1; }
.pn-metric-l { display: block; margin-top: 8px; font-size: 0.88rem; color: var(--ink-2); }

.pn-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pn-h2 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.pn-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 0 12px; min-width: 240px; }
.pn-search svg { width: 18px; height: 18px; color: var(--ink-2); flex: none; }
.pn-search input { border: 0; background: transparent; padding: 10px 0; width: 100%; outline: none; color: var(--ink); }

/* Lista de contatos */
.pn-cards { display: grid; gap: 12px; }
.pn-contact {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: start;
}
.pn-c-main { min-width: 0; }
.pn-c-name { font-weight: 700; font-size: 1.05rem; }
.pn-c-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 3px; font-size: 0.9rem; color: var(--ink-2); }
.pn-c-phone { color: var(--brand); font-weight: 600; text-decoration: none; }
.pn-c-phone:hover { text-decoration: underline; }
.pn-c-msg { margin: 8px 0 0; font-size: 0.94rem; color: var(--ink); background: var(--tint); border-radius: 10px; padding: 9px 12px; text-wrap: pretty; }
.pn-c-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pn-c-date { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; }

/* Status como select estilizado */
.pn-status { position: relative; }
.pn-status select {
  appearance: none; border: 1.5px solid currentColor; background: transparent; color: inherit;
  font-weight: 600; font-size: 0.85rem; border-radius: 6px; padding: 6px 30px 6px 14px; cursor: pointer;
}
.pn-status::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.pn-status.s-new { color: var(--info); }
.pn-status.s-contacted { color: var(--warn); }
.pn-status.s-scheduled { color: var(--brand); }
.pn-status.s-attended { color: var(--ok); }
.pn-status.s-lost { color: var(--ink-2); }
.pn-status select option { color: #15191b; }

/* Estados: skeleton / vazio / erro */
.pn-skel { display: grid; gap: 12px; }
.pn-skel-row { height: 84px; border-radius: 14px; background:
  linear-gradient(90deg, var(--surface), var(--tint), var(--surface)); background-size: 200% 100%;
  animation: pn-sheen 1.3s ease-in-out infinite; border: 1px solid var(--line); }
@keyframes pn-sheen { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.pn-empty, .pn-error { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }
.pn-empty svg, .pn-error svg { width: 44px; height: 44px; color: var(--brand); opacity: 0.8; margin-bottom: 10px; }
.pn-empty h3, .pn-error h3 { font-size: 1.2rem; margin: 0 0 0.3em; }
.pn-empty p, .pn-error p { color: var(--ink-2); margin: 0 auto; max-width: 42ch; text-wrap: pretty; }
.pn-error .pn-btn { width: auto; margin: 16px auto 0; padding: 10px 20px; }

/* Toast */
.pn-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px);
  background: #15191b; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 0.92rem;
  box-shadow: 0 20px 50px -18px rgba(0,0,0,0.5); z-index: 100; opacity: 0; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.pn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pn-toast.err { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .pn-spin { animation: none; }
  .pn-skel-row { animation: none; }
  .pn-toast { transition: opacity 0.15s; }
}
@media (max-width: 560px) {
  .pn-contact { grid-template-columns: 1fr; }
  .pn-c-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .pn-search { min-width: 0; width: 100%; }
  .pn-sec-head { align-items: stretch; }
}

/* ---------- Abas do painel ---------- */
.pn-abas { display: flex; gap: 6px; padding-top: 18px; }
.pn-aba {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); cursor: pointer; font-weight: 600;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.pn-aba:hover { color: var(--ink); }
.pn-aba.is-active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Editor da própria página ---------- */
.pn-ed-topo {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start;
  justify-content: space-between; margin-bottom: 18px;
}
.pn-ed-sub { color: var(--ink-2); margin: 4px 0 0; font-size: .95rem; max-width: 46ch; }
.pn-ed-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.pn-ed-rodape { margin-top: 18px; }
.pn-ed-rodape .pn-btn { width: 100%; }

.pn-grupo {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin-bottom: 12px;
}
.pn-grupo > h3 { margin: 0 0 4px; font-size: 1.06rem; }
.pn-grupo > .pn-ajuda { margin: 0 0 16px; color: var(--ink-2); font-size: .9rem; }
.pn-campo { margin-bottom: 14px; }
.pn-campo label { display: block; font-weight: 600; font-size: .86rem; color: var(--ink-2); margin: 0 0 6px; }
.pn-campo input, .pn-campo textarea {
  width: 100%; font-size: 16px;   /* 16px evita o zoom do iOS ao focar */
  color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 12px 14px; min-height: 46px;
  transition: border-color .18s, box-shadow .18s;
}
.pn-campo textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.pn-campo :is(input, textarea):focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.pn-dica { color: var(--ink-2); font-size: .8rem; margin: -8px 0 14px; opacity: .85; }

/* Imagem/vídeo: mesma proporção do site, toca pra trocar */
.pn-midia {
  position: relative; display: block; width: 100%; padding: 0; cursor: pointer;
  aspect-ratio: var(--ar, 4 / 5); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--tint); color: inherit;
}
.pn-midia:hover { border-color: var(--brand); }
.pn-midia > img, .pn-midia > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pn-midia-vazia {
  width: 100%; height: 100%; display: grid; place-content: center; gap: 6px; justify-items: center;
  color: var(--ink-2); border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; padding: 10px;
}
.pn-midia-vazia svg { width: 24px; height: 24px; }
.pn-midia-acao {
  position: absolute; left: 8px; right: 8px; bottom: 8px; display: inline-flex;
  align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 78%, transparent); color: #fff;
  font-weight: 700; font-size: .84rem; backdrop-filter: blur(3px);
}
.pn-midia-acao svg { width: 15px; height: 15px; }
.pn-midia.is-busy { pointer-events: none; }
.pn-midia.is-busy > img { opacity: .45; }
.pn-galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .pn-galeria { grid-template-columns: 1fr 1fr; } }
.pn-medida {
  display: inline-block; margin-top: 10px; font-size: .8rem; color: var(--ink-2);
  background: var(--tint); border-radius: 8px; padding: 7px 10px;
}
/* min-width: 0 nos dois: sem isso o input de texto do lado do seletor de cor
   mantém a largura mínima dele e empurra a tela inteira (533px num celular de
   390). Só aparecia depois de abrir o editor, por isso passou batido. */
.pn-cores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.pn-cor { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pn-cor input[type="text"] { min-width: 0; flex: 1; }
.pn-cor input[type="color"] {
  width: 52px; height: 46px; padding: 3px; flex: none; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer;
}
@media (max-width: 420px) { .pn-cores { grid-template-columns: 1fr; } }
.pn-itens { display: grid; gap: 12px; margin-bottom: 12px; }
.pn-item { padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.pn-item-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pn-item-n { font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.pn-item-x {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
  font-size: .84rem; font-weight: 600; cursor: pointer;
}
.pn-item-x:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.pn-item-x svg { width: 15px; height: 15px; }
.pn-add { width: 100%; }   /* o .pn-spin do topo do arquivo já serve aqui */
