/* 용도: 출결관리 웹 UI 스타일. 모바일/태블릿/PC 반응형. 큰 이름·큰 버튼 우선. */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: #f4f5f7; color: #1c2430; line-height: 1.5; }
a { color: #2457d6; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; justify-content: space-between; align-items: center;
  background: #003876; color: #fff; padding: .55rem 1rem; border-bottom: 3px solid #c8a45c; }
.topbar a { color: #fff; }
.topbar a:hover { text-decoration: none; }
.brand { display: flex; align-items: center; gap: .6rem; }
.org-emblem { height: 30px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.org-name { font-size: .72rem; letter-spacing: .04em; opacity: .82; }
.brand-title { font-weight: 700; font-size: 1.05rem; }
.logout { font-size: .9rem; font-weight: 700; background: #c8a45c; color: #1c2430 !important;
  padding: .35rem .7rem; border-radius: 8px; white-space: nowrap; }
.logout:hover { background: #d9b978; }

.podium-warn { background: #fdf3e0; color: #8a5a00; border-bottom: 1px solid #f0d9ad;
  text-align: center; font-size: .82rem; padding: .4rem 1rem; }
.podium-warn a { color: #8a5a00; font-weight: 700; }

.wrap { max-width: 860px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .3rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.muted { color: #6b7686; font-size: .92rem; }
.hint { color: #8a94a3; font-size: .82rem; margin-top: .5rem; }
.err { background: #fde8e8; color: #b3261e; padding: .6rem .8rem; border-radius: 8px; }
code { background: #e9edf3; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }

.card { background: #fff; border: 1px solid #e3e7ee; border-radius: 12px;
  padding: 1rem 1.1rem; margin-bottom: 1rem; }

/* 상단 경로(브레드크럼) 네비게이션 */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .3rem;
  font-size: .9rem; margin: .1rem 0 .9rem; }
.crumbs a { color: #2457d6; padding: .2rem .1rem; }
.crumbs .sep { color: #9aa3b2; }
.crumbs .here { color: #6b7686; font-weight: 600; }

.btn-primary, .btn-secondary, button.rb, .btn-mini {
  font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid transparent; }
.btn-primary { background: #2457d6; color: #fff; padding: .6rem 1rem; font-weight: 600; }
.btn-secondary { background: #eef1f6; color: #1c2430; padding: .55rem .9rem; border-color: #d5dbe5;
  display: inline-block; }
.btn-primary.big { width: 100%; padding: .85rem; font-size: 1.05rem; margin-top: .4rem; }
.btn-mini { background: #eef1f6; border: 1px solid #d5dbe5; padding: .28rem .55rem; font-size: .82rem;
  border-radius: 6px; display: inline-block; }
.btn-mini.danger { background: #fdecec; border-color: #f2c4c4; color: #b3261e; }
button[disabled] { opacity: .5; cursor: default; }

.login-card { max-width: 360px; margin: 3rem auto; }
form label { display: block; margin: .6rem 0; font-size: .9rem; color: #4a5568; }
form input { width: 100%; padding: .6rem; margin-top: .25rem; border: 1px solid #cdd4df;
  border-radius: 8px; font: inherit; }
.inline-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.inline-form label { margin: 0; }
.inline-form input { width: auto; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.course-card h2 { color: #2457d6; }
.course-card:hover { border-color: #2457d6; text-decoration: none; }
.stat-line { font-size: .9rem; color: #4a5568; margin: .4rem 0 0; }

table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.grid th, table.grid td { border: 1px solid #e3e7ee; padding: .45rem .5rem; text-align: center; }
table.grid th { background: #f0f3f8; }
table.grid td:first-child, table.grid td:nth-child(2) { text-align: left; }

.student-links { columns: 2; list-style: none; padding: 0; }
.student-links li { margin: .2rem 0; }

.statbar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; background: #fff; border: 1px solid #e3e7ee;
  border-radius: 10px; padding: .7rem 1rem; margin-bottom: .8rem; font-size: .95rem; }
.statbar b { font-size: 1.05rem; }
.c-present { color: #1a7f45; }
.c-late { color: #b26a00; }
.c-absent { color: #b3261e; }
.c-excused { color: #6a3fb2; }

.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.session-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }

/* 호명형 */
.roll { background: #fff; border: 1px solid #e3e7ee; border-radius: 14px; padding: 1.5rem 1rem;
  text-align: center; }
.roll-progress { color: #6b7686; font-size: 1rem; }
.roll-name { font-size: 2.6rem; font-weight: 800; margin: .8rem 0 .2rem; word-break: keep-all; }
.roll-sub { color: #8a94a3; min-height: 1.2em; }
.roll-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1.2rem 0; }
.rb { padding: 1.1rem; font-size: 1.25rem; font-weight: 700; color: #fff; }
.rb-present { background: #1a7f45; }
.rb-late { background: #d18400; }
.rb-absent { background: #c62f28; }
.rb-excused { background: #6a3fb2; }
.rb.sel { outline: 4px solid #1c2430; outline-offset: 2px; }
.roll-nav { display: flex; gap: .7rem; }
.roll-nav button { flex: 1; padding: .9rem; font-size: 1.05rem; }
.roll-nav button:disabled { opacity: .4; cursor: default; }
.roll-current { margin-top: .8rem; color: #4a5568; font-weight: 600; min-height: 1.2em; }

/* 호명 완료 상태: 출결 버튼을 숨기고 완료 메시지를 강조 */
.roll-done .roll-btns { display: none; }
.roll-done .roll-name { color: #1a7f45; }

/* 목록형 - 학생별 상태 변경 행 */
.name-filter { flex: 1; min-width: 180px; padding: .55rem .7rem; border: 1px solid #cdd4df;
  border-radius: 8px; font: inherit; }
.rollrows { display: flex; flex-direction: column; gap: .5rem; }
.rollrow { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid #e3e7ee;
  border-radius: 10px; padding: .55rem .7rem; flex-wrap: wrap; }
.rollrow[hidden] { display: none; }
.rollrow-id { color: #8a94a3; font-size: .85rem; min-width: 1.6rem; text-align: right; }
.rollrow-name { font-weight: 700; font-size: 1.05rem; min-width: 4.5rem; flex: 1; }
.rollrow-btns { display: flex; gap: .35rem; flex-wrap: wrap; }
.sbtn { font: inherit; font-size: .9rem; cursor: pointer; padding: .5rem .7rem; border-radius: 8px;
  border: 1px solid #d5dbe5; background: #f4f6f9; color: #4a5568; min-width: 3rem; }
.sbtn.on { color: #fff; border-color: transparent; font-weight: 700; }
.sbtn-present.on { background: #1a7f45; }
.sbtn-late.on    { background: #d18400; }
.sbtn-absent.on  { background: #c62f28; }
.sbtn-excused.on { background: #6a3fb2; }
.sbtn-unset.on   { background: #6b7686; }

/* 지난 날짜 잠금 표시 + 비밀번호 재확인 모달 */
.lock-badge { display: inline-block; font-size: .72rem; color: #8a5a00; background: #fdf3e0;
  border: 1px solid #f0d9ad; border-radius: 6px; padding: 0 .3rem; vertical-align: middle; }
.lock-banner { background: #fdf3e0; border: 1px solid #f0d9ad; color: #8a5a00;
  border-radius: 10px; padding: .6rem .9rem; margin-bottom: .9rem; font-size: .9rem; }
.pw-modal { position: fixed; inset: 0; background: rgba(20, 28, 44, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.pw-modal[hidden] { display: none; }
.pw-box { background: #fff; border-radius: 14px; padding: 1.3rem; max-width: 360px; width: 100%; }
.pw-box h3 { margin: 0 0 .5rem; }
.pw-box input { width: 100%; padding: .6rem; margin: .6rem 0 .3rem; border: 1px solid #cdd4df;
  border-radius: 8px; font: inherit; }
.pw-actions { display: flex; gap: .6rem; margin-top: .8rem; }
.pw-actions button { flex: 1; padding: .7rem; }

/* 수강취소(withdrawn) 표시 */
.wd-badge { display: inline-block; font-size: .68rem; font-weight: 700; color: #b3261e;
  background: #fdecec; border: 1px solid #f2c4c4; border-radius: 5px; padding: 0 .3rem;
  vertical-align: middle; }
.rollrow-withdrawn { background: #fcf6f6; border-color: #f0d5d5; }
.rollrow-withdrawn .rollrow-name { color: #8a5560; }
.withdrawn-head { font-size: 1rem; margin: 1rem 0 .4rem; color: #b3261e; }
.withdrawn-list a { color: #8a5560; }

/* 청강생(audit) 표시 */
.au-badge { display: inline-block; font-size: .68rem; font-weight: 700; color: #0b5cad;
  background: #e7f1fb; border: 1px solid #b9d6f2; border-radius: 5px; padding: 0 .3rem;
  vertical-align: middle; }

/* 명단 관리 버튼 */
.btn-small { padding: .4rem .7rem; font-size: .85rem; white-space: nowrap; }
.roster-btn-row { margin-top: .9rem; border-top: 1px solid #e3e7ee; padding-top: .9rem; }

/* 명단 관리 표 */
.roster-manage td { vertical-align: middle; }
.roster-manage .row-off td { color: #8a5560; background: #fcf6f6; }
.roster-manage + .withdrawn-head { margin-top: 1.2rem; }
.roster-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.roster-actions form { display: inline; margin: 0; }
.btn-mini.restore { background: #e7f4ec; border-color: #b6ddc4; color: #1c6b3c; font-weight: 600; }

/* 팝업(모달) */
.modal { position: fixed; inset: 0; background: rgba(20, 28, 44, .55);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100;
  padding: 2.5rem 1rem; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 14px; padding: 1.3rem; max-width: 640px; width: 100%; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: .6rem; }
.modal-head h2 { margin: 0; }
.modal-close { background: #eef1f6; border: 1px solid #d5dbe5; border-radius: 8px;
  width: 2rem; height: 2rem; font-size: 1rem; cursor: pointer; flex-shrink: 0; }
.import-report { margin-top: 1rem; border-top: 1px solid #e3e7ee; padding-top: .8rem; }
.import-report table { margin-top: .5rem; }

.site-footer { text-align: center; color: #003876; font-size: .8rem; padding: 1.6rem 1rem 2.2rem;
  line-height: 1.7; border-top: 1px solid #e3e7ee; margin-top: 1rem; }
.site-footer p { margin: 0; color: #003876; }
.footer-org { font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  margin-bottom: .35rem !important; }

.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: #1c2430; color: #fff; padding: .55rem 1rem; border-radius: 20px; font-size: .9rem;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: .95; }

@media (max-width: 520px) {
  .roll-name { font-size: 2.1rem; }
  .student-links { columns: 1; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input { width: 100%; }
  .rollrow-btns { width: 100%; }
  .sbtn { flex: 1; }
  .modal { padding: 1rem .5rem; }
  .modal-box { padding: 1rem; }
}
