/* 와이즈 LMS — 공통 디자인.
   원칙: 흰 바탕, 가는 선, 굵기는 제목과 핵심 숫자에만. 색은 남색 하나 + 상태색 넷.
   글씨는 흐리게 쓰지 않는다(보조 글도 --ink-2 이상). 그림자 · 그라데이션 · 장식 띠 없음. */

@font-face {
  font-family: "Pretendard Variable";
  src: url("/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
}

:root {
  --bg: #ffffff; --bg-2: #f6f7f9; --bg-3: #eef0f4;
  --ink: #0f172a; --ink-2: #3b4658; --ink-3: #566377;
  --line: #e2e5ea; --line-2: #cbd2dc;
  --brand: #1f2c5c; --brand-ink: #ffffff; --brand-soft: #eef1fa;
  --red: #c8281e; --red-soft: #fdeceb;
  --green: #0b7a4b; --green-soft: #e7f5ee;
  --amber: #a65a00; --amber-soft: #fdf1df;
  --blue: #1859c9; --blue-soft: #e8f0fd;
  /* 일정 분류 색(data/site.js의 CATS) · 카테고리 색(BIG) */
  --k-test: #e05656; --k-open: #1e9e7a; --k-speech: #7a4fd0; --k-quiz: #e08a12; --k-prep: #2f7bd0; --k-off: #d64545; --k-counsel: #16858a; --k-etc: #6b7280;
  --c-raz: #16858a; --c-phonics: #d9711f; --c-speech: #7a4fd0; --c-class: #2f6fd6; --c-promo: #cc4777; --c-ops: #2c9461; --gold: #b9862a;
  --band: #e6ebf7; --cream: #faf5e8; --cream-line: #eadfc4;
  --radius: 10px; --radius-s: 7px;
  --side: 232px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); letter-spacing: -0.005em; word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ───────── 글 */
h1 { font-size: 28px; font-weight: 750; line-height: 1.3; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.4; letter-spacing: -0.015em; }
h3 { font-size: 16px; font-weight: 700; line-height: 1.5; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 13.5px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.04em; }
.nowrap { white-space: nowrap; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; }
.c-red { color: var(--red); } .c-green { color: var(--green); } .c-amber { color: var(--amber); } .c-blue { color: var(--blue); }

/* ───────── 틀: 왼쪽 메뉴 + 본문 */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); padding: 20px 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.side-logo img { width: 34px; height: auto; }
.side-logo b { display: block; font-size: 17px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.25; }
.side-logo > div { min-width: 0; }
.side-logo span { display: block; white-space: nowrap; font-size: 10px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; }
.side-logo:hover { text-decoration: none; }
.side-logo .who { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: 0; vertical-align: 2px; }
/* 묶음 이름은 누르는 메뉴가 아니다: 위에 줄을 긋고 작게 쓴다 */
.side-group { margin: 12px 10px 2px; padding: 12px 0 2px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-3); cursor: default; user-select: none; }
.side a.nav { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-s); font-weight: 500; color: var(--ink-2); }
.side a.nav:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.side a.nav[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side a.nav .count { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--red); }
.side-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 8px; }
.side-me { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: none; text-align: left; cursor: pointer; }
.side-me:hover { background: var(--bg-2); }
.side-me b { display: block; font-size: 15px; line-height: 1.3; }
.side-me span { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.3; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 12px 40px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .date { font-size: 15px; font-weight: 600; }
.topbar .search { margin-left: auto; position: relative; width: min(320px, 40vw); }
.topbar .search input#q { width: 100%; padding-left: 34px; }
.topbar .search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sync.offline { color: var(--red); } .sync.offline::before { background: var(--red); }
.sync.loading::before { background: var(--line-2); }

.page { max-width: 1240px; margin: 0 auto; padding: 32px 40px 80px; }
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 36px; }
.page-head .lead { margin-top: 4px; color: var(--ink-2); }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── 배치 */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.stack.lg { gap: 60px; } .stack.sm { gap: 8px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.row.nowrap-row { flex-wrap: nowrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 44px; align-items: start; }  /* 본문 + 오른쪽 좁은 단 */
.cols > aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; min-width: 0; }
/* 크림색 상자: 오른쪽 단(.cols > aside)과 .callouts 안의 상자. 곁에 두고 보는 것을 본문과 가른다 */
:is(.cols > aside, .callouts) > :is(.panel, .sec), :is(.cols > aside, .callouts) > * > :is(.panel, .sec) { padding: 22px; border: 1px solid var(--cream-line); border-radius: var(--radius); background: var(--cream); overflow: clip; }
:is(.cols > aside, .callouts) .sec-h { margin: -22px -22px 4px; padding-left: 22px; padding-right: 14px; border-radius: 0; background: #f3ead2; border-bottom: 1px solid var(--cream-line); }
:is(.cols > aside, .callouts) .panel > .sec-h:first-child { margin-bottom: 18px; }
:is(.cols > aside, .callouts) :is(.stats, .btn, .badge:not(.red):not(.green):not(.amber):not(.blue):not(.brand)) { background: var(--bg); }
:is(.cols > aside, .callouts) :is(.list > li, .divide > * + *) { border-top-color: var(--cream-line); }
:is(.cols > aside, .callouts) .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.cols > aside, .callouts) .stat:nth-child(odd) { border-left: 0; }
:is(.cols > aside, .callouts) .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }

/* ───────── 구역 · 상자 */
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
/* 구역 머리: 옅은 색 띠. 띠가 보이면 새 구역이다. 상자(.panel)의 머리는 상자 윗변에 붙는다. */
.sec-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 46px; padding: 7px 10px 7px 16px; border-radius: var(--radius-s); background: var(--band); }
.sec-h .sub { translate: 0 1px; }
.panel > .sec-h:first-child { margin: -22px -22px 18px; padding-left: 22px; padding-right: 14px; border-radius: 0; border-bottom: 1px solid var(--line-2); }
.panel.tight > .sec-h:first-child { margin: -14px -16px 14px; padding-left: 16px; }
.sec-h.plain { min-height: 0; padding: 0; background: none; }
.sec-h .sub { font-size: 14px; color: var(--ink-2); }
.sec-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; background: var(--bg); overflow: clip; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.soft { background: var(--bg-2); border-color: transparent; }
.panel.tight { padding: 14px 16px; }
.divide > * + * { border-top: 1px solid var(--line); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ───────── 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--bg); font-weight: 600; font-size: 15px; line-height: 1.3; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #17224a; }
.btn.danger { color: var(--red); border-color: #e9b4b0; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn.sm { min-height: 30px; padding: 3px 10px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-s); background: none; color: var(--ink-2); cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--red); }

/* 고르는 단추 묶음: <div class="seg"><button aria-pressed="true">…</button>…</div> */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-3); border-radius: var(--radius-s); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 5px; font-size: 15px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
/* 여러 개 고르는 단추: <div class="chips"><button class="chip" aria-pressed="false">GT4</button></div> */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--bg); padding: 4px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; cursor: pointer; }
.chip:hover { background: var(--bg-2); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ───────── 입력 */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]), select, textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--bg); line-height: 1.4; }
textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.field { display: grid; gap: 5px; align-content: start; }
.field > span, .field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 13.5px; font-weight: 400; color: var(--ink-2); }
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; cursor: pointer; }
.form-err { color: var(--red); font-size: 14px; font-weight: 600; }

/* ───────── 목록 · 표 */
.list > li, .list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.list > li:first-child, .list-row:first-child { border-top: 0; }
.list.pad > li { padding-left: 16px; padding-right: 16px; }
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .meta { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.list .note { display: block; font-size: 14px; color: var(--ink-2); font-weight: 400; }
.list li.child { padding-left: 22px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; }
.kv dt { font-size: 14px; font-weight: 600; color: var(--ink-2); padding-top: 1px; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13.5px; font-weight: 700; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--bg); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; }
.table tbody tr.click { cursor: pointer; } .table tbody tr.click:hover { background: var(--bg-2); }
.table.compact td, .table.compact th { padding: 6px 10px; }
.scroll-x { overflow-x: auto; }

/* ───────── 표시 */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 700; line-height: 1.7; white-space: nowrap; background: var(--bg-3); color: var(--ink-2); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--ink-3)); flex: none; }

/* 큰 숫자 줄: <div class="stats"><div class="stat"><b>3</b><span>오늘 남김</span></div>…</div> */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.stat { padding: 14px 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 28px; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { display: block; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.stat small { display: block; font-size: 13.5px; color: var(--ink-2); }
.stat.warn b { color: var(--red); }


.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); font-size: 15px; }
.empty.left { text-align: left; padding: 8px 0; }
.note-box { padding: 12px 14px; border-radius: var(--radius-s); background: var(--bg-2); font-size: 15px; color: var(--ink-2); }
.note-box.warn { background: var(--amber-soft); color: var(--amber); }

/* 접는 칸 */
details.disc { border: 1px solid var(--line-2); border-radius: var(--radius); }
details.disc > summary { display: flex; align-items: center; gap: 8px; padding: 14px 18px; cursor: pointer; font-weight: 700; list-style: none; }
details.disc > summary::-webkit-details-marker { display: none; }
details.disc > summary::before { content: "›"; display: inline-block; width: 14px; color: var(--ink-2); transition: rotate 0.15s; }
details.disc[open] > summary::before { rotate: 90deg; }
details.disc[open] > summary { border-bottom: 1px solid var(--line); }
details.disc > .disc-b { padding: 16px 18px 20px; }

/* ───────── 달력 (월) */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-wd { padding: 7px 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 104px; padding: 6px 8px 8px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; gap: 3px; align-content: start; background: var(--bg); text-align: left; }
.cal-cell:nth-child(7n + 1) { border-left: 0; }
.cal-wd + .cal-wd { border-left: 0; }
button.cal-cell, .cal-cell[role=button] { cursor: pointer; font: inherit; border-right: 0; border-bottom: 0; }
button.cal-cell:hover, .cal-cell[role=button]:hover { background: var(--bg-2); }
.cal-cell.out { background: var(--bg-2); } .cal-cell.out .cal-d { color: var(--ink-3); }
.cal-d { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-cell.sun .cal-d, .cal-wd.sun { color: var(--red); } .cal-cell.sat .cal-d, .cal-wd.sat { color: var(--blue); }
.cal-cell.today .cal-d { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -2px 0 0 -4px; border-radius: 50%; background: var(--brand); color: #fff; }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-ev { display: flex; align-items: baseline; gap: 5px; font-size: 13.5px; line-height: 1.4; font-weight: 500; }
.cal-ev::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--ink-3)); translate: 0 -1px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { min-width: 132px; text-align: center; font-variant-numeric: tabular-nums; }

/* ───────── 창 · 알림 */
.dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); color: var(--ink); }
.dialog.wide { width: min(880px, calc(100vw - 32px)); }
.dialog.full { width: calc(100vw - 32px); height: calc(100vh - 32px); max-height: none; }
.dialog::backdrop { background: rgba(15, 23, 42, 0.42); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog-h { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 22px; }
.dialog-h h2 { flex: 1; }
.dialog-b { padding: 4px 22px 22px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.dialog.confirm { width: min(400px, calc(100vw - 32px)); }
.dialog.confirm .dialog-h h2 { font-size: 17px; }
#toasts { position: fixed; inset: auto auto 28px 50%; translate: -50% 0; z-index: 100; margin: 0; padding: 0; border: 0; background: none; overflow: visible; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
#toasts:not(:popover-open):empty { display: none; }
.toast { padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; }
.toast.error { background: var(--red); }

/* ───────── 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-2); }
.login-card { width: min(380px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); display: grid; gap: 20px; }
.login-card .side-logo { padding: 0; }
.login-card .side-logo img { width: 60px; }      /* 마스코트는 로그인 화면에서만 크게 */
.login-card .side-logo b { font-size: 20px; }

/* ───────── 수업 화면(아이들과 함께 보는 화면): 메뉴를 감추고 본문만 크게 */
body.classmode .side, body.classmode .topbar .search, body.classmode .t-only { display: none !important; }
body.classmode .shell { grid-template-columns: minmax(0, 1fr); }
body:not(.classmode) .c-only { display: none !important; }
body.classmode { font-size: 18px; }

/* ───────── 좁은 화면 */
@media (max-width: 1080px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .side-logo { padding: 0 8px 0 4px; } .side-logo span, .side-group { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; display: flex; }
  .topbar { padding: 10px 16px; } .page { padding: 20px 16px 64px; }
  .grid.c2, .grid.c3, .grid.c4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-cell { min-height: 72px; padding: 4px; } .cal-ev { font-size: 12.5px; }
}

@media print {
  .side, .topbar, #toasts, .no-print { display: none !important; }
  .shell { display: block; } .page { padding: 0; max-width: none; }
  body { font-size: 11pt; }
}
