@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #f8f6f1;
  --card: #fffdfa;
  --ink: #172238;
  --muted: #738096;
  --line: #e7e3dc;
  --navy: #1b3154;
  --blue: #4361ee;
  --gold: #dfa72e;
  --danger: #bd3a49;
  --shadow: 0 10px 30px rgba(24, 37, 57, 0.07);
}
[data-theme='dark'] {
  --bg: #07111f;
  --card: #0d1a2b;
  --ink: #edf2fb;
  --muted: #9ca9bc;
  --line: #1d2b3e;
  --navy: #a9c9ff;
  --blue: #84a7ff;
  --gold: #f2c55e;
  --danger: #ff8b99;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    500 14px/1.5 Manrope,
    system-ui,
    sans-serif;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  padding: 42px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
}
.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #f7c96b;
  font-weight: 800;
  border-radius: 13px;
  font-size: 19px;
}
.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.login h1 {
  font-size: 30px;
  letter-spacing: -1.4px;
  margin: 20px 0 4px;
}
.sub {
  color: var(--muted);
  margin: 0 0 24px;
}
.app {
  max-width: 1440px;
  margin: auto;
  display: grid;
  grid-template-columns: 246px 1fr;
  min-height: 100vh;
}
.side {
  border-right: 1px solid var(--line);
  padding: 24px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 30px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 15px;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  font: 700 13px Manrope;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
}
.nav button:hover,
.nav button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.nav-icon {
  display: flex;
  flex: 0 0 auto;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.nav-label {
  white-space: nowrap;
}
.side-foot {
  margin-top: auto;
  padding: 12px 8px;
  color: var(--muted);
  font-size: 11px;
}
.class-files-grid {
  gap: 22px;
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 8px 8px 0;
  padding: 4px 6px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.member-chip .button {
  padding: 4px 7px;
}
.content {
  padding: 32px 42px 52px;
  min-width: 0;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 31px;
}
.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}
.top h1 {
  font-size: 28px;
  letter-spacing: -1.4px;
  margin: 3px 0 0;
}
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  height: 35px;
  width: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #38290b;
  font-size: 12px;
  font-weight: 800;
  border: 0;
  font-family: Manrope;
  cursor: pointer;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.button,
button.primary {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 13px;
  font: 700 12px Manrope;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.button svg {
  width: 14px;
  height: 14px;
}
.button {
  background: var(--card);
  color: var(--ink);
}
.button.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.admin-user {
  align-items: flex-start;
}
.reset-form {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.reset-form input {
  width: 150px;
}
.class-admin-item + .class-admin-item {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}
.class-members {
  padding: 0 0 8px 20px;
}
.button.small {
  padding: 6px 9px;
  font-size: 11px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 17px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 19px;
  box-shadow: var(--shadow);
}
.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-6 {
  grid-column: span 6;
}
.span-7 {
  grid-column: span 7;
}
.span-8 {
  grid-column: span 8;
}
.span-12 {
  grid-column: span 12;
}
.card-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 15px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.card-head .card-title {
  margin: 0;
}
.metric {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -2px;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 11px;
}
.list {
  display: grid;
  gap: 9px;
}
.row {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.row:last-child {
  border-bottom: 0;
}
.badge {
  font-size: 10px;
  font-weight: 800;
  border-radius: 6px;
  padding: 4px 6px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  white-space: nowrap;
}
.badge.gold {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: #a16e00;
}
.badge.red {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  flex: 0 0 auto;
}
.push {
  margin-left: auto;
}
.done {
  text-decoration: line-through;
  opacity: 0.55;
}
.empty {
  color: var(--muted);
  padding: 18px 0;
  text-align: center;
}
.page-intro {
  margin: -18px 0 24px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  align-items: center;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
}
.tab {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 7px 10px;
  border-radius: 8px;
  white-space: nowrap;
  color: var(--muted);
  font: 700 11px Manrope;
  cursor: pointer;
}
.tab.active {
  border-color: var(--blue);
  color: var(--blue);
}
.schedule {
  overflow-x: auto;
}
.schedule-grid {
  min-width: 680px;
  display: grid;
  grid-template-columns: 58px repeat(5, minmax(115px, 1fr));
  grid-auto-rows: minmax(55px, auto);
  gap: 5px;
}
.schedule-grid > .cell {
  min-height: 55px;
  padding: 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 80%, var(--line));
  font-size: 11px;
}
.schedule-grid > .head {
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  min-height: auto;
}
.cell.lesson {
  position: relative;
  border-left: 3px solid var(--lesson-color, var(--blue)) !important;
  background: color-mix(
    in srgb,
    var(--lesson-color, var(--blue)) 10%,
    var(--card)
  ) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.cell.lesson.cancelled {
  opacity: 0.5;
  text-decoration: line-through;
  border-left-color: var(--danger) !important;
}
.cell.lesson small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.lesson-manage {
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
}
.lesson-variant {
  display: grid;
  gap: 1px;
  padding: 4px 5px;
  border-left: 3px solid var(--lesson-color, var(--blue));
  background: color-mix(in srgb, var(--lesson-color, var(--blue)) 10%, var(--card));
  border-radius: 5px;
  cursor: context-menu;
}
.lesson-variant small {
  color: var(--muted);
  font-size: 10px;
}
.hw-star {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 12px;
  height: 12px;
  color: var(--gold);
}
.hw-star svg {
  width: 100%;
  height: 100%;
  display: block;
}
.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 13px;
}
.grade-layout {
  display: grid;
  gap: 22px;
}
.grade-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
}
.grade-card b {
  font-size: 25px;
  letter-spacing: -1px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field.full {
  grid-column: 1/-1;
}
.field.hidden {
  display: none;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 11px;
  font: 500 13px Manrope;
  outline: none;
}
textarea {
  min-height: 88px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}
input[type='file'] {
  padding: 8px;
  font-size: 12px;
}
input[type='time'] {
  padding: 9px 8px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}
.modal-wrap {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 11, 21, 0.43);
  z-index: 5;
  padding: 20px;
  place-items: center;
}
.modal-wrap.show {
  display: grid;
}
.modal {
  max-height: 92vh;
  overflow: auto;
  overflow-x: hidden;
  min-width: 0;
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 23px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
}
.modal h2 {
  font-size: 20px;
  letter-spacing: -0.8px;
  margin: 0 0 20px;
}
.notice {
  border-radius: 10px;
  padding: 11px 13px;
  margin: 0 0 14px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--blue);
  font-size: 12px;
}
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--ink);
  color: var(--card);
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: var(--shadow);
  z-index: 8;
}
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  cursor: pointer;
  animation: welcome-in 420ms ease-out both;
}
.welcome-name {
  font-size: clamp(32px, 7vw, 88px);
  font-weight: 800;
  letter-spacing: -2px;
  animation: welcome-name-in 600ms 120ms ease-out both;
}
.welcome-continue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  animation: welcome-pulse 1.8s ease-in-out infinite;
}
@keyframes welcome-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes welcome-name-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes welcome-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}
.admin-section {
  margin-bottom: 22px;
}
.admin-section h2 {
  font-size: 17px;
  letter-spacing: -0.7px;
  margin: 0 0 12px;
}
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-form input,
.inline-form select {
  width: auto;
  flex: 1 1 150px;
}
.group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.group-options input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
}
.group-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-size: 13px;
  color: var(--ink);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
}
.group-chip button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
}
.right {
  float: right;
}
.hidden {
  display: none !important;
}
.done-toggle {
  border-radius: 50%;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
.done-toggle svg {
  width: 13px;
  height: 13px;
}
.done-toggle.is-done {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.mini-icon {
  display: inline-flex;
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  margin-left: 5px;
  color: var(--muted);
}
.mini-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.detail {
  display: grid;
  gap: 6px;
}
.detail h3 {
  margin: 4px 0 8px;
  font-size: 21px;
  letter-spacing: -0.6px;
}
.detail-text {
  white-space: pre-wrap;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  margin: 0 0 4px;
}
.attachment-preview {
  margin: 4px 0 10px;
}
.attachment-preview img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
}
.attachment-preview iframe {
  width: 100%;
  height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.attachment-card {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 4px 0 10px;
}
.attachment-card .icon {
  width: 30px;
  height: 30px;
  color: var(--blue);
  flex: 0 0 auto;
}
.attachment-card .icon svg {
  width: 100%;
  height: 100%;
}
.date-popover {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  padding: 10px;
  width: 240px;
}
.date-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.date-pop-head button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 6px;
}
.date-pop-head button:hover {
  background: var(--bg);
}
.date-pop-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  margin-bottom: 4px;
}
.date-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.date-pop-grid button {
  border: 0;
  background: transparent;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink);
  font-family: Manrope;
}
.date-pop-grid button:hover {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}
.date-pop-grid button.sel {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}
.date-pop-foot {
  margin-top: 6px;
  text-align: center;
}
.date-pop-foot button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
@media (max-width: 860px) {
  .app {
    display: block;
    padding-bottom: 74px;
  }
  .side {
    position: fixed;
    inset: auto 0 0 0;
    height: 66px;
    padding: 6px 6px;
    border: 0;
    border-top: 1px solid var(--line);
    background: var(--card);
    z-index: 20;
    display: block;
  }
  .side .brand,
  .side-foot {
    display: none;
  }
  .nav {
    height: 100%;
    display: flex;
    gap: 2px;
    overflow: visible;
  }
  .nav button {
    flex: 1;
    min-width: 0;
    padding: 6px 2px;
    flex-direction: column;
    gap: 2px;
    text-align: center;
    border-radius: 12px;
  }
  .nav-icon svg {
    width: 21px;
    height: 21px;
  }
  .nav-label {
    font-size: 9.5px;
    font-weight: 700;
  }
  .nav button.active {
    color: var(--blue);
    box-shadow: none;
  }
  .content {
    padding: 24px 16px 32px;
  }
  .top {
    margin-bottom: 22px;
  }
  .top h1 {
    font-size: 23px;
  }
  .top .eyebrow {
    display: none;
  }
  .grid {
    gap: 12px;
  }
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
  .card {
    padding: 16px;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .modal {
    padding: 19px;
  }
  .login-card {
    padding: 30px 24px;
  }
}
@media (max-width: 420px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .attachment-preview iframe {
    height: 260px;
  }
  .date-popover {
    width: calc(100vw - 32px);
  }
}
