:root {
  --navy: #173f63;
  --blue: #347ee8;
  --sky: #eaf6ff;
  --line: #d8e9f5;
  --muted: #70879a;
  --green: #1c9962;
  --red: #cf5159;
  --panel: #ffffff;
  --canvas: #f8fcff;
  --ink: #24445f;
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

.site-header {
  height: 74px;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid #e5eff7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1480px) / 2));
  backdrop-filter: blur(14px);
}
.site-header.sticky {
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, #3d86e8, #6ac0f3);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 23px;
  box-shadow: 0 10px 22px rgba(52, 126, 232, .28);
}
.brand-copy { display: grid; line-height: 1; }
.brand-copy b { font-size: 21px; }
.brand-copy small {
  font-size: 8px;
  letter-spacing: .18em;
  color: #79a0bd;
  margin-top: 6px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.secure {
  font-size: 11px;
  color: #188254;
  background: #edf9f4;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
}
.admin-chip {
  font-size: 12px;
  font-weight: 800;
  color: #36566f;
  background: #f1f7fc;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
}

.login-page { min-height: 100vh; background: var(--canvas); }
.hero {
  max-width: 1440px;
  margin: auto;
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .72fr);
  gap: 55px;
  padding: 65px 46px 70px;
  position: relative;
  overflow: hidden;
}
.hero:before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, #d6efff, transparent 68%);
  left: -170px;
  top: 15px;
}
.copy {
  position: relative;
  z-index: 1;
  padding-top: 54px;
}
.eyebrow, .label {
  font-size: 10px;
  letter-spacing: .22em;
  font-weight: 900;
  color: #3d86bc;
}
.copy h1 {
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: -.055em;
  color: var(--navy);
  margin: 15px 0;
}
.copy > p {
  font-size: 17px;
  line-height: 1.75;
  color: #607b92;
  max-width: 620px;
  margin: 0;
}
.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 31px 0 0;
}
.meta > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 145px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  box-shadow: 0 9px 25px rgba(33, 94, 143, .06);
}
.meta i { font-style: normal; font-size: 23px; }
.meta span { display: grid; }
.meta small { font-size: 9px; color: #8095a7; }
.meta b { font-size: 14px; color: #27577e; margin-top: 3px; }

.panel {
  align-self: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 31px;
  box-shadow: 0 24px 60px rgba(40, 101, 150, .14);
  position: relative;
  z-index: 2;
}
.panel h2 {
  font-size: 28px;
  color: #193f62;
  margin: 8px 0;
}
.panel .intro {
  font-size: 12px;
  color: #73899b;
  line-height: 1.6;
  margin: 0 0 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.field span {
  font-size: 12px;
  font-weight: 850;
  color: #36566f;
}
.field span small {
  margin-left: 6px;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field select,
.filters input,
.filters select,
.class-form input,
.class-form select,
.class-form textarea {
  height: 51px;
  border: 1px solid #d6e3ee;
  border-radius: 14px;
  padding: 0 15px;
  background: #fbfdff;
  outline: none;
  color: #294965;
  width: 100%;
}
.field input:focus,
.filters input:focus,
.filters select:focus,
.class-form input:focus {
  border-color: #5d9eea;
  box-shadow: 0 0 0 4px rgba(93, 158, 234, .12);
  background: #fff;
}

.primary {
  width: 100%;
  min-height: 53px;
  border: 0;
  border-radius: 15px;
  font-weight: 900;
  background: linear-gradient(120deg, #3177dd, #4c98e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-top: 8px;
  box-shadow: 0 13px 27px rgba(49, 119, 221, .26);
  transition: transform .18s;
}
.primary:hover { transform: translateY(-2px); }
.primary.full { margin-top: 18px; }
.primary:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.secondary-btn,
.ghost-btn {
  border-radius: 12px;
  font-weight: 800;
  padding: 10px 14px;
  transition: transform .18s;
}
.secondary-btn:hover,
.ghost-btn:hover { transform: translateY(-1px); }
.secondary-btn {
  border: 1px solid #d8e6f1;
  background: #f1f6fb;
  color: #346486;
}
.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #57758e;
}

.note {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  background: #f4f9fd;
  border-radius: 13px;
  padding: 11px;
  color: #71879a;
  font-size: 10px;
  line-height: 1.55;
}
.note b { color: var(--green); }
.form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.app-shell { min-height: 100vh; }
.workspace {
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .78fr);
  gap: 24px;
  align-items: start;
}

.catalog-panel,
.builder-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(40, 101, 150, .08);
}
.catalog-panel { padding: 28px; }
.builder-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.builder-scroll { padding: 28px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.section-heading h1,
.builder-panel h2 {
  margin: 8px 0;
  color: #193f62;
  letter-spacing: -.03em;
}
.section-heading h1 { font-size: 30px; }
.builder-panel h2 { font-size: 24px; }
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.muted.compact { font-size: 12px; margin-bottom: 18px; }

.dashboard-stats,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.dashboard-stats article,
.stats-grid article {
  background: linear-gradient(160deg, #fff, #f3faff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(45, 104, 152, .05);
}
.dashboard-stats span,
.stats-grid span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #7a93a8;
}
.dashboard-stats strong,
.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: #214d72;
  letter-spacing: -.04em;
}
.stats-grid article.accent {
  background: linear-gradient(145deg, #1e5d99, #3f8cda);
  border-color: transparent;
}
.stats-grid article.accent span,
.stats-grid article.accent strong { color: #fff; }

.recent-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0 12px;
}
.recent-heading h2 {
  margin: 0;
  font-size: 18px;
  color: #214d72;
}
.recent-heading span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.class-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.class-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fbfdff;
}
.class-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.class-status {
  font-size: 10px;
  font-weight: 900;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f8f0;
  color: var(--green);
}
.class-date { font-size: 11px; color: var(--muted); }
.class-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #214d72;
}
.class-code-line {
  margin: 0 0 12px;
  font-size: 12px;
  color: #6f879b;
  font-weight: 700;
}
.class-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.class-metrics span {
  font-size: 11px;
  font-weight: 800;
  color: #3d6f96;
  background: #eef6fc;
  border-radius: 999px;
  padding: 6px 9px;
}

.catalog-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d5e6f3, transparent);
  margin: 28px 0;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.filters select,
.filters input { height: 46px; }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: auto;
  background: #fbfdff;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
th, td {
  padding: 14px 12px;
  border-bottom: 1px solid #e7f0f6;
  text-align: left;
  vertical-align: top;
}
th {
  font-size: 11px;
  letter-spacing: .04em;
  color: #7a93a8;
  background: #f4f9fd;
  position: sticky;
  top: 0;
}
tr.selected { background: #eef6ff; }
tr:hover td { background: #f7fbff; }
.check-cell { width: 44px; }
.course-check {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}
.course-code {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #3d86bc;
  margin-bottom: 4px;
}
.course-title {
  display: block;
  font-size: 14px;
  color: #214d72;
}
.cell-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 10px;
  font-weight: 800;
  color: #3d6f96;
  background: #eaf4fb;
  border-radius: 999px;
  padding: 4px 8px;
}
.slide-cell { min-width: 110px; }
.slide-preview-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 4px 8px 4px 4px;
  color: #346486;
  font-weight: 800;
  font-size: 11px;
}
.slide-preview-button img {
  width: 42px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8f1f8;
}
.no-slides,
.pending-slides {
  font-size: 11px;
  font-weight: 800;
  color: #8a9eb0;
}
.pending-slides { color: #b46a04; }
.status-badge {
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 5px 8px;
}
.status-badge.verified { background: #e7f8f0; color: var(--green); }
.status-badge.supported { background: #eaf3ff; color: #2f6fbf; }
.status-badge.pending { background: #fff4df; color: #b46a04; }
.status-badge.required { background: #f4f7fa; color: #70879a; }
.json-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #3d6f96;
  font-weight: 900;
}
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.selected-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #f8fcff;
}
.selected-index {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #e8f4ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.selected-copy { display: grid; gap: 2px; }
.selected-copy strong { font-size: 13px; color: #214d72; }
.selected-copy span { font-size: 11px; color: var(--muted); }
.reorder-actions { display: flex; gap: 4px; }
.mini-button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #346486;
  font-weight: 900;
}
.mini-button.remove { color: var(--red); }
.selection-empty {
  border: 1px dashed #c9dcea;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.class-form { margin-top: 16px; }
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-divider {
  height: 1px;
  background: #e7f0f6;
  margin: 8px 0 16px;
}
.inline-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.inline-heading h3 {
  margin: 0;
  font-size: 15px;
  color: #214d72;
}
.inline-heading span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.creation-result { margin-top: 22px; }
.success {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.check {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e7f8f0;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
}
.success small {
  font-size: 10px;
  color: #1a9960;
  font-weight: 900;
}
.success h3 {
  font-size: 18px;
  margin: 3px 0 0;
  color: #193f62;
}
.ticket {
  background: linear-gradient(145deg, #1e5d99, #3f8cda);
  color: #fff;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 18px 38px rgba(26, 91, 152, .25);
  margin-bottom: 12px;
}
.ticket-head {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: .12em;
  color: #c9e5ff;
}
.ticket-head b {
  letter-spacing: 0;
  color: #197f50;
  background: #e8faef;
  padding: 5px 8px;
  border-radius: 999px;
}
.ticket-course { margin: 16px 0 12px; }
.ticket-course small {
  display: block;
  font-size: 9px;
  color: #c8e4ff;
}
.ticket-course strong {
  display: block;
  font-size: 18px;
  margin-top: 5px;
}
.ticket dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.ticket dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.ticket dt { font-size: 9px; color: #c9e5ff; }
.ticket dd {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}
#ticketCodes {
  width: 100%;
  min-height: 120px;
  border: 1px solid #d6e3ee;
  border-radius: 14px;
  padding: 12px;
  resize: vertical;
  background: #fbfdff;
  color: #294965;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.slide-dialog,
.json-dialog {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: 0 30px 70px rgba(7, 31, 54, .25);
}
.slide-dialog::backdrop,
.json-dialog::backdrop {
  background: rgba(17, 42, 65, .53);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 22px 0;
}
.dialog-heading h2 {
  margin: 6px 0 0;
  font-size: 22px;
  color: #193f62;
}
.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eff5fa;
  font-size: 20px;
  color: #36566f;
}
.json-meta {
  padding: 8px 22px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.slide-stage {
  margin: 16px 22px;
  min-height: 360px;
  border-radius: 18px;
  background: #0d2740;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.slide-stage img {
  max-width: 100%;
  max-height: 520px;
  display: block;
}
.slide-loading {
  color: #c9e5ff;
  font-size: 13px;
  font-weight: 700;
  padding: 24px;
}
.slide-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 22px 22px;
}
.slide-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.slide-numbers button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #346486;
  font-weight: 800;
}
.slide-numbers button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
#jsonContent {
  margin: 16px 22px 22px;
  max-height: 60vh;
  overflow: auto;
  background: #0f2740;
  color: #d7e9f8;
  border-radius: 16px;
  padding: 16px;
  font-size: 12px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 18px);
  background: #173e61;
  color: #fff;
  padding: 12px 17px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: .22s;
  z-index: 40;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .builder-panel {
    position: static;
    max-height: none;
  }
  .class-card-grid { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }
  .copy { padding-top: 25px; }
  .panel { max-width: 600px; width: 100%; margin: auto; }
  .dashboard-stats,
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .site-header { height: 66px; padding: 0 15px; }
  .brand-copy small,
  .secure { display: none; }
  .hero { padding: 25px 15px 43px; gap: 25px; }
  .copy h1 { font-size: 34px; }
  .copy > p { font-size: 14px; }
  .meta { display: grid; grid-template-columns: 1fr 1fr; }
  .meta > div { min-width: 0; }
  .meta > div:last-child { grid-column: 1 / -1; }
  .panel { padding: 22px; border-radius: 22px; }
  .panel h2 { font-size: 24px; }
  .workspace { padding: 16px 12px 36px; }
  .catalog-panel,
  .builder-scroll { padding: 18px; }
  .class-card-grid,
  .field-pair,
  .result-actions { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
}
