html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

:root {
  --page-bg: #e5e7eb;
  --card-border: #111827;
  --marker-size-mm: 6mm;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --section-border: #6b7280;
  --section-bg: #f9fafb;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--page-bg);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.button:hover,
.button:focus-visible {
  filter: brightness(0.95);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button.button--ghost {
  background: transparent;
  color: #0f766e;
}

.button.button--ghost:hover,
.button.button--ghost:focus-visible {
  background: rgba(15, 118, 110, 0.08);
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #d1d5db;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: flex-start;
}

.toolbar label {
  font-size: 14px;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbar label.grow {
  flex: 1 1 220px;
}

.toolbar input[type="number"],
.toolbar input[type="text"] {
  width: 100%;
  padding: 4px 6px;
  font-size: 14px;
}

.toolbar .file-input input[type="file"] {
  font-size: 13px;
}

.toolbar button {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
}

.toolbar .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #047857;
  background: #059669;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.toolbar .link-button.link-button--outlined {
  background: #fff;
  color: #047857;
  border-color: #047857;
}

.toolbar button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.toolbar button.secondary {
  background: #6b7280;
  color: #fff;
  border-color: #4b5563;
}

.toolbar button:hover {
  filter: brightness(0.95);
}

.toolbar .link-button:hover {
  filter: brightness(0.95);
}

.toolbar .link-button.link-button--outlined:hover {
  background: #ecfdf5;
}

.toolbar .hint {
  font-size: 12px;
  color: #6b7280;
}

.toolbar-status {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #374151;
}

/* Página A4 */
.page-wrapper {
  padding: 16px;
}

.preview-target {
  display: flex;
  justify-content: center;
}

.page {
  width: 210mm;
  height: 297mm;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  position: relative;
  padding: 10mm;
  box-sizing: border-box;
}

.toolbar--simple {
  align-items: center;
  gap: 8px 12px;
}

.toolbar--simple .link-button {
  font-size: 15px;
}

.hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* Página de criação */
.creation-wrapper {
  min-height: calc(100vh - 64px);
  padding: 32px 8px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.creation-card {
  min-width: 95%;
  /*max-width: 1320px;*/
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.creation-card__intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.creation-card__intro h1 {
  margin: 0;
  font-size: 30px;
  color: #0f172a;
}

.creation-card__intro p {
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.6;
}

.creation-layout {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(560px, 1fr);
  gap: 40px;
  align-items: start;
}

.creation-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.creation-panel--preview {
  position: sticky;
  top: 24px;
}

.config-card,
.creation-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.config-card__header h2,
.creation-preview__header h2 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.config-card__header p,
.creation-preview__header p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 15px;
}

.creation-preview__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.creation-preview__copy {
  flex: 1 1 280px;
  min-width: 0;
}

.preview-navigator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.preview-navigator__details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-navigator__label {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-navigator__counter {
  font-size: 13px;
  color: #475569;
}

.preview-navigator__control {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid #cbd5f5;
  background: #fff;
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.preview-navigator__control:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.preview-navigator__control:hover:not(:disabled) {
  background: #f1f5f9;
}

.preview-navigator__control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .preview-navigator {
    width: 100%;
    justify-content: space-between;
  }

  .creation-preview__header {
    flex-direction: column;
  }
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.config-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.form-field span {
  font-weight: 600;
}

.form-field input {
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  font-family: inherit;
}

.form-field select {
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  font-family: inherit;
  background-color: #fff;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field--static p {
  margin: 0;
}

.blank-mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  background: #eef2ff;
  color: #312e81;
  box-shadow: inset 0 0 0 1px rgba(49, 46, 129, 0.1);
}

.blank-mode-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

.blank-mode-indicator[data-mode="append"] {
  background: #ecfdf5;
  color: #065f46;
  box-shadow: inset 0 0 0 1px rgba(6, 95, 70, 0.15);
}

.blank-mode-indicator[data-mode="only"] {
  background: #fef3c7;
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgba(146, 64, 14, 0.15);
}

.config-hint {
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
  margin: -4px 0 0;
}

.config-hint--muted {
  color: #9ca3af;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.config-actions--secondary {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 4px;
}

.creation-card button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
  transition: filter 120ms ease, transform 120ms ease;
}

.creation-card button.primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}

.creation-card button.secondary {
  background: #fff;
  border-color: #0f172a;
  color: #0f172a;
}

.creation-card button:hover {
  filter: brightness(0.96);
}

.creation-preview__surface {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  min-height: 480px;
  overflow: auto;
}

.creation-preview__surface .page {
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .creation-layout {
    grid-template-columns: 1fr;
  }

  .creation-panel--preview {
    position: static;
  }
}

.card {
  position: relative;
  border: 0.5mm solid var(--card-border);
  width: 100%;
  height: 100%;
  padding: 4mm;
  display: flex;
  flex-direction: column;
  gap: 2.5mm;
}

/* Página de upload */
.upload-wrapper {
  min-height: calc(100vh - 64px);
  padding: 32px 8px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.upload-card {
  min-width: 95%;
  max-width: 1320px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.upload-card__intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-card__intro h1 {
  margin: 0;
  font-size: 28px;
  color: #0f172a;
}

.upload-card__intro p {
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.7;
}

.upload-card__layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(640px, 1fr);
  grid-template-areas: 'form info';
  gap: 48px;
  align-items: start;
}

.upload-card__column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-card__column--info {
  grid-area: info;
  gap: 24px;
}

.upload-card__column--form {
  grid-area: form;
  gap: 24px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.upload-form__note {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.upload-form button {
  align-self: center;
}

.dropzone {
  position: relative;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 28px 22px;
  text-align: center;
  background: #f8fafc;
  color: #1f2937;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone:focus {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.dropzone.is-dragover {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.dropzone.has-file {
  border-color: #2563eb;
  background: #f1f5ff;
}

.dropzone__feedback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.dropzone__file,
.dropzone__status {
  margin: 0;
}

.dropzone .upload-status {
  width: 100%;
  text-align: center;
}

.dropzone__status {
  font-weight: 500;
}

.dropzone__icon {
  font-size: 36px;
  margin-bottom: 0;
}

.dropzone__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.dropzone__hint {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.dropzone__browse {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

.dropzone__browse:hover,
.dropzone__browse:focus {
  text-decoration: none;
}

.upload-card label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.upload-card input[type="file"] {
  padding: 6px 0;
}


.upload-card button {
  align-self: center;
  background: #2563eb;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  transition: filter 120ms ease, transform 120ms ease;
  min-width: 220px;
}

.upload-card button:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}


.upload-status {
  margin: 0;
  font-size: 14px;
  color: #1f2937;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 12px 14px;
  border: 1px solid transparent;
}

.upload-status--muted {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.upload-status.error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.upload-status.success {
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.page-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-summary h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.page-summary__message {
  margin: 0;
  color: #374151;
  font-size: 14px;
}

.page-summary__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-summary__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  font-size: 14px;
}

.page-summary__item strong {
  font-weight: 600;
  color: #1f2937;
}

.page-summary__item span {
  color: #4b5563;
}

.page-summary__item--success {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.page-summary__item--success strong {
  color: #166534;
}

.page-summary__item--error {
  border-color: #fecaca;
  background: #fee2e2;
}

.page-summary__item--error strong {
  color: #b91c1c;
}

.page-summary__item--warning {
  border-color: #fcd34d;
  background: #fef3c7;
}

.page-summary__item--warning strong {
  color: #92400e;
}


.upload-insights {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.upload-insights__empty {
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  padding: 20px 24px;
  background: #f8fafc;
  color: #475569;
  font-size: 15px;
}

.upload-insights__content {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 340px) minmax(380px, 1fr);
  align-items: stretch;
}

.upload-insights__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-insights__header h2 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.upload-insights__summary {
  margin: 0;
  color: #334155;
  font-size: 15px;
}

.upload-insights__panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.upload-insights__panel--file,
.upload-insights__panel--cards {
  min-height: 100%;
}

.upload-insights__panel--cards {
  background: #f1f5f9;
  border-color: #dbeafe;
}

.upload-insights__panel--cards .upload-insights__group {
  background: #fff;
  border-color: #dbeafe;
}

.upload-insights__placeholder {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.upload-insights__panel-title {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.upload-insights__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
}

.upload-insights__group h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.data-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
}

.data-list dt {
  font-weight: 600;
  font-size: 13px;
  color: #475569;
}

.data-list dd {
  margin: 4px 0 0;
  font-size: 14px;
  color: #0f172a;
}

.tag-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  padding: 6px 12px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 13px;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.insights-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.insights-table th,
.insights-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

.insights-table th {
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-badge--success {
  background: #dcfce7;
  color: #15803d;
}

.status-badge--warning {
  background: #fef3c7;
  color: #b45309;
}

.status-badge--assumed {
  background: #fff7ed;
  color: #9a3412;
}

.status-badge--error {
  background: #fee2e2;
  color: #b91c1c;
}

.status-badge--qr_error {
  background: #ffe4e6;
  color: #be123c;
}

.omr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.omr-pill--success {
  background: #ecfccb;
  color: #3f6212;
}

.omr-pill--error {
  background: #fee2e2;
  color: #b91c1c;
}

.omr-pill__meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.empty-indicator {
  color: #64748b;
  font-style: italic;
}

@media (max-width: 1024px) {
  .upload-card__layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      'form'
      'info';
  }

  .upload-card__column--info,
  .upload-card__column--form {
    grid-area: auto;
  }

  .upload-insights__content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .upload-card {
    padding: 28px 20px;
  }

  .upload-card__layout {
    grid-template-columns: 1fr;
    gap: 32px;
    grid-template-areas: none;
  }

  .upload-form {
    padding: 20px;
  }
}

/* ==temporario== debug overlays */
.card .temp-debug-marker {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  pointer-events: none;
  z-index: 50;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.card .temp-debug-marker--primary {
  border-color: #ef4444;
}

.card .temp-debug-marker--backup {
  border-color: #2563eb;
}

.marker {
  position: absolute;
  width: var(--marker-size-mm);
  height: var(--marker-size-mm);
  background: #000;
}

.marker-tl {
  top: 3mm;
  left: 6mm;
}

.marker-tr {
  top: 3mm;
  right: 6mm;
}

.marker-bl {
  bottom: 7mm;
  left: 6mm;
}

.marker-br {
  bottom: 7mm;
  right: 6mm;
}

.marker-backup {
  background: #fff;
  border: 0.4mm solid #000;
  box-sizing: border-box;
  overflow: hidden;
  width: 3mm;
  height: 3mm;

}

.marker-backup::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, #000 0 50%, transparent 50%);
}

.marker-backup-left {
  bottom: 40mm;
  left: 2mm;
}

.marker-backup-right {
  bottom: 40mm;
  right: 2mm;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 2.5mm;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-heading {
  display: flex;
  flex-direction: column;
  gap: 1mm;
}

.card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3mm;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-title--primary,
.card-title--secondary {
  flex: 0 0 auto;
}

.card-title--secondary {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.card-title-value {
  display: inline-block;
  max-width: 100%;
}

.brand-logo {
  width: 32mm;
  max-width: 100%;
}

.section {
  border: 0.3mm solid var(--section-border);
  padding: 2.3mm;
  display: flex;
  flex-direction: column;
  gap: 2.2mm;
  background: var(--section-bg);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1f2937;
}



.section-info {
  flex-direction: row;
  gap: 3.2mm;
  align-items: stretch;
}

.section-info__pane {
  display: flex;
  flex-direction: column;
  gap: 2mm;
}

.section-info__pane--details {
  flex: 1 1 auto;
  min-width: 0;
}

.section-info__pane--details .info-grid {
  margin-top: 0.4mm;
}

.section-info__pane--qr {
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.section-info__pane--qr .qr-card {
  align-self: flex-start;
}


.qr-card {
  margin: 0;
  /*padding: 1mm 1mm 1mm;*/
  border: 0.3mm solid #d1d5db;
  border-radius: 1.6mm;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  box-shadow: 0 0 0.5mm rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4mm;
  max-width: 32mm;
}

.qr-card__code {
  width: 28mm;
  height: 28mm;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-card__code-placeholder {
  width: 22mm;
  height: 22mm;
  border-radius: 1mm;
  border: 0.3mm dashed #e5e7eb;
  background: #f9fafb;
  box-shadow: inset 0 0 0.5mm rgba(15, 23, 42, 0.08);
}

.qr-card__code img,
.qr-card__code canvas {
  width: 100% !important;
  height: 100% !important;
  padding: 2mm;
  border-radius: 1mm;
  image-rendering: pixelated;
}

.qr-card__code--fallback {
  font-size: 8px;
  text-align: center;
  color: #6b7280;
  padding: 4mm;
  border: 0.3mm dashed #d1d5db;
  border-radius: 1mm;
}

.qr-card__caption {
  margin: 0;
  font-size: 7px;
  text-align: center;
  color: #4b5563;
  line-height: 1.35;
  max-width: 30mm;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.4mm;
  font-size: 11px;
}

.info-field {
  display: flex;
  flex-direction: column;
  gap: 1mm;
}

.info-field--wide {
  grid-column: span 2;
}

.info-field--full {
  grid-column: 1 / -1;
}


.info-label {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 9px;
}

.info-line {
  border-bottom: 0.2mm solid #9ca3af;
  min-height: 11px;
  display: flex;
  align-items: flex-end;
  font-size: 10px;
  color: #1f2937;
  padding-bottom: 1mm;
}

.info-value {
  display: inline-block;
  min-height: 10px;
  padding-right: 1mm;
  word-break: break-word;
}

.section-instructions {
  gap: 1.8mm;
}

.instructions-list {
  margin: 0;
  padding-left: 5mm;
  font-size: 10px;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  gap: 1.2mm;
}

.instructions-list li {
  line-height: 1.4;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-answers {
  position: relative;
  flex: 1;
  gap: 2.6mm;
  background: #fff;
  padding-top: 10mm;
  padding-bottom: 6mm;
}

.section-answers .marker {
  position: absolute;
}

.questions-grid {
  display: flex;
  flex: 1;
  gap: 3mm;
  font-size: 10px;
  justify-content: center;
}

.questions-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.1mm;
}

.question-row {
  display: flex;
  align-items: center;
  gap: 1.8mm;
  min-height: 5.2mm;
}

.question-row:nth-child(odd) {
  background: #e5e7eb;
  border-radius: 1mm;
}

.q-num {
  width: 7mm;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.q-options {
  display: flex;
  gap: 1.8mm;
  flex-wrap: nowrap;
}

.bubble {
  width: 4.6mm;
  height: 4.6mm;
  border-radius: 999px;
  border: 0.6mm solid #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #b9c5d6;
  background: #fff;
}

.questions-grid.is-tight {
  gap: 2.4mm;
}

.questions-grid.is-tight .questions-col {
  gap: 0.9mm;
}

.questions-grid.is-tight .question-row {
  gap: 1.5mm;
  min-height: 4.8mm;
}

.questions-grid.is-tight .q-options {
  gap: 1.5mm;
}

.questions-grid.is-tight .bubble {
  width: 4.4mm;
  height: 4.4mm;
  font-size: 7.5px;
}

.bubble span {
  pointer-events: none;
}

.render-sandbox {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Impressão */
@page {
  size: A4;
  margin: 10mm;
}

@media print {
  body {
    background: #fff;
  }

  .toolbar {
    display: none;
  }

  .page-wrapper {
    padding: 0;
  }

  .page {
    margin: 0;
    box-shadow: none;
  }
}


.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

.invisible {
  visibility: hidden;
}

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

@media only screen and (min-width: 35em) {
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
}

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

.menu-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #e0f2fe 0%, #f9fafb 100%);
  color: #0f172a;
}

.menu-hero {
  text-align: center;
  padding: 48px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.menu-hero__logo {
  width: 96px;
  height: auto;
}

.menu-hero__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0;
}

.menu-grid {
  width: min(960px, 90vw);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 0 40px;
}

.menu-card {
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(14, 116, 144, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.5rem;
  color: #0f172a;
}

.menu-card p {
  margin: 0 0 16px;
  line-height: 1.5;
  color: #334155;
}

.menu-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #0f766e;
}

.menu-card__cta::after {
  content: '\2192';
  font-size: 1.1em;
}

.menu-card:focus,
.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.menu-footer {
  margin-top: auto;
  padding: 16px;
  text-align: center;
  font-size: 0.95rem;
  color: #1f2937;
}

.api-mode-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  font-family: var(--font-body);
}

.api-mode-toggle__button {
  border: 1px solid rgba(15, 23, 42, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 10px 18px;
  min-height: 48px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  font-size: 14px;
  line-height: 1.2;
  transition: transform 120ms ease, filter 120ms ease;
}

.api-mode-toggle__button[aria-pressed='false'] {
  background: rgba(31, 41, 55, 0.95);
}

.api-mode-toggle__button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.api-mode-toggle__label {
  font-weight: 600;
}

.api-mode-toggle__helper {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.95);
}

@media (min-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.assessments-body {
  background: var(--page-bg);
}

.assessments-wrapper {
  min-height: calc(100vh - 64px);
  padding: 32px 8px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.assessments-card {
  width: 95%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.assessments-header,
.assessments-search {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.assessments-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.assessments-header p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}


.assessments-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.assessments-stats__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assessments-stats__value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.assessments-stats__label {
  color: #64748b;
  font-size: 0.9rem;
}

.assessments-search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.assessments-search__field {
  align-self: center;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  color: #374151;
}

.assessments-search__field input {
  padding: 10px 12px;
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  font-size: 1rem;
}

.assessments-search__clear {
  align-self: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}

.assessments-search__clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.assessments-counter {
  margin-left: auto;
  color: #475569;
  font-size: 0.95rem;
}

.assessments-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.assessments-placeholder {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  border-radius: 16px;
  border: 2px dashed rgba(15, 23, 42, 0.1);
  color: #475569;
  background: #fff;
}

.assessments-placeholder--error {
  border-color: #dc2626;
  color: #b91c1c;
}

.assessment-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.assessment-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.assessment-card__header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.assessment-card__code {
  font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ecfeff;
  color: #0f766e;
}

.assessment-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.assessment-card__badge {
  background: #f1f5f9;
  color: #0f172a;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.assessment-card__date {
  color: #475569;
  font-size: 0.9rem;
}

.assessment-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.assessment-card__stat {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.assessment-card__stat-label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.assessment-card__stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  color: #0f172a;
}

.assessment-card__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.assessment-card__details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.assessment-card__details:hover,
.assessment-card__details:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.3);
}

.assessment-card__details[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 640px) {
  .assessments-header,
  .assessments-search {
    padding: 0;
  }

  .assessments-counter {
    width: 100%;
  }

  .assessment-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.assessment-details-body {
  background: var(--page-bg);
}

.assessment-details-wrapper {
  min-height: calc(100vh - 64px);
  padding: 32px 12px 48px;
  display: flex;
  justify-content: center;
}

.assessment-details-card {
  width: 95%;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.assessment-details-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.assessment-details-card__title h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #0f172a;
}

.assessment-details-card__code {
  font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
  background: #ecfeff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.95rem;
  color: #0f766e;
  margin-top: 8px;
}

.assessment-details-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.assessment-details-card__stats dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.assessment-details-card__stats dd {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #0f172a;
}

.assessment-details-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  font-size: 0.95rem;
  color: #475569;
}

.assessment-details-card__meta-item {
  margin: 0;
  flex: 1 1 260px;
}

.assessment-details-export {
  border: 1px solid rgb(29, 78, 216);
  background: #fff;
  color: rgb(29, 78, 216);
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.assessment-details-export:hover,
.assessment-details-export:focus-visible {
  background: rgb(29, 78, 216);
  color: #fff;
  transform: translateY(-1px);
}

.assessment-details-export:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5f5;
  box-shadow: none;
}

.assessment-details-card__body {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.assessment-details-message {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.assessment-details-message--muted {
  background: #f8fafc;
  color: #475569;
  border: 1px dashed rgba(71, 85, 105, 0.4);
}

.assessment-details-message--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.assessment-answer-key {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 20px;
}

.assessment-answer-key__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.assessment-answer-key__label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 700;
}

.assessment-answer-key__title {
  margin: 4px 0 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.assessment-answer-key__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.assessment-answer-key__status {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  min-width: 220px;
}

.assessment-answer-key__status--success {
  color: #15803d;
}

.assessment-answer-key__status--error {
  color: #b91c1c;
}

.assessment-answer-key__status--dirty {
  color: #0f172a;
  font-weight: 600;
}

.assessment-answer-key__input {
  width: 100%;
  min-width: 72px;
  max-width: 120px;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.assessment-answer-key__input::placeholder {
  color: #94a3b8;
}

.assessment-answer-key__input:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 1px;
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.16);
}

.assessment-details-table__row--answer-key {
  background: #f8fafc;
}

.assessment-details-table__student--answer-key {
  font-weight: 700;
  color: #0f172a;
}

.assessment-details-table__cell--answer-key {
  background: transparent;
}

.assessment-details-table__cell--placeholder {
  text-align: center;
  font-weight: 600;
  color: #475569;
}

.assessment-details-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.assessment-details-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.assessment-details-table th,
.assessment-details-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: center;
  font-size: 0.95rem;
}

.assessment-details-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #475569;
}

.assessment-details-table__student {
  text-align: left;
  min-width: 180px;
}

.assessment-details-table__student-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    color 0.15s ease;
}

.assessment-details-table__student-button:hover,
.assessment-details-table__student-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
  border-color: #0f766e;
  color: #0f766e;
  outline: none;
}

.assessment-details-table__student-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.4);
  outline-offset: 2px;
}

.assessment-details-table__student-button:active {
  transform: translateY(0);
}

.assessment-details-table__student-id {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.assessment-details-table__student-name {
  display: block;
  font-size: 0.85rem;
  color: #475569;
}

.assessment-details-table__cell--empty {
  color: #94a3b8;
  font-style: italic;
}

.assessment-details-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 4px 0;
}

.assessment-details-pagination__info {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.assessment-details-pagination__info strong {
  color: #0f172a;
}

.assessment-details-pagination__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assessment-details-pagination__button {
  border: 1px solid #cbd5f5;
  background: #fff;
  color: #1e3a8a;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.assessment-details-pagination__button:hover,
.assessment-details-pagination__button:focus-visible {
  background: rgb(29, 78, 216);
  border-color: rgb(29, 78, 216);
  color: #fff;
  transform: translateY(-1px);
}

.assessment-details-pagination__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e2e8f0;
  transform: none;
}

.assessment-details-pagination__button--active {
  background: rgb(29, 78, 216);
  border-color: rgb(29, 78, 216);
  color: #fff;
  cursor: default;
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.25);
  opacity: 1;
  transform: none;
}

body.student-modal-open {
  overflow: hidden;
}

.student-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.student-modal--visible {
  opacity: 1;
  pointer-events: auto;
}

.student-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.student-modal__dialog {
  position: relative;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
  background: #fff;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.student-modal--visible .student-modal__dialog {
  transform: translateY(0);
}

.student-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.student-modal__close:hover,
.student-modal__close:focus-visible {
  background: rgba(15, 23, 42, 0.1);
  transform: scale(1.05);
}

.student-modal__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.student-modal__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-modal__layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.6fr) minmax(280px, 1.4fr);
  grid-template-areas:
    "form form"
    "answers card";
  gap: 24px;
}

.student-modal__section {
  background: #f8fafc;
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  height: 100%;
}

.student-modal__section--form {
  grid-area: form;
}

.student-modal__section--card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-area: card;
}

.student-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-form__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-form__identifier {
  margin: 0;
  font-size: 0.85rem;
  color: #0f172a;
  font-weight: 600;
}

.student-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.student-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
}

.student-form__field input {
  border-radius: 12px;
  border: 1px solid #cbd5f5;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.student-form__field input:focus-visible {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.student-form__field input[aria-invalid="true"] {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.04);
}

.student-form__actions {
  display: flex;
  flex-wrap: wrap;
  padding-top: 12px;
  gap: 12px;
  justify-content: flex-end;
}

.student-form__status--error {
  color: #dc2626;
}

.student-card-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-card-panel__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-card-panel__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.student-card-panel__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.student-card-panel__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.student-card-panel__list-button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.student-card-panel__list-button strong {
  display: block;
  font-size: 0.95rem;
  color: #0f172a;
}

.student-card-panel__list-button small {
  color: #64748b;
}

.student-card-panel__list-button:hover,
.student-card-panel__list-button:focus-visible {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.student-card-panel__list-button[aria-selected="true"] {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
}

.student-card-panel__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.student-card-panel__status {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.student-card-panel__status--error {
  color: #dc2626;
}

.student-modal__answers {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  border-radius: 32px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  grid-area: answers;
}

.student-modal__answers-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-modal__answers-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.student-modal__answers-header p {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
}

.student-modal__answers-table {
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  background: #fff;
}

.student-modal__answers-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.student-modal__answers-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.student-modal__answers-status {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.student-modal__answers-status--error {
  color: #dc2626;
}

.student-modal__answers-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 4px 0 0;
}

.student-modal__answers-pagination-summary {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  flex: 1;
  text-align: center;
}

.student-modal__answers-pagination-button {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.student-modal__answers-pagination-button:hover,
.student-modal__answers-pagination-button:focus-visible {
  background: rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

.student-modal__answers-pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.student-modal__answers-table-grid {
  width: 100%;
  border-collapse: collapse;
}

.student-modal__answers-table-grid th,
.student-modal__answers-table-grid td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.student-modal__answers-table-grid th {
  font-weight: 600;
  color: #0f172a;
  background: rgba(15, 23, 42, 0.03);
}

.student-modal__answers-table-grid td {
  vertical-align: top;
}

.student-modal__answers-table-grid tbody th {
  background: transparent;
  font-weight: 600;
  color: #0f172a;
}

.student-modal__answers-table-grid tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.015);
}

.student-modal__answers-row--pending td {
  background: rgba(15, 118, 110, 0.08);
}

.student-modal__answers-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 8px 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.student-modal__answers-value {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-modal__answers-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.student-modal__answers-current-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}

.student-modal__answers-current-value.student-modal__answers-cell--empty {
  font-weight: 500;
  color: #94a3b8;
}

.student-modal__answers-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.student-modal__answers-select-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.student-modal__answers-actions button {
  min-width: 140px;
}

.student-modal__answers-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.student-modal__answers-source--manual {
  background: rgba(251, 191, 36, 0.15);
  color: #92400e;
  border-color: rgba(251, 191, 36, 0.5);
}

.student-modal__answers-source--omr {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.5);
}

.student-modal__answers-source--empty {
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
}

.student-modal__answers-clear {
  border: none;
  background: none;
  color: #dc2626;
  font-weight: 600;
  cursor: pointer;
}

.student-modal__answers-clear:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.student-modal__answers-fallback {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.student-modal__answers-cell--empty {
  color: #94a3b8;
}

.student-modal__label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #94a3b8;
}

.student-modal__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: #0f172a;
}

.student-modal__subtitle {
  margin: 0;
  color: #475569;
  font-weight: 600;
}

.student-modal__details {
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.student-modal__details div {
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.student-modal__details dt {
  margin: 0 0 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.student-modal__details dd {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
  font-weight: 600;
  word-break: break-word;
}

.student-modal__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: 20px;
  height: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.student-modal__insights {
  display: grid;
  grid-template-columns: minmax(240px, 0.25fr) minmax(0, 0.75fr);
  gap: 24px;
  align-items: flex-start;
}


.student-modal__card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-modal__card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.student-modal__card-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.student-modal__card-figure {
  margin: 0;
  padding: 16px;
  border-radius: 20px;
  border: 1px dashed rgba(15, 23, 42, 0.15);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 220px;
  justify-content: center;
}

.student-modal__card-image {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.15);
}

.student-modal__card-caption {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.student-modal__card-link {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}

.student-modal__card-link:hover,
.student-modal__card-link:focus-visible {
  text-decoration: underline;
}

.student-modal__card-fallback {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .student-modal {
    padding: 16px;
  }

  .student-modal__dialog {
    width: 100%;
    border-radius: 20px;
  }
}

@media (max-width: 1024px) {
  .student-modal__layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "answers"
      "card";
  }
}

@media (max-width: 768px) {
  .assessment-details-card {
    padding: 24px;
  }

  .assessment-details-card__header {
    flex-direction: column;
  }

  .assessment-details-card__meta {
    flex-direction: column;
    align-items: stretch;
  }

  .assessment-details-export {
    width: 100%;
    text-align: center;
  }

  .student-form__grid {
    grid-template-columns: 1fr;
  }

  .student-modal__answers-actions {
    width: 100%;
    justify-content: stretch;
  }

  .student-modal__answers-actions .button {
    flex: 1 1 auto;
  }
}

