:root {
  --azul: #284ad4;
  --azul-escuro: #203ab0;
  --verde: #14734e;
  --vermelho: #dc2626;
  --amarelo: #f59e0b;
  --cinza: #6b7280;
  --fundo: #f4f6fb;
  --card: #ffffff;
  --borda: #dfe5ef;
  --texto: #17233d;
  --sidebar: 224px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.acesso {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 20px;
}
.acesso .acesso-card { width: min(100%, 420px); margin: 0; padding: clamp(20px, 6vw, 36px); }
.acesso .marca-correcoes { margin: 0 0 16px; }
.acesso p { margin: 0 0 18px; }
.acesso fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.acesso input { width: 100%; margin-bottom: 10px; }
.acesso #mensagemAcesso { margin: 12px 0 0; color: #9f2424; }
.acesso #mensagemAcesso:empty { display: none; }
.conta-ativa { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.conta-ativa span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.conta-ativa button { width: auto; margin: 0; flex: 0 0 auto; }

body {
  font-family: Inter, "Segoe UI", sans-serif;
  background: var(--fundo);
  margin: 0;
  padding: 0;
  color: var(--texto);
}

.barra-lateral { display: contents; }
.topbar {
  background: #14213d;
  color: white;
  padding: 19px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.topbar small { display: block; margin-top: 4px; color: #b9c8e9; font-size: 12px; font-weight: 500; }
.marca-correcoes {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 1;
  overflow: hidden;
}
.marca-correcoes img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
}
.marca-painel {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}
.marca-painel-icone {
  flex: 0 0 38px;
  height: 38px;
  /* Enquadra o símbolo no PNG horizontal da marca. */
  background: url("logo-correcoes-palma.png") 4.2% 51.4% / 543% auto no-repeat;
}
.badge { background: #1f2937; border: 1px solid #374151; border-radius: 999px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }

.menu {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  background: #14213d;
  border-bottom: 1px solid #293a5d;
}

.menu-btn {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  color: #d9e3f8;
  border: 1px solid transparent;
  font-size: 14px;
  white-space: nowrap;
}

.menu-btn:hover { background: #24365c; }
.menu-btn.active { background: #2e46aa; color: white; border-color: #647def; }

main { max-width: 1240px; margin: auto; padding: clamp(12px, 3vw, 36px); }
.screen { display: none; }
.screen.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: clamp(14px, 2.4vw, 26px);
  box-shadow: 0 2px 6px rgba(23, 35, 61, .045);
  margin-bottom: 16px;
}

.card h2 { margin-top: 0; }
.card h3 { margin-bottom: 8px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.botoes-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cards-resumo, .resumo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.cards-resumo { grid-template-columns: repeat(4, 1fr); }

label { font-weight: bold; font-size: 14px; display: block; margin-bottom: 5px; }
input, select, textarea { width: 100%; padding: 11px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 15px; background: white; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid #5272ff; outline-offset: 3px; }
textarea { min-height: 90px; resize: vertical; }

button { width: 100%; border: none; border-radius: 10px; padding: 14px; font-size: 16px; font-weight: bold; cursor: pointer; margin-top: 10px; }
button:disabled { opacity: .65; cursor: wait; }
.btn-primary { background: var(--azul); color: white; }
.btn-primary:hover { background: var(--azul-escuro); }
.btn-green { background: var(--verde); color: white; }
.btn-red { background: var(--vermelho); color: white; }
.btn-gray { background: #374151; color: white; }
.btn-yellow { background: var(--amarelo); color: white; }
.sem-margem { margin-top: 0; }

.video-wrap { position: relative; width: 100%; background: black; border-radius: 14px; overflow: hidden; border: 3px solid #111827; }
video { width: 100%; display: block; background: black; transform: none; }
canvas { display: none; }
.moldura { position: absolute; inset: 4%; border: 3px dashed rgba(34, 197, 94, 0.95); border-radius: 10px; pointer-events: none; }
.moldura::before { content: "Enquadre o cartão"; position: absolute; top: -34px; left: 50%; transform: translateX(-50%); background: rgba(17,24,39,0.85); color: white; font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.preview { width: 100%; border-radius: 12px; border: 1px solid var(--borda); margin-top: 10px; display: none; background: white; }

.scanner-quick-actions { margin-top: 16px; }
.camera-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.camera-capture-btn, .file-choice-btn {
  display: block; padding: 17px; border-radius: 12px; text-align: center;
  background: var(--verde); color: white; font-size: 18px; font-weight: 800; cursor: pointer;
}
.file-choice-btn { padding: 13px; background: #374151; font-size: 15px; }
.quick-toggle { display: flex; gap: 9px; align-items: center; margin-top: 12px; font-weight: 600; }
.quick-toggle input { width: 20px; height: 20px; flex: 0 0 auto; }
.scanner-options { margin-top: 14px; }
.scanner-options summary { cursor: pointer; color: #475569; font-weight: 700; padding: 8px 0; }
.fast-success { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: #dcfce7; border: 2px solid #22c55e; color: #14532d; }
.fast-success strong { display: block; font-size: 18px; }
.fast-success span { display: block; margin-top: 4px; }
.fast-count { min-width: 68px; text-align: center; font-size: 25px; font-weight: 900; }
.fast-count small { display: block; font-size: 10px; font-weight: 700; }
.fast-review { padding: 14px; border-radius: 12px; background: #fef3c7; border: 2px solid #f59e0b; color: #78350f; font-weight: 800; }
.next-card-btn { min-height: 58px; font-size: 18px; }

@media (max-width: 760px) {
  #screen-scanner .card { padding: 12px; border-radius: 10px; }
  #screen-scanner .grid > div:nth-child(3),
  #screen-scanner .grid > div:nth-child(4),
  #screen-scanner .grid > div:nth-child(5),
  #screen-scanner .grid > div:nth-child(6) { display: none; }
  #screen-scanner .camera-capture-btn { position: sticky; bottom: 8px; z-index: 4; }
  #screen-scanner .resumo { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  #screen-scanner .mini-card { padding: 8px 4px; }
  #screen-scanner .mini-card strong { font-size: 18px; }
  #screen-scanner #cameraCard .video-wrap { max-height: 38vh; }
}

.status { padding: 12px; border-radius: 10px; margin-top: 12px; font-size: 15px; line-height: 1.4; background: #f9fafb; border: 1px solid var(--borda); }
.status.ok { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.status.erro { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.status.aviso { background: #fffbeb; border-color: #f59e0b; color: #92400e; }

.mini-card { background: #f9fafb; border: 1px solid var(--borda); border-radius: 10px; padding: 12px; text-align: center; }
.mini-card strong { font-size: 22px; display: block; margin-bottom: 3px; }
.mini-card span { color: var(--cinza); font-size: 13px; }
.disciplina-card { padding: 12px; border-radius: 10px; background: #eff6ff; border: 1px solid #3b82f6; margin-top: 10px; line-height: 1.5; }

.disciplina-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.disciplina-row button { width: 48px; padding: 11px; margin: 0; }
.gabarito-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.gabarito-item { border: 1px solid var(--borda); border-radius: 10px; padding: 8px; background: #f9fafb; }
.gabarito-item label { text-align: center; }

.upload-box { border: 2px dashed #94a3b8; background: #f8fafc; border-radius: 12px; padding: 14px; margin-top: 12px; }
.upload-box p { margin: 0 0 8px 0; color: #475569; font-size: 14px; }

.json-box { white-space: pre-wrap; overflow-x: auto; background: #111827; color: #e5e7eb; border-radius: 10px; padding: 12px; max-height: 360px; font-family: Consolas, monospace; font-size: 12px; display: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { border: 1px solid #e5e7eb; padding: 7px; text-align: center; }
th { background: #f3f4f6; }
.correta { color: green; font-weight: bold; }
.errada { color: red; font-weight: bold; }
.rasurada { color: orange; font-weight: bold; }
.branco { color: gray; font-weight: bold; }

.lista-card { border: 1px solid var(--borda); border-radius: 12px; padding: 12px; margin-top: 10px; background: #f9fafb; }
.lista-card strong { display: block; margin-bottom: 4px; }
.lista-card small { color: var(--cinza); }
.lista-actions { display: flex; gap: 8px; margin-top: 8px; }
.lista-actions button { margin: 0; padding: 9px; font-size: 13px; }
.passos li { margin: 6px 0; }

@media (max-width: 860px) {
  main { padding: 10px; }
  .grid, .botoes-linha, .disciplina-row { grid-template-columns: 1fr; }
  .cards-resumo, .resumo, .gabarito-grid { grid-template-columns: 1fr 1fr; }
  .menu { padding: 8px; }
  .menu-btn { padding: 9px 12px; font-size: 13px; }
}

.hint {
  color: #4b5563;
  font-size: 14px;
  margin-top: -4px;
}

.tres-colunas {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 760px) {
  .tres-colunas { grid-template-columns: 1fr; }
}

.tag-ok, .tag-aviso {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}
.tag-ok { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.tag-aviso { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  font-weight: 600;
}
.check-line input {
  width: auto;
}

.lista-card.clicavel { cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.lista-card.clicavel:hover { border-color: var(--azul); background: #eff6ff; transform: translateY(-1px); }
.lista-card-selecionado { border: 2px solid var(--azul); background: #eff6ff; }

.btn-voltar {
  width: auto;
  padding: 10px 14px;
  margin-top: 0;
  margin-bottom: 12px;
}

.detalhe-header h2 {
  margin-bottom: 10px;
}

.detalhe-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 14px;
}

.duas-colunas {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 760px) {
  .detalhe-specs, .duas-colunas { grid-template-columns: 1fr; }
}

/* Turmas / alunos - v1.14 */
.turmas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.turma-card {
  position: relative;
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 16px 48px 16px 14px;
  background: #f9fafb;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.turma-card:hover {
  border-color: var(--azul);
  background: #eff6ff;
  transform: translateY(-1px);
}

.turma-topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.turma-topo strong {
  font-size: 24px;
  line-height: 1.1;
}

.turma-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid #0ea5e9;
  color: #0369a1;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

.turma-qtd {
  margin-top: 8px;
  font-size: 18px;
  font-weight: bold;
}

.turma-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #b91c1c;
  font-size: 20px;
  line-height: 1;
}

.turma-delete:hover {
  background: #dc2626;
  color: white;
}

.turma-detalhe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--borda);
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.turma-detalhe-header h2 {
  margin: 0 0 4px;
  font-size: 28px;
}

.turma-detalhe-header p {
  margin: 0;
  color: #4b5563;
}

.turma-total {
  min-width: 100px;
  text-align: center;
  background: #eff6ff;
  border: 1px solid #3b82f6;
  color: #1d4ed8;
  border-radius: 12px;
  padding: 10px;
  font-size: 28px;
  font-weight: bold;
}

.turma-total span {
  display: block;
  font-size: 12px;
  color: #4b5563;
}

.btn-mini {
  width: auto;
  margin: 0;
  padding: 7px 12px;
  font-size: 13px;
}

@media (max-width: 760px) {
  .turmas-grid { grid-template-columns: 1fr; }
  .turma-detalhe-header { align-items: flex-start; flex-direction: column; }
}

/* Turmas/Alunos - estilo tabela */
.section-header-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.alunos-toolbar-grid {
  align-items: end;
}

.table-shell {
  border: 1px solid var(--borda);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-top: 14px;
}

.fixed-height-table {
  max-height: 480px;
  overflow: auto;
}

.modern-table {
  margin-top: 0;
  font-size: 14px;
}

.modern-table th,
.modern-table td {
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 10px 12px;
  vertical-align: middle;
}

.modern-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
}

.modern-table tbody tr {
  transition: background .12s ease;
}

.table-shell-clickable .modern-table tbody tr:hover {
  background: #f8fafc;
}

.col-check {
  width: 46px;
  text-align: center;
}

.col-actions {
  width: 90px;
  text-align: center;
  white-space: nowrap;
}

.text-left {
  text-align: left;
}

.strong-cell {
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  margin: 0 3px;
  padding: 0;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 16px;
  line-height: 1;
}

.icon-action-btn.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.selection-bar {
  margin-top: 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
}

.selection-left {
  font-size: 14px;
}

.selection-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.selection-actions .icon-action-btn {
  margin: 0;
}

.footer-link-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.link-btn {
  width: auto;
  background: transparent;
  color: var(--azul);
  border: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

.breadcrumb-line {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 12px;
}

.breadcrumb-line span {
  color: #9ca3af;
  padding: 0 4px;
}

.tabela-style-header {
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .section-header-line,
  .selection-bar,
  .footer-link-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .col-actions {
    width: 110px;
  }
}

/* Minhas Provas - estilo tabela */
.btn-top-action {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  white-space: nowrap;
}

.provas-toolbar-grid {
  align-items: end;
  margin-top: 10px;
}

.provas-table-shell {
  margin-top: 12px;
}

.provas-table .muted-small {
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 400;
}

.provas-table tbody tr {
  cursor: pointer;
}

.provas-table tbody tr.linha-selecionada {
  background: #eff6ff;
}

.turma-mini-badge {
  display: inline-block;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
  font-weight: 800;
  white-space: nowrap;
}

.status-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.danger-link {
  color: #dc2626;
}

@media (max-width: 760px) {
  .btn-top-action {
    width: 100%;
  }
}

/* Detalhe da prova - v1.18 */
.detalhe-prova-page {
  padding-bottom: 10px;
}

.detalhe-top-row,
.detalhe-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.detalhe-title-row h2 {
  margin: 8px 0 4px;
  font-size: 28px;
}

.detalhe-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.detalhe-metric {
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  padding: 12px;
  min-height: 70px;
}

.detalhe-metric span {
  display: block;
  color: #64748b;
  font-size: 13px;
  margin-bottom: 5px;
}

.detalhe-metric strong {
  display: block;
  font-size: 20px;
  color: #0f172a;
}

.detalhe-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--borda);
  padding-top: 12px;
}

.detalhe-tab {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #111827;
  font-size: 14px;
  white-space: nowrap;
}

.detalhe-tab.active {
  background: var(--azul);
  border-color: var(--azul);
  color: white;
}

.detalhe-tab-panel {
  display: none;
}

.detalhe-tab-panel.active {
  display: block;
}

.estatisticas-tabela {
  overflow-x: auto;
  border: 1px solid var(--borda);
  border-radius: 12px;
  margin-bottom: 18px;
}
.estatisticas-tabela table { width: 100%; border-collapse: collapse; }
.estatisticas-tabela th, .estatisticas-tabela td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--borda);
}
.estatisticas-tabela thead { background: var(--fundo); }
.estatisticas-tabela tbody tr:last-child > * { border-bottom: 0; }
.estatisticas-turma-ativa { background: #edf2ff; }
.estatisticas-tabela .link-btn { width: auto; margin: 0; padding: 0; }
#detalheEstatisticasProva summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.estatisticas-faixas {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px;
  border: 1px solid var(--borda);
  border-radius: 12px;
}
.estatisticas-faixas li {
  display: grid;
  grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 3ch;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.estatisticas-faixas meter { width: 100%; height: 16px; }
.estatisticas-faixas meter::-webkit-meter-optimum-value { background: var(--azul); }
.estatisticas-faixas meter::-moz-meter-bar { background: var(--azul); }
.estatisticas-faixas strong { text-align: right; font-variant-numeric: tabular-nums; }

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-info-grid > div,
.detail-disc-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}

.detail-info-grid span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 5px;
}

.detail-info-grid strong {
  font-size: 16px;
}

.detail-disc-box {
  margin-top: 10px;
  line-height: 1.5;
}

.detail-action-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 860px) {
  .detalhe-top-row,
  .detalhe-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .detalhe-dashboard,
  .detail-info-grid,
  .detail-action-strip {
    grid-template-columns: 1fr;
  }
}

/* Supabase sync */
.sync-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
}

.sync-box p {
  margin: 4px 0 0;
}

.sync-btn {
  width: auto;
  min-width: 240px;
  margin: 0;
}

@media (max-width: 760px) {
  .sync-box {
    align-items: stretch;
    flex-direction: column;
  }
  .sync-btn {
    width: 100%;
  }
}

/* Supabase sync - v1.22 */
.sync-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sync-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-btn {
  width: auto;
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
}

.status-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

@media (max-width: 760px) {
  .sync-panel { flex-direction: column; align-items: flex-start; }
  .sync-actions { width: 100%; }
  .sync-btn { width: 100%; }
}

.sync-auto-badge {
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  font-weight: 700;
  white-space: nowrap;
}
.duvidosa { color: #9a6700; font-weight: 700; }
.revisao-resposta { min-width: 92px; padding: 7px 9px; border: 2px solid #e0a800; border-radius: 8px; background: #fffbea; }
#screen-scanner #cameraCard .video-wrap { max-height: none; }
#scannerOverlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
#scannerPoligono { fill: rgba(34,197,94,.12); stroke: #22c55e; stroke-width: 5; vector-effect: non-scaling-stroke; }
#scannerInstrucao { text-align: center; font-weight: 600; }
#scannerProgresso { width: 100%; height: 12px; accent-color: #22c55e; }
#resultadoCard .table-wrap { max-height: 48vh; overflow: auto; }
#resultadoCard thead { position: sticky; top: 0; background: #f1f5f9; z-index: 1; }

@media (min-width: 861px) {
  body { padding-left: var(--sidebar); }
  body.aguardando-login { padding-left: 0; }
  .barra-lateral {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    background: #14213d;
  }
  .menu {
    position: static;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    overflow: auto;
  }
  .menu-btn { text-align: left; }
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: clamp(20px, 4vw, 44px);
  color: white;
  background: linear-gradient(115deg, #172849, #284aae);
  border-color: transparent;
}
.dashboard-hero h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; }
.dashboard-hero p { margin: 8px 0 0; color: #e1e9ff; }
.dashboard-hero button { width: auto; margin: 0; color: #203ab0; background: white; }
.dashboard-hero button:hover { background: #e6edff; }
.dashboard-stats { gap: 12px; margin: 0 0 16px; }
.dashboard-stats .mini-card {
  min-width: 0;
  padding: clamp(12px, 2vw, 22px);
  text-align: left;
  background: var(--card);
  border-top: 3px solid var(--azul);
}
.dashboard-stats .mini-card strong { margin: 5px 0 0; font-size: clamp(24px, 3.5vw, 36px); }
.dashboard-shortcuts h3, .result-summary h3 { margin: 0 0 12px; }
.dashboard-shortcuts button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  text-align: left;
  color: var(--azul-escuro);
  background: #eef2ff;
  border: 1px solid #dbe4ff;
}
.dashboard-shortcuts button:hover { background: #e0e8ff; }
.table-wrap, .table-shell { border: 1px solid var(--borda); border-radius: 10px; }
.table-wrap { margin-top: 12px; }
.table-wrap > table { margin-top: 0; }
.table-wrap tbody tr:nth-child(even) { background: #f8faff; }
.result-summary {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: #f8faff;
}
.result-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.result-summary-row + .result-summary-row { margin-top: 8px; }
.result-summary-row label { display: flex; justify-content: space-between; gap: 8px; margin: 0; }
.result-summary-row meter { width: 100%; height: 16px; }

@media (max-width: 640px) {
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-shortcuts .grid, .result-summary-row { grid-template-columns: 1fr; }
  .result-summary-row { gap: 3px; }
}
.scanner-salvar { position: sticky; bottom: 0; background: white; padding: 8px 0; z-index: 2; }
.scanner-salvar button { width: 100%; min-height: 52px; font-size: 18px; }
