:root {
  --pri: #0F2744;
  --sec: #C9A227;
  --bg: #F4F6F8;
  --ink: #14202E;
  --muted: #5B6775;
  --line: #E2E6EB;
  --card: #FFFFFF;
  --ok: #1B7A4E;
  --warn: #B45309;
  --err: #B42318;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
.app { height: 100%; min-height: 100%; display: flex; flex-direction: column; }
.shell { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 232px;
  background: var(--pri);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 6px;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 0 18px;
  font-weight: 700;
  letter-spacing: .02em;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.nav-link {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: #E8EEF5;
  font-weight: 500;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-spacer { flex: 1; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.topbar-logo { width: auto; height: 48px; max-width: 180px; object-fit: contain; border-radius: 6px; background: #fff; }
.topbar-emp { font-size: 13px; color: var(--muted); font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-toolbar { overflow: auto; }
.preview-nota { color: var(--muted); margin: 12px 0 0; }
.preview-stage { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.preview-device {
  background: #1A2330;
  border-radius: 20px;
  padding: 12px;
}
.preview-device-label { color: #D5DCE6; font-size: 12px; font-weight: 600; text-align: center; margin-bottom: 8px; }
.preview-device iframe { display: block; border: 0; background: #fff; border-radius: 10px; }
.preview-device.celular iframe { width: 390px; height: 680px; }
.preview-device.desktop iframe { width: min(1024px, 70vw); height: 680px; }
.chart-box { position: relative; height: min(220px, 32vh); margin-top: 8px; width: 100%; }
.chart-box canvas { display: block; max-width: 100%; }
.user-menu { position: relative; }
.user-menu-btn {
  background: none;
  border: 0;
  color: var(--pri);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 32, 46, .12);
  z-index: 30;
  padding: 6px 0;
}
.user-menu-list a,
.user-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.user-menu-list a:hover,
.user-menu-list button:hover { background: #F3F7FB; }
[x-cloak] { display: none !important; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; }
.content:has(.resposta-tela) { display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px; }
.resposta-tela {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resposta-topo {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  flex: 0 0 auto;
}
.resposta-meta { margin: 0 0 6px; }
.resposta-desc { max-height: 220px; overflow: auto; }
.resposta-desc h3 { margin: 0 0 4px; font-size: 15px; }
.resposta-desc p { margin: 0; }
.resposta-desc h3 + p + h3 { margin-top: 10px; }
.chart-box-resposta { height: min(160px, 22vh); }
.resposta-blocos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.resposta-blocos .card { min-height: 0; overflow: auto; padding: 12px; }
.resposta-blocos ul { margin: 6px 0 0; padding-left: 18px; }
.resposta-blocos li { margin-bottom: 3px; }
.resposta-premios { columns: 2; column-gap: 16px; }
.resposta-premios li { break-inside: avoid; }
.footer {
  flex-shrink: 0;
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--card);
}
.footer a { color: var(--pri); font-weight: 600; }
.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.stat { font-size: 28px; font-weight: 700; color: var(--pri); }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--pri);
  color: #fff;
  font-size: 13px;
}
.btn:hover { filter: brightness(1.08); }
.btn-sec { background: #fff; color: var(--pri); border: 1px solid var(--line); }
.btn-gold { background: var(--sec); color: #1A1403; }
.btn-danger { background: var(--err); }
.btn-sm { padding: 5px 8px; font-size: 12px; }
.field, select.field, textarea.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
label.lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field-row { margin-bottom: 12px; }
.field-color { width: 52px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msgs { list-style: none; padding: 0; margin: 0 0 12px; }
.msgs li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; }
.msgs .ok { background: #E8F6EE; color: var(--ok); }
.msgs .err { background: #FDECEC; color: var(--err); }
.msgs .warn { background: #FEF3E2; color: var(--warn); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.b-pendente { background: #EEE; color: #555; }
.b-enviado { background: #E7F0FB; color: #1D4E89; }
.b-entregue { background: #E7F0FB; color: #1D4E89; }
.b-visualizou { background: #FEF3E2; color: #9A5B0C; }
.b-respondeu { background: #E8F6EE; color: var(--ok); }
.auth {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--pri), #1B3B63);
}
.auth-card {
  width: min(420px, 92vw);
  margin: auto;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
}
.menu-btn { display: none; background: none; border: 0; color: var(--pri); font-size: 22px; }
.par {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.par-texto { margin: 0 0 8px; }
.par-soma { margin: 4px 0 12px; color: var(--muted); font-weight: 600; }
.pts { display: flex; gap: 8px; }
.pts button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.pts button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.pts button:disabled { opacity: .35; cursor: not-allowed; }
.opt {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}
.opt:has(input:checked) { border-color: var(--pri); background: #F3F7FB; }
.progress { height: 6px; background: #E6EBF1; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--sec); }
@media (max-width: 1100px) {
  .resposta-blocos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .resposta-topo { grid-template-columns: 1fr; }
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: absolute; inset: 52px 0 auto 0; z-index: 20; min-height: 70vh; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
