/* ============================================================
   세리정보기술 인사평가 · 세리인상 — 라이트 / 다크 테마
   ------------------------------------------------------------
   HTML 의 클래스(유틸리티) 는 그대로 두고, html[data-theme="dark"]
   스코프에서 색상 유틸리티만 덮어쓰는 방식입니다.
   → 기존 화면 구조·동작을 건드리지 않고 다크 모드를 적용합니다.

   사용: 각 페이지 <head> 에서
     <link href="/static/theme.css" rel="stylesheet">
     <script src="/static/theme.js" defer></script>
   ============================================================ */

:root {
  --seri-bg: #f8fafc;
  --seri-surface: #ffffff;
  --seri-surface-2: #f9fafb;
  --seri-surface-3: #f3f4f6;
  --seri-border: #e5e7eb;
  --seri-border-strong: #d1d5db;
  --seri-text: #1f2937;
  --seri-text-soft: #4b5563;
  --seri-text-muted: #9ca3af;
  color-scheme: light;
}

html[data-theme='dark'] {
  --seri-bg: #0b1220;
  --seri-surface: #141d2e;
  --seri-surface-2: #1a2437;
  --seri-surface-3: #212d43;
  --seri-border: #27334a;
  --seri-border-strong: #3a4a66;
  --seri-text: #e6edf7;
  --seri-text-soft: #b6c3d6;
  --seri-text-muted: #8494ab;
  color-scheme: dark;
}

/* ---------- 스크롤바 ---------- */
html[data-theme='dark'] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme='dark'] ::-webkit-scrollbar-track { background: #0d1524; }
html[data-theme='dark'] ::-webkit-scrollbar-thumb {
  background: #2f3d57;
  border-radius: 8px;
}
html[data-theme='dark'] ::-webkit-scrollbar-thumb:hover { background: #3d5075; }

/* ---------- 바탕 ---------- */
html[data-theme='dark'] body,
html[data-theme='dark'] .bg-gray-50,
html[data-theme='dark'] .bg-gray-50\/50,
html[data-theme='dark'] .bg-slate-50 {
  background-color: var(--seri-bg) !important;
  color: var(--seri-text);
}

/* ---------- 카드 / 표면 ---------- */
html[data-theme='dark'] .bg-white,
html[data-theme='dark'] .bg-white\/95 {
  background-color: var(--seri-surface) !important;
}
html[data-theme='dark'] .bg-gray-50,
html[data-theme='dark'] .bg-gray-100,
html[data-theme='dark'] .bg-slate-100,
html[data-theme='dark'] .bg-slate-200,
html[data-theme='dark'] .bg-slate-200\/60,
html[data-theme='dark'] .bg-gray-200 {
  background-color: var(--seri-surface-2) !important;
}
html[data-theme='dark'] .bg-gray-400,
html[data-theme='dark'] .bg-gray-600,
html[data-theme='dark'] .bg-gray-800,
html[data-theme='dark'] .bg-slate-700 {
  background-color: #38455e !important;
}
html[data-theme='dark'] .bg-slate-800\/60,
html[data-theme='dark'] .bg-slate-800\/80 {
  background-color: rgba(24, 34, 52, 0.86) !important;
}

/* ---------- 로그인 배경 그라디언트 ---------- */
html[data-theme='dark'] #loginScreen {
  background-image: linear-gradient(135deg, #0a1020 0%, #131a33 55%, #1c1440 100%) !important;
}

/* ---------- 글자 ---------- */
html[data-theme='dark'] .text-gray-800,
html[data-theme='dark'] .text-gray-900,
html[data-theme='dark'] .text-slate-800,
html[data-theme='dark'] .text-slate-900 {
  color: var(--seri-text) !important;
}
html[data-theme='dark'] .text-gray-600,
html[data-theme='dark'] .text-gray-700,
html[data-theme='dark'] .text-slate-600,
html[data-theme='dark'] .text-slate-700 {
  color: var(--seri-text-soft) !important;
}
html[data-theme='dark'] .text-gray-400,
html[data-theme='dark'] .text-gray-500,
html[data-theme='dark'] .text-slate-400,
html[data-theme='dark'] .text-slate-500 {
  color: var(--seri-text-muted) !important;
}
html[data-theme='dark'] .text-gray-300,
html[data-theme='dark'] .text-slate-300 {
  color: #64748b !important;
}

/* ---------- 테두리 / 구분선 ---------- */
html[data-theme='dark'] .border-gray-50,
html[data-theme='dark'] .border-gray-100,
html[data-theme='dark'] .border-gray-200,
html[data-theme='dark'] .border-gray-200\/60,
html[data-theme='dark'] .border-gray-300,
html[data-theme='dark'] .border-slate-100,
html[data-theme='dark'] .border-slate-200,
html[data-theme='dark'] .border-slate-200\/30,
html[data-theme='dark'] .border-slate-200\/60,
html[data-theme='dark'] .border-slate-200\/80 {
  border-color: var(--seri-border) !important;
}
html[data-theme='dark'] .border-slate-700,
html[data-theme='dark'] .border-slate-700\/50,
html[data-theme='dark'] .border-slate-800 {
  border-color: #33415c !important;
}
html[data-theme='dark'] .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--seri-border) !important;
}

/* ---------- 표 ---------- */
html[data-theme='dark'] table { color: var(--seri-text); }
html[data-theme='dark'] thead tr.bg-gray-50,
html[data-theme='dark'] tr.bg-gray-50 {
  background-color: var(--seri-surface-3) !important;
}
html[data-theme='dark'] tbody tr:hover,
html[data-theme='dark'] tr.hover\:bg-gray-50:hover,
html[data-theme='dark'] .hover\:bg-gray-50:hover,
html[data-theme='dark'] .hover\:bg-gray-100:hover {
  background-color: #1e2a40 !important;
}

/* ---------- 평가대상자 표: 고정 컬럼(sticky) ---------- */
html[data-theme='dark'] #empTableScroll {
  border-color: var(--seri-border) !important;
}
html[data-theme='dark'] .emp-table > thead > tr > th {
  background: var(--seri-surface-3) !important;
  border-bottom-color: var(--seri-border) !important;
}
html[data-theme='dark'] .emp-table > thead > tr > th.emp-fixed-col {
  background: var(--seri-surface-3) !important;
}
html[data-theme='dark'] .emp-table .emp-fixed-col {
  background: var(--seri-surface) !important;
}
html[data-theme='dark'] .emp-table tbody tr:hover .emp-fixed-col {
  background: #1e2a40 !important;
}
html[data-theme='dark'] .emp-table .emp-col-3 {
  box-shadow: 8px 0 8px -6px rgba(0, 0, 0, .55);
}

/* ---------- 폼 요소 ---------- */
html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
  background-color: #0f1728 !important;
  color: var(--seri-text) !important;
  border-color: var(--seri-border-strong) !important;
}
html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
  color: #6b7c96 !important;
}
html[data-theme='dark'] select option {
  background-color: #0f1728;
  color: var(--seri-text);
}
html[data-theme='dark'] input:focus,
html[data-theme='dark'] select:focus,
html[data-theme='dark'] textarea:focus {
  border-color: #4f7df3 !important;
  box-shadow: 0 0 0 3px rgba(79, 125, 243, 0.22);
}
html[data-theme='dark'] input[type='checkbox'],
html[data-theme='dark'] input[type='radio'] {
  accent-color: #4f7df3;
}

/* ---------- 연한 배경(알림 박스) ---------- */
html[data-theme='dark'] .bg-blue-50 { background-color: rgba(59, 130, 246, 0.13) !important; }
html[data-theme='dark'] .bg-blue-100 { background-color: rgba(59, 130, 246, 0.2) !important; }
html[data-theme='dark'] .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.14) !important; }
html[data-theme='dark'] .bg-indigo-100 { background-color: rgba(99, 102, 241, 0.22) !important; }
html[data-theme='dark'] .bg-purple-50 { background-color: rgba(168, 85, 247, 0.14) !important; }
html[data-theme='dark'] .bg-purple-100 { background-color: rgba(168, 85, 247, 0.22) !important; }
html[data-theme='dark'] .bg-red-50,
html[data-theme='dark'] .bg-red-100\/80 { background-color: rgba(239, 68, 68, 0.14) !important; }
html[data-theme='dark'] .bg-red-100 { background-color: rgba(239, 68, 68, 0.2) !important; }
html[data-theme='dark'] .bg-green-50 { background-color: rgba(34, 197, 94, 0.13) !important; }
html[data-theme='dark'] .bg-green-100 { background-color: rgba(34, 197, 94, 0.2) !important; }
html[data-theme='dark'] .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.13) !important; }
html[data-theme='dark'] .bg-emerald-100 { background-color: rgba(16, 185, 129, 0.2) !important; }
html[data-theme='dark'] .bg-amber-50 { background-color: rgba(245, 158, 11, 0.14) !important; }
html[data-theme='dark'] .bg-amber-100 { background-color: rgba(245, 158, 11, 0.2) !important; }
html[data-theme='dark'] .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.14) !important; }
html[data-theme='dark'] .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.2) !important; }
html[data-theme='dark'] .bg-orange-100 { background-color: rgba(249, 115, 22, 0.2) !important; }
html[data-theme='dark'] .bg-pink-100 { background-color: rgba(236, 72, 153, 0.2) !important; }
html[data-theme='dark'] .bg-teal-50 { background-color: rgba(20, 184, 166, 0.14) !important; }

/* 알림 박스 안의 진한 글자 → 밝은 계열로 */
html[data-theme='dark'] .text-blue-700,
html[data-theme='dark'] .text-blue-800,
html[data-theme='dark'] .text-indigo-700,
html[data-theme='dark'] .text-purple-700,
html[data-theme='dark'] .text-purple-800,
html[data-theme='dark'] .text-red-700,
html[data-theme='dark'] .text-green-700,
html[data-theme='dark'] .text-green-800,
html[data-theme='dark'] .text-emerald-700,
html[data-theme='dark'] .text-emerald-800,
html[data-theme='dark'] .text-amber-700,
html[data-theme='dark'] .text-amber-800,
html[data-theme='dark'] .text-yellow-700,
html[data-theme='dark'] .text-yellow-800,
html[data-theme='dark'] .text-orange-700,
html[data-theme='dark'] .text-pink-700,
html[data-theme='dark'] .text-teal-600 {
  color: #cfe0f7 !important;
}
html[data-theme='dark'] .text-blue-600,
html[data-theme='dark'] .text-indigo-600,
html[data-theme='dark'] .text-purple-600 { color: #8db4ff !important; }
html[data-theme='dark'] .text-red-600 { color: #ff9c9c !important; }
html[data-theme='dark'] .text-green-600,
html[data-theme='dark'] .text-emerald-600 { color: #7ee2b0 !important; }
html[data-theme='dark'] .text-amber-600,
html[data-theme='dark'] .text-yellow-600 { color: #f8cf7a !important; }
html[data-theme='dark'] .text-orange-600 { color: #ffb37a !important; }
html[data-theme='dark'] .text-blue-900,
html[data-theme='dark'] .text-indigo-900,
html[data-theme='dark'] .text-amber-900,
html[data-theme='dark'] .text-blue-500,
html[data-theme='dark'] .text-indigo-500,
html[data-theme='dark'] .text-purple-500 { color: #a8c4ff !important; }
html[data-theme='dark'] .text-yellow-500 { color: #fbbf24 !important; }

/* 연한 테두리 박스 */
html[data-theme='dark'] .border-blue-50,
html[data-theme='dark'] .border-blue-100,
html[data-theme='dark'] .border-blue-200,
html[data-theme='dark'] .border-indigo-100,
html[data-theme='dark'] .border-indigo-200,
html[data-theme='dark'] .border-indigo-300,
html[data-theme='dark'] .border-purple-100,
html[data-theme='dark'] .border-purple-200,
html[data-theme='dark'] .border-red-50,
html[data-theme='dark'] .border-red-100,
html[data-theme='dark'] .border-red-200,
html[data-theme='dark'] .border-red-300,
html[data-theme='dark'] .border-green-50,
html[data-theme='dark'] .border-green-200,
html[data-theme='dark'] .border-emerald-100,
html[data-theme='dark'] .border-amber-50,
html[data-theme='dark'] .border-amber-100,
html[data-theme='dark'] .border-amber-200,
html[data-theme='dark'] .border-yellow-200,
html[data-theme='dark'] .border-yellow-300,
html[data-theme='dark'] .border-teal-100 {
  border-color: var(--seri-border-strong) !important;
}

/* ---------- 탭 ---------- */
html[data-theme='dark'] .tab-btn { color: var(--seri-text-soft) !important; }
html[data-theme='dark'] .tab-btn:hover:not(.tab-active) {
  background-color: #25324a !important;
  color: #dbe7f7 !important;
}

/* ---------- 호버 보조 ---------- */
html[data-theme='dark'] .hover\:bg-gray-200:hover { background-color: #2a394f !important; }
html[data-theme='dark'] .hover\:bg-slate-200:hover,
html[data-theme='dark'] .hover\:bg-slate-600:hover { background-color: #34435d !important; }
html[data-theme='dark'] .hover\:bg-red-50:hover { background-color: rgba(239, 68, 68, 0.18) !important; }
html[data-theme='dark'] .hover\:bg-green-50:hover { background-color: rgba(34, 197, 94, 0.18) !important; }
html[data-theme='dark'] .hover\:bg-indigo-100:hover,
html[data-theme='dark'] .hover\:bg-purple-100:hover { background-color: rgba(129, 140, 248, 0.24) !important; }
html[data-theme='dark'] .hover\:text-gray-600:hover,
html[data-theme='dark'] .hover\:text-gray-700:hover,
html[data-theme='dark'] .hover\:text-slate-600:hover,
html[data-theme='dark'] .hover\:text-slate-800:hover { color: #ffffff !important; }
html[data-theme='dark'] .hover\:text-red-800:hover,
html[data-theme='dark'] .hover\:text-red-950:hover { color: #ffbdbd !important; }
html[data-theme='dark'] .hover\:border-gray-200:hover { border-color: var(--seri-border-strong) !important; }

/* ---------- 평가 결과 요약표 (인사평가) ---------- */
html[data-theme='dark'] .summary-cell-dept {
  background-color: #1b2740 !important;
  color: #cdd9ea !important;
}
html[data-theme='dark'] .summary-cell-total {
  background-color: #223049 !important;
  color: #e3ebf7 !important;
}
html[data-theme='dark'] .summary-cell-ex {
  background-color: rgba(198, 146, 20, 0.22) !important;
  color: #ffd77a !important;
}
html[data-theme='dark'] .summary-cell-vg {
  background-color: rgba(63, 138, 112, 0.24) !important;
  color: #8ce8c4 !important;
}
html[data-theme='dark'] .summary-cell-gd {
  background-color: rgba(67, 129, 181, 0.24) !important;
  color: #a8d4ff !important;
}
html[data-theme='dark'] .summary-cell-ni {
  background-color: #1d2839 !important;
  color: #b8c5d8 !important;
}

/* ---------- 매뉴얼(prose) ---------- */
html[data-theme='dark'] article#viewer-body,
html[data-theme='dark'] .prose { color: var(--seri-text-soft) !important; }
html[data-theme='dark'] .prose h2,
html[data-theme='dark'] .prose h3,
html[data-theme='dark'] .prose h4,
html[data-theme='dark'] .prose h5,
html[data-theme='dark'] .prose strong { color: var(--seri-text) !important; }
html[data-theme='dark'] .prose hr,
html[data-theme='dark'] .prose thead { border-color: var(--seri-border) !important; }

/* ---------- 모달 ---------- */
html[data-theme='dark'] .modal-overlay { background: rgba(3, 8, 18, 0.72); }

/* ============================================================
   테마 전환 버튼 (플로팅)
   ============================================================ */
#seri-theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  line-height: 1;
}
#seri-theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
}
#seri-theme-toggle:active { transform: translateY(0); }
#seri-theme-toggle i { font-size: 14px; }

html[data-theme='dark'] #seri-theme-toggle {
  background: #1b2740;
  border-color: #33415c;
  color: #dbe7f7;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
}

@media print {
  #seri-theme-toggle { display: none !important; }
}

/* 화면이 좁을 때는 아이콘만 */
@media (max-width: 640px) {
  #seri-theme-toggle { padding: 10px 12px; }
  #seri-theme-toggle .seri-theme-label { display: none; }
}
