/* Painel administrativo de propostas. Reaproveita as cores, a fonte e os botões da proposta (proposta.css);
   tudo aqui fica dentro de body.pn e não afeta a página do cliente. */
.pn { --pn-side: 236px; --pn-form: 460px; --pn-top: 60px; background: var(--paper); min-height: 100vh; font-size: 15px; line-height: 1.5; }
.pn h1, .pn h2, .pn h3 { letter-spacing: -0.02em; line-height: 1.15; font-stretch: 100%; }
.pn h1 { font-size: clamp(28px, 3vw, 40px); }
.pn h2 { font-size: 22px; }
.pn h3 { font-size: 16px; }
.pn [hidden] { display: none !important; }
.pn input, .pn select, .pn textarea { font: inherit; color: inherit; }
.pn-link { color: inherit; font-size: 14px; font-weight: 500; padding: 6px 4px; border-bottom: 1px solid transparent; }
.pn-link:hover { border-bottom-color: currentColor; }
.pn-btn-claro { color: var(--graphite); background: #fff; box-shadow: inset 0 0 0 1px rgba(21,24,28,0.22); }
.pn-btn-claro:hover { box-shadow: inset 0 0 0 1px var(--graphite); }
.pn .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.pn-acoes { display: flex; flex-wrap: wrap; gap: 10px; }

/* Entrada */
.pn-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--navy); }
.pn-login-box { width: min(400px, 100%); display: grid; gap: 16px; padding: 36px 32px; border-radius: 22px; background: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,0.3); }
.pn-login-box img { filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35)); }
.pn-login-box p { color: var(--steel); }
.pn-login-box label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--steel); }
.pn-login-box input { height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.pn-erro { color: #B3261E !important; min-height: 1.2em; font-size: 14px; }

/* Barra superior */
.pn-top { position: sticky; top: 0; z-index: 40; height: var(--pn-top); display: flex; align-items: center; gap: 16px; padding: 0 clamp(14px, 3vw, 28px); background: var(--navy); color: #fff; }
.pn-marca { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; }
.pn-marca img { height: 35px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.pn-modo { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.1); }
.pn-modo.local { color: var(--orange-hi); }
.pn-usuario { font-size: 13px; color: var(--mist); max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lista */
.pn-lista { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 80px; }
.pn-lista-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.pn-lista-head p { margin-top: 6px; color: var(--steel); }
.pn-filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 28px; }
.pn-filtros input { flex: 1 1 280px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 15px; }
.pn-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pn-chips button { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.pn-chips button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: none; }
.pn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
.pn-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.pn-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pn-card h2 { font-size: 18px; }
.pn-card p { color: var(--steel); font-size: 14px; }
.pn-card .pn-acoes { margin-top: auto; padding-top: 8px; }
.pn-card .btn { height: 36px; padding: 0 14px; font-size: 13px; }
.pn-sit { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--stone); color: var(--steel); }
.pn-sit.enviada { background: #E3ECF8; color: #1F4A87; }
.pn-sit.aprovada { background: #E1F1E6; color: #1E6B3A; }
.pn-sit.recusada { background: #F7E3E1; color: #8E2A20; }
.pn-sit.referencia { background: var(--navy); color: #fff; }
.pn-vazio { margin-top: 40px; color: var(--steel); }

/* Editor */
.pn-editor { height: calc(100vh - var(--pn-top)); height: calc(100dvh - var(--pn-top)); display: flex; flex-direction: column; }
.pn-barra { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 10px clamp(14px, 2vw, 24px); background: #fff; border-bottom: 1px solid var(--line); }
.pn-barra-titulo { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.pn-barra-titulo strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-barra-titulo span { font-size: 12px; color: var(--steel); }
.pn-barra select { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.pn-barra-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.pn-barra .btn { height: 36px; padding: 0 14px; font-size: 13px; }
.pn-aviso { padding: 10px clamp(14px, 2vw, 24px); font-size: 14px; background: #FFF4E8; color: #6B3A0F; border-bottom: 1px solid rgba(221,122,33,0.35); }
.pn-corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--pn-side) var(--pn-form) minmax(0, 1fr); }

.pn-categorias { overflow-y: auto; padding: 14px 10px 40px; border-right: 1px solid var(--line); background: var(--paper); }
.pn-categorias button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--graphite); }
.pn-categorias button:hover { background: rgba(21,24,28,0.05); }
.pn-categorias button[aria-current="true"] { background: var(--navy); color: #fff; }
.pn-categorias .pn-grupo { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.pn-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--orange); }

.pn-form { overflow-y: auto; padding: 22px clamp(16px, 2vw, 26px) 80px; background: #fff; border-right: 1px solid var(--line); }
.pn-form > h2 { margin-bottom: 4px; }
.pn-form > .pn-ajuda { margin-bottom: 18px; }
.pn-campo { display: grid; gap: 6px; margin-top: 16px; }
.pn-campo > *, .pn-item, .pn-item-corpo { min-width: 0; } /* títulos longos não alargam a coluna */
.pn-campo > label, .pn-rotulo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--graphite); }
.pn-campo input[type="text"], .pn-campo input[type="date"], .pn-campo input[type="number"], .pn-campo input[type="email"], .pn-campo input[type="tel"], .pn-campo select, .pn-campo textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(21,24,28,0.18); background: #fff; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.pn-campo textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.pn-campo input:focus, .pn-campo select:focus, .pn-campo textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(221,122,33,0.18); }
.pn-campo.pendente input, .pn-campo.pendente textarea, .pn-campo.pendente select { border-color: rgba(221,122,33,0.75); background: #FFFBF6; }
.pn-ajuda { font-size: 12.5px; color: var(--steel); line-height: 1.45; }
.pn-req { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; color: #8A4510; background: rgba(221,122,33,0.14); }
.pn-req.art { color: #1F4A87; background: #E3ECF8; }
.pn-toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pn-toggle input { width: 18px; height: 18px; accent-color: var(--navy); }
.pn-calc { margin-top: 6px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pn-form fieldset:disabled { opacity: 0.75; }
.pn-form fieldset { border: 0; min-width: 0; }

.pn-lista-campos { margin-top: 18px; }
.pn-lista-campos > .pn-rotulo { margin-bottom: 8px; }
.pn-item { margin-top: 8px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--paper); }
.pn-item > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
.pn-item > summary::-webkit-details-marker { display: none; }
.pn-item > summary .pn-item-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-item > summary .pn-item-n { color: var(--steel); font-weight: 500; font-variant-numeric: tabular-nums; }
.pn-item-corpo { padding: 0 12px 14px; }
.pn-item-corpo .pn-item { background: #fff; }
.pn-mini { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; color: var(--steel); }
.pn-mini:hover { background: rgba(21,24,28,0.07); color: var(--graphite); }
.pn-mini.perigo:hover { background: #F7E3E1; color: #8E2A20; }
.pn-add { margin-top: 10px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--navy); box-shadow: inset 0 0 0 1px rgba(10,24,48,0.3); }
.pn-add:hover { background: rgba(10,24,48,0.05); }
.pn-textos .pn-texto-linha { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; }
.pn-textos textarea { min-height: 64px; }

.pn-foto { display: flex; gap: 12px; align-items: center; }
.pn-foto-prev { width: 84px; height: 64px; flex-shrink: 0; border-radius: 10px; object-fit: cover; background: var(--stone); box-shadow: inset 0 0 0 1px var(--line); }
.pn-foto label.btn { height: 34px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.pn-foto input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.pn-secoes li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.pn-secoes li.off { opacity: 0.55; }
.pn-secoes li span { flex: 1; font-size: 14px; }

.pn-pend { display: grid; gap: 6px; margin-top: 10px; }
.pn-pend button { display: flex; gap: 10px; align-items: baseline; text-align: left; padding: 9px 12px; border-radius: 10px; background: #FFFBF6; box-shadow: inset 0 0 0 1px rgba(221,122,33,0.35); font-size: 14px; }
.pn-pend button small { color: var(--steel); }

.pn-previa { display: flex; flex-direction: column; min-width: 0; background: var(--stone); }
.pn-previa-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--steel); border-bottom: 1px solid var(--line); }
.pn-previa-bar > span { margin-right: auto; }
.pn-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.pn-seg button { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--steel); }
.pn-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.pn-previa iframe { flex: 1; width: 100%; border: 0; background: var(--paper); }
.pn-previa-fechar, .pn-previa-abrir { display: none; }

/* Janela do link */
.pn-dialogo { margin: auto; width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,0.35); }
.pn-dialogo::backdrop { background: rgba(6,14,30,0.55); }
.pn-dlg-box { display: grid; gap: 14px; padding: 26px; }
.pn-dlg-box p { color: var(--steel); font-size: 14px; }
.pn-alerta { padding: 12px 14px; border-radius: 12px; font-size: 14px; color: #6B3A0F !important; background: #FFF4E8; border: 1px solid rgba(221,122,33,0.35); }
.pn-alerta ul { margin-top: 6px; list-style: disc; padding-left: 18px; }
.pn-link-novo input { width: 100%; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; margin-bottom: 10px; }
.pn-links { display: grid; gap: 8px; }
.pn-links li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.pn-links li span { flex: 1; min-width: 180px; }
.pn-links li.revogado { opacity: 0.55; }
.pn-dlg-pe { justify-content: flex-end; margin-top: 6px; }

.pn-toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 12px; font-size: 14px; color: #fff; background: var(--graphite); box-shadow: 0 12px 30px rgba(0,0,0,0.25); opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); max-width: calc(100vw - 32px); }
.pn-toast.on { opacity: 1; transform: translate(-50%, 0); }
.pn-toast.erro { background: #8E2A20; }

/* Telas menores: a prévia vira uma camada que se abre por botão */
@media (max-width: 1280px) { .pn { --pn-side: 200px; --pn-form: 400px; } }
@media (max-width: 1080px) {
  .pn-corpo { grid-template-columns: var(--pn-side) minmax(0, 1fr); }
  .pn-previa { position: fixed; inset: 0; z-index: 60; display: none; }
  .pn-previa.aberta { display: flex; }
  .pn-previa-fechar { display: inline-block; }
  .pn-previa-abrir { display: block; position: fixed; right: 16px; bottom: 16px; z-index: 50; height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 600; color: #fff; background: var(--navy); box-shadow: 0 12px 30px rgba(0,0,0,0.25); }
}
@media (max-width: 760px) {
  .pn-corpo { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .pn-categorias { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .pn-categorias::-webkit-scrollbar { display: none; }
  .pn-categorias button { width: auto; flex: 0 0 auto; white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  .pn-categorias .pn-grupo { display: none; }
  .pn-form { border-right: 0; }
  .pn-barra-acoes { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .pn-barra-acoes .btn { flex: 0 0 auto; }
  .pn-usuario { display: none; }
  .pn-campo input, .pn-campo textarea, .pn-campo select { font-size: 16px; } /* evita o zoom automático do iPhone */
}
