/* Modular CSS slice extracted from style.css (4307-5024) */
.exam-empty-tab-state {
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  border-radius: var(--radius-md, 8px);
  border: 1px dashed var(--border-color, #cbd5e1);
  margin: 1rem 0;
}

@media (max-width: 640px) {
  .dual-upload-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .modal-variant-ribbon {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   AI MODEL SELECTOR CAPSULE (Hidden from UI as configured)
   ========================================================================== */
.ai-model-capsule,
#ai-model-selector-container,
.sg-model-indicator {
  display: none !important;
}

.ai-model-capsule:hover {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.ai-model-icon-pulse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.35);
  animation: subtlePulse 3s infinite ease-in-out;
}

@keyframes subtlePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.92; }
}

.ai-model-select {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  padding-right: 0.25rem;
}

.ai-model-badge-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: #e0e7ff;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ai-model-badge-chip.thinking {
  background: #fae8ff;
  color: #86198f;
}

.ai-model-badge-chip.vision {
  background: #e0f2fe;
  color: #0369a1;
}

.ai-model-badge-chip.speed {
  background: #dcfce7;
  color: #15803d;
}

.sg-model-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   RBAC & USER AUTHENTICATION STYLES
   ========================================================================== */

/* User Auth Capsule & Profile Trigger */
.user-auth-capsule {
  display: flex;
  align-items: center;
  position: relative;
}

.user-profile-menu-container {
  position: relative;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 9999px;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main, #0f172a);
}

.user-profile-trigger:hover {
  background: #ffffff;
  border-color: var(--primary, #00c5df);
  box-shadow: 0 2px 8px rgba(0, 197, 223, 0.25);
}

.user-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #082850, #0099b8);
  border: 1px solid rgba(0, 197, 223, 0.4);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
}

.user-name-display {
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-role {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-role.role-admin {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-role.role-teacher {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.badge-role.role-student {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* User Profile Dropdown Menu */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  animation: dropdownSlide 0.15s ease-out;
}

.user-profile-dropdown.open {
  display: flex !important;
}

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

.dropdown-header {
  padding: 0.5rem 0.65rem;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color, #e2e8f0);
  margin: 0.35rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  border-radius: var(--radius-sm, 6px);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

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

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

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

/* Quick Demo Login Pills */
.btn-demo-login {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-demo-login:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* Data Table Styling for Admin and Class Accounts */
.data-table th, .data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.82rem;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.badge-status-active {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-status-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Print Roster & Credentials Card Media Query (Scoped to prevent blank print across app) */
@media print {
  body.printing-student-accounts * {
    visibility: hidden;
  }
  body.printing-student-accounts #modal-student-accounts,
  body.printing-student-accounts #modal-student-accounts * {
    visibility: visible;
  }
  body.printing-student-accounts #modal-student-accounts {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
  }

  /* Universal print hygiene: hide non-printable navigation, buttons and backdrops */
  .no-print,
  .app-header,
  .sidebar,
  .modal-backdrop:not(.active-print),
  .mobile-bottom-dock,
  .speedgrader-cockpit-toolbar,
  .studio-tabs-nav,
  .btn:not(.printable-btn) {
    display: none !important;
  }

  /* Assessment Studio Audit & Rubric Report Print Optimization */
  #studio-audit-report-container,
  #studio-rubric-content-container {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #studio-audit-report-container *,
  #studio-rubric-content-container * {
    visibility: visible !important;
  }

  #studio-audit-defects-list,
  #studio-rubric-questions-list {
    max-height: none !important;
    overflow: visible !important;
  }

  .audit-defect-item {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 14px !important;
    box-shadow: none !important;
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .user-name-display,
  .badge-role {
    display: none;
  }
  .user-profile-trigger {
    padding: 0.25rem;
  }
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ==========================================================================
   SUBMISSION VIEWER MODAL & SMART TABLE PAGE CHIPS
   ========================================================================== */

/* Page Count & Quick View Chips in Submissions Table */
.page-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.page-chip-btn:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.12);
}

.page-chip-btn .view-hint {
  font-size: 0.7rem;
  color: #4f46e5;
  font-weight: 800;
  padding-left: 0.15rem;
}

.page-chip-empty {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.page-chip-empty:hover {
  background: #fef3c7;
  border-color: #d97706;
}

/* Submission Viewer Modal Container */
.submission-viewer-modal-content {
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #ffffff;
  max-width: 1200px;
  width: 95vw;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.mvs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mvs-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mvs-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #082850, #00c5df);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

.mvs-meta-content {
  display: flex;
  flex-direction: column;
}

.mvs-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mvs-student-name {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main, #0f172a);
}

.mvs-meta-info {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.2rem;
}

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

.mvs-disclaimer {
  margin-bottom: 0.65rem;
}

.disclaimer-short,
.btn-text-short {
  display: none;
}

.disclaimer-full,
.btn-text-full {
  display: inline;
}

.mvs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mvs-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mvs-page-indicator {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 0.5rem;
  min-width: 90px;
  text-align: center;
}

.mvs-layer-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.mvs-layer-select {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  height: auto;
}

.mvs-zoom-level {
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 45px;
  text-align: center;
}

.mvs-main-workspace {
  flex: 1 1 auto;
  display: flex;
  position: relative;
  overflow: hidden;
  min-height: 0;
  gap: 0.75rem;
}

.mvs-rubric-drawer {
  width: 380px;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  overflow-y: auto;
  padding: 1rem;
  flex-shrink: 0;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
}

.mvs-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.mvs-drawer-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main, #0f172a);
}

.mvs-drawer-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mvs-bottom-tray {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: 0.5rem;
  flex-shrink: 0;
}

.mvs-thumbnails-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0;
}

.mvs-score-summary {
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.mvs-toolbar .btn {
  font-weight: 600;
  white-space: nowrap;
}

/* Thumbnail Chips in Modal Tray */
.mvs-thumb-item {
  position: relative;
  width: 54px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  background: #f1f5f9;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mvs-thumb-item:hover {
  border-color: #818cf8;
  transform: scale(1.05);
}

.mvs-thumb-item.active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
  transform: scale(1.06);
}

.mvs-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mvs-thumb-item .thumb-label {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
}

/* Interactive Canvas Viewer inside Modal (Unified with AnnotationViewer) */