:root {
  /* Paleta Centro Médico Olinda */
  --color1: #ffffff;
  --color2: #1c4cd1;
  --color3: #8aa4ef;
  --color4: #0c44c8;
  --color5: #123186;
  --color6: #123186;

  --primary: var(--color2);
  --primary-dark: var(--color5);
  --primary-mid: var(--color4);
  --primary-light: #e8eeff;
  --primary-soft: var(--color3);
  --primary-glow: rgba(28, 76, 209, 0.22);
  --accent: var(--color4);
  --success: #10b981;
  --danger: #ef4444;
  --text: var(--color5);
  --text-soft: #4a5f9e;
  --text-muted: #8aa4ef;
  --surface: var(--color1);
  --surface-elevated: rgba(255, 255, 255, 0.94);
  --border: #d4dcf5;
  --border-focus: var(--color3);
  --shadow-sm: 0 1px 2px rgba(18, 49, 134, 0.06);
  --shadow-md: 0 8px 30px rgba(18, 49, 134, 0.1);
  --shadow-lg: 0 20px 50px rgba(28, 76, 209, 0.15);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Survey page ── */
.page-survey {
  background: linear-gradient(145deg, var(--color1) 0%, var(--primary-light) 40%, #f4f6ff 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(28, 76, 209, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(138, 164, 239, 0.18), transparent);
  z-index: 0;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* ── Header ── */
.survey-header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo {
  display: block;
  height: 4rem;
  width: auto;
  max-width: min(100%, 340px);
  margin: 0 auto 1rem;
  object-fit: contain;
}

.brand-logo--compact {
  height: 3rem;
  max-width: 260px;
  margin: 0 0 0.35rem;
}

.survey-header h1,
header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.survey-subtitle {
  color: var(--text-soft);
  font-size: 0.95rem;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Progress ── */
.progress-wrap {
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0.75rem;
  z-index: 10;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.progress-meta span:last-child {
  color: var(--primary);
  display: inline-block;
  min-width: 2.5rem;
  text-align: right;
  transition: transform 0.3s ease, color 0.3s ease;
}

.progress-meta span.is-updating {
  animation: progressTextPop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes progressTextPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); color: var(--color4); }
  100% { transform: scale(1); }
}

.progress-track {
  height: 8px;
  background: var(--primary-light);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(28, 76, 209, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: progressTrackFlow 3.5s ease-in-out infinite;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--color5) 0%,
    var(--color2) 35%,
    var(--color3) 65%,
    var(--color4) 100%
  );
  background-size: 300% 100%;
  transition: width 0.7s cubic-bezier(0.34, 1.15, 0.64, 1);
  box-shadow: 0 0 6px rgba(28, 76, 209, 0.18);
  animation: progressIdleFlow 2.6s ease-in-out infinite;
}

.progress-fill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: progressIdleGlow 2s ease-in-out infinite alternate;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -40%;
  width: 35%;
  height: 140%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.32) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  animation: progressIdleShine 2.4s ease-in-out infinite;
}

.progress-fill.is-advancing {
  animation: progressIdleFlow 1.2s ease-in-out infinite, progressAdvancePulse 0.7s ease;
}

.progress-fill.is-advancing::after {
  animation: progressIdleShine 1.1s ease-in-out infinite;
}

@keyframes progressIdleFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes progressIdleGlow {
  0% { background-position: 0% 50%; opacity: 0.35; }
  100% { background-position: 100% 50%; opacity: 0.65; }
}

@keyframes progressIdleShine {
  0% { left: -40%; opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.6; }
  100% { left: 130%; opacity: 0; }
}

@keyframes progressTrackFlow {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

@keyframes progressAdvancePulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(28, 76, 209, 0.18);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 10px rgba(28, 76, 209, 0.28);
    filter: brightness(1.04);
  }
}

.progress-wrap.is-advancing {
  animation: progressWrapGlow 0.6s ease;
}

@keyframes progressWrapGlow {
  0%, 100% {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
  }
  50% {
    box-shadow: 0 4px 16px rgba(28, 76, 209, 0.08);
    border-color: var(--border);
  }
}

/* ── Question cards ── */
.survey-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.survey-wizard .wizard-steps {
  position: relative;
  min-height: 280px;
}

.survey-wizard .question-card {
  animation: stepIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.survey-wizard .question-card[hidden] {
  display: none !important;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-title {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  text-align: center;
  margin-bottom: 1.35rem;
  letter-spacing: -0.02em;
}

.step-nav,
.wizard-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  min-height: 2.5rem;
}

.wizard-footer .btn {
  width: 100%;
  max-width: 320px;
}

.link-back {
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  transition: color var(--transition);
}

.link-back:hover {
  color: var(--primary);
}

.question-card--advancing {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.question-card:hover {
  border-color: var(--color3);
  box-shadow: var(--shadow-md);
}

.question-card--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.question-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.question-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.question-label {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.45;
  cursor: default;
}

.obrigatorio {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

/* ── Rating ── */
.rating-group {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

.rating-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-group label.nota {
  flex: 1;
  max-width: 72px;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--color1);
  transition: all var(--transition);
  user-select: none;
}

.nota-numero {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.rating-group input[type="radio"]:checked + label.nota .nota-numero {
  color: white;
}

.rating-group label.nota:hover {
  border-color: var(--color2);
  color: var(--color2);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.rating-group input[type="radio"]:checked + label.nota {
  background: linear-gradient(135deg, var(--color2) 0%, var(--color4) 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 6px 16px var(--primary-glow);
  transform: translateY(-2px) scale(1.04);
}

.legenda-notas {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  padding: 0 0.15rem;
}

/* ── Choice options ── */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.choice-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-group label.opcao {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--color1);
  transition: all var(--transition);
}

.opcao-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color3);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition);
}

.opcao-radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--primary);
  transform: scale(0);
  transition: transform var(--transition);
}

.choice-group label.opcao:hover {
  border-color: var(--color3);
  background: var(--primary-light);
}

.choice-group input[type="radio"]:checked + label.opcao {
  border-color: var(--color2);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(28, 76, 209, 0.12);
}

.choice-group input[type="radio"]:checked + label.opcao .opcao-radio {
  border-color: var(--color2);
}

.choice-group input[type="radio"]:checked + label.opcao .opcao-radio::after {
  transform: scale(1);
}

.opcao-texto {
  flex: 1;
  line-height: 1.35;
}

/* ── Textarea ── */
.text-input,
textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--color1);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  line-height: 1.5;
}

.text-input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.text-input:hover,
textarea:hover {
  border-color: var(--color3);
}

.text-input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color2);
  background: var(--color1);
  box-shadow: 0 0 0 4px rgba(28, 76, 209, 0.12);
}

/* ── Form footer ── */
.form-footer {
  margin-top: 0.5rem;
  text-align: center;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.btn svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color2) 0%, var(--color4) 100%);
  color: var(--color1);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) svg {
  transform: translateX(3px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ── Flash messages ── */
.flash {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.flash.erro {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.flash.sucesso {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* ── Thank you page ── */
.page-thanks {
  background: linear-gradient(145deg, var(--color1) 0%, var(--primary-light) 50%, #f4f6ff 100%);
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.sucesso-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.sucesso-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.2rem;
  color: white;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.sucesso-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.sucesso-card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Generic card (admin) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
}

.card h2 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

/* ── Admin ── */
body.page-admin {
  background: linear-gradient(180deg, var(--primary-light) 0%, #f4f6ff 100%);
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-main {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}

.admin-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin-bottom: 0.1rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.admin-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.admin-link:hover {
  background: var(--primary-light);
}

.admin-link--muted {
  color: var(--text-soft);
}

.admin-link--muted:hover {
  color: var(--text);
  background: #eef1fa;
}

.admin-section {
  margin-bottom: 2.25rem;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.admin-section-title {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.admin-section-head .admin-section-title {
  margin-bottom: 0;
}

.admin-section-desc {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.admin-empty {
  text-align: center;
  padding: 3rem 2rem;
}

.admin-empty .admin-link {
  display: inline-block;
  margin-top: 1rem;
}

.admin-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-panel .admin-section-title {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.panel-body {
  padding: 1.25rem;
}

.score-hero {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
}

.score-hero-value {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-hero-max {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-weight: 600;
}

.score-hero--inline {
  margin-bottom: 0.85rem;
}

.nps-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.nps-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--primary-light);
  color: var(--text-soft);
}

.nps-tag--promoter {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.nps-tag--neutral {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.nps-tag--detrator {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.dist-row--compact {
  margin-bottom: 0.55rem;
}

.bar-fill--soft {
  background: linear-gradient(90deg, var(--color3), #b8c9f7);
}

.valor-suffix {
  font-size: 1.1rem;
  color: var(--text-soft);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stats-grid--kpis {
  grid-template-columns: repeat(8, 1fr);
}

.stats-grid--kpis .stat-card:nth-child(1) { grid-column: 1 / 3; }
.stats-grid--kpis .stat-card:nth-child(2) { grid-column: 3 / 5; }
.stats-grid--kpis .stat-card:nth-child(3) { grid-column: 5 / 7; }
.stats-grid--kpis .stat-card:nth-child(4) { grid-column: 7 / 9; }
.stats-grid--kpis .stat-card:nth-child(5) { grid-column: 2 / 4; }
.stats-grid--kpis .stat-card:nth-child(6) { grid-column: 4 / 6; }
.stats-grid--kpis .stat-card:nth-child(7) { grid-column: 6 / 8; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 0.85rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 124px;
}

.stat-sub {
  font-size: 0.7rem;
  margin-top: 0.3rem;
  font-weight: 500;
  line-height: 1.25;
  min-height: 0.95rem;
  color: var(--text-muted);
}

.stat-card .label {
  font-size: 0.76rem;
  color: var(--text-soft);
  margin-top: 0.3rem;
  font-weight: 600;
  line-height: 1.35;
  min-height: 2.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 11rem;
}

.stat-card .valor {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-height: 1.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card--highlight {
  background: linear-gradient(145deg, var(--color2), var(--color4));
  border-color: transparent;
}

.stat-card--highlight .valor,
.stat-card--highlight .label {
  color: #ffffff;
}

.stat-card--highlight .label {
  color: rgba(255, 255, 255, 0.92);
}

.stat-card--highlight .stat-sub {
  color: rgba(255, 255, 255, 0.78);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.dist-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
}

.dist-row {
  margin-bottom: 0.85rem;
}

.dist-row:last-child {
  margin-bottom: 0;
}

.dist-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  color: var(--text-soft);
}

.dist-row-head span:first-child {
  flex: 1;
  line-height: 1.35;
}

.dist-row-head span:last-child {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.comments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.comment-group .comentarios-lista {
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0 1.25rem 0.5rem;
  background: transparent;
}

.cell-date {
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.section-title {
  font-size: 1rem;
  color: var(--text);
  margin: 2rem 0 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bar-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.bar-item { margin-bottom: 0.85rem; }
.bar-item:last-child { margin-bottom: 0; }

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
}

.bar-label span:last-child {
  font-weight: 700;
  color: var(--primary);
}

.bar-track {
  height: 8px;
  background: var(--primary-light);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color2), var(--color3));
  border-radius: 99px;
  transition: width 0.5s ease;
}

.recomendacoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.rec-item {
  text-align: center;
  padding: 1rem 0.75rem;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rec-item .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.rec-item .txt {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
  line-height: 1.3;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table th,
table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table th {
  background: var(--primary-light);
  color: var(--color5);
  font-weight: 600;
  position: sticky;
  top: 0;
  white-space: nowrap;
  font-size: 0.75rem;
}

table tbody tr:hover {
  background: rgba(232, 238, 255, 0.45);
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.comentarios-lista {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 1.25rem;
}

.comentario-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.comentario-item:last-child { border-bottom: none; }

.comentario-item .data {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.comentario-item .texto {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.admin-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  margin-left: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: background var(--transition);
}

.admin-links a:hover {
  background: var(--primary-light);
}

.admin-table-mobile {
  display: none;
}

.response-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.response-card + .response-card {
  margin-top: 0.75rem;
}

.response-card-head {
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
}

.response-card-head time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color5);
}

.response-card-body {
  padding: 0.35rem 1rem 0.75rem;
  margin: 0;
}

.response-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) 1fr;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.response-row:last-child {
  border-bottom: none;
}

.response-row dt {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0;
}

.response-row dd {
  font-size: 0.82rem;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.login-card {
  max-width: 400px;
  margin: 5rem auto;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  background: var(--color1);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--color2);
  box-shadow: 0 0 0 4px rgba(28, 76, 209, 0.12);
  background: var(--color1);
}

.vazio {
  text-align: center;
  color: var(--text-soft);
  padding: 2.5rem;
}

/* ── Legacy header compat ── */
header { text-align: center; margin-bottom: 1.5rem; }

.logo-area {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body.page-admin .container-wide {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .admin-topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .admin-brand {
    gap: 0.65rem;
  }

  .admin-brand h1 {
    font-size: 1.05rem;
  }

  .brand-logo--compact {
    height: 2.25rem;
    max-width: 180px;
  }

  .admin-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .admin-link {
    text-align: center;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    background: var(--surface);
  }

  .admin-link--muted {
    background: var(--primary-light);
  }

  .admin-main {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }

  .admin-section {
    margin-bottom: 1.75rem;
  }

  .admin-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .admin-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
  }

  .dist-grid,
  .comments-grid {
    grid-template-columns: 1fr;
  }

  .score-hero-value {
    font-size: 2.25rem;
  }

  .nps-legend {
    gap: 0.35rem;
  }

  .nps-tag {
    font-size: 0.68rem;
  }

  .dist-row-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .dist-row-head span:last-child {
    white-space: normal;
  }

  .stats-grid--kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .stats-grid--kpis .stat-card:nth-child(n) {
    grid-column: auto;
  }

  .stats-grid--kpis .stat-card:nth-child(7) {
    grid-column: 1 / -1;
  }

  .stat-card {
    min-height: 108px;
    padding: 0.95rem 0.65rem;
  }

  .stat-card .valor {
    font-size: 1.55rem;
    min-height: 1.75rem;
  }

  .stat-card .label {
    font-size: 0.72rem;
    min-height: 1.85rem;
    max-width: none;
  }

  .stat-sub {
    font-size: 0.66rem;
  }

  .admin-table-desktop {
    display: none;
  }

  .admin-table-mobile {
    display: block;
  }

  .table-wrap {
    max-height: none;
  }

  .login-card {
    margin: 2rem auto;
  }
}

@media (max-width: 600px) {
  .container,
  .container-wide {
    padding: 1.25rem 1rem 2.5rem;
  }

  .survey-header h1,
  header h1 {
    font-size: 1.35rem;
  }

  .brand-logo {
    height: 3.25rem;
  }

  .rating-group label.nota {
    max-width: none;
  }

  .nota-numero {
    font-size: 1.2rem;
  }

  .question-card {
    padding: 1.15rem;
  }

  .rating-group label.nota {
    max-width: none;
    font-size: 1rem;
  }

  .progress-wrap {
    top: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
