:root {
  --ink: #1e293b;
  --muted: #64748b;
  --paper: #f6f4ee;
  --panel: #ffffff;
  --line: #e6e2d8;
  --navy: #163a5f;
  --accent: #e8804f;
  --sidebar: #163a5f;
  --sidebar-text: #edf6fa;
}

.dark {
  --ink: #e8edf2;
  --muted: #a7b3c3;
  --paper: #101820;
  --panel: #18232e;
  --line: #2a3a49;
  --navy: #8fc5ee;
  --accent: #f09a6c;
  --sidebar: #0f1a24;
  --sidebar-text: #edf6fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.brand-mark .icon {
  width: 21px;
  height: 21px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 280px;
  flex: none;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 25px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 11px;
}

.nav-button {
  width: 100%;
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 10px;
  color: #d7e5ef;
  background: transparent;
  border: 0;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.nav-block {
  margin-top: 28px;
}

.nav-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.course-nav {
  border-left: 2px solid rgba(255, 255, 255, 0.16);
  margin: 0 0 12px 12px;
  padding-left: 9px;
}

.course-nav button {
  color: #c9d8e3;
  font-size: 13px;
  width: 100%;
  padding: 7px;
  border: 0;
  text-align: left;
  background: transparent;
  border-radius: 7px;
}

.course-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main-area {
  width: 100%;
  min-width: 0;
  padding: 28px;
}

.page-wrap {
  max-width: 1250px;
  margin: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 36rem;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 12px;
  color: #94a3b8;
  pointer-events: none;
}

.search-field {
  padding-left: 38px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
}

h3 {
  font-size: 1.15rem;
  margin-top: 16px;
}

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

.small {
  font-size: 0.85rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 8px 24px rgba(25, 47, 66, 0.04);
}

.hero {
  padding: 30px;
  background: linear-gradient(125deg, #163a5f 0%, #24547c 63%, #e8804f 160%);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.hero p {
  max-width: 42rem;
  margin: 12px 0 0;
  color: #dbeafe;
}

.hero h1 {
  margin-top: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.stat {
  padding: 17px;
}

.stat strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  margin-top: 6px;
}

.stat .muted {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 14px;
}

.section-head.tight {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.course-card {
  padding: 19px;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  border-top: 5px solid var(--course-color, #e8804f);
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(25, 47, 66, 0.1);
}

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

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 15px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-soft {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-danger {
  color: #bd3a35;
  background: #fff0ef;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
}

.small-btn {
  font-size: 0.875rem;
}

.progress {
  height: 7px;
  background: rgba(100, 116, 139, 0.17);
  border-radius: 99px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.progress-block {
  margin-top: 12px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.breadcrumb button {
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0;
  font-weight: 700;
}

.toolbar {
  padding: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.field {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
  width: 100%;
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 128, 79, 0.16);
}

.field.narrow {
  max-width: 16rem;
}

.class-row {
  padding: 16px;
  display: grid;
  grid-template-columns: 58px 1fr 145px auto;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.class-open {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.folder {
  width: 48px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: #fff1e9;
  border-radius: 10px;
}

.dark .folder {
  background: #2a241f;
}

.tag {
  display: inline-block;
  margin: 3px 4px 0 0;
  background: #edf1f4;
  color: #486174;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
}

.dark .tag {
  background: #273a49;
  color: #c5d7e4;
}

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

.notes {
  min-height: 410px;
  resize: vertical;
  line-height: 1.65;
}

.pad {
  padding: 20px;
}

.side-block {
  padding: 18px;
  margin-bottom: 14px;
}

.task-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child {
  border: 0;
}

.done {
  text-decoration: line-through;
  color: var(--muted);
}

.image-card {
  border: 1px dashed var(--line);
  padding: 11px;
  border-radius: 11px;
  margin-top: 8px;
}

.image-card img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12, 24, 36, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(590px, 100%);
  max-height: 90%;
  overflow: auto;
  padding: 23px;
}

.modal label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin: 14px 0 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  background: #173d36;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.search-results {
  position: absolute;
  z-index: 20;
  top: 47px;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.search-results button {
  width: 100%;
  text-align: left;
  padding: 11px;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.search-results button:hover {
  background: rgba(232, 128, 79, 0.1);
}

.empty {
  padding: 32px;
}

.row-actions {
  display: flex;
  gap: 4px;
}

.time-row,
.inline-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.grow {
  flex: 1;
}

.course-banner {
  padding: 24px;
  border-left: 8px solid var(--accent);
}

.course-banner-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.course-progress {
  min-width: 160px;
}

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

.recent-row {
  width: 100%;
  text-align: left;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.range {
  width: 100%;
  margin-top: 12px;
}

.color-field {
  height: 48px;
  padding: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.menu-btn {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 20;
}

@media (max-width: 850px) {
  .menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    z-index: 25;
    left: 0;
    transform: translateX(-100%);
    transition: 0.25s;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.22);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    padding: 18px;
  }

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

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

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

  .class-row {
    grid-template-columns: 48px 1fr;
  }

  .class-row > :nth-child(3),
  .class-row > :nth-child(4) {
    grid-column: 2;
  }

  .topbar .btn-accent {
    display: none;
  }
}
