/* RoboLabs EDU student foundation — Pass 1 shell only.
   Mirrors the finished teacher shell without changing student page content or
   any Robotlab, simulator, runtime, telemetry, permission, or API behavior. */

body.edu-role-student {
  color-scheme: light;
  --edu-bg: #f6f8fb;
  --edu-surface: #ffffff;
  --edu-surface-subtle: #f9fafb;
  --edu-text-primary: #101828;
  --edu-text-secondary: #667085;
  --edu-text-tertiary: #98a2b3;
  --edu-border: #e4e7ec;
  --edu-navy: #0b1526;
  --edu-navy-hover: #12213a;
  --edu-navy-active: #172b4a;
  --edu-blue: #2f6bff;
  --edu-blue-hover: #2458d8;
  --edu-blue-subtle: #eef4ff;
  --edu-radius-sm: 6px;
  --edu-radius-md: 10px;
  --edu-focus-ring: 0 0 0 3px rgba(47, 107, 255, 0.18);
  --bg: var(--edu-bg);
  --surface: var(--edu-surface);
  --surface-2: var(--edu-surface-subtle);
  --border: var(--edu-border);
  --text: var(--edu-text-primary);
  --text-soft: var(--edu-text-secondary);
  --text-mute: var(--edu-text-tertiary);
  --brand-50: var(--edu-blue-subtle);
  --brand-500: var(--edu-blue);
  --brand-600: var(--edu-blue-hover);
  --sidebar-w: 224px;
  --topbar-h: 64px;
  --font-display: var(--font);
  min-height: 100vh;
  background: var(--edu-bg);
  color: var(--edu-text-primary);
}

html[data-theme="dark"] body.edu-role-student {
  --bg: var(--edu-bg);
  --surface: var(--edu-surface);
  --surface-2: var(--edu-surface-subtle);
  --border: var(--edu-border);
  --text: var(--edu-text-primary);
  --text-soft: var(--edu-text-secondary);
  --text-mute: var(--edu-text-tertiary);
  background: var(--edu-bg);
  color: var(--edu-text-primary);
}

body.edu-role-student :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--edu-blue);
  outline-offset: 2px;
}

body.edu-role-student .edu-sidebar,
html[data-theme="dark"] body.edu-role-student .edu-sidebar {
  width: var(--sidebar-w);
  padding: 0;
  gap: 0;
  overflow-x: hidden;
  background: var(--edu-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #d0d5dd;
  animation: none;
  box-shadow: none;
  transition: width 180ms cubic-bezier(.2, .8, .2, 1), padding 180ms cubic-bezier(.2, .8, .2, 1);
}

body.edu-role-student .brand {
  position: relative;
  min-height: 76px;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.edu-role-student .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--edu-blue);
  box-shadow: none;
}

body.edu-role-student .brand-title {
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

body.edu-role-student .brand-sub {
  margin-top: 1px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

body.edu-role-student .sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #98a2b3;
  border-radius: var(--edu-radius-sm);
}

body.edu-role-student .sidebar-collapse-btn:hover {
  background: var(--edu-navy-hover);
  color: #fff;
}

body.edu-role-student .nav {
  gap: 4px;
  padding: 18px 12px;
}

body.edu-role-student .nav-item {
  min-height: 46px;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #b8c1d1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  transition: background-color 140ms ease, color 140ms ease;
}

body.edu-role-student .nav-item:hover {
  background: var(--edu-navy-hover);
  color: #fff;
  transform: none;
}

body.edu-role-student .nav-item.active,
html[data-theme="dark"] body.edu-role-student .nav-item.active {
  background: var(--edu-navy-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--edu-blue);
}

body.edu-role-student .nav-item.active::before { display: none; }

body.edu-role-student .nav-icon,
body.edu-role-student .nav-item.active .nav-icon,
html[data-theme="dark"] body.edu-role-student .nav-icon,
html[data-theme="dark"] body.edu-role-student .nav-item.active .nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  background: transparent;
  color: currentColor;
}

body.edu-role-student .nav-item:hover .nav-icon {
  color: currentColor;
  transform: none;
}

body.edu-role-student .nav-label {
  font-size: 14px;
  font-weight: inherit;
  letter-spacing: 0;
}

body.edu-role-student .sidebar-footer {
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

body.edu-role-student .mode-toggle { display: none; }

body.edu-role-student .sidebar-footer-credit {
  color: #667085;
  font-size: 10px;
  line-height: 1.5;
}

body.edu-role-student .edu-main,
html[data-theme="dark"] body.edu-role-student .edu-main {
  width: calc(100% - var(--sidebar-w));
  margin-left: var(--sidebar-w);
  background: var(--edu-bg) !important;
  transition: width 180ms cubic-bezier(.2, .8, .2, 1), margin-left 180ms cubic-bezier(.2, .8, .2, 1);
}

body.edu-role-student .edu-topbar,
html[data-theme="dark"] body.edu-role-student .edu-topbar {
  height: var(--topbar-h);
  padding: 0 clamp(20px, 3vw, 48px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--edu-border);
  color: var(--edu-text-primary);
  backdrop-filter: blur(10px);
  animation: none;
  box-shadow: none;
}

body.edu-role-student .topbar-left { gap: 10px; }

body.edu-role-student .topbar-title {
  color: var(--edu-text-primary);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

body.edu-role-student .topbar-role-badge,
body.edu-role-student .data-source-pill,
body.edu-role-student .topbar-notification-btn,
body.edu-role-student .status-pill {
  display: none !important;
}

body.edu-role-student .topbar-actions {
  gap: 12px;
  flex-wrap: nowrap;
}

body.edu-role-student .topbar-user-widget {
  gap: 9px;
  padding: 3px 0 3px 3px;
  border-radius: var(--edu-radius-md);
}

body.edu-role-student .topbar-user-widget:hover { background: transparent; }

body.edu-role-student .topbar-user-avatar,
html[data-theme="dark"] body.edu-role-student .topbar-user-avatar {
  width: 34px;
  height: 34px;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: var(--edu-blue-subtle);
  color: var(--edu-blue-hover);
  box-shadow: none;
}

body.edu-role-student .topbar-user-name {
  color: var(--edu-text-primary);
  font-size: 13px;
  font-weight: 600;
}

body.edu-role-student .topbar-user-sub {
  margin-top: 4px;
  color: var(--edu-text-secondary);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

body.edu-role-student .edu-view {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 30px clamp(20px, 3vw, 48px) 48px;
  gap: 28px;
  background: transparent;
  animation: none;
}

/* Robotlab uses the same full-width engineering canvas for students and
   teachers. The role changes available tools, never the workspace geometry. */
body.edu-role-student .edu-view.edu-view-lab {
  max-width: none;
  padding: clamp(16px, 2vw, 32px);
}

body.sidebar-collapsed.edu-role-student .edu-sidebar {
  width: 70px;
  padding: 0 9px;
}

body.sidebar-collapsed.edu-role-student .edu-main {
  width: calc(100% - 70px);
  margin-left: 70px;
}

body.sidebar-collapsed.edu-role-student .edu-sidebar .brand {
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 4px;
}

body.sidebar-collapsed.edu-role-student .edu-sidebar :where(.brand-text, .nav-label, .sidebar-footer) {
  display: none;
}

body.sidebar-collapsed.edu-role-student .edu-sidebar .brand-mark {
  width: 34px;
  height: 34px;
}

body.sidebar-collapsed.edu-role-student .edu-sidebar .sidebar-collapse-btn {
  width: 26px;
  height: 22px;
  margin: 0 auto;
  transform: rotate(180deg);
}

body.sidebar-collapsed.edu-role-student .edu-sidebar .nav { padding: 16px 0; }

body.sidebar-collapsed.edu-role-student .edu-sidebar .nav-item {
  justify-content: center;
  padding: 9px;
}

body.sidebar-collapsed.edu-role-student .edu-sidebar .nav-item.active {
  box-shadow: inset 2px 0 0 var(--edu-blue);
}

@media (max-width: 780px) {
  body.edu-role-student { --sidebar-w: 68px; }

  body.edu-role-student .edu-sidebar,
  body.sidebar-collapsed.edu-role-student .edu-sidebar {
    top: 0;
    right: auto;
    bottom: auto;
    width: 68px;
    height: 100vh;
    padding: 0 8px;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  body.edu-role-student .edu-sidebar .brand {
    display: flex;
    min-height: 68px;
    justify-content: center;
    padding: 12px 4px;
  }

  body.edu-role-student .edu-sidebar :where(.brand-text, .nav-label, .sidebar-footer, .sidebar-collapse-btn) {
    display: none;
  }

  body.edu-role-student .edu-sidebar .nav {
    flex-direction: column;
    padding: 12px 0;
  }

  body.edu-role-student .edu-sidebar .nav-item {
    justify-content: center;
    padding: 9px;
    flex-direction: row;
  }

  body.edu-role-student .edu-main,
  body.sidebar-collapsed.edu-role-student .edu-main {
    width: calc(100% - 68px);
    margin-left: 68px;
    padding-bottom: 0;
  }

  body.edu-role-student .edu-topbar {
    min-height: 64px;
    height: auto;
    padding: 10px 20px;
  }

  body.edu-role-student .topbar-user-info { display: none; }

  body.edu-role-student .edu-view { padding: 24px 20px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  body.edu-role-student *,
  body.edu-role-student *::before,
  body.edu-role-student *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
