:root{
    --bg:#f4f6fa; --surface:#fff; --sidebar:#182238; --sidebar2:#23304b;
    --text:#1f2937; --muted:#667085; --line:#e4e7ec;
    --primary:#4c648d; --primary2:#385078; --pink:#f07b92;
    --danger:#d92d20; --success:#067647; --warning:#b54708;
}
*{box-sizing:border-box}
body{margin:0;font-family:"Malgun Gothic","Apple SD Gothic Neo",Arial,sans-serif;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}
.app{min-height:100vh;display:flex}
.sidebar{position:fixed;inset:0 auto 0 0;width:220px;background:var(--sidebar);color:#d4dbea;padding:15px 12px;overflow-y:auto;z-index:30}
.brand{height:74px;display:flex;align-items:center;justify-content:center;margin-bottom:6px}
.brand img{max-width:175px;max-height:65px;object-fit:contain}
.sidebar nav{display:flex;flex-direction:column;gap:3px}
.sidebar nav a{padding:9px 12px;border-radius:8px;font-size:13px}
.sidebar nav a:hover,.sidebar nav a.active{background:rgba(255,255,255,.11);color:white}
.nav-title{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#8996ad;margin:13px 10px 3px}
.main{margin-left:220px;width:calc(100% - 220px)}
.topbar{height:62px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 24px;position:sticky;top:0;z-index:20}
.topbar strong{font-size:17px}
.class-selector{margin-left:auto;display:flex;align-items:center;gap:8px}
.class-selector label{font-size:12px;color:var(--muted)}
.class-selector select{min-width:145px}
.menu-btn{display:none;border:0;background:transparent;font-size:24px;cursor:pointer}
.content{padding:22px 24px 45px}
.flash{padding:11px 14px;border-radius:9px;margin-bottom:14px;background:#eef2ff;border:1px solid #c7d2fe}
.flash.success{background:#ecfdf3;border-color:#abefc6;color:#067647}
.flash.error{background:#fef3f2;border-color:#fecdca;color:#b42318}
.card{background:white;border:1px solid var(--line);border-radius:13px;padding:18px;box-shadow:0 3px 12px rgba(16,24,40,.035)}
.card h2,.card h3{margin-top:0}
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.stat .label{font-size:12px;color:var(--muted)}
.stat .value{font-size:27px;font-weight:800;margin-top:8px}
.grid-2{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(320px,.7fr);gap:18px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.stack{display:flex;flex-direction:column;gap:14px}
.toolbar{display:flex;gap:9px;align-items:center;justify-content:space-between;margin-bottom:14px;flex-wrap:wrap}
.filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
input,select,textarea{font:inherit;padding:9px 10px;border:1px solid #d0d5dd;border-radius:8px;background:white;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(76,100,141,.1)}
input[type="checkbox"],input[type="radio"]{width:auto}
textarea{width:100%;resize:vertical}
.button,button.button{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:var(--primary);color:white;padding:9px 13px;min-height:38px;font-weight:700;cursor:pointer;white-space:nowrap}
.button:hover{background:var(--primary2)}
.button.secondary{background:#eef2f6;color:#344054}
.button.pink{background:var(--pink)}
.button.danger{background:var(--danger)}
.button.small{padding:5px 8px;min-height:28px;font-size:11px}
.table-wrap{overflow:auto;border-radius:8px}
table{border-collapse:collapse;width:100%;min-width:720px}
th,td{padding:10px 9px;border-bottom:1px solid var(--line);text-align:left;font-size:12px;vertical-align:top}
th{background:#fafbfc;color:var(--muted);font-weight:800;position:sticky;top:0}
tr:hover td{background:#fbfcfe}
.badge{display:inline-block;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800;background:#eef2f6;color:#475467}
.badge.green{background:#ecfdf3;color:#067647}
.badge.red{background:#fef3f2;color:#b42318}
.badge.blue{background:#eef4ff;color:#3538cd}
.form-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px}
.field label{display:block;font-size:11px;font-weight:800;color:#475467;margin-bottom:5px}
.field input,.field select,.field textarea{width:100%}
.muted{color:var(--muted)}
.empty{text-align:center;color:var(--muted);padding:30px!important}
.student-list{display:flex;flex-direction:column;gap:4px;max-height:590px;overflow:auto}
.student-list a{padding:9px 10px;border-radius:7px;background:#f8fafc;font-size:12px}
.student-list a.current{background:#e9eef7;color:#233c68;font-weight:800}
.log-box{max-height:560px;overflow:auto;background:#fafafa;border:1px solid var(--line);border-radius:9px;padding:12px}
.log-day{padding:9px 0;border-bottom:1px solid var(--line)}
.split{display:grid;grid-template-columns:250px minmax(0,1fr);gap:16px}
.message-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px}
.message-paper{background:white;border:1px solid #cfd4dc;border-radius:8px;padding:25px;min-height:650px}
.message-title{text-align:center;font-size:20px;font-weight:800;margin-bottom:7px}
.message-sub{text-align:center;color:#475467;margin-bottom:20px}
.bar-row{display:grid;grid-template-columns:145px minmax(150px,1fr) 55px;gap:8px;align-items:center;margin:8px 0;font-size:12px}
.bar-bg{height:12px;background:#e7e9ee;border-radius:99px;overflow:hidden}
.bar{height:100%;background:var(--primary);border-radius:99px}
.score-row{display:grid;grid-template-columns:minmax(120px,1fr) 100px 120px;gap:10px;padding:7px 0;border-bottom:1px solid #f0f1f3;font-size:12px}
.logo-footer{text-align:center;margin-top:30px}
.logo-footer img{max-width:270px;max-height:90px}
.calendar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:#dfe3ea;border:1px solid #dfe3ea}
.cal-label,.cal-day{background:white;min-height:72px;padding:7px;font-size:11px}
.cal-label{min-height:32px;text-align:center;font-weight:800;background:#f8fafc}
.cal-day.empty-day{background:#fafafa}
.cal-day.event{background:#fff9e8}
.cal-day.holiday .day-num{color:#d92d20}
.cal-day.selected{outline:3px solid #91a4c5;outline-offset:-3px}
.day-num{font-weight:800}
.event-dot{width:6px;height:6px;border-radius:50%;background:var(--pink);display:inline-block;margin-left:4px}
.chart-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:white}
.chart-legend{display:flex;gap:18px;font-size:11px;margin-bottom:8px}
.legend-line{display:inline-block;width:26px;height:3px;vertical-align:middle;margin-right:5px;background:#315efb}
.legend-line.avg{background:#e0a000}
.small-note{font-size:11px;color:var(--muted)}
.inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.section-title{font-size:14px;font-weight:800;margin:3px 0 12px}
.danger-zone{border:1px solid #fecdca;background:#fffafa}
@media(max-width:1000px){
    .sidebar{transform:translateX(-100%);transition:.2s}
    .sidebar.open{transform:translateX(0)}
    .main{margin-left:0;width:100%}
    .menu-btn{display:block}
    .cards{grid-template-columns:repeat(2,1fr)}
    .grid-2,.grid-3,.split,.message-layout{grid-template-columns:1fr}
    .form-grid{grid-template-columns:repeat(2,1fr)}
    .content{padding:15px}
}
@media(max-width:620px){
    .cards,.form-grid{grid-template-columns:1fr}
    .class-selector label{display:none}
    .class-selector select{min-width:110px}
}


/* ─────────────────────────────────────────
   로그인 화면
   ───────────────────────────────────────── */
.auth-body{
    min-height:100vh;
    background:#f4f6fa;
}
.auth-shell{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}
.auth-card{
    width:min(440px,100%);
    background:white;
    border:1px solid var(--line);
    border-radius:18px;
    padding:34px;
    box-shadow:0 14px 40px rgba(16,24,40,.09);
}
.auth-logo{
    display:flex;
    justify-content:center;
    margin-bottom:22px;
}
.auth-logo img{
    width:190px;
    max-height:85px;
    object-fit:contain;
}
.auth-title{
    margin:0;
    text-align:center;
    font-size:23px;
}
.auth-desc{
    margin:8px 0 24px;
    text-align:center;
    color:var(--muted);
    font-size:13px;
    line-height:1.6;
}
.auth-form{
    display:flex;
    flex-direction:column;
    gap:15px;
}
.auth-button{
    width:100%;
    margin-top:5px;
    min-height:44px;
}

/* ─────────────────────────────────────────
   상단 로그인 사용자
   ───────────────────────────────────────── */
.user-menu{
    display:flex;
    align-items:center;
    gap:8px;
    margin-left:4px;
    padding-left:12px;
    border-left:1px solid var(--line);
}
.user-name{
    font-size:12px;
    font-weight:800;
    color:#475467;
}
.user-menu form{
    margin:0;
}
.logout-button{
    border:1px solid #d0d5dd;
    border-radius:7px;
    background:white;
    color:#475467;
    padding:6px 8px;
    font-size:11px;
    cursor:pointer;
}
.logout-button:hover{
    background:#f8fafc;
}


/* ===== 문자전송 v5: 웹 3단 레이아웃 ===== */
.msg3{
  display:grid;
  grid-template-columns:230px minmax(520px,1fr) 350px;
  gap:16px;
  align-items:start;
}
.msg3-left,.msg3-center,.msg3-right{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 3px 12px rgba(16,24,40,.035);
}
.msg3-left,.msg3-right{
  padding:14px;
  position:sticky;
  top:78px;
}
.msg3-center{padding:18px;min-width:0}

.msg3-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line)
}
.msg3-head strong{display:block;font-size:16px}
.msg3-head small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.msg3-head>span{
  background:#eef2ff;color:#3448a5;border-radius:999px;
  padding:5px 9px;font-size:10px;font-weight:800
}

.msg3-students{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:calc(100vh - 185px);
  overflow:auto
}
.msg3-student{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  background:#f8fafc;
  border:1px solid transparent;
  border-radius:8px
}
.msg3-student:hover{background:#f0f4fa;border-color:#d8e0ec}
.msg3-student.active{background:#e7edf7;border-color:#b9c8df;color:#233c68}
.msg3-student b{font-size:12px}
.msg3-student small{
  font-size:9px;color:var(--muted);max-width:80px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}

.msg3-weekbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:13px
}
.msg3-weeknav{display:flex;gap:5px}
.msg3-weeknav a{
  display:flex;align-items:center;justify-content:center;
  height:34px;min-width:34px;padding:0 10px;
  background:#eef2f6;border-radius:8px;
  font-size:12px;font-weight:800
}
.msg3-weeknav .today{min-width:68px}
.msg3-period{font-size:11px;color:var(--muted);font-weight:700}

.msg3-titlebox{
  padding:16px 17px;
  margin-bottom:11px;
  border-radius:11px;
  background:linear-gradient(135deg,#f4f7fb,#eef2f8)
}
.msg3-titlebox h2{
  font-size:19px;
  margin:0 0 8px;
  letter-spacing:-.03em
}
.msg3-titlebox>div{
  display:flex;gap:8px;align-items:center;
  flex-wrap:wrap;font-size:11px;color:#475467
}
.msg3-titlebox span{
  padding-left:8px;
  border-left:1px solid #cfd6df
}

.msg3-card{
  border:1px solid var(--line);
  border-radius:11px;
  padding:14px;
  margin-top:10px
}
.msg3-cardhead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px
}
.msg3-cardhead h3{font-size:14px;margin:0}
.msg3-cardhead small{font-size:10px;color:var(--muted)}

.msg3-attendance{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:7px
}
.msg3-attendance>div{
  padding:9px 6px;border-radius:8px;text-align:center;
  display:flex;flex-direction:column;gap:3px
}
.msg3-attendance span{font-size:9px}
.msg3-attendance b{font-size:13px}
.msg3-attendance .present{background:#ecfdf3;color:#067647}
.msg3-attendance .late{background:#fffaeb;color:#b54708}
.msg3-attendance .absent{background:#fef3f2;color:#b42318}
.msg3-attendance .early{background:#eff8ff;color:#175cd3}

.msg3-assignment{
  display:grid;
  grid-template-columns:92px minmax(150px,1fr) 42px;
  gap:8px;
  align-items:center;
  margin:8px 0
}
.msg3-assignment>span{font-size:10px;color:#475467}
.msg3-assignment>b{font-size:10px;text-align:right}
.msg3-assignment .track{
  height:10px;background:#eaecf0;border-radius:999px;overflow:hidden
}
.msg3-assignment .track i{
  display:block;height:100%;background:#4c648d;border-radius:999px
}

.msg3-tablewrap{overflow-x:auto}
.msg3-table{min-width:540px}
.msg3-table th,.msg3-table td{font-size:10px;padding:8px 7px}
.msg3-table th{position:static}
.msg3-table .testname{white-space:normal;line-height:1.35;max-width:240px}
.msg3-table .blue{color:#315efb}
.msg3-table .diff{
  display:inline-block;padding:3px 6px;
  border-radius:999px;font-weight:800
}
.msg3-table .diff.plus{background:#ecfdf3;color:#067647}
.msg3-table .diff.minus{background:#fef3f2;color:#b42318}

.msg3-progress{
  background:#f8fafc;border-radius:8px;
  padding:12px;line-height:1.7;font-size:11px
}

.msg3-ment{
  width:100%;
  min-height:500px;
  margin-top:12px;
  padding:13px;
  line-height:1.75;
  font-size:12px;
  border-radius:9px;
  resize:vertical
}
.msg3-actions{
  display:grid;
  grid-template-columns:1fr 82px;
  gap:7px;
  margin-top:9px
}
.msg3-help{
  margin-top:12px;
  background:#f8fafc;
  border-radius:8px;
  padding:11px;
  color:#667085;
  font-size:10px;
  line-height:1.6
}
.msg3-empty{
  padding:20px;
  text-align:center;
  color:var(--muted);
  font-size:11px
}
.msg3-empty.large{padding:100px 20px}

@media(max-width:1300px){
  .msg3{grid-template-columns:200px minmax(460px,1fr) 310px}
}
@media(max-width:1080px){
  .msg3{grid-template-columns:200px minmax(0,1fr)}
  .msg3-right{grid-column:1/-1;position:static}
  .msg3-ment{min-height:260px}
}
@media(max-width:720px){
  .msg3{grid-template-columns:1fr}
  .msg3-left,.msg3-right{position:static}
  .msg3-students{max-height:240px}
  .msg3-attendance{grid-template-columns:repeat(2,1fr)}
}

.app-version{
    margin:18px 10px 4px;
    padding-top:10px;
    border-top:1px solid rgba(255,255,255,.08);
    color:#71809a;
    font-size:9px;
    text-align:center;
}


/* v5.2 문자전송 이미지 복사 */
.msg3-weektools{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.button.compact{padding:7px 10px;font-size:11px;min-height:auto}
.msg3-image-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:2px 2px 0}
.msg3-image-actions small{color:var(--muted);font-size:10px;margin-left:2px}
@media(max-width:900px){
  .msg3-weekbar{align-items:flex-start;gap:8px}
  .msg3-weektools{justify-content:flex-start}
}

/* v5.2.5 - 문자전송 멘트 이미지 포함 체크 */
.msg3-include-ment{
  display:flex;
  align-items:flex-start;
  gap:9px;
  margin-top:10px;
  padding:10px 11px;
  border:1px solid #dbe2ea;
  border-radius:9px;
  background:#f8fafc;
  cursor:pointer;
}
.msg3-include-ment input{
  width:16px;
  height:16px;
  margin:2px 0 0;
  accent-color:#4c648d;
}
.msg3-include-ment span{display:flex;flex-direction:column;gap:2px;line-height:1.35}
.msg3-include-ment b{font-size:11px;color:#172033}
.msg3-include-ment small{font-size:9px;color:#667085;font-weight:400}

/* v5.2.6 - 이미지 추가내용을 항목별 체크/입력 */
.msg-extra-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}
.msg-extra-item{
  border:1px solid #dbe2ea;
  border-radius:10px;
  background:#f8fafc;
  padding:10px;
}
.msg-extra-check{
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  margin-bottom:7px;
}
.msg-extra-check input{
  width:16px;
  height:16px;
  margin:0;
  accent-color:#4c648d;
}
.msg-extra-check b{
  font-size:11px;
  color:#172033;
}
.msg-extra-text{
  width:100%;
  min-height:68px;
  padding:9px 10px;
  border:1px solid #d0d7e2;
  border-radius:8px;
  background:#fff;
  color:#172033;
  font-size:11px;
  line-height:1.55;
  resize:vertical;
}
.msg-extra-text:focus{
  outline:none;
  border-color:#7188ad;
  box-shadow:0 0 0 2px rgba(76,100,141,.10);
}
.msg3-actions.single{
  grid-template-columns:1fr;
}

/* ===== v5.3.5 대시보드 일정 / 보충일정 ===== */
.dashboard-schedule-grid{
    display:grid;
    grid-template-columns:minmax(360px,.85fr) minmax(520px,1.4fr);
    gap:18px;
    align-items:start;
}
.dash-events{display:flex;flex-direction:column;gap:7px}
.dash-events.upcoming{max-height:520px;overflow:auto;padding-right:4px}
.dash-event-row{
    display:grid;
    grid-template-columns:82px minmax(0,1fr);
    gap:10px;
    align-items:center;
    padding:10px 0;
    border-bottom:1px solid var(--line);
}
.dash-event-row.future{grid-template-columns:54px 82px minmax(0,1fr)}
.dash-event-date{display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}
.dash-event-date strong{font-size:13px}
.dash-event-date span{font-size:10px;color:var(--muted);margin-top:3px}
.dash-event-type{
    display:inline-flex;align-items:center;justify-content:center;
    min-height:28px;padding:4px 7px;border-radius:8px;
    font-size:10px;font-weight:800;background:#eef2f6;color:#475467;
}
.dash-event-type.makeup{background:#eef4ff;color:#3538cd}
.dash-event-type.fixed{background:#ecfdf3;color:#067647}
.dash-event-type.schedule{background:#fff4e8;color:#b54708}
.dash-event-main{min-width:0;font-size:12px;line-height:1.55}
.dash-event-time{display:inline-block;margin-right:7px;color:#344054}
.dash-event-memo{margin-top:2px;color:var(--muted);font-size:11px;white-space:pre-wrap}
.dash-empty{padding:35px 10px!important}

.makeup-grid{
    display:grid;
    grid-template-columns:330px minmax(0,1fr);
    gap:18px;
    align-items:start;
}
.makeup-form-card{position:sticky;top:78px}
.makeup-time-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.makeup-duration-box{
    margin-top:10px;padding:11px 12px;border-radius:9px;
    background:#f7f9fc;border:1px solid var(--line);
    display:flex;align-items:center;justify-content:space-between;
    font-size:12px;
}
.makeup-duration-box strong{font-size:15px;color:#233c68}
.fixed-clinic-toggle{
    margin-top:12px;padding:12px;border:1px solid #cfd8e8;border-radius:10px;
    background:#f7f9ff;display:flex;gap:10px;align-items:flex-start;cursor:pointer;
}
.fixed-clinic-toggle input{margin-top:3px}
.fixed-clinic-toggle span{display:flex;flex-direction:column;gap:3px}
.fixed-clinic-toggle strong{font-size:12px}
.fixed-clinic-toggle small{font-size:10px;line-height:1.45;color:var(--muted)}
.makeup-table{min-width:760px}
.makeup-actions{white-space:nowrap}
.makeup-actions form{display:inline;margin-left:4px}

@media(max-width:1100px){
    .dashboard-schedule-grid,.makeup-grid{grid-template-columns:1fr}
    .makeup-form-card{position:static}
}

/* ===== v5.3.6 대시보드 전체 통합 / 반별 재원생 ===== */
.dashboard-class-section{margin-top:20px}
.dashboard-class-head{margin-bottom:10px}
.dashboard-class-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(240px,1fr));
    gap:14px;
}
.dash-class-card{padding:15px 16px}
.dash-class-title{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid var(--line);
}
.dash-class-title>strong{font-size:14px;color:#233c68}
.dash-class-students{display:flex;flex-wrap:wrap;gap:7px}
.dash-student-chip{
    display:inline-flex;align-items:center;gap:5px;
    padding:6px 9px;border-radius:8px;background:#f7f9fc;border:1px solid #e6eaf0;
    font-size:11px;
}
.dash-student-chip small{color:var(--muted);font-size:9px}
@media(max-width:1200px){.dashboard-class-grid{grid-template-columns:repeat(2,minmax(240px,1fr))}}
@media(max-width:700px){.dashboard-class-grid{grid-template-columns:1fr}}

/* ===== v5.4.0 시험관리 / 학생 전용 자동채점 ===== */
.exam-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.exam-toolbar h2{font-size:18px;color:#172033}
.muted{color:var(--muted)}
.exam-table{min-width:980px}
.exam-actions{white-space:nowrap}
.exam-actions form{display:inline-block;margin-left:4px}
.exam-info-card{margin-top:14px;background:#f8fafc;border:1px solid #e4e9f0}
.exam-info-card p{margin:7px 0 0;font-size:11px;line-height:1.65;color:#667085}
.exam-info-card code{background:#eef2f6;border-radius:5px;padding:2px 5px}
.exam-basic-card{max-width:980px}
.exam-basic-grid{display:grid;grid-template-columns:180px 180px minmax(280px,1fr) 150px;gap:12px}
.exam-unit-field{min-width:0}
.exam-form-note{margin-top:14px;padding:11px 12px;border-radius:9px;background:#f7f9fc;color:#667085;font-size:11px;line-height:1.6}
.exam-summary-bar{display:grid;grid-template-columns:150px 120px minmax(260px,1fr) 120px 120px;gap:12px;margin-bottom:14px}
.exam-summary-bar>div{display:flex;flex-direction:column;gap:4px}
.exam-summary-bar small{color:var(--muted);font-size:9px}
.exam-summary-bar strong{font-size:13px;color:#233c68}
.exam-question-list{display:flex;flex-direction:column;gap:12px;padding-bottom:110px}
.exam-question-card{padding:14px 16px}
.exam-q-head{display:flex;align-items:flex-end;gap:14px;padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--line)}
.exam-q-no{font-size:17px;font-weight:800;color:#233c68;min-width:54px}
.compact-field{width:150px}
.exam-q-body{display:grid;grid-template-columns:160px 180px 220px;gap:12px;align-items:end}
.short-box{display:block}
.short-single{display:grid;grid-template-columns:160px minmax(280px,1fr);gap:12px;align-items:end}
.subpart-toggle,.publish-check{display:flex;gap:10px;align-items:flex-start;cursor:pointer}
.subpart-toggle{margin-bottom:12px;padding:10px 12px;border-radius:9px;background:#f8fafc;border:1px solid #e3e8ef;max-width:320px}
.subpart-toggle input,.publish-check input{margin-top:3px;width:16px;height:16px;accent-color:#4c648d}
.subpart-toggle span,.publish-check span{display:flex;flex-direction:column;gap:2px}
.subpart-toggle b,.publish-check b{font-size:11px;color:#172033}
.subpart-toggle small,.publish-check small{font-size:9px;color:#667085;line-height:1.45}
.short-subparts{display:none}
.sub-count{width:140px;margin-bottom:10px}
.subpart-rows{display:flex;flex-direction:column;gap:8px}
.subpart-row{display:grid;grid-template-columns:50px 140px minmax(260px,1fr);gap:10px;align-items:end;padding:9px 10px;border-radius:9px;background:#fafbfc;border:1px solid #edf0f4}
.subpart-row>strong{align-self:center;color:#344054}
.exam-savebar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid #dfe5ee;border-radius:12px;background:rgba(255,255,255,.97);box-shadow:0 -8px 24px rgba(16,24,40,.08)}
.publish-check{margin:0}

/* 학생 전용 페이지 */
.student-portal-body{margin:0;background:#f4f6f9;color:#172033;font-family:inherit}
.student-topbar{height:64px;background:#17233b;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 20px;box-sizing:border-box;position:sticky;top:0;z-index:10}
.student-brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;font-weight:800}
.student-brand img{height:32px;width:auto}
.student-brand span{font-size:14px}
.student-user{display:flex;align-items:center;gap:12px;font-size:11px}
.student-user form{margin:0}.student-user button{border:0;background:rgba(255,255,255,.12);color:#fff;border-radius:7px;padding:7px 9px;cursor:pointer}
.student-shell{width:min(820px,calc(100% - 28px));margin:22px auto 60px}
.student-login-card{max-width:420px;margin:70px auto;background:#fff;border:1px solid #e2e7ef;border-radius:16px;padding:28px;box-shadow:0 10px 30px rgba(16,24,40,.06)}
.student-login-card h1{font-size:22px;margin:0 0 7px}.student-login-card>p{font-size:12px;color:#667085;line-height:1.55;margin:0 0 20px}
.student-login-form{display:flex;flex-direction:column;gap:8px}.student-login-form label{font-size:11px;font-weight:700;margin-top:6px}.student-login-form input{height:42px;border:1px solid #cfd7e3;border-radius:9px;padding:0 12px;font-size:14px}.student-login-form .button{margin-top:10px;height:44px}
.student-login-help{margin-top:16px;padding:11px 12px;background:#f7f9fc;border-radius:9px;font-size:10px;line-height:1.6;color:#667085}
.student-welcome{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:22px}.student-welcome small{color:#667085}.student-welcome h1{margin:2px 0 0;font-size:22px}.student-password-link{font-size:10px;color:#475467}
.student-section{margin-top:22px}.student-section-title{display:flex;align-items:center;gap:8px;margin-bottom:10px}.student-section-title h2{font-size:15px;margin:0}.student-section-title span{display:inline-flex;min-width:22px;height:22px;align-items:center;justify-content:center;border-radius:20px;background:#e8edf5;color:#475467;font-size:10px}
.student-exam-list,.student-history-list{display:flex;flex-direction:column;gap:9px}
.student-exam-card,.student-history-card{background:#fff;border:1px solid #e1e6ee;border-radius:13px;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:14px;text-decoration:none;color:inherit}
.student-exam-card>div,.student-history-card>div:first-child{display:flex;flex-direction:column;gap:3px;min-width:0}.student-exam-card small,.student-history-card small{font-size:9px;color:#667085}.student-exam-card strong,.student-history-card strong{font-size:13px}.student-exam-card span,.student-history-card span{font-size:10px;color:#667085}
.student-score{font-size:22px;font-weight:800;color:#233c68;white-space:nowrap}.student-score small{font-size:10px;font-weight:500;color:#98a2b3}
.student-empty{padding:34px 16px;text-align:center;color:#98a2b3;background:#fff;border:1px dashed #d8dee8;border-radius:12px;font-size:11px}
.student-exam-head{margin-bottom:16px}.student-exam-head h1{font-size:22px;margin:3px 0}.student-exam-head small,.student-exam-head p{color:#667085;font-size:11px;margin:0}
.student-question-list{display:flex;flex-direction:column;gap:10px;padding-bottom:90px}.student-question-card{background:#fff;border:1px solid #e0e6ee;border-radius:13px;padding:15px 16px}.student-q-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}.student-q-header strong{font-size:15px;color:#233c68}.student-q-header span{font-size:10px;color:#667085}
.student-choice-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.student-choice-grid label{cursor:pointer}.student-choice-grid input{display:none}.student-choice-grid span{height:44px;border:1px solid #cfd7e3;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px;background:#fff}.student-choice-grid input:checked+span{background:#233c68;color:#fff;border-color:#233c68}
.student-short-answer{width:100%;height:44px;border:1px solid #cfd7e3;border-radius:9px;padding:0 12px;box-sizing:border-box;font-size:15px}
.student-subanswer-list{display:flex;flex-direction:column;gap:8px}.student-subanswer{display:grid;grid-template-columns:42px 1fr 50px;gap:8px;align-items:center}.student-subanswer input{height:40px;border:1px solid #cfd7e3;border-radius:8px;padding:0 10px}.student-subanswer small{text-align:right;color:#667085}
.student-submitbar{position:sticky;bottom:12px;display:flex;justify-content:flex-end;padding:10px;background:rgba(244,246,249,.94)}.student-submitbar .button{min-width:170px;height:44px}
.student-result-hero{background:#233c68;color:#fff;border-radius:16px;padding:24px;text-align:center}.student-result-hero>small{opacity:.75}.result-score{display:flex;align-items:baseline;justify-content:center;gap:5px;margin:10px 0}.result-score strong{font-size:48px}.result-score span{font-size:13px;opacity:.8}.result-wrong{display:flex;justify-content:center;gap:8px;font-size:11px}.result-wrong span{opacity:.85}.student-result-actions{margin:12px 0}.student-result-list{display:flex;flex-direction:column;gap:8px}.student-result-row{background:#fff;border:1px solid #e1e6ee;border-radius:12px;padding:12px 14px;display:grid;grid-template-columns:90px minmax(0,1fr) 90px;gap:12px;align-items:center;border-left:4px solid #d0d5dd}.student-result-row.correct{border-left-color:#12b76a}.student-result-row.wrong{border-left-color:#f04438}.student-result-q{display:flex;flex-direction:column;gap:2px}.student-result-q span{font-size:9px;color:#667085}.student-result-answer{display:flex;gap:18px;font-size:11px}.student-result-point{text-align:right;font-weight:700;font-size:11px}.student-result-subparts{display:flex;flex-direction:column;gap:5px}.student-result-subparts>div{display:grid;grid-template-columns:40px 1fr 1fr 24px;gap:8px;font-size:10px}.student-result-subparts em{font-style:normal;font-weight:800}

@media(max-width:900px){.exam-basic-grid{grid-template-columns:1fr 1fr}.exam-summary-bar{grid-template-columns:1fr 1fr}.exam-summary-bar .wide{grid-column:1/-1}.exam-q-body{grid-template-columns:1fr 1fr}.exam-savebar{align-items:flex-start;flex-direction:column}.student-choice-grid{grid-template-columns:repeat(5,1fr)}}
@media(max-width:600px){.student-topbar{padding:0 12px}.student-user span{display:none}.student-shell{width:min(100% - 18px,820px);margin-top:14px}.student-login-card{margin:30px auto;padding:20px}.student-choice-grid{gap:5px}.student-choice-grid span{height:42px;font-size:18px}.student-result-row{grid-template-columns:70px 1fr}.student-result-point{grid-column:2;text-align:left}.student-result-answer{flex-direction:column;gap:4px}.exam-basic-grid{grid-template-columns:1fr}.subpart-row{grid-template-columns:42px 100px 1fr}}


/* v5.4.1: 자동 학번 / 퇴원생 관리 / 시험 총점·복수정답 */
.withdrawn-table{min-width:1280px}
.withdrawn-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.withdrawn-actions form{margin:0}
.withdrawn-actions select{height:30px;min-width:95px;border:1px solid #d0d7e2;border-radius:7px;background:#fff;padding:0 7px}
.choice-answer-field{display:flex;flex-direction:column;gap:6px;min-width:270px}
.choice-answer-field>label:first-child{font-size:10px;color:var(--muted);font-weight:700}
.teacher-choice-grid{display:grid;grid-template-columns:repeat(5,42px);gap:6px}
.teacher-choice-option{cursor:pointer}
.teacher-choice-option input{display:none}
.teacher-choice-option span{height:38px;border:1px solid #cfd7e3;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px;background:#fff;color:#344054}
.teacher-choice-option input:checked+span{background:#233c68;color:#fff;border-color:#233c68}
.multi-answer-toggle{display:flex;align-items:center;gap:6px;font-size:10px;color:#475467;cursor:pointer;width:max-content}
.multi-answer-toggle input{width:15px;height:15px;accent-color:#4c648d}
.exam-total-box{margin-left:auto;padding:8px 11px;border-radius:9px;background:#ecfdf3;color:#067647;font-size:11px;white-space:nowrap}
.exam-total-box strong{font-size:14px}
.exam-total-box.invalid{background:#fef3f2;color:#b42318}
.student-choice-help{margin-top:7px;font-size:10px;color:#667085}
@media(max-width:900px){.choice-answer-field{grid-column:1/-1}.exam-total-box{margin-left:0}}

/* v5.4.2 기존 시험 결과 입력 */
.historical-basic-grid{grid-template-columns:160px 160px minmax(260px,1fr) 120px 120px}
.historical-summary-bar{grid-template-columns:150px 120px minmax(260px,1fr) 110px 110px}
.historical-entry-help{display:flex;flex-direction:column;gap:4px;margin-bottom:12px;padding:11px 12px;border-radius:9px;background:#f7f9fc;color:#667085;font-size:11px;line-height:1.55}
.historical-entry-help strong{color:#344054;font-size:12px}
.historical-result-table{min-width:760px}
.historical-result-table td:first-child{min-width:150px}.historical-result-table td:first-child small{display:block;margin-top:3px;color:#98a2b3;font-size:9px}
.historical-result-table input[type="text"]{min-width:270px}
.score-input-wrap{display:flex;align-items:center;gap:6px;white-space:nowrap}.score-input-wrap input{width:96px}.score-input-wrap span{font-size:10px;color:#667085}
.student-history-note{display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid #e1e6ee;border-radius:13px;padding:16px}.student-history-note strong{font-size:13px;color:#233c68}.student-history-note span{font-size:11px;line-height:1.65;color:#667085}
@media(max-width:900px){.historical-basic-grid{grid-template-columns:1fr 1fr}.historical-basic-grid .exam-unit-field{grid-column:1/-1}.historical-summary-bar{grid-template-columns:1fr 1fr}.historical-summary-bar .wide{grid-column:1/-1}}
@media(max-width:600px){.historical-basic-grid{grid-template-columns:1fr}.historical-basic-grid .exam-unit-field{grid-column:auto}}
