/* ===========================================================
   M2 Resultados — camada de modernização visual
   Mesma paleta original (preto / branco / cinza + verde, âmbar
   e vermelho apenas nos estados já existentes).
   Somente CSS: nenhum HTML ou JS foi alterado.
   =========================================================== */

:root {
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --line: #e9ebef;
  --line-2: #f0f1f4;
  --bg: #f5f6f8;
  --soft: #f6f7f9;
  --muted: #6b7280;
  --elev-1: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px -14px rgba(16, 24, 40, .12);
  --elev-2: 0 1px 2px rgba(16, 24, 40, .05), 0 22px 46px -22px rgba(16, 24, 40, .22);
  --elev-3: 0 40px 90px -40px rgba(16, 24, 40, .5);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html, body {
  background:
    radial-gradient(1200px 560px at 82% -14%, rgba(0, 0, 0, .05), transparent 62%),
    radial-gradient(900px 420px at -6% 8%, rgba(0, 0, 0, .03), transparent 60%),
    var(--bg);
  letter-spacing: -.01em;
}

::selection { background: #000; color: #fff; }

/* ======================= MARCA / BRAND ======================= */
.brand-mark {
  border-radius: 14px;
  background: linear-gradient(145deg, #232326, #000);
  box-shadow: 0 12px 26px -16px rgba(0, 0, 0, .9);
}
.brand-mark.small { border-radius: 12px; }
.brand-mark.tiny { border-radius: 10px; }

/* ==================== TELAS DE ESTADO ======================== */
.state-screen {
  background: rgba(6, 8, 12, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.state-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--elev-3);
  animation: m2-modal-in .3s var(--ease) both;
}

.state-card h1 { letter-spacing: -1.2px; }

.error-symbol { border-radius: var(--radius-pill); }

.error-card button {
  border-radius: var(--radius-pill);
  font-weight: 700;
  background: linear-gradient(145deg, #1c1c1f, #000);
  transition: transform .18s var(--ease), box-shadow .22s var(--ease);
}
.error-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -14px rgba(16, 24, 40, .7);
}

@keyframes m2-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* =========================== TOPBAR ========================== */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  box-shadow: var(--elev-1);
}

.month-control {
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.month-control:hover { border-color: #d6d9df; box-shadow: var(--elev-1); }
.month-control:focus-within {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .08);
}
.month-control select {
  border-radius: var(--radius-pill);
  outline: none;
}
.month-control span {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  color: var(--muted);
}

.icon-button {
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  transition: transform .18s var(--ease), background .2s var(--ease),
              color .2s var(--ease), box-shadow .22s var(--ease), border-color .2s var(--ease);
}
.icon-button:hover {
  transform: translateY(-1px);
  background: #000;
  color: #fff;
  border-color: #000;
  box-shadow: 0 12px 24px -14px rgba(16, 24, 40, .7);
}
.icon-button:hover svg { stroke: #fff; }
.icon-button:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* ============================ HERO =========================== */
.hero {
  border-radius: var(--radius);
  background: linear-gradient(150deg, #17171a 0%, #050505 58%, #000 100%);
  box-shadow: var(--elev-2);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -90px -140px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.09), rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.hero h1 { letter-spacing: -3px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.1px;
}
.section-heading .eyebrow,
.panel-heading .eyebrow { color: var(--muted); }

.updated-box {
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.updated-box strong { font-variant-numeric: tabular-nums; letter-spacing: -.5px; }


/* ============================ ABAS =========================== */
.tabs {
  gap: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px;
  box-shadow: var(--elev-1);
  display: flex;
  flex-wrap: wrap;
}

.tab {
  border: 0 !important;
  border-radius: var(--radius-pill);
  min-height: 40px;
  padding: 0 18px;
  font-weight: 600;
  background: transparent;
  transition: background .22s var(--ease), color .22s var(--ease),
              transform .22s var(--ease), box-shadow .22s var(--ease);
}
.tab:hover { background: rgba(0, 0, 0, .05); transform: translateY(-1px); }
.tab.active {
  background: linear-gradient(145deg, #1c1c1f, #000);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .9);
}
.tab:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

.tab-panel.active { animation: m2-view-in .32s var(--ease) both; }
@keyframes m2-view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ===================== SUPERFÍCIES / CARDS =================== */
.panel,
.metric-card,
.feedback-card,
.feedback-summary-card,
.manager-survey-card,
.survey-insight,
.manager-survey-comment,
.empty-state {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--elev-1);
  transition: box-shadow .28s var(--ease), transform .28s var(--ease), border-color .28s var(--ease);
}

.metric-card:hover,
.feedback-card:hover,
.feedback-summary-card:hover,
.manager-survey-card:hover,
.survey-insight:hover {
  transform: translateY(-2px);
  box-shadow: var(--elev-2);
  border-color: #dde0e6;
}

.panel { padding: 24px; }

.panel-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-2);
}
.panel-heading h3 { letter-spacing: -.4px; }

.section-heading h2 { letter-spacing: -.9px; }

.section-badge {
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  letter-spacing: .4px;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--elev-1);
}

/* ============================ KPIs =========================== */
.metric-grid { gap: 18px; }

.metric-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}
.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -70px -90px auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,0,0,.045), rgba(0,0,0,0) 70%);
  pointer-events: none;
  transition: transform .4s var(--ease);
}
.metric-card:hover::after { transform: scale(1.12); }

.metric-value,
.movement-value,
.feedback-summary-card strong,
.survey-insight strong,
.rank {
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.2px;
}

.metric-label,
.movement-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  color: var(--muted);
}

.metric-note { color: var(--muted); }

/* ========================== PROGRESSO ======================== */
.progress,
.movement-track,
.survey-distribution-track {
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill,
.movement-fill,
.survey-distribution-fill {
  border-radius: var(--radius-pill);
  transition: width .7s var(--ease);
}

.goal-header,
.goal-footer { letter-spacing: .2px; }

.funnel-step,
.movement-row,
.survey-distribution-row,
.feedback-field {
  border-radius: var(--radius-md);
  transition: background .18s var(--ease), transform .18s var(--ease), border-color .2s var(--ease);
}
.funnel-step:hover,
.movement-row:hover { transform: translateX(2px); }

.conversion-pill,
.survey-live-badge,
.rank {
  border-radius: var(--radius-pill);
  letter-spacing: .4px;
}

.survey-results-link {
  border-radius: var(--radius-pill);
  font-weight: 700;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease);
}
.survey-results-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -14px rgba(16, 24, 40, .6);
}

/* =========================== TABELAS ========================= */
.table-panel { padding: 0; overflow: hidden; }

.table-wrap {
  border-radius: var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.table-wrap table { border-collapse: separate; border-spacing: 0; }

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafbfc;
  text-transform: uppercase;
  letter-spacing: .9px;
  font-size: 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.table-wrap tbody tr { transition: background .18s var(--ease); }
.table-wrap tbody tr:hover { background: #fafafb; }
.table-wrap tbody td { border-bottom: 1px solid var(--line-2); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d9dce2;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: #c3c7cf; background-clip: content-box; }

/* ====================== FEEDBACK / PESQUISAS ================= */
.feedback-card-header { letter-spacing: -.3px; }
.feedback-date { color: var(--muted); }

.manager-survey-comment.attention { border-radius: var(--radius-md); }
.manager-survey-meta { color: var(--muted); letter-spacing: .2px; }

/* =========================== RODAPÉ ========================== */
footer {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  box-shadow: var(--elev-1);
}

/* ========================= RESPONSIVO ======================== */
@media (max-width: 900px) {
  .topbar { top: 8px; border-radius: var(--radius-md); }
  .panel { padding: 18px; }
  .tabs { border-radius: var(--radius-md); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
