/* =========================================================
   DESIGN TOKENS (mesma paleta do styles_8.css do relatório Quarto)
   ========================================================= */

:root {
  --deep-sea: #001863;
  --tech-blue: #0033FF;
  --pink-nic: #FF3199;
  --mustard: #F0B93D;
  --body-bg: #F1F3FC;
  --card-bg: #FFFFFF;
  --muted-text: #56607A;
  --body-text: #27314F;
  --border-light: #D9E0F5;

  --sidebar-bg: #13152B;
  --sidebar-text: #C7C3E2;
  --sidebar-text-muted: #716D96;
  --sidebar-border: #2C2E52;
  --sidebar-width: 232px;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --soft-shadow: 0 18px 45px rgba(19, 21, 43, 0.10);
  --small-shadow: 0 8px 22px rgba(19, 21, 43, 0.07);

  --font-main: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  background: var(--body-bg);
  color: var(--body-text);
  font-family: var(--font-main);
}

h1, h2, h3, h4 {
  color: var(--deep-sea);
  letter-spacing: -0.02em;
}

a {
  color: var(--tech-blue);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================================================
   APP SHELL / SIDEBAR
   ========================================================= */

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.1rem;
}

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  background: var(--sidebar-bg);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  color: var(--sidebar-text);
  position: sticky;
  top: 1.1rem;
  min-height: calc(100vh - 2.2rem);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.15rem 0.5rem 1.3rem;
}

.sidebar-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  flex: none;
  object-fit: contain;
  background: #FFFFFF;
  padding: 3px;
}

.sidebar-brand-word {
  font-weight: 800;
  font-size: 0.92rem;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  font-size: 0.64rem;
  color: var(--sidebar-text-muted);
  margin-top: 1px;
}

.sidebar-nav {
  overflow-y: auto;
}

.sidebar-group {
  margin-bottom: 1rem;
}

.sidebar-group-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  padding: 0 0.6rem 0.4rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sidebar-text) !important;
  text-decoration: none !important;
  margin-bottom: 2px;
  transition: background 0.12s ease-in-out, color 0.12s ease-in-out;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #FFFFFF !important;
}

.sidebar-item .nav-icon {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.8;
}

.sidebar-item--active,
.sidebar-item--active:hover {
  background: #FFFFFF;
  color: var(--deep-sea) !important;
}

.sidebar-item--active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--pink-nic);
}

.sidebar-footer-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
}

.sidebar-footer-role {
  font-size: 0.64rem;
  color: var(--sidebar-text-muted);
}

.sidebar-footer-link {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--sidebar-text-muted) !important;
  font-weight: 700;
}

.sidebar-footer-link:hover {
  color: #FFFFFF !important;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.3rem 0.4rem 0;
}

.navbar-filter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  box-shadow: var(--small-shadow);
}

.navbar-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-text);
  white-space: nowrap;
}

.navbar-dropdown {
  min-width: 250px;
}

.navbar-dropdown .Select-control,
.navbar-dropdown .select-control {
  border-radius: 999px !important;
  border-color: var(--border-light) !important;
}

.page-content {
  padding: 1.1rem 0.4rem 4rem;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* =========================================================
   HERO
   ========================================================= */

.hero-card {
  display: flex;
  align-items: center;
  gap: 1.8rem;

  padding: 1.8rem 2rem;
  margin-bottom: 1.2rem;

  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--soft-shadow);
}

.hero-logo {
  max-width: 130px;
  max-height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-title {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--deep-sea);
  letter-spacing: -0.03em;
}

.hero-subtitle {
  margin: 0.35rem 0 0.7rem 0;
  color: var(--muted-text);
  font-size: 1.02rem;
}

.report-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 51, 255, 0.08);
  color: var(--deep-sea);
  font-size: 0.8rem;
  font-weight: 700;
}

/* =========================================================
   KPI GRID
   ========================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.4rem 0;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--small-shadow);
  padding: 1.05rem 1.2rem;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-text);
}

.kpi-value {
  margin-top: 0.3rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--deep-sea);
  font-variant-numeric: tabular-nums;
}

.kpi-card--pink {
  background: #FFD8EA;
  border-color: transparent;
}

.kpi-card--pink .kpi-label,
.kpi-card--pink .kpi-value {
  color: #7A0C40;
}

.kpi-card--mustard {
  background: #FBE7B8;
  border-color: transparent;
}

.kpi-card--mustard .kpi-label,
.kpi-card--mustard .kpi-value {
  color: #6B4B05;
}

.kpi-card--navy {
  background: var(--sidebar-bg);
  border-color: transparent;
}

.kpi-card--navy .kpi-label {
  color: var(--sidebar-text-muted);
}

.kpi-card--navy .kpi-value {
  color: #FFFFFF;
}

.score-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.1rem 0 1rem;
  margin-bottom: 0.2rem;
}

.score-stat {
  flex: 1 1 108px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  box-shadow: var(--small-shadow);
}

.score-stat .kpi-value {
  font-size: 1.2rem;
  margin-top: 0.15rem;
}

.score-stat--low { border-top-color: var(--pink-nic); background: #FFF6FA; }
.score-stat--mid { border-top-color: var(--mustard); background: #FFFBF0; }
.score-stat--high { border-top-color: var(--tech-blue); background: #F5F7FF; }

/* =========================================================
   CALLOUT / CARD / SECTION TITLE
   ========================================================= */

.callout {
  padding: 1rem 1.15rem;
  margin: 0.4rem 0 1.4rem 0;

  background: rgba(255, 238, 0, 0.12);
  border: 1px solid rgba(255, 238, 0, 0.45);
  border-radius: var(--radius-md);

  color: var(--deep-sea);
  font-size: 0.95rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--small-shadow);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--body-text);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--deep-sea);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
  margin: 0.6rem 0 1.1rem 0;
}

.section-title::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--pink-nic);
  box-shadow: 0 0 0 5px rgba(255, 49, 153, 0.12);
}

.caption {
  color: var(--muted-text);
  font-size: 0.9rem;
}

/* =========================================================
   TABS
   ========================================================= */

.report-tabs {
  margin-bottom: 0.9rem !important;
  border-bottom: none !important;
  display: flex !important;
  flex-wrap: wrap !important;
  row-gap: 0.35rem;
}

.report-tab {
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 0.5rem 1.05rem !important;
  margin-right: 0.4rem !important;
  background: transparent !important;
  color: var(--tech-blue) !important;
  font-weight: 700 !important;
  font-family: var(--font-main) !important;
}

.report-tab--selected {
  background: #FFFFFF !important;
  color: var(--deep-sea) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--small-shadow);
  font-weight: 800 !important;
}

/* =========================================================
   CHARTS
   ========================================================= */

.chart-card {
  padding: 0.75rem !important;
  overflow: hidden;
}

/* =========================================================
   ANÁLISE DE TEXTO (TEMAS DE DESENVOLVIMENTO)
   ========================================================= */

.text-analysis-controls {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.dev-fields-checklist,
.dev-ngram-radio {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--body-text);
}

.dev-fields-checklist label,
.dev-ngram-radio label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1;
  margin-right: 0.4rem;
}

.badge-blue {
  background: rgba(0, 51, 255, 0.10);
  color: var(--tech-blue);
}

.badge-pink {
  background: rgba(255, 49, 153, 0.12);
  color: var(--pink-nic);
}

.badge-yellow {
  background: rgba(255, 187, 0, 0.18);
  color: #7A5B00;
}

.badge-neutral {
  background: var(--border-light);
  color: var(--muted-text);
}

/* =========================================================
   ANÁLISE INDIVIDUAL
   ========================================================= */

.individual-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 1.6rem;
  margin: 0.2rem 0 1.1rem 0;
}

.individual-toolbar-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.colaborador-dropdown {
  min-width: 320px;
}

.employee-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;

  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--small-shadow);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
}

.employee-name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--deep-sea);
}

.employee-role {
  margin: 0.2rem 0 0 0;
  color: var(--muted-text);
  font-size: 0.9rem;
}

.employee-meta {
  margin: 0.15rem 0 0 0;
  color: var(--muted-text);
  font-size: 0.78rem;
  opacity: 0.75;
}

.employee-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.individual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.methodology-card {
  grid-column: 1 / -1;
}

.methodology-title {
  margin: 0 0 0.6rem 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--deep-sea);
}

.methodology-legend {
  list-style: none;
  margin: 0.9rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
}

.methodology-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.methodology-summary {
  margin: 0.9rem 0 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-light);
}

.criteria-accordion-item {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--small-shadow);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
}

.criteria-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--deep-sea);
  list-style: none;
}

.criteria-summary::-webkit-details-marker {
  display: none;
}

.criteria-summary::before {
  content: "▸";
  color: var(--pink-nic);
  font-size: 0.85rem;
  transition: transform 0.15s ease-in-out;
}

.criteria-accordion-item[open] .criteria-summary::before {
  transform: rotate(90deg);
}

.criteria-name {
  flex: 1;
  font-size: 1rem;
}

.criteria-body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.criteria-body p {
  margin: 0;
  line-height: 1.55;
}

.dev-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.expectation-card {
  grid-column: 1 / -1;
  background: rgba(0, 51, 255, 0.04);
}

.expectation-text {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--deep-sea);
  line-height: 1.6;
}

/* =========================================================
   GUIA DE CRITÉRIOS (painel lateral)
   ========================================================= */

.guide-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-main);
  color: var(--tech-blue);
  box-shadow: var(--small-shadow);
  cursor: pointer;
}

.guide-trigger:hover {
  background: rgba(0, 51, 255, 0.05);
}

.guide-qmark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tech-blue);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
}

.guide-panel--open {
  display: block;
}

.guide-scrim {
  position: absolute;
  inset: 0;
  background: rgba(19, 21, 43, 0.42);
  border: none;
  padding: 0;
  cursor: pointer;
}

.guide-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 92vw;
  background: var(--card-bg);
  box-shadow: -24px 0 60px rgba(19, 21, 43, 0.28);
  border-radius: 16px 0 0 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.guide-drawer-head {
  flex: none;
  padding: 1.1rem 1.3rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.guide-drawer-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.guide-drawer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--deep-sea);
  margin: 0;
}

.guide-drawer-sub {
  font-size: 0.8rem;
  color: var(--muted-text);
  margin: 0.3rem 0 0;
  line-height: 1.5;
}

.guide-close {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--card-bg);
  color: var(--muted-text);
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.guide-jump-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.guide-jump-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tech-blue) !important;
  background: rgba(0, 51, 255, 0.07);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  text-decoration: none !important;
}

.guide-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.3rem 2rem;
}

.guide-section {
  margin-bottom: 1.7rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 1rem;
}

.guide-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-section h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--deep-sea);
  margin: 0 0 0.5rem;
}

.guide-section p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--body-text);
  margin: 0 0 0.6rem;
}

.guide-legend {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.guide-formula {
  background: #F5F7FF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.74rem;
  color: var(--deep-sea);
  font-family: Consolas, monospace;
  margin: 0 0 0.5rem;
}

.guide-crit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.guide-crit-table th {
  text-align: left;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-text);
  padding: 0 0.4rem 0.35rem;
  border-bottom: 1px solid var(--border-light);
}

.guide-crit-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.guide-crit-table tr:last-child td {
  border-bottom: none;
}

.guide-crit-name {
  font-weight: 700;
  color: var(--deep-sea);
  white-space: nowrap;
}

.guide-nb-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.4rem;
  margin: 0.7rem 0;
}

.guide-nb-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted-text);
  letter-spacing: 0.05em;
}

.guide-nb-xlabel {
  grid-column: 2;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted-text);
  letter-spacing: 0.05em;
}

.guide-nb-grid {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.guide-nb-cell {
  border-radius: 6px;
  padding: 0.4rem 0.3rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  font-size: 0.62rem;
  font-weight: 700;
}

.guide-nb-pink {
  background: #FFD8EA;
  color: #7A0C40;
}

.guide-nb-yellow {
  background: #FBE7B8;
  color: #6B4B05;
}

.guide-nb-blue {
  background: #DDE3FF;
  color: #0022A8;
}

@media (max-width: 900px) {
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell {
    flex-direction: column;
    padding: 0.7rem;
  }

  .sidebar {
    width: 100%;
    position: static;
    min-height: 0;
  }

  .page-content {
    padding: 1.25rem 0.4rem 3rem;
  }

  .individual-grid,
  .dev-grid {
    grid-template-columns: 1fr;
  }

  .colaborador-dropdown {
    min-width: 220px;
  }
}
