/* ── Rota Studio Brand Variables ─────────────────────────── */
:root {
  --gold:         #ca853e;
  --gold-dark:    #a8692a;
  --gold-light:   #e0a55e;
  --gold-bg:      #fdf3e7;
  --dark:         #1c0f05;
  --dark-mid:     #2e1c0e;
  --cream:        #f6ede2;
  --cream-dark:   #ede0d0;
  --warm-white:   #fdfaf7;
  --text:         #1c0f05;
  --text-muted:   #7a6150;
  --border:       #e5d0ba;
  --green:        #2a7d4f;
  --yellow:       #b8860b;
  --red:          #b83232;
  --green-bg:     #f0faf4;
  --yellow-bg:    #fdf8ec;
  --red-bg:       #fdf0f0;
  --radius:       12px;
  --shadow:       0 1px 4px rgba(28,15,5,.08), 0 1px 2px rgba(28,15,5,.05);
  --shadow-lg:    0 8px 30px rgba(28,15,5,.15);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--dark);
  color: #fff;
  padding: 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}
.header-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}
.header-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.15);
  margin: 0 4px;
}
.header-app-name {
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  letter-spacing: .3px;
}
.header-app-label {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: -.2px;
}
.header-badge {
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--gold);
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Container & Layout ──────────────────────────────────── */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}
.main-grid {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  align-items: start;
}
.left-col, .right-col { display: flex; flex-direction: column; gap: 24px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--warm-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-header { margin-bottom: 20px; }
.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 3px;
}
.card-header p { font-size: .82rem; color: var(--text-muted); }

/* ── Tipo Tabs ───────────────────────────────────────────── */
.tipo-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.tipo-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--cream);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s, background .18s;
  font-family: inherit;
}
.tipo-tab:hover { border-color: var(--gold); background: var(--gold-bg); }
.tipo-tab.active {
  border-color: var(--gold);
  background: var(--gold-bg);
  box-shadow: 0 0 0 3px rgba(202,133,62,.12);
}
.tipo-tab-icon { font-size: 1.4rem; flex-shrink: 0; }
.tipo-tab-body { display: flex; flex-direction: column; gap: 1px; }
.tipo-tab-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--dark);
}
.tipo-tab.active .tipo-tab-title { color: var(--gold-dark); }
.tipo-tab-sub { font-size: .72rem; color: var(--text-muted); }

/* ── History Filter ──────────────────────────────────────── */
.history-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: #fff;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold-dark); }
.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* ── History tipo badge ──────────────────────────────────── */
.history-tipo {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  margin-bottom: 3px;
}
.history-tipo.vendas   { background: #fdf3e7; color: var(--gold-dark); border: 1px solid #e8c99a; }
.history-tipo.onboarding { background: #edf5ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ── Result tipo badge ───────────────────────────────────── */
.result-tipo-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
  letter-spacing: .3px;
}

/* ── Topicos Card ────────────────────────────────────────── */
.topicos-card { border-left: 4px solid #ef4444; }
.topicos-card .card-header h2 { color: #b91c1c; }
.topico-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 7px;
  margin-bottom: 7px;
  font-size: .83rem;
  color: #7f1d1d;
  line-height: 1.5;
}
.topico-item:last-child { margin-bottom: 0; }
.topico-icon { flex-shrink: 0; font-size: .9rem; margin-top: 1px; }

/* ── Form ────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}
.form-group { margin-bottom: 16px; }
.form-group:last-of-type { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  font-family: inherit;
  transition: border-color .18s, box-shadow .18s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(202,133,62,.15);
}
.form-group textarea { resize: vertical; min-height: 180px; }
.form-group select { cursor: pointer; }

/* ── Button ──────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .3px;
  transition: background .18s, transform .15s, box-shadow .15s;
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(202,133,62,.4);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; }

/* ── Empty Results ────────────────────────────────────────── */
.empty-results-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  border: 2px dashed var(--border);
  background: var(--cream);
}
.empty-results-inner { text-align: center; max-width: 320px; padding: 20px 0; }
.empty-results-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-results-inner h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: 10px; }
.empty-results-inner p { font-size: .875rem; color: var(--text-muted); line-height: 1.7; }
.empty-features { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.feature-item {
  font-size: .82rem;
  color: var(--text-muted);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
}

/* ── Loading ─────────────────────────────────────────────── */
.loading-results-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}
.loading-inner { text-align: center; max-width: 300px; }
.spinner-large {
  width: 52px;
  height: 52px;
  border: 4px solid var(--cream-dark);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inner h3 { font-size: 1.05rem; color: var(--dark); margin-bottom: 8px; }
.loading-inner p { font-size: .82rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; }
.loading-steps { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.step {
  font-size: .8rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.step.active {
  color: var(--gold-dark);
  border-color: var(--gold);
  background: var(--gold-bg);
  font-weight: 600;
}

/* ── Score Card ──────────────────────────────────────────── */
.score-card {
  background: var(--dark);
  color: #fff;
  border-color: transparent;
  position: relative;
  overflow: hidden;
}
.score-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(202,133,62,.2) 0%, transparent 70%);
  pointer-events: none;
}
.score-layout {
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
}
.score-circle-wrap { text-align: center; flex-shrink: 0; }
.score-circle {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 3px solid rgba(202,133,62,.35);
  background: rgba(202,133,62,.08);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 8px;
  transition: border-color .4s;
}
.score-circle.good  { border-color: #4ade80; }
.score-circle.mid   { border-color: var(--gold-light); }
.score-circle.bad   { border-color: #f87171; }
.score-num  { font-size: 2.6rem; font-weight: 800; line-height: 1; color: #fff; }
.score-denom { font-size: .95rem; opacity: .55; align-self: flex-end; padding-bottom: 6px; }
.score-label { font-size: .72rem; opacity: .55; letter-spacing: .5px; text-transform: uppercase; }

.score-info { flex: 1; }
.classification-pill {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(202,133,62,.2);
  border: 1px solid rgba(202,133,62,.4);
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 16px;
}
.score-meta { display: flex; flex-direction: column; gap: 8px; }
.score-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: rgba(255,255,255,.75);
}
.meta-icon { font-size: 1rem; }

/* ── Criteria Grid ────────────────────────────────────────── */
.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.criterion-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow .2s;
}
.criterion-card:hover { box-shadow: 0 2px 10px rgba(28,15,5,.1); }
.criterion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.criterion-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.criterion-score { font-size: 1.05rem; font-weight: 800; }
.score-good { color: var(--green); }
.score-mid  { color: var(--yellow); }
.score-bad  { color: var(--red); }

.progress-wrap {
  height: 6px;
  background: var(--cream-dark);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-bar {
  height: 100%;
  border-radius: 100px;
  width: 0;
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.progress-bar.good { background: var(--green); }
.progress-bar.mid  { background: var(--gold); }
.progress-bar.bad  { background: var(--red); }

.criterion-row {
  font-size: .79rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  gap: 5px;
}
.criterion-row .row-icon { flex-shrink: 0; }
.criterion-row strong { color: var(--text-muted); font-weight: 600; }
.criterion-tip {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  font-size: .78rem;
  color: var(--dark-mid);
  line-height: 1.5;
}

/* ── Portfolio Card ──────────────────────────────────────── */
.portfolio-card { border-left: 4px solid var(--gold); }
.portfolio-servicos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.portfolio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--gold-bg);
  border: 1.5px solid var(--gold);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--gold-dark);
}
.portfolio-analise {
  font-size: .875rem;
  color: var(--text);
  line-height: 1.7;
  background: var(--cream);
  border-radius: 8px;
  padding: 14px 16px;
}

/* ── Moment & Ideal Cards ─────────────────────────────────── */
.moment-card {
  background: var(--dark);
  border-color: transparent;
  color: #fff;
}
.moment-card .card-header h2 { color: #f1f0ee; }
.moment-card .card-header p  { color: rgba(255,255,255,.5); }
.moment-quote {
  background: rgba(202,133,62,.1);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  font-size: .92rem;
  font-style: italic;
  color: #e8dfd4;
  line-height: 1.75;
}

.ideal-card { border-left: 4px solid var(--gold); }
.ideal-card .card-header h2 { color: var(--dark); }
.ideal-phrase {
  position: relative;
  background: var(--gold-bg);
  border-radius: 8px;
  padding: 20px 20px 20px 28px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.7;
}
.ideal-phrase::before {
  content: '"';
  position: absolute;
  top: -4px;
  left: 10px;
  font-size: 3rem;
  color: var(--gold);
  opacity: .35;
  font-family: Georgia, serif;
  line-height: 1;
}

/* ── History ─────────────────────────────────────────────── */
.empty-history {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: .875rem;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color .18s, background .18s, transform .15s;
}
.history-item:last-child { margin-bottom: 0; }
.history-item:hover {
  border-color: var(--gold);
  background: var(--gold-bg);
  transform: translateX(2px);
}
.history-info { flex: 1; }
.history-closer { font-weight: 600; font-size: .875rem; color: var(--text); }
.history-meta { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }
.history-right { text-align: right; flex-shrink: 0; margin-left: 12px; }
.history-score { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.history-class { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }

/* ── Results Action Bar ──────────────────────────────────── */
.results-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: .2px;
  transition: background .18s, transform .15s, box-shadow .15s;
}
.btn-download:hover {
  background: var(--dark-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28,15,5,.25);
}
.btn-download:active { transform: translateY(0); }
.btn-download:disabled { opacity: .65; cursor: not-allowed; }

/* ── Notas do Avaliador ──────────────────────────────────── */
.notas-card { border-left: 4px solid var(--dark); }
.nota-item {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: .875rem;
  line-height: 1.65;
}
.nota-item:last-child { margin-bottom: 0; }
.nota-item.positivo    { background: #f0faf4; border: 1px solid #bbf7d0; color: #166534; }
.nota-item.critico     { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.nota-item.oportunidade{ background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.nota-item.neutro      { background: var(--cream); border: 1px solid var(--border); color: var(--text); }

/* ── Métricas da Call ────────────────────────────────────── */
.metricas-card { border-left: 4px solid #3b82f6; }
.metricas-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.metrica-item {
  text-align: center;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
}
.metrica-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
  margin-bottom: 5px;
}
.metrica-label { font-size: .74rem; color: var(--text-muted); font-weight: 500; }
.metrica-badge {
  display: inline-block;
  margin-top: 7px;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.metrica-badge.good { background: #dcfce7; color: #166534; }
.metrica-badge.mid  { background: #fef9c3; color: #854d0e; }
.metrica-badge.bad  { background: #fee2e2; color: #991b1b; }

.talk-ratio-wrap { margin-bottom: 16px; }
.talk-ratio-bar {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  background: var(--cream-dark);
}
.talk-bar-closer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  transition: width .7s cubic-bezier(.4,0,.2,1);
  background: var(--gold);
  min-width: 0;
}
.talk-bar-closer.good { background: var(--green); }
.talk-bar-closer.mid  { background: var(--gold); }
.talk-bar-closer.bad  { background: var(--red); }
.talk-bar-prospect {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--dark-mid);
  background: var(--cream-dark);
  transition: width .7s cubic-bezier(.4,0,.2,1);
  flex: 1;
}
.talk-ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.diagnostico-box {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .84rem;
  color: var(--text);
  line-height: 1.65;
}

/* ── SPIN Selling ────────────────────────────────────────── */
.spin-card { border-left: 4px solid var(--gold-dark); }
.spin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.spin-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow .2s;
}
.spin-item:hover { box-shadow: 0 2px 8px rgba(28,15,5,.1); }
.spin-item.nao-aplicou { opacity: .82; }
.spin-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.spin-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--dark);
  color: var(--gold-light);
  font-size: .95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spin-title-wrap { flex: 1; }
.spin-title   { font-size: .82rem; font-weight: 700; color: var(--dark); }
.spin-subdesc { font-size: .7rem; color: var(--text-muted); line-height: 1.4; }
.spin-score   { font-size: .95rem; font-weight: 800; flex-shrink: 0; }
.spin-badge {
  display: inline-block;
  font-size: .69rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 100px;
  margin-bottom: 9px;
}
.spin-badge.sim { background: #dcfce7; color: #166534; }
.spin-badge.nao { background: #fee2e2; color: #991b1b; }
.spin-detalhe {
  font-size: .79rem;
  color: var(--text);
  line-height: 1.6;
}
.spin-avaliacao-box {
  background: var(--gold-bg);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: .875rem;
  color: var(--dark);
  line-height: 1.65;
  font-style: italic;
}

/* ── Técnicas Consultivas ────────────────────────────────── */
.tecnicas-card { border-left: 4px solid var(--green); }
.tecnicas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tecnica-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow .2s;
}
.tecnica-item:hover { box-shadow: 0 2px 8px rgba(28,15,5,.1); }
.tecnica-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tecnica-icon  { font-size: 1rem; flex-shrink: 0; }
.tecnica-name  { flex: 1; font-size: .77rem; font-weight: 700; color: var(--dark); text-transform: uppercase; letter-spacing: .4px; }
.tecnica-score { font-size: .95rem; font-weight: 800; flex-shrink: 0; }
.tecnica-obs   { font-size: .79rem; color: var(--text); line-height: 1.6; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px 24px;
  color: var(--text-muted);
  font-size: .78rem;
  border-top: 1px solid var(--border);
  background: var(--warm-white);
}
.footer a { color: var(--gold-dark); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-credit { margin-top: 4px; font-size: .76rem; color: var(--text-muted); }

/* ── Error Toast ─────────────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--red);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  max-width: 380px;
  z-index: 999;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s, opacity .25s;
}
.error-toast.show { transform: translateY(0); opacity: 1; }

/* ── Spinner (button) ────────────────────────────────────── */
.spinner-sm {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

/* ── Main Navigation ─────────────────────────────────────── */
.main-nav {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 90;
}
.main-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}
.nav-tab {
  padding: 14px 20px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s, border-color .18s;
  margin-bottom: -1px;
}
.nav-tab:hover { color: var(--gold-dark); }
.nav-tab.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
}

/* ── View sections ───────────────────────────────────────── */
.view-section { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Performance Header ──────────────────────────────────── */
.perf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.perf-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}
.perf-sub { font-size: .84rem; color: var(--text-muted); }
.perf-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.perf-select {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .875rem;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: border-color .18s;
}
.perf-select:focus { outline: none; border-color: var(--gold); }

/* ── KPI Grid ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  text-align: center;
}
.kpi-icon  { font-size: 1.6rem; margin-bottom: 8px; }
.kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--dark); line-height: 1; margin-bottom: 6px; }
.kpi-label { font-size: .76rem; color: var(--text-muted); font-weight: 500; }

/* ── Performance Row (half cards) ───────────────────────── */
.perf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.perf-card-half { /* inherits .card; no extra needed */ }

/* ── Weak Criteria ───────────────────────────────────────── */
.weak-item { margin-bottom: 14px; }
.weak-item:last-child { margin-bottom: 0; }
.weak-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Ranking ─────────────────────────────────────────────── */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
}
.ranking-item:last-child { margin-bottom: 0; }
.ranking-pos {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--dark);
  flex-shrink: 0;
}
.ranking-item:nth-child(1) .ranking-pos { background: #fde68a; color: #92400e; }
.ranking-item:nth-child(2) .ranking-pos { background: var(--cream-dark); color: var(--text-muted); }
.ranking-item:nth-child(3) .ranking-pos { background: #fed7aa; color: #c2410c; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-nome { font-size: .875rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-sub  { font-size: .74rem; color: var(--text-muted); margin-top: 1px; }
.ranking-right { text-align: right; flex-shrink: 0; }
.ranking-badge { font-size: .9rem; margin-top: 2px; }

/* ── Closer Charts ───────────────────────────────────────── */
.closer-chart-card { margin-bottom: 20px; }
.closer-chart-card:last-child { margin-bottom: 0; }
.closer-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.closer-chart-nome { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 3px; }
.closer-chart-sub  { font-size: .8rem; color: var(--text-muted); }
.closer-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.closer-chart-wrap { display: flex; flex-direction: column; gap: 8px; }
.closer-chart-title { font-size: .76rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

/* ── Equipe Header ───────────────────────────────────────── */
.equipe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.equipe-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.equipe-form-card { margin-bottom: 20px; }
.equipe-form-btns { display: flex; gap: 10px; margin-top: 16px; }

/* ── Equipe Table ────────────────────────────────────────── */
.equipe-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.equipe-tbl th {
  text-align: left;
  padding: 10px 14px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.equipe-tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.equipe-tbl tr:last-child td { border-bottom: none; }
.equipe-tbl tr.inativo td { opacity: .5; }
.equipe-nome { font-weight: 600; color: var(--text); }
.tipo-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
}
.tipo-badge-sm.closer { background: var(--gold-bg); color: var(--gold-dark); border: 1px solid #e8c99a; }
.tipo-badge-sm.gestor { background: #edf5ff; color: #2563eb; border: 1px solid #bfdbfe; }
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
}
.status-badge.ativo   { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.status-badge.inativo { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.equipe-actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-edit-sm, .btn-deact-sm, .btn-act-sm {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-edit-sm  { border-color: var(--border); background: #fff; color: var(--text); }
.btn-edit-sm:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-deact-sm { border-color: #fecaca; background: var(--red-bg); color: var(--red); }
.btn-deact-sm:hover { background: #fee2e2; }
.btn-act-sm   { border-color: #bbf7d0; background: var(--green-bg); color: var(--green); }
.btn-act-sm:hover { background: #dcfce7; }

/* ── Closer Select Wrap (form) ───────────────────────────── */
.closer-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.closer-select-wrap select { flex: 1; }
.btn-add-closer {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.btn-add-closer:hover { border-color: var(--gold); color: var(--gold-dark); }
.new-closer-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.new-closer-row input { flex: 1; }
.btn-criar-closer {
  flex-shrink: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-criar-closer:hover { background: var(--gold-dark); }

/* ── Comentário do Gestor ────────────────────────────────── */
.comentario-card { border-left: 4px solid var(--gold-dark); }
.comentario-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  resize: vertical;
  transition: border-color .18s, box-shadow .18s;
  display: block;
  margin-bottom: 12px;
}
.comentario-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(202,133,62,.15);
}
.btn-salvar-comentario {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s;
}
.btn-salvar-comentario:hover { background: var(--dark-mid); }

/* ── History Pagination ──────────────────────────────────── */
.history-pagination { display: flex; justify-content: center; margin-top: 14px; }
.btn-load-more {
  padding: 9px 24px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-load-more:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ── Extra Buttons ───────────────────────────────────────── */
.btn-primary-sm {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, transform .15s;
}
.btn-primary-sm:hover:not(:disabled) { background: var(--gold-dark); transform: translateY(-1px); }
.btn-primary-sm:disabled { opacity: .65; cursor: not-allowed; }
.btn-cancel {
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-cancel:hover { border-color: var(--red); color: var(--red); }
.btn-link-history {
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.btn-link-history:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-dark); }
.btn-link-history:disabled { opacity: .65; cursor: not-allowed; }

/* ── Success Toast ───────────────────────────────────────── */
.success-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  max-width: 380px;
  z-index: 999;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s, opacity .25s;
}
.success-toast.show { transform: translateY(0); opacity: 1; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .main-grid { grid-template-columns: 1fr; }
  .kpi-grid  { grid-template-columns: repeat(2, 1fr); }
  .perf-row  { grid-template-columns: 1fr; }
  .closer-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 16px 16px 40px; }
  .card { padding: 20px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .criteria-grid { grid-template-columns: 1fr; }
  .score-layout { flex-direction: column; text-align: center; }
  .score-meta { align-items: center; }
  .score-circle { width: 88px; height: 88px; }
  .score-num { font-size: 2rem; }
  .header-badge { display: none; }
  .kpi-grid  { grid-template-columns: repeat(2, 1fr); }
  .perf-header  { flex-direction: column; align-items: flex-start; }
  .equipe-header { flex-direction: column; align-items: flex-start; }
  .perf-controls { width: 100%; }
  .equipe-actions { width: 100%; }
  .spin-grid { grid-template-columns: 1fr; }
  .tecnicas-grid { grid-template-columns: 1fr; }
  .main-nav-inner { overflow-x: auto; }
  .nav-tab { font-size: .8rem; padding: 12px 14px; white-space: nowrap; }
}
