/* AP Math OS Dashboard UI Foundation 1차
   - dashboard.js 운영 UI(BEM) 전용 스타일
   - 전체 리뉴얼이 아니라 대시보드 운영 컴포넌트만 분리
   - 색상 강조를 줄이고 기존 APMS의 차분한 카드 흐름을 보존한다.
   - Apple-style light typography: 신규 foundation 영역은 700/800/900 굵기를 쓰지 않는다.
*/

.ap-withdrawal-report{display:flex;flex-direction:column;gap:12px;min-width:0}
.ap-withdrawal-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:8px;align-items:end;padding:12px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2)}
.ap-withdrawal-filters label{display:flex;flex-direction:column;gap:5px;min-width:0;color:var(--secondary);font-size:11px;font-weight:500}
.ap-withdrawal-filters select{width:100%;min-height:44px;padding:0 30px 0 10px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font:inherit;font-size:12px}
.ap-withdrawal-filters__reset{min-height:44px;padding:0 12px;border-radius:10px;white-space:nowrap}
.ap-withdrawal-report__summary{padding:0 2px;color:var(--secondary);font-size:12px;font-weight:500}
.ap-withdrawal-list{display:flex;flex-direction:column;max-height:56vh;overflow-y:auto;border:1px solid var(--border);border-radius:14px;background:var(--surface)}
.ap-withdrawal-row{display:grid;grid-template-columns:92px minmax(0,1fr) auto;gap:12px;align-items:center;padding:13px 14px;border-bottom:1px solid var(--border)}
.ap-withdrawal-row:last-child{border-bottom:0}
.ap-withdrawal-row__date{color:var(--secondary);font-size:12px;font-weight:500;white-space:nowrap}
.ap-withdrawal-row__body{min-width:0}
.ap-withdrawal-row__name{color:var(--text);font-size:14px;font-weight:500;line-height:1.35}
.ap-withdrawal-row__meta{margin-top:3px;color:var(--secondary);font-size:12px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-withdrawal-row__actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.ap-withdrawal-row__actions .btn{min-height:44px;padding:0 11px;border-radius:9px;font-size:11px;font-weight:500}
.ap-withdrawal-empty{padding:36px 16px;color:var(--secondary);font-size:13px;text-align:center}
.ap-withdrawal-live{position:fixed;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media (max-width:700px){.ap-withdrawal-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.ap-withdrawal-filters__reset{grid-column:1/-1}.ap-withdrawal-row{grid-template-columns:1fr;gap:5px}.ap-withdrawal-row__actions{justify-content:flex-start;margin-top:4px}.ap-withdrawal-row__meta{white-space:normal}}

.dashboard-journal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;padding:0 4px;gap:10px}
.dashboard-journal-title{margin:0;font-size:15px;font-weight:500;color:var(--text)}
.dashboard-journal-card{background:transparent;border:0;border-radius:0;min-height:0;padding:0;box-sizing:border-box;cursor:default;margin-bottom:18px;display:flex;flex-direction:column;gap:8px;overflow:visible;box-shadow:none}
.dashboard-journal-card__top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 -8px;padding:6px 8px;border-radius:8px;cursor:pointer;transition:background 0.15s ease}
.dashboard-journal-card__top:hover{background:rgba(15,23,42,0.03)}
.dashboard-journal-card__content{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;color:var(--text)}
.dashboard-journal-card__empty{font-size:14px;font-weight:400;color:var(--secondary)}
.dashboard-journal-card__arrow{font-size:18px;font-weight:400;color:var(--secondary);flex-shrink:0}
.journal-matrix{display:grid;gap:0;width:100%}
.journal-matrix--empty{display:block}
.journal-matrix__empty{display:block;padding:8px 0;color:var(--secondary);font-size:12px;font-weight:400;text-align:left}
.journal-day-cell{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;column-gap:8px;width:100%;margin:0;padding:0 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:none;cursor:pointer;text-align:left;color:var(--text);font-size:13px;font-weight:400;line-height:1.35;transition:background 0.15s ease;box-sizing:border-box}
.journal-day-cell:hover{background:var(--surface)}
.journal-day-cell:focus-visible{outline:2px solid rgba(15,23,42,0.14);outline-offset:2px}
.journal-day-cell--done,.journal-day-cell--missing,.journal-day-cell--holiday{border:1px solid var(--border);background:var(--surface)}
.journal-day-cell__label{font-size:13px;font-weight:400;color:var(--secondary);line-height:1.35;white-space:nowrap}
.journal-day-cell__spacer{min-width:8px}
.journal-day-cell__status{justify-self:end;font-size:13px;font-weight:400;color:var(--text);line-height:1.35;white-space:nowrap}
.journal-day-cell__chevron{font-size:14px;font-weight:400;color:#9ca3af;line-height:1;white-space:nowrap}
.journal-draft{display:flex;flex-direction:column;gap:10px}
.journal-draft__section{border:1px solid var(--border);border-radius:14px;background:var(--surface);overflow:hidden}
.journal-draft__title{padding:10px 12px;background:var(--surface-2);font-size:13px;font-weight:500;color:var(--text)}
.journal-draft__body{padding:10px 12px}
.journal-draft__list{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px}
.journal-draft__item{font-size:12px;font-weight:400;color:var(--text);line-height:1.45}
.journal-draft__empty{font-size:12px;font-weight:400;color:var(--secondary);line-height:1.45}
.daily-close-panel{display:flex;flex-direction:column;gap:14px}
.daily-close-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.daily-close-progress__item{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);padding:9px 8px;font-size:11px;font-weight:500;color:var(--secondary);text-align:center}
.daily-close-progress__item--active{background:var(--surface);color:var(--text);border-color:var(--border)}
.daily-close-step{display:none;border:1px solid var(--border);border-radius:16px;background:var(--surface);overflow:hidden}
.daily-close-step--active{display:block}
.daily-close-step__header{padding:14px 16px;background:var(--surface-2);font-size:15px;font-weight:500;color:var(--text)}
.daily-close-step__body{padding:14px 16px;display:flex;flex-direction:column;gap:12px}
.daily-close-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.daily-close-actions .btn{min-height:42px;border-radius:12px;font-size:13px;font-weight:500}
.daily-close-list{display:flex;flex-direction:column;gap:8px}
.daily-close-class-group{border:1px solid var(--border);border-radius:14px;overflow:hidden;background:var(--surface)}
.daily-close-class-group__head{padding:9px 12px;background:var(--surface-2);font-size:12px;font-weight:500;color:var(--secondary)}
.daily-close-student{padding:12px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:9px}
.daily-close-student__row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.daily-close-student__name{font-size:14px;font-weight:500;color:var(--text)}
.daily-close-student__link{font-size:11px;font-weight:500;color:var(--text);background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:5px 8px;cursor:pointer}
.daily-close-student__actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.daily-close-student__actions .btn{min-height:36px;border-radius:10px;font-size:12px;font-weight:500}
.daily-close-empty{padding:26px 16px;text-align:center;color:var(--secondary);font-size:13px;font-weight:400;background:var(--surface-2);border-radius:14px}
.care-log-list{display:flex;flex-direction:column;gap:8px}
.care-log-item{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);padding:10px 12px}
.care-log-item__title{font-size:13px;font-weight:500;color:var(--text)}
.care-log-item__text{font-size:12px;font-weight:400;color:var(--secondary);line-height:1.45;margin-top:4px}
.care-risk-badge,.care-risk-cleared{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:500;background:var(--surface-2);border:1px solid var(--border);color:var(--text)}
.admin-teacher-card__head{min-width:0}
.admin-teacher-card__name{font-size:16px;font-weight:500;color:var(--text);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-teacher-card__quick-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.admin-teacher-card__quick-action{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:30px;padding:0 10px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border);color:var(--text);font-size:12px;font-weight:500;line-height:1;white-space:nowrap;box-shadow:none;cursor:pointer}
.admin-teacher-card__journal{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.admin-teacher-card__journal-title{font-size:12px;font-weight:400;color:var(--secondary);line-height:1}
.admin-teacher-student-list{max-height:62vh;overflow-y:auto;display:flex;flex-direction:column;gap:7px;padding-right:4px}
.admin-teacher-grade-groups{max-height:62vh;overflow-y:auto;display:flex;flex-direction:column;gap:14px;padding-right:4px}
.admin-teacher-grade-group{display:flex;flex-direction:column;gap:7px}
.admin-teacher-grade-group__title{font-size:12px;font-weight:500;color:var(--secondary);padding:0 2px}
.admin-teacher-grade-pills{max-width:520px;display:flex;flex-wrap:wrap;gap:8px;padding:2px}
.admin-teacher-grade-pill{display:inline-flex;align-items:center;gap:5px;min-height:30px;padding:0 10px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:12px;font-weight:500;line-height:1;white-space:nowrap}
.admin-teacher-grade-pill--total{background:var(--surface-2)}
.admin-teacher-grade-pill span:last-child{color:var(--secondary);font-weight:500}
.admin-teacher-student-row{width:100%;min-height:48px;padding:10px 12px;border-radius:14px;border:1px solid var(--border);background:var(--surface);box-shadow:none;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left}
.admin-teacher-student-row__main{min-width:0;flex:1}
.admin-teacher-student-row__name{font-size:13px;font-weight:500;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-teacher-student-row__meta{font-size:11px;font-weight:400;color:var(--secondary);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-teacher-student-row__badge{font-size:11px;font-weight:500;color:var(--text);background:var(--surface-2);border:1px solid var(--border);padding:4px 8px;border-radius:999px;white-space:nowrap}
.admin-teacher-modal-back{width:100%;margin-bottom:12px;min-height:42px;border-radius:12px;font-weight:500;background:var(--surface-2);border:1px solid var(--border);color:var(--text)}
.journal-draft--simple{display:block}
.journal-draft__plain{margin:0;white-space:pre-wrap;font-family:inherit;font-size:13px;font-weight:400;line-height:1.55;color:var(--text);background:transparent;border:0;padding:0}

/* 일지 읽기 전용 렌더 — 폰트로 4단 위계 (편집 textarea는 영향 없음) */
.journal-render{font-family:inherit;color:var(--text)}
.journal-render .jr-line{white-space:pre-wrap;word-break:break-word;line-height:1.55}
.journal-render .jr-blank{height:8px;line-height:8px}
.journal-render .jr-title{font-size:15px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.journal-render .jr-section{font-size:14px;font-weight:700;color:var(--text);margin-top:14px;padding-top:8px;border-top:1px solid var(--border)}
.journal-render .jr-title + .jr-section,.journal-render .jr-section:first-child{margin-top:8px}
.journal-render .jr-field{font-size:13px;font-weight:600;color:var(--text)}
.journal-render .jr-body{font-size:13px;font-weight:400;color:var(--text-soft);padding-left:10px}

/* ======================================================================
   APMS Dashboard Card Shell Restore + Typography Unification
   - 기존 foundation selector는 보존한다.
   - 카드 안 카드는 금지하되, 섹션 단위 outer card는 복구한다.
   - 전역 body/button/card는 수정하지 않는다.
   ====================================================================== */

.ap-dashboard-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.ap-dashboard-journal-wrap {
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: visible;
  box-shadow: none;
}

.ap-dashboard-journal-section {
  margin-bottom: 18px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible;
}

.ap-dashboard-journal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.ap-dashboard-journal-section .ap-dashboard-journal-head {
  padding: 0 4px !important;
  margin: 0 0 8px !important;
  border: 0 !important;
  background: transparent !important;
}

.ap-dashboard-journal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
}

.ap-dashboard-journal-summary {
  min-width: 0;
  flex: 1;
  text-align: right;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-dashboard-journal-body {
  cursor: pointer;
  padding: 8px 16px 10px;
}

.ap-dashboard-journal-section .ap-dashboard-journal-body {
  padding: 4px !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.ap-dashboard-action-grid--teacher-quick {
  --ap-dashboard-action-count: 3;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.ap-dashboard-action-grid--teacher-quick .ap-dashboard-action-button {
  min-width: 0 !important;
}

@media (max-width: 520px) {
  .ap-dashboard-action-grid.ap-dashboard-action-grid--teacher-quick {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .ap-dashboard-action-grid.ap-dashboard-action-grid--teacher-quick .ap-dashboard-action-button {
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
}

.ap-dashboard-class-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-dashboard-class-list .ap-class-row,
.ap-class-row {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 16px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ap-dashboard-class-list .ap-class-row--scheduled,
.ap-class-row--scheduled {
  background: var(--surface);
  border: 1px solid var(--border);
}

.ap-dashboard-class-list .ap-class-row--scheduled:hover,
.ap-dashboard-class-list .ap-class-row--empty:hover,
.ap-class-row--scheduled:hover,
.ap-class-row--empty:hover {
  background: var(--surface-2);
}

.ap-dashboard-class-list .ap-class-row--empty,
.ap-class-row--empty {
  background: var(--surface-2);
  border: 1px dashed var(--border);
}

.ap-class-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.ap-class-row__name--inactive {
  font-weight: 400;
  color: var(--secondary);
}

.ap-class-row__meta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary);
  line-height: 1.35;
  white-space: nowrap;
}

.ap-class-row__chips {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.ap-class-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.ap-class-chip--active {
  background: rgba(26, 92, 255, 0.08);
  border-color: rgba(26, 92, 255, 0.18);
  color: #1A5CFF;
}

.ap-class-chip--present {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.22);
  color: #047857;
}

.ap-class-chip--absent {
  background: rgba(232, 65, 79, 0.10);
  border-color: rgba(232, 65, 79, 0.22);
  color: #D92D3A;
}

/* ======================================================================
   APMS / EIE UI Surface & Sidebar Guideline v1.1 적용
   - Round 3: inline style 의존을 줄이기 위한 의미 class 추가
   - 큰 카드: hover 때만 살짝 살아남
   - 작은 카드/row: 둥근 surface hover만 적용
   - 파란 active 배경 금지
   ====================================================================== */
.ap-surface-toolbar {
  display: grid;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: none;
  box-sizing: border-box;
  margin-bottom: 18px;
}

.ap-surface-toolbar--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-surface-toolbar--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ap-surface-toolbar--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ap-surface-toolbar--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.ap-surface-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  min-width: 0;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ap-surface-action--current { cursor: default; }

/* ======================================================================
   APMS 선생님 대시보드 전용 4px 스케일 토큰
   ====================================================================== */
body.ap-teacher-dashboard-mode {
  --ap-space-1: 4px;
  --ap-space-2: 8px;
  --ap-space-3: 12px;
  --ap-space-4: 16px;
  --ap-space-5: 20px;
  --ap-space-6: 24px;

  --ap-dash-section-gap: var(--ap-space-5);
  --ap-dash-inner-gap: var(--ap-space-2);
  --ap-dash-title-gap: var(--ap-space-3);

  --ap-dash-card-radius: var(--ap-space-4);
  --ap-dash-card-padding: var(--ap-space-5);

  --ap-dash-row-height: 52px;
  --ap-dash-row-padding-x: var(--ap-space-4);
  --ap-dash-row-radius: var(--ap-space-4);
  --ap-dash-row-inner-gap: var(--ap-space-3);

  --ap-dash-toolbar-padding: var(--ap-space-1);
  --ap-dash-toolbar-gap: var(--ap-space-2);
  --ap-dash-toolbar-radius: var(--ap-space-4);

  --ap-dash-quick-height: 72px;
  --ap-dash-quick-radius: var(--ap-space-3);
}

/* 퀵 액션 패널(출석부/시간표/아카이브): 하단 여백 고정 */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-panel {
  margin: 0 0 var(--ap-dash-section-gap) 0 !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: var(--ap-dash-toolbar-gap) !important;
  padding: var(--ap-dash-toolbar-padding) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--ap-dash-toolbar-radius) !important;
  background: var(--surface-2) !important;
  box-sizing: border-box !important;
}

/* 퀵 액션 버튼(시간표/출석부/아카이브): 실제 선생님 대시보드 클래스까지 포함 */
.ap-dashboard-action-grid--teacher-quick .ap-dashboard-action-button,
.ap-dashboard-action-grid.ap-dashboard-action-grid--teacher-quick .ap-dashboard-action-button,
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-card {
  height: auto !important;
  min-height: var(--ap-dash-quick-height) !important;
  max-height: none !important;
  padding: var(--ap-space-4) var(--ap-space-3) !important;
  border-radius: var(--ap-dash-quick-radius) !important;
  box-sizing: border-box !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

@media (max-width: 420px) {
  body.ap-teacher-dashboard-mode {
    --ap-dash-quick-height: 56px;
    --ap-dash-row-padding-x: var(--ap-space-3);
  }
  body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-grid {
    gap: var(--ap-space-2) !important;
    padding: var(--ap-space-1) !important;
  }
  body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-card {
    min-height: var(--ap-dash-quick-height) !important;
    padding: var(--ap-space-3) var(--ap-space-2) !important;
  }
  body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-quick-title {
    font-size: 12px !important;
    white-space: nowrap !important;
  }
}

/* ======================================================================
   큰 섹션 카드 규격 통일: 학급관리 / 오늘일지 / 오늘일정 / 주간일정
   ====================================================================== */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-card {
  border-radius: var(--ap-dash-card-radius) !important;
  padding: var(--ap-dash-card-padding) !important;
  margin-bottom: var(--ap-dash-section-gap) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-card:last-child {
  margin-bottom: 0 !important;
}

/* 섹션 제목 간격 통일 */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-card__title {
  margin: 0 0 var(--ap-dash-title-gap) 0 !important;
}

@media (max-width: 640px) {
  body.ap-teacher-dashboard-mode {
    --ap-dash-card-padding: var(--ap-space-4);
  }
}

/* ======================================================================
   row 카드 규격 통일: 학급관리 반 카드(.ap-class-row) + 오늘일지 날짜 카드(.ap-list-row)
   ====================================================================== */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-class-row,
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-list-row {
  min-height: var(--ap-dash-row-height) !important;
  padding: 0 var(--ap-dash-row-padding-x) !important;
  border-radius: var(--ap-dash-row-radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  gap: var(--ap-dash-row-inner-gap) !important;
}

/* 오늘일지 미작성 행은 다른 행과 같은 중립 톤으로 유지 */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-list-row.status-pending {
  border-color: var(--border) !important;
  border-left: 1px solid var(--border) !important;
  background: var(--surface) !important;
}

/* 오늘일지 row 간격 중복 제거: journal-matrix gap만 사용 */
body.ap-teacher-dashboard-mode .ap-dash-redesign #ap-dash-journal-section .ap-list-row {
  margin-bottom: 0 !important;
}

/* 학급관리 리스트 하단 40px legacy 제거 */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-class-list {
  margin-bottom: 0 !important;
  gap: var(--ap-dash-inner-gap) !important;
  width: 100% !important;
}

/* ======================================================================
   내부 wrapper 공통: .ap-dash-inner-list
   ====================================================================== */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-inner-list {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ap-dash-inner-gap) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 오늘일지: journal-matrix 가 row gap 담당 — wrapper gap은 0 */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dash-inner-list--journal {
  gap: 0 !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign #ap-dash-journal-section .journal-matrix {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--ap-dash-inner-gap) !important;
  width: 100% !important;
}

/* ======================================================================
   오늘일정 surface-list: 공통 row 계열로 보정
   ====================================================================== */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-surface-list--today {
  border-radius: var(--ap-dash-row-radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-surface-list--today > *:last-child {
  border-bottom: 0 !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-today-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* 오늘일정 empty-state 리듬 통일 */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memo {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  cursor: pointer;
  box-sizing: border-box;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memo__text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memo__details {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memo.is-open .ap-assistant-memo__details {
  display: flex;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memo__detail {
  min-width: 0;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-assistant-memo__hide {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-empty-state {
  min-height: var(--ap-dash-row-height) !important;
  padding: 0 var(--ap-dash-row-padding-x) !important;
  border-radius: var(--ap-dash-row-radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  gap: var(--ap-dash-row-inner-gap) !important;
}

/* ======================================================================
   주간일정 split: 공통 카드 계열로 보정
   ====================================================================== */
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-weekly-split {
  display: grid !important;
  gap: var(--ap-dash-inner-gap) !important;
}

@media (min-width: 640px) {
  body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-weekly-split {
    grid-template-columns: minmax(150px, 2fr) minmax(0, 8fr) !important;
  }
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-split-cell {
  min-width: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--ap-dash-row-radius) !important;
  background: var(--surface) !important;
  padding: var(--ap-space-4) !important;
  box-sizing: border-box !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-cleaning-routine {
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-weekly-notice-cell {
  cursor: pointer;
}

.ap-dashboard-weekly-parity {
  --ap-space-2: 8px;
  --ap-space-3: 12px;
  --ap-space-4: 16px;
  --ap-space-5: 20px;
  width: 100%;
  margin: 0 0 20px;
  padding: var(--ap-space-5);
  border: 1px solid var(--border);
  border-radius: var(--ap-space-4);
  background: var(--surface);
  box-shadow: none;
  box-sizing: border-box;
}

.ap-dashboard-weekly-parity .ap-dash-card__title {
  margin: 0 0 var(--ap-space-3);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.ap-dashboard-weekly-parity .ap-weekly-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ap-space-2);
}

.ap-dashboard-weekly-parity .ap-split-cell {
  min-width: 0;
  padding: var(--ap-space-4);
  border: 1px solid var(--border);
  border-radius: var(--ap-space-4);
  background: var(--surface);
  box-sizing: border-box;
}

.ap-dashboard-weekly-parity .ap-weekly-notice-cell {
  cursor: pointer;
}

.ap-owner-weekly-parity-cell {
  width: 100%;
  max-width: 850px;
}

@media (min-width: 640px) {
  .ap-dashboard-weekly-parity .ap-weekly-split {
    grid-template-columns: minmax(150px, 2fr) minmax(0, 8fr);
  }
}

@media (max-width: 640px) {
  .ap-dashboard-weekly-parity {
    padding: var(--ap-space-4);
  }
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-source {
  position: relative !important;
  overflow: visible !important;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-preview {
  position: absolute;
  left: 12px;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(360px, calc(100vw - 48px));
  max-height: 260px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
  white-space: normal;
  text-align: left;
  box-sizing: border-box;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-source:hover > .ap-hover-preview,
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-source:focus-visible > .ap-hover-preview,
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-source:focus-within > .ap-hover-preview {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-preview__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-preview__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-hover-preview__line {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--secondary);
  overflow-wrap: anywhere;
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-class-list .ap-hover-preview {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(3px);
}

body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-class-list .ap-hover-source:hover > .ap-hover-preview,
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-class-list .ap-hover-source:focus-visible > .ap-hover-preview,
body.ap-teacher-dashboard-mode .ap-dash-redesign .ap-dashboard-class-list .ap-hover-source:focus-within > .ap-hover-preview {
  transform: translateY(0);
}

.ap-surface-action:hover,
.ap-admin-app-gate .btn:hover,
.ap-admin-shortcuts .btn:hover,
.ap-dashboard-action-grid .btn:hover,
.ap-dashboard-tabbar .btn:hover,
.ap-admin-action-card:hover,
.ap-dashboard-action-button:hover {
  background: var(--surface-2);
  border-color: var(--border);
  border-color: color-mix(in srgb, var(--border) 72%, var(--text));
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  transform: translateY(-1px);
}

.ap-surface-action--current:hover,
.ap-admin-app-gate .btn[aria-current="page"]:hover,
.ap-dashboard-tabbar .btn[aria-current="page"]:hover {
  background: var(--surface);
  box-shadow: none;
  transform: none;
}

.ap-admin-app-gate,
.ap-admin-shortcuts,
.ap-dashboard-action-grid,
.ap-dashboard-tabbar,
.ap-admin-overview-grid {
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: none;
}

.ap-admin-app-gate .btn,
.ap-admin-shortcuts .btn,
.ap-dashboard-action-grid .btn,
.ap-dashboard-tabbar .btn,
.ap-admin-action-card,
.ap-dashboard-action-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ap-admin-app-gate .btn[aria-current="page"],
.ap-dashboard-tabbar .btn[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
}

.ap-admin-mini-metric,
.ap-admin-check-item,
.journal-day-cell,
.ap-class-row,
.eie-admin-card,
.eie-card {
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ap-admin-mini-metric[role="button"]:hover,
.ap-admin-check-item:hover,
.ap-class-row:hover {
  background: var(--surface-2);
  border-color: var(--border);
  border-color: color-mix(in srgb, var(--border) 72%, var(--text));
}

.ap-admin-check-item:hover,
.ap-class-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15,23,42,0.05);
}

.journal-day-cell:hover,
.dashboard-journal-card__top:hover,
.ap-admin-recent-student-row:hover,
#dashboard-weekly-schedule-list > div > div:hover,
#dashboard-onboarding-weekly-items > div:hover {
  background: var(--surface-2);
}

.ap-dashboard-surface-list,
#dashboard-weekly-schedule-list {
  background: var(--surface);
  border-color: var(--border);
}

.ap-dashboard-surface-list--today:hover {
  background: var(--surface);
}

/* 작은 카드 / 내부 요약은 부모보다 약한 hover만 허용 */
.ap-admin-mini-metric[role="button"]:hover,
.journal-day-cell:hover {
  transform: none;
  box-shadow: none;
}

/* 파란 active/primary 계열 회귀 차단 */
.ap-admin-app-gate,
.ap-admin-shortcuts,
.ap-admin-app-gate .btn,
.ap-admin-shortcuts .btn,
.ap-admin-mini-metric,
.journal-day-cell,
.ap-class-row,
.ap-dashboard-action-button {
  background-image: none;
}

.ap-admin-grade-pill,
.admin-teacher-student-row__badge,
.journal-day-cell__status {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}


/* Round 4 — full dashboard hover coverage */
.ap-dashboard-shell .card,
.ap-admin-teacher-card,
.ap-admin-recent-student-grid,
.ap-dashboard-surface-list {
  transition:
    background .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
}

.ap-dashboard-shell .card:hover,
.ap-admin-teacher-card:hover {
  background: var(--surface);
  border-color: var(--border);
  border-color: color-mix(in srgb, var(--border) 76%, var(--text));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.ap-admin-recent-student-grid:hover,
.ap-dashboard-surface-list:hover {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.admin-teacher-card__quick-action,
.ap-admin-consultation-row,
.ap-admin-recent-student-row,
.dashboard-journal-card__top,
.journal-day-cell,
#dashboard-weekly-schedule-list > div > div,
#dashboard-onboarding-weekly-items > div {
  transition:
    background .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
}

.admin-teacher-card__quick-action:hover,
.ap-admin-consultation-row:hover,
.ap-admin-recent-student-row:hover {
  background: var(--surface-2);
  border-color: var(--border);
  border-color: color-mix(in srgb, var(--border) 72%, var(--text));
  box-shadow: none;
  transform: none;
}

.ap-admin-check-item:hover,
.ap-admin-mini-metric[role="button"]:hover,
.journal-day-cell:hover,
#dashboard-weekly-schedule-list > div > div:hover,
#dashboard-onboarding-weekly-items > div:hover {
  background: var(--surface-2);
  border-color: var(--border);
  border-color: color-mix(in srgb, var(--border) 72%, var(--text));
}

.ap-dashboard-shell .card.ap-admin-teacher-card:hover .journal-day-cell,
.ap-dashboard-shell .card:hover .ap-admin-mini-metric {
  box-shadow: none;
}

/* ======================================================================
   Owner Dashboard 공통 Shell 클래스
   AP MATH 원장 대시보드와 EIE 대시보드의 시각적 일관성을 위한 공통 클래스.
   양쪽 모두에서 사용하며 기존 스타일을 갈아엎지 않고 추가 정의한다.
   ====================================================================== */

.owner-dashboard-shell {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 0 16px 24px;
  box-sizing: border-box;
}

body.ap-owner-dashboard-bg {
  --bg: #F1F7FF;
  background: #F1F7FF;
}

body.dark.ap-owner-dashboard-bg {
  --bg: #121212;
  background: #121212;
}

/* AP MATH / EIE 브랜드 탭 (원장 화면 상단 선택부) */
.owner-brand-tabs {
  display: grid;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  margin-bottom: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
}

.owner-brand-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.owner-brand-tab--current {
  cursor: default;
}

.owner-brand-tab:hover:not(.owner-brand-tab--current) {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--border) 72%, var(--text));
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  transform: translateY(-1px);
}

.owner-brand-tab--current:hover {
  background: var(--surface);
  box-shadow: none;
  transform: none;
}

/* 원장 섹션 카드 */
.owner-section-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

/* 원장 통계 그리드 */
.owner-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  margin-bottom: 18px;
}

@media (max-width: 720px) {
  .owner-dashboard-shell { padding-left: 14px; padding-right: 14px; }
  .owner-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ======================================================================
   AP dashboard interaction standard — hover/active/focus feedback only
   Scope: dashboards only. No layout changes.
   AP teacher/general: blue feedback. AP owner: slate/neutral feedback.
   ====================================================================== */
:root {
  --ap-dashboard-hover-lift: -1px;
  --ap-dashboard-hover-scale: 1.002;
  --ap-dashboard-hover-duration: 140ms;
  --ap-dashboard-blue-hover-bg: color-mix(in srgb, var(--primary) 6%, var(--surface));
  --ap-dashboard-blue-hover-border: color-mix(in srgb, var(--primary) 58%, var(--border));
  --ap-dashboard-blue-hover-shadow: 0 6px 14px rgba(26, 92, 255, 0.075);
  --ap-dashboard-owner-hover-bg: color-mix(in srgb, #0f172a 4%, var(--surface));
  --ap-dashboard-owner-hover-border: color-mix(in srgb, #0f172a 34%, var(--border));
  --ap-dashboard-owner-hover-shadow: 0 6px 14px rgba(15, 23, 42, 0.065);
}

body.ap-teacher-dashboard-mode .ap-metric-card,
body.ap-teacher-dashboard-mode .ap-dash-card,
body.ap-teacher-dashboard-mode .ap-list-row,
body.ap-teacher-dashboard-mode .ap-class-row,
body.ap-teacher-dashboard-mode .ap-dash-quick-card,
body.ap-teacher-dashboard-mode .ap-empty-state,
body.ap-teacher-dashboard-mode .ap-dashboard-surface-list,
body.ap-teacher-dashboard-mode .dashboard-journal-card__top,
body.ap-teacher-dashboard-mode .journal-day-cell,
body.ap-teacher-dashboard-mode #dashboard-weekly-schedule-list > div > div,
body.ap-teacher-dashboard-mode #dashboard-onboarding-weekly-items > div {
  transition:
    background var(--ap-dashboard-hover-duration) ease,
    border-color var(--ap-dashboard-hover-duration) ease,
    box-shadow var(--ap-dashboard-hover-duration) ease,
    transform var(--ap-dashboard-hover-duration) ease !important;
  transform-origin: center;
}

body.ap-teacher-dashboard-mode .ap-metric-card:hover,
body.ap-teacher-dashboard-mode .ap-metric-card:focus-visible,
body.ap-teacher-dashboard-mode .ap-dash-card:hover,
body.ap-teacher-dashboard-mode .ap-dash-card:focus-visible,
body.ap-teacher-dashboard-mode .ap-list-row:hover,
body.ap-teacher-dashboard-mode .ap-list-row:focus-visible,
body.ap-teacher-dashboard-mode .ap-class-row:hover,
body.ap-teacher-dashboard-mode .ap-class-row:focus-visible,
body.ap-teacher-dashboard-mode .ap-dash-quick-card:hover,
body.ap-teacher-dashboard-mode .ap-dash-quick-card:focus-visible,
body.ap-teacher-dashboard-mode .ap-empty-state:hover,
body.ap-teacher-dashboard-mode .ap-empty-state:focus-visible,
body.ap-teacher-dashboard-mode .ap-dashboard-surface-list:hover,
body.ap-teacher-dashboard-mode .ap-dashboard-surface-list:focus-visible,
body.ap-teacher-dashboard-mode .dashboard-journal-card__top:hover,
body.ap-teacher-dashboard-mode .dashboard-journal-card__top:focus-visible,
body.ap-teacher-dashboard-mode .journal-day-cell:hover,
body.ap-teacher-dashboard-mode .journal-day-cell:focus-visible,
body.ap-teacher-dashboard-mode #dashboard-weekly-schedule-list > div > div:hover,
body.ap-teacher-dashboard-mode #dashboard-weekly-schedule-list > div > div:focus-visible,
body.ap-teacher-dashboard-mode #dashboard-onboarding-weekly-items > div:hover,
body.ap-teacher-dashboard-mode #dashboard-onboarding-weekly-items > div:focus-visible {
  background: var(--ap-dashboard-blue-hover-bg) !important;
  border-color: var(--ap-dashboard-blue-hover-border) !important;
  box-shadow: var(--ap-dashboard-blue-hover-shadow) !important;
  transform: translateY(var(--ap-dashboard-hover-lift)) scale(var(--ap-dashboard-hover-scale)) !important;
}

body.ap-teacher-dashboard-mode .ap-metric-card:active,
body.ap-teacher-dashboard-mode .ap-list-row:active,
body.ap-teacher-dashboard-mode .ap-class-row:active,
body.ap-teacher-dashboard-mode .ap-dash-quick-card:active,
body.ap-teacher-dashboard-mode .journal-day-cell:active {
  transform: translateY(0) scale(1) !important;
  box-shadow: none !important;
}

#ap-admin-dashboard .card,
#ap-admin-dashboard .ap-admin-card,
#ap-admin-dashboard .ap-admin-teacher-card,
#ap-admin-dashboard .ap-admin-mini-metric,
#ap-admin-dashboard .ap-admin-check-item,
#ap-admin-dashboard .ap-admin-recent-student-grid,
#ap-admin-dashboard .ap-admin-assessment-card,
#ap-admin-dashboard .ap-admin-consultation-row,
#ap-admin-dashboard .ap-admin-recent-student-row,
#ap-admin-dashboard .ap-admin-search-row,
#ap-admin-dashboard .admin-teacher-card__quick-action,
#ap-admin-dashboard .admin-teacher-student-row,
#ap-admin-dashboard .ap-dashboard-surface-list,
#ap-admin-dashboard .ap-dashboard-action-button,
#ap-admin-dashboard .ap-admin-shortcuts .btn,
#ap-admin-dashboard .ap-admin-app-gate .btn {
  transition:
    background var(--ap-dashboard-hover-duration) ease,
    border-color var(--ap-dashboard-hover-duration) ease,
    box-shadow var(--ap-dashboard-hover-duration) ease,
    transform var(--ap-dashboard-hover-duration) ease !important;
  transform-origin: center;
}

#ap-admin-dashboard .card:hover,
#ap-admin-dashboard .card:focus-visible,
#ap-admin-dashboard .ap-admin-card:hover,
#ap-admin-dashboard .ap-admin-card:focus-visible,
#ap-admin-dashboard .ap-admin-teacher-card:hover,
#ap-admin-dashboard .ap-admin-teacher-card:focus-visible,
#ap-admin-dashboard .ap-admin-mini-metric:hover,
#ap-admin-dashboard .ap-admin-mini-metric:focus-visible,
#ap-admin-dashboard .ap-admin-check-item:hover,
#ap-admin-dashboard .ap-admin-check-item:focus-visible,
#ap-admin-dashboard .ap-admin-recent-student-grid:hover,
#ap-admin-dashboard .ap-admin-recent-student-grid:focus-visible,
#ap-admin-dashboard .ap-admin-assessment-card:hover,
#ap-admin-dashboard .ap-admin-assessment-card:focus-visible,
#ap-admin-dashboard .ap-admin-consultation-row:hover,
#ap-admin-dashboard .ap-admin-consultation-row:focus-visible,
#ap-admin-dashboard .ap-admin-recent-student-row:hover,
#ap-admin-dashboard .ap-admin-recent-student-row:focus-visible,
#ap-admin-dashboard .ap-admin-search-row:hover,
#ap-admin-dashboard .ap-admin-search-row:focus-visible,
#ap-admin-dashboard .admin-teacher-card__quick-action:hover,
#ap-admin-dashboard .admin-teacher-card__quick-action:focus-visible,
#ap-admin-dashboard .admin-teacher-student-row:hover,
#ap-admin-dashboard .admin-teacher-student-row:focus-visible,
#ap-admin-dashboard .ap-dashboard-surface-list:hover,
#ap-admin-dashboard .ap-dashboard-surface-list:focus-visible,
#ap-admin-dashboard .ap-dashboard-action-button:hover,
#ap-admin-dashboard .ap-dashboard-action-button:focus-visible,
#ap-admin-dashboard .ap-admin-shortcuts .btn:hover,
#ap-admin-dashboard .ap-admin-shortcuts .btn:focus-visible,
#ap-admin-dashboard .ap-admin-app-gate .btn:hover,
#ap-admin-dashboard .ap-admin-app-gate .btn:focus-visible {
  background: var(--ap-dashboard-owner-hover-bg) !important;
  border-color: var(--ap-dashboard-owner-hover-border) !important;
  box-shadow: var(--ap-dashboard-owner-hover-shadow) !important;
  transform: translateY(var(--ap-dashboard-hover-lift)) scale(var(--ap-dashboard-hover-scale)) !important;
}

#ap-admin-dashboard .card:active,
#ap-admin-dashboard .ap-admin-teacher-card:active,
#ap-admin-dashboard .ap-admin-mini-metric:active,
#ap-admin-dashboard .ap-admin-check-item:active,
#ap-admin-dashboard .ap-admin-consultation-row:active,
#ap-admin-dashboard .ap-admin-recent-student-row:active,
#ap-admin-dashboard .admin-teacher-card__quick-action:active,
#ap-admin-dashboard .ap-dashboard-action-button:active,
#ap-admin-dashboard .ap-admin-shortcuts .btn:active,
#ap-admin-dashboard .ap-admin-app-gate .btn:active {
  transform: translateY(0) scale(1) !important;
  box-shadow: none !important;
}

#ap-admin-dashboard .ap-admin-shortcuts .btn[aria-current="page"],
#ap-admin-dashboard .ap-admin-app-gate .btn[aria-current="page"],
#ap-admin-dashboard .ap-admin-shortcuts .btn.is-active,
#ap-admin-dashboard .ap-admin-app-gate .btn.is-active {
  transform: none !important;
}

body.ap-teacher-dashboard-mode .ap-dashboard-surface-list--today:hover,
body.ap-teacher-dashboard-mode .ap-dashboard-surface-list--today:focus-visible {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row {
  cursor: pointer;
  min-height: 52px;
  transition:
    background var(--ap-dashboard-hover-duration, 140ms) ease,
    transform var(--ap-dashboard-hover-duration, 140ms) ease !important;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row:hover,
body.ap-teacher-dashboard-mode .ap-dashboard-memo-row:focus-visible {
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface)) !important;
  outline: none;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row:active {
  transform: scale(0.995) !important;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  min-width: 32px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  cursor: pointer;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row__content {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ap-teacher-dashboard-mode .ap-dashboard-memo-row__meta {
  font-size: 12px;
  font-weight: 400;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  body.ap-teacher-dashboard-mode .ap-metric-card,
  body.ap-teacher-dashboard-mode .ap-dash-card,
  body.ap-teacher-dashboard-mode .ap-list-row,
  body.ap-teacher-dashboard-mode .ap-class-row,
  body.ap-teacher-dashboard-mode .ap-dash-quick-card,
  body.ap-teacher-dashboard-mode .ap-empty-state,
  body.ap-teacher-dashboard-mode .ap-dashboard-surface-list,
  body.ap-teacher-dashboard-mode .ap-dashboard-memo-row,
  body.ap-teacher-dashboard-mode .dashboard-journal-card__top,
  body.ap-teacher-dashboard-mode .journal-day-cell,
  #ap-admin-dashboard .card,
  #ap-admin-dashboard .ap-admin-card,
  #ap-admin-dashboard .ap-admin-teacher-card,
  #ap-admin-dashboard .ap-admin-mini-metric,
  #ap-admin-dashboard .ap-admin-check-item,
  #ap-admin-dashboard .ap-admin-consultation-row,
  #ap-admin-dashboard .ap-admin-recent-student-row,
  #ap-admin-dashboard .admin-teacher-card__quick-action {
    transition: background .01ms linear, border-color .01ms linear !important;
    transform: none !important;
    box-shadow: none !important;
  }
}


/* ============================================================
   Round minfix — AP teacher dashboard row hover coverage only
   - Covers class rows and journal rows that were still falling back to
     neutral black/gray hover rules.
   - No layout/size changes.
============================================================ */
.ap-dash-redesign .ap-class-row,
.ap-dash-redesign .journal-day-cell,
.ap-dash-redesign .dashboard-journal-card__top,
.ap-dash-redesign .ap-list-row {
  transition:
    background var(--ap-dashboard-hover-duration, 140ms) ease,
    border-color var(--ap-dashboard-hover-duration, 140ms) ease,
    box-shadow var(--ap-dashboard-hover-duration, 140ms) ease,
    transform var(--ap-dashboard-hover-duration, 140ms) ease !important;
  transform-origin: center;
}

.ap-dash-redesign .ap-class-row:hover,
.ap-dash-redesign .ap-class-row:focus-visible,
.ap-dash-redesign .journal-day-cell:hover,
.ap-dash-redesign .journal-day-cell:focus-visible,
.ap-dash-redesign .dashboard-journal-card__top:hover,
.ap-dash-redesign .dashboard-journal-card__top:focus-visible,
.ap-dash-redesign .ap-list-row:hover,
.ap-dash-redesign .ap-list-row:focus-visible {
  background: var(--ap-dashboard-blue-hover-bg, color-mix(in srgb, var(--primary) 6%, var(--surface))) !important;
  border-color: var(--ap-dashboard-blue-hover-border, color-mix(in srgb, var(--primary) 58%, var(--border))) !important;
  box-shadow: var(--ap-dashboard-blue-hover-shadow, 0 6px 14px rgba(26, 92, 255, 0.075)) !important;
  transform: translateY(var(--ap-dashboard-hover-lift, -1px)) scale(var(--ap-dashboard-hover-scale, 1.002)) !important;
}

.ap-dash-redesign .ap-class-row:active,
.ap-dash-redesign .journal-day-cell:active,
.ap-dash-redesign .dashboard-journal-card__top:active,
.ap-dash-redesign .ap-list-row:active {
  transform: translateY(0) scale(1) !important;
  box-shadow: none !important;
}

/* Owner dashboard consultation center */
#modal-content:has(.ap-admin-consultation-center) {
  width: min(1080px, calc(100vw - 32px));
  max-width: 1080px;
  height: min(820px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
}

#modal-body:has(.ap-admin-consultation-center) {
  padding: 0;
  overflow: hidden;
}

#modal-body:has(.ap-admin-consultation-center) > #admin-consultation-center-body {
  display: flex;
  min-height: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
}

.ap-admin-consultation-center {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  background: var(--bg);
}

.ap-admin-consultation-center__toolbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 150px 150px;
  gap: 10px;
  padding: 16px 20px 10px;
  background: var(--surface);
}

.ap-admin-consultation-center__toolbar input,
.ap-admin-consultation-center__toolbar select {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.ap-admin-consultation-center__toolbar input:focus,
.ap-admin-consultation-center__toolbar select:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 18%, transparent);
  outline-offset: 1px;
}

.ap-admin-consultation-center__summary {
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
}

.ap-admin-consultation-center__list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
}

.ap-admin-consultation-center__head,
.ap-admin-consultation-center__row {
  display: grid;
  grid-template-columns: 106px minmax(100px, 0.8fr) minmax(100px, 0.9fr) 92px minmax(240px, 2.4fr) 24px;
  gap: 14px;
  align-items: center;
}

.ap-admin-consultation-center__head {
  position: sticky;
  z-index: 1;
  top: 0;
  min-height: 38px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
}

.ap-admin-consultation-center__item {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.ap-admin-consultation-center__row {
  width: 100%;
  min-height: 58px;
  padding: 10px 20px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ap-admin-consultation-center__row:hover,
.ap-admin-consultation-center__row:focus-visible,
.ap-admin-consultation-center__item.is-expanded .ap-admin-consultation-center__row {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.ap-admin-consultation-center__row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.ap-admin-consultation-center__cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}

.ap-admin-consultation-center__date,
.ap-admin-consultation-center__class {
  color: var(--secondary);
}

.ap-admin-consultation-center__student {
  font-size: 13px;
  font-weight: 700;
}

.ap-admin-consultation-center__type > span {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
}

.ap-admin-consultation-center__preview {
  color: var(--secondary);
}

.ap-admin-consultation-center__chevron {
  color: var(--secondary);
  font-size: 18px;
  text-align: center;
  transition: transform 140ms ease;
}

.ap-admin-consultation-center__item.is-expanded .ap-admin-consultation-center__chevron {
  transform: rotate(180deg);
}

.ap-admin-consultation-center__detail {
  display: grid;
  gap: 12px;
  padding: 2px 20px 18px 140px;
  background: color-mix(in srgb, var(--primary) 3%, var(--surface));
}

.ap-admin-consultation-center__detail-content {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.65;
  white-space: pre-wrap;
}

.ap-admin-consultation-center__next-action {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.55;
}

.ap-admin-consultation-center__next-action strong {
  flex: 0 0 auto;
  color: var(--text);
}

.ap-admin-consultation-center__student-button {
  justify-self: start;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ap-admin-consultation-center__more {
  min-height: 44px;
  margin: 12px 20px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ap-admin-consultation-center__empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

@media (max-width: 700px) {
  #modal-content:has(.ap-admin-consultation-center) {
    width: 100vw;
    max-width: 100vw;
    height: calc(92vh - env(safe-area-inset-top));
    max-height: calc(92vh - env(safe-area-inset-top));
  }

  .ap-admin-consultation-center__toolbar {
    grid-template-columns: 1fr 1fr;
    padding: 12px 14px 8px;
  }

  .ap-admin-consultation-center__search {
    grid-column: 1 / -1;
  }

  .ap-admin-consultation-center__summary {
    padding: 0 14px 10px;
  }

  .ap-admin-consultation-center__head {
    display: none;
  }

  .ap-admin-consultation-center__row {
    grid-template-columns: minmax(0, 1fr) auto 20px;
    gap: 7px 10px;
    min-height: 0;
    padding: 14px;
  }

  .ap-admin-consultation-center__cell {
    white-space: normal;
  }

  .ap-admin-consultation-center__date {
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
    font-size: 11px;
  }

  .ap-admin-consultation-center__student {
    grid-column: 1;
    grid-row: 1;
  }

  .ap-admin-consultation-center__class {
    grid-column: 1;
    grid-row: 2;
    font-size: 11px;
  }

  .ap-admin-consultation-center__type {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .ap-admin-consultation-center__preview {
    display: -webkit-box;
    grid-column: 1 / 3;
    grid-row: 3;
    margin-top: 2px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--secondary);
    line-height: 1.5;
  }

  .ap-admin-consultation-center__chevron {
    grid-column: 3;
    grid-row: 1 / 4;
  }

  .ap-admin-consultation-center__detail {
    padding: 0 14px 16px;
  }

  .ap-admin-consultation-center__more {
    margin: 10px 14px 14px;
  }
}
