:root {
  --navy: #0f375e;
  --blue: #0f375e;
  --teal: #e87c1a;
  --pale: #fff3e8;
  --ink: #0f375e;
  --muted: #617181;
  --line: #d9e1e7;
}

body {
  background: #f7f8fa;
}

header {
  background: #0f375e;
}

#coursesView .hero,
#adminView .hero {
  border: 1px solid #d9e3ec;
  border-left: 5px solid #e87c1a;
  background: linear-gradient(120deg, #eaf1f7, #fff3e8);
}

.tabs button {
  border: 1px solid #c7d3dc;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #eee;
}

.tabs button.active {
  background: #fff;
  color: #0f375e;
}

.modal .tabs button {
  flex: 1;
}

.primary {
  background: #0f375e;
}

.primary:hover {
  background: #092b4a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #e87c1a;
  outline: 3px solid rgba(232, 124, 26, .18);
}

body .course-card:hover,
body .user-row:hover,
body .lesson-admin-row:hover {
  border-color: #e2a36d;
}

#authOverlay {
  background: #000;
}

#authOverlay .modal.auth {
  padding: 22px 28px;
}

.brand-logo {
  display: block;
  object-fit: cover;
  border-radius: 999px;
}

.header-logo {
  width: 190px;
  height: 50px;
}

.auth-logo {
  width: min(280px, 88%);
  height: auto;
  margin: 0 auto;
}

#authOverlay .modal.auth > h2 {
  margin: 8px 0 12px;
  font-size: 23px;
  line-height: 1.2;
}

#authOverlay .tabs {
  margin-bottom: 12px;
}

#authOverlay .modal label {
  margin: 9px 0;
}

#authOverlay .error {
  margin: 5px 0;
  min-height: 18px;
}

#authOverlay .auth-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #a9d5c9;
  border-radius: 8px;
  background: #edf8f4;
  color: #176451;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

#authOverlay .modal form > .primary {
  margin-top: 4px;
}

.auth-text-button {
  display: block;
  margin: 14px auto 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 650;
}

.auth-text-button:hover {
  text-decoration: underline;
}

.modal.auth form > h3 {
  margin: 4px 0 6px;
  text-align: center;
}

#coursesView .hero,
#adminView .hero {
  padding: 18px 24px;
  margin-bottom: 14px;
}

#coursesView .hero h2,
#adminView .hero h2 {
  margin: 0;
  font-size: 26px;
}

.mark svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.mark.large svg {
  width: 43px;
  height: 43px;
}

nav .icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #e8f5f7;
  transition: background .15s, transform .1s;
}

nav .icon-btn:hover {
  background: rgba(255, 255, 255, .18);
}

nav .icon-btn:active {
  transform: scale(.96);
}

nav .icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

nav .icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 10;
  top: calc(100% + 9px);
  left: 50%;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  background: #102a43;
  box-shadow: 0 5px 14px rgba(9, 24, 38, .28);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity .15s, transform .15s;
}

nav .icon-btn:last-child::after {
  right: 0;
  left: auto;
  transform: translateY(-3px);
}

nav .icon-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

nav .icon-btn:last-child:focus-visible::after {
  transform: translateY(0);
}

@media (hover: hover) {
  nav .icon-btn:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  nav .icon-btn:last-child:hover::after {
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .header-logo {
    width: 150px;
    height: 40px;
  }

  .brand h1 {
    font-size: 15px;
  }

  nav .icon-btn {
    width: 44px;
    height: 44px;
  }
}

.user-row {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.user-row,
.lesson-admin-row {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 11px 14px;
  gap: 8px;
}

.compact-primary {
  flex: 0 0 auto;
  font-weight: 750;
}

.compact-secondary {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-separator {
  flex: 0 0 auto;
  color: #9aa5ab;
}

.user-row .user-course-progress {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 600px) {
  .user-row,
  .lesson-admin-row {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
  }

  .user-row .compact-secondary,
  .lesson-admin-row .compact-secondary {
    flex: 1 1 100%;
    overflow: visible;
    white-space: normal;
  }

  .user-row .compact-separator,
  .lesson-admin-row .compact-separator {
    display: none;
  }

  .user-row .user-course-progress {
    margin-left: 0;
  }
}

.user-row:hover {
  border-color: #8fbec7;
  background: #f3f9fa;
  box-shadow: 0 4px 14px rgba(23, 50, 77, .08);
}

.user-name-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.user-course-progress {
  font-size: 13px;
  font-weight: 750;
}

.user-progress-incomplete {
  color: #861f2b;
}

.user-progress-complete {
  color: #17643a;
}

.user-progress-none {
  color: #858d93;
}

.course-checklist {
  margin: 20px 0;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.course-checklist > h3 {
  margin: 4px 0 8px;
}

.user-modal-tabs {
  margin: 0 0 10px;
}

#dialog > h2 {
  min-height: 32px;
  margin: 0 40px 10px 0;
  line-height: 1.25;
}

#userAssignmentForm > .user-tab-panel label,
#newUserForm > .user-tab-panel label {
  margin: 8px 0;
}

#userAssignmentForm > .user-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 14px;
}

#userAssignmentForm > .user-details-grid .user-detail-wide {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  #userAssignmentForm > .user-details-grid {
    grid-template-columns: 1fr;
  }

  #userAssignmentForm > .user-details-grid .user-detail-wide {
    grid-column: auto;
  }
}

#userAssignmentForm > .user-tab-panel input,
#userAssignmentForm > .user-tab-panel select,
#newUserForm > .user-tab-panel input,
#newUserForm > .user-tab-panel select {
  padding: 9px 11px;
}

#userAssignmentForm > .error:empty,
#newUserForm > .error:empty {
  display: none;
}

#userAssignmentForm > .error:not(:empty),
#newUserForm > .error:not(:empty) {
  margin: 8px 0;
}

#userAssignmentForm > .primary,
#newUserForm > .primary {
  margin-top: 6px;
}

.course-checklist legend {
  padding: 0 6px;
  font-weight: 700;
}

.modal label.course-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.modal label.course-check:last-child {
  border-bottom: 0;
}

.course-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
}

.course-check span {
  display: grid;
}

.course-check small {
  color: var(--muted);
  font-weight: 400;
}

.assignment-course {
  display: grid !important;
  grid-template-columns: auto 1fr auto auto;
  transition: background .15s, color .15s, opacity .15s;
}

.course-expand {
  grid-column: 4;
  justify-self: end;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: currentColor;
  font-size: 24px;
  line-height: 1;
}

.course-expand:hover {
  background: rgba(23, 50, 77, .08);
}

.assignment-lessons {
  margin: -1px 10px 8px 47px;
  padding: 6px 12px;
  border-left: 2px solid var(--line);
}

.assignment-lesson {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.assignment-lesson:last-child {
  border-bottom: 0;
}

.assignment-lesson time {
  color: var(--muted);
  white-space: nowrap;
}

.lesson-done span {
  color: #17643a;
}

.lesson-pending span,
.lesson-pending time {
  color: #861f2b;
}

.assignment-course-copy {
  min-width: 0;
}

.course-not-needed {
  background: #f3f4f5;
  color: #858d93;
}

.course-not-needed small {
  color: #989fa4;
}

.course-required strong {
  color: #861f2b;
}

.course-finished strong {
  color: #17643a;
}

.completed-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #dff3e7;
  color: #17643a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.incomplete-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8dfe2;
  color: #861f2b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.assignment-status {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.completion-date {
  color: #17643a;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.lesson-admin-row {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.lesson-admin-row:hover {
  border-color: #8fbec7;
  background: #f3f9fa;
  box-shadow: 0 4px 14px rgba(23, 50, 77, .08);
}

.lesson-form-actions {
  align-items: center;
}

.readonly-field {
  background: #f3f5f6;
  color: var(--muted);
  cursor: default;
}


.settings-email-title {
  margin: 0 36px 18px 0;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.confirm-overlay {
  z-index: 7;
  background: rgba(8, 19, 29, .78);
}

.confirm-modal {
  width: min(440px, 100%);
  text-align: center;
}

.warning-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff0d9;
  color: #a85a00;
  font-size: 28px;
  font-weight: 800;
}

.confirm-modal h2 {
  margin: 0 0 10px;
}

.confirm-modal p {
  color: var(--muted);
}

.confirm-modal .modal-actions {
  justify-content: center;
}

.danger-solid {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.course-modal-tabs {
  margin: 0 0 12px;
}

.sortable-list {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.sortable-lesson {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sortable-lesson.dragging {
  opacity: .55;
  border-color: var(--teal);
}

.sortable-lesson div {
  display: grid;
  min-width: 0;
}

.sortable-lesson small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drag-handle {
  padding: 4px;
  color: var(--muted);
  font-size: 22px;
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.add-lesson-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.compact-empty {
  padding: 24px;
}

.completion-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}

.completion-check input {
  width: 20px;
  height: 20px;
  margin: 0 !important;
}

.progress-save {
  width: 100%;
  margin-top: 10px;
}

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

  .completion-check {
    white-space: normal;
  }
}
