/* ============================================================================
   LICIDATA — PORTAL MUNICIPAL · TEMPLATE BASE
   Versão: 2.0 — Reutilizável para qualquer prefeitura/câmara
   ============================================================================

   COMO PERSONALIZAR POR MUNICÍPIO:
   ---------------------------------
   No <body> do portal, defina as variáveis CSS no atributo style:

     <body style="
       --p-primary:   #0d2e5e;
       --p-secondary: #c79c4a;
       --p-accent:    #d4af37;
     ">

   Ou via PHP no view:
     <body style="--p-primary:<?=$t['cor_primaria']?>;--p-secondary:<?=$t['cor_secundaria']?>">

   Todas as cores são derivadas dessas 3 variáveis principais.

============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Roboto+Mono:wght@400;500&display=swap');

/* ─── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Personalizáveis por município
═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Cores base do município (override no body) */
  --p-primary:    #0d2e5e;
  --p-secondary:  #c79c4a;
  --p-accent:     #d4af37;

  /* Cores neutras (sistema) */
  --paper:        #fafaf7;
  --paper-warm:   #f5f1ea;
  --ink:          #0a1628;
  --ink-soft:     #2a3548;
  --ink-muted:    #5b6982;
  --rule:         rgba(10, 22, 40, 0.10);
  --rule-strong:  rgba(10, 22, 40, 0.16);

  /* Estados */
  --green:        #15803d;
  --green-bg:     #dcfce7;
  --amber:        #b45309;
  --amber-bg:     #fef3c7;
  --red:          #b91c1c;
  --red-bg:       #fee2e2;
  --blue:         #1e40af;
  --blue-bg:      #dbeafe;
  --slate:        #475569;
  --slate-bg:     #f1f5f9;

  /* Tipografia */
  --display:      'Roboto', system-ui, -apple-system, sans-serif;
  --body:         'Roboto', system-ui, -apple-system, sans-serif;

  /* Espaçamento (escala harmônica) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 48px; --s-10: 64px; --s-11: 80px; --s-12: 96px;

  /* Bordas */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Sombras (sutis, em camadas) */
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05);
  --shadow:    0 4px 12px -2px rgba(10, 22, 40, 0.08), 0 2px 4px rgba(10, 22, 40, 0.04);
  --shadow-lg: 0 16px 40px -12px rgba(10, 22, 40, 0.14), 0 4px 12px rgba(10, 22, 40, 0.06);

  /* Acessibilidade — fonte escalável */
  --fs: 1;
}

html { font-size: calc(16px * var(--fs)); }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink-soft);
  line-height: 1.6;
  font-feature-settings: 'kern', 'liga', 'calt';
}

a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT BASE — Estrutura do Portal
═══════════════════════════════════════════════════════════════════════════ */
.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-content { flex: 1; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-5); }

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER — Cabeçalho do Município
═══════════════════════════════════════════════════════════════════════════ */
.p-header {
  background: linear-gradient(135deg, var(--p-primary) 0%, color-mix(in srgb, var(--p-primary) 70%, var(--ink) 30%) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.p-header::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, color-mix(in srgb, var(--p-secondary) 60%, transparent) 0%, transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.p-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-6) 0;
}

.p-brasao {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.2);
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.p-brasao-fallback {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p-secondary), var(--p-accent));
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.p-titles { flex: 1; min-width: 0; }

.p-org-name {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 4px;
}

.p-org-sub {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
}

.p-org-sub::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--p-secondary);
  vertical-align: middle;
  margin-right: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION — Menu de Modalidades
═══════════════════════════════════════════════════════════════════════════ */
.p-nav {
  background: color-mix(in srgb, var(--p-primary) 88%, var(--ink) 12%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.p-nav::-webkit-scrollbar { display: none; }

.p-nav-inner {
  display: flex;
  gap: 0;
  white-space: nowrap;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.p-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.p-nav-link:hover,
.p-nav-link.active {
  color: #fff;
  border-bottom-color: var(--p-secondary);
}

.p-nav-link.active { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE TITLE BAR — Faixa de título da página
═══════════════════════════════════════════════════════════════════════════ */
.p-pagebar {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--rule);
  padding: var(--s-6) 0;
}

.p-pagebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.p-breadcrumb {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.p-breadcrumb a:hover { color: var(--p-primary); }

.p-page-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.p-page-actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS — Painel de Indicadores
═══════════════════════════════════════════════════════════════════════════ */
.p-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-3);
  margin: var(--s-6) 0;
}

.p-stat {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-5) var(--s-4);
  position: relative;
  transition: all 0.25s ease;
}

.p-stat:hover {
  border-color: var(--p-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.p-stat::before {
  content: '';
  position: absolute;
  top: 0; left: var(--s-4); right: var(--s-4);
  height: 3px;
  background: var(--p-secondary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  opacity: 0;
  transition: opacity 0.25s;
}

.p-stat:hover::before { opacity: 1; }

.p-stat-num {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
  color: var(--p-primary);
  letter-spacing: -0.02em;
}

.p-stat-num.green  { color: var(--green); }
.p-stat-num.amber  { color: var(--amber); }
.p-stat-num.slate  { color: var(--slate); }

.p-stat-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: var(--s-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS — Container base
═══════════════════════════════════════════════════════════════════════════ */
.p-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--s-5);
}

.p-card-head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.p-card-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.p-card-body { padding: var(--s-5); }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER BAR — Busca e Filtros
═══════════════════════════════════════════════════════════════════════════ */
.p-filter {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}

.p-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-3);
  align-items: end;
}

.p-field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.p-field-input,
.p-field-select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.p-field-input:focus,
.p-field-select:focus {
  border-color: var(--p-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-primary) 15%, transparent);
}

.p-filter-actions { display: flex; gap: var(--s-2); }

/* ═══════════════════════════════════════════════════════════════════════════
   ITEM CARD — Cartão de Licitação/Contrato
═══════════════════════════════════════════════════════════════════════════ */
.p-item {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-3);
  transition: all 0.2s ease;
  position: relative;
}

.p-item:hover {
  border-color: var(--p-primary);
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.p-item-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-4);
  align-items: start;
}

.p-item-main { min-width: 0; }

.p-item-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: var(--s-2);
}

.p-item-num {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--p-primary);
  letter-spacing: 0.01em;
}

.p-item-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: var(--s-3);
  letter-spacing: -0.01em;
}

.p-item-meta {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.p-item-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p-item-meta-item svg {
  width: 14px; height: 14px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.p-item-action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES — Etiquetas de Status
═══════════════════════════════════════════════════════════════════════════ */
.p-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--body);
  white-space: nowrap;
}

.p-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.p-badge.aberta,
.p-badge.vigente,
.p-badge.publicada { background: var(--green-bg); color: var(--green); }

.p-badge.andamento { background: var(--blue-bg); color: var(--blue); }

.p-badge.finalizada,
.p-badge.encerrado { background: var(--slate-bg); color: var(--slate); }

.p-badge.suspensa,
.p-badge.aditado { background: var(--amber-bg); color: var(--amber); }

.p-badge.cancelada,
.p-badge.rescindido { background: var(--red-bg); color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════════════════ */
.p-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: var(--body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  text-decoration: none;
  line-height: 1;
}

.p-btn svg { width: 16px; height: 16px; }

.p-btn-primary {
  background: var(--p-primary);
  color: #fff;
  border-color: var(--p-primary);
}
.p-btn-primary:hover {
  background: color-mix(in srgb, var(--p-primary) 85%, var(--ink) 15%);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.p-btn-secondary {
  background: var(--p-secondary);
  color: var(--ink);
  border-color: var(--p-secondary);
  font-weight: 700;
}
.p-btn-secondary:hover {
  background: color-mix(in srgb, var(--p-secondary) 90%, var(--ink) 10%);
  transform: translateY(-1px);
}

.p-btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.p-btn-ghost:hover {
  background: var(--paper-warm);
  border-color: var(--p-primary);
  color: var(--p-primary);
}

.p-btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.p-btn-lg { padding: 14px 24px; font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENT LIST — Lista de Documentos
═══════════════════════════════════════════════════════════════════════════ */
.p-doc {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: var(--s-2);
  transition: all 0.2s;
}

.p-doc:hover {
  background: #fff;
  border-color: var(--p-primary);
  box-shadow: var(--shadow-sm);
}

.p-doc-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.p-doc-info { flex: 1; min-width: 0; }

.p-doc-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.p-doc-meta {
  font-size: 0.74rem;
  color: var(--ink-muted);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════════════════════ */
.p-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--s-5) 0;
  flex-wrap: wrap;
}

.p-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--s-3);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.p-page-link:hover {
  background: var(--paper-warm);
  color: var(--p-primary);
  border-color: var(--p-primary);
}

.p-page-link.active {
  background: var(--p-primary);
  color: #fff;
  border-color: var(--p-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════════════════ */
.p-empty {
  text-align: center;
  padding: var(--s-12) var(--s-5);
  color: var(--ink-muted);
}

.p-empty-icon {
  font-size: 3rem;
  margin-bottom: var(--s-4);
  opacity: 0.4;
}

.p-empty-title {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: var(--s-2);
  font-weight: 500;
}

.p-empty-text {
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════════════════ */
.p-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.55);
  padding: var(--s-10) 0 var(--s-5);
  margin-top: var(--s-11);
}

.p-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-8);
  margin-bottom: var(--s-7);
}

.p-footer-brand {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--s-2);
}

.p-footer-desc {
  font-size: 0.86rem;
  line-height: 1.7;
  max-width: 400px;
}

.p-footer-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: var(--s-3);
}

.p-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.p-footer-links a {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p-footer-links a:hover { color: var(--p-secondary); }

.p-footer-bottom {
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
}

.p-footer-bottom a { color: var(--p-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   REPORTS / CHARTS — Mini gráficos
═══════════════════════════════════════════════════════════════════════════ */
.p-reports {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-4);
}

.p-report-card {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
}

.p-report-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.p-report-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: var(--s-3) 0 var(--s-2);
}

.p-bar-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: 6px;
}

.p-bar-label {
  width: 42px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.p-bar-track {
  flex: 1;
  height: 8px;
  background: var(--rule);
  border-radius: 99px;
  overflow: hidden;
}

.p-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--p-primary), var(--p-secondary));
  border-radius: 99px;
  transition: width 0.6s ease;
}

.p-bar-value {
  width: 28px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

.p-histogram {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  height: 50px;
  align-items: flex-end;
  margin-top: 4px;
}

.p-histogram-bar {
  background: var(--p-primary);
  opacity: 0.85;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: opacity 0.2s, transform 0.2s;
  cursor: default;
}

.p-histogram-bar:hover {
  opacity: 1;
  transform: scaleY(1.05);
  transform-origin: bottom;
}

.p-histogram-bar.empty { background: var(--rule); opacity: 1; }

.p-histogram-labels {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--ink-muted);
  text-align: center;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY BAR
═══════════════════════════════════════════════════════════════════════════ */
.p-a11y {
  position: fixed;
  top: 0; right: 0;
  z-index: 9999;
  display: flex;
  gap: 4px;
  background: rgba(10, 22, 40, 0.94);
  padding: 6px 10px;
  border-radius: 0 0 0 10px;
  backdrop-filter: blur(8px);
}

.p-a11y-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.p-a11y-btn:hover { background: rgba(255, 255, 255, 0.2); }
.p-a11y-btn.on    { background: var(--p-secondary); color: var(--ink); }

body.hi-c { filter: contrast(1.55); }
body.gs   { filter: grayscale(1); }

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING WHATSAPP
═══════════════════════════════════════════════════════════════════════════ */
.p-wa {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 100;
  width: 54px; height: 54px;
  background: #25d366;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.25s;
}
.p-wa:hover { transform: scale(1.1) rotate(-6deg); }
.p-wa svg   { width: 28px; height: 28px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding: 0 var(--s-4); }

  .p-header-inner { gap: var(--s-3); padding: var(--s-4) 0; }
  .p-brasao,
  .p-brasao-fallback { width: 56px; height: 56px; }

  .p-nav-link { padding: var(--s-3) var(--s-3); font-size: 0.8rem; }

  .p-pagebar { padding: var(--s-4) 0; }
  .p-pagebar-inner { flex-direction: column; align-items: stretch; }

  .p-stats { grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
  .p-stat  { padding: var(--s-4) var(--s-3); }

  .p-item-grid { grid-template-columns: 1fr; }
  .p-item-action { align-self: stretch; }
  .p-item-action .p-btn { width: 100%; justify-content: center; }

  .p-card-body { padding: var(--s-4); }

  .p-filter-grid { grid-template-columns: 1fr 1fr; }
  .p-filter-actions { grid-column: 1 / -1; }

  .p-footer-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .p-footer-bottom { flex-direction: column; text-align: center; }

  .p-a11y { display: none; }
}

@media (max-width: 480px) {
  .p-stats { grid-template-columns: 1fr 1fr; }
  .p-filter-grid { grid-template-columns: 1fr; }
  .p-item-meta { gap: var(--s-2); }
  .p-doc-meta { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════════════════════════════ */
@media print {
  .p-nav, .p-a11y, .p-wa, .p-filter, .p-pagination { display: none; }
  .p-header { background: #fff !important; color: #000 !important; }
  .p-org-name, .p-org-sub { color: #000 !important; }
  .p-item { break-inside: avoid; }
}
