:root {
  --ink-900: #102217;
  --ink-800: #1e3427;
  --ink-700: #355847;
  --ink-500: #638272;
  --ink-200: #d7e7dc;
  --sand-50: #f3faf4;
  --sand-100: #eaf6ec;
  --mist-50: #edf6f0;
  --mist-100: #dfede4;
  --brand: #2e7d32;
  --brand-deep: #1b5e20;
  --accent: #43a047;
  --accent-deep: #2e7d32;
  --on-brand: #f4fff5;
  --surface-0: #f6fbf7;
  --surface-1: #ffffff;
  --surface-2: #f1f8f2;
  --surface-3: #e6f2e8;
  --outline: rgba(27, 53, 39, 0.16);
  --state-hover: rgba(46, 125, 50, 0.08);
  --state-press: rgba(46, 125, 50, 0.14);
  --ok: #0a7d53;
  --danger: #b03844;
  --line: rgba(20, 33, 27, 0.12);
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --elev-1: 0 1px 2px rgba(9, 27, 15, 0.12), 0 2px 4px rgba(9, 27, 15, 0.08);
  --elev-2: 0 6px 16px rgba(9, 27, 15, 0.12), 0 2px 6px rgba(9, 27, 15, 0.08);
  --elev-3: 0 16px 32px rgba(9, 27, 15, 0.16), 0 4px 12px rgba(9, 27, 15, 0.1);
  --shadow-soft: var(--elev-2);
  --shadow-strong: var(--elev-3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink-900);
  line-height: 1.55;
  letter-spacing: 0.01em;
  background:
    radial-gradient(40rem 40rem at 8% 5%, rgba(67, 160, 71, 0.18), transparent 58%),
    radial-gradient(34rem 34rem at 90% 8%, rgba(46, 125, 50, 0.14), transparent 58%),
    linear-gradient(125deg, var(--surface-0), #f0f7f1 42%, #f8fcf8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(18, 20, 31, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 20, 31, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: -3;
  pointer-events: none;
}

body.lang-en {
  font-family: "Segoe UI", "Calibri", "Arial", sans-serif;
}

body.lang-fa,
body.lang-ar {
  font-family: "Segoe UI", "Tahoma", "Noto Naskh Arabic", sans-serif;
}

h1,
h2,
h3,
.brand {
  font-family: "Segoe UI Semibold", "Segoe UI", "Calibri", sans-serif;
  letter-spacing: 0.2px;
}

.orb {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.28;
  z-index: -2;
  pointer-events: none;
}

.orb-a {
  background: #bde7c0;
  top: -120px;
  left: -80px;
  animation: floatA 12s ease-in-out infinite;
}

.orb-b {
  background: #c7ecd1;
  right: -140px;
  bottom: -30px;
  animation: floatB 14s ease-in-out infinite;
}

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  50% {
    transform: translateY(26px) translateX(14px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  50% {
    transform: translateY(-28px) translateX(-16px);
  }
}

.top-nav {
  max-width: 1260px;
  margin: 20px auto 30px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand {
  text-decoration: none;
  color: var(--ink-900);
  font-weight: 800;
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--ink-500);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lang-switch a {
  text-decoration: none;
  color: var(--ink-700);
  font-weight: 700;
  border: 1px solid rgba(18, 20, 31, 0.18);
  border-radius: 10px;
  padding: 7px 14px;
  background: #fff;
  transition: transform 170ms ease, border-color 170ms ease, color 170ms ease;
}

.lang-switch a:hover {
  transform: translateY(-1px);
  color: var(--brand-deep);
  border-color: rgba(46, 125, 50, 0.5);
}

.page-shell {
  max-width: 1260px;
  margin: 0 auto 70px;
  padding: 0 24px;
}

.hero-card,
.center-card,
.dashboard-grid,
.creator-grid,
.take-shell,
.list-card {
  animation: riseIn 640ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.md3-page {
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--elev-2);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-card {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 24px;
  align-items: stretch;
}

.hero-intro {
  padding: clamp(22px, 2vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(233, 245, 235, 0.9)),
    repeating-linear-gradient(
      -45deg,
      rgba(46, 125, 50, 0.04),
      rgba(46, 125, 50, 0.04) 12px,
      rgba(102, 187, 106, 0.04) 12px,
      rgba(102, 187, 106, 0.04) 24px
    );
  box-shadow: var(--shadow-soft);
}

.hero-kicker {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(46, 125, 50, 0.35);
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.12);
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-intro h1 {
  margin: 0;
  line-height: 1.2;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
}

.hero-intro p {
  margin: 16px 0 0;
  color: var(--ink-700);
}

.verify-resend-btn {
  margin-top: 12px;
}

.hero-points {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hero-points li {
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(18, 20, 31, 0.1);
  font-weight: 600;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.glass-form,
.list-card {
  padding: clamp(20px, 2vw, 30px);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--elev-1);
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.glass-form:hover,
.list-card:hover {
  border-color: rgba(46, 125, 50, 0.26);
  box-shadow: var(--elev-2);
}

.glass-form h1,
.glass-form h2,
.glass-form h3,
.list-card h2 {
  margin: 0 0 14px;
  line-height: 1.2;
}

label {
  display: block;
  margin: 12px 0;
  color: var(--ink-700);
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(27, 53, 39, 0.22);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: #fcfffc;
  color: var(--ink-900);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(46, 125, 50, 0.84);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.18);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--elev-1);
  transition: transform 170ms ease, box-shadow 170ms ease, background-color 170ms ease, filter 170ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(160deg, #2f8a35, #1f6f2c);
  color: var(--on-brand);
  box-shadow: var(--elev-2);
  width: 100%;
}

.btn-accent {
  background: linear-gradient(160deg, #55b85b, #2f8a35);
  color: var(--on-brand);
  box-shadow: var(--elev-2);
  width: 100%;
}

.btn-chip {
  background: #fff;
  border-color: rgba(27, 53, 39, 0.2);
  color: var(--ink-700);
  box-shadow: none;
}

.btn-chip:hover {
  border-color: rgba(46, 125, 50, 0.5);
  background: #f2faf3;
  color: var(--brand-deep);
}

.flash-wrap {
  margin-bottom: 18px;
}

.flash {
  margin-bottom: 9px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
}

.flash-error {
  background: #ffe2e5;
  border-color: rgba(176, 56, 68, 0.3);
  color: var(--danger);
}

.flash-success {
  background: #dbf6ea;
  border-color: rgba(10, 125, 83, 0.3);
  color: var(--ok);
}

.flash-info {
  background: #e1f3e4;
  border-color: rgba(46, 125, 50, 0.3);
  color: var(--brand-deep);
}

.captcha-preview {
  margin-top: 22px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(18, 20, 31, 0.14);
  border-radius: var(--radius-md);
  background: var(--panel-solid);
}

.captcha-preview strong {
  font-size: 1.25rem;
  letter-spacing: 4px;
}

.center-card {
  display: flex;
  justify-content: center;
}

.narrow {
  width: min(560px, 100%);
}

.dashboard-grid,
.creator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.creator-shell {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: start;
}

.creator-topbar {
  grid-column: 1 / -1;
  width: 100%;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.creator-load-bar {
  grid-column: 1 / -1;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.creator-load-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.creator-load-label select {
  min-width: 260px;
  margin: 0;
}

.creator-left {
  position: sticky;
  top: 12px;
}

.creator-head {
  margin: 0;
  padding: 0;
  border: 0;
}

.creator-meta-bar {
  width: 100%;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(46, 125, 50, 0.18);
  background: linear-gradient(180deg, rgba(236, 247, 238, 0.95), rgba(255, 255, 255, 0.96));
}

.creator-meta-item {
  display: grid;
  gap: 4px;
}

.creator-meta-wide {
  min-width: 0;
}

.creator-meta-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
}

.creator-meta-text {
  color: var(--ink-700);
}

.language-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(27, 53, 39, 0.18);
  background: #fff;
  font-size: 0.9rem;
}

.language-toggle input {
  width: auto;
  margin: 0;
}

.language-fields {
  display: grid;
  gap: 12px;
}

.language-field textarea {
  margin-top: 8px;
}

.module-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin: 10px 0 16px;
}

.module-picker-label {
  display: block;
  width: 100%;
}

.module-picker-label select {
  width: 100%;
  margin-top: 8px;
}

.saved-question-row input {
  margin-top: 8px;
}

.saved-question-row select {
  margin-top: 8px;
}

.btn-xs {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.creator-finish-actions {
  margin-top: 14px;
}

.preview-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  background: #fff;
  border: 1px solid rgba(18, 20, 31, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

.preview-data-table th,
.preview-data-table td {
  padding: 8px 10px;
  border-bottom: 2px solid rgba(18, 20, 31, 0.18);
  border-right: 2px solid rgba(18, 20, 31, 0.18);
}

.preview-data-table th:last-child,
.preview-data-table td:last-child {
  border-right: 0;
}

.preview-graph-box {
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(18, 20, 31, 0.2);
  background: #f8fbf8;
}

.preview-graph-box pre {
  margin: 0;
  white-space: pre-wrap;
}

.creator-right {
  display: grid;
  gap: 18px;
}

.preview-pane {
  border: 1px solid rgba(46, 125, 50, 0.28);
  box-shadow: 0 14px 28px rgba(46, 125, 50, 0.16);
}

.preview-surface {
  padding: 14px;
  border: 1px dashed rgba(18, 20, 31, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #fff, #f4faf5);
}

.preview-question header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.preview-question p {
  margin: 0 0 10px;
}

.preview-question pre {
  margin: 10px 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(18, 20, 31, 0.15);
  background: #f8fafb;
  white-space: pre-wrap;
}

.preview-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.preview-lang-grid div {
  border: 1px solid rgba(18, 20, 31, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.preview-lang-grid span {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-deep);
}

.preview-answer-tag {
  display: inline-flex;
  margin: 6px 6px 0 0;
  border: 1px solid rgba(46, 125, 50, 0.35);
  border-radius: 10px;
  padding: 4px 10px;
  background: #ecf7ee;
  color: var(--brand-deep);
  font-size: 0.84rem;
  font-weight: 700;
}

.preview-picture-grid {
  margin: 10px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.preview-picture-grid img,
.inline-picture-preview {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(18, 20, 31, 0.16);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.picture-dropzone {
  margin: 10px 0;
  padding: 16px;
  border: 2px dashed rgba(46, 125, 50, 0.45);
  border-radius: 14px;
  background: #f8fbf8;
  color: var(--ink-700);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.picture-dropzone-thumb {
  display: block;
  width: 56px;
  height: 56px;
  margin-top: 10px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(18, 20, 31, 0.16);
  box-shadow: var(--elev-1);
}

.picture-dropzone.is-dragover {
  background: rgba(46, 125, 50, 0.1);
  border-color: rgba(46, 125, 50, 0.75);
}

.module-editor-item {
  border-style: solid;
  border-color: rgba(18, 20, 31, 0.16);
}

.picture-rows {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.picture-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto minmax(0, 0.6fr);
  gap: 8px;
  align-items: center;
}

.picture-row .btn {
  white-space: nowrap;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(140px, 160px) minmax(140px, 160px) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}

.score-row label {
  margin: 0;
}

.creator-actions {
  margin-top: 14px;
}

.exam-list {
  display: grid;
  gap: 10px;
}

.exam-item {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.95);
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.exam-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(18, 20, 31, 0.16);
}

.module-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.module-item {
  border: 1px dashed rgba(18, 20, 31, 0.28);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.question-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 20, 31, 0.14);
}

.question-image-wrap {
  display: inline-block;
  width: min(100%, 420px);
  min-width: 180px;
  resize: both;
  overflow: auto;
  border-radius: var(--radius-sm);
  margin: 10px 0;
}

.code-block,
.table-block,
.graph-block,
.run-output,
.code-editor {
  background: #121825;
  color: #f0f3f9;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  white-space: pre-wrap;
}

.code-editor {
  min-height: 150px;
  font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 12px;
}

.saved-preview {
  border: 1px dashed rgba(18, 20, 31, 0.24);
  border-radius: var(--radius-sm);
  padding: 11px;
  min-height: 46px;
  color: var(--ink-500);
  background: #fff;
}

.verify-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid rgba(10, 125, 83, 0.25);
  padding: 6px 12px;
  margin-bottom: 12px;
  background: #dbf6ea;
  color: #0a6b47;
  font-weight: 700;
}

.time-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid rgba(46, 125, 50, 0.25);
  padding: 8px 12px;
  margin-bottom: 12px;
  background: #edf8ef;
  color: #1b5e20;
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.proctor-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.proctor-fixed {
  display: block;
}

.full-exam {
  display: block;
}

.full-exam .take-main {
  width: 100%;
}

.proctor-panel {
  position: sticky;
  top: 12px;
  box-shadow: var(--shadow-strong);
}

.proctor-fixed .proctor-panel {
  position: fixed;
  top: 16px;
  left: 24px;
  width: 320px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.proctor-fixed .take-main {
  margin-left: 360px;
  width: calc(100% - 360px);
}

.exam-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.exam-nav-btn {
  min-width: 180px;
  font-size: 1rem;
  padding: 12px 18px;
}

.exam-nav-progress {
  font-weight: 700;
  color: var(--ink-700);
}

.take-main {
  min-width: 0;
}

.tiny-note {
  color: var(--ink-500);
  margin: 0 0 14px;
}

.wcat-box {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.wcat-box.is-good {
  background: #dbf6ea;
  color: #0a6b47;
}

.wcat-box.is-bad {
  background: #ffe2e5;
  color: var(--danger);
}

.foreground-app-box {
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #ffd0d6;
  background: #fff4f5;
  color: #9d1f35;
  font-size: 0.92rem;
}

.cambox {
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(18, 20, 31, 0.18);
  background: #121825;
}

.cambox video {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.cam-label {
  font-size: 0.88rem;
  color: #e0ecf7;
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.voice-log-wrap {
  margin-bottom: 12px;
}

.voice-log {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.voice-log li {
  font-size: 0.9rem;
  border: 1px dashed rgba(18, 20, 31, 0.18);
  border-radius: 10px;
  padding: 7px 8px;
  color: var(--ink-700);
  background: #fff;
}

.module-hint {
  margin: 7px 0;
  color: var(--ink-500);
}

.canvas-course-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.course-hero-meta {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 14px;
  align-items: start;
}

.course-hero-image {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

.course-meta-edit-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.taxonomy-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.taxonomy-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.28);
  background: rgba(46, 125, 50, 0.08);
  font-size: 0.8rem;
  color: var(--brand-deep);
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-grid-tight {
  margin-top: 14px;
}

.admin-form-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
}

.kpi-card span {
  font-size: 0.82rem;
  color: var(--ink-500);
}

.kpi-card strong {
  font-size: 1.4rem;
}

.upload-widget {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f3faf5);
  padding: 10px;
  box-shadow: var(--elev-1);
}

.upload-widget input[type="file"] {
  margin-top: 0;
}

.upload-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--ink-700);
}

.upload-progress {
  margin-top: 8px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #dce9df;
}

.upload-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #2e7d32);
  transition: width 260ms ease;
}

.upload-hint {
  margin-top: 8px;
}

.upload-hint.is-error {
  color: var(--danger);
  font-weight: 700;
}

.manage-tab-row {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.module-tools {
    margin-top: 20px;
}

@media (max-width: 980px) {
  .hero-card,
  .auth-grid,
  .dashboard-grid,
  .creator-grid,
  .creator-shell,
  .split,
  .proctor-shell {
    grid-template-columns: 1fr;
  }

  .creator-left {
    position: static;
  }

  .preview-lang-grid {
    grid-template-columns: 1fr;
  }

  .creator-meta-bar,
  .module-picker-row {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .creator-topbar {
    margin: 14px 0 0;
  }

  .creator-load-bar {
    margin: 0 0 6px;
  }

  .creator-meta-bar {
    gap: 8px;
  }



  .picture-row {
    grid-template-columns: 1fr;
  }

  .course-hero-meta,
  .admin-grid,
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    border-radius: 22px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .brand-wrap {
    flex: 1;
  }

  .lang-switch {
    justify-content: center;
  }

  .page-shell {
    padding: 0 14px;
  }

  .creator-finish-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .proctor-fixed .proctor-panel {
    position: static;
    width: auto;
    max-height: none;
    left: auto;
  }

  .proctor-fixed .take-main {
    margin-left: 0;
  }
}


/* Redesigned Dashboard */
.dashboard-redesign {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-hero {
  background: linear-gradient(135deg, var(--ink-800), var(--ink-900));
  color: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.dash-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.dash-hero h1 { margin-top: 0; font-size: 2.2rem; }
.dash-hero-sub { color: var(--ink-200); font-size: 1.1rem; margin-bottom: 24px; }
.btn-large { padding: 12px 24px; font-size: 1.1rem; }

.dash-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.dash-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-card {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--elev-1);
  border: 1px solid var(--outline);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.dash-card:hover {
  box-shadow: var(--elev-2);
  border-color: rgba(46, 125, 50, 0.26);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.dash-card-header h3 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--ink-800); }
.badge { background: var(--brand); color: white; padding: 4px 8px; border-radius: 99px; font-size: 0.85rem; font-weight: bold; }

.dash-create-form input { margin-bottom: 12px; width: 100%; }
.btn-block { width: 100%; display: block; text-align: center; }

.dash-exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dash-exam-card {
  background: var(--mist-50);
  border: 1px solid var(--mist-100);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-exam-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 20, 31, 0.08);
  border-color: rgba(46, 125, 50, 0.3);
}

.exam-card-info strong { font-size: 1.15rem; display: block; margin-bottom: 8px; color: var(--ink-800); }
.exam-id-badge { font-family: monospace; background: var(--mist-100); padding: 4px 8px; border-radius: 6px; font-size: 0.85rem; color: var(--ink-500); display: inline-block; margin-bottom: 12px; }
.exam-meta { font-size: 0.85rem; color: var(--ink-500); margin: 0; }


.exam-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Global app shell */
.app-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.global-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid rgba(46, 125, 50, 0.2);
  background: linear-gradient(180deg, #0f3519 0%, #195a26 55%, #1f6f2c 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
}

.global-sidebar .brand,
.global-sidebar .brand-sub {
  color: #eff8f1;
}

.global-nav {
  display: grid;
  gap: 8px;
}

.global-nav-link {
  text-decoration: none;
  color: #e8f8ec;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.global-nav-link:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.app-main {
  min-width: 0;
}

.dashboard-topbar {
  margin: 16px 24px 14px;
  border: 1px solid rgba(46, 125, 50, 0.22);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--elev-1);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creator-topbar.dashboard-topbar {
  display: grid;
  align-items: start;
  justify-content: stretch;
  margin: 16px 0 14px 0;
  z-index: 1;
}

.topbar-search {
  flex: 1;
}

.topbar-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.24);
  padding: 10px 14px;
  background: #f7fcf8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.84rem;
  border-radius: 999px;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(46, 125, 50, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, #effaf0, #e6f5e8);
  box-shadow: var(--elev-1);
}

.token-balance-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.token-chip .token-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--ink-500);
  font-weight: 700;
}

.token-chip strong {
  color: var(--brand-deep);
  font-size: 0.95rem;
}

.notification-box {
  position: relative;
}

.notif-btn {
  border: 1px solid rgba(46, 125, 50, 0.24);
  border-radius: 999px;
  background: #eef7f0;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.notif-btn:hover {
  background: #e5f4e7;
  border-color: rgba(46, 125, 50, 0.4);
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 1px 6px;
}

.notif-menu {
  position: absolute;
  top: 38px;
  right: 0;
  width: 340px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  padding: 8px;
  display: none;
  z-index: 30;
}

.notification-box.open .notif-menu {
  display: block;
}

.notif-item {
  border-bottom: 1px solid var(--line);
  padding: 7px;
}

.notif-item:last-child {
  border-bottom: 0;
}

.notif-item.cheating {
  background: #fff1f3;
}

.profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.profile-menu a {
  text-decoration: none;
  color: var(--brand-deep);
  font-weight: 700;
}

.lang-dropdown {
  position: relative;
}

.lang-dropdown summary {
  list-style: none;
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.24);
  background: #eef7f0;
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-deep);
}

.lang-dropdown-ghost .lang-dropdown-summary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e9f3fa;
}

.lang-code {
  font-size: 0.86rem;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  display: none;
  /* min-width: 140px; */
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(46, 125, 50, 0.18);
  background: #fff;
  box-shadow: var(--shadow-soft);
  z-index: 9999;
}

.lang-dropdown[open] .lang-dropdown-menu {
  display: grid;
  gap: 6px;
}

.lang-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--brand-deep);
  font-weight: 700;
}

.lang-dropdown-menu a img {
  width: 18px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

.lang-dropdown-menu a:hover {
  background: rgba(46, 125, 50, 0.08);
}

.logout-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.22);
  background: #eef7f0;
  color: var(--brand-deep);
  text-decoration: none;
  font-size: 1.05rem;
}

.logout-icon-link:hover {
  background: #e5f4e7;
}

.app-content.page-shell {
  margin: 0 auto 70px;
  max-width: var(--shell-max);
  padding: 0 var(--shell-gutter);
}

/* Dashboard */
.dash-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.dash-main-column,
.dash-right-column {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.dash-heading {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff;
  padding: 20px;
}

.dash-heading p {
  color: rgba(255, 255, 255, 0.85);
}

.dashboard-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.md3-surface {
  box-shadow: var(--elev-2);
  border: 1px solid rgba(46, 125, 50, 0.26);
}

.dashboard-action-hub .action-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.dashboard-action-hub .action-grid.action-stack {
  grid-template-columns: 1fr;
}

.dashboard-action-hub .action-cell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px;
}

.action-grid.action-stack {
  display: grid;
  gap: 16px;
}

.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.canvas-course-card,
.offer-card {
  position: relative;
}

.canvas-course-card .action-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.canvas-course-card .action-row .btn {
  flex: 1;
}

.offer-card form,
.offer-card .btn,
.offer-card h4,
.offer-card p,
.offer-card img {
  position: relative;
  z-index: 2;
}

#module-sort-list {
  display: grid;
  gap: 14px;
}

.module-card.dragging {
  opacity: 0.55;
  border-color: var(--accent);
}

.module-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.md-preview-pane {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

#md-preview {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 8px;
}

#md-preview ul {
  margin: 8px 0 8px 20px;
}

.badge.muted {
  opacity: 0.75;
}

@media (max-width: 980px) {
  .module-editor-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-action-hub .action-cell h3 {
  margin: 0 0 8px;
}

.dashboard-action-hub .action-cell p {
  margin: 0 0 10px;
  color: var(--ink-500);
}

.quick-action-stack {
  display: grid;
  gap: 12px;
}

.quick-action-courses {
  display: grid;
  gap: 10px;
}

.quick-course-list {
  display: grid;
  gap: 8px;
}

.quick-course-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: inherit;
}

.quick-course-item strong {
  font-size: 0.96rem;
}

.quick-course-item span {
  font-size: 0.82rem;
  color: var(--ink-500);
}

.quick-action-explore {
  justify-self: start;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
  width: 100%;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: center;
  background: linear-gradient(145deg, #ffffff, #f0f8f1 55%, #eaf5ff);
}

.dashboard-hero-copy h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

.dashboard-hero-copy .hero-copy {
  margin: 10px 0 0;
  color: var(--ink-700);
  max-width: 58ch;
}

.dashboard-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-hero-stats article {
  border: 1px solid rgba(46, 125, 50, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 12px;
  display: grid;
  gap: 2px;
}

.dashboard-hero-stats strong {
  font-size: 1.2rem;
  color: var(--brand-deep);
}

.dashboard-hero-stats span {
  color: var(--ink-500);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-panel {
  display: grid;
  gap: 14px;
}

.join-exam-inline,
.dashboard-teacher-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.join-exam-inline {
  max-width: 740px;
}

.join-exam-inline input {
  flex: 1 1 280px;
  min-width: 0;
}

.join-exam-inline button {
  flex: 0 0 auto;
}

.dashboard-teacher-tools .inline-form {
  flex: 1 1 320px;
  min-width: 0;
}

.dashboard-discover-form {
  max-width: 940px;
}

.dashboard-course-grid,
.dashboard-suggestions-grid {
  width: 100%;
}

.dashboard-course-grid .canvas-course-card,
.dashboard-suggestions-grid .offer-card {
  min-height: 100%;
}

.dashboard-course-grid .canvas-course-card {
  display: grid;
}

.dashboard-course-grid .canvas-course-card .action-row {
  margin-top: auto;
}

@media (max-width: 980px) {
  .dashboard-hero,
  .join-exam-inline,
  .dashboard-teacher-tools {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-hero,
  .dashboard-panel,
  .home-stage {
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  .dashboard-hero-stats {
    grid-template-columns: 1fr;
  }

  .join-exam-inline,
  .dashboard-teacher-tools {
    gap: 10px;
  }

  .join-exam-inline input,
  .dashboard-teacher-tools input,
  .dashboard-teacher-tools button {
    width: 100%;
  }
}

.enroll-offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.offer-card {
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: 12px;
  background: var(--surface-1);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.offer-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(46, 125, 50, 0.24);
  background: #eaf5ec;
}

.offer-card h4 {
  margin: 0;
  font-size: 0.96rem;
}

.offer-card p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.86rem;
}

.invited-exams-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.invited-exams-panel h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--ink-700);
}

.invited-exam-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.invited-exam-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-1);
  padding: 8px 10px;
}

.invited-exam-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: end;
}

.invited-start-label {
  color: var(--ink-500);
  font-size: 0.78rem;
}

.countdown-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  color: #145a1f;
  background: #e8f6ea;
  border: 1px solid rgba(46, 125, 50, 0.34);
}

.canvas-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.canvas-course-card {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 12px;
  background: var(--surface-1);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(9, 27, 15, 0.08);
  cursor: grab;
  transition: all 200ms ease;
}

.canvas-course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(9, 27, 15, 0.14);
}

.canvas-course-card:active {
  cursor: grabbing;
}

.canvas-course-card.is-dragging {
  opacity: 0.6;
  box-shadow: 0 12px 24px rgba(9, 27, 15, 0.2);
}

.canvas-course-card .canvas-course-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.color-strip {
  height: 4px;
  background: var(--brand);
}

.canvas-course-card h3 {
  margin: 0;
  padding: 12px 16px 4px;
  font-size: 1.1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.canvas-course-card > p.tiny-note {
  margin: 0;
  padding: 0 16px 2px;
  font-size: 0.8rem;
  color: var(--ink-500);
}

.canvas-course-card > p:not(.tiny-note) {
  margin: 0;
  padding: 0 16px 8px;
  font-size: 0.9rem;
  color: var(--ink-500);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.canvas-course-card .course-meta-row {
  padding: 0 16px 8px;
  margin: 0;
}

.canvas-course-card .taxonomy-chip-row,
.canvas-course-card .teacher-link-row {
  padding: 0 16px 8px;
}

.quick-icons-row {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  margin: 0;
  justify-content: flex-end;
}

.quick-icons-row a {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.todo-list {
  margin: 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 8px;
}

.todo-list li {
  color: var(--ink-700);
}

.todo-feed {
  padding: 0;
}

.todo-item {
  color: var(--ink-700);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.todo-item:last-child {
  border-bottom: 0;
}

/* Course workspace */
.course-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

.course-sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 14px;
}

.course-main {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.course-nav-panel {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.course-nav-link {
  text-decoration: none;
  color: var(--ink-800);
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 700;
}

.course-nav-link.active,
.course-nav-link:hover {
  border-color: rgba(46, 125, 50, 0.28);
  background: rgba(46, 125, 50, 0.1);
}

.settings-grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.settings-grid-form .full {
  grid-column: 1 / -1;
}

.nav-order-grid {
  display: grid;
  gap: 8px;
}

.nav-order-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 8px;
}

.module-stack {
  display: grid;
  gap: 8px;
}

.module-card {
  border: 1px solid rgba(28, 58, 45, 0.12);
  border-radius: 10px;
  padding: 9px 10px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(8, 28, 18, 0.06);
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.module-card .inline-form.compact {
  gap: 6px;
  margin: 6px 0;
}

.module-card .inline-form.compact input,
.module-card .inline-form.compact select {
  padding: 8px 10px;
}

.module-card .todo-item {
  padding: 6px 0;
  font-size: 0.92rem;
}

.gradebook-table th,
.gradebook-table td {
  min-width: 200px;
}

.grade-cell-form {
  display: grid;
  gap: 6px;
}

.grade-cell-form input {
  min-width: 0;
}

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .global-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dash-grid-layout {
    grid-template-columns: 1fr;
  }

  .course-layout {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .settings-grid-form {
    grid-template-columns: 1fr;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .notif-menu {
    width: min(90vw, 340px);
    right: auto;
    left: 0;
  }
}

.empty-state {
  text-align: center;
  padding: 40px;
  background: var(--mist-50);
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  color: var(--ink-500);
  grid-column: 1 / -1;
}

/* Exam Management Detail Header */
.manage-hero {
  background: var(--panel-solid);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}

.manage-hero h1 { margin-top: 0; margin-bottom: 8px; }
.manage-meta-row { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.manage-id { font-family: monospace; font-size: 1.1rem; color: var(--ink-500); background: var(--mist-50); padding: 6px 12px; border-radius: 8px;}

/* Fresh redesign override */
body {
  background:
    radial-gradient(40rem 40rem at -8% -4%, rgba(29, 165, 108, 0.18), transparent 55%),
    radial-gradient(34rem 34rem at 102% 5%, rgba(72, 99, 255, 0.12), transparent 58%),
    linear-gradient(165deg, #f3fbf7 0%, #ecf6ff 46%, #f8fbfc 100%);
}

.workspace-card,
.glass-form,
.list-card,
.course-sidebar,
.dashboard-topbar {
  border-radius: 18px;
  border: 1px solid rgba(30, 58, 46, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(12, 37, 27, 0.08);
}

.global-sidebar {
  background:
    linear-gradient(185deg, rgba(9, 31, 24, 0.98), rgba(17, 62, 45, 0.96)),
    radial-gradient(circle at 18% 10%, rgba(75, 195, 130, 0.36), transparent 45%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.global-nav-link {
  border-radius: 14px;
  padding: 11px 12px;
}

.global-nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dash-heading {
  background: linear-gradient(135deg, #0f6a44, #1aa06f 65%, #31b987);
  border: 0;
}

.btn-primary {
  background: linear-gradient(150deg, #177f59, #1ca56f);
  width: 100%;
}

.btn-accent {
  background: linear-gradient(150deg, #2f69f6, #4b7cff);
  width: 100%;
}

.course-nav-link.active,
.course-nav-link:hover {
  background: linear-gradient(120deg, rgba(29, 165, 108, 0.2), rgba(73, 118, 255, 0.14));
  border-color: rgba(28, 138, 97, 0.36);
}

.enrolled-course-header {
  border: 1px solid rgba(28, 138, 97, 0.28);
  background: linear-gradient(145deg, #ffffff, #f1fbf6);
}

.enrolled-course-short {
  margin: 8px 0 12px;
  font-size: 1.02rem;
  color: var(--ink-700);
}

.enrolled-course-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.enrolled-course-meta-grid > div {
  border: 1px solid rgba(28, 58, 45, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.enrolled-course-meta-grid h4 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-500);
}

.enrolled-course-meta-grid p {
  margin: 0;
  color: var(--ink-800);
}

@media (max-width: 980px) {
  .enrolled-course-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Custom Tabs */
.manage-tabs-container {
  background: var(--panel-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.manage-tab-headers {
  display: flex;
  border-bottom: 1px solid var(--mist-100);
  background: var(--mist-50);
  padding: 0 16px;
}

.manage-tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-500);
  padding: 16px 24px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.manage-tab-btn:hover {
  color: var(--ink-800);
  background: rgba(255, 255, 255, 0.5);
}

.manage-tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--panel-solid);
}

.manage-tab-content {
  padding: 16px 24px;
  margin: 0;
}

.btn-outline {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--mist-50);
  border-color: var(--ink-500);
}

@media (max-width: 900px) {
  .dash-content { flex-direction: column; }
  .dash-sidebar { width: 100%; }

  .dashboard-action-hub .action-grid {
    grid-template-columns: 1fr;
  }
}

/* Workspace redesign */
.workspace-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
}

.workspace-brand,
.workspace-card,
.workspace-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow-soft);
}

.workspace-brand,
.workspace-card,
.workspace-hero,
.workspace-main {
  padding: 16px;
}

.workspace-menu {
  display: grid;
  gap: 8px;
}

.workspace-link {
  display: block;
  width: 100%;
  border: 1px solid rgba(18, 20, 31, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-700);
  text-decoration: none;
  padding: 10px 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.workspace-link.active,
.workspace-link:hover {
  color: #fff;
  background: linear-gradient(160deg, var(--brand), var(--brand-deep));
  border-color: transparent;
}

.workspace-main {
  display: grid;
  gap: 16px;
}

.workspace-hero h1 {
  margin: 0;
}

.workspace-hero p {
  margin: 8px 0 0;
  color: var(--ink-500);
}

.workspace-kpis {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  border: 1px solid rgba(46, 125, 50, 0.22);
  border-radius: 12px;
  background: #f2f9f3;
  padding: 12px;
}

.kpi-card.warning {
  border-color: rgba(56, 142, 60, 0.34);
  background: #ecf7ee;
}

.kpi-card span {
  color: var(--ink-500);
  font-size: 0.82rem;
  display: block;
}

.kpi-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.workspace-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.workspace-card-head h2 {
  margin: 0;
}

/* ===== Exohex Redesign v3 ===== */
:root {
  --v3-bg-0: #f4faf7;
  --v3-bg-1: #ecf6ff;
  --v3-ink-0: #10291f;
  --v3-ink-1: #254138;
  --v3-ink-2: #4d6a61;
  --v3-brand-0: #0f8f63;
  --v3-brand-1: #1ab57f;
  --v3-brand-2: #3b6df6;
  --v3-surface-0: rgba(255, 255, 255, 0.9);
  --v3-surface-1: rgba(255, 255, 255, 0.98);
  --v3-border: rgba(14, 35, 28, 0.12);
  --v3-shadow-sm: 0 8px 18px rgba(12, 34, 25, 0.08);
  --v3-shadow-lg: 0 24px 54px rgba(12, 34, 25, 0.14);
}

body {
  color: var(--v3-ink-0);
  background:
    radial-gradient(36rem 36rem at -8% -4%, rgba(26, 181, 127, 0.2), transparent 55%),
    radial-gradient(34rem 34rem at 105% 8%, rgba(59, 109, 246, 0.16), transparent 58%),
    linear-gradient(160deg, var(--v3-bg-0) 0%, var(--v3-bg-1) 50%, #f8fbff 100%);
}

body::before {
  background-image:
    linear-gradient(rgba(15, 38, 29, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 38, 29, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

.orb {
  opacity: 0.2;
  filter: blur(62px);
}

.app-layout {
  grid-template-columns: 270px minmax(0, 1fr);
}

.global-sidebar {
  background:
    linear-gradient(180deg, rgba(7, 29, 22, 0.98), rgba(13, 47, 35, 0.96)),
    radial-gradient(circle at 18% 12%, rgba(26, 181, 127, 0.34), transparent 52%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.global-sidebar .brand {
  font-size: 1.65rem;
}

.global-nav-link {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #eafcf2;
  letter-spacing: 0.2px;
}

.global-nav-link:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.24);
}

.dashboard-topbar {
  border-radius: 18px;
  border: 1px solid var(--v3-border);
  background: var(--v3-surface-0);
  box-shadow: var(--v3-shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar-search input {
  background: #fbfffd;
  border: 1px solid rgba(15, 143, 99, 0.26);
}

.token-chip {
  background: linear-gradient(130deg, #effbf4, #e6f6ed);
  border: 1px solid rgba(15, 143, 99, 0.26);
}

.workspace-card,
.glass-form,
.list-card,
.course-sidebar {
  border: 1px solid var(--v3-border);
  border-radius: 18px;
  background: var(--v3-surface-1);
  box-shadow: var(--v3-shadow-sm);
}

.workspace-card:hover,
.glass-form:hover,
.list-card:hover {
  box-shadow: var(--v3-shadow-lg);
}

.dash-heading {
  border-radius: 20px;
  border: 0;
  background: linear-gradient(140deg, #0f8f63 0%, #1ab57f 58%, #3b6df6 100%);
  box-shadow: var(--v3-shadow-lg);
}

.btn {
  border-radius: 12px;
  min-height: 42px;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(140deg, #0f8f63, #19a977);
  width: 100%;
}

.btn-accent {
  background: linear-gradient(140deg, #3b6df6, #5b8cff);
  width: 100%;
}

.btn-chip {
  border: 1px solid rgba(10, 43, 33, 0.15);
  background: #ffffff;
  color: var(--v3-ink-1);
}

.btn-chip:hover {
  border-color: rgba(15, 143, 99, 0.34);
  background: #f4fbf8;
}

input,
select,
textarea {
  border-radius: 12px;
  border: 1px solid rgba(12, 53, 40, 0.18);
  background: #fbfffd;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 143, 99, 0.78);
  box-shadow: 0 0 0 4px rgba(26, 181, 127, 0.2);
}

.modern-table-wrap {
  border: 1px solid var(--v3-border);
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}

.modern-table th {
  background: #f3faf7;
  color: var(--v3-ink-1);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modern-table td {
  color: var(--v3-ink-1);
}

.canvas-card-grid {
  gap: 16px;
}

.canvas-course-card,
.offer-card {
  border-radius: 16px;
  border: 1px solid var(--v3-border);
  box-shadow: var(--v3-shadow-sm);
  background: #fff;
}

.canvas-course-card:hover,
.offer-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--v3-shadow-lg);
}

.course-layout {
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 14px;
}

.course-sidebar {
  padding: 14px;
}

.course-nav-link {
  border-radius: 11px;
}

.course-nav-link.active,
.course-nav-link:hover {
  background: linear-gradient(120deg, rgba(15, 143, 99, 0.18), rgba(59, 109, 246, 0.14));
  border-color: rgba(15, 143, 99, 0.32);
}

#module-sort-list {
  gap: 8px;
}

.module-card {
  border: 1px solid rgba(8, 48, 36, 0.1);
  border-radius: 11px;
  background: #fff;
  padding: 9px 10px;
  box-shadow: 0 4px 14px rgba(8, 31, 23, 0.06);
}

.module-head {
  gap: 8px;
  margin-bottom: 7px;
}

.module-card .inline-form.compact {
  margin: 6px 0;
  gap: 6px;
}

.module-card .inline-form.compact input,
.module-card .inline-form.compact select {
  padding: 8px 10px;
}

.module-card .todo-item {
  padding: 6px 0;
  font-size: 0.92rem;
}

.module-card.dragging {
  opacity: 0.62;
  transform: scale(0.99);
}

.enrolled-course-header {
  border: 1px solid rgba(15, 143, 99, 0.28);
  background: linear-gradient(150deg, #ffffff, #f2fbf7);
}

.enrolled-course-short {
  margin: 8px 0 12px;
  color: var(--v3-ink-1);
}

.enrolled-course-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.enrolled-course-meta-grid > div {
  border: 1px solid rgba(12, 49, 37, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.enrolled-course-meta-grid h4 {
  margin: 0 0 5px;
  color: var(--v3-ink-2);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.enrolled-course-meta-grid p {
  margin: 0;
  color: var(--v3-ink-1);
}

.upload-widget {
  border-radius: 12px;
  border: 1px solid rgba(11, 50, 38, 0.14);
  background: linear-gradient(180deg, #ffffff, #f4fbf8);
}

.upload-progress {
  height: 11px;
  background: #deece4;
}

.upload-progress-fill {
  background: linear-gradient(90deg, #0f8f63, #3b6df6);
}

.top-nav {
  border-radius: 18px;
  border: 1px solid var(--v3-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--v3-shadow-sm);
}

.hero-intro,
.auth-grid .glass-form {
  border-radius: 18px;
}

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .course-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .enrolled-course-meta-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== Exohex UI Reset v4 ===== */
:root {
  --u4-bg-a: #fffaf2;
  --u4-bg-b: #edf6ff;
  --u4-bg-c: #f6fffb;
  --u4-ink-0: #1f2623;
  --u4-ink-1: #36413d;
  --u4-ink-2: #63706a;
  --u4-primary: #0f9d68;
  --u4-primary-deep: #08734b;
  --u4-accent: #0b62d8;
  --u4-line: rgba(22, 33, 28, 0.14);
  --u4-surface: rgba(255, 255, 255, 0.9);
  --u4-surface-solid: #ffffff;
  --u4-shadow-sm: 0 10px 28px rgba(17, 30, 24, 0.08);
  --u4-shadow-lg: 0 24px 56px rgba(17, 30, 24, 0.14);
}

body {
  color: var(--u4-ink-0);
  background:
    radial-gradient(36rem 36rem at -8% 12%, rgba(15, 157, 104, 0.16), transparent 56%),
    radial-gradient(32rem 32rem at 102% 4%, rgba(11, 98, 216, 0.13), transparent 58%),
    linear-gradient(150deg, var(--u4-bg-a), var(--u4-bg-b) 47%, var(--u4-bg-c));
}

body.lang-en,
body.lang-fa,
body.lang-ar {
  font-family: "Trebuchet MS", "Tahoma", "Segoe UI", sans-serif;
}

h1,
h2,
h3,
.brand {
  font-family: "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  letter-spacing: 0.2px;
}

.app-layout {
  grid-template-columns: 284px minmax(0, 1fr);
}

.global-sidebar {
  background:
    linear-gradient(185deg, rgba(11, 26, 21, 0.98), rgba(18, 45, 36, 0.96)),
    radial-gradient(circle at 18% 12%, rgba(15, 157, 104, 0.34), transparent 50%);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.global-nav-link {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 13px;
  color: #edfff6;
}

.global-nav-link:hover {
  transform: translateX(5px);
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.18);
}

.dashboard-topbar {
  border-radius: 22px;
  border: 1px solid var(--u4-line);
  background: var(--u4-surface);
  box-shadow: var(--u4-shadow-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.topbar-search input {
  border-radius: 999px;
  border: 1px solid rgba(15, 157, 104, 0.26);
  background: #ffffff;
}

.token-chip {
  background: linear-gradient(130deg, #effdf7, #e9f7ff);
  border: 1px solid rgba(15, 157, 104, 0.26);
}

.workspace-card,
.glass-form,
.list-card,
.course-sidebar,
.top-nav {
  border: 1px solid var(--u4-line);
  border-radius: 22px;
  background: var(--u4-surface-solid);
  box-shadow: var(--u4-shadow-sm);
}

.workspace-card:hover,
.glass-form:hover,
.list-card:hover {
  box-shadow: var(--u4-shadow-lg);
}

.dash-heading {
  border: 0;
  border-radius: 24px;
  background: linear-gradient(140deg, #0f9d68, #1ab57f 62%, #0b62d8);
  box-shadow: var(--u4-shadow-lg);
}

.btn {
  border-radius: 14px;
  min-height: 44px;
  padding: 10px 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--u4-primary), #17b37a);
  width: 100%;
}

.btn-accent {
  background: linear-gradient(135deg, var(--u4-accent), #2c7ff0);
  width: 100%;
}

.btn-chip {
  border: 1px solid var(--u4-line);
  background: #fff;
  color: var(--u4-ink-1);
}

.btn-chip:hover {
  border-color: rgba(15, 157, 104, 0.34);
  background: #f5fbf8;
}

input,
select,
textarea {
  border: 1px solid rgba(22, 36, 31, 0.18);
  border-radius: 12px;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 157, 104, 0.74);
  box-shadow: 0 0 0 4px rgba(15, 157, 104, 0.18);
}

.course-layout {
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 16px;
}

.course-nav-link {
  border-radius: 12px;
}

.course-nav-link.active,
.course-nav-link:hover {
  border-color: rgba(15, 157, 104, 0.3);
  background: linear-gradient(120deg, rgba(15, 157, 104, 0.18), rgba(11, 98, 216, 0.1));
}

#module-sort-list {
  gap: 8px;
}

.module-card {
  border: 1px solid rgba(14, 34, 28, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 9px 10px;
  box-shadow: 0 4px 14px rgba(12, 26, 22, 0.06);
}

.module-card .inline-form.compact {
  gap: 6px;
  margin: 6px 0;
}

.module-card .inline-form.compact input,
.module-card .inline-form.compact select {
  padding: 8px 10px;
}

.module-card .todo-item {
  padding: 6px 0;
  font-size: 0.92rem;
}

.module-card.dragging {
  opacity: 0.62;
}

.canvas-course-card,
.offer-card {
  border: 1px solid var(--u4-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--u4-shadow-sm);
}

.canvas-course-card:hover,
.offer-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--u4-shadow-lg);
}

.enrolled-course-header {
  border: 1px solid rgba(15, 157, 104, 0.26);
  background: linear-gradient(150deg, #ffffff, #f2fcf7);
}

.enrolled-course-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.enrolled-course-meta-grid > div {
  border: 1px solid var(--u4-line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.enrolled-course-meta-grid h4 {
  margin: 0 0 6px;
  color: var(--u4-ink-2);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.enrolled-course-meta-grid p {
  margin: 0;
  color: var(--u4-ink-1);
}

.modern-table-wrap {
  border: 1px solid var(--u4-line);
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}

.modern-table th {
  background: #f4fbf8;
  color: var(--u4-ink-1);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.upload-widget {
  border-radius: 13px;
  border: 1px solid var(--u4-line);
  background: linear-gradient(180deg, #ffffff, #f5fcf8);
}

.upload-progress-fill {
  background: linear-gradient(90deg, var(--u4-primary), var(--u4-accent));
}

@media (max-width: 1180px) {
  .app-layout,
  .course-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .enrolled-course-meta-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Dashboard: teacher Add Exam form styles (moved from inline styles) */
.dashboard-add-exam-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 8px;
}

.dashboard-add-exam-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(27, 53, 39, 0.18);
  background: #fcfffc;
}

.dashboard-add-exam-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
}

@media (min-width: 720px) {
  /* On wider screens show input and button side-by-side */
  .dashboard-add-exam-form {
    flex-direction: row;
    align-items: center;
  }
  .dashboard-add-exam-input {
    flex: 1 1 auto;
    margin: 0;
  }
  .dashboard-add-exam-btn {
    flex: 0 0 auto;
    width: auto;
  }
}

@media (max-width: 520px) {
  /* Ensure spacing and full-width alignment on small screens */
  .workspace-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .dashboard-add-exam-form { max-width: 100%; margin-left: 0; }
}

.inline-form.compact {
  align-items: stretch;
}

.inline-form.compact input {
  min-width: 140px;
}

.modern-table-wrap {
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
}

.modern-table th,
.modern-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: start;
  vertical-align: top;
}

.modern-table thead th {
  font-size: 0.82rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-500);
}

.empty-cell {
  text-align: center;
  color: var(--ink-500);
}

.answersheet-stack {
  display: grid;
  gap: 12px;
}

.answersheet-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.answersheet-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
}

.answersheet-head p {
  margin: 4px 0 0;
  color: var(--ink-500);
}

.answersheet-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answersheet-scores span {
  border: 1px solid rgba(18, 20, 31, 0.15);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 0.82rem;
}

.answersheet-body {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.event-log-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.event-log-item {
  font-size: 0.86rem;
  color: var(--ink-700);
}

.event-log-item.event-cheating {
  color: var(--danger);
}

.shots-grid-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.shots-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.screenshot-bulk-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.screenshot-item {
  position: relative;
}

.screenshot-wrapper {
  position: relative;
  display: inline-block;
}

.screenshot-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.screenshot-wrapper:hover .screenshot-actions {
  opacity: 1;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon:hover {
  background: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.score-plot-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.score-plot-card h3 {
  margin: 0 0 8px;
}

#score-plot {
  width: 100%;
  max-height: 240px;
}

.cheat-category {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cheat-category h5 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
}

.media-player {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

.media-player audio,
.media-player video {
  width: 100%;
  max-width: 400px;
  border-radius: 4px;
}

.btn-delete {
  color: #d32f2f;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-box {
  width: min(920px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-strong);
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.verify-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

@media (max-width: 980px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
  }

  .workspace-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answersheet-head,
  .answersheet-body {
    grid-template-columns: 1fr;
  }
}

/* Layout stability and alignment fixes */
:root {
  --shell-max: 1260px;
  --shell-gutter: 20px;
}

.top-nav,
.page-shell {
  max-width: var(--shell-max);
}

.page-shell {
  padding-inline: var(--shell-gutter);
}

.workspace-shell {
  align-items: start;
}

.workspace-main {
  min-width: 0;
}

.manage-shell .workspace-main,
.dashboard-shell .workspace-main {
  min-width: 0;
}

.manage-shell .workspace-sidebar {
  min-width: 250px;
}

.manage-shell .manage-tab-btn {
  width: 100%;
  text-align: start;
  white-space: normal;
  line-height: 1.35;
}

.modern-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.modern-table {
  min-width: 760px;
}

.answersheet-head {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.answersheet-body {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.event-log-list {
  max-height: 260px;
  overflow: auto;
  padding-right: 6px;
}

/* Course pages */
.course-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.course-card,
.course-material-card {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 12px;
  background: var(--surface-1);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(9, 27, 15, 0.08);
  transition: all 200ms ease;
}

.course-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(9, 27, 15, 0.14);
}

.course-card h3,
.course-material-card h3,
.course-material-card header strong {
  margin: 0;
  padding: 12px 16px 4px;
  font-size: 1.05rem;
}

.course-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.discover-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Course Card Sections */
.course-card-head,
.course-card-meta,
.course-card-footer {
  padding: 0 16px;
}

.course-card-head {
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.course-card-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.course-card-head h2,
.course-card-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-head h2 a,
.course-card-head h3 a {
  text-decoration: none;
  color: var(--ink-900);
}

.course-card-head h2 a:hover,
.course-card-head h3 a:hover {
  color: var(--brand);
}

.course-card-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-600);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-price-badge {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(46, 125, 50, 0.1);
  color: var(--brand-deep);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.course-card-meta {
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--ink-600);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.course-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.course-card-footer {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.course-card-footer--single {
  justify-content: flex-start;
}

.course-card-footer .btn {
  flex: 0 0 auto;
}

.course-card-footer span {
  font-size: 0.85rem;
  color: var(--ink-600);
  white-space: normal;
}

.course-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

[dir="rtl"] .course-card-stats {
  margin-left: 0;
  margin-right: auto;
}

.taxonomy-chip-row,
.teacher-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  margin: 0;
}

.taxonomy-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(46, 125, 50, 0.08);
  border: 1px solid rgba(46, 125, 50, 0.16);
  font-size: 0.82rem;
  color: var(--ink-700);
  white-space: nowrap;
}

.taxonomy-chip a {
  text-decoration: none;
  color: var(--brand-deep);
}

.taxonomy-chip a:hover {
  text-decoration: underline;
}

.teacher-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(67, 160, 71, 0.08);
  border: 1px solid rgba(67, 160, 71, 0.16);
  font-size: 0.82rem;
  color: var(--accent-deep);
  text-decoration: none;
  transition: all 150ms ease;
}

.teacher-link:hover {
  background: rgba(67, 160, 71, 0.14);
  color: var(--brand-deep);
}

.course-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 0 16px;
}

.course-meta-row span {
  border: 1px solid rgba(18, 20, 31, 0.12);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: var(--ink-600, #525c78);
  background: rgba(46, 125, 50, 0.04);
}

.course-material-stack {
  display: grid;
  gap: 12px;
}

.course-material-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.course-material-form {
  display: grid;
  gap: 8px;
}

@media (max-width: 980px) {
  .top-nav,
  .page-shell {
    padding-inline: 14px;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
  }

  .modern-table {
    min-width: 640px;
  }

  .canvas-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }

  .course-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }

  .discover-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 700px) {
  .canvas-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .course-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .discover-card-grid {
    grid-template-columns: 1fr;
  }

  .canvas-course-card h3 {
    font-size: 1rem;
  }

  .course-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .course-card-footer .btn {
    width: 100%;
  }

  .course-card-meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* ===== Exohex Structural UI v5 ===== */
:root {
  --u5-bg-0: #f8f6ef;
  --u5-bg-1: #eef4fb;
  --u5-bg-2: #f4faf5;
  --u5-ink-0: #1f262b;
  --u5-ink-1: #39434a;
  --u5-muted: #60717d;
  --u5-primary: #1763b6;
  --u5-primary-2: #0f8f68;
  --u5-surface: rgba(255, 255, 255, 0.94);
  --u5-line: rgba(26, 34, 40, 0.14);
  --u5-shadow: 0 14px 38px rgba(16, 26, 31, 0.1);
}

body {
  color: var(--u5-ink-0);
  background:
    radial-gradient(32rem 32rem at -10% 10%, rgba(23, 99, 182, 0.12), transparent 56%),
    radial-gradient(28rem 28rem at 104% 0%, rgba(15, 143, 104, 0.1), transparent 55%),
    linear-gradient(150deg, var(--u5-bg-0), var(--u5-bg-1) 48%, var(--u5-bg-2));
}

body.lang-en,
body.lang-fa,
body.lang-ar {
  font-family: "Verdana", "Trebuchet MS", "Tahoma", sans-serif;
}

h1,
h2,
h3,
.brand {
  font-family: "Georgia", "Palatino Linotype", serif;
}

.app-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.global-sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: auto;
  padding: 10px 20px;
  border-right: 0;
  border-bottom: 1px solid var(--u5-line);
  background: rgba(17, 26, 34, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 14px;
  grid-template-rows: none;
}

.global-sidebar .brand-wrap {
  display: flex;
  flex-direction: column;
  margin-inline-end: 8px;
}

.global-sidebar .brand {
  font-size: 1.25rem;
  color: #f4fbff;
}

.global-sidebar .brand-sub {
  color: #d4e6f1;
  text-transform: none;
  letter-spacing: 0;
}

.global-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.global-nav-link {
  border-radius: 999px;
  padding: 8px 14px;
  color: #e9f3fa;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.global-nav-link:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
}

.dashboard-topbar {
  max-width: var(--shell-max);
  margin: 14px auto 8px;
  border: 1px solid var(--u5-line);
  border-radius: 18px;
  background: var(--u5-surface);
  box-shadow: var(--u5-shadow);
}

.app-content.page-shell {
  padding: 0 16px;
}

.workspace-card,
.glass-form,
.list-card,
.top-nav,
.course-sidebar {
  border: 1px solid var(--u5-line);
  border-radius: 18px;
  background: var(--u5-surface);
  box-shadow: var(--u5-shadow);
}

.dash-grid-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
  gap: 16px;
}

.dash-right-column {
  display: none;
  grid-area: side;
  position: sticky;
  top: 130px;
}

.dash-main-column {
  grid-area: main;
}

.dash-heading {
  border: 0;
  border-radius: 20px;
  background: linear-gradient(130deg, #1f4f86, #1763b6 55%, #0f8f68);
}

.dashboard-action-hub .action-grid.action-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-action-hub .action-cell {
  background: #fff;
  border: 1px solid rgba(24, 41, 53, 0.12);
  border-radius: 14px;
}

.dashboard-action-hub {
  margin-inline: calc(var(--shell-gutter) * -1);
  width: calc(100% + (var(--shell-gutter) * 2));
  box-sizing: border-box;
}

.canvas-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.canvas-course-card,
.offer-card {
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(20, 33, 40, 0.09);
}

.course-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

.course-sidebar {
  position: static;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr auto;
  align-items: center;
  gap: 14px;
}

.course-nav-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.course-nav-link {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(26, 34, 40, 0.18);
  background: #fff;
}

.course-nav-link.active,
.course-nav-link:hover {
  border-color: rgba(23, 99, 182, 0.38);
  background: rgba(23, 99, 182, 0.12);
}

.course-main {
  gap: 14px;
}

.course-hero-meta {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
}

.enrolled-course-header {
  border-radius: 18px;
  border: 1px solid rgba(15, 143, 104, 0.26);
  background: linear-gradient(145deg, #ffffff, #f3faf7);
}

.enrolled-course-meta-grid > div {
  border-radius: 10px;
}

.btn {
  border-radius: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--u5-primary), #2a79cf);
  width: 100%;
}

.btn-accent {
  background: linear-gradient(135deg, var(--u5-primary-2), #16a67a);
  width: 100%;
}

.btn-chip {
  border: 1px solid rgba(26, 34, 40, 0.18);
  color: var(--u5-ink-1);
}

.tiny-note,
.course-meta-row span,
.enrolled-course-meta-grid h4,
.modern-table thead th,
.invited-start-label {
  color: var(--u5-muted);
}

@media (max-width: 1200px) {
  .dash-grid-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .dash-right-column {
    position: static;
  }

  .course-sidebar {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 900px) {
  :root {
    --shell-gutter: 12px;
  }

  .global-sidebar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .global-nav {
    width: 100%;
  }

  .global-nav-link {
    text-align: center;
  }

  .dashboard-topbar,
  .app-content.page-shell {
    margin-left: 12px;
    margin-right: 12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .dashboard-action-hub .action-grid.action-stack {
    grid-template-columns: 1fr;
  }

  .course-hero-meta,
  .enrolled-course-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile and role UX refinements */
.mobile-nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 7px 14px;
  font-weight: 700;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid var(--u5-line);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  color: var(--u5-ink-1);
  text-decoration: none;
  cursor: pointer;
}

.learner-note-cell {
  border-style: dashed;
}

@media (max-width: 900px) {
  .mobile-nav-toggle {
    display: inline-flex;
    align-self: flex-end;
    margin-bottom: 4px;
  }

  .global-sidebar .brand,
  .global-sidebar .brand-sub {
    text-align: center;
    width: 100%;
  }

  .global-nav {
    display: none;
    flex-direction: column;
    gap: 6px;
  }

  .global-sidebar.is-open .global-nav {
    display: flex;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .role-chip {
    order: -1;
  }

  .dashboard-topbar {
    margin-top: 10px;
  }

  .modern-table-wrap {
    overflow-x: auto;
  }

  .modern-table {
    min-width: 720px;
  }

  .canvas-card-grid,
  .course-card-grid,
  .enroll-offer-grid {
    grid-template-columns: 1fr;
  }
}

/* Discover courses */
.discover-page {
  display: grid;
  gap: 16px;
}

.discover-toolbar-card {
  display: grid;
  gap: 12px;
}

.discover-toolbar-form {
  display: grid;
  gap: 12px;
}

.discover-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.discover-sort-control {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  flex: 1 1 320px;
}

.discover-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.discover-sort-card {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
}

.discover-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discover-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 41, 53, 0.14);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 18px rgba(12, 37, 27, 0.06);
}

.discover-filter-chip strong {
  font-size: 0.84rem;
}

.discover-filter-chip span {
  font-size: 0.9rem;
}

.discover-chip-remove {
  border: 0;
  background: transparent;
  color: var(--u5-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

#discover-hidden-filters {
  display: none;
}

.discover-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.discover-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.discover-dialog::backdrop {
  background: rgba(15, 22, 28, 0.56);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.discover-dialog-card {
  width: min(92vw, 520px);
  border: 1px solid var(--u5-line);
  border-radius: 20px;
  background: var(--u5-surface);
  box-shadow: var(--u5-shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
  min-width: 220px;
  width: 220px;
}
.discover-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.discover-sort-control span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--u5-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.discover-sort-control select {
  min-width: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.discover-dialog-close {
  border: 0;
  background: transparent;
  color: var(--u5-muted);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0;
}

.discover-filter-input {
  display: none;
  gap: 6px;
}

.discover-dialog-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .discover-toolbar-row {
    align-items: stretch;
  }
  .discover-sort-card {
    width: 100%;
    display: block;
  }
  .discover-sort-control,
  .discover-sort-control select {
    width: 100%;
    min-width: 0;
  }

  .discover-toolbar-actions {
    width: 100%;
  }

  .discover-toolbar-actions .btn {
    flex: 1 1 0;
  }

  .discover-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Homepage v2 */
.home-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
}

.home-auth-card {
  border: 1px solid var(--u5-line);
  border-radius: 20px;
  background: var(--u5-surface);
  box-shadow: var(--u5-shadow);
}

.home-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-auth-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.home-auth-card-login {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 255, 0.94));
}

.home-auth-card-register {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(242, 252, 246, 0.95));
}

.home-auth-head h2 {
  margin: 0;
  line-height: 1.15;
}

.home-auth-head p {
  margin: 6px 0 0;
  color: var(--u5-muted);
  font-size: 0.92rem;
}

.home-captcha-input-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.home-captcha-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(26, 34, 40, 0.34);
  background: #fff;
  letter-spacing: 0.08em;
}

@media (max-width: 1180px) {
  .home-stage {
    max-width: 760px;
  }

  .home-auth-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .home-auth-grid,
  .home-kpi-grid,
  .home-captcha-input-row {
    grid-template-columns: 1fr;
  }

  .home-captcha-value {
    width: 100%;
  }
}

