:root {
      color-scheme: light;
      --background: #F6F8FC;
      --surface: #FFFFFF;
      --blue: #2563EB;
      --blue-dark: #1D4ED8;
      --blue-soft: #EFF6FF;
      --navy: #172B4D;
      --text: #475569;
      --muted: #64748B;
      --line: #E2E8F0;
      --green: #15803D;
      --green-soft: #F0FDF4;
      --amber: #92400E;
      --amber-soft: #FFFBEB;
      --radius: 14px;
      --shadow: 0 2px 8px rgba(23, 43, 77, .025);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      background: var(--background);
      color: var(--text);
      font-family: "Segoe UI", Arial, sans-serif;
      font-size: 14px;
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
    }

    button, input, textarea, select { font: inherit; }
    button { cursor: pointer; border: 0; }
    button, a { -webkit-tap-highlight-color: transparent; }
    button:disabled { cursor: not-allowed; opacity: .55; }
    [hidden] { display: none !important; }
    a { color: var(--blue); }
    h1, h2, h3, p { margin-top: 0; }
    h1, h2, h3 { color: var(--navy); }
    h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.7px; }
    h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.25px; }
    h3 { font-size: 15px; line-height: 1.5; }
    small, .muted { color: var(--muted); }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible,
    summary:focus-visible {
      outline: 3px solid #93B8FF;
      outline-offset: 3px;
    }

    .skip {
      position: fixed;
      top: -80px;
      left: 16px;
      z-index: 200;
      padding: 12px 18px;
      background: white;
      border-radius: 12px;
    }

    .skip:focus { top: 12px; }

    .ui-icon {
      width: 19px;
      height: 19px;
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.7;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .topbar {
      min-height: 78px;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 16px;
      padding: 16px 28px;
      background: white;
      border-bottom: 1px solid var(--line);
    }

    .icon-btn {
      width: 36px;
      height: 36px;
      flex-shrink: 0;
      display: inline-grid;
      place-items: center;
      background: transparent;
      color: var(--text);
      border-radius: 10px;
      font-size: 22px;
    }

    .icon-btn:hover { background: var(--blue-soft); color: var(--blue); }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--navy);
    }

    .brand b { font-size: 21px; letter-spacing: -.7px; }
    .brand small {
      display: block;
      font-size: 9px;
      line-height: 1;
      letter-spacing: 3px;
      margin-top: 5px;
    }

    .logo {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      flex-shrink: 0;
      background: var(--blue);
      color: white;
      border-radius: 12px;
      font-size: 16px;
      font-weight: 800;
    }

    .course-state { padding-left: 20px; border-left: 1px solid var(--line); }
    .active-status { color: var(--green); font-size: 11px; font-weight: 700; }
    .course-state > small { display: block; margin-top: 2px; font-size: 11px; }
    .top-spacer { flex: 1; }

    .top-chip {
      padding: 9px 12px;
      border-radius: 12px;
      background: white;
      color: var(--text);
      border: 1px solid var(--line);
      font-size: 12px;
      font-weight: 600;
    }

    .top-chip:hover { background: var(--blue-soft); color: var(--blue); }

    .profile-select {
      max-width: 190px;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #F8FAFC;
      color: var(--navy);
      font-size: 12px;
    }

    .header-streaks { display: flex; align-items: center; gap: 8px; }

    .streak-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 10px;
      border: 1px solid #FED7AA;
      border-radius: 12px;
      background: #FFF7ED;
      color: #9A3412;
      white-space: nowrap;
    }

    .streak-chip strong { font-size: 16px; }
    .streak-chip > span:last-child { font-size: 10px; font-weight: 600; }

    .demo-note {
      padding: 8px 28px;
      background: #F8FAFC;
      border-bottom: 1px solid var(--line);
      color: var(--muted);
      font-size: 11px;
    }

    .subnav {
      display: flex;
      gap: 26px;
      overflow-x: auto;
      padding: 0 28px;
      background: white;
      border-bottom: 1px solid var(--line);
    }

    .subnav button {
      flex-shrink: 0;
      padding: 16px 0 13px;
      background: transparent;
      border-bottom: 3px solid transparent;
      color: var(--text);
      font-size: 12px;
      font-weight: 600;
    }

    .subnav button.active { border-color: var(--blue); color: var(--blue); }

    main {
      width: 100%;
      max-width: 1640px;
      margin: auto;
      padding: 28px 28px 100px;
    }

    .page-title,
    .workspace-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 24px;
    }

    .page-title h1, .workspace-title h1 { margin-bottom: 7px; }
    .page-title p, .workspace-title p { margin: 0; font-size: 13px; color: var(--muted); }

    .panel {
      min-width: 0;
      overflow: hidden;
      background: white;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .pad { padding: 24px; }

    .panel-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 18px;
      border-bottom: 1px solid var(--line);
      color: var(--navy);
      font-size: 13px;
      font-weight: 700;
    }

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

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: 40px;
      padding: 10px 15px;
      border: 1px solid transparent;
      border-radius: 12px;
      background: var(--blue);
      color: white;
      text-decoration: none;
      text-align: center;
      font-size: 12px;
      font-weight: 600;
      box-shadow: none;
    }

    .btn:hover { background: var(--blue-dark); }
    .btn.light { background: var(--blue-soft); color: var(--blue-dark); }
    .btn.light:hover { background: #DBEAFE; }
    .btn.gray { background: #F1F5F9; color: var(--text); }
    .btn.gray:hover { background: #E2E8F0; }

    .actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 17px;
    }

    .label,
    .schedule-status {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 8px;
      border-radius: 6px;
      background: #F1F5F9;
      color: var(--text);
      font-size: 10px;
      font-weight: 650;
      justify-self: start;
    }

    .label.green, .schedule-status.completed {
      background: var(--green-soft);
      color: var(--green);
    }

    .label.orange,
    .schedule-status.pending,
    .schedule-status.today,
    .schedule-status.upcoming {
      background: var(--amber-soft);
      color: var(--amber);
    }

    .label.locked, .schedule-status.locked { background: #F1F5F9; color: var(--muted); }

    .next-class {
      padding: 24px;
      background: white;
      border: 1px solid var(--line);
      border-left: 4px solid var(--blue);
      border-radius: var(--radius);
      margin-bottom: 18px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 22px;
    }

    .next-class h2 { font-size: 22px; margin: 8px 0; }
    .next-class p { margin: 0; color: var(--muted); font-size: 13px; }
    .next-class .actions { margin: 0; flex-shrink: 0; }
    .kicker { font-size: 10px; letter-spacing: 1.2px; font-weight: 700; color: var(--blue); }

    .welcome-small {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 15px;
      padding: 16px 20px;
      background: white;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      margin-bottom: 20px;
    }

    .welcome-small strong { color: var(--navy); }
    .welcome-small p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

    .stat-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 18px;
      margin-bottom: 24px;
    }

    .stat-box {
      padding: 22px;
      background: white;
      border: 1px solid var(--line);
      border-radius: var(--radius);
    }

    .stat-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
    }

    .stat-top .ui-icon { color: var(--blue); }
    .stat-box > strong {
      display: block;
      color: var(--navy);
      font-size: 32px;
      line-height: 1.3;
      letter-spacing: -1px;
      margin: 12px 0;
    }
    .stat-box > p { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

    progress {
      appearance: none;
      display: block;
      width: 100%;
      height: 6px;
      border: 0;
      border-radius: 20px;
      background: #EDF1F7;
      accent-color: var(--blue);
      overflow: hidden;
    }

    progress::-webkit-progress-bar { background: #EDF1F7; }
    progress::-webkit-progress-value { background: var(--blue); border-radius: 20px; }
    progress::-moz-progress-bar { background: var(--blue); }

    .section-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 15px;
      margin: 22px 0 13px;
    }

    .section-head h2 { margin: 0; font-size: 18px; }
    .section-heading { margin: 28px 0 15px; font-size: 18px; }

    .overview-bottom {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
      gap: 20px;
      align-items: start;
    }

    .overview-bottom > section { min-width: 0; }
    .quick-support { padding: 22px; }
    .quick-support p { font-size: 12px; color: var(--muted); }
    .quick-support h3 { margin: 16px 0 6px; }

    .home-updates { margin-bottom: 24px; }

    .updates-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 22px 24px;
      border-bottom: 1px solid var(--line);
    }

    .updates-heading h2 { margin: 0 0 5px; font-size: 18px; }
    .updates-heading p { margin: 0; font-size: 12px; }

    .update-row {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 18px 24px;
      border-bottom: 1px solid var(--line);
    }

    .update-row:last-child { border-bottom: 0; }
    .update-row > div { flex: 1; min-width: 0; }
    .update-row h3 { margin: 0 0 5px; font-size: 13px; }
    .update-row p { margin: 0; font-size: 12px; color: var(--text); }
    .update-icon { display: flex; align-items: center; color: var(--text); }
    .update-row .btn { flex-shrink: 0; }
    .updates-empty { padding: 20px 24px; font-size: 13px; }

    .assignment-row {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: white;
      margin: 9px 0;
      overflow: hidden;
    }

    .assignment-row > summary {
      list-style: none;
      cursor: pointer;
      padding: 16px 18px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 125px 105px 18px;
      gap: 12px;
      align-items: center;
    }

    .assignment-row > summary::-webkit-details-marker { display: none; }
    .assignment-row[open] > summary { background: #F8FAFC; border-bottom: 1px solid var(--line); }
    .assignment-row summary strong { font-size: 13px; color: var(--navy); }
    .assignment-row summary small { display: block; font-size: 11px; margin-top: 3px; }
    .assignment-row .deadline { font-size: 11px; color: var(--muted); }
    .assignment-row .answer-body { padding: 20px; }
    .assignment-row .answer-body p { font-size: 13px; }
    .assignment-row .chevron { color: var(--muted); }
    .assignment-row[open] .chevron { transform: rotate(180deg); }

    input, textarea, select {
      max-width: 100%;
      padding: 11px;
      border: 1px solid #D7E0ED;
      border-radius: 10px;
      background: white;
      color: var(--text);
    }

    textarea { width: 100%; min-height: 130px; resize: vertical; line-height: 1.7; }
    .field { display: grid; gap: 7px; margin: 13px 0; font-size: 12px; font-weight: 600; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

    .problem {
      padding: 22px;
      margin-bottom: 17px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: white;
    }

    .problem:last-child { margin-bottom: 0; }

    .feedback {
      padding: 13px;
      margin-top: 15px;
      border-left: 3px solid var(--green);
      border-radius: 0 10px 10px 0;
      background: var(--green-soft);
      font-size: 12px;
      overflow-wrap: anywhere;
    }

    .empty {
      padding: 24px;
      border: 1px dashed #D2DDEB;
      border-radius: 12px;
      background: #FAFCFF;
      color: var(--muted);
      font-size: 13px;
    }

    .info {
      padding: 14px;
      margin-top: 16px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #F8FAFC;
      color: var(--text);
      font-size: 12px;
    }

    .classroom-grid {
      display: grid;
      grid-template-columns: 260px minmax(0, 1fr);
      gap: 24px;
      align-items: start;
    }

    .calendar-list {
      max-height: 560px;
      padding: 8px;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: #CCD7E7 transparent;
    }

    .calendar-item {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 13px 9px;
      margin-bottom: 5px;
      background: white;
      color: var(--text);
      border: 1px solid transparent;
      border-radius: 10px;
      text-align: left;
    }

    .calendar-item:last-child { margin-bottom: 0; }
    .calendar-item:hover { background: #F8FAFC; }
    .calendar-item.selected {
      background: var(--blue-soft);
      border-color: #BFDBFE;
      box-shadow: inset 3px 0 var(--blue);
    }

    .calendar-date {
      min-width: 39px;
      padding: 5px 3px;
      border-radius: 8px;
      background: #F1F5F9;
      color: var(--muted);
      text-align: center;
      text-transform: uppercase;
      font-size: 9px;
      letter-spacing: .5px;
    }

    .calendar-date strong {
      display: block;
      color: var(--navy);
      font-size: 18px;
      line-height: 1.25;
    }

    .selected .calendar-date { background: white; }
    .selected .calendar-date strong { color: var(--blue); }
    .calendar-name { flex: 1; min-width: 0; font-size: 12px; line-height: 1.6; font-weight: 600; }
    .calendar-status { color: var(--muted); }
    .calendar-status.completed { color: var(--green); }
    .calendar-list + .pad { padding: 15px 18px; border-top: 1px solid var(--line); font-size: 11px; }
    .lesson-content { padding: 24px; min-width: 0; }
    .lesson-content h2 { margin: 16px 0 10px; font-size: clamp(21px, 2vw, 27px); line-height: 1.35; }
    .lesson-content > .muted { font-size: 12px; }

    .recording-placeholder {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      min-height: 240px;
      margin-top: 20px;
      padding: 24px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--background);
      text-align: center;
    }

    .recording-placeholder > p { margin: 0; color: var(--text); font-size: 13px; font-weight: 600; }

    .class-tabs {
      display: flex;
      gap: 23px;
      padding: 0 23px;
      overflow-x: auto;
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      background: white;
    }

    .class-tabs button {
      flex-shrink: 0;
      padding: 17px 0 14px;
      background: transparent;
      color: var(--text);
      border-bottom: 3px solid transparent;
      font-size: 12px;
      font-weight: 600;
    }

    .class-tabs button.active { color: var(--blue); border-color: var(--blue); }

    .lesson-summary {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      border-top: 1px solid var(--line);
      background: white;
    }

    .lesson-summary > div { padding: 17px 9px; border-right: 1px solid var(--line); text-align: center; }
    .lesson-summary > div:last-child { border-right: 0; }
    .lesson-summary small { font-size: 10px; }
    .lesson-summary strong { display: block; margin-top: 5px; color: var(--navy); font-size: 14px; }
    .lesson-summary strong.locked-text { color: var(--muted); }

    .classroom-grid .assignment-row {
      border: 0;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
      margin: 0;
    }

    .classroom-grid .assignment-row:last-child { border-bottom: 0; }

    .curriculum-heading,
    .curriculum-section-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 15px;
      margin-bottom: 18px;
    }

    .curriculum-heading h1 { margin: 7px 0; }
    .curriculum-heading p, .curriculum-section-title > span { font-size: 12px; color: var(--muted); }
    .curriculum-kicker { font-size: 10px; color: var(--blue); font-weight: 700; letter-spacing: 1px; }
    .curriculum-batch { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 11px; }

    .curriculum-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      border: 1px solid var(--line);
      background: white;
      border-radius: var(--radius);
      margin-bottom: 25px;
      overflow: hidden;
    }

    .curriculum-summary > div { padding: 18px 22px; border-right: 1px solid var(--line); }
    .curriculum-summary > div:last-child { border-right: 0; }
    .curriculum-summary strong { display: block; font-size: 25px; color: var(--navy); }
    .curriculum-summary span { font-size: 11px; color: var(--muted); }
    .upcoming-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }

    .upcoming-lesson {
      background: white;
      padding: 20px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      display: flex;
      flex-direction: column;
      align-items: flex-start;
    }

    .upcoming-lesson > .row { width: 100%; }
    .upcoming-module { font-size: 10px; color: var(--muted); margin-top: 16px; }
    .upcoming-lesson h3 { margin: 7px 0; }
    .upcoming-lesson p { font-size: 11px; color: var(--muted); }
    .upcoming-lesson .btn { margin-top: auto; }

    .schedule-date {
      padding: 6px;
      width: 49px;
      flex-shrink: 0;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #F8FAFC;
      text-align: center;
    }

    .schedule-date span { display: block; font-size: 9px; text-transform: uppercase; color: var(--muted); }
    .schedule-date strong { display: block; font-size: 21px; color: var(--navy); }
    .curriculum-module { border: 1px solid var(--line); border-radius: var(--radius); background: white; margin-bottom: 14px; overflow: hidden; }

    .curriculum-module > summary {
      display: flex;
      align-items: center;
      gap: 13px;
      padding: 18px 20px;
      cursor: pointer;
      list-style: none;
      background: #F8FAFC;
    }

    .curriculum-module > summary::-webkit-details-marker { display: none; }
    .module-number { padding: 7px 10px; background: var(--blue-soft); color: var(--blue); border-radius: 10px; font-size: 12px; font-weight: 700; }
    .module-description { flex: 1; min-width: 0; }
    .module-description strong, .module-description small { display: block; }
    .module-description small { font-size: 10px; }
    .curriculum-module[open] .module-chevron { transform: rotate(180deg); }
    .curriculum-lesson { display: flex; align-items: center; gap: 17px; padding: 20px; border-top: 1px solid var(--line); }
    .curriculum-lesson-info { flex: 1; min-width: 0; }
    .lesson-title-button { padding: 0; text-align: left; background: transparent; color: var(--navy); font-size: 13px; font-weight: 650; }
    .lesson-title-button:hover { color: var(--blue); }
    .curriculum-lesson-info > p, .lesson-resource-labels { font-size: 11px; color: var(--muted); margin: 5px 0; }
    .lesson-resource-labels { display: flex; gap: 12px; flex-wrap: wrap; }
    .curriculum-lesson-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }

    .lesson-feedback-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
    .lesson-feedback-form textarea { min-height: 90px; }
    .lesson-resource-labels > span { display: inline-flex; align-items: center; }

    .quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
    .admin-class { padding: 25px; border-bottom: 1px solid var(--line); }
    .admin-class:last-child { border-bottom: 0; }

    pre {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #F8FAFC;
      font-size: 12px;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .academy-sidebar { display: none; }
    .drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(19, 35, 59, .38); }

    .drawer {
      position: fixed;
      inset: 0 auto 0 0;
      z-index: 100;
      width: min(365px, 90vw);
      padding: 26px;
      overflow-y: auto;
      background: white;
      box-shadow: 12px 0 45px rgba(16, 35, 65, .12);
    }

    .drawer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
    .menu-group { padding-top: 19px; margin-top: 17px; border-top: 1px solid var(--line); }
    .menu-group h3 { margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; }

    .menu-link {
      display: flex;
      align-items: center;
      gap: 13px;
      width: 100%;
      padding: 14px 10px;
      border-radius: 12px;
      background: white;
      color: var(--text);
      text-align: left;
      font-size: 13px;
    }

    .menu-link:hover, .menu-link.active { background: var(--blue-soft); color: var(--blue); }
    .menu-link > span:first-child { min-width: 25px; }
    .menu-link small { display: block; margin-top: 3px; font-size: 10px; }

    .chat-toggle {
      position: fixed;
      right: 23px;
      bottom: 22px;
      z-index: 70;
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 13px 19px;
      border-radius: 28px;
      background: var(--blue);
      color: white;
      font-size: 12px;
      font-weight: 600;
      box-shadow: 0 4px 14px rgba(23, 43, 77, .1);
    }

    .chat {
      position: fixed;
      right: 23px;
      bottom: 83px;
      z-index: 70;
      width: min(355px, calc(100vw - 28px));
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: white;
      box-shadow: 0 16px 50px rgba(24, 47, 82, .16);
    }

    .chat-header { padding: 13px 16px; background: var(--navy); color: white; font-size: 13px; }
    .chat-header .icon-btn { color: white; }
    .chat-log { height: min(280px, 40dvh); overflow-y: auto; padding: 15px; }
    .chat-log p { padding: 12px; border-radius: 12px; background: #F1F5F9; font-size: 12px; }
    .chat-log .user { margin-left: 22px; background: var(--blue-soft); color: var(--navy); }
    .chat form { display: flex; gap: 7px; padding: 12px; border-top: 1px solid var(--line); }
    .chat input { flex: 1; min-width: 0; font-size: 12px; }
    .chat small { display: block; padding: 0 13px 12px; font-size: 10px; }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 25px;
      z-index: 150;
      max-width: calc(100vw - 30px);
      padding: 13px 20px;
      transform: translateX(-50%);
      border-radius: 12px;
      background: var(--navy);
      color: white;
      font-size: 13px;
    }

    @media (min-width: 1101px) {
      body { padding-left: 228px; }

      .academy-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        display: flex;
        flex-direction: column;
        width: 228px;
        padding: 27px 17px 20px;
        overflow-y: auto;
        background: white;
        color: var(--text);
        border-right: 1px solid var(--line);
      }

      .sidebar-brand { padding: 0 9px 28px; }
      .sidebar-brand b { font-size: 18px; }
      .sidebar-brand small { color: var(--text); }

      .sidebar-caption {
        margin: 18px 12px 9px;
        color: var(--muted);
        font-size: 9px;
        font-weight: 650;
        letter-spacing: 1.2px;
      }

      .academy-sidebar > button {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px;
        margin: 2px 0;
        border-radius: 12px;
        background: transparent;
        color: var(--text);
        text-align: left;
        font-size: 12px;
      }

      .academy-sidebar > button.active {
        background: var(--blue-soft);
        color: var(--blue);
        box-shadow: inset 3px 0 var(--blue);
      }

      .academy-sidebar > button:hover { background: var(--blue-soft); color: var(--blue); }
      .sidebar-bottom { padding: 16px 12px; margin-top: auto; border-top: 1px solid var(--line); }
      .sidebar-bottom strong { display: block; font-size: 12px; color: var(--navy); }
      .sidebar-bottom p { font-size: 11px; color: var(--text); }
      .sidebar-support-icon { margin-bottom: 9px; color: var(--blue); }
      .sidebar-bottom .btn { width: 100%; font-size: 11px; }

      .topbar > .brand,
      .topbar > .course-state,
      #menu-open,
      .subnav { display: none; }

      .topbar { gap: 10px; padding: 14px 26px; min-height: 72px; }
      main { padding: 26px 27px 100px; }
    }

    @media (max-width: 1280px) {
      .course-state { display: none; }
      .overview-bottom { grid-template-columns: 1fr; }
    }

    @media (max-width: 1100px) {
      .top-chip { display: none; }
      .curriculum-heading { align-items: flex-start; flex-direction: column; }
    }

    @media (max-width: 800px) {
      .classroom-grid { grid-template-columns: 1fr; }
      .stat-grid, .upcoming-grid, .quick-grid { grid-template-columns: 1fr; }
      .calendar-list { display: flex; gap: 7px; max-height: none; overflow-x: auto; }
      .calendar-item { flex-shrink: 0; width: 215px; margin: 0; }
      .calendar-list + .pad { padding: 10px 16px; }
      .recording-placeholder { min-height: 190px; }
      .lesson-content { padding: 20px; }
    }

    @media (max-width: 780px) {
      .topbar { padding: 14px 18px; gap: 10px; }
      .header-streaks { order: 5; width: 100%; padding-top: 2px; }
      .profile-select { margin-left: auto; max-width: 170px; }
      .top-spacer { display: none; }
      .demo-note { padding: 7px 18px; font-size: 10px; }
      .subnav { padding: 0 18px; gap: 24px; }
      main { padding: 23px 17px 100px; }
    }

    @media (max-width: 700px) {
      .next-class, .welcome-small { align-items: flex-start; flex-direction: column; }
      .next-class .actions { margin-top: 3px; }
      .assignment-row > summary { grid-template-columns: minmax(0, 1fr) auto 18px; gap: 8px; }
      .assignment-row .deadline { grid-column: 1; grid-row: 2; }
      .assignment-row .schedule-status { grid-column: 2; grid-row: 1; }
      .assignment-row .chevron { grid-column: 3; grid-row: 1; }
      .curriculum-lesson { flex-wrap: wrap; }
      .curriculum-lesson-info { flex-basis: calc(100% - 70px); }
      .curriculum-lesson-actions { width: 100%; flex-direction: row; justify-content: space-between; }
      .curriculum-section-title { align-items: flex-start; flex-direction: column; }
    }

    @media (max-width: 600px) {
      .updates-heading, .update-row { padding: 18px; }
      .update-row { flex-wrap: wrap; gap: 12px; }
      .update-row > div { flex-basis: calc(100% - 36px); }
      .update-row .btn { margin-left: 31px; }
    }

    @media (max-width: 520px) {
      .brand b { font-size: 17px; }
      .brand small { font-size: 8px; letter-spacing: 2px; }
      .logo { width: 33px; height: 33px; font-size: 14px; }
      .profile-select { max-width: 140px; padding: 8px 5px; font-size: 10px; }
      .streak-chip { flex: 1; justify-content: center; }
      h1 { font-size: 24px; }
      .page-title p { font-size: 12px; }
      .class-tabs { padding: 0 17px; gap: 22px; }
      .lesson-content h2 { font-size: 22px; }
      .lesson-summary small { font-size: 9px; }
      .lesson-summary strong { font-size: 12px; }
      .stat-box { padding: 18px; }
      .stat-box > strong { font-size: 30px; }
      .curriculum-summary { grid-template-columns: 1fr 1fr; }
      .curriculum-summary > div { padding: 16px; border-bottom: 1px solid var(--line); }
      .workspace-title { align-items: flex-start; flex-direction: column; }
      .curriculum-module > summary, .curriculum-lesson { padding: 16px; }
      .form-grid { grid-template-columns: 1fr; gap: 0; }
      .pad, .admin-class, .problem { padding: 18px; }
      .chat-toggle { right: 15px; bottom: 15px; }
      .chat { right: 14px; bottom: 76px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
      }
    }
    /* Polished dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0B1220;
  --surface: #111C2E;
  --blue: #60A5FA;
  --blue-dark: #3B82F6;
  --blue-soft: #172B46;
  --navy: #E5EDF8;
  --text: #CBD5E1;
  --muted: #94A3B8;
  --line: #26364D;
  --green: #4ADE80;
  --green-soft: #123326;
  --amber: #FBBF24;
  --amber-soft: #382B14;
  --shadow: 0 8px 28px rgba(0, 0, 0, .18);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 75% -20%, rgba(37, 99, 235, .13), transparent 42%),
    var(--background);
  color: var(--text);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .subnav,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .stat-box,
:root[data-theme="dark"] .next-class,
:root[data-theme="dark"] .welcome-small,
:root[data-theme="dark"] .calendar-item,
:root[data-theme="dark"] .upcoming-lesson,
:root[data-theme="dark"] .assignment-row,
:root[data-theme="dark"] .curriculum-module,
:root[data-theme="dark"] .chat,
:root[data-theme="dark"] .drawer {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] .demo-note,
:root[data-theme="dark"] .profile-select,
:root[data-theme="dark"] .btn.gray,
:root[data-theme="dark"] .label,
:root[data-theme="dark"] .schedule-status {
  background-color: #172438;
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background-color: #0D1727;
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] .top-chip,
:root[data-theme="dark"] .menu-link {
  color: var(--text);
}

:root[data-theme="dark"] .top-chip:hover,
:root[data-theme="dark"] .menu-link:hover,
:root[data-theme="dark"] .subnav button:hover {
  background-color: var(--blue-soft);
  color: #BFDBFE;
}

:root[data-theme="dark"] .btn {
  background: #3B82F6;
  color: #071426;
}

:root[data-theme="dark"] .btn:hover {
  background: #93C5FD;
}

:root[data-theme="dark"] .btn.light {
  background: var(--blue-soft);
  color: #BFDBFE;
}

:root[data-theme="dark"] .label.green,
:root[data-theme="dark"] .schedule-status.completed {
  background: var(--green-soft);
  color: var(--green);
}

:root[data-theme="dark"] .label.orange,
:root[data-theme="dark"] .schedule-status.pending,
:root[data-theme="dark"] .schedule-status.today,
:root[data-theme="dark"] .schedule-status.upcoming {
  background: var(--amber-soft);
  color: var(--amber);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.theme-toggle span:first-child {
  font-size: 16px;
}

.theme-toggle:active {
  transform: scale(.97);
}

@media (prefers-reduced-motion: no-preference) {
  body,
  .topbar,
  .subnav,
  .panel,
  .stat-box,
  .next-class,
  .welcome-small,
  .top-chip,
  .btn {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  }
}

/* Student workspace layouts based on the supplied calendar, curriculum,
   performance, recording, and assignment references. */
.student-home-heading,
.student-curriculum-heading,
.student-assignment-head,
.student-performance-page-head,
.student-classroom-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.student-home-heading h1,
.student-curriculum-heading h1,
.student-assignment-head h1,
.student-performance-page-head h1,
.student-classroom-heading h1 { margin: 5px 0; }

.student-home-heading p,
.student-curriculum-heading p,
.student-assignment-head p,
.student-performance-page-head p,
.student-classroom-heading p { margin: 0; color: var(--muted); }

.student-home-grid {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.student-calendar { padding: 0; min-height: 410px; }
.student-calendar-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.student-calendar-head h2 { margin: 0; }
.student-calendar-head > span { color: var(--muted); font-size: 11px; }
.student-calendar-list { max-height: 470px; overflow-y: auto; padding: 8px; }
.student-calendar-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 9px; margin: 3px 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); text-align: left; }
.student-calendar-item:hover { background: var(--blue-soft); }
.student-calendar-item.selected { background: color-mix(in srgb, #F43F8E 12%, var(--surface)); border-color: color-mix(in srgb, #F43F8E 38%, var(--line)); }
.student-calendar-date { width: 48px; min-width: 48px; padding: 6px 3px; border-radius: 10px; background: #1A1D25; color: var(--muted); text-align: center; font-size: 9px; letter-spacing: .6px; }
.student-calendar-date strong { display: block; color: var(--navy); font-size: 19px; line-height: 1.2; }
.student-calendar-copy { flex: 1; min-width: 0; }
.student-calendar-copy strong,.student-calendar-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-calendar-copy strong { color: var(--navy); font-size: 12px; }
.student-calendar-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.student-calendar-mark { color: #FF76C2; }
.student-calendar-mark.done { color: var(--green); }
.student-calendar-foot { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.student-calendar-empty { padding: 25px 16px; color: var(--muted); font-size: 12px; }

.student-featured-class { display: flex; flex-direction: column; padding: 22px; }
.student-featured-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.student-video-card { position: relative; display: flex; align-items: center; gap: 20px; min-height: 205px; overflow: hidden; padding: 25px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: linear-gradient(115deg, #351542 0%, #182449 58%, #101924 100%); }
.student-video-glow { position: absolute; width: 220px; height: 220px; top: -110px; left: 16%; border-radius: 50%; background: rgba(244,63,142,.45); filter: blur(48px); }
.student-video-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 76px; height: 76px; flex: 0 0 76px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: linear-gradient(140deg, #F43F8E, #9333EA); color: white; box-shadow: 0 8px 28px rgba(217,70,239,.3); }
.student-video-icon .ui-icon { width: 31px; height: 31px; stroke-width: 2; }
.student-video-caption { position: relative; z-index: 1; display: grid; gap: 5px; min-width: 0; color: white; }
.student-video-caption small { color: #D8B4FE; font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; }
.student-video-caption strong { max-width: 520px; font-size: clamp(18px, 2.3vw, 26px); line-height: 1.35; }
.student-video-label { position: absolute; right: 18px; top: 16px; color: #FBCFE8; font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
.student-featured-details { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 18px; }
.student-featured-details h2 { margin: 0 0 5px; }
.student-featured-details p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.student-featured-details .actions { margin: 0; justify-content: flex-end; }
.student-featured-empty { display: grid; place-items: center; align-content: center; flex: 1; min-height: 310px; padding: 30px; text-align: center; }
.student-featured-empty h2 { margin: 16px 0 7px; }
.student-featured-empty p { max-width: 440px; color: var(--muted); }

.student-performance-mini { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.student-performance-mini-title { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.student-performance-mini-title > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #172033; color: #79A9FF; }
.student-performance-mini-title > div { flex: 1; }
.student-performance-mini-title strong,.student-performance-mini-title small { display: block; }
.student-performance-mini-title strong { color: var(--navy); font-size: 14px; }
.student-performance-mini-title small { color: var(--muted); font-size: 10px; }
.student-mini-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.student-mini-metric { min-width: 0; padding: 14px; border: 1px solid var(--line); border-top: 2px solid #4F8CFF; border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, #182033); }
.student-mini-metric > span,.student-mini-metric > small { display: block; color: var(--muted); font-size: 10px; }
.student-mini-metric > strong { display: block; margin: 4px 0 8px; color: var(--navy); font-size: 23px; }
.student-mini-metric progress { height: 5px; margin: 5px 0 7px; }
.student-mini-metric.accent-yellow { border-top-color: #EAB308; }
.student-mini-metric.accent-pink { border-top-color: #F43F8E; }
.student-mini-metric.accent-orange { border-top-color: #F97316; }
.student-mini-metric.accent-violet { border-top-color: #A855F7; }
.student-home-shortcuts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }

.student-curriculum-heading,.student-assignment-head,.student-performance-page-head { margin-bottom: 20px; }
.student-curriculum-layout { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0,1fr); gap: 20px; align-items: start; }
.student-module-rail { display: grid; gap: 12px; max-height: 780px; padding-right: 5px; overflow-y: auto; }
.student-module-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.student-module-card.active { border-color: #B83280; box-shadow: inset 0 0 0 1px rgba(244,63,142,.24), 0 8px 25px rgba(244,63,142,.08); }
.student-module-card > small { color: #8BAEFF; font-size: 10px; letter-spacing: 1.5px; }
.student-module-card h2 { margin: 4px 0; font-size: 15px; }
.student-module-card > p { margin: 0 0 13px; color: var(--muted); font-size: 11px; }
.student-module-open { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #17191F; color: var(--text); text-align: left; font-size: 11px; }
.student-module-open > span:first-of-type { flex: 1; }
.student-module-card.active .student-module-open { border-color: transparent; background: linear-gradient(100deg,#2563EB,#8B35DD 65%,#E13C9A); color: white; }
.student-module-status { margin-top: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; }
.student-module-status.available { color: #58E092; background: #14291F; }
.student-curriculum-lessons { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.student-curriculum-list-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 20px; border-bottom: 1px solid var(--line); }
.student-curriculum-list-head h2 { margin: 4px 0 0; }
.student-curriculum-list-head > span { color: var(--muted); font-size: 11px; }
.student-lesson-row { display: grid; grid-template-columns: 76px minmax(170px,1fr) 105px 120px 120px 20px; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.student-lesson-row:last-child { border-bottom: 0; }
.student-lesson-row:hover { background: rgba(79,140,255,.06); }
.student-lesson-day small,.student-lesson-day em,.student-lesson-metric small { display: block; color: var(--muted); font-size: 9px; font-style: normal; letter-spacing: .7px; }
.student-lesson-day strong { display: block; color: #9DBBFF; font-size: 19px; }
.student-lesson-day em { color: #FF76C2; }
.student-lesson-name { min-width: 0; }
.student-lesson-name strong,.student-lesson-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-lesson-name strong { color: var(--navy); font-size: 13px; }
.student-lesson-name small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.student-lesson-metric { padding-left: 13px; border-left: 1px solid var(--line); text-align: center; }
.student-lesson-metric strong { display: block; margin-top: 4px; color: #FF6FAF; font-size: 12px; }
.student-lesson-chevron { color: #79A9FF; }

.student-assignment-head { margin-bottom: 16px; }
.student-assignment-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.student-assignment-summary > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.student-assignment-summary > div:last-child { border-right: 0; }
.student-assignment-summary small { display: block; color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.student-assignment-summary strong { display: block; margin-top: 4px; color: var(--navy); font-size: 21px; }
.student-assignment-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.student-assignment-list-head { display: grid; grid-template-columns: 44px minmax(0,1fr) 130px; gap: 10px; padding: 13px 17px; border-bottom: 1px solid var(--line); background: #17191F; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.student-assignment-item { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 10px; align-items: start; padding: 0 17px; border-bottom: 1px solid var(--line); }
.student-assignment-item:last-child { border-bottom: 0; }
.student-assignment-index { padding-top: 20px; color: #8BAEFF; font-size: 12px; font-weight: 700; }
.student-assignment-item-content { min-width: 0; }
.student-assignment-item-meta { display: none; }
.student-assignment-item .assignment-row { margin: 0; border: 0; border-radius: 0; background: transparent; }
.student-assignment-item .assignment-row > summary { grid-template-columns: minmax(0,1fr) auto 18px; padding: 17px 0; }
.student-assignment-item .assignment-row > summary .deadline { display: none; }
.student-assignment-item .assignment-row[open] > summary { background: transparent; }
.student-assignment-item .answer-body { padding: 4px 0 18px; }
.student-assignment-item .answer-body .assignment-row { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.student-assignment-item .answer-body .assignment-row > summary { padding: 13px; }
.student-assignment-empty { padding: 28px; color: var(--muted); }

.student-performance-page-head { margin-bottom: 20px; }
.student-performance-hero { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 25px; margin-bottom: 17px; background: radial-gradient(ellipse at 10% 20%,rgba(244,63,142,.13),transparent 38%),var(--surface); }
.student-performance-hero-copy h2 { margin: 7px 0; font-size: 21px; }
.student-performance-hero-copy p { margin: 0; color: var(--muted); }
.student-performance-rings { display: flex; align-items: center; gap: 18px; }
.student-ring { --ring-color:#4F8CFF; display: grid; place-items: center; align-content: center; width: 106px; height: 106px; border-radius: 50%; background: conic-gradient(var(--ring-color) var(--ring-value),#292D35 0); position: relative; }
.student-ring::before { content:""; position:absolute; inset:8px; border-radius:50%; background:#101216; }
.student-ring span,.student-ring small { z-index:1; }
.student-ring span { color: var(--navy); font-size: 19px; font-weight: 750; }
.student-ring small { color: var(--muted); font-size: 9px; }
.student-ring.accent-yellow { --ring-color:#EAB308; }
.student-ring.accent-pink { --ring-color:#F43F8E; }
.student-performance-detail-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.student-performance-detail { padding: 18px; border: 1px solid var(--line); border-top: 2px solid #4F8CFF; border-radius: 13px; background: var(--surface); }
.student-performance-detail > span { display: block; color: var(--muted); font-size: 11px; }
.student-performance-detail > strong { display: block; margin: 9px 0 5px; color: var(--navy); font-size: 27px; }
.student-performance-detail > strong small { color: var(--muted); font-size: 11px; font-weight: 500; }
.student-performance-detail > p { min-height: 32px; margin: 0 0 9px; color: var(--muted); font-size: 10px; }
.student-performance-detail.accent-pink { border-top-color:#F43F8E; }
.student-performance-detail.accent-orange { border-top-color:#F97316; }
.student-performance-detail.accent-violet { border-top-color:#A855F7; }
.student-performance-detail.accent-blue { border-top-color:#3B82F6; }
.student-performance-note { margin-top: 17px; padding: 20px; }
.student-performance-note h2 { margin-bottom: 6px; }
.student-performance-note p { margin: 0; color: var(--muted); font-size: 12px; }

.student-classroom-heading { align-items: center; }
.student-classroom-summary { display: grid; grid-template-columns: 38px auto; align-items: center; column-gap: 9px; min-width: 170px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.student-classroom-summary > span { grid-row: span 2; color: #FFC247; font-size: 24px; }
.student-classroom-summary small { color: var(--muted); font-size: 8px; letter-spacing: .6px; }
.student-classroom-summary strong { color: var(--navy); font-size: 12px; }
.student-classroom-layout { display: grid; grid-template-columns: minmax(220px,270px) minmax(0,1fr); gap: 17px; align-items: start; }
.student-recording-rail { display: grid; gap: 8px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.student-recording-rail h2 { margin: 0 0 4px; font-size: 14px; }
.student-recording-nav { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.student-recording-nav.active { border-color: #B83280; background: #211322; }
.student-recording-nav > span:first-child { color: #FF76C2; }
.student-recording-nav > span:last-child { min-width: 0; }
.student-recording-nav strong,.student-recording-nav small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-recording-nav strong { color: var(--navy); font-size: 11px; }
.student-recording-nav small { color: var(--muted); font-size: 9px; }
.student-classroom-main { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.student-classroom-tabs { display: flex; gap: 22px; overflow-x: auto; padding: 0 18px; border-bottom: 1px solid var(--line); }
.student-classroom-tabs button { flex: 0 0 auto; padding: 15px 0 12px; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.student-classroom-tabs button.active { border-color: #F43F8E; color: #FF76C2; }
.student-classroom-tabs button small { color: inherit; }
.student-recording-stage { padding: 20px; }
.student-recording-art { position: relative; display: flex; align-items: center; gap: 22px; min-height: 255px; overflow: hidden; padding: 25px; border: 1px solid #343044; border-radius: 13px; background: linear-gradient(120deg,#182C52,#242044 60%,#351842); }
.student-recording-art::after { content:""; position:absolute; inset:auto -10% -65% -10%; height:170px; background:linear-gradient(90deg,rgba(59,130,246,.34),rgba(217,70,239,.25)); filter:blur(28px); }
.student-recording-art-title { position: relative; z-index: 1; display: grid; gap: 8px; max-width: 500px; color: #D9E7FF; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.student-recording-art-title strong { color: white; font-size: clamp(20px,2vw,27px); letter-spacing: 0; line-height: 1.3; text-transform: none; }
.student-recording-progress { position: absolute; z-index: 2; right: 18px; bottom: 15px; left: 18px; height: 4px; border-radius: 4px; background: linear-gradient(90deg,#F43F8E,#8B5CF6,#3B82F6); }
.student-recording-info { padding: 18px 3px 2px; }
.student-recording-info h2 { margin: 10px 0 3px; }
.student-recording-info p { color: var(--muted); font-size: 12px; }
.student-recording-info .actions { margin-top: 12px; }
.student-class-tab-body { padding: 20px; }
.student-class-tab-body h2 { margin-bottom: 14px; }

@media (max-width: 1000px) {
  .student-mini-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .student-curriculum-layout { grid-template-columns: minmax(230px,290px) minmax(0,1fr); }
  .student-lesson-row { grid-template-columns: 62px minmax(150px,1fr) 90px 95px 20px; }
  .student-lesson-metric.extra { display: none; }
  .student-performance-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .student-home-grid,.student-curriculum-layout,.student-classroom-layout { grid-template-columns: 1fr; }
  .student-calendar-list { display: flex; max-height: none; gap: 7px; overflow-x: auto; }
  .student-calendar-item { flex: 0 0 245px; }
  .student-module-rail { display: flex; max-height: none; overflow-x: auto; padding: 0 0 5px; }
  .student-module-card { flex: 0 0 min(290px,80vw); }
  .student-lesson-row { grid-template-columns: 55px minmax(0,1fr) 85px 20px; gap: 9px; padding: 14px 12px; }
  .student-lesson-metric:nth-of-type(2) { display: none; }
  .student-performance-hero { align-items: flex-start; flex-direction: column; }
  .student-performance-rings { align-self: center; }
  .student-classroom-summary { min-width: 0; }
  .student-recording-rail { display: flex; overflow-x: auto; }
  .student-recording-rail h2 { display: none; }
  .student-recording-nav { flex: 0 0 220px; }
  .student-assignment-list-head { display: none; }
  .student-assignment-item { padding: 0 12px; }
}

@media (max-width: 520px) {
  .student-home-heading,.student-curriculum-heading,.student-assignment-head,.student-performance-page-head,.student-classroom-heading { align-items: flex-start; flex-direction: column; }
  .student-video-card { min-height: 190px; padding: 18px; gap: 13px; }
  .student-video-icon { width: 58px; height: 58px; flex-basis: 58px; }
  .student-featured-details { align-items: flex-start; flex-direction: column; }
  .student-featured-details .actions { justify-content: flex-start; }
  .student-performance-mini { padding: 15px; }
  .student-performance-mini-title { align-items: flex-start; flex-wrap: wrap; }
  .student-performance-mini-title .btn { margin-left: 48px; }
  .student-mini-metrics { gap: 8px; }
  .student-mini-metric { padding: 11px; }
  .student-curriculum-list-head { align-items: flex-start; flex-direction: column; padding: 15px; }
  .student-lesson-row { grid-template-columns: 46px minmax(0,1fr) 20px; }
  .student-lesson-metric { display: none; }
  .student-assignment-summary > div { padding: 12px; }
  .student-assignment-item .assignment-row > summary { grid-template-columns: minmax(0,1fr) auto 16px; }
  .student-performance-detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .student-performance-detail { padding: 13px; }
  .student-ring { width: 90px; height: 90px; }
  .student-recording-art { min-height: 200px; gap: 12px; padding: 17px; }
  .student-recording-stage { padding: 12px; }
  .student-classroom-tabs { gap: 16px; padding: 0 13px; }
}

/* Home: compact class schedule with the student's performance kept beside it. */
.student-home-grid { grid-template-columns: minmax(0,1fr) minmax(285px,340px); align-items: start; }
.student-upcoming-panel { min-width: 0; padding: 0; }
.student-upcoming-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px 22px; border-bottom:1px solid var(--line); }
.student-upcoming-heading h2 { margin:3px 0; }
.student-upcoming-heading p { margin:0; color:var(--muted); font-size:11px; }
.student-upcoming-list { display:grid; }
.student-upcoming-item { display:grid; grid-template-columns:52px 42px minmax(0,1fr) auto; align-items:center; gap:13px; padding:17px 20px; border-bottom:1px solid var(--line); }
.student-upcoming-item:last-child { border-bottom:0; }
.student-upcoming-item.featured { background:linear-gradient(100deg,rgba(49,87,213,.07),transparent 72%); }
.student-upcoming-date { display:grid; place-items:center; align-content:center; min-height:53px; border:1px solid var(--line); border-radius:11px; background:var(--background); }
.student-upcoming-date strong { color:var(--navy); font-size:21px; line-height:1.1; }
.student-upcoming-date span { color:var(--muted); font-size:9px; font-weight:700; letter-spacing:.7px; }
.student-upcoming-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:linear-gradient(140deg,#3157D5,#7554D8); color:white; box-shadow:0 5px 14px rgba(49,87,213,.2); }
.student-upcoming-icon .ui-icon { width:20px; height:20px; }
.student-upcoming-copy { min-width:0; }
.student-upcoming-status { color:#64748B; font-size:9px; font-weight:750; letter-spacing:1px; }
.student-upcoming-status.live { color:#0B8B63; }
.student-upcoming-copy h3 { overflow:hidden; margin:2px 0; color:var(--navy); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.student-upcoming-copy p,.student-upcoming-copy small { display:block; overflow:hidden; margin:0; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.student-upcoming-actions .btn { min-height:35px; padding:8px 11px; font-size:10px; }
.student-upcoming-empty { display:grid; justify-items:center; padding:32px 20px; text-align:center; }
.student-upcoming-empty .student-video-icon { width:56px; height:56px; }
.student-upcoming-empty h3 { margin:13px 0 4px; }
.student-upcoming-empty p { max-width:350px; color:var(--muted); font-size:12px; }

.student-performance-aside { position:sticky; top:18px; padding:19px 18px; }
.student-performance-aside-heading { display:flex; align-items:center; gap:10px; padding-bottom:13px; border-bottom:1px solid var(--line); }
.student-performance-aside-heading > span { color:#3157D5; }
.student-performance-aside-heading h2 { margin:0; font-size:17px; }
.student-performance-aside-intro { display:grid; gap:5px; padding:14px 2px 13px; border-bottom:1px solid var(--line); }
.student-performance-aside-intro strong { color:#3157D5; font-size:9px; letter-spacing:1px; }
.student-performance-aside-intro span { color:var(--navy); font-size:13px; font-weight:700; }
.student-performance-aside-intro small { color:var(--muted); font-size:10px; }
.student-side-performance-row { display:grid; grid-template-columns:minmax(0,1fr) 54px 48px; align-items:center; gap:9px; min-height:93px; padding:13px 2px; border-bottom:1px solid var(--line); }
.student-side-performance-row > div:first-child { min-width:0; }
.student-side-performance-row > div:first-child strong,.student-side-performance-row > div:first-child small { display:block; }
.student-side-performance-row > div:first-child strong { color:var(--navy); font-size:12px; }
.student-side-performance-row > div:first-child small { margin-top:4px; color:var(--muted); font-size:9px; line-height:1.4; }
.student-side-meter { --meter-color:#EAB308; display:grid; place-items:center; width:49px; height:49px; border-radius:50%; background:conic-gradient(var(--meter-color) var(--meter-value),#E7EAF0 0); position:relative; }
.student-side-meter::before { content:""; position:absolute; inset:5px; border-radius:50%; background:var(--surface); }
.student-side-meter span { z-index:1; color:var(--navy); font-size:11px; font-weight:700; }
.student-side-meter.accent-orange { --meter-color:#F28B28; }
.student-side-streak { display:flex; align-items:center; justify-content:flex-end; gap:4px; color:#D79806; font-size:12px; font-weight:700; }
.student-side-streak .ui-icon { width:16px; height:16px; }
.student-side-streak.accent-orange { color:#F28B28; }
.student-side-progress-line { display:grid; grid-template-columns:1fr auto; gap:5px; padding:14px 2px 0; color:var(--muted); font-size:10px; }
.student-side-progress-line strong { color:var(--navy); }
.student-side-progress-line progress { grid-column:1/-1; height:5px; }

/* Student profile cards open an inline editor for only the selected detail. */
.student-profile-heading { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:22px; }
.student-profile-heading h1 { margin:4px 0; }
.student-profile-heading p { margin:0; color:var(--muted); font-size:12px; }
.student-profile-avatar { display:grid; place-items:center; width:54px; height:54px; border:1px solid #D9E1F5; border-radius:16px; background:linear-gradient(145deg,#EEF2FF,#E5E9FA); color:#2847B8; font-size:17px; font-weight:800; }
.student-profile-section { margin:0 0 23px; }
.student-profile-section-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:0 1px 11px; }
.student-profile-section-heading h2 { margin:0; font-size:15px; }
.student-profile-section-heading p { margin:0; color:var(--muted); font-size:10px; }
.student-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
.student-profile-card { display:flex; align-items:center; justify-content:space-between; gap:15px; min-width:0; min-height:82px; padding:15px 17px; border:1px solid var(--line); border-radius:13px; background:var(--surface); box-shadow:var(--shadow); }
.student-profile-card > div { min-width:0; }
.student-profile-card small { display:block; color:var(--muted); font-size:10px; font-weight:600; }
.student-profile-value { overflow-wrap:anywhere; margin-top:4px; }
.student-profile-value strong,.student-profile-address-value { color:var(--navy); font-size:12px; font-weight:650; }
.profile-empty-value { color:#8993A7; font-size:11px; font-weight:450; }
.student-profile-edit { flex:0 0 auto; padding:7px 11px; border:1px solid #D5DDF0; border-radius:9px; background:#F7F8FC; color:#2847B8; font-size:10px; font-weight:700; }
.student-profile-edit:hover { background:#E9EEFF; }
.profile-readonly { flex:0 0 auto; color:var(--muted); font-size:9px; }
.student-profile-card.editing { display:block; border-color:#8399DC; box-shadow:0 0 0 3px rgba(49,87,213,.08); }
.student-profile-card form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; }
.student-profile-card .field { margin:0; }
.student-profile-card .field input { width:100%; }
.student-profile-card-actions { display:flex; gap:7px; }
.student-profile-card-actions .btn { min-height:36px; padding:8px 11px; font-size:10px; }
.student-profile-address { min-height:100px; }
.student-profile-address-value { line-height:1.7; }
.student-profile-address-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; grid-column:1/-1; }
.student-profile-address form { grid-template-columns:minmax(0,1fr) auto; }
.student-profile-security-note { color:var(--muted); font-size:10px; }

/* A refined royal-white light palette; dark palette is retained above. */
:root:not([data-theme="dark"]) {
  color-scheme:light;
  --background:#F4F6FC;
  --surface:#FFFFFF;
  --blue:#2847B8;
  --blue-dark:#1D347F;
  --blue-soft:#EEF2FF;
  --navy:#19294B;
  --text:#3F4C68;
  --muted:#71809B;
  --line:#DFE5F0;
  --green:#087B5A;
  --green-soft:#EAF7F1;
  --amber:#8A5B00;
  --amber-soft:#FFF6DE;
  --shadow:0 7px 22px rgba(30,48,91,.055);
}
:root:not([data-theme="dark"]) body { background:linear-gradient(145deg,#F7F8FC,#EEF2FA); }
:root:not([data-theme="dark"]) .topbar,
:root:not([data-theme="dark"]) .subnav,
:root:not([data-theme="dark"]) .academy-sidebar { background:#FFFFFF; }
:root:not([data-theme="dark"]) .btn { background:linear-gradient(110deg,#2847B8,#4D62C7); box-shadow:0 5px 13px rgba(40,71,184,.13); }
:root:not([data-theme="dark"]) .btn:hover { background:linear-gradient(110deg,#1D347F,#3B50AA); }
:root:not([data-theme="dark"]) .logo { background:linear-gradient(135deg,#1D347F,#4762C7); }
:root:not([data-theme="dark"]) .student-profile-card,
:root:not([data-theme="dark"]) .student-upcoming-panel,
:root:not([data-theme="dark"]) .student-performance-aside { border-color:#DFE5F0; }
:root[data-theme="dark"] .student-profile-card,
:root[data-theme="dark"] .student-upcoming-panel,
:root[data-theme="dark"] .student-performance-aside { background:#101216; border-color:var(--line); color:var(--text); }
:root[data-theme="dark"] .student-profile-edit { background:#191522; border-color:#382442; color:#F0ABFC; }
:root[data-theme="dark"] .student-profile-avatar { background:linear-gradient(145deg,#24152E,#17213B); border-color:#42304B; color:#E6B5F3; }
:root[data-theme="dark"] .student-upcoming-item.featured { background:linear-gradient(100deg,rgba(244,63,142,.1),transparent 75%); }
:root[data-theme="dark"] .student-upcoming-date { background:#17191F; }
:root[data-theme="dark"] .student-upcoming-icon { background:linear-gradient(140deg,#F43F8E,#7641D9); }
:root[data-theme="dark"] .student-side-meter::before { background:#101216; }
:root[data-theme="dark"] .student-profile-card.editing { border-color:#8D60A5; box-shadow:0 0 0 3px rgba(217,70,239,.1); }

@media (max-width: 920px) {
  .student-home-grid { grid-template-columns:minmax(0,1fr) 290px; }
  .student-upcoming-item { grid-template-columns:48px 38px minmax(0,1fr); }
  .student-upcoming-actions { grid-column:3; }
}
@media (max-width: 760px) {
  .student-home-grid { grid-template-columns:1fr; }
  .student-performance-aside { position:static; }
  .student-upcoming-item { grid-template-columns:48px 38px minmax(0,1fr) auto; }
  .student-upcoming-actions { grid-column:auto; }
}
@media (max-width: 600px) {
  .student-profile-grid { grid-template-columns:1fr; }
  .student-profile-section-heading { align-items:flex-start; flex-direction:column; }
  .student-profile-card form { grid-template-columns:1fr; }
  .student-profile-card-actions { justify-content:flex-end; }
  .student-profile-address-fields { grid-template-columns:1fr; }
  .student-upcoming-item { grid-template-columns:45px 34px minmax(0,1fr); gap:9px; padding:14px 12px; }
  .student-upcoming-actions { grid-column:2/-1; }
  .student-upcoming-heading { align-items:flex-start; flex-direction:column; padding:16px; }
  .student-performance-aside { padding:16px 14px; }
  .student-side-performance-row { grid-template-columns:minmax(0,1fr) 48px 40px; }
}
.access-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 130px;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.access-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-row input {
  accent-color: var(--blue);
}

@media (max-width: 600px) {
  .access-row {
    grid-template-columns: 1fr 1fr;
  }

  .access-row strong {
    grid-column: 1 / -1;
  }
}



    /* Subtle dashboard motion. The theme variables remain in control of colors. */
    @media (prefers-reduced-motion: no-preference) {
      @keyframes codrax-ambient-drift {
        0% { transform: translate3d(-1.5%, -1%, 0) scale(1); }
        100% { transform: translate3d(1.5%, 1%, 0) scale(1.06); }
      }

      @keyframes codrax-dashboard-enter {
        from { opacity: 0; transform: translateY(9px); }
        to { opacity: 1; transform: translateY(0); }
      }

      body {
        position: relative;
        isolation: isolate;
      }

      body::before {
        content: "";
        position: fixed;
        inset: -16%;
        z-index: -1;
        pointer-events: none;
        opacity: .38;
        background:
          radial-gradient(ellipse at 18% 22%, rgba(37, 99, 235, .14), transparent 34%),
          radial-gradient(ellipse at 82% 76%, rgba(20, 184, 166, .09), transparent 32%);
        animation: codrax-ambient-drift 22s ease-in-out infinite alternate;
        will-change: transform;
      }

      :root[data-theme="dark"] body::before {
        opacity: .62;
        background:
          radial-gradient(ellipse at 18% 22%, rgba(37, 99, 235, .22), transparent 36%),
          radial-gradient(ellipse at 82% 76%, rgba(20, 184, 166, .13), transparent 34%);
      }

      main > * {
        animation: codrax-dashboard-enter .42s ease-out both;
      }

      main > *:nth-child(2) { animation-delay: .04s; }
      main > *:nth-child(3) { animation-delay: .08s; }
      main > *:nth-child(4) { animation-delay: .12s; }
      main > *:nth-child(5) { animation-delay: .16s; }

      .stat-box,
      .next-class,
      .welcome-small,
      .upcoming-lesson,
      .calendar-item,
      .curriculum-module {
        transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
      }

      .stat-box:hover,
      .next-class:hover,
      .welcome-small:hover,
      .upcoming-lesson:hover,
      .calendar-item:hover,
      .curriculum-module:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(23, 43, 77, .10);
        border-color: color-mix(in srgb, var(--blue) 32%, var(--line));
      }

      :root[data-theme="dark"] .stat-box:hover,
      :root[data-theme="dark"] .next-class:hover,
      :root[data-theme="dark"] .welcome-small:hover,
      :root[data-theme="dark"] .upcoming-lesson:hover,
      :root[data-theme="dark"] .calendar-item:hover,
      :root[data-theme="dark"] .curriculum-module:hover {
        box-shadow: 0 14px 32px rgba(0, 0, 0, .28);
      }

      .top-chip,
      .icon-btn,
      .academy-sidebar > button,
      .subnav button,
      .btn {
        transition: transform .18s ease, background-color .2s ease,
                    color .2s ease, border-color .2s ease, box-shadow .2s ease;
      }

      .top-chip:hover,
      .academy-sidebar > button:hover,
      .subnav button:hover {
        transform: translateY(-1px);
      }

      .btn:hover { box-shadow: 0 7px 18px rgba(37, 99, 235, .18); }
      .icon-btn:hover { transform: scale(1.06); }
      .theme-toggle:active { transform: scale(.97); }
    }

    /* Admin workspace additions */
    .admin-metric-grid,
    .admin-session-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 16px;
      margin: 18px 0 25px;
    }

    .admin-metric {
      padding: 20px;
      background: white;
      border: 1px solid var(--line);
      border-radius: var(--radius);
    }

    .admin-metric span { display: block; color: var(--muted); font-size: 11px; }
    .admin-metric strong { display: block; margin-top: 7px; color: var(--navy); font-size: 27px; }
    .admin-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 16px 0; }
    .admin-filters .field { min-width: 180px; margin: 0; }
    .student-performance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0 25px; }
    .student-performance-card { padding: 20px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
    .student-performance-card h3 { margin: 0 0 3px; }
    .student-performance-card .student-meta { color: var(--muted); font-size: 11px; }
    .student-performance-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
    .student-performance-stats div { padding: 11px; border-radius: 10px; background: #F8FAFC; }
    .student-performance-stats small { display: block; font-size: 10px; }
    .student-performance-stats strong { color: var(--navy); font-size: 16px; }
    .admin-segmented { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
    .admin-segmented button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--text); font-size: 12px; font-weight: 650; }
    .admin-segmented button.active { border-color: #BFDBFE; background: var(--blue-soft); color: var(--blue-dark); }
    .admin-session-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-session-card { padding: 19px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
    .admin-session-card h3 { margin: 0 0 5px; }
    .admin-session-card p { margin: 4px 0; font-size: 12px; }
    .admin-session-card .field { margin: 10px 0; }
    .admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
    .admin-table { width: 100%; border-collapse: collapse; min-width: 620px; background: white; }
    .admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
    .admin-table th { background: #F8FAFC; color: var(--muted); font-size: 10px; letter-spacing: .4px; text-transform: uppercase; }
    .admin-table tr:last-child td { border-bottom: 0; }
    .bulk-assignment-fields { display: grid; gap: 12px; }
    .bulk-assignment-item { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #FAFCFF; }
    .admin-subsection { margin-top: 24px; }

    :root[data-theme="dark"] .admin-metric,
    :root[data-theme="dark"] .student-performance-card,
    :root[data-theme="dark"] .admin-session-card,
    :root[data-theme="dark"] .admin-segmented button,
    :root[data-theme="dark"] .admin-table,
    :root[data-theme="dark"] .bulk-assignment-item { background: var(--surface); color: var(--text); border-color: var(--line); }
    :root[data-theme="dark"] .student-performance-stats div,
    :root[data-theme="dark"] .admin-table th { background: #172438; }

    @media (max-width: 900px) {
      .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .student-performance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 600px) {
      .admin-metric-grid, .student-performance-grid, .admin-session-grid { grid-template-columns: 1fr; }
      .admin-filters { align-items: stretch; flex-direction: column; }
      .admin-filters .field { min-width: 0; }
    }

/* Codrax premium dark palette: deep charcoal surfaces with bright, varied accents. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #08090D;
  --surface: #101216;
  --blue: #4F8CFF;
  --blue-dark: #77A7FF;
  --blue-soft: #172033;
  --navy: #F4F6FB;
  --text: #D0D4DE;
  --muted: #9096A4;
  --line: #2A2D34;
  --green: #45D483;
  --green-soft: #14291F;
  --amber: #FFC247;
  --amber-soft: #302510;
  --shadow: 0 12px 38px rgba(0, 0, 0, .26);
  --accent-pink: #FF3FA4;
  --accent-red: #F43F5E;
  --accent-blue: #3B82F6;
  --accent-green: #22C55E;
  --accent-violet: #A855F7;
  --accent-orange: #F97316;
  --accent-yellow: #EAB308;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 2% 0%, rgba(236, 72, 153, .11), transparent 26%),
    radial-gradient(ellipse at 96% 16%, rgba(59, 130, 246, .09), transparent 24%),
    #08090D;
  color: var(--text);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .subnav,
:root[data-theme="dark"] .academy-sidebar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .stat-box,
:root[data-theme="dark"] .next-class,
:root[data-theme="dark"] .welcome-small,
:root[data-theme="dark"] .quick-support,
:root[data-theme="dark"] .home-updates,
:root[data-theme="dark"] .assignment-row,
:root[data-theme="dark"] .problem,
:root[data-theme="dark"] .calendar-item,
:root[data-theme="dark"] .upcoming-lesson,
:root[data-theme="dark"] .curriculum-module,
:root[data-theme="dark"] .curriculum-summary,
:root[data-theme="dark"] .lesson-summary,
:root[data-theme="dark"] .curriculum-batch,
:root[data-theme="dark"] .schedule-date,
:root[data-theme="dark"] .info,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .recording-placeholder,
:root[data-theme="dark"] .admin-class,
:root[data-theme="dark"] .admin-metric,
:root[data-theme="dark"] .student-performance-card,
:root[data-theme="dark"] .admin-session-card,
:root[data-theme="dark"] .admin-table,
:root[data-theme="dark"] .bulk-assignment-item,
:root[data-theme="dark"] .drawer,
:root[data-theme="dark"] .chat {
  background-color: #101216;
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] .demo-note,
:root[data-theme="dark"] .panel-heading,
:root[data-theme="dark"] .updates-heading,
:root[data-theme="dark"] .curriculum-module > summary,
:root[data-theme="dark"] .assignment-row[open] > summary,
:root[data-theme="dark"] .student-performance-stats div,
:root[data-theme="dark"] .admin-table th,
:root[data-theme="dark"] .lesson-summary > div,
:root[data-theme="dark"] .schedule-date,
:root[data-theme="dark"] .module-number,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .info,
:root[data-theme="dark"] .recording-placeholder,
:root[data-theme="dark"] .btn.gray,
:root[data-theme="dark"] .label,
:root[data-theme="dark"] .schedule-status,
:root[data-theme="dark"] .calendar-date {
  background-color: #17191F;
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] pre {
  background-color: #0B0D11;
  color: #E7EAF0;
  border-color: #343842;
}

:root[data-theme="dark"] .logo {
  background: linear-gradient(135deg, #F43F5E, #D946EF 58%, #7C3AED);
  box-shadow: 0 5px 18px rgba(217, 70, 239, .28);
}

:root[data-theme="dark"] .btn {
  background: linear-gradient(110deg, #F43F8E, #C026D3);
  color: white;
  box-shadow: 0 5px 16px rgba(217, 70, 239, .16);
}

:root[data-theme="dark"] .btn:hover {
  background: linear-gradient(110deg, #FB68A7, #D946EF);
  color: white;
  box-shadow: 0 7px 22px rgba(217, 70, 239, .28);
}

:root[data-theme="dark"] .btn.light {
  background: #191522;
  border-color: #382442;
  color: #F0ABFC;
  box-shadow: none;
}

:root[data-theme="dark"] .btn.gray {
  background: #1A1C22;
  color: #D1D5DE;
}

:root[data-theme="dark"] .top-chip,
:root[data-theme="dark"] .menu-link,
:root[data-theme="dark"] .academy-sidebar > button,
:root[data-theme="dark"] .calendar-item,
:root[data-theme="dark"] .subnav button,
:root[data-theme="dark"] .class-tabs button {
  color: #B9BFCC;
}

:root[data-theme="dark"] .menu-link:hover,
:root[data-theme="dark"] .menu-link.active,
:root[data-theme="dark"] .academy-sidebar > button.active,
:root[data-theme="dark"] .calendar-item.selected,
:root[data-theme="dark"] .subnav button.active,
:root[data-theme="dark"] .class-tabs button.active {
  color: #FF76C2;
  background-color: #211322;
  border-color: #63304F;
}

:root[data-theme="dark"] .subnav button.active,
:root[data-theme="dark"] .class-tabs button.active {
  background: transparent;
  border-bottom-color: #F43F8E;
}

:root[data-theme="dark"] .academy-sidebar > button.active {
  box-shadow: inset 3px 0 #F43F8E;
}

:root[data-theme="dark"] .kicker,
:root[data-theme="dark"] a,
:root[data-theme="dark"] .stat-top .ui-icon {
  color: #79A9FF;
}

:root[data-theme="dark"] .active-status,
:root[data-theme="dark"] .label.green,
:root[data-theme="dark"] .schedule-status.completed {
  color: #58E092;
}

:root[data-theme="dark"] .label.orange,
:root[data-theme="dark"] .schedule-status.pending,
:root[data-theme="dark"] .schedule-status.today,
:root[data-theme="dark"] .schedule-status.upcoming {
  background: #302510;
  color: #FFC247;
}

:root[data-theme="dark"] .streak-chip {
  color: #FFC274;
  background: #291B12;
  border-color: #59351D;
}

:root[data-theme="dark"] .streak-chip .ui-icon { color: #FF8A3D; }
:root[data-theme="dark"] .stat-box:nth-child(6n + 1) { border-top: 2px solid var(--accent-pink); }
:root[data-theme="dark"] .stat-box:nth-child(6n + 2) { border-top: 2px solid var(--accent-blue); }
:root[data-theme="dark"] .stat-box:nth-child(6n + 3) { border-top: 2px solid var(--accent-green); }
:root[data-theme="dark"] .stat-box:nth-child(6n + 4) { border-top: 2px solid var(--accent-violet); }
:root[data-theme="dark"] .stat-box:nth-child(6n + 5) { border-top: 2px solid var(--accent-orange); }
:root[data-theme="dark"] .stat-box:nth-child(6n + 6) { border-top: 2px solid var(--accent-yellow); }
:root[data-theme="dark"] .admin-metric:nth-child(6n + 1) { border-left: 3px solid var(--accent-pink); }
:root[data-theme="dark"] .admin-metric:nth-child(6n + 2) { border-left: 3px solid var(--accent-blue); }
:root[data-theme="dark"] .admin-metric:nth-child(6n + 3) { border-left: 3px solid var(--accent-green); }
:root[data-theme="dark"] .admin-metric:nth-child(6n + 4) { border-left: 3px solid var(--accent-violet); }
:root[data-theme="dark"] .admin-metric:nth-child(6n + 5) { border-left: 3px solid var(--accent-orange); }
:root[data-theme="dark"] .admin-metric:nth-child(6n + 6) { border-left: 3px solid var(--accent-yellow); }

:root[data-theme="dark"] progress { background: #292D35; }
:root[data-theme="dark"] progress::-webkit-progress-bar { background: #292D35; }
:root[data-theme="dark"] progress::-webkit-progress-value { background: linear-gradient(90deg, #F43F8E, #A855F7, #3B82F6); }
:root[data-theme="dark"] progress::-moz-progress-bar { background: linear-gradient(90deg, #F43F8E, #A855F7, #3B82F6); }
:root[data-theme="dark"] .toast { background: #171922; border: 1px solid #3A3D49; box-shadow: 0 10px 35px rgba(0, 0, 0, .38); }
:root[data-theme="dark"] .chat-header { background: linear-gradient(110deg, #211322, #111827); }
:root[data-theme="dark"] .chat-log p { background: #1A1D25; color: #D0D4DE; }
:root[data-theme="dark"] .chat-log .user { background: #21172A; color: #F2D8F4; }
:root[data-theme="dark"] .curriculum-summary > div,
:root[data-theme="dark"] .lesson-summary > div { border-color: var(--line); }
:root[data-theme="dark"] .schedule-date strong,
:root[data-theme="dark"] .calendar-date strong { color: #F4F6FB; }
:root[data-theme="dark"] .empty { border-color: #383B46; color: #A5ABBA; }

@media (prefers-reduced-motion: no-preference) {
  :root[data-theme="dark"] .panel,
  :root[data-theme="dark"] .stat-box,
  :root[data-theme="dark"] .admin-metric,
  :root[data-theme="dark"] .student-performance-card,
  :root[data-theme="dark"] .admin-session-card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, .17);
  }
}

/* Light mode: restrained royal navy, quiet blue-gray canvas, and high-contrast content. */
:root[data-theme="light"] {
  color-scheme: light;
  --background: #F2F4F8;
  --surface: #FFFFFF;
  --blue: #35527C;
  --blue-dark: #243B60;
  --blue-soft: #EDF1F7;
  --navy: #17283F;
  --text: #344256;
  --muted: #66758A;
  --line: #DFE4EB;
  --green: #08744F;
  --green-soft: #E7F7EF;
  --amber: #805300;
  --amber-soft: #FFF4D6;
  --shadow: 0 8px 24px rgba(28, 43, 65, .06);
}

:root[data-theme="light"] body {
  background: linear-gradient(135deg, #F4F5F8 0%, #E9EDF3 52%, #F3F4F7 100%);
  color: #344256;
}

:root[data-theme="light"] .topbar,
:root[data-theme="light"] .subnav,
:root[data-theme="light"] .academy-sidebar {
  background: linear-gradient(115deg, #17283F, #243B60 58%, #304A70);
  color: #FFFFFF;
  border-color: #405A7B;
}

:root[data-theme="light"] .brand,
:root[data-theme="light"] .brand b,
:root[data-theme="light"] .brand small,
:root[data-theme="light"] .course-state,
:root[data-theme="light"] .course-state small,
:root[data-theme="light"] .topbar .icon-btn,
:root[data-theme="light"] .topbar .top-chip,
:root[data-theme="light"] .topbar .streak-chip,
:root[data-theme="light"] .subnav button,
:root[data-theme="light"] .academy-sidebar > button,
:root[data-theme="light"] .sidebar-caption,
:root[data-theme="light"] .sidebar-bottom,
:root[data-theme="light"] .sidebar-bottom p {
  color: #FFFFFF;
}

:root[data-theme="light"] .active-status { color: #A7F3D0; }
:root[data-theme="light"] .topbar .course-state { border-color: rgba(255,255,255,.24); }
:root[data-theme="light"] .topbar .icon-btn:hover,
:root[data-theme="light"] .topbar .top-chip:hover,
:root[data-theme="light"] .academy-sidebar > button:hover,
:root[data-theme="light"] .academy-sidebar > button.active {
  background: rgba(255,255,255,.16);
  color: #FFFFFF;
}
:root[data-theme="light"] .topbar .top-chip,
:root[data-theme="light"] .topbar .streak-chip {
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.10);
}
:root[data-theme="light"] .topbar .streak-chip { color: #F3D98B; }
:root[data-theme="light"] .topbar .streak-chip .ui-icon { color: #E8C768; }
:root[data-theme="light"] .subnav button.active {
  color: #FFFFFF;
  border-bottom-color: #E8C768;
}
:root[data-theme="light"] .academy-sidebar .logo,
:root[data-theme="light"] .topbar .logo {
  background: linear-gradient(135deg, #FFFFFF, #DCE8FF);
  color: #243B60;
  box-shadow: 0 4px 14px rgba(5, 22, 72, .2);
}

:root[data-theme="light"] .demo-note {
  background: #F7F8FA;
  color: #536176;
  border-color: #DFE4EB;
}

:root[data-theme="light"] main { color: #263653; }
:root[data-theme="light"] .panel,
:root[data-theme="light"] .stat-box,
:root[data-theme="light"] .next-class,
:root[data-theme="light"] .welcome-small,
:root[data-theme="light"] .assignment-row,
:root[data-theme="light"] .curriculum-module,
:root[data-theme="light"] .student-profile-card,
:root[data-theme="light"] .student-upcoming-panel,
:root[data-theme="light"] .student-performance-aside,
:root[data-theme="light"] .student-performance-card,
:root[data-theme="light"] .admin-session-card,
:root[data-theme="light"] .admin-metric {
  background-color: #FFFFFF;
  color: #263653;
  border-color: #DFE4EB;
}
:root[data-theme="light"] .btn {
  background: linear-gradient(110deg, #2F496B, #3D5B82);
  color: #FFFFFF;
}
:root[data-theme="light"] .btn.light {
  background: #EEF1F6;
  color: #293F61;
  border-color: #D8DFE9;
  box-shadow: none;
}
:root[data-theme="light"] .btn.gray {
  background: #EEF2F8;
  color: #263653;
  border-color: #D4DEEC;
}
:root[data-theme="light"] .student-module-open {
  background: #F6F7F9;
  color: #293F61;
  border-color: #DFE4EB;
}
:root[data-theme="light"] .student-module-status.available {
  color: #08744F;
  background: #E7F7EF;
  border-color: #B8E5D0;
}
:root[data-theme="light"] .student-module-card > small,
:root[data-theme="light"] .student-lesson-day strong,
:root[data-theme="light"] .student-lesson-chevron,
:root[data-theme="light"] .student-performance-mini-title > span,
:root[data-theme="light"] .student-recording-nav > span:first-child {
  color: #35527C;
}
:root[data-theme="light"] .student-lesson-day em { color: #9F174D; }
:root[data-theme="light"] .student-lesson-metric strong { color: #A31D52; }
:root[data-theme="light"] .student-assignment-list-head {
  background: #F0F3F7;
  color: #45566D;
}
:root[data-theme="light"] .student-recording-nav.active {
  background: #EEF2F7;
  border-color: #C7D1DF;
}
:root[data-theme="light"] .student-recording-nav.active strong { color: #243B60; }
:root[data-theme="light"] .student-classroom-tabs button.active {
  border-color: #35527C;
  color: #2B466D;
}
:root[data-theme="light"] .student-performance-mini-title > span {
  background: #EEF2F7;
}
:root[data-theme="light"] .student-mini-metric { background: #F7F9FF; }
:root[data-theme="light"] .student-calendar-date {
  background: #EEF2F7;
  color: #45566D;
}
:root[data-theme="light"] .student-calendar-date strong { color: #10234B; }
:root[data-theme="light"] .student-ring::before { background: #FFFFFF; }
:root[data-theme="light"] .student-side-meter::before { background: #FFFFFF; }
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background: #FFFFFF;
  color: #172B4D;
  border-color: #C9D2DF;
}
:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder { color: #70819C; opacity: 1; }
:root[data-theme="light"] a { color: #2F527E; }
:root[data-theme="light"] .student-profile-edit {
  background: #EEF2F7;
  border-color: #D1D9E4;
  color: #293F61;
}
:root[data-theme="light"] .student-profile-edit:hover { background: #E2E8F0; }
:root[data-theme="light"] .student-video-card {
  border-color: #C8D3E1;
  background: linear-gradient(115deg, #314B6D, #263B58 58%, #202F45);
}
:root[data-theme="light"] .student-video-glow {
  background: rgba(136, 165, 206, .24);
}
:root[data-theme="light"] .student-video-icon {
  background: linear-gradient(140deg, #60799D, #3A557A);
  box-shadow: 0 7px 20px rgba(19, 36, 60, .22);
}
:root[data-theme="light"] .student-video-caption small { color: #D5DFED; }
:root[data-theme="light"] .student-video-label { color: #E8D49A; }
:root[data-theme="light"] .student-module-card.active {
  border-color: #7389A8;
  box-shadow: inset 0 0 0 1px rgba(53, 82, 124, .14), 0 7px 20px rgba(28, 43, 65, .07);
}
:root[data-theme="light"] .student-module-card.active .student-module-open {
  background: linear-gradient(100deg, #35527C, #496487);
  color: #FFFFFF;
}
:root[data-theme="light"] .student-mini-metric.accent-yellow { border-top-color: #B88A21; }
:root[data-theme="light"] .student-mini-metric.accent-pink { border-top-color: #7589A8; }
:root[data-theme="light"] .student-mini-metric.accent-orange { border-top-color: #B77A4D; }
:root[data-theme="light"] .student-mini-metric.accent-violet { border-top-color: #777A9E; }
:root[data-theme="light"] .student-performance-hero {
  background: linear-gradient(115deg, #F8FAFC, #EEF2F7);
}
:root[data-theme="light"] .student-ring { --ring-color: #526F96; }
:root[data-theme="light"] .student-ring.accent-yellow { --ring-color: #C49A35; }
:root[data-theme="light"] .student-ring.accent-pink { --ring-color: #667EA1; }
:root[data-theme="light"] .student-performance-detail.accent-pink { border-top-color: #7589A8; }
:root[data-theme="light"] .student-performance-detail.accent-orange { border-top-color: #B77A4D; }
:root[data-theme="light"] .student-performance-detail.accent-violet { border-top-color: #777A9E; }
:root[data-theme="light"] .student-performance-detail.accent-blue { border-top-color: #526F96; }
:root[data-theme="light"] .student-recording-art {
  border-color: #C8D3E1;
  background: linear-gradient(120deg, #E8EDF4, #E2E9F2 60%, #EDF1F6);
}
:root[data-theme="light"] .student-recording-art::after {
  background: linear-gradient(90deg, rgba(82,111,150,.18), rgba(196,154,53,.12));
}
:root[data-theme="light"] .student-recording-art-title,
:root[data-theme="light"] .student-recording-art-title strong { color: #20334E; }
:root[data-theme="light"] .student-recording-progress {
  background: linear-gradient(90deg, #526F96, #8294AE, #C49A35);
}
:root[data-theme="light"] .student-upcoming-icon {
  background: linear-gradient(140deg, #526F96, #344E73);
  box-shadow: 0 5px 14px rgba(28, 43, 65, .14);
}
:root[data-theme="light"] .student-performance-aside-heading > span,
:root[data-theme="light"] .student-performance-aside-intro strong { color: #35527C; }
:root[data-theme="light"] .student-side-meter { --meter-color: #C49A35; }
:root[data-theme="light"] .student-side-meter.accent-orange { --meter-color: #B77A4D; }
:root[data-theme="light"] .student-side-streak { color: #96721F; }
:root[data-theme="light"] .student-side-streak.accent-orange { color: #9D613C; }

.dashboard-overview-widgets {
  display: grid;
  grid-template-columns: minmax(270px, .9fr) minmax(300px, 1.1fr);
  gap: 18px;
  margin: 20px 0;
  align-items: start;
}

.overview-widget {
  min-width: 0;
  padding: 18px;
}

.overview-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.overview-widget-head h2 { margin: 4px 0 0; font-size: 16px; }
.overview-widget-head .kicker { color: var(--muted); font-size: 9px; font-weight: 800; }

.overview-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(24px, 1fr));
  gap: 5px;
  text-align: center;
}

.overview-calendar-grid > span {
  display: grid;
  place-items: center;
  min-height: 32px;
  font-size: 11px;
}

.overview-calendar-grid .weekday { color: var(--muted); font-size: 9px; font-weight: 700; }
.overview-calendar-grid .calendar-day { position: relative; border-radius: 9px; }
.overview-calendar-grid .calendar-day.today { background: var(--blue); color: white; font-weight: 800; }
.overview-calendar-grid .calendar-day.has-event::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #C49A35;
}

.overview-widget-stack { display: grid; gap: 14px; }

.overview-agenda-item,
.overview-reminder {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 2px;
  border-top: 1px solid var(--line);
}

.overview-agenda-item time { width: 55px; color: var(--muted); font-size: 10px; font-weight: 700; }
.overview-agenda-item strong,
.overview-agenda-item small,
.overview-reminder strong,
.overview-reminder small { display: block; }
.overview-agenda-item small,
.overview-reminder small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.overview-reminder {
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.overview-reminder > span:nth-child(2) { flex: 1; }

.overview-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.overview-donut-wrap { display: flex; align-items: center; gap: 18px; min-height: 145px; }
.overview-donut {
  position: relative;
  display: flex;
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: conic-gradient(#3573E8 0 var(--submitted), var(--line) var(--submitted) 100%);
}
.overview-donut::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--surface);
}
.overview-donut strong,
.overview-donut small { position: relative; z-index: 1; }
.overview-donut strong { font-size: 23px; }
.overview-donut small { color: var(--muted); font-size: 10px; }
.overview-legend { flex: 1; color: var(--muted); font-size: 10px; }
.overview-legend p { display: flex; justify-content: space-between; gap: 10px; }
.overview-legend b { color: var(--text); }

.overview-chart-legend { display: flex; justify-content: flex-end; gap: 14px; color: var(--muted); font-size: 9px; }
.legend-blue,
.legend-violet { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; background: #3573E8; }
.legend-violet { background: #8A72CE; }

.overview-bar-chart {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  min-height: 150px;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
}

.overview-bar-group { display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: flex-end; text-align: center; }
.overview-bars { display: flex; height: 110px; align-items: flex-end; justify-content: center; gap: 5px; }
.overview-bars .bar { width: 22px; min-height: 3px; border-radius: 4px 4px 0 0; background: #3573E8; }
.overview-bars .completion-bar { background: #8A72CE; }
.overview-bar-group small { overflow: hidden; padding: 7px 1px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .dashboard-overview-widgets,
  .overview-chart-grid { grid-template-columns: 1fr; }

  .stat-box-link {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stat-box-link:hover > span:last-child,
.stat-box-link:focus-visible > span:last-child {
  text-decoration: underline;
}

.stat-box-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
}