.dashboard-info-row{
  display:grid;
  grid-template-columns:minmax(0,1.86fr) minmax(365px,1.14fr);
  gap:8px;
  align-items:start;
  margin-bottom:32px;
}
.dashboard-info-row .duty-section{margin:0}
.dashboard-info-row>#dutySchedule,
.dashboard-info-row>#dutySchedule>#dutyBox{height:auto;min-height:0;align-self:start}

.school-status-card{
  box-sizing:border-box;
  min-width:0;
  overflow:visible;
  align-self:start;
  padding:16px;
  border:1px solid #dfe5ed;
  border-radius:9px;
  background:#fff;
}
.ssc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.ssc-title{font-size:1rem;font-weight:650}
.ssc-updated{margin-top:3px;color:#8a95a5;font-size:.75rem}
.ssc-view-tabs{display:flex;padding:2px;border:1px solid #e1e6ed;border-radius:6px;background:#f7f9fc}
.ssc-view-tab{height:27px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:#7a8595;font-size:.6875rem;font-weight:550;cursor:pointer}
.ssc-view-tab.active{background:#fff;color:#2f66b3;box-shadow:0 1px 3px rgba(35,55,80,.09)}
.ssc-panel{display:none}
.ssc-panel.active{display:block}
.ssc-total{margin-top:14px;display:flex;align-items:baseline;justify-content:space-between;padding-bottom:10px;border-bottom:1px solid #edf0f4}
.ssc-total span{color:#657286;font-size:.8125rem}
.ssc-total strong{font-size:1.375rem;font-weight:650;color:#2f66b3}
.ssc-grades{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:10px}
.ssc-grades>div{text-align:center;padding:7px 2px;background:#f7f9fc;border-radius:6px;min-width:0}
.ssc-grades span{display:block;color:#738095;font-size:.6875rem}
.ssc-grades strong{display:block;margin-top:2px;font-size:.875rem;font-weight:600;white-space:nowrap}

.ssc-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:9px;min-height:28px;flex-wrap:nowrap}
.ssc-toggle{padding:0;border:0;background:none;color:#2f66b3;font-size:.75rem;font-weight:600;cursor:pointer}
.ssc-sheet-link{display:inline-flex;align-items:center;height:28px;padding:0 8px;border:1px solid #dfe5ed;border-radius:6px;background:#fff;color:#657286;font-size:.6875rem;font-weight:550;text-decoration:none;white-space:nowrap}
.ssc-sheet-link:hover{border-color:#b8c9de;color:#2f66b3;background:#f8fbff}
.staff-actions{justify-content:flex-end}
.ssc-detail{display:none;margin-top:11px;width:100%}
.school-status-card.student-open .student-detail{display:block}

/* 학생 반별 상세: 학년 탭 + 반/재적/담임/부담임 표 */
.student-detail{overflow:hidden}
.student-grade-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-bottom:8px}
.student-grade-tab{height:30px;border:1px solid #e1e6ed;border-radius:6px;background:#f7f9fc;color:#728096;font-size:.71875rem;font-weight:550;cursor:pointer}
.student-grade-tab.active{border-color:#b9cce3;background:#edf4fc;color:#2f66b3;font-weight:650}
.student-grade-table-wrap{overflow:hidden;border:1px solid #e6eaf0;border-radius:7px}
.student-grade-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.6875rem}
.student-grade-table th{padding:6px 4px;background:#f7f9fc;color:#748095;font-size:.625rem;font-weight:600;text-align:center;border-bottom:1px solid #e4e9ef}
.student-grade-table td{padding:6px 4px;color:#4c586a;text-align:center;border-bottom:1px solid #edf0f4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.student-grade-table tbody tr:last-child td{border-bottom:0}
.student-grade-table th:nth-child(1),.student-grade-table td:nth-child(1){width:16%}
.student-grade-table th:nth-child(2),.student-grade-table td:nth-child(2){width:20%}
.student-grade-table th:nth-child(3),.student-grade-table td:nth-child(3){width:32%}
.student-grade-table th:nth-child(4),.student-grade-table td:nth-child(4){width:32%}
.student-count-cell{font-weight:600;color:#25364d!important}
.student-homeroom-cell{font-weight:650;color:#25364d!important}

/* 지도근무: 등교/급식은 조금 좁게, 야간은 가장 넓게 */
.duty-today{
  grid-template-columns:minmax(0,.80fr) minmax(0,.95fr) minmax(0,1.25fr)!important;
  padding-left:14px!important;
  padding-right:14px!important;
}
.duty-row{align-items:flex-start!important;min-width:0!important}
.duty-row.morning{padding-right:8px!important}
.duty-row.lunch{padding-left:10px!important;padding-right:10px!important}
.duty-row.night{padding-left:12px!important;padding-right:0!important}
.duty-dot{margin-top:.48rem}
.duty-people{display:flex!important;align-items:flex-start!important;min-width:0;line-height:1.35}
.duty-person{display:inline-flex;align-items:baseline;white-space:nowrap;min-width:0}
.duty-person .duty-role,.duty-role{color:#8792a2!important;font-size:.59375rem!important;font-weight:500!important;letter-spacing:-.025em}
.duty-person strong{color:var(--text);font-size:.84375rem!important;font-weight:550!important;letter-spacing:-.03em}
.duty-none{display:inline-flex;align-items:center;min-height:1.45rem;color:#8a95a4;font-size:.875rem;font-weight:500}
.duty-table{font-size:.8125rem!important}
.duty-table th{font-size:.75rem!important;font-weight:600!important}
.duty-table td{font-size:.8125rem!important;line-height:1.35!important;padding-top:.62rem!important;padding-bottom:.62rem!important}
.duty-table tbody tr:last-child td{border-bottom:0!important}

@media(min-width:901px){
  .duty-people{flex-wrap:nowrap!important;gap:.18rem .34rem!important;white-space:nowrap!important}
  .duty-person{flex:0 0 auto!important;gap:.16rem!important}
}

@media(max-width:1080px) and (min-width:901px){
  .dashboard-info-row{grid-template-columns:minmax(0,1.72fr) minmax(340px,1.08fr)}
  .duty-person .duty-role,.duty-role{font-size:.5625rem!important}
  .duty-person strong{font-size:.8125rem!important}
}

@media(max-width:900px){
  .dashboard-info-row{grid-template-columns:1fr}
  .school-status-card{height:auto!important}
  .duty-today{grid-template-columns:1fr!important;padding-left:18px!important;padding-right:18px!important}
  .duty-row.morning,.duty-row.lunch,.duty-row.night{padding-left:0!important;padding-right:0!important}
  .duty-people{flex-wrap:wrap!important;gap:.3rem .65rem!important}
}


/* v17: 접힌 학교현황 하단 버튼이 카드 밖으로 잘리지 않도록 보강 */
.school-status-card:not(.student-open) .ssc-panel.active{padding-bottom:1px}
.ssc-actions .ssc-toggle,.ssc-actions .ssc-sheet-link{flex:0 0 auto}
@media(max-width:1120px) and (min-width:901px){
  .ssc-actions{gap:6px}
  .ssc-sheet-link{padding:0 7px;font-size:.65625rem}
  .ssc-toggle{font-size:.71875rem}
}


/* v18: 지도근무 / 학교현황은 서로 높이를 강제로 맞추지 않음 */
.dashboard-info-row{
  align-items:start !important;
}
.dashboard-info-row > #dutySchedule,
.dashboard-info-row > .school-status-card,
#dutyBox{
  height:auto !important;
  min-height:0 !important;
  align-self:start !important;
}

/* v18: 주간 근무표 - 월~금 가로 / 근무종류 세로 */
.duty-week{
  overflow-x:auto;
}
.duty-week-matrix{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
  table-layout:fixed;
}
.duty-week-matrix th,
.duty-week-matrix td{
  padding:9px 8px;
  border-right:1px solid #edf0f4;
  border-bottom:1px solid #e7ebf0;
  text-align:center;
  vertical-align:middle;
  line-height:1.35;
}
.duty-week-matrix th:last-child,
.duty-week-matrix td:last-child{
  border-right:0;
}
.duty-week-matrix thead th{
  background:#f7f9fc;
  color:#5f6d82;
  font-weight:600;
}
.duty-week-matrix thead th:first-child{
  width:116px;
}
.duty-week-matrix .week-day{
  display:block;
  color:#4b596d;
  font-size:.75rem;
  font-weight:650;
}
.duty-week-matrix .week-date{
  display:block;
  margin-top:2px;
  color:#96a0af;
  font-size:.625rem;
  font-weight:500;
}
.duty-week-matrix tbody th{
  background:#fbfcfe;
  color:#59677b;
  font-size:.6875rem;
  font-weight:600;
  white-space:nowrap;
}
.duty-week-matrix tbody td{
  color:#354257;
  font-size:.71875rem;
  word-break:keep-all;
}
.duty-week-matrix .week-none{
  color:#a0a8b4;
}
.duty-week-matrix .week-note-row th,
.duty-week-matrix .week-note-row td{
  background:#fcfcfd;
  color:#7a8493;
  font-size:.65625rem;
}
.duty-week-matrix tbody tr:last-child th,
.duty-week-matrix tbody tr:last-child td{
  border-bottom:0;
}
@media(max-width:900px){
  .duty-week-matrix{min-width:680px}
}


/* v19: 왼쪽 지도근무 폭 확대 / 오른쪽 학교현황 폭 축소 */
.dashboard-info-row{
  grid-template-columns:minmax(0,3.65fr) minmax(300px,1.05fr) !important;
  gap:10px !important;
  align-items:stretch !important;
}

/* 두 카드 외곽 높이는 맞추되 내부 내용은 자연스럽게 배치 */
.dashboard-info-row > #dutySchedule,
.dashboard-info-row > .school-status-card{
  align-self:stretch !important;
}

.dashboard-info-row > #dutySchedule,
.dashboard-info-row > #dutySchedule > #dutyBox,
.dashboard-info-row > .school-status-card{
  height:100% !important;
}

.school-status-card{
  display:flex !important;
  flex-direction:column !important;
}

.school-status-card .ssc-panel.active{
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
}

.school-status-card .ssc-actions{
  margin-top:auto !important;
  padding-top:10px !important;
}

/* 주간표: 가로스크롤 제거 + 월~금 한 화면 고정 */
.duty-week{
  overflow-x:hidden !important;
}

.duty-week-matrix{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

.duty-week-matrix thead th:first-child{
  width:108px !important;
}

.duty-week-matrix th,
.duty-week-matrix td{
  padding:8px 6px !important;
}

.duty-week-matrix thead th:not(:first-child),
.duty-week-matrix tbody td{
  width:auto !important;
}

.duty-week-matrix tbody td{
  font-size:.6875rem !important;
  line-height:1.3 !important;
  word-break:keep-all !important;
  overflow-wrap:anywhere !important;
}

.duty-week-matrix tbody th{
  font-size:.65625rem !important;
}

.duty-week-matrix .week-day{
  font-size:.71875rem !important;
}

.duty-week-matrix .week-date{
  font-size:.59375rem !important;
}

/* 야간 3명도 셀 안에서 자연스럽게 줄바꿈 */
.duty-week-matrix .week-duty-list{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:2px 5px;
}

@media(max-width:1100px) and (min-width:901px){
  .dashboard-info-row{
    grid-template-columns:minmax(0,3.8fr) minmax(275px,.95fr) !important;
  }

  .duty-week-matrix thead th:first-child{
    width:96px !important;
  }

  .duty-week-matrix th,
  .duty-week-matrix td{
    padding:7px 4px !important;
  }

  .duty-week-matrix tbody td{
    font-size:.65625rem !important;
  }
}


/* v20: 기본 접힘 상태에서만 높이를 맞추고, 상세 펼침은 서로 독립 */
.dashboard-info-row{
  align-items:start !important;
}
.dashboard-info-row > #dutySchedule,
.dashboard-info-row > .school-status-card{
  align-self:start !important;
  height:auto !important;
}
.dashboard-info-row > #dutySchedule > #dutyBox{
  height:auto !important;
  min-height:0 !important;
}

/* 지도근무 카드 배경을 끝까지 동일하게 */
#dutyBox{
  background:#fff !important;
  overflow:hidden !important;
}
#dutyBox .duty-footer{
  background:#fff !important;
}
#dutyBox::after{
  display:none !important;
}

/* 학교현황 상세는 오른쪽 카드만 자연스럽게 늘어남 */
.school-status-card.student-open,
.school-status-card.staff-open{
  height:auto !important;
}

/* 학생 반별 표: 재적 / 담임 / 부담임 동일 폭 */
.student-grade-table{
  width:100% !important;
  table-layout:fixed !important;
}
.student-grade-table th:nth-child(1),
.student-grade-table td:nth-child(1){
  width:16% !important;
}
.student-grade-table th:nth-child(2),
.student-grade-table td:nth-child(2),
.student-grade-table th:nth-child(3),
.student-grade-table td:nth-child(3),
.student-grade-table th:nth-child(4),
.student-grade-table td:nth-child(4){
  width:28% !important;
  text-align:center !important;
}


/* v20.2: 지도근무 기본 높이 확장 시 하단 배경색 통일 */
#dutyBox{
  display:flex !important;
  flex-direction:column !important;
}

/* 기존 footer와 같은 색으로 남는 높이를 채움 */
#dutyBox::after{
  content:"" !important;
  display:block !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  background:#fbfcfe !important;
}

/* 실제 하단 영역도 동일한 배경 */
#dutyBox .duty-foot{
  background:#fbfcfe !important;
}

/* 주간 근무표를 펼치면 인위적인 채움 영역 제거 */
#dutyBox.open::after{
  display:none !important;
}


/* v20.3: 지도근무 카드 내부 높이 재배분 */
#dutyBox{
  display:flex !important;
  flex-direction:column !important;
}

/* 상단 본문이 남는 높이를 더 가져가도록 */
#dutyBox .duty-main,
#dutyBox .duty-content{
  flex:1 1 auto !important;
}

/* 하단 주간표 보기 영역을 더 얇게 */
#dutyBox .duty-foot{
  flex:0 0 auto !important;
  min-height:0 !important;
  padding:10px 16px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#fbfcfe !important;
}

/* 버튼 중앙 배치 */
#dutyWeekToggle{
  margin:0 auto !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
}

/* 남는 공간용 가상 영역은 사용하지 않음 */
#dutyBox::after{
  display:none !important;
  content:none !important;
}


/* v20.4 FIX
   실제 본문 클래스는 .duty-today 입니다.
   카드 높이가 늘어날 때 본문이 남는 높이를 차지하도록 수정합니다.
*/
#dutyBox{
  display:flex !important;
  flex-direction:column !important;
}

/* 상단 헤더는 고정 */
#dutyBox .duty-head{
  flex:0 0 auto !important;
}

/* 실제 오늘 근무 본문이 남는 공간을 모두 차지 */
#dutyBox .duty-today{
  flex:1 1 auto !important;
  min-height:0 !important;
  align-items:stretch !important;
}

/* 세 근무 칸도 본문 높이에 맞춰 자연스럽게 확장 */
#dutyBox .duty-row{
  height:100% !important;
  box-sizing:border-box !important;
}

/* 하단 토글 영역은 얇고 고정 */
#dutyBox .duty-foot{
  flex:0 0 auto !important;
  min-height:46px !important;
  padding:7px 16px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#fbfcfe !important;
}

/* 빈 안내 span은 공간을 차지하지 않게 제거 */
#dutyBox .duty-hint{
  display:none !important;
}

/* 토글 버튼 정중앙 */
#dutyWeekToggle{
  margin:0 !important;
  padding:6px 10px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
}

/* 이전에 사용했던 가상 채움 영역 완전 제거 */
#dutyBox::after,
#dutyBox.open::after{
  content:none !important;
  display:none !important;
}
