:root {
  --bg: #f8f5ef;
  --surface: #ffffff;
  --surface-soft: #fffaf0;
  --text: #211f1b;
  --muted: #6f675d;
  --primary: #7b2f21;
  --primary-dark: #5c2218;
  --accent: #d59a2f;
  --accent-soft: #f7dfaa;
  --success: #13795b;
  --warning: #a66b00;
  --border: #e4d8c5;
  --shadow: 0 18px 50px rgba(69, 48, 22, 0.12);
  --overlay-bg: rgba(255, 255, 255, 0.86);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(213, 154, 47, 0.2), transparent 28rem),
    linear-gradient(180deg, #fffdf8 0%, var(--bg) 100%);
  color: var(--text);
}

a { color: inherit; }

button, input, select { font: inherit; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff8ea;
  font-size: 1.65rem;
  box-shadow: 0 12px 30px rgba(123, 47, 33, 0.25);
}

.brand strong { display: block; font-size: 1.05rem; }
.brand small { color: var(--muted); }
.header-actions { display: flex; gap: 0.6rem; align-items: center; }

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 1.5rem;
  align-items: stretch;
  padding: clamp(2rem, 6vw, 5rem) 0 2rem;
}

.hero-copy,
.hero-card,
.profile-card,
.summary-card,
.progress-panel,
.module-card,
.preview-card {
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-copy {
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin-bottom: 0.35rem;
}

.hero-copy > p:not(.eyebrow):not(.message) {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.75rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: var(--surface); color: var(--primary); border-color: var(--border); }
.button-ghost { background: transparent; color: var(--muted); border-color: var(--border); }

.hero-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 300px;
  background:
    linear-gradient(160deg, rgba(123, 47, 33, 0.95), rgba(33, 31, 27, 0.95)),
    var(--primary);
  color: #fff8ea;
}

.hero-card strong { font-size: 2.2rem; line-height: 1; letter-spacing: -0.04em; margin-bottom: 0.8rem; }
.hero-card p { color: rgba(255, 248, 234, 0.8); line-height: 1.55; }
.score-label { color: var(--accent-soft); font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }

.dashboard { display: grid; gap: 1.25rem; padding-top: 1.25rem; }
.dashboard-topline { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(240px, 0.9fr) minmax(320px, 1.2fr); gap: 1rem; align-items: stretch; }
.profile-card { display: flex; align-items: center; gap: 1rem; border-radius: var(--radius-lg); padding: 1.25rem; }
.profile-card img { border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.profile-card h1 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.03em; margin-bottom: 0.25rem; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.summary-card { border-radius: var(--radius-md); padding: 1rem; }
.summary-card span { display: block; color: var(--muted); font-size: 0.88rem; margin-bottom: 0.35rem; }
.summary-card strong { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.05em; }

.progress-panel { border-radius: var(--radius-lg); padding: 1.25rem; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.progress-track { width: 100%; height: 0.85rem; border-radius: 999px; overflow: hidden; background: #efe5d5; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 240ms ease; }

.modules-grid, .preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.module-card, .preview-card { border-radius: var(--radius-md); padding: 1.1rem; }
.module-card { display: grid; gap: 0.85rem; }
.module-card-header { display: flex; align-items: flex-start; gap: 0.75rem; }
.module-icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 16px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 1.45rem; flex: 0 0 auto; }
.module-card h3, .preview-card h3 { font-size: 1.06rem; margin-bottom: 0.25rem; }
.module-card p, .preview-card p { color: var(--muted); line-height: 1.45; margin-bottom: 0; }

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.status-pill[data-status="em_andamento"] { color: var(--warning); background: #fff6df; }
.status-pill[data-status="concluido"] { color: var(--success); background: #e8f6f1; }

.module-controls { display: grid; gap: 0.65rem; padding-top: 0.25rem; border-top: 1px solid var(--border); }
.control-row { display: grid; gap: 0.35rem; }
.control-row label { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.control-row select, .control-row input[type="range"] { width: 100%; }
.control-row select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
}
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 0.7rem; align-items: center; }
.pct-label { font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 900; }
.module-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.module-actions .button { flex: 1 1 auto; min-height: 2.45rem; font-size: 0.92rem; }

.preview-section { padding-top: 2.5rem; }
.preview-card { background: var(--overlay-bg); box-shadow: none; }
.preview-card strong { display: inline-block; margin-bottom: 0.4rem; color: var(--primary); }

.message { min-height: 1.25rem; color: var(--muted); font-weight: 700; }
.message.error { color: #a22a22; }
.message.success { color: var(--success); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
code { background: #f0e4d2; padding: 0.1rem 0.3rem; border-radius: 0.35rem; }

.app-footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
}
.app-footer p { margin: 0; }

@media (max-width: 940px) {
  .hero, .dashboard-topline { grid-template-columns: 1fr; }
  .modules-grid, .preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .app-header, .app-footer, .section-title-row { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions .button { width: 100%; }
  .summary-grid, .modules-grid, .preview-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 1rem; }
  .hero-actions .button { width: 100%; }

  /* Mobile Font Size Decreases */
  h1 { font-size: 1.8rem !important; }
  h2 { font-size: 1.5rem !important; }
  h3 { font-size: 1.2rem !important; }
  .viewer-title-group h2 { font-size: 1.5rem !important; }
  .admin-header h2 { font-size: 1.5rem !important; }
  .report-main-title { font-size: 1.35rem !important; }
  .report-student-info h2 { font-size: 1.5rem !important; }

  /* Recovering Empty screen spaces (Paddings/Margins) */
  .viewer-view, .admin-view, .report-view {
    padding: 1rem !important;
    margin-top: 1rem !important;
    border-radius: var(--radius-md) !important;
  }
  .viewer-item-card {
    padding: 0.85rem !important;
    gap: 0.75rem !important;
  }
  .viewer-header {
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    gap: 0.75rem !important;
  }
  .admin-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0.5rem 0 !important;
  }
  .admin-sidebar {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding-right: 0 !important;
    padding-bottom: 1rem !important;
  }

  /* Responsive Viewer Header */
  .viewer-item-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  .viewer-item-title {
    width: 100% !important;
    font-size: 1.05rem !important;
  }
  .item-status-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .item-status-select {
    width: 100% !important;
    font-size: 0.75rem !important;
    padding: 0.45rem !important;
  }
  .html-container iframe {
    height: 380px !important;
  }

  /* Report Table Mobile optimization */
  .report-document {
    padding: 1rem !important;
    border: 1px solid #111111 !important;
  }
  .report-stats-summary {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }
  .report-certificate-footer {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.5rem !important;
  }
  .report-certificate-footer .signature-line {
    width: 100% !important;
  }
  .report-table th, .report-table td {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.7rem !important;
  }
}

/* Modais */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(33, 31, 27, 0.45);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 900px;
  animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalEnter {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 800;
}

.button-success {
  background: var(--success);
  color: #fff;
  border: none;
}
.button-success:hover:not(:disabled) {
  background: #0f6149;
}

/* Admin Grid Layout */
.admin-view {
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  margin-top: 1.5rem;
  animation: pageEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-title-group h2 {
  margin: 0;
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
}

.admin-header .button {
  align-self: flex-start;
  min-height: 2.5rem;
  font-size: 0.95rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) 2fr;
  gap: 1.5rem;
  padding: 1rem 0;
  min-height: 500px;
}

.admin-sidebar {
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.admin-sidebar select {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-weight: bold;
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row label {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.form-row textarea {
  min-height: 80px;
  resize: vertical;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* Admin list items */
.admin-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.admin-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.admin-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-item-info strong {
  font-size: 0.95rem;
}

.admin-item-info span {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary);
}

.admin-item-actions {
  display: flex;
  gap: 0.35rem;
}

.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* Viewer Styles */
.viewer-view {
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  margin-top: 1.5rem;
  animation: pageEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.viewer-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.viewer-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.viewer-title-group h2 {
  margin: 0;
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
}

.viewer-header .button {
  align-self: flex-start;
  min-height: 2.5rem;
  font-size: 0.95rem;
}

.viewer-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0;
}

.viewer-item-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.viewer-item-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  flex-wrap: wrap;
}

.viewer-item-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 800;
  flex: 1;
}

.item-status-wrapper {
  margin-left: auto;
}

.item-status-select {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.item-status-select:focus {
  border-color: var(--primary);
}

.viewer-type-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: bold;
  padding: 0.25rem 0.55rem;
  border-radius: 99px;
  background: var(--border);
  color: var(--muted);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.audio-container audio {
  width: 100%;
}

.html-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
}

@media (max-width: 768px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
  }
}

/* Quiz Styles */
.admin-quiz-helper {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-question-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.quiz-option-label:hover {
  background: var(--border);
  border-color: var(--muted);
}

.quiz-option-label input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--primary);
  margin: 0;
  cursor: pointer;
}

/* Feedback states */
.quiz-option-label.correct-choice {
  background: #e8f6f1;
  border-color: var(--success);
  color: var(--success);
}

.quiz-option-label.incorrect-choice {
  background: #fde8e8;
  border-color: #e02424;
  color: #a22a22;
}

.quiz-option-label.unselected-correct-choice {
  border-color: var(--success);
  background: #e8f6f1;
}

.quiz-result-box {
  background: var(--surface-soft);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.quiz-result-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
}

/* Quiz Accordion Styles */
.quiz-accordion {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.quiz-accordion-header {
  transition: background 0.2s ease;
}

.quiz-accordion-header:hover {
  background: var(--border) !important;
}

/* Report & Certificate Styles */
.report-view {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  margin-top: 1.5rem;
  animation: pageEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.report-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.report-document {
  background: #ffffff;
  border: 2px solid #111111;
  padding: 3.5rem;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
  color: #111111;
}

.report-badge-ornament {
  font-size: 4rem;
  color: var(--primary);
  text-align: center;
  line-height: 1;
  opacity: 0.8;
  margin-bottom: 0.5rem;
  user-select: none;
}

.report-main-title {
  font-size: 2rem;
  text-align: center;
  color: #111111;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.report-subtitle {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 3.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.report-student-info {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.report-student-info h2 {
  font-size: 2.2rem;
  color: #111111;
  font-weight: 800;
  margin: 0.4rem 0;
  border-bottom: 2px solid #111111;
  display: inline-block;
  padding: 0 2rem 0.4rem 2rem;
}

.report-student-info .student-email {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.report-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  background: #fdfdfd;
  border: 2px solid #111111;
  padding: 1.25rem;
  margin-bottom: 2.5rem;
}

.report-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.report-stat-item span {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.report-stat-item strong {
  font-size: 1.5rem;
  font-weight: 900;
  color: #111111;
}

.report-details-section {
  margin-bottom: 3.5rem;
}

.report-details-section h3 {
  font-size: 1.15rem;
  color: #111111;
  border-bottom: 2px solid #111111;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.report-details-grid {
  display: block;
  width: 100%;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #111111;
}

.report-table th {
  border: 1px solid #111111;
  padding: 0.6rem 0.8rem;
  text-align: left;
  background-color: #f1f1f1 !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.report-table td {
  border: 1px solid #111111;
  padding: 0.5rem 0.8rem;
  text-align: left;
}

.report-module-header-row td {
  background-color: #f9f9f9 !important;
  font-weight: 700;
  font-size: 0.9rem;
}

.report-item-title-col {
  font-weight: 500;
  line-height: 1.4;
}

.report-certificate-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 2px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}

.report-certificate-footer .date-generated {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.report-certificate-footer .security-hash {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--muted);
  margin: 0.2rem 0 0 0;
}

.report-certificate-footer .signature-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 250px;
}

.report-certificate-footer .signature-line::before {
  content: "";
  display: block;
  width: 100%;
  border-top: 1px solid #333;
  margin-bottom: 0.5rem;
}

.report-certificate-footer .signature-line span {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.report-certificate-footer .signature-line small {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

/* Print Overrides */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Hide everything except report-view and report-document */
  header.app-header,
  footer.app-footer,
  section.dashboard,
  section.viewer-view,
  section.admin-view,
  .report-header-controls,
  .dashboard-topline,
  .progress-panel {
    display: none !important;
  }

  .report-view {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-document {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    padding: 2rem !important;
    max-width: 100% !important;
    margin: 0 !important;
    page-break-inside: avoid;
  }

  .report-stats-summary {
    background: #f8f9fa !important;
    border: 1px solid #cccccc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Dark Theme Variables & Styling Overrides */
body.dark-theme {
  --bg: #121110;
  --surface: #1e1b18;
  --surface-soft: #282420;
  --text: #ece5da;
  --muted: #a69888;
  --primary: #f28b77;
  --primary-dark: #fca898;
  --accent: #e5b35c;
  --accent-soft: #4a3a1d;
  --success: #3ab08c;
  --warning: #f8ab1c;
  --border: #443c32;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  --overlay-bg: rgba(30, 27, 24, 0.94);
  
  background:
    radial-gradient(circle at top left, rgba(229, 179, 92, 0.08), transparent 28rem),
    linear-gradient(180deg, #1c1a17 0%, #121110 100%) !important;
  color: var(--text);
}

body.dark-theme .button-secondary {
  background: #2d2822;
  color: #e5b35c;
  border-color: #4a3c2a;
}

body.dark-theme .button-secondary:hover:not(:disabled) {
  background: #3a332a;
}

body.dark-theme .button-ghost {
  color: #ece5da;
}

body.dark-theme .button-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme code {
  background: #2a2520;
  color: #f28b77;
}

body.dark-theme .module-card {
  background: #201d1a;
  border-color: #383129;
}

body.dark-theme .module-card:hover {
  border-color: #e5b35c;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

body.dark-theme .preview-card {
  background: #201d1a;
  border-color: #383129;
}

body.dark-theme .status-pill[data-status="nao_iniciado"] {
  background: #362e24;
  color: #d59a2f;
}

body.dark-theme .status-pill[data-status="em_andamento"] {
  background: #212c3f;
  color: #5dade2;
}

body.dark-theme .status-pill[data-status="concluido"] {
  background: #17362b;
  color: #2ecc71;
}

body.dark-theme .form-row input, 
body.dark-theme .form-row select, 
body.dark-theme .form-row textarea,
body.dark-theme .admin-sidebar select {
  background: #1e1b18;
  color: #ece5da;
  border-color: #443c32;
}

body.dark-theme .admin-item-card {
  background: #25211c;
  border-color: #443c32;
}

body.dark-theme .quiz-option-label {
  border-color: #443c32;
  background: #25211c;
}

body.dark-theme .quiz-option-label:hover {
  background: #322b24;
}

body.dark-theme .quiz-option-label.correct-choice {
  background: rgba(19, 121, 91, 0.15);
  border-color: #3ab08c;
  color: #3ab08c;
}

body.dark-theme .quiz-option-label.incorrect-choice {
  background: rgba(224, 36, 36, 0.15);
  border-color: #f87171;
  color: #f87171;
}

body.dark-theme .quiz-option-label.unselected-correct-choice {
  border-color: #3ab08c;
  background: rgba(19, 121, 91, 0.08);
}
/* Dashboard Main Columns and Leaderboard Panel */
.dashboard-overview-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.dashboard-main-layout {
  display: block;
  margin-top: 1.5rem;
}

.leaderboard-panel {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

body.dark-theme .leaderboard-panel {
  background: #25211c;
  border-color: #443c32;
}

#leaderboard-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leaderboard-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.leaderboard-row.current-user {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

body.dark-theme .leaderboard-row {
  background: #201d1a;
  border-color: #383129;
}

body.dark-theme .leaderboard-row.current-user {
  background: #2f251c;
  border-color: var(--accent);
}

.leaderboard-rank {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-muted);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.leaderboard-row.current-user .leaderboard-rank {
  color: var(--accent);
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.leaderboard-info {
  flex-grow: 1;
  min-width: 0;
}

.leaderboard-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.leaderboard-xp {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

@media (max-width: 900px) {
  .dashboard-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Apps Table Layout */
.apps-table th, .apps-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.apps-table tbody tr {
  transition: background-color 0.2s ease;
}

.apps-table tbody tr:hover {
  background-color: var(--surface-soft);
}

.apps-table tbody tr:last-child {
  border-bottom: none;
}

/* Star/Favorite Button style */
.btn-star-app {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-star-app:hover {
  transform: scale(1.22);
}

.btn-star-app.favorited {
  color: #f5b041;
  text-shadow: 0 0 2px rgba(245, 176, 65, 0.35);
}

body.dark-theme .apps-table {
  background: #201d1a !important;
}

body.dark-theme .apps-table th {
  background: #25211c !important;
  border-bottom-color: #443c32 !important;
}

body.dark-theme .apps-table td {
  border-bottom-color: #383129 !important;
}

body.dark-theme .apps-table tbody tr:hover {
  background-color: #2a2520 !important;
}

/* Apps Table Wrapper & Mobile Styles */
.apps-table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .apps-table-wrapper {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .apps-table thead {
    display: none;
  }

  .apps-table, 
  .apps-table tbody, 
  .apps-table tr, 
  .apps-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  .apps-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
    background: transparent;
  }

  .apps-table tr {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
  }

  body.dark-theme .apps-table tr {
    background: #201d1a !important;
    border-color: #383129 !important;
  }

  .apps-table td {
    padding: 0 !important;
    border-bottom: none !important;
  }

  /* App name card header */
  .apps-table td:first-child {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
  }

  /* Description */
  .apps-table td:nth-child(2) {
    font-size: 0.85rem;
    color: var(--text-soft);
    margin-bottom: 1.25rem;
    line-height: 1.45;
  }

  /* Actions container styled like footer card */
  .apps-table td:last-child {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.85rem !important;
  }

  body.dark-theme .apps-table td:last-child {
    border-top-color: #383129 !important;
  }
}

/* Interactive modules preview trigger hover styling */
.preview-module-trigger[data-available="true"] {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.preview-module-trigger[data-available="true"]:hover {
  transform: translateY(-4px);
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-md);
  background: var(--surface) !important;
}

/* Fullscreen styles for material wrappers */
.fullscreen-wrapper:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  background: #ffffff !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.fullscreen-wrapper:fullscreen iframe {
  height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
}
.fullscreen-wrapper:fullscreen .btn-fullscreen-material {
  top: 16px !important;
  right: 16px !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}




