/* 10-24 교수님: 전 페이지 디자인 손보기 — 밝은 바탕 + 새 QR 화면의 남색·금색.
   style.css 위에 덮어쓰는 층이라, 이 파일을 빼면 예전 모습으로 돌아간다. 기능(JS)은 건드리지 않는다.
   원칙: 남색은 구조, 금색은 '지금 여기'(선택·현재·주의)에만. 숫자는 QR 화면처럼 굵고 크게. */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #0f1b2d;
  --muted: #5a6779;
  --line: #dfe5ee;
  --accent: #1b2f4b;
  --accent-soft: #e9eef6;
  --navy2: #13233a;
  --gold: #d99a1e;
  --gold-soft: #fdf3dd;
  --gold-ink: #8a5a00;
  --wait: #2563eb;
  --prog: #5b5bd6;
  --ok: #0f8a5f;
  --ok-soft: #e2f4ec;
  --warn: #a35a00;
  --warn-soft: #fff4e0;
  --bad: #c9362f;
  --bad-soft: #fdeceb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 18px rgba(15, 27, 45, .05);
}
body { background: var(--bg); letter-spacing: -0.01em; }
::selection { background: var(--gold-soft); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 머리말: 흰 바탕 아래 금색 가는 선 하나 — 사이트 전체의 표지 */
.brand { border-bottom: 0; box-shadow: inset 0 -3px 0 var(--gold), 0 1px 0 var(--line); }
.brand-title { color: var(--ink); border-left-color: var(--line); }
/* 첫 화면 띠: 남색 사선 + 금색 원호 (민트 → 금색) */
.band { background: linear-gradient(90deg, #f6f8fb, #edf1f7 60%); }
.band::after { background: linear-gradient(160deg, #24406a, var(--navy2)); }
.band .arc { border-color: rgba(217, 154, 30, .14); border-right-color: rgba(217, 154, 30, .6); }
.band ~ section.wrap .card { box-shadow: 0 14px 40px rgba(15, 27, 45, .10); }

/* 카드·제목 */
.card { border-color: var(--line); box-shadow: var(--shadow); }
.card h1, h1 { color: var(--ink); font-weight: 800; letter-spacing: -0.03em; }
.admin h1 { font-size: 26px; }
.admin h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.sub { color: var(--muted); }

/* 버튼: 남색 꽉 찬 것 = 할 일, 흰 것 = 보조 */
.btn { border-radius: 10px; border-color: var(--line); font-weight: 600; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: #c4cfde; background: #f8fafc; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: #24406a; border-color: #24406a; }
.btn.danger:hover:not(:disabled) { background: #b02d27; }
.openbtn.on { background: var(--ok); border-color: var(--ok); }
.openbtn.on:hover:not(:disabled) { background: #0c7751; }
.mini { border-radius: 8px; font-weight: 600; }

/* 입력 */
label.field input, .form-grid input[type=text], .form-grid input[type=number], .form-grid input[type=date],
.form-grid input[type=time], .form-grid input[type=datetime-local], textarea.roster, select {
  border-color: var(--line); border-radius: 10px; }
label.field input:focus, .form-grid input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* 꼭 읽으세요: 금색 왼쪽 띠 */
.rules { background: var(--gold-soft); border: 1px solid #f1dcaa; border-left: 4px solid var(--gold); border-radius: 10px; }
.rules strong { color: var(--gold-ink); }

/* 꼬리표 */
.pill { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag { font-weight: 600; padding: 2px 9px; }
.tag.run { background: var(--accent-soft); color: var(--accent); }

/* 표 */
.tablewrap { border-radius: 14px; border-color: var(--line); box-shadow: var(--shadow); }
th { background: #f7f9fc; color: var(--muted); font-weight: 700; font-size: 13px; }
tbody tr:hover td { background: #fafbfd; }
tr.sel td { background: var(--accent-soft); }

/* 현황 숫자판: QR 화면처럼 굵은 숫자, 위에 색 띠로 무엇의 숫자인지 */
.stat { border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--accent); }
.stat b { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); }
.stat span { font-weight: 600; }

/* 탭 */
.tabs { background: #e9edf4; }
.tab.on { color: var(--ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .10); }

/* 대기실 */
.lobby-state { background: #f7f9fc; border-radius: 14px; }
.dots i { background: var(--accent); }
.startbig { border-radius: 14px; font-weight: 800; }
.startbig.ready { background: var(--ok); border-color: var(--ok); }
.waitlist span { background: #e7efff; color: var(--wait); border-color: #c9dafc; font-weight: 600; }
.waitlist span.off { background: #f1f3f6; color: var(--muted); border-color: var(--line); font-weight: 500; }

/* 시험 화면: 위 막대 아래 금색 선, 남은 시간은 크게 */
.topbar { box-shadow: inset 0 -2px 0 var(--gold); border-bottom: 0; }
.topbar .timer { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.qno { color: var(--accent); }
.qtext { color: var(--ink); }
.choice { border-radius: 12px; transition: border-color .12s, background .12s; }
.choice:hover { border-color: #c4cfde; }
.choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.choice.sel .mk { background: var(--accent); border-color: var(--accent); }
.grid button { border-radius: 7px; }
.grid button.done { background: var(--accent); border-color: var(--accent); }
.grid button.cur { outline: 2px solid var(--gold); }
.essay-input:focus { border-color: var(--accent); }

/* 덮개·끝 화면 */
.overlay { background: rgba(15, 27, 45, .72); }
.ended .score { font-size: 48px; letter-spacing: -0.03em; color: var(--ink); }

/* 조별 평가 */
.examrow { border-radius: 14px; transition: border-color .12s, background .12s; }
.examrow:hover { border-color: var(--accent); background: #f6f8fc; }
.examrow.on { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }
.lv { border-radius: 10px; }
.lv.sel { border-color: var(--accent); background: var(--accent-soft); }
.livenow { border-color: var(--accent); background: #eef3fa; border-radius: 16px; }
.livenow .dot { background: var(--bad); }
.livebtn { border-radius: 14px; }
.livebtn.now { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--gold); }
.livebtn.done { background: #f2f8f5; }
.pvbanner { background: var(--gold-soft); color: var(--gold-ink); border-bottom-color: #f1dcaa; }
.previewbox { background: #f9fafc; }

/* 링크: 파란 밑줄 대신 남색 굵은 글자, 올리면 금색 밑줄 */
a { color: var(--accent); }
.admin a:not(.btn), .tablewrap a:not(.btn) { color: var(--ink); text-decoration: none; }
.admin a:not(.btn):hover, .tablewrap a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a.btn { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
a.btn.primary { color: #fff; }
/* 학기 묶음 줄: 남색 띠 */
tr.termrow td { background: var(--accent) !important; color: #fff; font-size: 14px; letter-spacing: 0; }
tr.termrow td .muted { color: #b9c6d8; }
/* 페이지 제목 */
.admin > .toolbar h1, .admin h1 { font-size: 30px; letter-spacing: -0.035em; }
.admin { padding-top: 28px; }
/* 표 안 숫자 정렬 */
td.num, th.num { font-variant-numeric: tabular-nums; }
td.num { font-weight: 600; }

/* 시험 관리 숫자판: QR 화면과 같은 뜻의 색 (대기·응시 중·제출·이탈 종료·평균·미응시 순) */
#examView .stat:nth-child(1) { border-top-color: var(--wait); }
#examView .stat:nth-child(1) b { color: var(--wait); }
#examView .stat:nth-child(2) { border-top-color: var(--prog); }
#examView .stat:nth-child(2) b { color: var(--prog); }
#examView .stat:nth-child(3) { border-top-color: var(--ok); }
#examView .stat:nth-child(3) b { color: var(--ok); }
#examView .stat:nth-child(4) { border-top-color: var(--bad); }
#examView .stat:nth-child(4) b { color: var(--bad); }
#examView .stat:nth-child(5) { border-top-color: var(--gold); background: var(--gold-soft); }
#examView .stat:nth-child(5) b { color: var(--gold-ink); }
#examView .stat:nth-child(6) { border-top-color: #9aa6b8; }

/* ── 2차(10-24 "별 차이가 없다"): 더 과감하게 ── */
body { background: #eef1f6; }
/* 머리말: 남색 띠 + 금색 선, 로고는 흰 알약 안에 */
.brand { background: var(--navy2); box-shadow: inset 0 -3px 0 var(--gold); }
.brand-in { padding: 12px 24px; }
.brand img { background: #fff; border-radius: 10px; padding: 4px 8px; height: 38px; }
.brand-title { color: #fff; border-left-color: rgba(255,255,255,.18); font-size: 18px; }
.brand-org { color: #b9c6d8; }
/* 관리 화면 첫 줄(제목·버튼)을 남색 띠로 이어 붙인다 — 화면 끝까지 */
.admin { padding-top: 0; }
.admin > .toolbar:first-child {
  background: var(--navy2); color: #fff; margin: 0 0 24px; padding: 26px 0 30px;
  box-shadow: 0 0 0 100vmax var(--navy2); clip-path: inset(0 -100vmax); }
.admin > .toolbar:first-child h1, .admin > .toolbar:first-child h1 * { color: #fff; }
.admin > .toolbar:first-child .muted, .admin > .toolbar:first-child span { color: #b9c6d8; }
.admin > .toolbar:first-child .btn, .admin > .toolbar:first-child a.btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.22); color: #fff; }
.admin > .toolbar:first-child .btn:hover { background: rgba(255,255,255,.14); }
.admin > .toolbar:first-child .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--navy2); font-weight: 800; }
.admin > .toolbar:first-child .btn.primary:hover { background: #e8ab2e; }
/* 카드: 테두리 없이 넓은 여백 */
.admin .card, .evwrap .card { border: 0; border-radius: 18px; box-shadow: 0 1px 2px rgba(15,27,45,.04), 0 10px 30px rgba(15,27,45,.06); }
.admin .card { padding: 22px 24px; }
.tablewrap { border: 0; border-radius: 16px; box-shadow: 0 1px 2px rgba(15,27,45,.04), 0 10px 30px rgba(15,27,45,.06); }
th, td { padding: 12px 14px; }
th { background: #f1f4f9; color: #3d4a5c; font-size: 13px; border-bottom: 1px solid #e3e8f0; }
.stat { border: 0; border-top: 4px solid var(--accent); border-radius: 16px; padding: 16px 18px; }
.stat b { font-size: 34px; }
/* 학생 첫 화면: 남색 띠를 크게, 카드는 그 위에 */
.band { height: 220px; background: var(--navy2); }
.band::after { background: linear-gradient(160deg, #28497a, #1a2e4c); opacity: .9; }
.band .arc { border-color: rgba(217,154,30,.16); border-right-color: rgba(217,154,30,.75); width: 320px; height: 320px; }
.band ~ section.wrap { margin-top: -170px; }
.band ~ section.wrap .card { border: 0; border-radius: 20px; box-shadow: 0 20px 50px rgba(15,27,45,.18); }
.card h1 { font-size: 26px; }
.btn.primary.block { min-height: 54px; font-size: 18px; font-weight: 800; border-radius: 12px; }
/* 시험 위 막대: 남색 */
.topbar { background: var(--navy2); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
.topbar .who, .topbar .count, .topbar .save { color: #b9c6d8; }
.topbar .timer { color: #fff; }
.topbar .timer.low { color: #ffb4ae; }
.topbar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
/* 조별 평가 학생 위 막대도 같은 남색 */
#main > .topbar b, #main > .topbar .who, #main > .topbar .count { color: #fff; }
@media (max-width: 599px) {
  .band { height: 160px; } .band ~ section.wrap { margin-top: -120px; }
  .admin > .toolbar:first-child { padding: 18px 0 22px; }
}

/* ── 3차: 시험 하나 관리 화면을 대시보드로 (10-24 교수님 "다시") ── */
#examView:not(.hidden) { display: flex; flex-direction: column; }
#examView > .toolbar:first-child { order: -3; margin-bottom: 0; padding-bottom: 14px; }
/* 시험 정보·학생 링크 줄: 남색 머리 띠 안으로 */
#examView > .toolbar:first-child + .card {
  order: -2; background: var(--navy2); color: #fff; border: 0; border-radius: 0; margin: 0 0 22px !important;
  padding: 0 0 26px !important; box-shadow: 0 0 0 100vmax var(--navy2); clip-path: inset(0 -100vmax 0 -100vmax); }
#examView > .toolbar:first-child + .card .pill { background: rgba(217,154,30,.18); color: #f3c76b; font-size: 14px; padding: 5px 12px; }
#examView > .toolbar:first-child + .card .muted { color: #b9c6d8; }
#examView > .toolbar:first-child + .card code { background: rgba(255,255,255,.08); color: #e6edf7; padding: 5px 10px; border-radius: 8px; }
#examView > .toolbar:first-child + .card .btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.22); color: #fff; }
#examView > .toolbar:first-child + .card #qrBtn { background: var(--gold); border-color: var(--gold); color: var(--navy2); font-weight: 800; }
/* 현황 숫자판: 맨 위, 한 장짜리 띠로 (QR 화면처럼 큰 숫자) */
#examView > .stats { order: -1; background: #fff; border-radius: 18px; gap: 0; padding: 6px 0;
  box-shadow: 0 1px 2px rgba(15,27,45,.04), 0 10px 30px rgba(15,27,45,.06); margin-bottom: 18px; }
#examView .stats .stat { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 14px 22px;
  border-left: 1px solid #e8ecf3; }
#examView .stats .stat:first-child { border-left: 0; }
#examView .stats .stat b { font-size: 42px; line-height: 1.05; }
#examView .stats .stat span { display: flex; align-items: center; gap: 6px; }
#examView .stats .stat span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .0; }
#examView .stats .stat:nth-child(1) span::before { background: var(--wait); opacity: 1; }
#examView .stats .stat:nth-child(2) span::before { background: var(--prog); opacity: 1; }
#examView .stats .stat:nth-child(3) span::before { background: var(--ok); opacity: 1; }
#examView .stats .stat:nth-child(4) span::before { background: var(--bad); opacity: 1; }
#examView .stats .stat:nth-child(5) { background: var(--gold-soft); border-radius: 12px; margin: 0 6px; border-left: 0; }
#examView .stats .stat:nth-child(5) span::before { background: var(--gold); opacity: 1; }
#examView .stats .stat:nth-child(6) span::before { background: #9aa6b8; opacity: 1; }
/* 시험 시작 버튼: 금색, 크게 (진행 중이면 원래대로 초록) */
#examView #openBtn:not(.on) { background: var(--gold); border-color: var(--gold); color: var(--navy2); font-weight: 800; min-height: 56px; padding: 10px 28px; font-size: 19px; }
#examView #openBtn:not(.on):hover { background: #e8ab2e; }
/* 칸 제목 앞 금색 짧은 막대 */
#examView .card h2 { display: flex; align-items: center; gap: 10px; }
#examView .card h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--gold); flex: none; }
@media (max-width: 899px) {
  #examView .stats .stat { border-left: 0; border-top: 1px solid #e8ecf3; }
  #examView .stats .stat b { font-size: 32px; }
}

/* 기록 표(문자 보낸 기록 등): 낮은 줄, 약 8줄 높이 상자 안에서 스크롤, 머리줄 고정, 긴 칸은 한 줄 … (11-02 교수님) */
/*   응시 현황 표도 같은 모양(.compact + .logbox.tall), 폰 폭에서는 상자 안 가로 스크롤 */
.tablewrap.logbox { max-height: 300px; overflow: auto; overscroll-behavior: contain; }
.tablewrap.logbox.tall { max-height: 440px; }
table.compact th, table.compact td { padding: 6px 10px; font-size: 13px; line-height: 1.35; }
table.compact th { position: sticky; top: 0; z-index: 1; box-shadow: inset 0 -1px 0 #e3e8f0; }
table.compact .tag { padding: 1px 8px; font-size: 12px; }
table.compact .btn.mini { padding: 2px 8px; min-height: 0; font-size: 12px; line-height: 1.5; border-radius: 7px; }
table.compact td .btn.mini + .btn.mini { margin-left: 2px; }
.logtable { table-layout: fixed; min-width: 560px; }
.logtable td { vertical-align: top; }
.logtable td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.logtable td.clip.open { white-space: pre-wrap; word-break: break-all; }

/* 설정 칸 입력칸 묶음: 내용 폭 때문에 칸이 밀려나지 않게, 폰 폭에서는 한 줄에 하나 (11-02 교수님) */
.form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grid > * { min-width: 0; }
.form-grid input, .form-grid select { max-width: 100%; min-width: 0; box-sizing: border-box; }
.form-grid select { width: 100%; }
@media (max-width: 599px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* 좁은 화면에서 숫자판 */
@media (max-width: 599px) { .stat b { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { .btn, .choice, .examrow { transition: none; } }
