/* ═══════════════════════════════════════════════════════════════════
   PROFILE INLINE EDIT — Sistema de Edição Inline por Seção
   Estilo: LinkedIn / Notion / Linear
   Versão: 1.0
   Arquivo: profile_inline_edit.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── HERO DO PERFIL (COVER + AVATAR) ─────────────────────────────── */
.pie-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--tr-card-bg, #fff);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
}

/* Cover Photo */
.pie-cover {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 35%, #1d4ed8 70%, #7c3aed 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.pie-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 60%, rgba(99,102,241,0.4) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(16,185,129,0.25) 0%, transparent 40%),
    radial-gradient(circle at 55% 85%, rgba(245,158,11,0.18) 0%, transparent 35%);
}

.pie-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* Corpo do hero (abaixo da capa) */
.pie-hero-body {
  background: var(--tr-card-bg, #fff);
  padding: 0 2rem 1.5rem;
  position: relative;
}

/* Linha com avatar + ações */
.pie-hero-top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
}

/* Avatar grande sobrepostos ao cover */
.pie-avatar-wrap {
  position: relative;
  margin-top: -52px;
  z-index: 10;
  flex-shrink: 0;
  cursor: pointer;
}

.pie-avatar-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #2563eb, #7c3aed, #10b981);
  box-shadow: 0 4px 20px rgba(37,99,235,0.3), 0 0 0 4px var(--tr-card-bg, #fff);
  transition: all 0.22s;
}

.pie-avatar-ring:hover {
  box-shadow: 0 8px 28px rgba(37,99,235,0.45), 0 0 0 4px var(--tr-card-bg, #fff);
  transform: scale(1.04);
}

.pie-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.pie-avatar-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 3px solid var(--tr-card-bg, #fff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.72rem;
  box-shadow: 0 2px 8px rgba(37,99,235,0.4);
  transition: all 0.22s;
  pointer-events: none;
}

.pie-avatar-wrap:hover .pie-avatar-badge {
  transform: scale(1.15);
}

/* Overlay de hover no avatar */
.pie-avatar-overlay {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(0,0,0,0.48);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.22s;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}
.pie-avatar-wrap:hover .pie-avatar-overlay { opacity: 1; }
.pie-avatar-overlay i { font-size: 1.2rem; }

/* Botões de ação no topo direito do hero */
.pie-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 0.75rem;
  flex-wrap: wrap;
}

/* Identidade: nome, cargo, diretoria */
.pie-identity {
  margin-bottom: 0.9rem;
}

.pie-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin: 0 0 3px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

[data-theme="dark"] .pie-name { color: #f1f5f9; }

.pie-tagline {
  font-size: 0.98rem;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 5px;
}

.pie-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 16px;
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 8px;
}

.pie-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pie-meta-item i { font-size: 0.72rem; color: #94a3b8; }

.pie-bio {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.65;
  max-width: 640px;
  margin-top: 6px;
}

[data-theme="dark"] .pie-bio { color: #94a3b8; }

/* Skills no hero */
.pie-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pie-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1.5px solid;
  transition: all 0.2s;
}

.pie-skill-chip:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Barra de completude compacta no hero */
.pie-completion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--tr-slate-50, #f8fafc);
  border-radius: 12px;
  border: 1px solid var(--tr-slate-200, #e2e8f0);
  cursor: pointer;
  transition: all 0.2s;
}

.pie-completion-row:hover {
  border-color: #2563eb;
  background: rgba(37,99,235,0.04);
}

.pie-completion-pct {
  font-size: 1rem;
  font-weight: 900;
  min-width: 40px;
  color: #2563eb;
  letter-spacing: -0.3px;
}

.pie-completion-pct.green { color: #10b981; }
.pie-completion-pct.amber { color: #f59e0b; }
.pie-completion-pct.red   { color: #ef4444; }

.pie-completion-bar-track {
  flex: 1;
  height: 6px;
  background: var(--tr-slate-200, #e2e8f0);
  border-radius: 100px;
  overflow: hidden;
}

.pie-completion-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.pie-completion-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: pie-shimmer 2.2s ease-in-out infinite;
}

@keyframes pie-shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

.pie-completion-bar-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.pie-completion-bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.pie-completion-bar-fill.red   { background: linear-gradient(90deg, #ef4444, #dc2626); }

.pie-completion-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

/* ── BARRA DE CONTROLE SIMPLIFICADA ─────────────────────────────── */
.pie-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 14px 20px;
  background: var(--tr-card-bg, #fff);
  border-radius: 14px;
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pie-control-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pie-control-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin: 0;
  letter-spacing: -0.2px;
}

.pie-control-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.pie-control-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── SISTEMA DE EDIÇÃO INLINE POR SEÇÃO ─────────────────────────── */

/* Botão de edição inline no header da seção */
.pie-section-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid rgba(37,99,235,0.22);
  background: rgba(37,99,235,0.06);
  color: #2563eb;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.pie-section-edit-btn:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

/* Container de visualização dos dados (read-only) */
.pie-view-content {
  display: block;
}

/* Container dos inputs de edição (hidden por padrão) */
.pie-edit-panel {
  display: none;
  border-top: 1.5px dashed var(--tr-slate-200, #e2e8f0);
  margin-top: 1rem;
  padding-top: 1.25rem;
  animation: pie-edit-slide-down 0.22s ease forwards;
}

@keyframes pie-edit-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Quando a seção está em modo edição */
.pie-section-active {
  border-color: rgba(37,99,235,0.35) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.06), 0 4px 16px rgba(0,0,0,0.07) !important;
}

.pie-section-active .pie-edit-panel { display: block; }
.pie-section-active .pie-view-content { display: block; }

/* Ações de edição por seção (salvar/cancelar inline) */
.pie-section-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tr-slate-100, #f1f5f9);
}

.pie-btn-save-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 3px 10px rgba(16,185,129,0.3);
  transition: all 0.2s;
}

.pie-btn-save-section:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16,185,129,0.4);
}

.pie-btn-save-section:active { transform: translateY(1px); }

.pie-btn-save-section.saving {
  opacity: 0.75;
  pointer-events: none;
}

.pie-btn-cancel-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  background: transparent;
  color: #64748b;
  transition: all 0.2s;
}

.pie-btn-cancel-section:hover {
  background: var(--tr-slate-50, #f8fafc);
  border-color: #94a3b8;
  color: #1e293b;
}

/* Indicador de save inline */
.pie-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.pie-save-indicator.visible { opacity: 1; }
.pie-save-indicator.saved   { color: #10b981; background: rgba(16,185,129,0.1); }
.pie-save-indicator.saving  { color: #f59e0b; background: rgba(245,158,11,0.1); }
.pie-save-indicator.error   { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ── VIEW MODE: DADOS FORMATADOS POR SEÇÃO ───────────────────────── */

/* — Informações Básicas (view) — */
.pie-view-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 8px;
}

.pie-view-contact-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  color: #374151;
  font-weight: 500;
}

.pie-view-contact-item i {
  width: 18px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
}

.pie-view-bio-text {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.7;
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--tr-slate-50, #f8fafc);
  border-radius: 10px;
  border-left: 3px solid #2563eb;
  font-style: italic;
}

[data-theme="dark"] .pie-view-bio-text {
  color: #94a3b8;
  background: rgba(37,99,235,0.06);
}

.pie-view-empty {
  font-size: 0.82rem;
  color: #94a3b8;
  font-style: italic;
  padding: 8px 0;
}

/* — Lotação (view) — */
.pie-dept-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(139,92,246,0.08);
  border: 1.5px solid rgba(139,92,246,0.2);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #7c3aed;
}

.pie-dept-badge i { font-size: 0.85rem; }

/* — Conexões (view) — */
.pie-connections-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pie-connection-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: 1.5px solid;
}

.pie-connection-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.pie-link-linkedin {
  background: rgba(10,102,194,0.07);
  color: #0A66C2;
  border-color: rgba(10,102,194,0.25);
}

.pie-link-linkedin:hover {
  background: #0A66C2;
  color: white;
  border-color: #0A66C2;
}

.pie-link-lattes {
  background: rgba(220,38,38,0.07);
  color: #DC2626;
  border-color: rgba(220,38,38,0.22);
}

.pie-link-lattes:hover {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}

.pie-link-cv {
  background: rgba(16,185,129,0.07);
  color: #059669;
  border-color: rgba(16,185,129,0.22);
}

.pie-link-cv:hover {
  background: #059669;
  color: white;
  border-color: #059669;
}

/* — Proficiências (view) — */
.pie-skills-view-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* — Timeline: Formação / Experiência (view) — */
.pie-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pie-timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 1.25rem;
  position: relative;
}

.pie-timeline-item:last-child { padding-bottom: 0; }

/* Linha vertical */
.pie-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--tr-slate-200, #e2e8f0);
  border-radius: 2px;
}

.pie-timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1.5px solid;
  background: white;
}

.pie-timeline-dot.edu    { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.pie-timeline-dot.exp    { color: #f97316; border-color: rgba(249,115,22,0.3); background: rgba(249,115,22,0.08); }
.pie-timeline-dot.cert   { color: #10b981; border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }

[data-theme="dark"] .pie-timeline-dot { background: #1e293b; }

.pie-timeline-content { flex: 1; min-width: 0; padding-top: 4px; }

.pie-timeline-main {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main, #1e293b);
  line-height: 1.3;
  margin-bottom: 2px;
}

[data-theme="dark"] .pie-timeline-main { color: #f1f5f9; }

.pie-timeline-sub {
  font-size: 0.8rem;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 2px;
}

.pie-timeline-meta {
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pie-timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
}

.pie-badge-cursando { background: rgba(37,99,235,0.1); color: #2563eb; }
.pie-badge-concluido { background: rgba(16,185,129,0.1); color: #10b981; }
.pie-badge-trancado { background: rgba(239,68,68,0.1); color: #ef4444; }

/* — Idiomas (view) — */
.pie-languages-view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pie-language-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 12px;
  background: var(--tr-slate-50, #f8fafc);
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  transition: all 0.2s;
}

.pie-language-pill:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pie-lang-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
}

.pie-lang-level {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(37,99,235,0.1);
  color: #2563eb;
}

.pie-lang-level.fluente { background: rgba(16,185,129,0.1); color: #10b981; }
.pie-lang-level.avancado { background: rgba(139,92,246,0.1); color: #7c3aed; }
.pie-lang-level.intermediario { background: rgba(245,158,11,0.1); color: #d97706; }
.pie-lang-level.basico { background: rgba(100,116,139,0.1); color: #475569; }
.pie-lang-level.nativo { background: rgba(37,99,235,0.15); color: #1d4ed8; }

/* ── SIDEBAR MELHORADO ───────────────────────────────────────────── */
.pie-sidebar-card {
  background: var(--tr-card-bg, #fff);
  border-radius: 18px;
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.pie-sidebar-identity {
  padding: 1.5rem 1.25rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid var(--tr-slate-100, #f1f5f9);
}

.pie-sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  object-fit: cover;
  margin: 0 auto 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: block;
}

.pie-sidebar-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37,99,235,0.2);
}

.pie-sidebar-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  margin: 0 0 3px;
  letter-spacing: -0.2px;
}

[data-theme="dark"] .pie-sidebar-name { color: #f1f5f9; }

.pie-sidebar-role {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
  margin-bottom: 0;
}

/* Stats dentro da sidebar */
.pie-sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--tr-slate-100, #f1f5f9);
}

.pie-stat-cell {
  padding: 14px 10px;
  text-align: center;
  transition: background 0.15s;
}

.pie-stat-cell:hover { background: var(--tr-slate-50, #f8fafc); }
.pie-stat-cell:first-child { border-right: 1px solid var(--tr-slate-100, #f1f5f9); }

.pie-stat-num {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 3px;
}

.pie-stat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

/* XP / Level widget na sidebar */
.pie-xp-widget {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(37,99,235,0.04), rgba(124,58,237,0.04));
  border-top: 1px solid var(--tr-slate-100, #f1f5f9);
  border-bottom: 1px solid var(--tr-slate-100, #f1f5f9);
}

.pie-xp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pie-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(37,99,235,0.1);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 4px;
}

.pie-tier-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #b45309;
  letter-spacing: 0.2px;
}

.pie-xp-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: #7c3aed;
  text-align: right;
}

.pie-xp-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Conquistas na sidebar */
.pie-achievements-section {
  padding: 14px 16px;
}

.pie-achievements-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.pie-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Link do ID Profissional */
.pie-id-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  margin: 8px 16px 16px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37,99,235,0.07);
  border: 1.5px solid rgba(37,99,235,0.18);
  text-decoration: none;
  transition: all 0.2s;
}

.pie-id-link:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
  text-decoration: none;
}

/* ── SEÇÃO DE CURRÍCULO NA SIDEBAR ───────────────────────────────── */
.pie-resume-card {
  background: var(--tr-card-bg, #fff);
  border-radius: 18px;
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.pie-resume-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--tr-slate-100, #f1f5f9);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 7px;
}

[data-theme="dark"] .pie-resume-header { color: #f1f5f9; }

.pie-resume-body { padding: 14px 16px; }

/* Drop zone */
.pie-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  border: 2px dashed var(--tr-slate-200, #e2e8f0);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.22s;
  text-align: center;
  background: var(--tr-slate-50, #f8fafc);
}

.pie-drop-zone:hover, .pie-drop-zone.drag-over {
  border-color: #10b981;
  background: rgba(16,185,129,0.04);
}

.pie-drop-icon {
  font-size: 1.6rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.pie-drop-zone:hover .pie-drop-icon { color: #10b981; }

.pie-drop-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
  margin: 0;
}

.pie-drop-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* Estado com arquivo */
.pie-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(16,185,129,0.06);
  border: 1.5px solid rgba(16,185,129,0.2);
  border-radius: 10px;
  margin-bottom: 8px;
}

.pie-file-icon {
  font-size: 1.5rem;
  color: #10b981;
  flex-shrink: 0;
}

.pie-file-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  margin: 0 0 2px;
}

.pie-file-date {
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 0;
}

.pie-file-actions {
  display: flex;
  gap: 6px;
}

.pie-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.pie-file-btn-replace {
  background: rgba(37,99,235,0.07);
  color: #2563eb;
  border-color: rgba(37,99,235,0.2);
}

.pie-file-btn-replace:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  text-decoration: none;
}

.pie-file-btn-download {
  background: rgba(16,185,129,0.07);
  color: #059669;
  border-color: rgba(16,185,129,0.2);
}

.pie-file-btn-download:hover {
  background: #059669;
  color: white;
  border-color: #059669;
  text-decoration: none;
}

/* ── CHECKLIST DE COMPLETUDE ─────────────────────────────────────── */
.pie-checklist-card {
  background: var(--tr-card-bg, #fff);
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  animation: pie-edit-slide-down 0.25s ease;
}

.pie-checklist-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pie-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.pie-checklist-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
}

.pie-checklist-item i {
  font-size: 0.78rem;
  flex-shrink: 0;
}

.pie-checklist-item.done i { color: #10b981; }
.pie-checklist-item.pending i { color: #d1d5db; }
.pie-checklist-item.done span { color: #10b981; }

/* ── LAYOUT 2 COLUNAS ───────────────────────────────────────────── */
.pie-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.pie-sidebar { position: sticky; top: 1rem; }

.pie-main { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── DARK MODE ───────────────────────────────────────────────────── */
[data-theme="dark"] .pie-hero-body,
[data-theme="dark"] .pie-control-bar,
[data-theme="dark"] .pie-sidebar-card,
[data-theme="dark"] .pie-resume-card,
[data-theme="dark"] .pie-checklist-card {
  background: #1e293b;
  border-color: #1e3a5f;
}

[data-theme="dark"] .pie-completion-row {
  background: rgba(255,255,255,0.04);
  border-color: #1e3a5f;
}

[data-theme="dark"] .pie-completion-row:hover {
  border-color: #2563eb;
}

[data-theme="dark"] .pie-drop-zone {
  background: rgba(255,255,255,0.03);
  border-color: #334155;
}

[data-theme="dark"] .pie-language-pill {
  background: rgba(255,255,255,0.04);
  border-color: #334155;
}

[data-theme="dark"] .pie-lang-name { color: #f1f5f9; }

[data-theme="dark"] .pie-timeline-item:not(:last-child)::before {
  background: #334155;
}

[data-theme="dark"] .pie-timeline-main { color: #f1f5f9; }
[data-theme="dark"] .pie-section-edit-btn { border-color: rgba(37,99,235,0.3); }
[data-theme="dark"] .pie-view-bio-text { background: rgba(37,99,235,0.08); color: #94a3b8; }
[data-theme="dark"] .pie-dept-badge { background: rgba(139,92,246,0.12); }
[data-theme="dark"] .pie-control-title { color: #f1f5f9; }

/* ── ONBOARDING BANNER ───────────────────────────────────────────── */
.pie-onboarding {
  background: var(--tr-card-bg, #fff);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1.5px solid var(--tr-slate-200, #e2e8f0);
  animation: pie-edit-slide-down 0.3s ease;
}

.pie-onboarding-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pie-onboarding-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--tr-card-bg, #fff);
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  color: #1e293b;
}

.onboarding-step:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  transform: translateX(3px);
}

.onboarding-step.done {
  opacity: 0.55;
  text-decoration: line-through;
  background: rgba(16, 185, 129, 0.04);
  border-color: transparent;
}

.onboarding-step .step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: #eef2ff;
  color: #4f46e5;
  transition: all 0.2s ease;
}

.onboarding-step.done .step-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.onboarding-step-text {
  flex: 1;
  color: #1e293b;
  font-weight: 600;
}

.onboarding-step.done .onboarding-step-text {
  color: #64748b;
}

[data-theme="dark"] .pie-onboarding {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .pie-onboarding-body {
  background: var(--tr-card-bg, #1e293b);
}

[data-theme="dark"] .onboarding-step {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

[data-theme="dark"] .onboarding-step:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .onboarding-step .step-icon {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

[data-theme="dark"] .onboarding-step.done {
  background: rgba(16, 185, 129, 0.05);
}

[data-theme="dark"] .onboarding-step.done .step-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .onboarding-step-text {
  color: #f1f5f9;
}

[data-theme="dark"] .onboarding-step.done .onboarding-step-text {
  color: #94a3b8;
}

/* ── MOBILE RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .pie-layout {
    grid-template-columns: 1fr;
  }

  .pie-sidebar {
    position: static;
    order: -1;
  }

  .pie-hero-body { padding: 0 1rem 1.25rem; }
  .pie-name { font-size: 1.3rem; }
  .pie-avatar-ring { width: 88px; height: 88px; }
  .pie-avatar-wrap { margin-top: -40px; }

  .pie-control-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pie-control-right { width: 100%; justify-content: flex-end; }

  .pie-hero-top-row { flex-direction: column; align-items: flex-start; }
  .pie-hero-actions { padding-top: 0; }

  .pie-cover { height: 120px; }

  .pie-checklist-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .pie-checklist-grid { grid-template-columns: 1fr; }
  .pie-connections-row { flex-direction: column; }
}

/* ── OCULTAR HERO ANTIGO NA VIEW DE USUÁRIO ──────────────────────── */
/* Quando #talentUserView está visível (view=user), o .page-hero-header
   é substituído pelo .pie-hero moderno e deve ser ocultado via JS.
   Esta regra é uma proteção CSS extra durante o carregamento. */
body.user-profile-view .page-hero-header {
  display: none !important;
}
