/* ============================================
   GVI PAINEL — Design System v3 (Swiss Tech Remix)
   High-precision layout, softly rounded geometry (12px radius),
   unified GVI brand identity (amber, charcoal, warm neutral).
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --pn-primary: #ea580c;
  --pn-primary-light: #f97316;
  --pn-primary-bg: #fff7ed;
  --pn-accent: #ea580c;
  --pn-accent-soft: #fed7aa;
  --pn-gold: #fbbf24;
  --pn-bg: #faf8f6;
  --pn-surface: #ffffff;
  --pn-surface-alt: #fcfbfa;
  --pn-border: #e7e2dd;
  --pn-border-light: #f3eee9;
  --pn-text: #1e120c;
  --pn-text-secondary: #5c4d44;
  --pn-text-muted: #9a8b80;
  --pn-success: #10b981;
  --pn-danger: #ef4444;
  --pn-warning: #f59e0b;
  --pn-radius: 12px;
  --pn-radius-sm: 8px;
  --pn-shadow: 0 1px 2px rgba(30,18,12,0.02), 0 0 0 1px rgba(30,18,12,0.04);
  --pn-shadow-md: 0 4px 12px rgba(30,18,12,0.04), 0 0 0 1px rgba(30,18,12,0.06);
  --pn-shadow-lg: 0 12px 32px rgba(30,18,12,0.08), 0 0 0 1px rgba(30,18,12,0.08);
  --pn-transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Base ── */
.painel-page {
  margin: 0;
  padding: 0;
  background: var(--pn-bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--pn-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.pn-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(18, 11, 8, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pn-navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.pn-navbar-brand .pn-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--pn-radius-sm);
  background: linear-gradient(135deg, #fbbf24, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.pn-navbar-brand span {
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.pn-navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pn-navbar-links a {
  padding: 8px 16px;
  border-radius: var(--pn-radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all var(--pn-transition);
}

.pn-navbar-links a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.05);
}

.pn-navbar-links a.active {
  color: #ffffff;
  background: var(--pn-primary);
}

/* ── Layout ── */
.pn-layout {
  display: flex;
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 40px;
  gap: 40px;
  box-sizing: border-box;
}

/* ── Sidebar ── */
.pn-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pn-sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--pn-radius-sm);
  cursor: pointer;
  transition: all var(--pn-transition);
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--pn-text-secondary);
  box-sizing: border-box;
}

.pn-sidebar-item:hover {
  background: var(--pn-surface-alt);
  color: var(--pn-text);
  border-left-color: var(--pn-border);
}

.pn-sidebar-item.active {
  background: var(--pn-primary-bg);
  border-left-color: var(--pn-primary);
  color: var(--pn-primary);
  font-weight: 700;
}

.pn-sidebar-item .pn-sidebar-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--pn-radius-sm);
  background: var(--pn-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--pn-transition);
}

.pn-sidebar-item.active .pn-sidebar-icon {
  background: linear-gradient(135deg, #fbbf24, #ea580c);
}

.pn-sidebar-item .pn-sidebar-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--pn-text-secondary);
  transition: all var(--pn-transition);
}

.pn-sidebar-item.active .pn-sidebar-icon svg {
  stroke: #ffffff;
}

.pn-sidebar-item:hover .pn-sidebar-icon {
  background: var(--pn-accent-soft);
}

.pn-sidebar-item:hover .pn-sidebar-icon svg {
  stroke: var(--pn-primary);
}

/* ── Main Content ── */
.pn-main {
  flex: 1;
  min-width: 0;
}

.pn-section {
  display: none;
}

/* Cascade animation for direct children of active sections */
.pn-section.active {
  display: block;
}

.pn-section.active > * {
  animation: pnFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pn-section.active > *:nth-child(1) { animation-delay: 0.04s; }
.pn-section.active > *:nth-child(2) { animation-delay: 0.08s; }
.pn-section.active > *:nth-child(3) { animation-delay: 0.12s; }
.pn-section.active > *:nth-child(4) { animation-delay: 0.16s; }
.pn-section.active > *:nth-child(5) { animation-delay: 0.20s; }
.pn-section.active > *:nth-child(6) { animation-delay: 0.24s; }

@keyframes pnFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Section Header ── */
.pn-section-header {
  text-align: left;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--pn-border);
  padding-bottom: 16px;
}

.pn-section-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--pn-text);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  letter-spacing: -0.02em;
}

.pn-section-header h2 svg {
  width: 24px;
  height: 24px;
  stroke: var(--pn-primary);
}

.pn-section-header .pn-header-line {
  display: none; /* Removed in favor of full width bottom border */
}

/* ── Cards ── */
.pn-card {
  background: var(--pn-surface);
  border-radius: var(--pn-radius);
  border: 1px solid var(--pn-border);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--pn-shadow);
  transition: all var(--pn-transition);
}

.pn-card:hover {
  box-shadow: var(--pn-shadow-md);
  border-color: var(--pn-text-muted);
}

.pn-card-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--pn-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pn-card-label svg {
  width: 14px;
  height: 14px;
  stroke: var(--pn-text-muted);
}

.pn-card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--pn-text);
}

/* ── Select ── */
.pn-select-wrapper {
  position: relative;
}

.pn-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  background: var(--pn-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--pn-text);
  appearance: none;
  cursor: pointer;
  transition: all var(--pn-transition);
}

.pn-select:focus {
  outline: none;
  border-color: var(--pn-primary);
  box-shadow: 0 0 0 2px var(--pn-accent-soft);
}

.pn-select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--pn-text-muted);
  font-size: 10px;
}

/* ── Text Input ── */
.pn-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  background: var(--pn-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--pn-text);
  transition: all var(--pn-transition);
  box-sizing: border-box;
}

.pn-input:focus {
  outline: none;
  border-color: var(--pn-primary);
  box-shadow: 0 0 0 2px var(--pn-accent-soft);
}

.pn-input::placeholder {
  color: var(--pn-text-muted);
  font-weight: 400;
}

/* ── Typeahead Autocomplete ── */
.pn-typeahead-wrapper {
  position: relative;
}

/* Garante o empilhamento correto dos cards de filtro para que o dropdown de municípios sobreponha a eleição e botões */
#sec-municipio > .pn-card:nth-of-type(1) { position: relative; z-index: 3; }
#sec-municipio > .pn-card:nth-of-type(2) { position: relative; z-index: 4; }
#sec-municipio > .pn-card:nth-of-type(3) { position: relative; z-index: 2; }

.pn-typeahead-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 110;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  box-shadow: var(--pn-shadow-lg);
  max-height: 280px;
  overflow-y: auto;
}

.pn-ta-item {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--pn-text);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--pn-border-light);
}

.pn-ta-item:last-child {
  border-bottom: none;
}

.pn-ta-item:hover {
  background: var(--pn-primary-bg);
  color: var(--pn-primary);
}

.pn-ta-item strong {
  color: var(--pn-primary);
  font-weight: 800;
}

.pn-ta-item.pn-ta-empty {
  color: var(--pn-text-muted);
  font-style: italic;
  cursor: default;
  padding: 16px;
}

.pn-ta-item.pn-ta-empty:hover {
  background: transparent;
}

/* ── Search Input ── */
.pn-search {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  background: var(--pn-surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--pn-text);
  transition: all var(--pn-transition);
  box-sizing: border-box;
}

.pn-search:focus {
  outline: none;
  border-color: var(--pn-primary);
  box-shadow: 0 0 0 2px var(--pn-accent-soft);
}

.pn-search-wrapper {
  position: relative;
}

.pn-search-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--pn-text-muted);
  pointer-events: none;
}

/* ── Button ── */
.pn-btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--pn-radius-sm);
  background: linear-gradient(135deg, var(--pn-primary-light), var(--pn-primary));
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--pn-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.2);
}

.pn-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.3);
}

.pn-btn:active {
  transform: translateY(0) scale(0.99);
}

.pn-btn-outline {
  background: var(--pn-surface);
  color: var(--pn-primary);
  border: 1px dashed var(--pn-accent-soft);
  box-shadow: none;
}

.pn-btn-outline:hover {
  background: var(--pn-primary-bg);
  border-color: var(--pn-primary);
  transform: none;
  box-shadow: none;
}

/* ── Source Footnote ── */
.pn-source {
  text-align: left;
  font-size: 11px;
  color: var(--pn-text-muted);
  margin-top: 24px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--pn-border-light);
  padding-top: 14px;
}

/* ── Analysis List ── */
.pn-analysis-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--pn-surface);
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--pn-transition);
}

.pn-analysis-item:hover {
  border-color: var(--pn-primary);
  box-shadow: var(--pn-shadow-md);
  transform: translateY(-1px);
}

.pn-analysis-item .pn-ai-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--pn-radius-sm);
  background: var(--pn-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pn-analysis-item .pn-ai-icon span {
  font-size: 16px;
}

.pn-analysis-item .pn-ai-info {
  flex: 1;
  min-width: 0;
}

.pn-analysis-item .pn-ai-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pn-text);
  letter-spacing: -0.01em;
}

.pn-analysis-item .pn-ai-sub {
  font-size: 11px;
  color: var(--pn-primary);
  font-weight: 700;
  margin-top: 2px;
}

.pn-analysis-item .pn-ai-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pn-analysis-item .pn-ai-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--pn-radius-sm);
  color: var(--pn-text-muted);
  transition: all var(--pn-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pn-analysis-item .pn-ai-actions button:hover {
  background: var(--pn-primary-bg);
  color: var(--pn-primary);
}

/* ── Results Container ── */
.pn-results {
  display: none;
}

.pn-results.visible {
  display: block;
}

.pn-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.pn-kpi {
  background: var(--pn-surface);
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius);
  padding: 24px 20px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: all var(--pn-transition);
  box-shadow: var(--pn-shadow);
}

.pn-kpi:hover {
  box-shadow: var(--pn-shadow-md);
  transform: translateY(-1px);
}

.pn-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--pn-primary);
}

.pn-kpi:nth-child(2)::before { background: #3b82f6; }
.pn-kpi:nth-child(3)::before { background: #10b981; }
.pn-kpi:nth-child(4)::before { background: #ef4444; }

.pn-kpi-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--pn-text);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.pn-kpi-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--pn-text-muted);
  text-transform: uppercase;
  margin-top: 6px;
  letter-spacing: 0.08em;
}

.pn-kpi-sub {
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
}

/* ── Candidate Card ── */
.pn-cand-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--pn-surface);
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--pn-transition);
  box-shadow: var(--pn-shadow);
}

.pn-cand-card:hover {
  border-color: var(--pn-primary);
  box-shadow: var(--pn-shadow-md);
  transform: translateY(-1px);
}

.pn-cand-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--pn-border);
  transition: all var(--pn-transition);
}

.pn-cand-card:hover img {
  border-color: var(--pn-primary);
}

.pn-cand-card .pn-cc-info {
  flex: 1;
}

.pn-cand-card .pn-cc-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--pn-text);
  letter-spacing: -0.01em;
}

.pn-cand-card .pn-cc-detail {
  font-size: 12px;
  color: var(--pn-text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.pn-cand-card .pn-cc-votes {
  font-size: 20px;
  font-weight: 900;
  color: var(--pn-primary);
  letter-spacing: -0.03em;
}

/* ── Comparison Widget ── */
.pn-comp-new {
  border: 1px dashed var(--pn-accent-soft);
  background: var(--pn-primary-bg);
  padding: 24px;
  border-radius: var(--pn-radius);
  text-align: left;
  cursor: pointer;
  transition: all var(--pn-transition);
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.pn-comp-new:hover {
  border-color: var(--pn-primary);
  background: #ffedd5;
}

.pn-comp-new .pn-comp-plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #ea580c);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.pn-comp-new .pn-comp-text strong {
  display: block;
  font-size: 14px;
  color: var(--pn-primary);
  margin-bottom: 2px;
}

.pn-comp-new .pn-comp-text span {
  font-size: 12px;
  color: var(--pn-text-secondary);
  font-weight: 500;
}

/* ── Empty State ── */
.pn-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--pn-text-muted);
}

.pn-empty svg {
  width: 40px;
  height: 40px;
  stroke: var(--pn-border);
  margin-bottom: 16px;
}

.pn-empty p {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

/* ── Chart Card ── */
.pn-chart-card {
  background: var(--pn-surface);
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--pn-shadow);
  transition: all var(--pn-transition);
}

.pn-chart-card:hover {
  box-shadow: var(--pn-shadow-md);
  border-color: var(--pn-border);
}

.pn-chart-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--pn-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pn-chart-title .pn-ct-bar {
  width: 3px;
  height: 14px;
  border-radius: var(--pn-radius-sm);
  flex-shrink: 0;
}

/* ── Ranking Table ── */
.pn-ranking {
  width: 100%;
  border-collapse: collapse;
}

.pn-ranking th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  color: var(--pn-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--pn-border);
  background: var(--pn-surface-alt);
}

.pn-ranking td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--pn-border-light);
  vertical-align: middle;
  font-weight: 500;
  color: var(--pn-text-secondary);
}

.pn-ranking tr:hover td {
  background: var(--pn-primary-bg);
  color: var(--pn-text);
}

.pn-ranking .pn-rank-pos {
  font-weight: 800;
  color: var(--pn-primary);
  width: 48px;
}

.pn-ranking .pn-rank-name {
  font-weight: 700;
  color: var(--pn-text);
}

.pn-ranking .pn-rank-votes {
  font-weight: 800;
  color: var(--pn-text);
  text-align: right;
}

/* ── Toolbar ── */
.pn-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pn-toolbar .pn-search-wrapper {
  flex: 1;
}

.pn-toolbar button {
  padding: 12px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  background: var(--pn-surface);
  cursor: pointer;
  color: var(--pn-text-secondary);
  transition: all var(--pn-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pn-toolbar button:hover {
  border-color: var(--pn-primary);
  color: var(--pn-primary);
  background: var(--pn-primary-bg);
}

/* ── Miscellaneous ── */
.pn-saved-count {
  font-size: 11px;
  color: var(--pn-text-muted);
  text-align: left;
  margin-top: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pn-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--pn-border);
  border-top-color: var(--pn-primary);
  border-radius: 50%;
  animation: pnSpin 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 40px auto;
}

@keyframes pnSpin {
  to { transform: rotate(360deg); }
}

.pn-inline-selects {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.pn-inline-selects .pn-card {
  flex: 1;
  margin-bottom: 0;
}

/* ── Mobile Layout ── */
@media (max-width: 768px) {
  .pn-layout {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }
  .pn-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pn-border);
    -webkit-overflow-scrolling: touch;
  }
  .pn-sidebar-item {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 11px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .pn-sidebar-item:hover {
    border-left-color: transparent;
    border-bottom-color: var(--pn-border);
  }
  .pn-sidebar-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--pn-primary);
  }
  .pn-sidebar-item .pn-sidebar-icon {
    width: 26px;
    height: 26px;
  }
  .pn-sidebar-item .pn-sidebar-icon svg {
    width: 14px;
    height: 14px;
  }
  .pn-kpi-grid {
    grid-template-columns: 1fr;
  }
  .pn-grid-2cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pn-inline-selects {
    flex-direction: column;
    gap: 12px;
  }
  .pn-navbar {
    padding: 0 20px;
  }
}

.pn-grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 480px) {
  .pn-section-header h2 {
    font-size: 18px;
  }
  .pn-kpi-value {
    font-size: 24px;
  }
}

/* ============================================
   GVI CUSTOM SELECT — Estética Premium
   ============================================ */

/* Wrapper que envolve o select original (oculto) e a estrutura nova */
.pn-custom-select-container {
  position: relative;
  width: 100%;
}

/* Ocultar o select nativo de forma acessível */
.pn-custom-select-container select.pn-select {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0 !important;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

/* O gatilho visual que simula o select */
.pn-custom-select-trigger {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  background: var(--pn-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--pn-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--pn-transition);
  box-sizing: border-box;
  user-select: none;
}

.pn-custom-select-trigger:hover {
  border-color: var(--pn-text-muted);
  background: var(--pn-surface-alt);
}

.pn-custom-select-container.open .pn-custom-select-trigger {
  border-color: var(--pn-primary);
  box-shadow: 0 0 0 2px var(--pn-accent-soft);
  background: var(--pn-surface);
}

/* Seta de indicação */
.pn-custom-select-trigger .pn-cs-arrow {
  color: var(--pn-text-muted);
  font-size: 9px;
  transition: transform var(--pn-transition);
}

.pn-custom-select-container.open .pn-custom-select-trigger .pn-cs-arrow {
  transform: rotate(180deg);
  color: var(--pn-primary);
}

/* Dropdown suspenso */
.pn-custom-select-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 150;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-sm);
  box-shadow: var(--pn-shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  padding: 4px;
}

.pn-custom-select-container.open .pn-custom-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Item de opção dentro do dropdown */
.pn-cs-item {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pn-text);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.pn-cs-item:last-child {
  margin-bottom: 0;
}

.pn-cs-item:hover {
  background: var(--pn-primary-bg);
  color: var(--pn-primary);
}

.pn-cs-item.selected {
  background: var(--pn-primary);
  color: #ffffff;
  font-weight: 600;
}

/* Quando o select nativo está desativado (disabled) */
.pn-custom-select-container.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.pn-custom-select-container.disabled .pn-custom-select-trigger {
  background: var(--pn-border-light);
  border-color: var(--pn-border-light);
  color: var(--pn-text-muted);
  cursor: not-allowed;
}

/* Card em foco durante a abertura do select para sobreposição correta */
.pn-card:has(.pn-custom-select-container.open),
.pn-card.focus-select {
  position: relative !important;
  z-index: 9999 !important;
}

.pn-select-wrapper:has(.pn-custom-select-container.open) {
  position: relative !important;
  z-index: 9999 !important;
}

.pn-custom-select-container.open {
  position: relative !important;
  z-index: 9999 !important;
}

.pn-custom-select-container.open .pn-custom-select-dropdown {
  z-index: 99999 !important;
}


