/* ─────────────────────────────────────────────
   선생님 화면 — 학생·노트 관리, 사용량과 비용, 연결·설정
   ───────────────────────────────────────────── */
body.admin { min-height: 100vh; overflow-x: hidden; }

/* ── 로그인 ── */
.gate { position: relative; z-index: 5; min-height: 100vh; display: grid; place-items: center; padding: 60px 18px 30px; }
.gate-card { width: min(100%, 420px); padding: 46px 36px 28px; rotate: .6deg; animation: modal-in .5s var(--ease-pop) both; }
.gate-card .owl { position: absolute; right: -30px; top: -66px; rotate: 7deg; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .35)); }
.gate-card .kicker { font-size: 10.5px; letter-spacing: .34em; color: var(--paper-ink-3); }
.gate-card h1 { margin-top: 6px; font-size: 38px; line-height: 1.15; }
.gate-card .lead { margin-top: 6px; font-size: 14.5px; color: var(--paper-ink-2); }
.gate-card form { margin-top: 22px; display: grid; gap: 12px; }
.gate-card .msg { min-height: 20px; font-size: 14px; font-weight: 700; color: #c4402b; }
.gate-card .back-link { display: block; margin-top: 16px; text-align: center; font-size: 13.5px; color: var(--paper-ink-3); text-decoration: none; }
.gate-card .back-link:hover { color: var(--paper-ink); }

/* ── 뼈대 ── */
.topbar {
  position: sticky; top: 14px; z-index: 50; margin: 14px auto 0; width: min(1240px, calc(100% - 28px));
  display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; border-radius: 99px;
}
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 20px; white-space: nowrap; }
.topbar .brand img { border-radius: 9px; }
.topbar .brand em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; color: var(--yellow);
  padding: 3px 9px; border-radius: 99px; border: 1px dashed rgba(255, 215, 122, .5); }
.topbar .who { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, .05); }
.tabs button {
  min-height: 38px; padding: 0 17px; border-radius: 99px; font-family: var(--font-display); font-size: 15.5px; color: var(--ink-2);
  transition: background .2s, color .2s; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: #14151a; background: linear-gradient(100deg, var(--peri-2), var(--lilac)); }

.wrap { position: relative; z-index: 5; width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 100px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  padding: 18px 20px; border-radius: 20px; background: rgba(35, 36, 43, .9); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); animation: nb-in .5s var(--ease-pop) both; animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes nb-in { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }
.stat .k { font-size: 13px; color: var(--ink-3); }
.stat .v { margin-top: 3px; font-family: var(--font-display); font-size: 32px; line-height: 1.15; }
.stat .v small { font-family: var(--font-body); font-size: 14px; color: var(--ink-3); margin-left: 5px; }
.stat .s { margin-top: 3px; font-size: 12.5px; color: var(--ink-4); }
.stat.warm .v { color: var(--yellow); }

.panel { animation: fade-in .35s ease both; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-weight: 400; font-size: 25px; margin-right: 4px; }
.panel-head .pnote { font-size: 13px; color: var(--ink-3); }   /* .note 는 보드(board.css)의 공책 카드 이름이라 쓰지 않는다 */
.hint { margin: -4px 0 12px; font-size: 13px; color: var(--ink-3); }
.hint:empty { display: none; }

.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, .06); }
.seg button { min-height: 34px; padding: 0 14px; border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-checked="true"] { color: var(--ink); background: rgba(255, 255, 255, .14); }
.seg b { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--coral); }
.search { width: 240px; min-height: 40px; font-size: 14.5px; margin-left: auto; border-radius: 99px; }

/* ── 표 ── */
.table-wrap { border-radius: 20px; overflow: auto; background: rgba(35, 36, 43, .9); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { position: sticky; top: 0; padding: 13px 16px; text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  background: #2a2b33; white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, .025); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .act { text-align: right; white-space: nowrap; }
.table td.act { display: flex; justify-content: flex-end; gap: 6px; }
.table .no { font-family: var(--font-mono); font-size: 13px; color: var(--peri-2); }
.table .nm { font-weight: 700; }
.table .dim { color: var(--ink-4); }
.table .empty { padding: 44px 16px; text-align: center; color: var(--ink-3); }
.table .gone td { opacity: .62; }
.table .btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.pill-s { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.pill-s.ok { color: #0f3a24; background: var(--mint); }
.pill-s.todo { color: #4a3a05; background: #ffe49a; }
.pill-s.off { color: var(--ink-2); background: rgba(255, 255, 255, .1); }
.ck { display: inline-flex; gap: 4px; vertical-align: middle; }
.ck i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 12px;
  background: rgba(255, 255, 255, .07); filter: grayscale(1); opacity: .45; }
.ck i.on { background: rgba(139, 233, 183, .22); filter: none; opacity: 1; }

/* ── 학생의 노트 (모달) ── */
.modal.wide { width: min(100%, 860px); }
.notes-list { display: grid; gap: 9px; margin-top: 18px; max-height: 58vh; overflow-y: auto; padding: 2px; }
.nrow { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 15px;
  background: #fff; border: 2px solid rgba(35, 32, 25, .09); }
.nrow img { width: 54px; height: 72px; object-fit: cover; border-radius: 4px 9px 9px 4px; box-shadow: 0 4px 10px rgba(35, 32, 25, .25); }
.nrow h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1.3; }
.nrow p { font-size: 13px; color: var(--paper-ink-2); line-height: 1.5; }
.nrow .ck i { background: #f1eee4; } .nrow .ck i.on { background: #d3f4e2; }
.nrow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nrow.gone { background: #f4f1e8; border-style: dashed; }
.nrow.gone h3, .nrow.gone p { opacity: .6; }
.nrow .btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.red { color: #fff; background: #c4402b; border-color: transparent; }
.btn.red:hover { background: #a93422; }

/* ── 비용 ── */
.units { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.unit { position: relative; padding: 20px 20px 18px; border-radius: 20px; background: var(--paper); color: var(--paper-ink);
  box-shadow: var(--shadow-1); }
.unit .e { font-size: 30px; line-height: 1; }
.unit h3 { margin-top: 8px; font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.unit .won { margin-top: 2px; font-family: var(--font-display); font-size: 34px; line-height: 1.15; color: #c9553e; }
.unit .won small { font-family: var(--font-body); font-size: 14px; color: var(--paper-ink-2); margin-left: 3px; }
.unit .how { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--paper-ink-2); }
.unit .how b { font-weight: 700; color: var(--paper-ink); }
.unit .model { margin-top: 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--paper-ink-3); }
.example { margin-top: 14px; padding: 18px 22px; border-radius: 20px; background: rgba(35, 36, 43, .9); border: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.example b { color: var(--yellow); font-weight: 700; }
.example h4 { font-family: var(--font-display); font-weight: 400; font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.example ul { list-style: none; display: grid; gap: 2px; }
.example li::before { content: "· "; color: var(--ink-4); }

.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.day { padding: 12px 12px 10px; border-radius: 16px; background: rgba(35, 36, 43, .9); border: 1px solid var(--line); text-align: center; }
.day .d { font-size: 12px; color: var(--ink-3); }
.day .col { height: 74px; display: flex; align-items: flex-end; justify-content: center; margin: 8px 0 6px; }
.day .col i { width: 26px; min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--peri-2), var(--lilac)); }
.day .n { font-family: var(--font-display); font-size: 17px; line-height: 1.2; }
.day .w { font-size: 11.5px; color: var(--ink-3); }
.day.today { border-color: rgba(255, 215, 122, .5); }
.day.today .d { color: var(--yellow); }

/* ── 연결 ── */
.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.link { padding: 20px; border-radius: 20px; background: rgba(35, 36, 43, .9); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  display: grid; gap: 8px; align-content: start; }
.link .top { display: flex; align-items: center; gap: 10px; }
.link .e { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; background: rgba(255, 255, 255, .07); }
.link h3 { font-family: var(--font-display); font-weight: 400; font-size: 18.5px; line-height: 1.25; }
.link .m { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-4); }
.link p { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.link code { font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .09); color: var(--ink); }
.link .btn { justify-self: start; margin-top: 4px; }

/* ── 설정 ── */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set { padding: 16px 18px; border-radius: 18px; background: rgba(35, 36, 43, .9); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; }
.set h4 { font-family: var(--font-display); font-weight: 400; font-size: 16.5px; }
.set p { grid-column: 1; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.set .ctl { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.set input[type="number"] { width: 104px; min-height: 42px; padding: 0 12px; border-radius: 12px; text-align: right; font-size: 16px;
  font-variant-numeric: tabular-nums; color: var(--ink); background: rgba(255, 255, 255, .07); border: 1.5px solid var(--line); outline: none; }
.set input[type="number"]:focus, .set select:focus { border-color: var(--peri); }
.set select { min-height: 42px; padding: 0 12px; border-radius: 12px; font-size: 15px; color: var(--ink); background: #2b2d3a; border: 1.5px solid var(--line); outline: none; }
.switch { position: relative; width: 54px; height: 32px; border-radius: 99px; background: rgba(255, 255, 255, .14); transition: background .25s; }
.switch::after { content: ""; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: translate .25s var(--ease-pop); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch[aria-checked="true"] { background: var(--mint); }
.switch[aria-checked="true"]::after { translate: 22px 0; }
.settings .save-row { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.settings .save-row span { font-size: 13px; color: var(--ink-3); }

@media (max-width: 980px) {
  .stats, .units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .links, .settings { grid-template-columns: 1fr; }
  .days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topbar { border-radius: 24px; flex-wrap: wrap; }
  .topbar .brand em { display: none; }
  .search { width: 100%; margin-left: 0; }
  .nrow { grid-template-columns: 54px 1fr; }
  .nrow .acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ── 오늘 수업: 단계 열기 ── */
.stage-ctl { display: grid; gap: 14px; }
.stage-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stage-row h4 { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.stage-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stage-card {
  display: grid; gap: 6px; padding: 16px 18px; border-radius: 18px; text-align: left; min-width: 0;
  background: rgba(255, 255, 255, .05); border: 2px solid rgba(255, 255, 255, .1);
  transition: background .2s, border-color .2s, transform .2s var(--ease-pop), opacity .2s;
}
.stage-card:hover { background: rgba(255, 255, 255, .1); }
.stage-card:active { transform: scale(.98); }
.stage-card.on { border-color: rgba(255, 215, 122, .55); background: rgba(255, 215, 122, .08); }
.stage-card.now { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 215, 122, .16); }
.stage-card:not(.on) { opacity: .62; }
.stage-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stage-card .top b { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--yellow); }
.stage-card .min { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.stage-card strong { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.2; }
.stage-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); word-break: keep-all; }
.stage-card em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--ink-4); }
.stage-card.on em { color: var(--mint); }
.table .qtext { word-break: keep-all; overflow-wrap: anywhere; min-width: 220px; }
.table .ok { color: var(--mint); font-weight: 700; }
.table .warn { color: var(--yellow); font-weight: 700; }
.table .mono { font-family: var(--font-mono); font-size: 13px; color: var(--peri-2); }
@media (max-width: 760px) { .stage-cards { grid-template-columns: 1fr; } }

/* ── 연결·설정: 진짜로 나오게 하려면 ── */
.ready {
  grid-column: 1 / -1; padding: 18px 22px; border-radius: 18px;
  background: rgba(255, 215, 122, .08); border: 1.5px solid rgba(255, 215, 122, .4);
}
.ready.ok { background: rgba(139, 233, 183, .08); border-color: rgba(139, 233, 183, .4); }
.ready h3 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.ready ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.ready li.done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(139, 233, 183, .6); }
.ready li b { color: var(--ink); }
.keyrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.keyrow .input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; }

/* ── 오늘의 보드 ── */
.boards { display: grid; gap: 9px; }
.brow { display: grid; grid-template-columns: 22px 46px 1fr auto; align-items: center; gap: 14px; padding: 9px 14px 9px 10px; border-radius: 15px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.brow img { width: 46px; height: 62px; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.brow h3 { font-family: var(--font-display); font-weight: 400; font-size: 17px; line-height: 1.3; }
.brow p { font-size: 13px; color: var(--ink-3); line-height: 1.5; word-break: keep-all; }
.brow p b { color: var(--ink-2); font-weight: 600; }
.brow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.brow .btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.prog { height: 10px; margin: 14px 0 6px; border-radius: 99px; background: rgba(35, 32, 25, .1); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #8be9b7, #7c8cf8); transition: width .3s ease; }
@media (max-width: 640px) {
  .brow { grid-template-columns: 22px 46px 1fr; }
  .brow .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .bbar .search { order: 3; flex-basis: 100%; }
}

/* 아이들의 질문: 2단계 질문 점검 불 (꺼진 불은 흐리게) */
.qlamps { display: inline-flex; gap: 2px; margin-right: 6px; font-size: 12px; vertical-align: 1px; }
.qlamps .off { opacity: .28; filter: grayscale(1); }

/* 학생 보드: 골라 받기 */
.bbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 12px; }
.bbar .search { flex: 1; min-width: 200px; max-width: 360px; }
.bbar #bAll { margin-left: auto; }
.bcheck { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.bcheck input, .bpick input { width: 18px; height: 18px; accent-color: var(--yellow); cursor: pointer; }
.bpick { display: grid; place-items: center; cursor: pointer; }
.brow.on { border-color: rgba(255, 215, 122, .55); background: rgba(255, 215, 122, .07); }
.boards .empty { padding: 18px; text-align: center; font-size: 14px; color: var(--ink-3); }
