/* ═══════════════════════════════════════════════════════════════
   FEDESPMG · painel.css — Área administrativa
   Reaproveita os tokens de cor do site (main.css).
   ═══════════════════════════════════════════════════════════════ */

.pnl {
  --sidebar-w: 248px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-soft);
  display: flex;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.pnl-aside {
  width: var(--sidebar-w);
  background: var(--navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}
.pnl-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pnl-brand img { height: 34px; width: auto; }
.pnl-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pnl-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-sm);
  color: rgba(255,255,255,0.72); font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.pnl-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.pnl-nav a.active { background: var(--red-600); color: #fff; }
.pnl-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.pnl-nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,0.4); padding: 16px 14px 6px; }
.pnl-aside-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.pnl-user { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 10px; }
.pnl-user strong { color: #fff; display: block; font-size: 14px; }
.pnl-logout {
  width: 100%; padding: 9px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.08); color: #fff; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pnl-logout:hover { background: rgba(255,255,255,0.16); }

/* ── Main area ───────────────────────────────────────────────── */
.pnl-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.pnl-topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 18px 32px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
}
.pnl-topbar h1 { font-size: 20px; font-weight: 700; }
.pnl-topbar .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.pnl-content { padding: 28px 32px 60px; }

/* ── Stat cards ──────────────────────────────────────────────── */
.pnl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.pnl-stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.pnl-stat .n { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.pnl-stat .l { font-size: 13px; color: var(--text-muted); margin-top: 8px; font-weight: 500; }
.pnl-stat.amber .n { color: #b45309; }
.pnl-stat.green .n { color: #15803d; }
.pnl-stat.navy .n { color: var(--navy-700); }
.pnl-stat.gray .n { color: var(--text-muted); }

/* ── Card / panel ────────────────────────────────────────────── */
.pnl-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.pnl-card-head {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.pnl-card-head h2 { font-size: 16px; font-weight: 700; }
.pnl-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin: 32px 0 14px; }

/* ── Table ───────────────────────────────────────────────────── */
.pnl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pnl-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 600; padding: 12px 22px; background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.pnl-table td { padding: 14px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pnl-table tr:last-child td { border-bottom: none; }
.pnl-table tr:hover td { background: var(--navy-50); }
.pnl-table .nome { font-weight: 600; color: var(--text); }
.pnl-table .muted { color: var(--text-muted); font-size: 13px; }
.pnl-table a.row-link { color: var(--navy-600); font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: var(--r-full); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pendente { color: #b45309; background: #fef3c7; }
.badge.ativo    { color: #15803d; background: #dcfce7; }
.badge.inativo  { color: #6b7280; background: #f1f3f5; }
.badge.publicado{ color: #15803d; background: #dcfce7; }
.badge.rascunho { color: #6b7280; background: #f1f3f5; }
.badge.origem   { color: var(--navy-700); background: var(--navy-100); }
.badge.origem::before { display: none; }

/* ── Buttons (painel) ────────────────────────────────────────── */
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.pbtn svg { width: 16px; height: 16px; }
.pbtn-primary { background: var(--red-600); color: #fff; }
.pbtn-primary:hover { background: var(--red-700); }
.pbtn-navy { background: var(--navy-800); color: #fff; }
.pbtn-navy:hover { background: var(--navy-700); }
.pbtn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.pbtn-outline:hover { background: var(--bg-soft); }
.pbtn-ghost { background: transparent; color: var(--text-soft); }
.pbtn-ghost:hover { background: var(--bg-mid); }
.pbtn-sm { padding: 6px 12px; font-size: 13px; }
.pbtn-danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.pbtn-danger:hover { background: #fef2f2; }
.pbtn:disabled { opacity: .6; cursor: not-allowed; }
.pbtn-success { background: #15803d; color: #fff; }
.pbtn-success:hover { background: #166534; }

/* ── Forms (painel) ──────────────────────────────────────────── */
.pform { display: grid; gap: 18px; }
.pform-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pfield { display: flex; flex-direction: column; gap: 6px; }
.pfield label { font-size: 13px; font-weight: 600; color: var(--text); }
.pfield input, .pfield select, .pfield textarea {
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 10px 13px; font-size: 14.5px; background: #fff; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.pfield textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.pfield input:focus, .pfield select:focus, .pfield textarea:focus {
  outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px var(--navy-100);
}
.pfield .hint { font-size: 12px; color: var(--text-muted); }
.pform-actions { display: flex; gap: 12px; align-items: center; padding-top: 8px; flex-wrap: wrap; }

/* ── Search bar ──────────────────────────────────────────────── */
.pnl-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.pnl-search { position: relative; flex: 1; min-width: 220px; }
.pnl-search input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 10px 13px 10px 38px; font-size: 14.5px; background: #fff;
}
.pnl-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-muted); }
.pnl-filters { display: flex; gap: 6px; }
.pnl-filter {
  padding: 9px 14px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-soft);
}
.pnl-filter.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ── Empty / misc ────────────────────────────────────────────── */
.pnl-empty { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.pnl-empty svg { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--border-strong); }
.cred-thumb { width: 46px; height: 30px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-mid); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted);
  font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.back-link:hover { color: var(--text); }

/* ── Login ───────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: var(--navy-900); padding: 24px;
}
.login-card {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 410px; padding: 40px 36px;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { height: 50px; width: auto; margin: 0 auto; }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }
.login-error {
  background: var(--red-50); border: 1px solid var(--red-100); color: var(--red-700);
  padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; margin-bottom: 16px;
}
.login-foot { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-muted); }
.save-ok {
  background: #dcfce7; border: 1px solid #86efac; color: #15803d;
  padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
}

/* ── Caixa de dica no editor ─────────────────────────────────── */
.editor-tip {
  background: var(--navy-50); border: 1px solid var(--navy-100); border-radius: var(--r-md);
  margin-bottom: 22px; overflow: hidden;
}
.editor-tip-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 18px; font-size: 14px; font-weight: 700; color: var(--navy-700);
}
.editor-tip-head .chev { margin-left: auto; transition: transform .2s; }
.editor-tip-head.open .chev { transform: rotate(180deg); }
.editor-tip-body { padding: 0 18px 18px; font-size: 14px; color: var(--text-soft); line-height: 1.65; }
.editor-tip-body ul { display: grid; gap: 8px; margin-top: 4px; }
.editor-tip-body li { padding-left: 20px; position: relative; }
.editor-tip-body li::before { content: '→'; position: absolute; left: 0; color: var(--red-600); font-weight: 700; }
.editor-tip-body code {
  background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
  font-size: 13px; font-family: ui-monospace, Menlo, monospace; color: var(--navy-700);
}
.editor-tip-body a { color: var(--red-600); font-weight: 600; text-decoration: underline; }

/* ── Documento de ajuda ──────────────────────────────────────── */
.help-doc { max-width: 820px; }
.help-doc .pnl-card { margin-bottom: 20px; }
.help-doc .help-body { padding: 8px 26px 26px; }
.help-doc h2 { font-size: 19px; margin: 18px 0 6px; }
.help-doc h3 { font-size: 16px; margin: 18px 0 4px; color: var(--navy-700); }
.help-doc p { font-size: 15px; line-height: 1.7; color: var(--text-soft); margin: 8px 0; }
.help-doc ul, .help-doc ol { margin: 8px 0 8px 4px; display: grid; gap: 7px; }
.help-doc ul li { list-style: none; padding-left: 22px; position: relative; }
.help-doc ul li::before { content: '•'; position: absolute; left: 6px; color: var(--red-600); font-weight: 700; }
.help-doc ol { counter-reset: step; }
.help-doc ol li {
  list-style: none; padding-left: 44px; position: relative; min-height: 30px;
  display: flex; align-items: center; font-size: 15px; color: var(--text-soft); line-height: 1.6;
}
.help-doc ol li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.help-doc code {
  background: var(--bg-mid); border-radius: 5px; padding: 2px 7px;
  font-size: 13.5px; font-family: ui-monospace, Menlo, monospace; color: var(--navy-700);
}
.help-doc strong { color: var(--text); }
.help-callout {
  display: flex; gap: 12px; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--r-md); padding: 14px 16px; margin: 16px 0; font-size: 14px; color: #92660b; line-height: 1.6;
}
.help-callout svg { flex-shrink: 0; color: #d97706; width: 20px; height: 20px; margin-top: 1px; }
.help-toc-card { background: var(--navy-900); color: #fff; }
.help-toc-card .help-body a {
  display: block; color: rgba(255,255,255,0.8); padding: 7px 0; font-size: 14.5px; font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.help-toc-card .help-body a:last-child { border-bottom: none; }
.help-toc-card .help-body a:hover { color: #fff; }
.help-doc h2[id], .help-doc h3[id] { scroll-margin-top: 90px; }

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .pnl-aside { transform: translateX(-100%); transition: transform .25s; }
  .pnl-aside.open { transform: translateX(0); }
  .pnl-main { margin-left: 0; }
  .pnl-content { padding: 20px 18px 48px; }
  .pnl-topbar { padding: 16px 18px 16px 64px; }
  .pform-row { grid-template-columns: 1fr; }
}
.pnl-burger { display: none; }
@media (max-width: 860px) { .pnl-burger { display: inline-flex; } }
