/* ===================================================
   AI 세특 LMS – Custom Styles  (Phase 3 업데이트)
   =================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Page / Tab Fade-in ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: fadeSlideIn 0.25s ease forwards; }

/* ── Modal ── */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
#modal-backdrop { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#modal-box { animation: modalIn 0.2s ease forwards; }

/* ── Tab underline ── */
.tab-btn { position: relative; transition: color 0.15s ease, border-color 0.15s ease; }

/* ── Card hover lift ── */
.card-lift {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.card-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.07);
}

/* ── Chevron rotate ── */
.chevron-icon { transition: transform 0.2s ease; }
.chevron-icon.open { transform: rotate(180deg); }

/* ── Detail panel animate ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detail-panel { animation: slideDown 0.22s ease forwards; }

/* ── Focus override ── */
input:focus, textarea:focus, select:focus { outline: none; }

/* ── AI glow ── */
.ai-glow { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25); }

/* ── Stat number ── */
.stat-number { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ── Nav active ── */
.nav-btn.active { color: #4f46e5; background-color: #eef2ff; }

/* ── Progress bar ── */
.progress-bar { transition: width 0.5s ease; }

/* ── Toast ── */
@keyframes toastIn  { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(20px); } }
.toast     { animation: toastIn  0.25s ease forwards; }
.toast.out { animation: toastOut 0.25s ease forwards; }

/* ── Table overflow ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Content body text ── */
.content-body {
  white-space: pre-wrap;
  line-height: 1.75;
  color: #374151;
  font-size: 0.875rem;
}

/* ── Dashed "new" card ── */
.dashed-card {
  border: 2px dashed #e5e7eb;
  transition: border-color 0.15s, background 0.15s;
}
.dashed-card:hover { border-color: #a5b4fc; background: #f5f3ff; }

/* ═══════════════════════════════════════════════
   Phase 3 – YouTube 임베드
   ═══════════════════════════════════════════════ */
.yt-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;   /* 16:9 */
  background: #0f0f0f;
  border-radius: 12px;
  overflow: hidden;
}
.yt-wrapper iframe,
.yt-wrapper img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}
.yt-wrapper .yt-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.22);
  transition: background 0.2s ease;
}
.yt-wrapper:hover .yt-overlay { background: rgba(0,0,0,0.35); }

.yt-play-btn {
  width: 56px; height: 56px;
  background: #ff0000;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}
.yt-wrapper:hover .yt-play-btn {
  transform: scale(1.1);
  background: #cc0000;
}

.yt-label {
  margin-top: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════
   Phase 3 – 댓글 스레드
   ═══════════════════════════════════════════════ */
.comment-section {
  border-top: 1px solid #f3f4f6;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

/* 댓글 말풍선 */
.comment-bubble {
  background: #f9fafb;
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 10px 14px;
  transition: background 0.15s;
}
.comment-bubble.teacher-bubble {
  background: #eef2ff;
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}

/* 타입 배지 */
.badge-question    { background:#eff6ff; color:#1d4ed8; }
.badge-peer-review { background:#faf5ff; color:#7c3aed; }
.badge-feedback    { background:#f0fdf4; color:#15803d; }
.badge-comment     { background:#f1f5f9; color:#475569; }

/* 댓글 입력 textarea */
.comment-input {
  background: #f9fafb;
  transition: background 0.15s, border-color 0.15s;
}
.comment-input:focus { background: #fff; }

/* 아바타 이니셜 링 */
.avatar-ring {
  border: 2px solid;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  border-radius: 9999px;
}
.avatar-ring.admin   { background:#eef2ff; color:#4338ca; border-color:#c7d2fe; }
.avatar-ring.teacher { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.avatar-ring.student { background:#fffbeb; color:#92400e; border-color:#fcd34d; }

/* 댓글 등록 버튼 */
.btn-comment-submit {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  border-radius: 0.625rem;
  transition: background 0.15s, transform 0.1s;
}
.btn-comment-submit:active { transform: scale(0.97); }

/* 피드백 카드 구분선 */
.submission-card {
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  overflow: hidden;
}
.submission-card + .submission-card { margin-top: 0.75rem; }

/* ═══════════════════════════════════════════════
   Phase 3.5 – Quill 에디터 커스텀
   ═══════════════════════════════════════════════ */

/* 모달 내 에디터 컨테이너 */
.ql-container.ql-snow {
  border-color: transparent !important;
  font-family: inherit;
  font-size: 0.875rem;
}
.ql-toolbar.ql-snow {
  border-color: #e5e7eb !important;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  background: #f9fafb;
  padding: 6px 8px;
  flex-wrap: wrap;
}
.ql-container.ql-snow {
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
  min-height: 120px;
}
.ql-editor {
  min-height: 120px;
  line-height: 1.7;
  font-size: 0.875rem;
  color: #374151;
}
.ql-editor.ql-blank::before {
  color: #9ca3af;
  font-style: normal;
  font-size: 0.875rem;
}

/* 콘텐츠 뷰어 모드 (저장된 HTML 렌더링) */
.ql-rendered {
  padding: 0 !important;
  border: none !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  line-height: 1.75;
}
.ql-rendered p   { margin-bottom: 0; color: #374151; }
.ql-rendered p + p { margin-top: 0; }
.ql-rendered h1  { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.ql-rendered h2  { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; }
.ql-rendered h3  { font-size: 1rem;   font-weight: 600; margin-bottom: 0.4rem; }
.ql-rendered ul, .ql-rendered ol { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.ql-rendered blockquote {
  border-left: 3px solid #e5e7eb;
  padding-left: 0.75rem;
  color: #6b7280;
  margin: 0.5rem 0;
}
.ql-rendered pre.ql-syntax {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}
.ql-rendered img {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

/* ═══════════════════════════════════════════════
   Phase 3.5 – 회원 상태 배지 & 관리자 탭
   ═══════════════════════════════════════════════ */

/* 차단 상태 행 */
.user-blocked-row { background: rgba(254, 242, 242, 0.4); }
.user-blocked-row td { opacity: 0.75; }

/* 관리자 대시보드 내부 탭 */
.admin-inner-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-bottom: -1px;
}
.admin-inner-tab:hover  { color: #374151; }
.admin-inner-tab.active { border-color: #4f46e5; color: #4f46e5; }

/* 수정됨 표시 뱃지 */
.badge-edited {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════
   Phase 3.5.1 – 생기부 태그 배지 공통 스타일
   ═══════════════════════════════════════════════ */

/* 생기부 태그 공통 배지 (알약 모양) */
.record-tag-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  border-width: 1px;
  border-style: solid;
  line-height: 1.4;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   Phase 3.5.2 – 진로 태그 배지
   ═══════════════════════════════════════════════ */

/* 학생 대시보드 진로 태그 (크게, 삭제 버튼 포함) */
.career-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
  color: #4338ca;
  border: 1px solid #c7d2fe;
  line-height: 1.4;
  white-space: nowrap;
  gap: 4px;
}

/* 학생 목록 테이블용 미니 진로 태그 */
.career-tag-sm {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════
   Phase 3.5.2 – 학생 포트폴리오 드로워
   ═══════════════════════════════════════════════ */

.portfolio-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.35s ease;
  cursor: pointer;
}
.portfolio-overlay.open {
  background: rgba(15, 23, 42, 0.35);
}

.portfolio-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(620px, 96vw);
  background: #f8fafc;
  box-shadow: -12px 0 48px rgba(15, 23, 42, 0.14);
  transform: translateX(105%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.portfolio-panel.open {
  transform: translateX(0);
}

.portfolio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.portfolio-close-btn {
  padding: 0.5rem;
  color: #9ca3af;
  border-radius: 0.625rem;
  transition: background 0.15s, color 0.15s;
  line-height: 0;
}
.portfolio-close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.portfolio-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
}
.portfolio-body::-webkit-scrollbar { width: 5px; }
.portfolio-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.portfolio-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.01em;
  padding-bottom: 0.625rem;
  margin-bottom: 0.875rem;
  border-bottom: 2px solid #e0e7ff;
}

/* ═══════════════════════════════════════════════
   Phase 3.5.2 – 활동 타임라인
   ═══════════════════════════════════════════════ */

.timeline-list {
  position: relative;
  padding-left: 1.25rem;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: linear-gradient(to bottom, #c7d2fe, #e2e8f0);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.625rem 0;
}

.timeline-dot {
  position: absolute;
  left: -1.25rem;
  top: 0.75rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid #818cf8;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.timeline-content {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 0.625rem;
}

/* 마감 종료 표시 */
.deadline-passed {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: center;
  color: #dc2626;
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════
   Phase 4 – RAG JSON 추출 버튼
   ═══════════════════════════════════════════════ */
.rag-export-btn {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 1px 4px rgba(16,185,129,.35);
}
.rag-export-btn:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 3px 10px rgba(16,185,129,.45);
  transform: translateY(-1px);
}
.rag-export-btn:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════
   Phase 4 – Q&A 채팅 탭 레이아웃
   ═══════════════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 540px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(90deg, #eef2ff, #f5f3ff);
  border-bottom: 1px solid #e0e7ff;
  flex-shrink: 0;
}

.chat-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  scroll-behavior: smooth;
}
.chat-messages-list::-webkit-scrollbar { width: 4px; }
.chat-messages-list::-webkit-scrollbar-thumb { background: #e0e7ff; border-radius: 4px; }

/* 메시지 행 */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  animation: chatMsgIn 0.18s ease forwards;
}
.chat-row-mine  { flex-direction: row-reverse; }
.chat-row-other { flex-direction: row; }

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-avatar { align-self: flex-end; }

.chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 68%;
  width: fit-content;
  gap: 0.2rem;
}
.chat-row-mine .chat-bubble-wrap {
  align-items: flex-end;
}

.chat-sender {
  font-size: 0.7rem;
  color: #6b7280;
  padding-left: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chat-role-teacher {
  font-size: 0.65rem;
  background: #e0e7ff;
  color: #4f46e5;
  padding: 1px 5px;
  border-radius: 9999px;
  font-weight: 600;
}
.chat-role-admin {
  font-size: 0.65rem;
  background: #fef3c7;
  color: #d97706;
  padding: 1px 5px;
  border-radius: 9999px;
  font-weight: 600;
}

.chat-bubble {
  padding: 0.55rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  width: fit-content;
}
.chat-bubble-mine {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 0.3rem;
  align-self: flex-end;
}
.chat-bubble-other {
  background: #f3f4f6;
  color: #1f2937;
  border-bottom-left-radius: 0.3rem;
}

.chat-meta {
  display: flex;
  align-items: center;
  font-size: 0.65rem;
  color: #9ca3af;
  padding: 0 0.25rem;
}
.chat-row-mine .chat-meta { justify-content: flex-end; }

.chat-reply-preview {
  font-size: 0.7rem;
  color: #6366f1;
  background: #eef2ff;
  border-left: 2px solid #6366f1;
  padding: 3px 8px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 답글 바 */
.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: #eef2ff;
  border-top: 1px solid #e0e7ff;
  flex-shrink: 0;
}

/* 입력창 */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
  flex-shrink: 0;
}

.chat-input {
  padding: 0.6rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 1.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
}
.chat-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.chat-send-btn {
  padding: 0.6rem 1.1rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 1.5rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.chat-send-btn:hover  { opacity: 0.9; transform: scale(1.02); }
.chat-send-btn:active { transform: scale(0.97); }


/* ═══════════════════════════════════════════════
   Phase 5.0.0 – 담임교사 시스템
   ═══════════════════════════════════════════════ */

/* ── 교사 대시보드 담임/교과 탭 ── */
.hr-dash-tab {
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.hr-dash-tab:hover  { color: #059669; }
.hr-dash-tab.active {
  color: #059669;
  border-bottom-color: #059669;
  font-weight: 600;
}

/* ── 학생 종합 조회 모달 섹션 타이틀 ── */
.hr-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid #e5e7eb;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── 교과 수업 현황 프로그레스 바 ── */
.hr-subject-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: box-shadow .15s;
}
.hr-subject-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* ── 학급 행사 뱃지 ── */
.hr-event-badge-자율 {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.hr-event-badge-진로 {
  background: #faf5ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

/* ── 관리자 담임 설정 토글 ── */
.admin-hr-toggle-on {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.admin-hr-toggle-off {
  background: #f9fafb;
  color: #6b7280;
  border-color: #e5e7eb;
}
.admin-hr-toggle-on:hover  { background: #d1fae5; }
.admin-hr-toggle-off:hover { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }

/* ═══════════════════════════════════════════════
   읽지 않은 알림 동그라미
   ═══════════════════════════════════════════════ */
.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 4px;
  vertical-align: middle;
  animation: unreadPulse 2s ease-in-out infinite;
}
.tab-unread-dot {
  position: absolute;
  top: 6px;
  right: 2px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid white;
  pointer-events: none;
}
html.dark .tab-unread-dot { border-color: #222819; }
@keyframes unreadPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.refresh-icon.spin { animation: refreshSpin 0.8s linear infinite; }
@keyframes refreshSpin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   다크 모드
   ═══════════════════════════════════════════════ */

/* ── 전역 배경·텍스트 (올리브/카키 톤) ── */
html.dark body                   { background: #181c14; color: #ddd8c4; }
html.dark header                 { background: #1f2419 !important; border-color: #333a28 !important; }
html.dark main                   { color: #ddd8c4; }

/* Tailwind bg-white / bg-gray 오버라이드 */
html.dark .bg-white              { background: #222819 !important; }
html.dark .bg-gray-50            { background: #1a1f15 !important; }
html.dark .bg-gray-100           { background: #222819 !important; }

/* 텍스트 색상 */
html.dark .text-gray-900         { color: #eae5d3 !important; }
html.dark .text-gray-800         { color: #ddd8c4 !important; }
html.dark .text-gray-700         { color: #bfb99a !important; }
html.dark .text-gray-600         { color: #9a9477 !important; }
html.dark .text-gray-500         { color: #9a9477 !important; }
html.dark .text-gray-400         { color: #6e6b52 !important; }
html.dark .text-gray-300         { color: #4a4835 !important; }

/* 보더 */
html.dark .border-gray-100       { border-color: #333a28 !important; }
html.dark .border-gray-200       { border-color: #333a28 !important; }
html.dark .border-gray-50        { border-color: #282e1e !important; }

/* 입력 필드 */
html.dark input, html.dark textarea, html.dark select {
  background: #252b1c !important;
  color: #ddd8c4 !important;
  border-color: #3e4530 !important;
}
html.dark input::placeholder, html.dark textarea::placeholder {
  color: #6e6b52 !important;
}
html.dark input:focus, html.dark textarea:focus, html.dark select:focus {
  border-color: #c8a84e !important;
}

/* 테이블 */
html.dark .bg-gray-50 th         { color: #9a9477 !important; }
html.dark tr:hover               { background: #282e1e !important; }
html.dark .hover\:bg-gray-50:hover     { background: #282e1e !important; }
html.dark .hover\:bg-indigo-50\/40:hover { background: rgba(200,168,78,0.06) !important; }

/* 모달 */
html.dark #modal-box             { background: #222819 !important; }
html.dark #modal-backdrop        { background: rgba(10,12,8,0.75) !important; }

/* 카드 / 보더 — indigo→amber 톤 */
html.dark .border-indigo-100     { border-color: #3e4530 !important; }
html.dark .bg-indigo-50          { background: rgba(200,168,78,0.08) !important; }
html.dark .bg-indigo-50\/60      { background: rgba(200,168,78,0.05) !important; }

/* indigo 텍스트·배경·보더 → 골드/앰버 */
html.dark .text-indigo-600       { color: #d4a94e !important; }
html.dark .text-indigo-500       { color: #c8a84e !important; }
html.dark .text-indigo-400       { color: #c8a84e !important; }
html.dark .text-indigo-700       { color: #b89840 !important; }
html.dark .border-indigo-500     { border-color: #c8a84e !important; }
html.dark .border-indigo-200     { border-color: #4a4530 !important; }
html.dark .bg-indigo-600         { background: #8b6d1e !important; }
html.dark .bg-indigo-700         { background: #7a5f18 !important; }
html.dark .hover\:bg-indigo-700:hover  { background: #7a5f18 !important; }
html.dark .hover\:bg-indigo-100:hover  { background: rgba(200,168,78,0.12) !important; }
html.dark .hover\:text-indigo-600:hover { color: #d4a94e !important; }
html.dark .hover\:text-indigo-700:hover { color: #b89840 !important; }
html.dark .ring-indigo-400       { --tw-ring-color: #c8a84e !important; }
html.dark .focus\:ring-indigo-400:focus { --tw-ring-color: #c8a84e !important; }

/* purple 텍스트 → 따뜻한 황토 */
html.dark .text-purple-600       { color: #c8a84e !important; }
html.dark .bg-purple-50          { background: rgba(200,168,78,0.08) !important; }
html.dark .border-purple-100     { border-color: #3e4530 !important; }

/* emerald/teal → 카키 밝은 톤 유지 */
html.dark .bg-emerald-600        { background: #5a7a30 !important; }
html.dark .hover\:bg-emerald-700:hover { background: #4e6c28 !important; }
html.dark .bg-teal-500           { background: #5a7a30 !important; }
html.dark .hover\:bg-teal-600:hover    { background: #4e6c28 !important; }

/* 네비게이션 */
html.dark .nav-btn               { color: #9a9477; }
html.dark .nav-btn:hover         { color: #ddd8c4; background: #2e3422; }
html.dark .nav-btn.active        { color: #d4a94e; background: rgba(200,168,78,0.1); }

/* 댓글 */
html.dark .comment-bubble        { background: #2a3020; }
html.dark .comment-bubble.teacher-bubble { background: rgba(200,168,78,0.08); }
html.dark .comment-input         { background: #252b1c; }
html.dark .comment-input:focus   { background: #1f2419; }

/* Quill 에디터 */
html.dark .ql-toolbar.ql-snow    { background: #282e1e !important; border-color: #3e4530 !important; }
html.dark .ql-container.ql-snow  { border-color: #3e4530 !important; }
html.dark .ql-editor             { color: #ddd8c4 !important; background: #252b1c; }
html.dark .ql-editor.ql-blank::before { color: #6e6b52 !important; }
html.dark .ql-snow .ql-stroke    { stroke: #9a9477 !important; }
html.dark .ql-snow .ql-fill      { fill: #9a9477 !important; }
html.dark .ql-snow .ql-picker-label { color: #9a9477 !important; }

/* 콘텐츠 렌더 */
html.dark .ql-rendered p         { color: #bfb99a; }
html.dark .ql-rendered blockquote { color: #9a9477; border-color: #3e4530; }
html.dark .content-body          { color: #bfb99a; }

/* 채팅 */
html.dark .chat-container        { background: #222819; border-color: #333a28; }
html.dark .chat-header           { background: linear-gradient(90deg, #1f2419, #2a3020); border-color: #3e4530; }
html.dark .chat-bubble-other     { background: #2a3020; color: #ddd8c4; }
html.dark .chat-input-row        { background: #1a1f15; border-color: #333a28; }
html.dark .chat-input            { background: #252b1c; border-color: #3e4530; color: #ddd8c4; }
html.dark .chat-reply-bar        { background: #282e1e; border-color: #3e4530; }
html.dark .chat-reply-preview    { background: #2a3020; color: #bfb99a; }
html.dark .chat-sender           { color: #9a9477; }

/* 포트폴리오 드로워 */
html.dark .portfolio-panel       { background: #181c14; }
html.dark .portfolio-header      { background: #222819; border-color: #333a28; }
html.dark .portfolio-close-btn:hover { background: #2e3422; color: #ddd8c4; }
html.dark .portfolio-section-title { color: #ddd8c4; border-color: #3e4530; }
html.dark .timeline-content      { background: #222819; border-color: #333a28; }
html.dark .timeline-dot          { background: #222819; }

/* 제출물 카드 */
html.dark .submission-card       { border-color: #333a28; }
html.dark .submission-card .bg-gray-50 { background: #1a1f15 !important; }

/* 아바타 */
html.dark .avatar-ring.admin     { background: #2e3422; color: #d4a94e; border-color: #8b6d1e; }
html.dark .avatar-ring.teacher   { background: #253020; color: #8cc665; border-color: #4a7a28; }
html.dark .avatar-ring.student   { background: #302e18; color: #e0c060; border-color: #a08030; }

/* 배지 */
html.dark .badge-edited          { background: #2a3020; color: #6e6b52; border-color: #3e4530; }
html.dark .career-badge          { background: linear-gradient(135deg, #2a3020, #333a28); color: #d4a94e; border-color: #4a4530; }
html.dark .career-tag-sm         { background: #2a3020; color: #d4a94e; border-color: #4a4530; }

/* 관리자 탭 */
html.dark .admin-inner-tab       { color: #9a9477; }
html.dark .admin-inner-tab:hover { color: #ddd8c4; }
html.dark .admin-inner-tab.active { color: #d4a94e; border-color: #d4a94e; }

/* 담임 탭 */
html.dark .hr-dash-tab           { color: #9a9477; }
html.dark .hr-dash-tab:hover     { color: #8cc665; }
html.dark .hr-dash-tab.active    { color: #8cc665; border-color: #8cc665; }

/* 교과 현황 카드 */
html.dark .hr-subject-card       { background: #222819; border-color: #333a28; }
html.dark .hr-subject-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.35); }
html.dark .hr-section-title      { color: #eae5d3; border-color: #3e4530; }

/* 마감 종료 */
html.dark .deadline-passed       { background: #2e1a12; border-color: #5c2a18; color: #f0a090; }

/* 탭 버튼 활성 — 골드 */
html.dark .tab-btn.border-indigo-500 { border-color: #c8a84e !important; }
html.dark .tab-btn.text-indigo-600   { color: #d4a94e !important; }

/* 스크롤바 */
html.dark ::-webkit-scrollbar-track { background: #1f2419; }
html.dark ::-webkit-scrollbar-thumb { background: #3e4530; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #525840; }

/* 토스트 */
html.dark .toast                 { background: #2a3020; color: #ddd8c4; }

/* 로그인 화면 */
html.dark .login-bg { background: linear-gradient(135deg, #181c14, #1f2419, #181c14) !important; }
html.dark #app-root { background: #181c14; }

/* 로그인 버튼 */
html.dark .login-bg .bg-indigo-600,
html.dark .login-bg .from-indigo-500,
html.dark .login-bg [class*="bg-gradient"] {
  background: linear-gradient(135deg, #8b6d1e, #a07a20) !important;
}

/* violet 계열 → 골드 */
html.dark .bg-violet-50          { background: rgba(200,168,78,0.06) !important; }
html.dark .text-violet-700       { color: #c8a84e !important; }
html.dark .border-violet-200     { border-color: #4a4530 !important; }
html.dark .border-violet-100     { border-color: #3e4530 !important; }
html.dark .hover\:bg-violet-100:hover { background: rgba(200,168,78,0.1) !important; }

/* 테마 토글 버튼 */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  transition: all 0.15s;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}
.theme-toggle:hover { color: #f59e0b; border-color: #f59e0b; background: #fffbeb; }
html.dark .theme-toggle { color: #9a9477; border-color: #3e4530; }
html.dark .theme-toggle:hover { color: #d4a94e; border-color: #d4a94e; background: rgba(200,168,78,0.08); }

/* 아바타 모달 다크 */
html.dark #avatar-modal .bg-white { background: #222819 !important; }
html.dark #avatar-modal .border-gray-200 { border-color: #3e4530 !important; }
html.dark #avatar-modal .border-gray-300 { border-color: #3e4530 !important; }
html.dark #avatar-modal .text-gray-800 { color: #ddd8c4 !important; }
html.dark #avatar-modal .text-gray-700 { color: #bfb99a !important; }
html.dark #avatar-modal .text-gray-500 { color: #9a9477 !important; }
