@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
  /* Brand & Semantic Colors (DESIGN.md) */
  --color-primary: #4285F4;        /* Azul Vibrante */
  --color-primary-hover: #3367d6;
  --color-primary-subtle: #e8f0fe;
  --color-primary-border: #aecbfa;

  --color-secondary: #EA4335;      /* Vermelho Ousado */
  --color-secondary-subtle: #fce8e6;
  --color-secondary-border: #fad2cf;

  --color-tertiary: #FBBC05;       /* Amarelo Energético */
  --color-tertiary-subtle: #fef7e0;
  --color-tertiary-border: #feefc3;

  --color-neutral: #34A853;        /* Verde Vistoso */
  --color-neutral-subtle: #e6f4ea;
  --color-neutral-border: #ceead6;

  --color-cyan: #00BCD4;           /* Ciano */
  --color-cyan-subtle: #e0f7fa;

  /* Surfaces & Backgrounds */
  --color-surface: #FFFFFF;        /* Primary Surface */
  --color-surface-variant: #F1F3F4;/* Secondary / Card Surface */
  --color-bg: #F8F9FA;             /* App Background */
  --color-border: #DADCE0;         /* 1px border stroke */
  --color-border-subtle: #E8EAED;

  /* Typography Colors */
  --color-text-main: #202124;      /* High contrast dark */
  --color-text-body: #3C4043;      /* Secondary dark surface */
  --color-text-muted: #5F6368;     /* Muted labels */
  --color-text-inverse: #FFFFFF;

  /* Typography Scale */
  --font-family-base: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-mono: 'JetBrains Mono', monospace;

  /* Corner Radius (DESIGN.md) */
  --rounded-sm: 8px;
  --rounded-md: 16px;
  --rounded-lg: 24px;
  --rounded-full: 9999px;

  /* Elevation Shadows (Material Physics) */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-elevation-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-elevation-2: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  --shadow-elevation-3: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  --shadow-lift: 0 4px 14px rgba(66, 133, 244, 0.25);

  /* Z-Index Contract */
  --z-base: 0;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 500;
}

/* Reset & Base Setup */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-body);
  font-family: var(--font-family-base);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[x-cloak] {
  display: none !important;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-main);
  font-family: var(--font-family-base);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text-main);
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.sub-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-body);
  max-width: 72ch;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-mono {
  font-family: var(--font-family-mono);
}

/* Layout Containers */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

.dashboard-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  width: 100%;
  min-height: calc(100dvh - 64px);
}

.dashboard-layout--collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

main.container:has(.dashboard-layout) {
  max-width: none;
  padding: 0;
}

.dashboard-layout--teacher {
  --dashboard-accent: var(--color-primary);
  --dashboard-accent-subtle: var(--color-primary-subtle);
}

.dashboard-layout--student {
  --dashboard-accent: var(--color-neutral);
  --dashboard-accent-subtle: var(--color-neutral-subtle);
}

.dashboard-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100dvh - 80px);
  min-height: 0;
  padding: 1.25rem 1rem;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

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

.dashboard-sidebar-label {
  margin-bottom: 0.25rem;
  color: var(--dashboard-accent);
  font-family: var(--font-family-mono);
  font-size: 0.6875rem;
  font-weight: 700;
}

.dashboard-sidebar-title {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.dashboard-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  background: var(--color-surface);
  color: var(--color-text-body);
  cursor: pointer;
}

.dashboard-sidebar-toggle:hover {
  background: var(--dashboard-accent-subtle);
  color: var(--dashboard-accent);
}

.dashboard-sidebar-toggle .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.dashboard-sidebar-toggle .icon.is-collapsed {
  transform: rotate(180deg);
}

.dashboard-nav {
  display: grid;
  gap: 0.35rem;
}

.dashboard-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: var(--rounded-sm);
  background: transparent;
  color: var(--color-text-body);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.is-current {
  background: var(--dashboard-accent-subtle);
  color: var(--dashboard-accent);
}

.dashboard-nav-link .icon {
  flex: 0 0 18px;
}

.dashboard-sidebar-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.dashboard-main {
  min-width: 0;
  width: 100%;
  max-width: 1500px;
  padding: 2rem;
}

.dashboard-sidebar-backdrop {
  display: none;
}

.dashboard-layout--collapsed .dashboard-sidebar {
  padding-right: 1rem;
  padding-left: 1rem;
}

.dashboard-layout--collapsed .dashboard-sidebar-label,
.dashboard-layout--collapsed .dashboard-sidebar-title,
.dashboard-layout--collapsed .dashboard-sidebar-note,
.dashboard-layout--collapsed .dashboard-nav-link span {
  display: none;
}

.dashboard-layout--collapsed .dashboard-sidebar-header {
  justify-content: center;
}

.dashboard-layout--collapsed .dashboard-sidebar-header > div {
  display: none;
}

.dashboard-layout--collapsed .dashboard-sidebar-toggle,
.dashboard-layout--collapsed .dashboard-nav-link {
  justify-content: center;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}

/* Navigation Bar */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  background: var(--color-surface);
  color: var(--color-text-body);
  cursor: pointer;
}

.navbar-sidebar-toggle .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.navbar-sidebar-toggle .icon.is-collapsed {
  transform: rotate(180deg);
}

.navbar-sidebar-toggle:hover {
  background: var(--color-surface-variant);
}

.navbar-actions,
.navbar-user {
  display: flex;
  align-items: center;
}

.navbar-user {
  gap: 1rem;
}

.navbar-user-desktop {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-user-name {
  color: var(--color-text-main);
  font-size: 0.9375rem;
  font-weight: 500;
}

.profile-menu {
  position: relative;
  display: none;
}

.profile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-body);
  cursor: pointer;
}

.profile-menu-toggle:hover,
.profile-menu-toggle[aria-expanded="true"] {
  background: var(--color-surface-variant);
}

.profile-menu-toggle .icon {
  width: 20px;
  height: 20px;
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: calc(var(--z-sticky) + 1);
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  min-width: 200px;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.profile-menu-name {
  max-width: 240px;
  overflow: hidden;
  color: var(--color-text-main);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-badge-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--rounded-sm);
  background: linear-gradient(135deg, #4285F4 0%, #34A853 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.brand-tagline {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--rounded-sm);
  font-family: var(--font-family-base);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s ease-out, transform 0.15s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
  text-decoration: none;
  line-height: 1.2;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-elevation-1);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: var(--shadow-lift);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-body);
  border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-surface-variant);
  border-color: #BCC1C8;
  color: var(--color-text-main);
}

.btn-success {
  background-color: var(--color-neutral);
  color: #FFFFFF;
}

.btn-success:hover {
  background-color: #2d9247;
  box-shadow: 0 4px 12px rgba(52, 168, 83, 0.25);
}

.btn-danger {
  background-color: var(--color-secondary);
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: #d93025;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: var(--rounded-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.0625rem;
  border-radius: var(--rounded-sm);
}

/* Components: Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

.card:hover {
  border-color: #C4C7CC;
  box-shadow: var(--shadow-elevation-1);
}

/* Badges & Status Signals */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--rounded-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-family-base);
}

.badge-primary {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-border);
}

.badge-neutral {
  background-color: var(--color-neutral-subtle);
  color: var(--color-neutral);
  border: 1px solid var(--color-neutral-border);
}

.badge-warning {
  background-color: var(--color-tertiary-subtle);
  color: #b06000;
  border: 1px solid var(--color-tertiary-border);
}

.badge-error {
  background-color: var(--color-secondary-subtle);
  color: var(--color-secondary);
  border: 1px solid var(--color-secondary-border);
}

.pulse-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  display: inline-block;
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  color: var(--color-text-main);
  font-family: var(--font-family-base);
  font-size: 0.9375rem;
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Dedicated Exam & Question Editor Workspace Layout */
.exam-editor-workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: flex-start;
}

.exam-editor-sidebar {
  position: sticky;
  top: 85px;
}

.question-builder-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.question-builder-card:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-elevation-1);
}

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

.question-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Split Hero Section */
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0;
  min-height: 72dvh;
}

.hero-preview-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: var(--shadow-elevation-2);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-preview-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4285F4, #34A853, #FBBC05, #EA4335);
}

/* Zig-Zag Feature Rows */
.zig-zag-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 3.5rem 0;
}

.zig-zag-row.reverse {
  direction: rtl;
}

.zig-zag-row.reverse > * {
  direction: ltr;
}

.feature-visual-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

/* Telemetry Stats Bar */
.telemetry-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
}

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-body);
}

.telemetry-pill strong {
  color: var(--color-text-main);
  font-family: var(--font-family-mono);
}

/* Forensic Playback Console */
.playback-console {
  background: #1e2124;
  color: #e8eaed;
  border-radius: var(--rounded-sm);
  padding: 1.25rem;
  font-family: var(--font-family-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  min-height: 160px;
  white-space: pre-wrap;
  border: 1px solid #3c4043;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--z-toast);
  padding: 12px 20px;
  border-radius: var(--rounded-sm);
  font-weight: 500;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-elevation-3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s cubic-bezier(0, 0, 0.2, 1);
  background: var(--color-surface);
  border-left: 4px solid var(--color-primary);
  color: var(--color-text-main);
}

.toast-error {
  border-left-color: var(--color-secondary);
  background: #fff8f7;
}

.toast-success {
  border-left-color: var(--color-neutral);
  background: #f6fbf7;
}

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

/* Stat Box Metric */
.stat-box {
  background: var(--color-surface-variant);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  padding: 1rem 1.25rem;
}

.stat-val {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--font-family-mono);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Table Style */
.table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--color-surface-variant);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-body);
  font-size: 0.9375rem;
}

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

tr:hover td {
  background: rgba(66, 133, 244, 0.02);
}

/* SVG Icon Helper */
.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Responsive Collapse */
@media (max-width: 900px) {
  .exam-editor-workspace {
    grid-template-columns: 1fr;
  }
  .exam-editor-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
  }

  .zig-zag-row, .zig-zag-row.reverse {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
    direction: ltr;
  }

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

  .navbar-inner {
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .navbar-sidebar-toggle {
    display: inline-flex;
    flex: 0 0 38px;
  }

  .navbar-inner > .brand {
    margin-right: auto;
  }

  .brand {
    gap: 0;
  }

  .brand > div:last-child,
  .navbar-user-desktop {
    display: none;
  }

  .brand-badge-ai {
    width: 36px;
    height: 36px;
  }

  .profile-menu {
    display: block;
  }

  main.container:has(.dashboard-layout) {
    padding: 0;
  }

  main.container:not(:has(.dashboard-layout)) {
    padding: 1.25rem 1rem;
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100dvh - 62px);
  }

  .dashboard-layout--collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-sidebar {
    position: fixed;
    top: 62px;
    bottom: 0;
    left: 0;
    z-index: calc(var(--z-sticky) - 1);
    width: min(280px, 82vw);
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 1rem;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    visibility: hidden;
    border: 0;
    box-shadow: var(--shadow-elevation-2);
  }

  .dashboard-sidebar-toggle {
    display: none;
  }

  .dashboard-layout--mobile-open .dashboard-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .dashboard-sidebar-backdrop {
    position: fixed;
    inset: 62px 0 0;
    z-index: calc(var(--z-sticky) - 2);
    display: block;
    width: 100%;
    border: 0;
    background: rgba(32, 33, 36, 0.32);
  }

  .dashboard-sidebar-header {
    align-items: center;
    margin-bottom: 1rem;
  }

  .dashboard-layout--collapsed .dashboard-sidebar-label,
  .dashboard-layout--collapsed .dashboard-sidebar-title,
  .dashboard-layout--collapsed .dashboard-sidebar-note {
    display: block;
  }

  .dashboard-layout--collapsed .dashboard-nav-link span {
    display: inline;
  }

  .dashboard-layout--collapsed .dashboard-sidebar-header {
    justify-content: space-between;
  }

  .dashboard-layout--collapsed .dashboard-sidebar-header > div {
    display: block;
  }

  .dashboard-layout--collapsed .dashboard-nav-link {
    justify-content: flex-start;
  }

  .dashboard-main {
    padding: 1rem 0.75rem;
  }

  .dashboard-sidebar-title {
    margin-bottom: 0;
  }

  .dashboard-nav {
    display: grid;
    gap: 0.25rem;
  }

  .dashboard-nav-link {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.5rem;
  }

  .dashboard-sidebar-note {
    display: none;
  }
}

@media (max-width: 480px) {
  .dashboard-main {
    padding: 1rem 0.5rem;
  }
}

/* Modal System */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-fade-in 0.2s ease-out;
}

.modal-dialog {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3), var(--shadow-elevation-3);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  animation: modal-pop-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--color-surface-variant);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop-up {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Student Join Exam by Key Workflow */
.student-join-section {
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary-border);
  border-radius: var(--rounded-md);
  padding: 1.75rem 2rem;
  margin-bottom: 2.25rem;
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.08);
  position: relative;
  overflow: hidden;
}

.student-join-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-neutral) 100%);
}

.join-key-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.join-key-input-container {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.join-key-input-container svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--color-text-muted);
  pointer-events: none;
}

.join-key-input {
  padding-left: 42px !important;
  font-family: var(--font-family-mono);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  height: 46px;
}

.unlocked-exam-card {
  background: #FFFFFF;
  border: 2px solid var(--color-neutral);
  border-radius: var(--rounded-md);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 30px rgba(52, 168, 83, 0.12);
  animation: slide-in-down 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes slide-in-down {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.flexible-time-banner {
  background: linear-gradient(135deg, var(--color-neutral-subtle) 0%, #f0fdf4 100%);
  border: 1.5px solid var(--color-neutral-border);
  border-radius: var(--rounded-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scheduled-time-banner {
  background: linear-gradient(135deg, var(--color-tertiary-subtle) 0%, #fffbeb 100%);
  border: 1.5px solid var(--color-tertiary-border);
  border-radius: var(--rounded-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.exam-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1rem 0;
}

.exam-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-surface-variant);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--rounded-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-body);
}
