/* Painel do Gestor v2 — hierarquia executiva, densidade legível e responsividade real. */

#view-dashboard.pg-v2-view,
#view-relatorios.pg-v2-view,
#view-reuniao.pg-v2-view {
  --pg-v2-surface: rgba(22, 16, 27, .86);
  --pg-v2-surface-strong: rgba(29, 20, 35, .96);
  --pg-v2-line: rgba(216, 205, 223, .14);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: none;
  width: 100%;
  padding-bottom: 40px;
}

.pg-v2-shell-head {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 148px;
  padding: 28px 30px;
  border: 1px solid rgba(212, 175, 55, .24);
  border-radius: 24px;
  background: radial-gradient(circle at 86% 10%, rgba(212, 175, 55, .16), transparent 26%), linear-gradient(135deg, rgba(91, 31, 126, .56), rgba(24, 16, 29, .96) 58%);
}
.pg-v2-shell-head::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -84px;
  width: 240px;
  height: 240px;
  border: 38px solid rgba(255, 255, 255, .035);
  border-radius: 50%;
  pointer-events: none;
}
.pg-v2-shell-copy { position: relative; z-index: 1; max-width: 760px; }
.pg-v2-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #f3d76f; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.pg-v2-shell-copy h2 { margin: 9px 0 7px; color: #fff; font-family: Poppins, Inter, sans-serif; font-size: clamp(23px, 2.1vw, 34px); font-weight: 800; line-height: 1.14; letter-spacing: -.025em; }
.pg-v2-shell-copy p { max-width: 680px; margin: 0; color: #d8cddf; font-size: 14px; line-height: 1.55; }
.pg-v2-shell-status { position: relative; z-index: 1; display: grid; justify-items: end; min-width: 150px; color: #fff; }
.pg-v2-shell-status span { color: #71e4bd; font-size: 11px; font-weight: 800; }
.pg-v2-shell-status span i { margin-right: 6px; font-size: 7px; }
.pg-v2-shell-status strong { margin-top: 7px; font-family: Poppins, sans-serif; font-size: 31px; line-height: 1; }
.pg-v2-shell-status small { margin-top: 4px; color: #b8aabd; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }

.pg-v2-view > .pg-tab-strip { position: sticky; top: 68px; z-index: 18; gap: 4px !important; padding: 6px !important; border-color: var(--pg-v2-line) !important; border-radius: 18px !important; background: rgba(17, 11, 21, .92) !important; box-shadow: 0 12px 28px rgba(0, 0, 0, .16); backdrop-filter: blur(16px); }
.pg-v2-view .pg-tab-btn, .pg-v2-view .pg-tab-apresentar { min-height: 42px; border-radius: 13px !important; }
.pg-v2-view .pg-tab-btn.bg-blue-600 { background: linear-gradient(135deg, #6f2995, #5b1f7e) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 7px 16px rgba(91,31,126,.22); }

#painelGestorEngajamento { margin: 0 !important; padding: 22px !important; border-color: var(--pg-v2-line) !important; border-radius: 24px !important; background: var(--pg-v2-surface) !important; box-shadow: none !important; }
#painelGestorEngajamento > div:first-child { align-items: flex-start !important; padding-bottom: 17px; border-bottom: 1px solid var(--pg-v2-line); }
#painelGestorEngajamento h3 { font-family: Poppins, sans-serif; font-size: 15px !important; letter-spacing: .025em !important; }
#painelGestorEngajamento .pg-btn-recalc { min-height: 32px; padding: 6px 10px; border: 1px solid rgba(216,205,223,.16); border-radius: 9px; color: #cdbfd2; text-decoration: none; }
#painelGestorEngajamento .pg-filtros { justify-content: flex-end; max-width: 880px; }
#painelGestorEngajamento .pg-filtros > * { min-height: 44px; }
#painelGestorEngajamento #pgBusca { flex: 1 1 230px; }
#painelGestorEngajamento select { max-width: 220px; }
#pgKpisFonte { min-height: 18px; }

#pgKpis { display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr)) !important; gap: 10px !important; }
#pgKpis > div { grid-column: span 3; min-height: 126px; padding: 17px !important; border-color: var(--pg-v2-line) !important; border-radius: 18px !important; background: var(--pg-v2-surface-strong) !important; }
#pgKpis > div:nth-child(n+5) { grid-column: span 2; min-height: 100px; padding: 14px !important; background: rgba(18, 12, 23, .64) !important; }
#pgKpis > div > div.mt-1 { font-family: Poppins, sans-serif; font-size: 27px !important; line-height: 1.15; }
#pgKpis > div:nth-child(n+5) > div.mt-1 { font-size: 21px !important; }
#pgKpis > div p:first-child { min-height: 25px; line-height: 1.25; color: #c2b5c7 !important; }

#pgAlertas > div { border-color: rgba(212, 175, 55, .24) !important; border-radius: 20px !important; background: linear-gradient(135deg, rgba(78, 55, 21, .24), rgba(31, 22, 22, .65)) !important; }
#pgBody { padding-top: 4px; }
#pgLista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px !important; }
#pgLista > button { min-height: 74px; padding: 14px 15px !important; border-color: var(--pg-v2-line) !important; border-radius: 16px !important; background: rgba(17, 12, 21, .64) !important; }
#pgLista > button:hover { border-color: rgba(212, 175, 55, .34) !important; background: rgba(40, 28, 47, .8) !important; }
#pgPager { margin-top: 9px; padding-top: 14px !important; border-top: 1px solid var(--pg-v2-line); }
#pgPager button, #pgPager span { min-height: 40px; display: inline-flex; align-items: center; }
#painelRelatorioGestor, #painelReuniaoGestor { width: 100%; }

body.theme-light .pg-v2-view { --pg-v2-surface: rgba(255,255,255,.94); --pg-v2-surface-strong: #fff; --pg-v2-line: rgba(91,31,126,.15); }
body.theme-light .pg-v2-shell-head { background: radial-gradient(circle at 86% 10%, rgba(212,175,55,.18), transparent 28%), linear-gradient(135deg, #6c278e, #4c1b68 68%); }
body.theme-light .pg-v2-view > .pg-tab-strip { background: rgba(255,255,255,.94) !important; }
body.theme-light .pg-v2-view .pg-tab-btn:not(.bg-blue-600) { color: #66566d !important; }
body.theme-light #painelGestorEngajamento { color: #211727; }
body.theme-light #painelGestorEngajamento h3, body.theme-light #pgLista > button p:first-child { color: #211727 !important; }
body.theme-light #painelGestorEngajamento input, body.theme-light #painelGestorEngajamento select { border-color: rgba(91,31,126,.18) !important; background: #fff !important; color: #33243a !important; }
body.theme-light #pgKpis > div, body.theme-light #pgLista > button { box-shadow: 0 8px 22px rgba(55,31,65,.055); }

@media (max-width: 1180px) {
  #pgKpis > div, #pgKpis > div:nth-child(n+5) { grid-column: span 4; }
  #painelGestorEngajamento .pg-filtros { width: 100%; justify-content: stretch; }
  #painelGestorEngajamento .pg-filtros > * { flex: 1 1 180px; max-width: none; }
}
@media (max-width: 820px) {
  #view-dashboard.pg-v2-view, #view-relatorios.pg-v2-view, #view-reuniao.pg-v2-view { gap: 12px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .pg-v2-shell-head { grid-template-columns: 1fr; min-height: auto; gap: 17px; padding: 23px 20px; border-radius: 20px; }
  .pg-v2-shell-copy h2 { font-size: 24px; }
  .pg-v2-shell-status { display: flex; align-items: center; justify-content: space-between; width: 100%; min-width: 0; }
  .pg-v2-shell-status strong { margin: 0 0 0 auto; font-size: 21px; }
  .pg-v2-shell-status small { margin: 0 0 0 7px; }
  .pg-v2-view > .pg-tab-strip { top: 0; overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; }
  .pg-v2-view > .pg-tab-strip::-webkit-scrollbar { display: none; }
  .pg-v2-view .pg-tab-btn { flex: 0 0 auto; padding-inline: 14px !important; }
  .pg-v2-view .pg-tab-apresentar { display: none !important; }
  #painelGestorEngajamento { padding: 17px !important; border-radius: 20px !important; }
  #pgKpis > div, #pgKpis > div:nth-child(n+5) { grid-column: span 6; min-height: 108px; }
  #pgLista { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pg-v2-shell-head { padding: 20px 17px; }
  .pg-v2-shell-copy p { font-size: 13px; }
  .pg-v2-shell-status small { display: none; }
  #painelGestorEngajamento { padding: 14px !important; }
  #painelGestorEngajamento .pg-filtros.is-open { grid-template-columns: 1fr !important; }
  #painelGestorEngajamento .pg-filtros.is-open > * { grid-column: 1 !important; width: 100% !important; }
  #pgKpis > div, #pgKpis > div:nth-child(n+5) { grid-column: span 6; min-height: 96px; padding: 13px !important; }
  #pgKpis > div > div.mt-1, #pgKpis > div:nth-child(n+5) > div.mt-1 { font-size: 22px !important; }
  #pgKpis > div p:first-child { min-height: 30px; font-size: 9px !important; }
  #pgKpis .pg-spark { display: none; }
  #pgPager { align-items: flex-start; }
}
.pg-v2-view :where(button, input, select):focus-visible { outline: 3px solid rgba(243, 215, 111, .9) !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pg-v2-view *, .pg-v2-view *::before, .pg-v2-view *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
