@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  color-scheme: light;
  font-family: "Space Grotesk", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f6faff;
  color: #0f172a;
  --ink: #0f172a;
  --muted: #516074;
  --paper: #f5f9ff;
  --surface: #ffffff;
  --line: rgba(15, 65, 122, 0.14);
  --accent: #0f4c81;
  --accent-dark: #0a3358;
  --accent-soft: #e8f1fb;
  --accent-contrast: #ffffff;
  --accent-border: rgba(15, 76, 129, 0.18);
  --accent-border-strong: rgba(15, 76, 129, 0.30);
  --danger: #b42318;
  --danger-soft: #fdecec;
  --danger-text: #b42318;
  --success-soft: #e7f7ef;
  --success-text: #166534;
  --warning-soft: #e6f3ff;
  --warning-text: #0f4c81;
  --body-bg:
    radial-gradient(circle at 10% 16%, rgba(14, 165, 233, 0.10), transparent 24rem),
    radial-gradient(circle at 88% 0%, rgba(15, 76, 129, 0.10), transparent 22rem),
    linear-gradient(145deg, #f8fbff 0%, #edf4fb 100%);
  --auth-hero-bg:
    linear-gradient(160deg, rgba(6, 22, 43, 0.22), rgba(7, 25, 48, 0.82)),
    radial-gradient(circle at 20% 24%, rgba(59, 130, 246, 0.28), transparent 24rem),
    linear-gradient(135deg, #081427, #0b2c4e 58%, #0f766e);
  --auth-panel-bg: rgba(248, 251, 255, 0.92);
  --sidebar-bg: linear-gradient(180deg, rgba(7, 25, 48, 0.96), rgba(11, 44, 78, 0.96));
  --panel-bg: rgba(255, 255, 255, 0.84);
  --field-bg: #ffffff;
  --field-hover-bg: #f2f8ff;
  --field-focus: rgba(15, 76, 129, 0.13);
  --select-arrow:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.75 7.75L10 12.25L14.25 7.75' stroke='%230f4c81' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --secondary-bg: #f7fbff;
  --secondary-hover: #eaf3fb;
  --nav-text: #dbeafe;
  --nav-hover-bg: rgba(255, 255, 255, 0.08);
  --nav-active-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.18));
  --nav-border: var(--accent-border);
  --nav-active-border: var(--accent-border-strong);
  --chip-bg: #eef4fb;
  --callout-bg: rgba(255, 255, 255, 0.92);
  --callout-text: #0f172a;
  --callout-muted: #516074;
  --pre-bg: #0f172a;
  --pre-text: #dbeafe;
  --toast-bg: #f7fbff;
  --toast-text: #0f172a;
  --shadow: 0 24px 60px rgba(8, 15, 32, 0.10);
  --accent-shadow: 0 18px 40px rgba(15, 76, 129, 0.20);
  --toast-shadow: 0 24px 70px rgba(23, 32, 51, 0.26);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  background: #080b14;
  color: #e7edf8;
  --ink: #e7edf8;
  --muted: #99a8bd;
  --paper: #111827;
  --surface: #121a2a;
  --line: #263348;
  --accent: #7cc4ff;
  --accent-dark: #bae6fd;
  --accent-soft: rgba(124, 196, 255, 0.14);
  --accent-contrast: #111827;
  --accent-border: rgba(124, 196, 255, 0.20);
  --accent-border-strong: rgba(124, 196, 255, 0.32);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.16);
  --danger-text: #fecdd3;
  --success-soft: rgba(34, 197, 94, 0.16);
  --success-text: #bbf7d0;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --warning-text: #fde68a;
  --body-bg:
    radial-gradient(circle at 12% 20%, rgba(14, 165, 233, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 0%, rgba(45, 212, 191, 0.10), transparent 24rem),
    linear-gradient(135deg, #07111f 0%, #0d1c31 100%);
  --auth-hero-bg:
    linear-gradient(160deg, rgba(7, 10, 19, 0.18), rgba(7, 10, 19, 0.82)),
    radial-gradient(circle at 20% 24%, rgba(59, 130, 246, 0.30), transparent 24rem),
    linear-gradient(135deg, #081427, #0b2c4e 58%, #0f766e);
  --auth-panel-bg: rgba(15, 23, 42, 0.88);
  --sidebar-bg: rgba(12, 18, 30, 0.9);
  --panel-bg: rgba(17, 24, 39, 0.78);
  --field-bg: #0f172a;
  --field-hover-bg: #131d30;
  --field-focus: rgba(139, 147, 255, 0.16);
  --select-arrow:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.75 7.75L10 12.25L14.25 7.75' stroke='%237cc4ff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --secondary-bg: #111827;
  --secondary-hover: #1b2638;
  --nav-text: #aab6c8;
  --nav-hover-bg: rgba(255, 255, 255, 0.08);
  --nav-active-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(14, 165, 233, 0.14));
  --nav-border: rgba(231, 237, 248, 0.10);
  --nav-active-border: rgba(139, 147, 255, 0.30);
  --chip-bg: #142033;
  --callout-bg: #10233f;
  --callout-text: #e7edf8;
  --callout-muted: rgba(231, 237, 248, 0.72);
  --pre-bg: #050816;
  --pre-text: #dbeafe;
  --toast-bg: #e5eefc;
  --toast-text: #111827;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
  --accent-shadow: 0 12px 30px rgba(14, 165, 233, 0.18);
  --toast-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--body-bg);
  color: var(--ink);
}

a {
  color: inherit;
}

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

h1 {
  font-size: clamp(2rem, 4vw, 4.8rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
button,
textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 54px;
}

.password-field > .password-toggle {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 8px;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 !important;
  box-shadow: none;
  flex: 0 0 38px;
  margin: auto 0;
  appearance: none;
  z-index: 1;
}

.password-field > .password-toggle span {
  font-size: 0;
  line-height: 0;
}

.password-field > .password-toggle span::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M1.5 9C3.12 5.82 5.78 4.25 9 4.25C12.22 4.25 14.88 5.82 16.5 9C14.88 12.18 12.22 13.75 9 13.75C5.78 13.75 3.12 12.18 1.5 9Z' stroke='%23667186' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9' cy='9' r='2.3' stroke='%23667186' stroke-width='1.4'/%3E%3C/svg%3E")
    center / 18px 18px no-repeat;
}

.password-field > .password-toggle:hover,
.password-field > .password-toggle:focus-visible,
.password-field > .password-toggle.is-active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.password-field > .password-toggle:hover span::before,
.password-field > .password-toggle:focus-visible span::before,
.password-field > .password-toggle.is-active span::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M1.5 9C3.12 5.82 5.78 4.25 9 4.25C12.22 4.25 14.88 5.82 16.5 9C14.88 12.18 12.22 13.75 9 13.75C5.78 13.75 3.12 12.18 1.5 9Z' stroke='%233730a3' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9' cy='9' r='2.3' stroke='%233730a3' stroke-width='1.4'/%3E%3C/svg%3E")
    center / 18px 18px no-repeat;
}

select {
  appearance: none;
  background-color: var(--field-bg);
  background-image: var(--select-arrow);
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  cursor: pointer;
  font-weight: 800;
  padding-right: 46px;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select .native-select {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.custom-select-trigger {
  width: 100%;
  min-height: 50px;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    var(--select-arrow) right 14px center / 18px 18px no-repeat,
    var(--field-bg);
  color: var(--ink);
  padding: 13px 46px 13px 16px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
  border-color: var(--accent-border-strong);
  background:
    var(--select-arrow) right 14px center / 18px 18px no-repeat,
    var(--field-hover-bg);
  box-shadow: 0 0 0 4px var(--field-focus);
  transform: none;
}

.custom-select.is-disabled .custom-select-trigger {
  cursor: not-allowed;
  opacity: 0.62;
  background:
    var(--select-arrow) right 14px center / 18px 18px no-repeat,
    var(--chip-bg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 25;
  display: none;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--accent-border-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--toast-shadow);
  padding: 6px;
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 4px;
  animation: dropdownReveal 140ms ease both;
}

.custom-select-option {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  padding: 9px 12px;
  text-align: left;
  box-shadow: none;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: var(--nav-active-bg);
  color: var(--ink);
  transform: none;
}

select:hover,
input:hover,
textarea:hover {
  border-color: var(--accent-border-strong);
  background-color: var(--field-hover-bg);
}

select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background-color: var(--chip-bg);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--field-focus);
  outline: 0;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
  box-shadow: var(--accent-shadow);
  transform: translateY(-1px);
}

button.secondary,
.button-link.secondary {
  border: 1px solid var(--line);
  background: var(--secondary-bg);
  color: var(--ink);
}

button.secondary:hover,
.button-link.secondary:hover {
  background: var(--secondary-hover);
  box-shadow: none;
}

button.danger {
  background: var(--danger);
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
  min-height: 100vh;
}

.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  padding: clamp(32px, 7vw, 90px);
  background: var(--auth-hero-bg);
  color: #fff;
}

.auth-hero .muted {
  max-width: 680px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
}

.brand-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(28px, 5vw, 72px);
  background: var(--auth-panel-bg);
  backdrop-filter: blur(24px);
}

.auth-panel h2 {
  margin-bottom: 10px;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.form-stack button {
  width: 100%;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.switch-copy {
  margin-top: 24px;
  color: var(--muted);
}

.switch-copy a {
  color: var(--accent);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

.workspace.sidebar-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px);
  transition: padding 220ms ease, box-shadow 220ms ease;
}

.sidebar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 46px;
  color: #eff6ff;
  font-weight: 900;
  text-decoration: none;
}

.brand-name {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 160ms ease, transform 160ms ease, width 180ms ease;
}

.brand-dot {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #eff6ff;
  font-size: 0.82rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.sidebar-toggle {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-content: center;
  gap: 4px;
}

.sidebar-toggle span {
  width: 17px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease, width 180ms ease;
}

.workspace.sidebar-collapsed .sidebar {
  align-items: center;
  padding: 24px 0;
}

.workspace.sidebar-collapsed .sidebar-head {
  width: 42px;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 12px;
  min-height: 100px;
}

.workspace.sidebar-collapsed .sidebar-brand {
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
}

.workspace.sidebar-collapsed .brand-name,
.workspace.sidebar-collapsed .user-label,
.workspace.sidebar-collapsed .sidebar-footer button {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-8px);
}

.workspace.sidebar-collapsed .sidebar-toggle {
  position: static;
  transform: none;
}

.workspace.sidebar-collapsed .sidebar-toggle span:nth-child(1) {
  transform: translateX(-2px);
}

.workspace.sidebar-collapsed .sidebar-toggle span:nth-child(2) {
  width: 11px;
}

.workspace.sidebar-collapsed .sidebar-toggle span:nth-child(3) {
  transform: translateX(2px);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.workspace.sidebar-collapsed .nav-list {
  width: 42px;
  justify-items: center;
  margin-top: 26px;
}

.nav-list a {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid var(--nav-border);
  border-radius: 14px;
  padding: 13px 14px;
  background: transparent;
  color: var(--nav-text);
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-list a:hover {
  border-color: var(--nav-active-border);
  background: var(--nav-hover-bg);
  color: #eff6ff;
  transform: translateX(2px);
}

.nav-list a.active {
  border-color: var(--nav-active-border);
  background: var(--nav-active-bg);
  color: #eff6ff;
}

.workspace.sidebar-collapsed .nav-list a {
  display: grid;
  width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  font-size: 0;
  line-height: 1;
}

.workspace.sidebar-collapsed .nav-list a:hover {
  transform: none;
}

.workspace.sidebar-collapsed .nav-list a::before {
  content: attr(data-short);
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  align-items: center;
  justify-items: center;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  transform: translateY(0.5px);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.sidebar-footer button {
  width: 100%;
}

.user-label {
  color: rgba(219, 234, 254, 0.76);
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
}

.workspace-main {
  min-width: 0;
  padding: clamp(24px, 4vw, 56px);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.page-head,
.section-head,
.project-row-main {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.page-head {
  margin-bottom: 0;
}

.teacher-dashboard-head {
  align-items: end;
}

.page-head .muted {
  max-width: 720px;
  margin-top: 12px;
}

.panel,
.callout,
.empty-state,
.project-row,
.toolbar {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.panel,
.callout,
.empty-state,
.project-row {
  padding: 24px;
}

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  border-color: var(--nav-active-border);
  background: var(--callout-bg);
  color: var(--callout-text);
}

.teacher-dashboard-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.dashboard-entry-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--accent-border);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 22px;
}

.dashboard-entry-card.selected {
  border-color: var(--accent-border-strong);
  box-shadow: var(--accent-shadow);
}

.dashboard-entry-card-wide {
  grid-column: 1 / -1;
}

.dashboard-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-module-chip {
  width: auto;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 9px 14px;
  font-weight: 800;
}

.dashboard-module-chip.active,
.dashboard-module-chip:hover {
  border-color: var(--accent-border-strong);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(14, 165, 233, 0.14));
  color: var(--accent-dark);
  transform: translateY(-1px);
}

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

.panel:hover,
.project-row:hover,
.toolbar:hover,
.callout:hover {
  border-color: var(--accent-border-strong);
}

#auditCard {
  margin-top: 26px;
}

.academic-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  min-width: min(100%, 820px);
}

.academic-filters label {
  color: var(--callout-text);
}

.academic-filters .button-link {
  min-height: 48px;
  padding: 13px 18px;
  white-space: nowrap;
}

.project-form {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 0.7fr 0.9fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-top: 22px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 14px;
  margin: 22px 0;
  padding: 18px;
}

.projects-list {
  display: grid;
  gap: 18px;
}

.project-row {
  display: grid;
  gap: 16px;
}

.repo-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  word-break: break-all;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.project-meta span,
.pill {
  border-radius: 999px;
  background: var(--chip-bg);
  padding: 8px 12px;
}

.pill {
  color: var(--nav-text);
  font-size: 0.82rem;
  font-weight: 900;
}

.pill.running {
  background: var(--success-soft);
  color: var(--success-text);
}

.pill.failed {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.pill.building {
  background: var(--warning-soft);
  color: var(--warning-text);
  animation: pulse 1.2s ease-in-out infinite;
}

.pill.approved {
  background: var(--success-soft);
  color: var(--success-text);
}

.pill.pending {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.pill.rejected {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-actions a,
.project-actions button {
  padding: 10px 13px;
}

pre {
  max-height: 320px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 18px;
  background: var(--pre-bg);
  color: var(--pre-text);
  padding: 16px;
  font-size: 0.88rem;
}

.audit-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.audit-list,
.settings-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.audit-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface);
}

.audit-row p {
  margin-top: 8px;
  color: var(--muted);
}

.audit-row pre {
  margin-top: 12px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-overview {
  margin-bottom: 0;
}

.student-projects-page,
#studentProjectsPage {
  gap: 28px;
}

.student-classroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.student-classroom-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 18px;
}

.activity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

button.activity-chip {
  border: 1px solid var(--line);
  cursor: pointer;
}

button.activity-chip.active {
  background: var(--nav-active-bg);
  border-color: var(--accent-border-strong);
}

.invite-notice {
  margin-top: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 16px;
  background: var(--nav-active-bg);
  color: var(--ink);
  padding: 14px 16px;
  font-weight: 800;
}

.classroom-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.classroom-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 18px;
}

.classroom-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.classroom-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.invite-link {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  word-break: break-all;
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  background: var(--chip-bg);
  padding: 10px 12px;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-actions button,
.classroom-actions button {
  min-height: 38px;
  padding: 8px 11px;
}

.classroom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.folder-tree {
  display: grid;
  gap: 8px;
}

.folder-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-left: calc(var(--folder-level) * 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-bg);
  padding: 12px;
}

.folder-row::before {
  content: "";
  width: 10px;
  min-width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.folder-row > div:first-of-type {
  flex: 1;
}

.folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.folder-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.module-list {
  display: grid;
  gap: 12px;
}

.module-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
}

.module-row h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.module-workspace-content {
  margin-top: 22px;
}

#studentProjectsPage .panel {
  display: grid;
  gap: 6px;
}

.teacher-shell {
  display: grid;
  gap: 18px;
}

.teacher-hero {
  display: grid;
  gap: 18px;
  border-radius: 28px;
  padding: 28px;
  color: #eff6ff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(120deg, #071427, #114277 52%, #0ea5a3);
  box-shadow: 0 32px 90px rgba(2, 6, 23, 0.20);
}

.teacher-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.teacher-hero-copy {
  display: grid;
  gap: 10px;
}

.teacher-hero-copy h3 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  max-width: 12ch;
}

.teacher-hero-copy p {
  max-width: 58ch;
  color: rgba(239, 246, 255, 0.84);
}

.teacher-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
}

.teacher-hero-card {
  display: grid;
  gap: 10px;
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
}

.teacher-hero-card .muted {
  color: rgba(239, 246, 255, 0.78);
}

.teacher-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.teacher-hero-stat {
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.10);
}

.teacher-hero-stat span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(224, 242, 254, 0.74);
}

.teacher-hero-stat strong {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.module-workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
  gap: 18px;
}

.module-brief,
.module-deliveries,
.delivery-card,
.module-workspace-empty {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 18px;
}

.module-deliveries {
  display: grid;
  gap: 14px;
}

.module-deliveries-premium {
  padding: 22px;
}

.delivery-list {
  display: grid;
  gap: 16px;
}

.delivery-list-dashboard {
  gap: 10px;
}

.delivery-table-head,
.delivery-card-dashboard {
  display: grid;
  grid-template-columns: 1.05fr 0.92fr 0.72fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.delivery-table-head {
  padding: 0 12px;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.delivery-card {
  display: grid;
  gap: 14px;
}

.delivery-card-dashboard {
  padding: 14px 12px;
  gap: 10px;
}

.delivery-card.selected {
  border-color: var(--accent-border-strong);
  box-shadow: var(--accent-shadow);
}

.delivery-student strong,
.delivery-published-link,
.delivery-commit-cell {
  word-break: break-word;
}

.delivery-student strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.96rem;
}

.delivery-student span,
.delivery-published-link,
.delivery-commit-cell {
  color: var(--muted);
  font-size: 0.84rem;
}

.delivery-status-cell,
.delivery-action-cell {
  display: flex;
  align-items: center;
}

.delivery-action-cell {
  justify-content: flex-end;
}

.delivery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.delivery-head h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.delivery-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.delivery-modal-stack {
  display: grid;
  gap: 14px;
}

.deployment-history-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.status-light {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.pill.running,
.pill.building {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.folder-option-source {
  display: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 380px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 16px 18px;
  box-shadow: var(--toast-shadow);
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  min-height: 40px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.28);
}

.modal-body {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.modal-close {
  min-height: 38px;
  padding: 8px 12px;
}

@media (max-width: 1020px) {
  .auth-layout,
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 48vh;
  }

  .auth-panel {
    min-height: auto;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace.sidebar-collapsed .sidebar {
    padding: 24px;
  }

  .workspace.sidebar-collapsed .sidebar-head,
  .workspace.sidebar-collapsed .sidebar-brand {
    justify-content: space-between;
  }

  .workspace.sidebar-collapsed .sidebar-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    justify-items: stretch;
    min-height: 46px;
  }

  .workspace.sidebar-collapsed .brand-name,
  .workspace.sidebar-collapsed .user-label,
  .workspace.sidebar-collapsed .sidebar-footer button {
    width: auto;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: none;
  }

  .workspace.sidebar-collapsed .sidebar-toggle {
    position: static;
    transform: none;
  }

  .workspace.sidebar-collapsed .sidebar-toggle span {
    width: 17px;
    transform: none;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
  }

  .workspace.sidebar-collapsed .nav-list {
    margin-top: 22px;
  }

  .workspace.sidebar-collapsed .nav-list a {
    display: block;
    padding: 13px 14px;
    font-size: inherit;
  }

  .workspace.sidebar-collapsed .nav-list a::before {
    content: none;
  }

  .sidebar-footer {
    margin-top: 22px;
  }

  .project-form,
  .audit-filters,
  .settings-grid,
  .module-workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .teacher-hero-copy h3 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .page-head,
  .section-head,
  .project-row-main,
  .callout,
  .academic-filters,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .callout {
    display: grid;
  }

  .teacher-dashboard-overview {
    grid-template-columns: 1fr;
  }

  .folder-row,
  .member-row {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-table-head {
    display: none;
  }

  .delivery-card-dashboard {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .delivery-action-cell {
    justify-content: stretch;
  }

  button,
  .button-link {
    width: 100%;
  }

  .password-field > .password-toggle {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex-basis: 38px;
  }

  .sidebar-toggle {
    width: 42px;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.62;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.62;
  }
}

@keyframes dropdownReveal {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
