:root {
  --bg: #eef3ff;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --ink: #0f1b3d;
  --muted: #5d6a86;
  --line: #d9e2ff;
  --blue: #2f57d7;
  --blue-deep: #1d3ea8;
  --blue-soft: #eaf0ff;
  --red: #ff6363;
  --green: #8bc34a;
  --shadow: 0 24px 60px rgba(25, 56, 145, 0.16);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(47, 87, 215, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 99, 99, 0.12), transparent 24%),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

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

.page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue) 0%, #2446ba 72%, #15318d 100%);
  border-radius: 0 0 36px 36px;
  color: #fff;
  padding: 28px 0 44px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -42% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 72%);
}

.hero-grid {
  display: grid;
  gap: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 12px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy h1,
.hero-copy h2,
.section-title {
  margin: 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.76;
  text-transform: uppercase;
}

.hero-copy {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

.hero-copy h2 {
  font-size: clamp(2rem, 4.8vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 12px 26px rgba(17, 37, 103, 0.16);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

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

.btn-block {
  width: 100%;
}

.content-stack {
  display: grid;
  gap: 20px;
  padding: 24px 0 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-soft {
  background: var(--surface-soft);
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-title {
  font-size: 1.2rem;
  line-height: 1.25;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: #eef1f7;
  color: #414d67;
  font-size: 0.85rem;
  font-weight: 700;
}

.stats-grid,
.card-grid,
.action-grid,
.info-grid,
.report-grid,
.teacher-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-box {
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f9fbff 0%, #f1f5ff 100%);
  border: 1px solid var(--line);
}

.stat-box strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 10px;
}

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

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.click-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  padding: 20px;
  text-align: left;
}

.click-card:hover {
  border-color: #b9c8ff;
  box-shadow: 0 14px 34px rgba(33, 63, 160, 0.12);
}

.click-card strong {
  display: block;
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.click-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.action-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.menu-action {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f6f8ff 0%, #ffffff 100%);
  border: 1px solid var(--line);
}

.menu-action strong {
  font-size: 1.1rem;
}

.menu-action p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-logo {
  width: 132px;
  margin: 0 auto 18px;
  display: block;
}

.center-copy {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.center-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.center-copy p {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.75;
}

.student-list,
.term-list,
.report-sections,
.class-list,
.student-row-list,
.admin-list {
  display: grid;
  gap: 14px;
}

.student-item,
.term-item,
.class-item,
.student-row,
.admin-item {
  border-radius: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.student-item strong,
.term-item strong,
.class-item strong,
.student-row strong,
.admin-item strong {
  display: block;
  font-size: 1.05rem;
}

.admin-item-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.select-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.select-row input {
  width: 16px;
  height: 16px;
}

.student-item p,
.term-item p,
.class-item p,
.student-row p,
.admin-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.info-chip {
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.info-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.info-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.report-grid {
  grid-template-columns: 1.3fr 0.9fr;
  align-items: start;
}

.section-block {
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.section-block .section-head {
  background: var(--blue);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-body {
  padding: 18px;
}

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

.calendar-cell {
  min-height: 106px;
  border-radius: 18px;
  padding: 10px;
  background: #fbfcff;
  border: 1px solid #ecf1ff;
}

.calendar-day {
  font-weight: 700;
  margin-bottom: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  padding: 7px 10px;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-attend {
  background: #dff2bd;
  color: #4f7a10;
}

.status-homework {
  border: 2px solid #b2dc6c;
  color: #6b8917;
  background: #fff;
}

.comment-box,
.ai-box {
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f8ff 100%);
  border: 1px solid var(--line);
}

.comment-date {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 700;
}

.assess-list {
  display: grid;
  gap: 14px;
}

.assess-item {
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

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

.score-box {
  text-align: right;
}

.score-box strong {
  display: block;
  font-size: 1.8rem;
  color: var(--red);
}

.score-box span {
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.teacher-grid,
.admin-grid {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

.login-card {
  max-width: 440px;
  margin: 0 auto;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #cfdaff;
  padding: 14px 16px;
  background: #fbfcff;
  color: var(--ink);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  background: #102253;
  color: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.mini-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.admin-link-url {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-all;
}

.footer-note {
  text-align: center;
  padding: 18px 0 34px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .report-grid,
  .teacher-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 100%);
  }

  .hero {
    border-radius: 0 0 28px 28px;
    padding-bottom: 34px;
  }

  .panel,
  .student-item,
  .term-item,
  .class-item,
  .student-row,
  .admin-item {
    padding: 16px;
  }

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

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