:root {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.header-container {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.9;
  transform: translateY(-0.5px);
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.brand-logo-fallback {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.22);
  flex-shrink: 0;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Navigation Tabs & Segmented Nav */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 1;
  min-width: 0;
}

.nav-group-primary {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: #f1f5f9;
  padding: 0.2rem;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  flex-shrink: 1;
  min-width: 0;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border: none;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.tab-btn svg {
  flex-shrink: 0;
}

.tab-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.tab-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.nav-divider {
  width: 1px;
  height: 22px;
  background-color: #cbd5e1;
  margin: 0 0.15rem;
  flex-shrink: 0;
}

.nav-group-secondary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #334155;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-action-btn svg {
  flex-shrink: 0;
}

.nav-action-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

@media (max-width: 1300px) {
  .brand-subtitle {
    display: none;
  }
  .tab-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
  }
  .nav-action-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 1200px) {
  .brand-subtitle {
    display: none;
  }
}

/* Main Container */
.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

/* Desktop Grid */
.scanner-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.scanner-card, .result-card, .create-exam-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.https-helper-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: #1e40af;
  font-weight: 500;
}

.https-helper-banner a {
  white-space: nowrap;
  font-weight: 700;
  text-decoration: none;
}

.card-header {
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.exam-selector-box {
  margin-top: 0.75rem;
}

.exam-selector-box label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Camera Viewport */
.camera-viewport-container {
  position: relative;
  width: 100%;
  background-color: #090d16;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  background: rgba(9, 13, 22, 0.85);
  z-index: 5;
  text-align: center;
  padding: 1rem;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Viewfinder Overlay */
.viewfinder-overlay {
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #38bdf8;
  border-style: solid;
  border-width: 0;
}

.guide-corner.top-left { top: -2px; left: -2px; border-top-width: 4px; border-left-width: 4px; }
.guide-corner.top-right { top: -2px; right: -2px; border-top-width: 4px; border-right-width: 4px; }
.guide-corner.bottom-right { bottom: -2px; right: -2px; border-bottom-width: 4px; border-right-width: 4px; }
.guide-corner.bottom-left { bottom: -2px; left: -2px; border-bottom-width: 4px; border-left-width: 4px; }

.guide-center-target {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.target-cross {
  width: 8px;
  height: 8px;
  position: relative;
}
.target-cross::before, .target-cross::after {
  content: '';
  position: absolute;
  background-color: rgba(255, 255, 255, 0.6);
}
.target-cross::before { top: 3px; left: 0; right: 0; height: 2px; }
.target-cross::after { left: 3px; top: 0; bottom: 0; width: 2px; }

.guide-banner {
  position: absolute;
  bottom: -28px;
  background-color: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* Controls */
.camera-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
}

.shutter-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: white;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.file-upload-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.student-name-bar {
  margin-top: 0.85rem;
}

.student-name-bar label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* Form inputs (Touch Friendly) */
.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 16px; /* Evita zoom automático no iOS Safari */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease-in-out;
  touch-action: manipulation;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:active {
  background-color: var(--primary-hover);
  transform: scale(0.98);
}

.btn-primary.btn-lg {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  flex: 1.5;
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:active {
  background-color: #e2e8f0;
}

/* Results */
.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.result-placeholder h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0.25rem;
}

.result-placeholder p {
  font-size: 0.775rem;
  max-width: 280px;
}

.score-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
}

.score-circle-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  background: white;
  border: 3px solid var(--success);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.score-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.score-total {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

.score-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.tag-success { background: var(--success-light); color: var(--success-hover); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-warning { background: var(--warning-light); color: var(--warning); }

.score-percent-bar {
  width: 100%;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.score-progress {
  height: 100%;
  background-color: var(--success);
  transition: width 0.4s ease;
}

/* Student Identification & Meta Grid */
.score-student-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.student-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.student-status-badge.status-identified {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.student-status-badge.status-unidentified {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.student-meta-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 0.75rem;
}

@media (min-width: 640px) {
  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.meta-field-box {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  min-width: 0;
}

.meta-field-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.meta-field-value {
  font-size: 0.825rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Professor Confirmation Banner */
.professor-confirmation-banner {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.confirmation-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.confirmation-info {
  flex: 1;
  min-width: 220px;
}

.confirmation-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.confirm-title-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #166534;
}

.confirm-subtext {
  font-size: 0.775rem;
  color: #15803d;
  margin: 0.2rem 0 0 0;
  line-height: 1.3;
}

.confirmation-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-confirm-action {
  background: #16a34a;
  color: #ffffff;
  border: 1px solid #15803d;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-confirm-action:hover {
  background: #15803d;
}

.btn-reject-action {
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reject-action:hover {
  background: #fef2f2;
}

/* Result Toggle */
.result-view-toggle {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* X-Ray Image */
.xray-legend {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-success { background: var(--success); }
.dot-danger { background: var(--danger); }
.dot-warning { background: var(--warning); }

.xray-image-wrap {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: #0f172a;
}

.xray-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Table */
.table-container {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.775rem;
}

.data-table th {
  background-color: #f8fafc;
  padding: 0.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.badge-status {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Exams Header & Search Bar */
.exams-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  gap: 1rem;
}

.exams-header-bar .section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.exams-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.exams-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exams-header-actions .search-box-wrap {
  width: 320px;
}

#go-to-create-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.825rem;
  white-space: nowrap;
  background-color: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
}

#go-to-create-btn:hover {
  background-color: #1d4ed8;
  border-color: #1e40af;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.exams-table-header {
  display: grid;
  grid-template-columns: minmax(280px, 2.3fr) minmax(170px, 1fr) 120px auto;
  gap: 0.85rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.65rem;
}

.exam-row {
  display: grid;
  grid-template-columns: minmax(280px, 2.3fr) minmax(170px, 1fr) 120px auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.exam-row:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
}

.exam-row .cl-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  min-width: 0;
}

.exam-row .cl-name {
  font-size: 0.93rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  display: block;
}

.exam-row .cl-grade {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  line-height: 1.25;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.grade-pill-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.grade-pill-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.grade-pill-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}

@media (max-width: 900px) {
  .exams-table-header {
    display: none;
  }
  .exam-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .exam-row .cl-col-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.exam-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.exam-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

.exam-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.exam-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exam-card-icon.math {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.exam-card-icon.portuguese {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #dcfce7;
}

.exam-card-icon.general {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.exam-card-title-group {
  flex: 1;
  min-width: 0;
}

.exam-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.exam-card-grade-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.exam-card-meta {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  align-items: center;
}

.meta-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.meta-chip.meta-chip-highlight {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
  font-weight: 600;
}

.meta-chip.meta-chip-empty {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.exam-card-actions {
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.85rem;
}

.exam-card-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  width: 100%;
}

.exam-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 36px;
  padding: 0 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exam-btn-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.exam-btn-action.exam-btn-econ {
  color: #2563eb;
  background: #f8fafc;
  border-color: #bfdbfe;
}

.exam-btn-action.exam-btn-econ:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.exam-btn-action.exam-btn-delete {
  color: #dc2626;
  border-color: #fee2e2;
  background: #ffffff;
}

.exam-btn-action.exam-btn-delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Create Form */
.create-exam-card {
  max-width: 800px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
}
.form-group.flex-2 { flex: 2; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.answer-key-section {
  margin: 1.25rem 0;
  background: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.answer-key-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.answer-key-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.answer-key-matrix {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.25rem 0.15rem 0.5rem 0.15rem;
}

.key-col-card {
  flex: 1 1 180px;
  max-width: 220px;
  min-width: 165px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
}

.key-col-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: inherit;
}

.key-th-item {
  background: #1e293b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.35rem;
  text-align: center;
  border-right: 1px solid #334155;
  width: 44px;
  letter-spacing: 0.5px;
}

.key-th-opt {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.45rem 0.2rem;
  text-align: center;
  border-bottom: 1px solid #cbd5e1;
}

.key-tr-row {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.12s ease;
}

.key-tr-row:nth-child(even) {
  background: #f8fafc;
}

.key-tr-row:hover {
  background: #eff6ff;
}

.key-td-item {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-align: center;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 0.25rem 0.35rem;
  user-select: none;
}

.key-td-opt {
  padding: 0.25rem 0.15rem;
  text-align: center;
}

.key-bubble-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease-in-out;
  outline: none;
  padding: 0;
  touch-action: manipulation;
}

.key-bubble-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  transform: scale(1.08);
}

.key-bubble-btn.selected {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.35);
  font-weight: 800;
  transform: scale(1.05);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

/* Toast */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translate(-50%, -120%);
  background: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.toast.error { background-color: var(--danger); }
.toast.success { background-color: var(--success-hover); }

/* ========================================================================= */
/* 📱 MOBILE RESPONSIVE OPTIMIZATIONS (APP-NATIVE STYLE)                      */
/* ========================================================================= */
/* ========================================================================= */
/* 📱 MOBILE RESPONSIVE NAVIGATION (APP-NATIVE DRAWER & BOTTOM BAR)          */
/* ========================================================================= */

/* Mobile Header Actions (Hidden on Desktop > 1024px) */
.mobile-header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.mobile-header-avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
  user-select: none;
}

.mobile-header-avatar:active {
  transform: scale(0.93);
}

.mobile-menu-toggle-btn {
  width: 38px;
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4.5px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.mobile-menu-toggle-btn:active {
  transform: scale(0.95);
}

.hamburger-bar {
  width: 19px;
  height: 2px;
  background-color: #334155;
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle-btn.active .hamburger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.mobile-menu-toggle-btn.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle-btn.active .hamburger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Backdrop Overlay */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Off-canvas Mobile Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 360px);
  background: #ffffff;
  z-index: 1060;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-sizing: border-box;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

/* Drawer Header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.15rem 0.95rem;
  padding-top: calc(1.1rem + env(safe-area-inset-top, 0px));
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.mobile-drawer-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.mobile-drawer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
}

.mobile-drawer-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-drawer-name {
  font-size: 0.90rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-drawer-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: #2563eb;
  letter-spacing: 0.01em;
}

.mobile-drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.mobile-drawer-close-btn:active {
  transform: scale(0.92);
}

/* Drawer Body */
.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.15rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-drawer-quick-action {
  margin-bottom: 0.75rem;
}

.mobile-quick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-quick-btn:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.mobile-drawer-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 0.75rem 0 0.35rem 0.25rem;
}

.mobile-drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  font-family: inherit;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.mobile-drawer-item:active {
  background: #e2e8f0;
}

.mobile-drawer-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.mobile-item-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f8fafc;
  color: #475569;
}

.mobile-drawer-item.active .mobile-item-icon-box {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.mobile-item-icon-box.icon-blue { color: #2563eb; background: #eff6ff; }
.mobile-item-icon-box.icon-emerald { color: #059669; background: #ecfdf5; }
.mobile-item-icon-box.icon-indigo { color: #4f46e5; background: #eef2ff; }
.mobile-item-icon-box.icon-sky { color: #0284c7; background: #f0f9ff; }
.mobile-item-icon-box.icon-purple { color: #7c3aed; background: #f5f3ff; }
.mobile-item-icon-box.icon-amber { color: #d97706; background: #fffbeb; }
.mobile-item-icon-box.icon-teal { color: #0d9488; background: #f0fdfa; }

.mobile-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.mobile-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: inherit;
  line-height: 1.2;
}

.mobile-item-desc {
  font-size: 0.70rem;
  color: #64748b;
  line-height: 1.2;
  margin-top: 2px;
}

.mobile-badge-chip {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* Drawer Footer */
.mobile-drawer-footer {
  padding: 0.9rem 1.15rem;
  padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.mobile-drawer-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1rem;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-radius: 9px;
  color: #dc2626;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-logout-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

.mobile-drawer-logout-btn:active {
  transform: scale(0.98);
}

/* Mobile Bottom Navigation Bar (Hidden on Desktop > 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 0.35rem 0.75rem env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  z-index: 990;
  align-items: center;
  justify-content: space-around;
  box-sizing: border-box;
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  flex: 1;
  max-width: 74px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-btn svg {
  transition: transform 0.15s ease, color 0.15s ease;
}

.bottom-nav-btn.active {
  color: #2563eb;
  font-weight: 700;
}

.bottom-nav-btn.active svg {
  color: #2563eb;
  transform: translateY(-1px);
}

/* Elevated Center FAB for Instant Correction / Scanner */
.bottom-nav-fab {
  margin-top: -16px;
  position: relative;
  z-index: 995;
}

.fab-scanner-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.42), 0 0 0 4px #ffffff;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.bottom-nav-fab:active .fab-scanner-circle {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35), 0 0 0 3px #ffffff;
}

.bottom-nav-fab span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2px;
}

.bottom-nav-fab.active .fab-scanner-circle {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.55), 0 0 0 4px #dbeafe;
}

/* Tablet & Mobile Breakpoints */
@media (max-width: 1024px) {
  .nav-tabs {
    display: none !important;
  }

  .mobile-header-actions {
    display: flex;
  }

  .header-container {
    padding: 0.55rem 0.95rem;
    justify-content: space-between;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-logo-img {
    height: 34px;
  }
}

/* Prevent body scroll when drawer is open */
body.mobile-menu-open {
  overflow: hidden !important;
  touch-action: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .main-container {
    padding: 0.75rem 0.75rem calc(75px + env(safe-area-inset-bottom, 0px));
  }

  /* Scanner Mobile Stack */
  .scanner-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .scanner-card, .result-card, .create-exam-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .camera-viewport-container {
    aspect-ratio: 3 / 4; /* Proporção perfeita para tela vertical de celular */
    max-height: 52vh;
    border-radius: var(--radius-md);
  }

  .viewfinder-overlay {
    inset: 6%;
  }

  .guide-banner {
    font-size: 0.65rem;
    bottom: 8px;
  }

  /* Mobile Camera Controls (estilo app de câmera) */
  .camera-controls {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
  }

  .camera-controls .btn {
    padding: 0.65rem 0.4rem;
    font-size: 0.75rem;
  }

  .camera-controls .btn span {
    display: none; /* Apenas ícone nos botões secundários para caber perfeitamente */
  }

  #capture-btn {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.8rem 0.5rem;
  }

  #capture-btn span {
    display: inline !important;
    font-size: 0.85rem;
    font-weight: 700;
  }

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

  .exams-grid {
    grid-template-columns: 1fr;
  }

  .answer-key-matrix {
    justify-content: center;
    gap: 0.65rem;
  }

  .key-col-card {
    max-width: 100%;
  }

  .key-bubble-btn {
    width: 26px;
    height: 26px;
    font-size: 0.76rem;
  }

  .score-banner {
    flex-direction: row;
    padding: 0.75rem;
  }

  .score-circle-box {
    width: 58px;
    height: 58px;
  }

  .score-value {
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   Create Exam 2-Column Layout & Live Sheet Mockup (Canoa Official Style)
   ========================================================================== */

.create-exam-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
  gap: 1.5rem !important;
  align-items: start;
  width: 100%;
}

.create-exam-layout > .create-exam-card {
  max-width: 100% !important;
  margin: 0 !important;
  width: 100%;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
  margin: 1.25rem 0 0.75rem 0;
}

/* Logo Selector Card */
.logo-selector-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background-color: var(--bg-main);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
}

.logo-preview-box {
  width: 72px;
  height: 54px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.logo-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

.logo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.75rem !important;
}

/* Cor do Gabarito - Color Picker */
.color-picker-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.color-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.color-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color, #e2e8f0);
  background-color: var(--bg-card, #ffffff);
  color: var(--text-primary, #1e293b);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.color-pill:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
  transform: translateY(-1px);
}

.color-pill.active {
  border-color: var(--primary, #2563eb);
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.color-pill-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
}

.color-pill-name {
  white-space: nowrap;
}

.custom-color-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-color-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md, 6px);
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  position: relative;
  transition: all 0.15s ease;
}

.custom-color-btn:hover {
  border-color: var(--primary, #2563eb);
  background: #f8fafc;
}

.custom-color-btn input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.custom-color-preview-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.custom-color-label {
  pointer-events: none;
}

.color-hex-text {
  width: 105px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.82rem !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  padding: 0.35rem 0.5rem !important;
  height: 34px !important;
  border-radius: var(--radius-md, 6px) !important;
}

/* Preview Panel */
.preview-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 5rem;
}

.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.preview-panel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: #dbeafe;
  color: #1d4ed8;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

/* Live Sheet Mockup Paper */
.live-sheet-mockup {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 18px 14px;
  position: relative;
  font-family: Arial, sans-serif;
  user-select: none;
}

/* Mockup ArUco Corner Markers */
.mockup-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  background-color: #000000;
  color: #ffffff;
  font-size: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000000;
}
.mockup-marker.tl { top: 6px; left: 6px; }
.mockup-marker.tr { top: 6px; right: 6px; }
.mockup-marker.bl { bottom: 6px; left: 6px; }
.mockup-marker.br { bottom: 6px; right: 6px; }

/* Mockup Banner (#244061) */
.mockup-banner {
  background-color: #244061;
  color: #ffffff;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid #0f172a;
  border-bottom: none;
}

.mockup-banner-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mockup-banner-sub {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.95;
  margin-top: 2px;
}

/* Mockup Table */
.mockup-table {
  display: flex;
  border: 1px solid #000000;
  background-color: #ffffff;
}

.mockup-col-logo {
  width: 60px;
  border-right: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background-color: #ffffff;
  flex-shrink: 0;
}

.mockup-col-logo img {
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
}

.mockup-col-data {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mockup-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  font-size: 0.58rem;
  border-bottom: 1px solid #000000;
  height: 17px;
  color: #0f172a;
}

.mockup-row:last-child {
  border-bottom: none;
}

.mockup-row.split {
  padding: 0;
}

.mockup-row .m-sub {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  height: 100%;
}

.mockup-row .m-sub:first-child {
  border-right: 1px solid #000000;
  flex: 1.1;
}

.mockup-row .m-lbl {
  font-weight: 800;
  font-size: 0.55rem;
}

/* Mockup Instructions */
.mockup-instructions {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: none;
  font-size: 0.52rem;
  font-weight: 700;
  padding: 3px 6px;
  display: flex;
  justify-content: space-between;
  color: #334155;
  margin-bottom: 8px;
}

/* Mockup Question Table */
.mockup-questions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mockup-q-col-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.55rem;
}

.mockup-q-col-table th,
.mockup-q-col-table td {
  border: 1px solid #cbd5e1;
  text-align: center;
  padding: 2px 1px;
}

.mockup-q-col-table th.th-item {
  background-color: #244061;
  color: #ffffff;
  font-weight: 800;
  width: 26px;
}

.mockup-q-col-table th.th-opt {
  background-color: #e2e8f0;
  color: #0f172a;
  font-weight: 800;
}

.mockup-q-col-table td.td-item {
  background-color: #f1f5f9;
  font-weight: 800;
  color: #0f172a;
}

.mockup-q-col-table td.td-alt {
  background-color: #ffffff;
}

.mockup-bubble-dot {
  width: 12px;
  height: 12px;
  border: 1px solid #334155;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.48rem;
  font-weight: 700;
  color: #334155;
}

@media (max-width: 768px) {
  .create-exam-layout {
    grid-template-columns: 1fr !important;
  }
  .preview-panel {
    position: static;
    margin-top: 1.5rem;
  }
}

/* Edit Mode Banner */
.edit-mode-banner {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  animation: fadeIn 0.25s ease;
}

.edit-mode-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #92400e;
}

/* Mobile Camera Fallback Card */
.mobile-cam-fallback-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  height: 100%;
  width: 100%;
}

.mobile-cam-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.mobile-cam-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.mobile-cam-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  max-width: 280px;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.mobile-cam-desc strong {
  color: #38bdf8;
}

.btn-pulse {
  animation: pulse-border 2s infinite;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* ==========================================================================
   Gestão Escolar, Turmas & Alunos Styles
   ========================================================================== */

.student-meta-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.school-tag {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.class-tag {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.reg-tag {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* School Tree Layout */
.schools-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.schools-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Universal Search Box & Filter Toolbars */
.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  padding: 0 0.55rem 0 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.search-box-wrap:hover {
  border-color: #94a3b8;
}

.search-box-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

.search-box-icon {
  color: #94a3b8;
  flex-shrink: 0;
  margin-right: 0.55rem;
  pointer-events: none;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
}

.search-box-wrap:focus-within .search-box-icon {
  color: #2563eb;
}

.search-box-input {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0.85rem !important;
  font-weight: 500;
  color: #0f172a;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit;
}

.search-box-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.search-box-clear {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 0.35rem;
  flex-shrink: 0;
}

.search-box-clear:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

.search-kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-left: 0.35rem;
  pointer-events: none;
  user-select: none;
  font-family: inherit;
  transition: opacity 0.15s ease;
}

.search-box-wrap:focus-within .search-kbd-hint {
  opacity: 0;
  pointer-events: none;
}

/* Match highlight */
.search-match-mark {
  background-color: #fef08a;
  color: #713f12;
  padding: 0.05rem 0.2rem;
  border-radius: 3px;
  font-weight: 700;
}

.schools-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.schools-search-toolbar .search-box-wrap {
  max-width: 480px;
  flex: 1;
}

.search-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
}

.schools-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.school-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
}

.school-card-header {
  padding: 1rem 1.35rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.school-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.school-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.school-meta-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  background: #e2e8f0;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

.school-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.school-card-body {
  padding: 1rem 1.35rem;
  flex: 1;
}

.classroom-table-header {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(140px, 1fr) 110px auto;
  gap: 0.85rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.5rem;
  align-items: center;
}

.classroom-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.classroom-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(140px, 1fr) 110px auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.classroom-row:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
}

.cl-col-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cl-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cl-tags-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.cl-grade {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  line-height: 1.2;
}

.cl-shift {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  line-height: 1.2;
}

.cl-col-exams {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
}

.cl-exam-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

.cl-no-exams-btn {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
}

.cl-no-exams-btn:hover {
  background: #f8fafc;
  border-color: #2563eb;
  color: #2563eb;
}

.cl-col-students {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.cl-student-toggle-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 0.6rem;
  height: 30px;
  font-size: 0.76rem;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cl-student-toggle-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.cl-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.cl-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 30px;
  padding: 0 0.58rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  user-select: none;
}

.cl-action-btn svg {
  flex-shrink: 0;
}

.cl-action-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.cl-action-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1e40af;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

.cl-action-btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cl-action-btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.cl-more-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cl-action-btn-more {
  width: 30px;
  height: 30px;
  padding: 0;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cl-action-btn-more:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.cl-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  padding: 0.35rem;
  min-width: 175px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  animation: dropdownFadeIn 0.15s ease-out;
}

.cl-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.12s;
  font-family: inherit;
}

.cl-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.cl-dropdown-item svg {
  color: #64748b;
  flex-shrink: 0;
}

.cl-dropdown-item:hover svg {
  color: #0f172a;
}

.cl-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.25rem 0;
}

.cl-dropdown-item-danger {
  color: #dc2626;
}

.cl-dropdown-item-danger svg {
  color: #dc2626;
}

.cl-dropdown-item-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.cl-dropdown-item-danger:hover svg {
  color: #b91c1c;
}

.cl-action-btn-subtle {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.cl-action-btn-subtle:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.cl-action-btn-danger {
  background: #ffffff;
  color: #dc2626;
  border-color: #fecaca;
}

.cl-action-btn-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #f87171;
}

.btn-danger-subtle {
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger-subtle:hover {
  background: #fee2e2;
  color: #991b1b;
}

.students-collapse-pane {
  grid-column: 1 / -1;
  padding-top: 0.75rem;
  margin-top: 0.4rem;
  border-top: 1px dashed #cbd5e1;
}

@media (max-width: 1080px) {
  .classroom-table-header {
    display: none;
  }
  .classroom-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .cl-col-students, .cl-col-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.students-list-mini {
  list-style: none;
  padding: 0;
  margin: 0;
}

.students-list-mini li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #f8fafc;
}

.students-list-mini li:nth-child(even) {
  background: #f8fafc;
}

.student-reg-num {
  font-family: monospace;
  color: var(--text-secondary);
}

/* Relatório Modal Metrics */
.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.stat-box-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-box-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
}

/* Question Accuracy Bars */
.accuracy-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.accuracy-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.acc-q-num {
  width: 45px;
  font-weight: 700;
  color: var(--text-primary);
}

.acc-bar-wrap {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.acc-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: #10b981;
}

.acc-bar-fill.low { background: #ef4444; }
.acc-bar-fill.mid { background: #f59e0b; }

.acc-val {
  width: 50px;
  text-align: right;
  font-weight: 700;
  color: var(--text-secondary);
}

/* CSV Upload Dropzone */
.csv-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.csv-dropzone:hover, .csv-dropzone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.csv-dropzone-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.csv-dropzone-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

.csv-dropzone-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card-lg {
  max-width: 720px;
}

.modal-card-xl {
  max-width: 1060px;
  width: 95%;
}

.modal-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 0.25rem;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.35rem;
  overflow-y: auto;
}

.modal-instruction {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  border-radius: 4px;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.delete-exam-btn:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #ef4444 !important;
}

.delete-student-sub-btn:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #ef4444 !important;
}

/* ==========================================================================
   CLASSROOM REPORT FULL VIEW (PAGE)
   ========================================================================== */
.report-page-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.report-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.report-title-group .page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.report-title-group .page-subtitle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.report-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exam-select-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.exam-select-pill label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.exam-select-pill select {
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

/* KPI CARDS GRID */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-green { background: #ecfdf5; color: #10b981; }
.icon-amber { background: #fffbeb; color: #f59e0b; }
.icon-navy { background: #f8fafc; color: #1e293b; border: 1px solid #cbd5e1; }
.icon-emerald { background: #f0fdf4; color: #059669; }

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0.2rem 0;
}

.kpi-green { color: #059669; }
.kpi-amber { color: #d97706; }
.kpi-emerald { color: #047857; }

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* TOP 3 STUDENTS SECTION (EXECUTIVE CARDS) */
.podium-card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.section-card-header {
  margin-bottom: 1rem;
}

.section-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.top-students-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .top-students-grid {
    grid-template-columns: 1fr;
  }
}

.top-student-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.top-student-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.top-student-card.rank-1-card {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffdfa 0%, #ffffff 100%);
}

.top-student-card.rank-2-card {
  border-color: #e2e8f0;
}

.top-student-card.rank-3-card {
  border-color: #fed7aa;
}

.top-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.top-rank-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.pill-gold {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pill-silver {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.pill-bronze {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.top-student-reg {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

.top-student-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-student-score-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.top-student-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.rank-1-card .top-student-score {
  color: #b45309;
}

.top-student-max {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.top-student-hits {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.podium-empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* CHARTS GRID */
.report-charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 980px) {
  .report-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-box-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chart-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

.chart-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.chart-legend-custom {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green { background: #10b981; }
.dot-amber { background: #f59e0b; }
.dot-red { background: #ef4444; }

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 270px;
  flex: 1;
}

.grade-distribution-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.dist-chip {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.chip-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.chip-warning { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.chip-primary { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.chip-success { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }

/* RANKING TABLE SECTION */
.ranking-card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.ranking-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ranking-search-wrap {
  width: 320px;
  max-width: 100%;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.75rem;
}

.rank-1 { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.rank-2 { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.rank-3 { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.rank-default { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; font-weight: 600; }

.badge-best-exam {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ==========================================================================
   CLASSROOM REPORT COMPARISON TAB & COMPONENTS
   ========================================================================== */
.report-subnav-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.subnav-pill:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.subnav-pill.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

.compare-selector-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.compare-selector-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 1rem;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .compare-selector-grid {
    grid-template-columns: 1fr;
  }
  .compare-vs-badge {
    display: none;
  }
}

.compare-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.compare-label {
  font-size: 0.8rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.exam-color-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
}

.exam-a-dot { background: #2563eb; }
.exam-b-dot { background: #10b981; }

.compare-vs-badge {
  font-weight: 900;
  font-size: 0.85rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  text-align: center;
  align-self: center;
  border: 1px solid #e2e8f0;
}

.compare-btn-col {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.compare-insight-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  color: #1e40af;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.insight-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.compare-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.compare-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.compare-kpi-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.compare-kpi-body {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
}

.compare-stat-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.side-a .stat-score {
  color: #2563eb;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
}

.side-b .stat-score {
  color: #059669;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
}

.stat-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.2rem;
}

.stat-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.compare-divider {
  width: 1px;
  height: 55px;
  background: var(--border-color);
}

.compare-kpi-footer {
  margin-top: 0.85rem;
  padding-top: 0.6rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  color: #475569;
}

.badge-delta-pos {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-delta-neg {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-delta-zero {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}

/* STUDENT ANSWERS TOGGLE & DETAIL ROW */
.compare-student-row {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.compare-student-row:hover {
  background: #f8fafc;
}

.compare-student-row.row-expanded {
  background: #f1f5f9;
}

.student-name-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chevron-toggle {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.compare-student-row.row-expanded .chevron-toggle {
  transform: rotate(90deg);
  color: var(--primary);
}

.student-name-col {
  display: flex;
  flex-direction: column;
}

.student-name-text {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.student-hint-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: normal;
  margin-top: 0.1rem;
}

.compare-detail-row {
  background: #f8fafc;
}

.compare-detail-cell {
  padding: 1rem 1.25rem !important;
  border-bottom: 2px solid var(--border-color) !important;
}

.student-answers-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 820px) {
  .student-answers-detail-grid {
    grid-template-columns: 1fr;
  }
}

.exam-answers-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.exam-answers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
}

.exam-answers-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-graded {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-pending {
  background: #f1f5f9;
  color: #64748b;
}

.exam-answers-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  font-style: italic;
}

.questions-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.q-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.q-chip .q-num {
  font-size: 0.68rem;
  opacity: 0.75;
  font-weight: 600;
}

.q-chip .q-ans {
  font-size: 0.82rem;
  font-weight: 800;
}

.q-chip .q-icon {
  font-size: 0.75rem;
  margin-left: 0.1rem;
}

.q-chip .q-key {
  font-size: 0.68rem;
  opacity: 0.85;
  font-weight: normal;
  margin-left: 0.15rem;
}

.q-correct {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.q-wrong {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.q-blank {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   EXECUTIVE REPORT SUITE & MULTI-FORMAT EXPORT (PDF, XLSX, DOCX)
   ========================================================================== */

.export-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.report-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  min-width: 280px;
  padding: 0.5rem;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 0.15s ease;
}

.report-dropdown-item:hover {
  background-color: #f1f5f9;
}

.report-fmt-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.fmt-pdf {
  background: #dc2626;
  color: #ffffff;
}

.fmt-xlsx {
  background: #059669;
  color: #ffffff;
}

.fmt-docx {
  background: #1e3a8a;
  color: #ffffff;
}

.report-fmt-info {
  display: flex;
  flex-direction: column;
}

.report-fmt-info strong {
  font-size: 0.84rem;
  color: #0f172a;
  font-weight: 700;
}

.report-fmt-info small {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.2;
}

.report-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.25rem 0;
}

/* Institutional Settings Modal Styles */
.settings-logo-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.settings-logo-preview {
  width: 80px;
  height: 80px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.settings-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.settings-logo-upload {
  flex: 1;
}

/* Year Performance Report (R2) Modal */
.year-report-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.export-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.export-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.export-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.08);
  border-color: #1e3a8a;
}

.export-card-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 0.75rem;
}

.export-card-content h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.export-card-content p {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

.export-card button {
  width: 100%;
  pointer-events: none;
}

/* Status Badges & Format Tags */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1;
}

.status-badge.status-graded {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-badge.status-pending {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.format-tag {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.format-tag-pdf {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.format-tag-xlsx {
  background: #059669;
  color: #ffffff;
}

.format-tag-docx {
  background: #2563eb;
  color: #ffffff;
}

/* ==========================================================================
   AUTHENTICATION & LOGIN SCREEN
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 15%, #1e3a8a 0%, #0f172a 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 410px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  padding: 2.25rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: loginCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: #eff6ff;
  border: 1.5px solid #dbeafe;
  border-radius: 16px;
  margin-bottom: 0.85rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.login-brand-img {
  max-height: 56px;
  max-width: 56px;
  object-fit: contain;
}

.login-brand-fallback {
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.84rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.login-badge-city {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #dbeafe;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-error-alert {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  line-height: 1.35;
}

.login-field-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.login-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 2.5rem 0 2.65rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15);
}

.login-pwd-toggle {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.15s;
}

.login-pwd-toggle:hover {
  color: #0f172a;
}

.login-row-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.login-remember-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.login-remember-label input[type="checkbox"] {
  accent-color: #2563eb;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.login-submit-btn {
  width: 100%;
  height: 44px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  font-family: inherit;
}

.login-submit-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.login-card-footer {
  text-align: center;
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid #f1f5f9;
}

.login-hint-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

.nav-logout-btn {
  color: #dc2626 !important;
  border-color: #fecaca !important;
  background: #fff5f5 !important;
}

.nav-logout-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

/* ==========================================================================
   DASHBOARD MACRO (TELA INICIAL)
   ========================================================================== */
.dash-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dash-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dash-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.dash-select {
  height: 38px;
  border-radius: 8px;
  font-size: 0.82rem;
  padding: 0 0.85rem;
  background-color: #ffffff;
}

/* KPI Cards Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.dash-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.dash-kpi-card.kpi-primary {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dash-kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue {
  background: #eff6ff;
  color: #2563eb;
}

.icon-green {
  background: #ecfdf5;
  color: #059669;
}

.icon-amber {
  background: #fffbeb;
  color: #d97706;
}

.icon-slate {
  background: #f1f5f9;
  color: #475569;
}

.dash-kpi-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.dash-kpi-main-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.dash-kpi-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  background: #e2e8f0;
  color: #475569;
}

.dash-kpi-badge.badge-success {
  background: #dcfce7;
  color: #166534;
}

.dash-kpi-badge.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.dash-kpi-badge.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.dash-kpi-subpill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.dash-kpi-bar-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.dash-kpi-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-kpi-bar-fill.bar-amber {
  background: #f59e0b;
}

.dash-kpi-subtext {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  margin-top: auto;
}

/* Charts Grid */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 960px) {
  .dash-charts-row {
    grid-template-columns: 1fr;
  }
}

.dash-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dash-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dash-chart-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.dash-chart-desc {
  font-size: 0.78rem;
  color: #64748b;
}

.dash-chart-legend-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.leg-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Section Card & Table */
.dash-section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.5rem;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-section-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.dash-section-desc {
  font-size: 0.8rem;
  color: #64748b;
}

.dash-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.dash-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dash-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table tr:hover td {
  background: #f8fafc;
}

.dash-table-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-neutral {
  background: #f1f5f9;
  color: #64748b;
}

/* Alert Classrooms Grid */
.dash-alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.dash-alert-card {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.alert-class-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #991b1b;
  margin-bottom: 0.15rem;
}

.alert-school-name {
  font-size: 0.75rem;
  color: #7f1d1d;
}

.alert-score-chip {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  white-space: nowrap;
}

/* ==========================================================================
   USER SESSION PROFILE BADGE (TOP NAV)
   ========================================================================== */
.nav-user-badge-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.6rem 0.2rem 0.35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  cursor: default;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.nav-user-badge-box:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.nav-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-user-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
  max-width: 95px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-role {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   GESTÃO DE USUÁRIOS & ACESSOS (LAYOUT COMPACTO E HARMONIOSO)
   ========================================================================== */
.users-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.users-page-title {
  font-size: 1.22rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}

.users-page-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.users-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Compact KPI Cards for Users Tab */
#users-tab .dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 1024px) {
  #users-tab .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #users-tab .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}

#users-tab .dash-kpi-card {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#users-tab .dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

#users-tab .dash-kpi-title {
  font-size: 0.69rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#users-tab .dash-kpi-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#users-tab .dash-kpi-icon-wrap svg {
  width: 16px;
  height: 16px;
}

#users-tab .dash-kpi-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

#users-tab .dash-kpi-main-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

#users-tab .dash-kpi-subpill {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

#users-tab .dash-kpi-subtext {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.25;
}

/* Compact Toolbar & Filter */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
}

.users-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 380px;
  min-width: 220px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 0.65rem;
  height: 35px;
  transition: all 0.15s ease;
}

.users-search-box:focus-within {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.users-search-box svg {
  color: #94a3b8;
  margin-right: 0.45rem;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.users-search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.8rem;
  color: #0f172a;
  outline: none;
}

.users-search-box input::placeholder {
  color: #94a3b8;
  font-size: 0.78rem;
}

#users-search-clear {
  background: #e2e8f0;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: #64748b;
  cursor: pointer;
  margin-left: 0.35rem;
}

#users-search-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.users-filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.users-filter-group label {
  font-size: 0.77rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.users-filter-group select {
  height: 35px;
  border-radius: 7px;
  font-size: 0.78rem;
  padding: 0 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}

/* User Table Compact Styling */
#users-table th {
  padding: 0.55rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#users-table td {
  padding: 0.58rem 0.75rem;
  vertical-align: middle;
}

/* User Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 16px;
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge-admin {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.role-badge-coord {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.role-badge-prof {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 16px;
  font-size: 0.67rem;
  font-weight: 600;
}

.status-badge-active {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-badge-active::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
}

.status-badge-inactive {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.status-badge-inactive::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
}

/* Table Action Buttons */
.users-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-icon-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-icon-action.action-edit:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

.btn-icon-action.action-toggle:hover {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}

.btn-icon-action.action-delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ==========================================================================
   ROLE-BASED ACCESS CONTROL (RBAC) UI VISIBILITY RULES
   ========================================================================== */
/* Coordenador: Acesso total a todas as abas e recursos, mas bloqueio irrestrito de qualquer exclusão */
body.role-coordenador .delete-school-btn,
body.role-coordenador .delete-classroom-btn,
body.role-coordenador .delete-exam-btn,
body.role-coordenador .delete-student-sub-btn,
body.role-coordenador .action-delete,
body.role-coordenador #btn-delete-current-result,
body.role-coordenador .cl-action-btn-danger,
body.role-coordenador [data-action="delete"] {
  display: none !important;
}

/* Professor: Acesso restrito e exclusivo à Correção de Provas (scanner-tab) */
body.role-professor .tab-btn[data-tab="dashboard-tab"],
body.role-professor .tab-btn[data-tab="exams-tab"],
body.role-professor .tab-btn[data-tab="schools-tab"],
body.role-professor .tab-btn[data-tab="create-tab"],
body.role-professor .tab-btn[data-tab="users-tab"],
body.role-professor #btn-open-year-report-nav,
body.role-professor #btn-open-settings-modal,
body.role-professor #btn-open-new-school-modal,
body.role-professor #btn-open-csv-modal,
body.role-professor .delete-school-btn,
body.role-professor .delete-classroom-btn,
body.role-professor .delete-exam-btn,
body.role-professor .delete-student-sub-btn,
body.role-professor .btn-edit-classroom,
body.role-professor .cl-action-btn-danger,
body.role-professor .action-delete,
body.role-professor #btn-delete-current-result,
body.role-professor [data-action="delete"],
body.role-professor #wrap-admin-dropdown {
  display: none !important;
}

/* ==========================================================================
   MENU SUSPENSO: GESTÃO ADMINISTRATIVA
   ========================================================================== */
.nav-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.nav-gestao-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-gestao-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.nav-gestao-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.nav-gestao-btn.active svg {
  stroke: #ffffff;
}

.dropdown-arrow-icon {
  transition: transform 0.2s ease;
}

.nav-dropdown-wrap.open .dropdown-arrow-icon {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  padding: 0.4rem;
  min-width: 240px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.nav-dropdown-item:hover {
  background: #f1f5f9;
}

.nav-dropdown-item.active {
  background: #eff6ff;
}

.nav-dd-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-dd-icon.icon-blue {
  background: #eff6ff;
  color: #2563eb;
}

.nav-dd-icon.icon-emerald {
  background: #ecfdf5;
  color: #059669;
}

.nav-dd-icon.icon-amber {
  background: #fffbeb;
  color: #d97706;
}

.nav-dd-icon.icon-indigo {
  background: #eef2ff;
  color: #4f46e5;
}

.nav-dd-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav-dd-title {
  font-size: 0.81rem;
  font-weight: 700;
  color: #1e293b;
}

.nav-dd-desc {
  font-size: 0.68rem;
  color: #64748b;
}

.nav-dd-separator {
  height: 1px;
  background: #f1f5f9;
  margin: 0.25rem 0;
}

/* ==========================================================================
   REGRAS DE RBAC PARA GESTÃO & BACKUP
   ========================================================================== */
body:not(.role-admin) .admin-only-item,
body.role-coordenador .admin-only-item,
body.role-professor .admin-only-item {
  display: none !important;
}

body:not(.role-admin) #backup-tab,
body.role-coordenador #backup-tab,
body.role-professor #backup-tab {
  display: none !important;
}

/* Backup Dropzone Drag & Drop Hover States */
#backup-dropzone.drag-over {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
  transform: scale(1.01);
}

/* ==========================================================================
   UNIFIED REPORT EXPORT MODAL
   ========================================================================== */
.export-modal-card {
  max-width: 530px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.export-modal-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.export-modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbeafe;
  flex-shrink: 0;
}

.export-modal-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  display: block;
  margin-top: 0.1rem;
}

.export-modal-body {
  padding: 1.1rem 1.35rem;
  max-height: 80vh;
  overflow-y: auto;
}

.export-step-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

/* Report Types Grid */
.export-report-types-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.export-report-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.export-report-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.export-report-card.active {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 1px #2563eb;
}

.export-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.export-report-card.active .export-card-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.export-card-body {
  flex: 1;
}

.export-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}

.export-card-desc {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 0.1rem;
  line-height: 1.3;
}

.export-radio-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #ffffff;
  transition: all 0.18s ease;
}

.export-radio-indicator svg {
  display: none;
  color: #ffffff;
}

.export-report-card.active .export-radio-indicator,
.export-format-card.active .export-radio-indicator {
  border-color: #2563eb;
  background: #2563eb;
}

.export-report-card.active .export-radio-indicator svg,
.export-format-card.active .export-radio-indicator svg {
  display: block;
}

/* Format Cards Grid */
.export-formats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (max-width: 540px) {
  .export-formats-grid {
    grid-template-columns: 1fr;
  }
}

.export-format-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.export-format-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.export-format-card.active {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 1px #2563eb;
}

.export-fmt-pill {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.export-fmt-info {
  flex: 1;
  min-width: 0;
}

.export-fmt-info strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-fmt-info small {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.05rem;
  line-height: 1.2;
}

.export-modal-footer {
  padding: 0.85rem 1.35rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Mobile Landscape Fullscreen Camera Mode (Correção Imersiva)
   ========================================================================== */
body.mobile-landscape-camera-active {
  overflow: hidden !important;
  position: fixed !important;
  width: 100vw !important;
  height: 100dvh !important;
  inset: 0 !important;
  touch-action: none !important;
}

body.mobile-landscape-camera-active .top-header,
body.mobile-landscape-camera-active .bottom-nav,
body.mobile-landscape-camera-active .admin-dropdown-menu,
body.mobile-landscape-camera-active .scanner-card > .card-header,
body.mobile-landscape-camera-active .camera-controls,
body.mobile-landscape-camera-active .result-card,
body.mobile-landscape-camera-active .https-helper-banner,
body.mobile-landscape-camera-active .scanner-layout > *:not(.scanner-card) {
  display: none !important;
}

body.mobile-landscape-camera-active .main-container {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100vw !important;
  height: 100dvh !important;
}

body.mobile-landscape-camera-active .scanner-layout {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
}

body.mobile-landscape-camera-active .scanner-card {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  width: 100vw !important;
  height: 100dvh !important;
}

body.mobile-landscape-camera-active .camera-viewport-container {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 99999 !important;
  background: #000000 !important;
}

body.mobile-landscape-camera-active #camera-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.mobile-landscape-camera-active .viewfinder-overlay {
  inset: 6% 16% 6% 6% !important;
  border: 2px dashed rgba(56, 189, 248, 0.6) !important;
}

body.mobile-landscape-camera-active .guide-corner {
  width: 32px !important;
  height: 32px !important;
  border-color: #38bdf8 !important;
}

body.mobile-landscape-camera-active .guide-banner {
  bottom: 14px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  padding: 0.4rem 1.1rem !important;
  background: rgba(15, 23, 42, 0.82) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  border-radius: 9999px !important;
  color: #f8fafc !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* HUD & Controls Overlay */
.landscape-camera-hud {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

body.mobile-landscape-camera-active .landscape-camera-hud {
  display: block;
}

.landscape-hud-top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  left: max(16px, env(safe-area-inset-left, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.landscape-exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  max-width: 55vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landscape-exam-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landscape-top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.landscape-hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.landscape-hud-btn:active {
  transform: scale(0.92);
  background: rgba(30, 41, 59, 0.95);
}

.landscape-hud-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.landscape-btn-exit {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.landscape-btn-exit:active {
  background: rgba(185, 28, 28, 0.95);
}

.landscape-hud-right {
  position: absolute;
  right: max(16px, env(safe-area-inset-right, 16px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  pointer-events: auto;
}

.landscape-shutter-trigger {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 3.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.65), 0 0 16px rgba(16, 185, 129, 0.45);
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s ease;
  outline: none;
}

.landscape-shutter-trigger:active {
  transform: scale(0.88);
  background: rgba(255, 255, 255, 0.4);
}

.landscape-shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.35);
}

.landscape-shutter-trigger.processing .landscape-shutter-inner {
  background: #475569;
}

/* ==========================================================================
   PWA INSTALL ALERT MODAL (MOBILE ONLY)
   ========================================================================== */
.pwa-install-overlay {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: pwaFadeIn 0.25s ease-out;
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pwa-install-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 1rem 1.5rem 2rem;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes pwaSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.pwa-sheet-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 0 auto 1.25rem;
}

.pwa-sheet-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pwa-app-badge-wrap {
  position: relative;
  margin-bottom: 0.85rem;
}

.pwa-app-icon-img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 20px -4px rgba(36, 64, 97, 0.2);
}

.pwa-app-badge-verified {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.pwa-sheet-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 0.25rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.pwa-sheet-subtitle {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pwa-sheet-desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #475569;
  margin: 0 0 1.5rem;
  max-width: 360px;
}

.btn-pwa-install {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
}

.btn-pwa-install:active {
  transform: scale(0.98);
}

.pwa-ios-instructions {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.pwa-ios-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.pwa-ios-step:last-child {
  margin-bottom: 0;
}

.ios-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-pwa-dismiss {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 1rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: color 0.15s ease;
}

.btn-pwa-dismiss:active {
  color: #1e293b;
  background: #f1f5f9;
}





