/* Auto-extracted from GAS HTML files */

/* ==================== AI.html ==================== */

:root {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-ai: #f8fafd;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --border: #e2e8f0;
  --input-bg: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 
 * [FIX] 기존에 body에 직접 display:flex, height:100vh, overflow:hidden을 적용하면
 * 홈 대시보드의 .dashboard-container가 flex-item으로 축소(shrink-wrap)되어
 * 카드 폭이 371px로 줄어들고 여백이 비정상적으로 넓어지는 버그 발생.
 * → body 기본 스타일에서 레이아웃 관련 속성 제거, 챗앱 전용 body 클래스로 분리.
 */
body {
  font-family:
    "Inter",
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  margin: 0;
  padding: 0;
}

/* 챗앱(AI 상담) 페이지 전용 body 스타일 */
body.chat-app-body {
  background: linear-gradient(145deg, #1e3a5f 0%, #0f2240 40%, #162032 100%);
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 메인 컨테이너 */
.chat-app {
  width: 100%;
  max-width: 500px;
  /* Reverted to 500px */
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .chat-app {
    height: 85vh;
    /* Adjusted height */
    max-height: 900px;
    max-width: 1200px;
    /* Widen for tables */
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
  }
}

/* 헤더 */
.chat-header {
  background: linear-gradient(135deg, #0f2240 0%, #1a3a6e 100%);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  /* Clip zoomed image */
  /* [Fix] Padding instead of transform for cleaner rendering */
  padding: 4px 4px 0px 4px;
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Transform removed */
  filter: contrast(1.15) saturate(1.1);
  /* [UX] Sharpen image */
}

.bot-info h1 {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* 드롭다운 메뉴 */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 70px;
  right: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  min-width: 180px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item i {
  color: var(--accent);
  width: 18px;
}

/* 채팅 영역 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #f8fafd 0%, #ffffff 100%);
  position: relative;
  z-index: 1;
}

/* 스크롤바 세련화 */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.chat-messages::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background-image: url("https://lh3.googleusercontent.com/d/1acvybrygscssOAHamXpOoQFcXZhtpiVV");
  background-repeat: no-repeat;
  background-position: center 65%;
  background-size: 78%;
  opacity: 0.2;
  mix-blend-mode: multiply;
  z-index: -1;
  pointer-events: none;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 90%;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  overflow: hidden;
  /* Clip zoomed image */
  /* [Fix] Padding for cleaner rendering */
  padding: 3px 3px 0px 3px;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Transform removed */
  filter: contrast(1.15) saturate(1.1);
  /* [UX] Sharpen image */
}

.message.user .message-avatar {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.message-avatar i {
  color: #fff;
  font-size: 14px;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-bubble {
  padding: 13px 17px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  position: relative;
  transition: all 0.2s;
  letter-spacing: -0.1px;
}

.message.ai .message-bubble {
  background: #ffffff;
  color: var(--text-primary);
  border-radius: 4px 18px 18px 18px;
  box-shadow:
    0 2px 10px rgba(15, 34, 64, 0.07),
    0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid #edf2f7;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  border-radius: 18px 4px 18px 18px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.message-time {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0 4px;
}

.message.user .message-time {
  text-align: right;
}

/* AI 메시지 스타일 */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.message-bubble strong {
  color: var(--text-primary);
  background: linear-gradient(180deg, transparent 60%, #fef08a 60%);
}

/* Markdown Styles for Marked.js */
.message-bubble ul,
.message-bubble ol {
  margin: 8px 0 8px 24px;
  /* Indent lists */
  padding: 0;
  list-style-position: outside;
  /* Ensure bullets show */
}

.message-bubble ul {
  list-style-type: disc;
  /* Force dots */
}

.message-bubble ol {
  list-style-type: decimal;
}

.message-bubble li {
  margin-bottom: 4px;
}

.message-bubble p {
  margin: 0 0 8px 0;
  /* Paragraph spacing */
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

/* Law Title Link Styling */
.law-title {
  color: #2563eb !important;
  font-weight: 600 !important;
  font-family: "Inter", "Pretendard", sans-serif !important;
  background: none !important;
  padding: 0 !important;
  display: inline !important;
  margin: 0 !important;
  cursor: pointer;
  transition: all 0.15s;
  border: none !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(37, 99, 235, 0.4) !important;
}

.law-title:hover {
  text-decoration-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.06) !important;
  border-radius: 3px !important;
  padding: 1px 3px !important;
  margin: 0 -3px !important;
}

/* === Premium Safety Theme Design === */

/* 1. Highlight (Yellow Marker) */
.message-bubble strong {
  color: #1e293b;
  font-weight: 700;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(253, 224, 71, 0.5) 50%
  );
  padding: 0 2px;
  border-radius: 2px;
}

/* Remove top margin from first element in bubble for cleaner look */
.message-bubble > :first-child {
  margin-top: 0 !important;
}

/* 2. Headers (Trust Navy & Emerald) */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  color: #0f172a;
  font-size: 15px !important;
  font-weight: 700;
  margin: 16px 0 8px 0;
  padding: 0 0 4px 0;
  display: inline-block;
  border-bottom: 3px solid rgba(16, 185, 129, 0.4);
  letter-spacing: -0.2px;
}

/* 3. List Item Bullets (Emerald) */
.message-bubble ul,
.message-bubble ol {
  list-style: none;
  padding-left: 5px;
  margin: 10px 0;
}

.message-bubble li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  line-height: 1.7;
}

.message-bubble ul li::before {
  content: "•";
  color: #10b981;
  font-weight: 800;
  position: absolute;
  left: 0;
  top: -1px;
  font-size: 1.2em;
}

.message-bubble p {
  margin: 0 0 12px;
  line-height: 1.65;
  color: #334155;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

/* 4. Blockquote (Reference / Quote Box) */
.message-bubble blockquote {
  border-left: 4px solid #10b981;
  background: #f8fafc;
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 0 8px 8px 0;
  color: #475569;
  font-size: 0.95em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.message-bubble blockquote p:last-child {
  margin-bottom: 0;
}

/* 5. Inline Code / Tags */
.message-bubble code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "Inter", monospace;
  font-size: 0.9em;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* 4. Tables */
.message-bubble table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}

.message-bubble th,
.message-bubble td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.message-bubble th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e40af;
}

.message-bubble tr:last-child td {
  border-bottom: none;
}

/* 퀵 버튼 (Scrollable Row) */
.quick-actions {
  display: flex;
  /* Flex instead of Grid */
  overflow-x: auto;
  gap: 8px;
  margin-top: 4px;
  /* Reduced top margin since label is added */
  width: 100%;
  padding: 4px 4px 8px 4px;
  /* Added padding to prevent hover clipping */
  scrollbar-width: none;
  /* Firefox */
}

.quick-actions::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.quick-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.15);
}

/* 로딩 애니메이션 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: 6px 18px 18px 18px;
  box-shadow: var(--shadow);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.typing-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 입력 영역 */
.chat-input-area {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #edf2f7;
  flex-shrink: 0;
}

.input-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 28px;
  padding: 6px 8px 6px 18px;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-container:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: #ffffff;
}

.input-container textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  padding: 8px 0;
}

.input-container textarea::placeholder {
  color: var(--text-secondary);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.input-btn:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.input-btn.active {
  color: var(--accent);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 17px;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.send-btn.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.send-btn.active:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

/* 파일 인디케이터 */
.file-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fef3c7;
  border-radius: 20px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #92400e;
}

.file-indicator.show {
  display: flex;
}

.file-indicator .remove {
  cursor: pointer;
  margin-left: auto;
}

/* 자동완성 */
.autocomplete {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
  z-index: 50;
}

.autocomplete.show {
  display: block;
}

.autocomplete-item {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f3f4f6;
}

.autocomplete-item i {
  color: var(--accent);
  font-size: 12px;
}

/* 토스트 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 14px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  /* Force single line */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 모달 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  width: 90%;
  max-width: 320px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  font-size: 24px;
  cursor: pointer;
  opacity: 0.8;
}

.modal-close:hover {
  opacity: 1;
}

.contact-list {
  list-style: none;
}

.contact-item {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-name {
  font-weight: 600;
  color: var(--text-primary);
}

.call-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* 재시도 버튼 */
.retry-btn {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.retry-btn:hover {
  background: #fee2e2;
}

/* 스크롤바 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* Feedback UI */
.feedback-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  justify-content: flex-end;
}

.feedback-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
}

/* [Fix] Reduced Top Margin for Bubbles */
.message-bubble > :first-child {
  margin-top: 0 !important;
}

.feedback-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}
.feedback-btn.fb-good:hover {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}
.feedback-btn.fb-bad:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.feedback-btn.active {
  color: var(--accent);
  background: #eff6ff;
  font-weight: 600;
}

/* 상세 보기 버튼 shimmer */
.detail-btn {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #eef2ff 100%);
  color: #4f46e5 !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  position: relative;
  overflow: hidden;
}
.detail-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: detailShimmer 2.5s ease-in-out infinite;
}
@keyframes detailShimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 150%;
  }
  100% {
    left: 150%;
  }
}
.detail-btn:hover {
  background: linear-gradient(
    135deg,
    #e0e7ff 0%,
    #c7d2fe 50%,
    #e0e7ff 100%
  ) !important;
  color: #4338ca !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.contact-card-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid #edf2f7;
  transition: all 0.2s;
}
.contact-card-item:hover {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  border-color: #bfdbfe;
}
.contact-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
}
.contact-card-num {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}
.contact-card-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  transition: all 0.2s;
}
.contact-card-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.45);
}

/* ==================== AI_Dash.html ==================== */

/* AI Dashboard Scoped Styles */
:root {
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --primary-color: #3b82f6;
  --text-dark: #1e293b;
  --text-gray: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 16px;
}

/* Removed body selector to avoid global conflict */
.ai-dash-container {
  /* font-family: 'Pretendard', sans-serif; */
  background-color: var(--bg-color);
  color: var(--text-dark);
  max-width: 100%;
  padding: 0;
}

/* Adjusted container class */
.ai-dash-inner-container {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

/* 헤더 스타일 */

.header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title i {
  color: var(--primary-color);
  font-size: 26px;
}

.refresh-btn {
  background-color: var(--bg-color);
  color: var(--text-gray);
  border: 1px solid #e2e8f0;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-dark);
}

.refresh-btn.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* 통계 카드 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border-left: 5px solid transparent;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 카드별 포인트 컬러 */
.stat-card.blue {
  border-left-color: var(--primary-color);
}

.stat-card.blue .stat-icon-bg {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.stat-card.green {
  border-left-color: var(--success);
}

.stat-card.green .stat-icon-bg {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card.orange {
  border-left-color: var(--warning);
}

.stat-card.orange .stat-icon-bg {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-card.purple {
  border-left-color: var(--purple);
}

.stat-card.purple .stat-icon-bg {
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 5px;
}

.stat-icon-bg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

.stat-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 5px;
}

/* 차트 섹션 */
.section-card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-container {
  height: 300px;
  width: 100%;
}

/* 테이블 섹션 */
table.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
  margin-top: 10px !important;
}

table.dataTable thead th {
  background-color: #f8fafc !important;
  color: var(--text-gray) !important;
  font-weight: 700 !important;
  font-size: 13px;
  border-bottom: 2px solid #e2e8f0 !important;
  padding: 12px 15px !important;
}

table.dataTable tbody td {
  padding: 14px 15px !important;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

table.dataTable tbody tr:hover {
  background-color: #f8fafc !important;
  cursor: pointer;
}

/* 비용 배지 (알약 모양) */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-cheap {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-normal {
  background-color: #fff7ed;
  color: #c2410c;
}

/* 로딩 및 에러 */
#loading {
  text-align: center;
  padding: 60px;
  color: var(--text-gray);
}

.error-box {
  background: #fef2f2;
  color: #dc2626;
  padding: 15px;
  border-radius: 10px;
  font-weight: 500;
}

/* 모달 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  width: 600px;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.modal-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
}

.close-btn {
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
}

.close-btn:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
}

.detail-box {
  background: #f8fafc;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.detail-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
  display: block;
}

.detail-text {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
}

/* 말줄임표 처리 */
.text-truncate {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table Header Center Align Force */
table.dataTable thead th,
table.dataTable thead td {
  text-align: center !important;
}

/* Podium Styles */
.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  justify-content: center;
  gap: 80px;
  height: 80px;
  width: 100%;
  padding-bottom: 5px;
}

.podium-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  transition: transform 0.3s ease;
}

.podium-column:hover {
  transform: translateY(-5px);
}

.podium-bar {
  width: 70px;
  border-radius: 12px 12px 4px 4px;
  display: flex;
  align-items: flex-start;
  /* Score at top */
  justify-content: center;
  padding-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: white;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

/* Glass Shine Effect */
.podium-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.podium-label {
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
  text-align: center;
  max-width: 110px;
  /* Increased width */
  white-space: normal;
  /* Allow wrapping */
  word-break: keep-all;
  /* Prevent breaking in middle of words */
  line-height: 1.25;
}

.podium-score {
  font-size: 0.9rem;
  z-index: 1;
}

.podium-avatar,
.podium-crown {
  font-size: 1.8rem;
  margin-bottom: 5px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: float 3s ease-in-out infinite;
}

.podium-crown {
  font-size: 2.2rem;
  animation-delay: 0.5s;
}

/* Ranks */
.rank-1 .podium-bar {
  height: 60px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  /* Gold */
}

.rank-1 {
  z-index: 3;
}

.rank-2 .podium-bar {
  height: 45px;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  /* Silver */
}

.rank-2 {
  z-index: 2;
}

.rank-3 .podium-bar {
  height: 35px;
  background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
  /* Bronze */
}

.rank-3 {
  z-index: 1;
}

/* Float Animation */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* AI Keyword Ranking - Liquid Tank Bars */
.ai-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 8px;
  height: 100%;
  justify-content: center;
}
.ai-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-rank-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.ai-rank-num.r1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.ai-rank-num.r2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}
.ai-rank-num.r3 {
  background: linear-gradient(135deg, #fb923c, #ea580c);
}
.ai-rank-num.r4 {
  background: #cbd5e1;
  color: #475569;
}
.ai-rank-num.r5 {
  background: #e2e8f0;
  color: #64748b;
}
.ai-rank-label {
  width: 72px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.ai-rank-val {
  width: 42px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* AI Liquid Tank horizontal */
.ai-liq-tank-hz {
  height: 26px;
  background: #f1f5f9;
  border-radius: 13px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  flex: 1;
}
.ai-liq-fill-hz {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-liq-solid-hz {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
.ai-liq-wave-hz {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 12px;
  height: 300%;
  margin-left: -4px;
  z-index: 3;
  background-size: 100% 33.333%;
  animation: aiLiqSlide 1.5s infinite linear;
}
.ai-liq-wave-hz-back {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 16px;
  height: 300%;
  margin-left: -7px;
  z-index: 1;
  background-size: 100% 33.333%;
  animation: aiLiqSlide 2.2s infinite linear reverse;
  opacity: 0.6;
}
@keyframes aiLiqSlide {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-33.333%);
  }
}
/* Wave color classes */
.ai-wave-blue {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%233b82f6'/%3E%3C/svg%3E");
}
.ai-wave-blue-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%2360a5fa'/%3E%3C/svg%3E");
}
.ai-wave-indigo {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%234f46e5'/%3E%3C/svg%3E");
}
.ai-wave-indigo-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23818cf8'/%3E%3C/svg%3E");
}
.ai-wave-emerald {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%2310b981'/%3E%3C/svg%3E");
}
.ai-wave-emerald-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%2334d399'/%3E%3C/svg%3E");
}
.ai-wave-amber {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23d97706'/%3E%3C/svg%3E");
}
.ai-wave-amber-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23fbbf24'/%3E%3C/svg%3E");
}
.ai-wave-rose {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23f43f5e'/%3E%3C/svg%3E");
}
.ai-wave-rose-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23fb7185'/%3E%3C/svg%3E");
}
.ai-wave-purple {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%238b5cf6'/%3E%3C/svg%3E");
}
.ai-wave-purple-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23c4b5fd'/%3E%3C/svg%3E");
}

/* Daily Trend CSS Mini Bars (Simple) */
.ai-trend-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  padding: 12px 10px 40px;
  position: relative;
}
.ai-trend-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.ai-trend-bar {
  width: 100%;
  max-width: 12px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #3b82f6, #60a5fa);
  transition: height 0s;
  min-height: 0;
  position: relative;
}
.ai-trend-bar.empty {
  background: transparent;
}

.ai-trend-val {
  font-size: 0.65rem;
  color: #3b82f6;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0s;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}
.ai-trend-val.show {
  opacity: 1;
}

.ai-trend-day {
  font-size: 0.55rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1;
  position: absolute;
  bottom: -20px;
}

/* Global Background Fix */
.ai-dash-container {
  background-color: transparent !important;
}

table.dataTable tbody td {
  padding: 3px 6px !important;
  /* Reduced padding */
  font-size: 0.8rem !important;
  /* Slightly smaller font */
  vertical-align: middle;
  text-align: center !important;
}

table.dataTable thead th {
  padding: 5px 6px !important;
  font-size: 0.85rem !important;
}

/* ==================== Edu_Dash.html ==================== */

@keyframes eduEmpSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes premiumShimmerSweep {
  0% {
    transform: translateX(-150%) skewX(-15deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  60% {
    transform: translateX(300%) skewX(-15deg);
    opacity: 1;
  }
  100% {
    transform: translateX(300%) skewX(-15deg);
    opacity: 0;
  }
}
.chart-flow-shimmer {
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 30%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0.4),
    transparent
  );
  pointer-events: none;
  z-index: 5;
  animation: premiumShimmerSweep 5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  mix-blend-mode: lighten;
}

/* Horizontal Liquid Tank CSS */
.liq-tank-hz {
  height: 28px;
  background: #f1f5f9;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.8);
}
.liq-fill-hz {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.liq-solid-hz {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
.liq-wave-hz {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 14px;
  height: 300%;
  margin-left: -5px;
  z-index: 3;
  background-size: 100% 33.333%;
  animation: liqSlideHz 1.5s infinite linear;
}
.liq-wave-hz-back {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 18px;
  height: 300%;
  margin-left: -8px;
  z-index: 1;
  background-size: 100% 33.333%;
  animation: liqSlideHz 2.2s infinite linear reverse;
  opacity: 0.6;
}
@keyframes liqSlideHz {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-33.333%);
  }
}

.liq-goal-line-hz {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 90%;
  width: 0;
  border-left: 2px dashed rgba(239, 68, 68, 0.7);
  z-index: 10;
  pointer-events: none;
}

/* Vertical Liquid Tank CSS (For Trend Chart) */
.liq-tank-vt {
  width: 100%;
  height: 100%;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}
.liq-fill-vt {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}
.liq-solid-vt {
  position: absolute;
  bottom: -5px;
  top: 5px;
  left: 0;
  right: 0;
  z-index: 2;
}
.liq-wave-vt {
  position: absolute;
  bottom: 100%;
  left: -100%;
  width: 300%;
  height: 12px;
  margin-bottom: -5px;
  z-index: 3;
  background-size: 33.333% 100%;
  animation: liqSlideVt 1.5s infinite linear;
}
.liq-wave-vt-back {
  position: absolute;
  bottom: 100%;
  left: -100%;
  width: 300%;
  height: 16px;
  margin-bottom: -7px;
  z-index: 1;
  background-size: 33.333% 100%;
  animation: liqSlideVt 2.2s infinite linear reverse;
  opacity: 0.6;
}
@keyframes liqSlideVt {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(33.333%);
  }
}

/* ==================== Home_Dash.html ==================== */
@keyframes megaphone-shout {
  0%,
  80%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  82% {
    transform: rotate(-10deg) scale(1.15);
  }
  84% {
    transform: rotate(10deg) scale(1.15);
  }
  86% {
    transform: rotate(-10deg) scale(1.15);
  }
  88% {
    transform: rotate(10deg) scale(1.15);
  }
  90% {
    transform: rotate(0deg) scale(1);
  }
}
.notice-megaphone {
  display: inline-block;
  transform-origin: center center;
  animation: megaphone-shout 3s infinite ease-in-out;
}
@keyframes bell-shake {
  0%,
  80%,
  100% {
    transform: rotate(0deg);
  }
  82% {
    transform: rotate(15deg);
  }
  84% {
    transform: rotate(-15deg);
  }
  86% {
    transform: rotate(10deg);
  }
  88% {
    transform: rotate(-10deg);
  }
  90% {
    transform: rotate(5deg);
  }
  92% {
    transform: rotate(-5deg);
  }
  94% {
    transform: rotate(0deg);
  }
}
.notice-bell {
  display: inline-block;
  transform-origin: top center;
  animation: bell-shake 3s infinite ease-in-out;
}

.home-legal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px; /* Reduced Padding */
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  height: auto;
  min-height: 36px; /* Reduced Height */
  margin-bottom: 4px; /* Reduced Margin */
}

.home-legal-badge {
  font-size: 0.7rem; /* Slightly smaller */
  padding: 3px 6px; /* Reduced padding */
  border-radius: 5px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 36px; /* Reduced width */
  text-align: center;
  background-color: #f1f5f9; /* Always Gray */
  color: #64748b; /* Gray Text */
}
.home-legal-target {
  font-weight: 600;
  color: #334155;
  font-size: 0.85rem; /* Slightly smaller */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 110px;
  flex-shrink: 0;
  margin-left: 10px;
}
.home-legal-dday {
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  flex: 1;
}
.home-legal-date {
  font-size: 0.75rem; /* Slightly smaller */
  font-family: "Pretendard", sans-serif;
  color: #64748b;
  background: #f8fafc;
  padding: 3px 8px; /* Reduced padding */
  border-radius: 5px;
  white-space: nowrap;
  font-weight: 500;
  min-width: 90px; /* Slightly narrower */
  text-align: center;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px; /* Optical vertical center */
}
.home-legal-date i {
  display: none;
}
.home-legal-date i {
  font-size: 0.8rem;
  margin-top: 1px; /* Optical adjustment */
}
.home-legal-date.status-done {
  background: #f0fdf4;
  color: #22c55e;
  border: 1.5px solid #22c55e;
}
.home-legal-date.status-red {
  background: #fef2f2;
  color: #ef4444;
  border: 1.5px solid #ef4444;
}
.home-legal-date.status-orange {
  background: #fff7ed;
  color: #f97316;
  border: 1.5px solid #f97316;
}
.home-legal-date.status-gray {
  background: #f9fafb;
  color: #6b7280;
  border: 1.5px solid #9ca3af;
}
@keyframes dropPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15) translateY(-1px);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}
.anim-drop {
  animation: dropPulse 2s infinite ease-in-out;
  display: inline-block;
}
.completed-person,
.overdue-person {
  display: inline-block;
  transform-origin: bottom center;
  animation: person-nod 3s infinite ease-in-out;
}
.completed-person:nth-child(even),
.overdue-person:nth-child(even) {
  animation-delay: 1.5s;
}
.completed-person:nth-child(odd),
.overdue-person:nth-child(odd) {
  animation-delay: 0s;
}
@keyframes person-nod {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

/* ==================== Index.html ==================== */

body {
  background-color: #ffffff !important;
}

#global-date-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  margin-right: 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
#global-date-picker::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
/* Home Safety Header (Slogan + Counter) */
.home-safety-header {
  display: flex;
  gap: 15px;
  align-items: stretch;
  margin-bottom: 20px;
}

.safety-slogan-card {
  flex: 1;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  overflow: hidden;
  position: relative;
  min-height: 50px;
}

.safety-slogan-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #2563eb;
}

.slogan-icon {
  width: 38px;
  height: 38px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.slogan-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  font-family: "Pretendard", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Accident Free Card */
.accident-free-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 20px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.accident-free-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(
    circle,
    rgba(34, 197, 94, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.af-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.af-count {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}

.count-num {
  font-size: 1.8rem;
  font-weight: 800;
  /* Gradient Text */
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Logo Text */
.logo-text {
  border: none !important;
  padding: 0 !important;
  margin-left: 0px;
  font-weight: 800 !important;
  font-family: "Pretendard", sans-serif !important;
  display: inline-block !important;
  color: #1e293b;
  -webkit-text-fill-color: #1e293b;
  letter-spacing: -0.3px;
}

/* Header Slogan Wrapper (fixed border) */
.header-slogan-wrapper {
  margin-left: 16px;
  padding-left: 24px !important;
  border-left: 1px solid #e2e8f0 !important;
  display: flex;
  align-items: center;
  height: 24px;
  overflow: hidden;
}

/* Header Slogan - next to logo, same vertical center line */
.header-slogan {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
  opacity: 1; /* Changed from 0 to 1 so it shows immediately */
  transform: translateY(0);
  display: inline-block;
}

/* Accident Free Text - Classic Dark Flip */
.header-af-text {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
}
.header-af-text .label {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0px 1px 2px rgba(255, 255, 255, 0.5);
}
.header-af-count {
  display: flex;
  gap: 4px;
}
.header-af-count .digit {
  background: #1e293b;
  color: #fff;
  font-size: 1.15rem;
  padding: 0 8px;
  border-radius: 4px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  font-family: "Oswald", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  height: 1.4em;
  line-height: 1.4em;
  overflow: hidden;
}
/* The middle line was removed to look better with vertical rolling effect */
.header-af-count .ribbon {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.header-af-count .ribbon-item {
  height: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 900px) {
  .header-slogan-wrapper,
  .header-slogan {
    display: none;
  }
}

@media (max-width: 700px) {
  .header-af-text {
    display: none;
  }
}

.count-unit {
  font-size: 0.9rem;
  font-weight: 700;
  color: #15803d;
}

.af-start {
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
  .home-safety-header {
    flex-direction: column;
    gap: 10px;
  }

  .notice-ticker-container {
    margin-top: 5px;
    height: 36px;
    font-size: 0.9rem;
  }

  .ticker-label {
    padding: 0 10px;
    font-size: 1rem;
  }

  .safety-slogan-card {
    padding: 12px 15px;
  }

  .accident-free-card {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 20px;
    align-items: center;
    min-height: auto;
  }

  .af-count {
    margin-left: auto;
  }

  .af-start {
    display: none;
  }

  .af-title {
    margin-bottom: 0;
    font-size: 0.85rem;
  }
}

/* Header Shortcuts */
.header-shortcuts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border-radius: 100px;
  border: none;
  box-shadow: none;
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 100px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: 0.9rem;
}

.header-icon-btn:hover {
  transform: translateY(-1px);
  background: #f1f5f9;
}

/* Grayscale filter for inner image icons */
.header-icon-btn img {
  width: 18px;
  height: 18px;
  filter: grayscale(100%) opacity(0.55);
  transition: all 0.22s;
}

.header-icon-btn:hover img {
  filter: grayscale(0%) opacity(1);
}

/* 아이콘별 개별 hover 색상 - 위험성평가(🔴), 기숙사(🟡), 달력(🟢), 북마크(🔵), 로그인(보라) */
/* 위험성평가 */
#btn-calendar ~ * .header-icon-btn:first-child:hover,
.header-shortcuts > .header-icon-btn:nth-child(2):hover {
  color: #ef4444;
  background: #fee2e2;
}
/* 기숙사 */
.header-shortcuts > .header-icon-btn:nth-child(3):hover {
  color: #f59e0b;
  background: #fef3c7;
}
/* (calendar wrapper는 div라서 nth-child 계산 다름) */
.header-icon-btn[title="위험성 평가"]:hover {
  color: #ef4444 !important;
  background: #fee2e2 !important;
}
.header-icon-btn[title="기숙사 관리"]:hover {
  color: #f59e0b !important;
  background: #fef3c7 !important;
}
.header-icon-btn[title="MSDS 포털"]:hover {
  color: #0ea5e9 !important;
  background: #e0f2fe !important;
}
.header-icon-btn[title="팀 달력"]:hover {
  color: #10b981 !important;
  background: #d1fae5 !important;
}
.header-icon-btn[title="관련 사이트"]:hover {
  color: #2563eb !important;
  background: #dbeafe !important;
}
.header-icon-btn[title="로그인"]:hover,
.header-icon-btn[title="로그아웃"]:hover {
  color: #7c3aed !important;
  background: #ede9fe !important;
}

/* ========== [NEW] Icon Color & Login State Logic ========== */

/* 1. Header Icons - Default Black */
.header-icon-btn {
  color: #1e293b;
  border-color: rgba(226, 232, 240, 0.8);
}

/* 2. Nav Icons - Default Blue */
.nav-bar .nav-item i {
  color: #2563eb;
}

/* 3. Not Logged In State (Grayscale for Login-required Items) */

/* Nav Items - Gray */
body.not-logged-in #nav-study i,
body.not-logged-in #nav-tbm i,
body.not-logged-in #nav-risk i,
body.not-logged-in #nav-legal i,
body.not-logged-in #nav-stress i,
body.not-logged-in #nav-ai i,
body.not-logged-in #nav-facilities i,
body.not-logged-in #nav-db i {
  color: #cbd5e1 !important;
}

body.not-logged-in #nav-study,
body.not-logged-in #nav-tbm,
body.not-logged-in #nav-risk,
body.not-logged-in #nav-legal,
body.not-logged-in #nav-stress,
body.not-logged-in #nav-ai,
body.not-logged-in #nav-facilities,
body.not-logged-in #nav-db {
  color: #94a3b8 !important;
}

body.not-logged-in #nav-study:hover,
body.not-logged-in #nav-tbm:hover,
body.not-logged-in #nav-risk:hover,
body.not-logged-in #nav-legal:hover,
body.not-logged-in #nav-stress:hover,
body.not-logged-in #nav-ai:hover,
body.not-logged-in #nav-facilities:hover,
body.not-logged-in #nav-db:hover {
  color: #94a3b8 !important;
  transform: none !important;
  cursor: pointer;
  background: transparent !important;
}

/* Header Icons - Gray for Restricted Items (e.g., Team Calendar) */
body.not-logged-in .header-icon-btn[title="팀 달력"] {
  color: #cbd5e1 !important;
  border-color: rgba(226, 232, 240, 0.4) !important;
  background: #f8fafc !important;
}

.header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 1px solid white;
}

/* Login State Indicator - wiggle effect */
.header-icon-btn.logged-in {
  background: transparent;
  border: none;
  color: #2563eb !important;
  position: relative;
  box-shadow: none;
  overflow: visible;
}

/* 자물쇠 아이콘 흔들림 - 로그인 여부 무관 */
#btn-login-toggle i {
  animation: icon-wiggle 1.5s ease-in-out infinite;
}

@keyframes icon-wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(-8deg);
  }
  20% {
    transform: rotate(6deg);
  }
  30% {
    transform: rotate(-4deg);
  }
  40% {
    transform: rotate(2deg);
  }
  50%,
  100% {
    transform: rotate(0deg);
  }
}

.header-icon-btn.logged-in::before {
  display: none;
}

.header-icon-btn.logged-in::after {
  display: none;
}

/* ═══ Premium AI FAB ═══ */
.fab-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

.fab-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
  padding: 0;
  position: relative;
}

.fab-btn:focus,
.fab-btn:active,
.fab-btn:focus-visible {
  outline: none !important;
}

/* Hover */
.fab-btn:hover {
  transform: translateY(-3px) scale(1.1);
}
.fab-btn:hover .fab-robot-svg {
  transform: scale(1.05);
}

/* No shimmer/pulse for transparent button */
.fab-btn::before,
.fab-btn::after {
  display: none;
}

.fab-robot-svg {
  width: 60px;
  height: 60px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.2));
}

/* Shake */
@keyframes fab-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  12% {
    transform: translateX(-2.5px) rotate(-3deg);
  }
  24% {
    transform: translateX(2.5px) rotate(3deg);
  }
  36% {
    transform: translateX(-2px) rotate(-2deg);
  }
  48% {
    transform: translateX(2px) rotate(2deg);
  }
  60% {
    transform: translateX(-1px) rotate(-0.5deg);
  }
  72% {
    transform: translateX(1px) rotate(0.5deg);
  }
  84%,
  100% {
    transform: translateX(0) rotate(0);
  }
}
.fab-btn.fab-shake {
  animation: fab-shake 0.65s ease-in-out;
}

/* Greeting Bubble */
.ai-greeting-bubble {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #1e293b;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.15px;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.07);
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(6px) scale(0.94);
  position: relative;
  pointer-events: none;
  white-space: nowrap;
  font-family:
    "Pretendard",
    -apple-system,
    sans-serif;
}

.ai-greeting-bubble.animate-greeting {
  animation: greeting-show 6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.ai-greeting-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.92);
}

@keyframes greeting-show {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
  10% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-3px) scale(0.97);
  }
}

/* Custom Modal System */
.custom-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.custom-modal-overlay.show {
  display: flex;
}

.custom-modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.custom-modal-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 16px;
}

.custom-modal-icon.success {
  color: #22c55e;
}

.custom-modal-icon.error {
  color: #ef4444;
}

.custom-modal-icon.info {
  color: #3b82f6;
}

.custom-modal-icon.warning {
  color: #f59e0b;
}

.custom-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin-bottom: 12px;
}

.custom-modal-message {
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
  white-space: pre-line;
}

.custom-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.custom-modal-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-modal-buttons {
  display: flex;
  gap: 10px;
}

.custom-modal-btn {
  flex: 1;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.custom-modal-btn.primary {
  background: #3b82f6;
  color: white;
}

.custom-modal-btn.primary:hover {
  background: #2563eb;
}

.custom-modal-btn.secondary {
  background: #f1f5f9;
  color: #64748b;
}

.custom-modal-btn.secondary:hover {
  background: #e2e8f0;
}

/* [NEW] Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* [NEW] Button Click Effect (Active State) */
button:not(.btn-close):active,
.btn:active,
.nav-item:active,
.header-icon-btn:active,
.fab-btn:active,
.list-item:active,
.kpi-card:active {
  transform: scale(0.98) !important;
  transition: transform 0.1s ease;
}

/* Footer Style */
/* Footer Style */
.app-footer {
  text-align: center;
  padding: 10px 0;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 10px;
  /* Minimal border for separation */
  /* border-top: 1px dashed #e2e8f0; */
}

/* Quick Links Dropdown */
.quick-links-wrapper {
  position: relative;
}
.quick-links-btn.active {
  background: #2563eb !important;
  color: white !important;
  border-color: #2563eb !important;
}
.quick-links-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: -42px;
  width: auto;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 8px 40px rgba(0, 0, 0, 0.04);
  padding: 6px;
  z-index: 1000;
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  animation: qlDropIn 0.2s ease-out;
}
.quick-links-dropdown.show {
  display: block;
}
@keyframes qlDropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.quick-links-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 54px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;
  transform: rotate(45deg);
}
.ql-grid {
  display: flex;
  gap: 2px;
}
.ql-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.ql-card:hover {
  background: #f8fafc;
}
.ql-card:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: #e2e8f0;
}
.ql-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ql-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.ql-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}
.ql-card:hover .ql-name {
  color: #2563eb;
}
.ql-external {
  font-size: 0.5rem;
  color: #cbd5e1;
  margin-left: -2px;
  transition: color 0.15s;
}
.ql-card:hover .ql-external {
  color: #93c5fd;
}

/* ============================================== */
/* [PREMIUM UX EFFECT CLASSES]                    */
/* ============================================== */

.bg-slate-soft {
  background-color: #f1f5f9 !important;
}
.text-slate {
  color: #475569 !important;
}

/* 3. Smooth Continuous Segmented Progress Bar */
.legal-segment-bar {
  position: relative;
  width: 94%;
  height: 16px;
  margin: 4px auto 16px auto;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}
.legal-segment-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #3b82f6; /* Distinct Blue Color */
  transition: width 0.8s ease;
}
.legal-segment-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: translateX(-100%);
  animation: smoothSweep 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
.legal-segment-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
}
.legal-segment {
  flex: 1;
  background: transparent;
  border-right: 2px solid #ffffff; /* Sharp glass separator */
  z-index: 2; /* Sits on top of the fill */
}
.legal-segment:last-child {
  border-right: none;
}

@keyframes smoothSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Fix for nav item vertical alignment */
.nav-bar .nav-item {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}
.nav-bar .nav-item i {
  display: inline-flex;
  align-items: center;
  font-size: 1.05rem;
  transform: translateY(1px);
}

@keyframes koshaModalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes koshaOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#kosha-modal.modal-overlay {
  animation: koshaOverlayIn 0.2s ease-out;
}
#kosha-modal .kosha-modal-card {
  animation: koshaModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.kosha-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kosha-info-card {
  background: #27272a;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #3f3f46;
  transition: all 0.2s ease;
}
.kosha-info-card.danger {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}
.kosha-info-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #a1a1aa;
  margin-bottom: 6px;
  display: block;
}
.kosha-info-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.3;
  word-break: keep-all;
}
.kosha-info-card.danger .kosha-info-value {
  color: #ef4444;
}
.kosha-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
  border: none;
}
.kosha-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(220, 38, 38, 0.4);
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}
.kosha-modal-btn i {
  margin-right: 8px;
  font-size: 1.1rem;
}

/* ==================== Legal_Dash.html ==================== */

@keyframes lnGlow {
  0%,
  100% {
    box-shadow: 0 0 4px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
  }
}
/* KPI Cards - Uses global kpi-card-new from Style.html */

/* KPI 카드 로딩 전후 크기 고정 */
#legal-view .kpi-card-new .card-body {
  min-height: 100px;
}

/* List Item Styles */
.legal-list-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 2 Column Layout */
  gap: 6px;
  /* Gap between items */
  /* Compact Height to match other dashboard cards */
  height: 230px;
  overflow-y: auto;
  align-content: start;
  padding-top: 4px;
  /* 상단 여백 추가 - hover 테두리 잘림 방지 */
}

.legal-list-body::-webkit-scrollbar {
  width: 4px;
}

.legal-list-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.legal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  height: 32px;
}

.legal-item:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Badge Colors */
.badge-gimhae {
  background-color: #ecfdf5;
  color: #10b981;
}

.badge-busan {
  background-color: #eff6ff;
  color: #3b82f6;
}

.badge-chang {
  background-color: #fff7ed;
  color: #f97316;
}

.badge-other {
  background-color: #f1f5f9;
  color: #64748b;
}

.legal-info-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

.legal-badge {
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
  background-color: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 26px;
  text-align: center;
}

.legal-badge.is-sub {
  background-color: #eff6ff;
  color: #2563eb;
}

.legal-target {
  font-weight: 700;
  color: #334155;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex-grow: 1;
}

.legal-name {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
}

.date-badge {
  font-size: 0.6rem;
  font-family: "Roboto", sans-serif;
  color: #64748b;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 600;
  margin-left: 6px;
  display: inline-block; /* span 태그 너비 고정을 위해 필수 */
  width: 78px; /* 통일감을 위한 고정 너비 (기존 크기 유지) */
  text-align: center;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

/* 새 날짜 색상 스타일 */
.date-badge.date-green {
  background: #f0fdf4;
  color: #22c55e;
  border: 1.5px solid #22c55e;
}

.date-badge.date-red {
  background: #fef2f2;
  color: #ef4444;
  border: 1.5px solid #ef4444;
}

.date-badge.date-orange {
  background: #fff7ed;
  color: #f97316;
  border: 1.5px solid #f97316;
}

.date-badge.date-gray {
  background: #f9fafb;
  color: #6b7280;
  border: 1.5px solid #9ca3af;
}

/* 기존 호환성 유지 */
.date-badge.overdue {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.date-badge.warning {
  background: #fffbeb;
  color: #f59e0b;
  border: 1px solid #fde68a;
}

/* Location Buttons - Matching Edu Dash Style */
.loc-icon-box {
  width: 24px;
  height: 24px;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Header Utility */
.border-bottom-dashed {
  border-bottom: 1px dashed #eaecf0 !important;
}

/* FIX: Remove Transform issues (legal-view only) */
#legal-view .kpi-card-new,
#legal-view .content-card,
#legal-view .legal-loc-btn,
#legal-view .legal-loc-btn:hover {
  transform: none !important;
  transition: none !important;
}

@keyframes notify-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ==================== MSDS_Portal.html ==================== */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
/* Responsive Photo Modal */
@media (max-width: 768px) {
  #photo-modal-body {
    flex-direction: column !important;
    overflow-y: auto !important;
  }
  #photo-modal-left {
    margin-right: 0 !important;
    flex: none !important;
  }
  #img-search-panel {
    position: static !important;
    width: 100% !important;
    height: 400px !important;
  }
}

/* Toast & Modal UI */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-msg {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 280px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-msg.fade-out {
  animation: toastOut 0.3s forwards;
}
@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.custom-modal-overlay.active {
  display: flex;
}
.custom-modal {
  background: #fff;
  border-radius: 12px;
  width: 340px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.custom-modal-overlay.active .custom-modal {
  transform: translateY(0);
}
.custom-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.custom-modal-desc {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 20px;
  line-height: 1.5;
  word-break: keep-all;
}
.custom-modal-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
  margin-bottom: 20px;
  outline: none;
  transition: 0.2s;
  display: none;
}
.custom-modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.custom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cm-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}
.cm-btn.cancel {
  background: #f1f5f9;
  color: #475569;
}
.cm-btn.cancel:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.cm-btn.confirm {
  background: #3b82f6;
  color: #fff;
}
.cm-btn.confirm:hover {
  background: #2563eb;
}
.cm-btn.danger {
  background: #ef4444;
  color: #fff;
}
.cm-btn.danger:hover {
  background: #dc2626;
}

:root {
  --bg: #ffffff;
  --bg-sub: #fafafa;
  --text-main: #09090b;
  --text-sub: #71717a;
  --text-muted: #a1a1aa;
  --border: #e4e4e7;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --safe-bg: #f0fdf4;
  --safe-text: #15803d;
  --font-main: "Pretendard", -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.02em;
  overflow-x: hidden;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

/* ── TOP NAVBAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  height: 64px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-logo {
  height: 28px;
  width: auto;
}
.nav-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #09090b;
  letter-spacing: -0.03em;
}

.btn-nav {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  background: #ffffff;
  color: #18181b;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.btn-nav:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

/* ── SEARCH HERO (Asymmetric) ── */
.search-hero {
  padding: 48px 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-text-area {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 24px;
  width: 100%;
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #09090b;
  margin: 0;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: #71717a;
  font-weight: 500;
  margin: 0;
  max-width: 100%;
  line-height: 1.5;
  text-align: left;
  letter-spacing: -0.01em;
}
.search-box-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
}
.search-input-main {
  width: 100%;
  height: 52px;
  padding: 0 20px 0 52px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  font-size: 1.05rem;
  font-weight: 500;
  font-family: var(--font-main);
  color: #09090b;
  outline: none;
  transition: all 0.3s ease;
}
.search-box-wrap i {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #a1a1aa;
  font-size: 1.4rem;
  pointer-events: none;
}
.search-input-main:focus {
  border-color: #09090b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
@media (max-width: 900px) {
  .hero-text-area {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .search-box-wrap {
    max-width: 100%;
  }
}
.search-box-wrap i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #a1a1aa;
  font-size: 1.2rem;
  pointer-events: none;
}
.search-input-main {
  width: 100%;
  height: 56px;
  padding: 0 20px 0 52px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  font-size: 1.05rem;
  font-weight: 500;
  font-family: var(--font-main);
  color: #09090b;
  outline: none;
  transition: all 0.2s ease;
}
.search-input-main::placeholder {
  color: #a1a1aa;
}
.search-input-main:focus {
  border-color: #09090b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── MAIN CONTENT & GRID ── */
.main-content {
  padding: 0 48px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
}
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── CARD (Minimal) ── */
.pro-card {
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card-image-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.pro-card:hover .card-image-box {
  transform: scale(1.02);
  background: transparent;
}
.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}
.card-image-empty {
  color: #d4d4d8;
  font-size: 3rem;
}

.card-content-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}
.card-title-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #09090b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta-line {
  font-size: 0.85rem;
  color: #71717a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.card-meta-dot {
  color: #d4d4d8;
  font-size: 0.5rem;
}
.v5-ghs {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.v5-ghs img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
/* hover effect removed */

/* ── SIDE DRAWER (Detail) ── */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 11, 0.4);
  z-index: 3000;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.drawer-panel {
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-overlay.active .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 24px 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  flex-shrink: 0;
}
.drawer-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #a1a1aa;
  cursor: pointer;
  transition: 0.2s;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-close-btn:hover {
  background: #f1f5f9;
  color: #2563eb !important;
}

.drawer-body {
  padding: 0 32px 32px 32px;
  overflow-y: auto;
  flex: 1;
}
.drawer-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: transparent;
  border-radius: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 24px;
}
.drawer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}
.drawer-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #09090b;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.drawer-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}
.drawer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f4f4f5;
  padding-bottom: 8px;
}
.drawer-meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.dm-dt {
  font-size: 0.9rem;
  color: #a1a1aa;
  font-weight: 600;
}
.dm-dd {
  font-size: 0.95rem;
  color: #27272a;
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  text-align: right;
}
.dm-ghs-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.drawer-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  color: #09090b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-section-title i {
  font-size: 1rem;
}
.h-section {
  margin-bottom: 32px;
}
.p-section {
  margin-bottom: 32px;
}
.code-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.code-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.code-id {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #09090b;
  flex-shrink: 0;
}
.code-text {
  font-size: 0.9rem;
  color: #52525b;
  line-height: 1.5;
}

.drawer-footer {
  padding: 24px 32px;
  border-top: 1px solid #e4e4e7;
  flex-shrink: 0;
  background: #ffffff;
}
.btn-primary-black {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  border: none;
  background: #09090b;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}
.btn-primary-black:hover {
  background: #27272a;
}

/* 🔸 ADMIN FULLSCREEN MODAL 🔸 */
.admin-fs-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.admin-fs-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.adm-fs-window {
  width: 90vw;
  max-width: 1200px;
  height: 770px;
  max-height: 95vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.admin-fs-modal.active .adm-fs-window {
  transform: translateY(0);
}

.adm-fs-header {
  padding: 24px 32px 0 32px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: #ffffff;
  gap: 16px;
}
.adm-fs-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.adm-fs-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #09090b;
  letter-spacing: -0.04em;
}
.adm-table-wrap {
  margin-top: 12px;
}
.v5-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.v5-table th {
  padding: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e4e4e7;
}
.v5-table td {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #27272a;
  font-weight: 500;
  border-bottom: 1px solid #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 44px;
}
.v5-table tr:hover td {
  background: #fafafa;
}
.v5-table tr.recent-item td {
  background-color: #ecfdf5;
}
.v5-table tr.recent-item:hover td {
  background-color: #ecfdf5;
}

.adm-page-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #a1a1aa;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
}
.adm-page-btn:hover:not(:disabled) {
  background: #f4f4f5;
  color: #09090b;
}
.adm-page-btn.active {
  background: #09090b !important;
  color: #ffffff !important;
}
.adm-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.adm-ghost-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #71717a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}
.adm-ghost-btn:hover {
  background: #f4f4f5;
  color: #09090b;
}
.adm-ghost-btn.danger:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* Loader */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 5000;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #09090b;
  font-weight: 600;
  backdrop-filter: blur(2px);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e4e4e7;
  border-top: 3px solid #09090b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.admin-mode .admin-controls {
  display: flex;
}

.drawer-thumb {
  width: 100%;
  height: 300px;
  background: transparent;
  margin-bottom: 24px;
}

.thumb-hover-wrapper {
  position: relative;
  display: inline-block;
}
.thumb-hover-popup {
  position: absolute;
  top: 50%;
  left: 55px;
  transform: translateY(-50%);
  width: 300px;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  background: transparent;
  padding: 0;
  border: none;
  visibility: hidden;
}
.thumb-hover-wrapper:hover .thumb-hover-popup {
  opacity: 1;
  visibility: visible;
}

/* Drawer Code alignment */
.code-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.code-id {
  font-weight: 700;
  color: #0f172a;
  margin-right: 8px;
  flex-shrink: 0;
}
.code-id.code-len-1 {
  width: 44px;
}
.code-id.code-len-2 {
  width: 88px;
}
.code-id.code-len-3 {
  width: 132px;
}
.code-id.code-len-4 {
  width: 176px;
}
.code-text {
  color: #475569;
  flex: 1;
  word-break: keep-all;
}

@keyframes msdsIconPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}
@keyframes msdsBarFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
.msds-progress-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: msdsIconPulse 1.8s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.msds-progress-icon i {
  font-size: 1.4rem;
  color: #3b82f6;
}
.msds-progress-icon.done {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  animation: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.msds-progress-icon.done i {
  color: #10b981;
}
.msds-progress-bar-wrap {
  width: 70%;
  max-width: 260px;
  margin: 0 auto;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.msds-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b82f6, #6366f1, #3b82f6);
  background-size: 200% 100%;
  animation: msdsBarFlow 1.5s linear infinite;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.compact-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Pretendard", sans-serif;
}
.compact-modal-window {
  background: #fff;
  width: 1100px;
  max-width: 95vw;
  height: auto;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.cm-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.cm-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
}
.cm-close-btn:hover {
  color: #0f172a;
}

.cm-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.cm-left {
  flex: 1;
  padding: 24px;
  padding-top: 32px;
  overflow-y: auto;
  border-right: 1px solid #e2e8f0;
}
.cm-section {
  margin-bottom: 20px;
}
.cm-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}
.cm-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 10px;
  font-family: inherit;
  background: #fff;
  transition: 0.2s;
}
.cm-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* GHS Grid */
.cm-ghs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.cm-ghs-tile {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: #f8fafc;
  transition: 0.2s;
}
.cm-ghs-tile input {
  position: absolute;
  opacity: 0;
}
.cm-ghs-tile.selected {
  border-color: #ef4444;
  background: #fef2f2;
}
.cm-ghs-tile span {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
}

.ghs-css-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ghs-css-diamond {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 3px solid #cc0000;
  transform: rotate(45deg);
  border-radius: 2px;
}
.ghs-css-icon i {
  position: relative;
  z-index: 1;
  font-size: 10px;
  color: #000;
}

.cm-radio-group {
  display: flex;
  gap: 4px;
}
.cm-radio {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
}
.cm-radio input {
  display: none;
}
.cm-radio:has(input:checked).danger {
  border-color: #ef4444;
  background: #fef2f2;
  color: #ef4444;
  font-weight: 700;
}
.cm-radio:has(input:checked).warning {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #f59e0b;
  font-weight: 700;
}
.cm-radio:has(input:checked).default {
  border-color: #64748b;
  background: #f1f5f9;
  font-weight: 700;
}

/* Right Column */
.cm-right {
  width: 500px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}
.cm-preview-header {
  padding: 16px 24px 8px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.cm-preview-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.cm-btn-pdf {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.cm-btn-pdf:hover {
  opacity: 0.9;
}
.cm-btn-pdf:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.cm-preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  justify-content: center;
}

.cm-paper {
  background: #fff;
  width: 100%;
  max-width: 100%;
  height: fit-content;
  min-height: 600px;
  width: 100%;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.p-title {
  background: #f1f5f9;
  padding: 12px;
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 20px;
}
.p-ghs-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  min-height: 60px;
}
.p-signal {
  text-align: center;
  font-weight: 900;
  font-size: 22px;
  color: #cc0000;
  margin-bottom: 20px;
}

.p-section {
  margin-bottom: 12px;
}
.p-sec-title {
  font-size: 13px;
  font-weight: 800;
  padding: 6px;
  margin-bottom: 6px;
  border-radius: 2px;
}
.p-sec-title.hazard {
  background: #fee2e2;
  color: #991b1b;
}
.p-sec-title.precaution {
  background: #e0f2fe;
  color: #075985;
}
.p-sec-desc {
  font-size: 12px;
  line-height: 1.6;
  color: #333;
  padding: 0 4px;
  white-space: pre-wrap;
}

.p-supplier {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #475569;
}

.label-gen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f8fafc;
  z-index: 9999;
  overflow-y: auto;
  font-family: "Pretendard", "Inter", sans-serif;
  color: #0f172a;
}
.lg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.lg-header .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.label-gen-overlay .app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.label-gen-overlay .steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.label-gen-overlay .step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.label-gen-overlay .step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0d9488;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.label-gen-overlay .step-label {
  font-size: 13px;
  font-weight: 800;
}

.label-gen-overlay .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 24px;
  align-items: start;
}
.label-gen-overlay .form-stack {
  display: grid;
  gap: 16px;
}
.label-gen-overlay .panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.label-gen-overlay .panel-head {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.label-gen-overlay .panel-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}
.label-gen-overlay .panel-body {
  padding: 16px;
}

.label-gen-overlay .field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #334155;
}
.label-gen-overlay .text-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}
.label-gen-overlay .text-input:focus {
  border-color: #0d9488;
  outline: 2px solid rgba(13, 148, 136, 0.2);
}

.label-gen-overlay .ghs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.label-gen-overlay .ghs-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
}
.label-gen-overlay .ghs-tile:hover {
  border-color: #ef4444;
}
.label-gen-overlay .ghs-tile.is-selected {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 0 0 1px #ef4444;
}
.label-gen-overlay .ghs-tile img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.label-gen-overlay .ghs-tile input {
  display: none;
}
.label-gen-overlay .ghs-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.label-gen-overlay .preview-stage {
  background-color: #eef2f7;
  background-size: 24px 24px;
  background-image:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  padding: 24px;
  padding-top: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  overflow: auto;
}

.label-gen-overlay .label-preview {
  width: 10cm;
  min-height: 7cm;
  padding: 0.42cm;
  border: 2px solid #222;
  background: #fff;
  color: #111;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  font-family: "Malgun Gothic", sans-serif;
  display: flex;
  flex-direction: column;
}
.label-gen-overlay .label-color-band {
  height: 16px;
  margin: -0.42cm -0.42cm 0.12cm;
  border-bottom: 1px solid #333;
}
.label-gen-overlay .label-material {
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
  padding: 4px;
  background: #f3f4f6;
}
.label-gen-overlay .label-ghs-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.label-gen-overlay .label-ghs-row img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}
.label-gen-overlay .label-signal {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  color: #dc2626;
  margin-bottom: 8px;
  letter-spacing: 2px;
}
.label-gen-overlay .label-section {
  margin-bottom: 6px;
}
.label-gen-overlay .label-section-title {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 6px;
  margin-bottom: 4px;
}
.label-gen-overlay .label-section-title.hazard {
  background: #fee2e2;
  color: #991b1b;
}
.label-gen-overlay .label-section-title.precaution {
  background: #dbeafe;
  color: #1e40af;
}
.label-gen-overlay .label-company {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #cbd5e1;
  font-size: 10px;
  white-space: pre-wrap;
  font-weight: 600;
}

@media (max-width: 900px) {
  .label-gen-overlay .workspace {
    grid-template-columns: 1fr;
  }
  .label-gen-overlay .steps {
    display: none;
  }
}

/* ==================== Risk_Assessment.html ==================== */

/* ============================================= */
/* Risk Assessment - Premium Design              */
/* ============================================= */

.risk-assessment-container {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  max-width: 100%;
  min-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Premium Card */
.ra-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ra-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

/* Section Banner - Left light → Right dark */
.ra-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* Step Display */
.ra-step-display {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 1rem 0;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-light);
}

.step-label-text {
  color: #3b82f6;
  font-weight: 800;
  font-size: 1.05rem;
}

.step-name-text {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

/* ---- Flowchart Cards ---- */
.flowchart-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  padding: 0.1rem;
}

/* 공정 간 화살표 */
.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
}

.flow-arrow svg {
  width: 18px;
  height: 18px;
  stroke: #94a3b8;
  stroke-width: 2.5;
  fill: none;
}

.flow-step {
  flex: 0 0 calc(12.5% - 0.57rem);
  min-width: 90px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 0.8rem 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Status: not done = subtle red tint */
.flow-step.status-not-done {
  background: #fff5f5;
  border-color: #fecaca;
}

/* Status: done = clean white (default) */
.flow-step.status-done {
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* Subtle shimmer on hover */
.flow-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(59, 130, 246, 0.04) 50%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.flow-step:hover::after {
  opacity: 1;
}

.flow-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(59, 130, 246, 0.12);
  border-color: #93c5fd;
}

/* Active card - glow + pulse */
.flow-step.active {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #60a5fa;
  box-shadow:
    0 0 0 3px rgba(96, 165, 250, 0.2),
    0 8px 24px -4px rgba(59, 130, 246, 0.2);
  transform: translateY(-3px);
  animation: flowPulse 2s ease-in-out infinite;
}

.flow-step.active .flow-step-title {
  animation: textPulse 2s ease-in-out infinite;
}

@keyframes flowPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(96, 165, 250, 0.2),
      0 8px 24px -4px rgba(59, 130, 246, 0.2);
  }

  50% {
    box-shadow:
      0 0 0 6px rgba(96, 165, 250, 0.12),
      0 8px 24px -4px rgba(59, 130, 246, 0.3);
  }
}

@keyframes textPulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.flow-step-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

.flow-step.active .flow-step-num {
  color: #3b82f6;
}

.flow-step-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  white-space: normal;
  word-break: keep-all;
  transition: color 0.3s;
}

.flow-step.active .flow-step-title {
  color: #1e40af;
}

.flow-step-desc {
  display: none;
}

/* Instruction text */
.flow-instruction {
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 0 0 0;
  letter-spacing: 0.2px;
}

/* ---- Table ---- */
.ra-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4rem;
}

.ra-table th {
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 0.5rem 0.6rem 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ra-table td {
  padding: 0 0.2rem;
  vertical-align: middle;
}

/* Row hover */
.ra-row {
  transition: background 0.15s;
}

.ra-row:hover td {
  background: rgba(248, 250, 252, 0.6);
}

/* Input - matching opt5 */
.opt5-input-cell {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-input);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.opt5-input-cell:focus {
  background: var(--bg-white);
  border-color: #93c5fd;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.opt5-input-cell::placeholder {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.85rem;
}

/* ---- Risk Level Radio (Card Style) ---- */
.risk-check-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.4rem;
}

.risk-check-item {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.risk-check-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.risk-check-item input {
  display: none;
}

.custom-check-circle {
  display: none;
}

/* 상 = Red */
.risk-check-item[data-level="H"]:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.risk-check-item[data-level="H"].checked {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

/* 중 = Yellow/Amber */
.risk-check-item[data-level="M"]:hover {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #d97706;
}

.risk-check-item[data-level="M"].checked {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

/* 하 = Green */
.risk-check-item[data-level="L"]:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
}

.risk-check-item[data-level="L"].checked {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

/* ---- Buttons ---- */
.btn-add-row {
  background: #fff;
  border: 1.5px dashed #93c5fd;
  color: #3b82f6;
  width: 100%;
  padding: 0.75rem;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.btn-add-row:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.ra-row-delete {
  background: transparent;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.ra-row-delete:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Empty State */
.flow-empty {
  width: 100%;
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
  font-style: italic;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
}

/* Code cell - plain text */
.code-cell-input {
  background: transparent !important;
  color: #64748b;
  text-align: center;
  cursor: default;
  border: none !important;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: none !important;
  letter-spacing: 0.5px;
}

.code-cell-input:focus {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ---- Bottom Save Area ---- */
.bottom-save-area {
  text-align: center;
  padding: 0.7rem 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.btn-save-bottom {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.9rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
  min-width: 180px;
}

.btn-save-bottom:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.btn-save-bottom:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* ra-toast: 제거됨 - showGlobalToast() 사용 (Risk_Index.html) */

/* ── Validation Error Highlight ── */
.ra-validation-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  animation: raShake 0.4s ease;
}

.risk-check-group.ra-validation-error {
  border: 2px solid #ef4444 !important;
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  animation: raShake 0.4s ease;
}

@keyframes raShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-4px);
  }

  40% {
    transform: translateX(4px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }
}

/* ---- Animations ---- */
/* fadeSlideUp: Risk_Index.html 공통 키프레임 상속 */

.ra-card {
  animation: fadeSlideUp 0.4s ease-out;
}

#assessment-card {
  animation: none;
}

/* ═══════════════════════════════════════════ */
/* Banner Action Buttons                        */
/* ═══════════════════════════════════════════ */

#assessment-banner {
  justify-content: space-between;
}

.ra-banner-title {
  flex: 1;
}

.ra-banner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ra-banner-btn {
  position: relative;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 10px;
  border: 1.5px solid #bfdbfe;
  background: #eff6ff;
  color: #3b82f6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ra-banner-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.15);
}

.ra-banner-btn-enc {
  border-color: #fde68a;
  background: #fffbeb;
  color: #d97706;
}

.ra-banner-btn-enc:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #b45309;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.15);
}

.ra-banner-btn-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  line-height: 16px;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* ═══════════════════════════════════════════ */
/* Reference Modal                              */
/* ═══════════════════════════════════════════ */

.ref-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
}

.ref-modal-overlay.active {
  display: flex;
}

.ref-modal {
  display: none;
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 680px;
  height: 560px;
  overflow: hidden;
  flex-direction: column;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-modal.active {
  display: flex;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ref-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  flex-shrink: 0;
}

.ref-modal-header-fb {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.ref-modal-header-enc {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.ref-modal-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
}

.ref-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.ref-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ref-modal-body {
  padding: 1.2rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.ref-modal-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ref-modal-tab {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.ref-modal-tab:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

.ref-modal-tab.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.ref-modal-tab .tab-count {
  display: inline-block;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.05rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  margin-left: 0.2rem;
}

.ref-modal-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

.ref-modal-footer {
  padding: 0.8rem 1.2rem;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ref-modal-add-btn {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
  color: white;
}

.ref-modal-add-btn-fb {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.ref-modal-add-btn-fb:hover {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  transform: translateY(-1px);
}

.fb-btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
}

.fb-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fbSpin 0.6s linear infinite;
}

@keyframes fbSpin {
  to {
    transform: rotate(360deg);
  }
}

.ref-modal-add-btn-enc {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ref-modal-add-btn-enc:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

.ref-modal-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Checkbox Items (shared for feedback + encyclopedia) */
.ref-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.25rem;
}

.ref-check-item:hover {
  background: #f1f5f9;
}

.ref-check-item.checked {
  background: #eff6ff;
}

.ref-check-item.added {
  opacity: 0.5;
  pointer-events: none;
}

.ref-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.ref-check-item-text {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.4;
  flex: 1;
}

.ref-check-item-added {
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 600;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════ */
/* Feedback Items (inside modal)                */
/* ═══════════════════════════════════════════ */

/* Category group */
.fb-ref-group {
  margin-bottom: 1rem;
}

.fb-ref-group:last-child {
  margin-bottom: 0;
}

.fb-ref-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f1f5f9;
}

.fb-ref-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fb-ref-group-count {
  font-weight: 600;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-left: auto;
}

.fb-ref-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  margin-bottom: 0.35rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: all 0.2s;
}

.fb-ref-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.fb-ref-item-text {
  flex: 1;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.5;
  word-break: keep-all;
}

.fb-ref-item-author {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.fb-ref-apply-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid #93c5fd;
  background: white;
  color: #2563eb;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.fb-ref-apply-btn:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.fb-ref-apply-btn.applied {
  background: #dcfce7;
  color: #16a34a;
  border-color: #86efac;
  cursor: default;
  pointer-events: none;
}

.fb-ref-empty {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.fb-ref-empty svg {
  width: 32px;
  height: 32px;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

/* Loading state */
.fb-ref-loading {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.fb-ref-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: fbSpin 0.8s linear infinite;
  margin: 0 auto 0.5rem;
}

@keyframes fbSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════ */
/* Encyclopedia Items (inside modal)            */
/* ═══════════════════════════════════════════ */

.hz-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.hz-cat-tab {
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.hz-cat-tab:hover {
  border-color: #f59e0b;
  color: #92400e;
  background: #fffbeb;
}

.hz-cat-tab.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}

.hz-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hz-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  transition: all 0.2s;
  cursor: default;
}

.hz-item:hover {
  background: #fef3c7;
  border-color: #fde68a;
}

.hz-item-text {
  flex: 1;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.4;
}

.hz-item-add {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border: 1.5px solid #fbbf24;
  background: white;
  color: #d97706;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.hz-item-add:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.hz-item-add.added {
  background: #dcfce7;
  color: #16a34a;
  border-color: #86efac;
  cursor: default;
  pointer-events: none;
}

@keyframes aiModalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#ai-convert-modal button:active {
  transform: scale(0.97);
}

/* ==================== Risk_Dash.html ==================== */

.risk-dash-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
  padding: 60px 20px;
}

.risk-dash-placeholder .placeholder-icon {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #f59e0b;
}

.risk-dash-placeholder .placeholder-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
}

.risk-dash-placeholder .placeholder-desc {
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  line-height: 1.6;
  max-width: 400px;
}

.risk-dash-placeholder .placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: #f1f5f9;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

/* ==================== Risk_Feedback.html ==================== */

/* ═══════════════════════════════════════════ */
/* Feedback - Premium Redesign v2              */
/* ═══════════════════════════════════════════ */

.fb-page-wrapper {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  min-width: 900px;
}

/* ── Section Title ── */
.fb-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fb-section-title-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ═══ Stat Cards v2 ═══ */

/* staggered 입장 애니메이션 */
@keyframes fbCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fb-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1vw, 0.75rem);
  margin-bottom: 1.5rem;
}

.fb-stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: clamp(0.75rem, 1.1vw, 1rem) clamp(0.6rem, 0.9vw, 0.85rem);
  border: 1.5px solid #e2e8f0;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;

  /* staggered 입장 */
  animation: fbCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fb-stat-card:nth-child(1) {
  animation-delay: 0s;
}

.fb-stat-card:nth-child(2) {
  animation-delay: 0.06s;
}

.fb-stat-card:nth-child(3) {
  animation-delay: 0.12s;
}

.fb-stat-card:nth-child(4) {
  animation-delay: 0.18s;
}

.fb-stat-card:nth-child(5) {
  animation-delay: 0.24s;
}

.fb-stat-card:nth-child(6) {
  animation-delay: 0.3s;
}

/* 상단 액센트 바 */
.fb-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 호버 글로우 */
.fb-stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.fb-stat-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: transparent;
}

.fb-stat-card:hover::after {
  opacity: 1;
}

/* active 상태 */
.fb-stat-card.active {
  border-color: transparent;
  transform: translateY(-2px);
}

.fb-stat-card.active::before {
  height: 4px;
}

/* 아이콘 영역 — 그라디언트 배경 */
.fb-stat-icon-top {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.fb-stat-card:hover .fb-stat-icon-top {
  transform: scale(1.1);
}

.fb-stat-icon-top svg {
  width: 20px;
  height: 20px;
}

/* 텍스트 영역 */
.fb-stat-value {
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.15rem;
  transition: color 0.3s;
}

.fb-stat-unit {
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 0.1rem;
  opacity: 0.7;
}

.fb-stat-label {
  font-size: clamp(0.62rem, 0.72vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 0;
  opacity: 0.85;
}

/* ── Card Color Themes (그라디언트 팔레트) ── */

/* total — blue→indigo */
.fb-stat-card[data-key="total"] {
  color: #475569;
}

.fb-stat-card[data-key="total"]::before {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.fb-stat-card[data-key="total"]::after {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.06),
    rgba(99, 102, 241, 0.06)
  );
}

.fb-stat-card[data-key="total"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.fb-stat-card[data-key="total"].active {
  box-shadow:
    0 0 0 2px #3b82f6,
    0 8px 28px rgba(59, 130, 246, 0.18);
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
}

.fb-stat-card[data-key="total"] .fb-stat-value {
  color: #1e40af;
}

/* nearmiss — amber→red */
.fb-stat-card[data-key="nearmiss"] {
  color: #92400e;
}

.fb-stat-card[data-key="nearmiss"]::before {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.fb-stat-card[data-key="nearmiss"]::after {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.06),
    rgba(239, 68, 68, 0.06)
  );
}

.fb-stat-card[data-key="nearmiss"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.fb-stat-card[data-key="nearmiss"].active {
  box-shadow:
    0 0 0 2px #f59e0b,
    0 8px 28px rgba(245, 158, 11, 0.18);
  background: linear-gradient(135deg, #fffbeb 0%, #fef2f2 100%);
}

.fb-stat-card[data-key="nearmiss"] .fb-stat-value {
  color: #b45309;
}

/* workplace — red→orange */
.fb-stat-card[data-key="workplace"] {
  color: #991b1b;
}

.fb-stat-card[data-key="workplace"]::before {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.fb-stat-card[data-key="workplace"]::after {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.06),
    rgba(249, 115, 22, 0.06)
  );
}

.fb-stat-card[data-key="workplace"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.fb-stat-card[data-key="workplace"].active {
  box-shadow:
    0 0 0 2px #ef4444,
    0 8px 28px rgba(239, 68, 68, 0.18);
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
}

.fb-stat-card[data-key="workplace"] .fb-stat-value {
  color: #dc2626;
}

/* travel — violet */
.fb-stat-card[data-key="travel"] {
  color: #5b21b6;
}

.fb-stat-card[data-key="travel"]::before {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.fb-stat-card[data-key="travel"]::after {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.06),
    rgba(168, 85, 247, 0.06)
  );
}

.fb-stat-card[data-key="travel"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.fb-stat-card[data-key="travel"].active {
  box-shadow:
    0 0 0 2px #8b5cf6,
    0 8px 28px rgba(139, 92, 246, 0.18);
  background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
}

.fb-stat-card[data-key="travel"] .fb-stat-value {
  color: #7c3aed;
}

/* improve — green→cyan */
.fb-stat-card[data-key="improve"] {
  color: #065f46;
}

.fb-stat-card[data-key="improve"]::before {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.fb-stat-card[data-key="improve"]::after {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.06),
    rgba(6, 182, 212, 0.06)
  );
}

.fb-stat-card[data-key="improve"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.fb-stat-card[data-key="improve"].active {
  box-shadow:
    0 0 0 2px #10b981,
    0 8px 28px rgba(16, 185, 129, 0.18);
  background: linear-gradient(135deg, #ecfdf5 0%, #ecfeff 100%);
}

.fb-stat-card[data-key="improve"] .fb-stat-value {
  color: #059669;
}

/* opinion — indigo→purple */
.fb-stat-card[data-key="opinion"] {
  color: #3730a3;
}

.fb-stat-card[data-key="opinion"]::before {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.fb-stat-card[data-key="opinion"]::after {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.06),
    rgba(139, 92, 246, 0.06)
  );
}

.fb-stat-card[data-key="opinion"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.fb-stat-card[data-key="opinion"].active {
  box-shadow:
    0 0 0 2px #6366f1,
    0 8px 28px rgba(99, 102, 241, 0.18);
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
}

.fb-stat-card[data-key="opinion"] .fb-stat-value {
  color: #4f46e5;
}

/* ── Divider ── */
.fb-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
  margin: 0.5rem 0 1rem 0;
}

/* ═══ Response Items v2 ═══ */

@keyframes fbItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fb-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fbItemIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fb-item:nth-child(1) {
  animation-delay: 0.05s;
}

.fb-item:nth-child(2) {
  animation-delay: 0.1s;
}

.fb-item:nth-child(3) {
  animation-delay: 0.15s;
}

.fb-item:nth-child(4) {
  animation-delay: 0.2s;
}

.fb-item:nth-child(5) {
  animation-delay: 0.25s;
}

.fb-item:nth-child(6) {
  animation-delay: 0.3s;
}

.fb-item:nth-child(7) {
  animation-delay: 0.35s;
}

.fb-item:nth-child(8) {
  animation-delay: 0.4s;
}

.fb-item:nth-child(n + 9) {
  animation-delay: 0.45s;
}

.fb-item:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  border-color: #c7d2fe;
  transform: translateY(-3px);
}

.fb-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
  border-bottom: 1px solid #e8ecf4;
}

.fb-item-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
}

.fb-item-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.fb-item-body {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.8;
  word-break: keep-all;
  padding: 0.75rem 1rem;
}

.fb-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.fb-row:last-child {
  margin-bottom: 0;
}

.fb-row-text {
  flex: 1;
  min-width: 0;
}

/* 태그 pill — 그라디언트 미세 적용 */
.fb-item-body .fb-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0;
  border-radius: 6px;
  min-width: 65px;
  width: 65px;
  text-align: center;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fb-tag-near {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.fb-tag-work {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
}

.fb-tag-travel {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
}

.fb-tag-improve {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}

.fb-tag-opinion {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

.fb-item-body .fb-no-hazard {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.82rem;
}

/* Refresh Button */
.fb-btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
}

.fb-btn-refresh:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.fb-btn-refresh:disabled {
  opacity: 0.5;
  cursor: wait;
}

.fb-center-text {
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Empty State */
.fb-center {
  text-align: center;
  padding: 3rem 1rem;
}

.fb-center-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.fb-center-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

.fb-center svg {
  width: 40px;
  height: 40px;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

/* ── Skeleton UI ── */
@keyframes fbShimmer {
  0% {
    background-position: -400px 0;
  }

  100% {
    background-position: 400px 0;
  }
}

.fb-skeleton-bar {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 800px 100%;
  animation: fbShimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

.fb-skeleton-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1vw, 0.75rem);
  margin-bottom: 1.5rem;
}

.fb-skeleton-stat-card {
  border-radius: 16px;
  padding: clamp(0.75rem, 1.1vw, 1rem) clamp(0.6rem, 0.9vw, 0.85rem);
  border: 1px solid #f1f5f9;
  background: #fafbfc;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.fb-skeleton-stat-card .sk-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
}

.fb-skeleton-stat-card .sk-value {
  width: 40px;
  height: 20px;
  margin-bottom: 0.25rem;
}

.fb-skeleton-stat-card .sk-label {
  width: 52px;
  height: 12px;
}

.fb-skeleton-item {
  border-radius: 14px;
  border: 1px solid #f1f5f9;
  background: #fafbfc;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.fb-skeleton-item-header {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.fb-skeleton-item-header .sk-name {
  width: 60px;
  height: 14px;
}

.fb-skeleton-item-header .sk-meta {
  width: 100px;
  height: 12px;
}

.fb-skeleton-item-body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fb-skeleton-item-body .sk-line {
  height: 14px;
  border-radius: 6px;
}

.fb-skeleton-item-body .sk-line:nth-child(1) {
  width: 85%;
}

.fb-skeleton-item-body .sk-line:nth-child(2) {
  width: 65%;
}

/* ── Load More Button ── */
.fb-load-more-wrap {
  text-align: center;
  margin-top: 1rem;
}

.fb-btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.6rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-btn-load-more:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.fb-btn-load-more svg {
  width: 16px;
  height: 16px;
}

/* ==================== Risk_Index.html ==================== */

/* ═══ CSS Variables ═══ */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eff6ff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #ffffff;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --sidebar-width: 280px;
  --header-height: 64px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --toast-bg: #1e293b;
  --toast-color: #fff;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --success: #16a34a;
  --success-light: #dcfce7;
  --info-color: #3b82f6;
  --info-light: #dbeafe;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1180px;
}

body {
  margin: 0;
  font-family: "Inter", "Noto Sans KR", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
  min-width: 1180px;
}

/* Sidebar Styles */
aside {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
}

.logo-area {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo-icon {
  margin-right: 0.75rem;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-menu {
  flex: 1;
  padding: 1.5rem 0.75rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding-left: 0.75rem;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  letter-spacing: 1.5px;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 0.88rem;
  position: relative;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
  transform: translateX(2px);
}

.nav-item.active svg {
  stroke: white;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  margin-right: 0.7rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 0 2.5rem 2rem 2.5rem;
  background: transparent;
  min-width: 900px;
}

.content-header {
  margin-bottom: 2rem;
}

.content-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.content-header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.page-section {
  display: none;
  animation: slideUpFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-section.active {
  display: block;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 공통: fadeSlideUp 애니메이션 ── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 공통: 배너 넘버 ── */
.banner-num {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered card fade-in */
.page-section.active .card,
.page-section.active .opt5-card,
.page-section.active .ra-card,
.page-section.active .ms-card,
.page-section.active .rs-card {
  animation: staggerCard 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.page-section.active > :nth-child(1) {
  animation-delay: 0s;
}

.page-section.active > :nth-child(2) {
  animation-delay: 0.06s;
}

.page-section.active > :nth-child(3) {
  animation-delay: 0.12s;
}

.page-section.active > :nth-child(4) {
  animation-delay: 0.18s;
}

.page-section.active > :nth-child(5) {
  animation-delay: 0.24s;
}

.page-section.active > :nth-child(6) {
  animation-delay: 0.3s;
}

.page-section.active > :nth-child(7) {
  animation-delay: 0.36s;
}

@keyframes staggerCard {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card Style (Global) */
.card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  color: var(--primary);
}

/* Input Groups (Global idea) */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-body);
}

/* Login Overlay Styles Removed */

/* ── Kebab Menu ── */
.nav-item-wrapper {
  position: relative;
}

.nav-kebab {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.2s;
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.nav-item.active ~ .nav-kebab,
.nav-item-wrapper:hover .nav-kebab {
  opacity: 1;
  pointer-events: auto;
}

.nav-item.active ~ .nav-kebab {
  color: rgba(255, 255, 255, 0.85);
}

.nav-item-wrapper:not(:has(.nav-item.active)) .nav-kebab {
  color: #94a3b8;
}

.nav-kebab:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-kebab svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.nav-dropdown {
  position: absolute;
  right: -4px;
  top: calc(100% + 4px);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  padding: 0.35rem;
  z-index: 100;
  display: none;
  animation: dropdownFade 0.15s ease;
}

.nav-dropdown.show {
  display: block;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-dropdown-item:hover {
  background: var(--bg-hover);
}

.nav-dropdown-item svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

/* ═══ Global Toast ═══ */
.g-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
}

.g-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  background: var(--toast-bg);
  color: var(--toast-color);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: "Noto Sans KR", sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 480px;
  white-space: normal;
  word-break: keep-all;
}

.g-toast.show {
  transform: translateX(0);
}

.g-toast.success {
  background: var(--success);
  color: #fff;
}

.g-toast.error {
  background: var(--danger);
  color: #fff;
}

.g-toast.warning {
  background: var(--warning);
  color: #1e293b;
}

.g-toast.info {
  background: var(--info-color);
  color: #fff;
}

.g-toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-toast-retry {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: inherit;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.g-toast-retry:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ═══ Progress Bar (저장바 상단) ═══ */
.progress-card {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0.6rem 0;
  gap: 0;
  min-height: 48px;
  margin: 0 auto;
}

.progress-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  margin-right: 0.8rem;
  letter-spacing: 0.3px;
}

.progress-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.progress-loading .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-steps {
  display: flex;
  align-items: center;
  flex: 1;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #94a3b8;
  flex-shrink: 0;
}

.progress-step:hover {
  background: #f1f5f9;
  color: #475569;
}

/* 완료 */
.progress-step.done {
  color: #16a34a;
}

.progress-step.done .step-icon {
  color: #22c55e;
}

/* 미실시 */
.progress-step.pending {
  color: #ef4444;
}

.progress-step.pending .step-icon {
  color: #ef4444;
}

/* 현재 탭 */
.progress-step.current {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #1d4ed8;
  font-weight: 700;
  border: 1.5px solid #93c5fd;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  position: relative;
  animation: currentPulse 2s ease-in-out infinite;
}

@keyframes currentPulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  }

  50% {
    box-shadow: 0 2px 16px rgba(59, 130, 246, 0.35);
  }
}

.progress-step.current::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #3b82f6;
}

.progress-step.current.pending .step-icon {
  color: #ef4444;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.15rem;
  color: #1e293b;
  font-size: 0.75rem;
  user-select: none;
  flex-shrink: 0;
}

/* 저장 버튼 (우측 끝단, 스크롤 안 따라옴) */
.floating-save-btn {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* 스크롤 상단 이동 (우하단) */
.scroll-top-fab {
  position: fixed;
  bottom: 2rem;
  right: 2.5rem;
  height: 40px;
  padding: 0 1rem 0 0.75rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #64748b, #475569);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 4px 16px rgba(71, 85, 105, 0.3);
  transition: all 0.3s;
  z-index: 100;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
}

.scroll-top-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(71, 85, 105, 0.4);
}

.scroll-top-fab svg {
  width: 16px;
  height: 16px;
}

/* ═══ Logout Feedback ═══ */
.logout-active {
  background: #fef2f2 !important;
  color: #ef4444 !important;
}

.logo-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 1.5px;
  display: flex;
  justify-content: center;
}

.ll {
  display: inline-block;
  opacity: 0;
  animation: llLoop 10s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.ll.ls {
  width: 0.3em;
  animation: none;
  opacity: 1;
}

@keyframes llLoop {
  0% {
    opacity: 0;
    transform: scale(0.4) translateY(6px);
  }

  5% {
    opacity: 1;
    transform: scale(1.15) translateY(-1px);
  }

  8% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  50% {
    opacity: 1;
    transform: scale(1) translateY(-2px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

");
            printWin.document.write("html,
body {
  min-width: 0 !important;
  display: block !important;
  height: auto !important;
  overflow: visible !important;
  padding: 10mm !important;
  background: #fff !important;
}
");
            printWin.document.write("aside,
nav,
.sidebar,
.nav-item,
.nav-group,
.nav-menu,
.logo-area,
.nav-section-title,
#login-overlay,
.login-box {
  display: none !important;
}
");
            printWin.document.write("main {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  overflow: visible !important;
  flex: none !important;
  background: none !important;
}
");
            printWin.document.write(".page-section {
  display: block !important;
  position: static !important;
  opacity: 1 !important;
  animation: none !important;
}
");
            printWin.document.write("button,
.btn,
.toast,
.rs-toast,
.mp-toast,
.rs-crop-overlay,
.g-toast-container,
.unsaved-dot {
  display: none !important;
}
");
            printWin.document.write(".rs-save-area,
.rs-btn-save,
.mp-save-area,
.mp-btn-save,
#ms-save-area {
  display: none !important;
}
");
            printWin.document.write(".rs-photo-delete,
.rs-photo-placeholder {
  display: none !important;
}
");
            printWin.document.write(".stat-bar,
.filter-bar,
#ms-filter-bar {
  display: none !important;
}
");
            printWin.document.write("#print-modal-overlay,
#print-loading-overlay {
  display: none !important;
}
");
            printWin.document.write(".card,
.info-card,
.rs-card,
.mp-card,
.ra-card,
.ms-card {
  box-shadow: none !important;
}
");
            printWin.document.write(".print-section {
  margin-bottom: 20px;
}
");
            printWin.document.write(".print-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e40af;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
");
            printWin.document.write(".opt5-selection-card.checked {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border-color: transparent !important;
}
");
            printWin.document.write("@media print {
  @page {
    margin: 10mm;
  }
  .print-section {
    page-break-after: always;
  }
  .print-section:last-child {
    page-break-after: auto;
  }
}
');
            printWin.document.write('

/* ==================== Risk_Info.html ==================== */

    /* Save/Load Toolbar Styles */
    .risk-info-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  min-width: 900px;
  transition: background 0.3s;
}

.risk-info-toolbar .btn {
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.btn-delete {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.btn-delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #ef4444;
}

/* Option 5: Premium Card Styles */
.opt5-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: fadeSlideUp 0.4s ease-out;
  min-width: 900px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.opt5-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

/* Full-width Banner Header */
.opt5-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* Legacy opt5-title kept for compatibility but restyled */
.opt5-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1.5rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* fadeSlideUp: Risk_Index.html 공통 키프레임 상속 */

.opt5-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.opt5-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.opt5-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-input);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.opt5-input:disabled {
  background: var(--bg-input);
  color: var(--text-light);
  cursor: not-allowed;
}

.opt5-input::placeholder {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.85rem;
}

.opt5-input:focus {
  background: var(--bg-white);
  border-color: #93c5fd;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.opt5-grid-5 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 0.5fr;
  gap: 1rem;
  align-items: center;
}

.opt5-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1.5rem;
}

.opt5-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.opt5-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.opt5-selection-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.5rem;
}

.opt5-selection-card {
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  user-select: none;
}

.opt5-selection-card:hover {
  background: #eff6ff;
  color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.opt5-selection-card.checked {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.opt5-selection-card input {
  accent-color: #333;
  width: 14px;
  height: 14px;
}

.opt5-selection-card.checked input {
  accent-color: #333;
}

.opt5-sub-header {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 2px dashed var(--border-color);
}

.opt5-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.opt5-table th {
  text-align: center;
  color: #64748b;
  font-weight: 700;
  padding: 0 0.5rem;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.opt5-table td {
  padding: 0 0.25rem;
  vertical-align: middle;
}

.opt5-table input {
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  text-align: center;
}

.hidden-input {
  display: none;
  margin-top: 0.5rem;
  border-left: 3px solid #3b82f6;
  padding-left: 0.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast Notification Styles */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  background: white;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateX(100%);
  border: 1px solid #f1f5f9;
  pointer-events: auto;
}

/* Clean style without left border */
.toast.success,
.toast.error,
.toast.info {
  border-left: none;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: #16a34a;
  background: #dcfce7;
}

.toast.error .toast-icon {
  color: #dc2626;
  background: #fee2e2;
}

.toast.info .toast-icon {
  color: #2563eb;
  background: #dbeafe;
}

.toast-content {
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
}

/* Toolbar Buttons */
.btn-load {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  transition: all 0.2s;
}

.btn-load:hover {
  background: #e0f2fe;
  transform: translateY(-1px);
}

.btn-save {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  transition: all 0.2s;
}

.btn-save:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.toast.success .toast-icon {
  color: #22c55e;
  background: #dcfce7;
}

.toast.error .toast-icon {
  color: #ef4444;
  background: #fee2e2;
}

.toast.info .toast-icon {
  color: #3b82f6;
  background: #dbeafe;
}

.toast-content {
  font-size: 0.95rem;
  color: #334155;
  font-weight: 600;
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ═══════════════════════════════════════════
       PROCESS STEP CARD
    ═══════════════════════════════════════════ */
.process-step-card {
  border: none;
  border-radius: 12px;
  margin-bottom: 1.2rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition:
    box-shadow 0.2s,
    opacity 0.2s,
    transform 0.15s;
}

.process-step-card.dragging {
  opacity: 0.4;
  box-shadow: 0 0 0 2px #3b82f6;
}

.process-step-card.drag-over {
  border-top: 3px solid #3b82f6;
}

.process-step-card:hover {
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.15);
}

/* Step Number Banner */
.step-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
}

.step-number {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.step-divider {
  width: 1.5px;
  height: 18px;
  background: rgba(255, 255, 255, 0.25);
}

.step-title-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  transition: all 0.15s;
}

.step-title-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.step-title-input:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Process Description */
.process-desc {
  padding: 0.9rem 1.5rem;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}

.process-desc .opt5-label {
  color: #2563eb;
  font-weight: 700;
  font-size: 0.72rem;
}

.process-desc .input {
  background: #fff;
  border: 1px solid #bfdbfe;
  box-shadow: none;
  font-size: 0.88rem;
  padding: 0.6rem 0.85rem;
  width: 100%;
  border-radius: 8px;
}

.process-desc .input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Process Body */
.process-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
}

/* Sub-section Box */
.sub-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
}

.sub-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid #dbeafe;
  letter-spacing: 0.2px;
}

/* Compact Table for Sub-items */
.compact-table {
  width: 100%;
  border-collapse: collapse;
}

.compact-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0.3rem 0.35rem;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.3px;
}

.compact-table td {
  padding: 0.25rem 0.2rem;
}

.compact-table input {
  width: 100%;
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.compact-table input:focus {
  border-color: #60a5fa;
  outline: none;
}

/* Step Actions */
.step-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1.2rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.btn-step-delete {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-step-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

.btn-add-sub {
  background: #fff;
  border: 1.5px dashed #bfdbfe;
  color: #3b82f6;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 0.5rem;
}

.btn-add-sub:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

/* ── 참여자 자동완성 ── */
.ac-wrapper {
  position: relative;
  overflow: visible;
}

.ac-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  width: 260px;
}

.ac-dropdown.show {
  display: block;
}

.ac-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.active {
  background: #eff6ff;
}

.ac-item .ac-name {
  font-weight: 700;
  color: #1e293b;
}

.ac-item .ac-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.4rem;
}

/* ==================== Risk_Login.html ==================== */

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: linear-gradient(
    160deg,
    #1e40af 0%,
    #2563eb 30%,
    #3b82f6 60%,
    #60a5fa 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle background pattern */
body::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Floating orbs */
body::after {
  content: "";
  position: absolute;
  top: 10%;
  right: 5%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

/* Top branding area */
.brand-area {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.brand-logo img {
  height: 36px;
  filter: brightness(0) invert(1);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Login Card */
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Blue accent line at top of card */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  border-radius: 0 0 4px 4px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--slate-700);
  letter-spacing: 0.2px;
}

.form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--slate-200);
  border-radius: 12px;
  background: var(--slate-50);
  color: var(--slate-800);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.form-select:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background-color: #fff;
}

.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}

.divider span {
  font-size: 0.72rem;
  color: var(--slate-400);
  font-weight: 500;
  white-space: nowrap;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-survey {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--blue-200);
  background: var(--blue-50);
  color: var(--blue-700);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.2px;
}

.btn-survey:hover {
  background: var(--blue-100);
  border-color: var(--blue-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn-survey:active {
  transform: translateY(0);
}

.btn-survey svg {
  flex-shrink: 0;
}

/* Loading */
.loading-state {
  text-align: center;
  padding: 2rem 0;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.88rem;
  color: var(--slate-400);
  font-weight: 500;
}

/* Footer */
.footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 20px;
  }

  .brand-title {
    font-size: 1.3rem;
  }
}

/* Subtle entrance animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-wrapper {
  animation: slideUp 0.5s ease-out;
}

/* ==================== Risk_Measures.html ==================== */

/* ============================================= */
/* Improvement Measures - Premium Design          */
/* ============================================= */

.measures-container {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  max-width: 100%;
  min-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Card */
.ms-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: msFadeUp 0.4s ease-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

@keyframes msFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Banner */
.ms-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* 통계 필터 바 */
.ms-filter-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
}

.ms-filter-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid #e2e8f0;
  user-select: none;
}

.ms-filter-item:last-child {
  border-right: none;
}

.ms-filter-item:hover {
  background: #eff6ff;
  color: #2563eb;
}

.ms-filter-item.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.ms-filter-item.active .ms-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ms-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
  transition: all 0.2s;
}

.ms-filter-item[data-filter="H"] .ms-filter-count {
  background: #fee2e2;
  color: #dc2626;
}

.ms-filter-item[data-filter="H"].active .ms-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ms-filter-item[data-filter="M"] .ms-filter-count {
  background: #fef3c7;
  color: #d97706;
}

.ms-filter-item[data-filter="M"].active .ms-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ms-filter-item[data-filter="H"].active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.ms-filter-item[data-filter="M"].active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Table */
.ms-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4rem;
  font-size: 0.88rem;
}

.ms-table thead th {
  text-align: center;
  color: #64748b;
  font-weight: 700;
  padding: 0 0.5rem 0.6rem 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  background: transparent;
  border: none;
  white-space: nowrap;
}

.ms-table td {
  padding: 0 0.2rem;
  vertical-align: middle;
}

.ms-table tbody tr {
  transition: background 0.15s;
}

.ms-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

/* 구분 숫자 */
.ms-row-num {
  text-align: center;
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* 코드 표시 */
.ms-code-cell {
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
  letter-spacing: 0.5px;
}

/* 위험등급 뱃지 */
.ms-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 32px;
}

.ms-risk-badge.level-H {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.ms-risk-badge.level-M {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* 읽기전용 텍스트 셀 */
.ms-readonly-cell {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
  word-break: keep-all;
  padding: 0.5rem 0.6rem;
}

/* 입력 필드 */
.ms-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-input:focus {
  background: #fff;
  border-color: #93c5fd;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.ms-input::placeholder {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.82rem;
}

.ms-input[type="date"] {
  cursor: pointer;
}

/* 빈 상태 */
.ms-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
}

.ms-empty-state svg {
  width: 48px;
  height: 48px;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.ms-empty-state h3 {
  color: #64748b;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
}

.ms-empty-state p {
  font-size: 0.85rem;
  margin: 0;
}

/* 하단 저장 영역 */
.ms-save-area {
  text-align: center;
  padding: 0.7rem 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.ms-btn-save {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.9rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
  font-family: inherit;
  min-width: 180px;
}

.ms-btn-save:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.ms-btn-save:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.ms-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ms-toast: 제거됨 - showGlobalToast() 사용 (Risk_Index.html) */

/* ── Validation Error Highlight ── */
.ms-validation-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  animation: msShake 0.4s ease;
}

@keyframes msShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-4px);
  }

  40%,
  80% {
    transform: translateX(4px);
  }
}

/* ==================== Risk_Results.html ==================== */

/* ============================================= */
/* Improvement Results - Premium Design           */
/* ============================================= */

.results-container {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  max-width: 100%;
  min-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Card Wrapper */
.rs-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: rsFadeUp 0.4s ease-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rs-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

@keyframes rsFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Banner */
.rs-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* 빈 상태 */
.rs-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
}

.rs-empty-state svg {
  width: 48px;
  height: 48px;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.rs-empty-state h3 {
  color: #64748b;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
}

.rs-empty-state p {
  font-size: 0.85rem;
  margin: 0;
}

/* ── 결과 카드 아이템 ── */
.rs-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 0.8rem;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rs-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

/* 카드 헤더 */
.rs-item-header {
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.rs-header-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.rs-header-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.35rem 1rem;
  font-size: 0.78rem;
}

.rs-detail-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rs-detail-label {
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.rs-detail-value {
  color: #1e293b;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-code-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.rs-manager-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

.rs-manager-name {
  font-size: 0.88rem;
  color: #1e293b;
  font-weight: 700;
}

.rs-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  margin-left: auto;
}

.rs-risk-badge.level-H {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.rs-risk-badge.level-M {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

/* 카드 바디 */
.rs-item-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.rs-before-col,
.rs-after-col {
  padding: 0.7rem 1rem;
}

.rs-before-col {
  border-right: 1px solid #e2e8f0;
}

.rs-col-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
}

.rs-col-label svg {
  width: 16px;
  height: 16px;
}

.rs-col-label.before {
  background: #f1f5f9;
  color: #64748b;
}

.rs-col-label.after {
  background: #eff6ff;
  color: #2563eb;
}

/* 사진 업로드 영역 */
.rs-photo-area {
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.rs-photo-area:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.rs-photo-area.has-image {
  border-style: solid;
  border-color: #e2e8f0;
}

.rs-photo-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.rs-photo-placeholder {
  text-align: center;
  color: #cbd5e1;
  pointer-events: none;
}

.rs-photo-placeholder svg {
  width: 28px;
  height: 28px;
  margin-bottom: 0.3rem;
}

.rs-photo-placeholder p {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0;
}

/* 업로드 스피너 */
.rs-upload-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: rsSpinAnim 0.8s linear infinite;
  margin: 0 auto 0.5rem;
}

@keyframes rsSpinAnim {
  to {
    transform: rotate(360deg);
  }
}

.rs-photo-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3b82f6;
  border-radius: 10px;
  flex-direction: column;
  gap: 0.3rem;
}

/* ── 크롭 팝업 모달 ── */
.rs-crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rsCropFadeIn 0.2s ease;
}

@keyframes rsCropFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.rs-crop-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 480px;
  max-width: 92vw;
  overflow: hidden;
}

.rs-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.rs-crop-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.rs-crop-close:hover {
  color: #ef4444;
}

.rs-crop-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.rs-crop-canvas-wrap:active {
  cursor: grabbing;
}

.rs-crop-canvas-wrap img {
  position: absolute;
  transform-origin: 0 0;
  pointer-events: none;
}

.rs-crop-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.2rem;
  border-top: 1px solid #e2e8f0;
}

.rs-crop-controls label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.rs-crop-controls input[type="range"] {
  flex: 1;
  accent-color: #3b82f6;
}

.rs-crop-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.7rem 1.2rem;
  border-top: 1px solid #e2e8f0;
}

.rs-crop-btn {
  padding: 0.5rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}

.rs-crop-btn.cancel {
  background: #f1f5f9;
  color: #64748b;
}

.rs-crop-btn.cancel:hover {
  background: #e2e8f0;
}

.rs-crop-btn.confirm {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.rs-crop-btn.confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.35);
}

/* 삭제 버튼 */
.rs-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.rs-photo-area:hover .rs-photo-delete {
  opacity: 1;
}

/* 내용 입력 */
.rs-textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1e293b;
  resize: vertical;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s;
}

.rs-textarea:focus {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.3);
  outline: none;
}

.rs-textarea::placeholder {
  color: #cbd5e1;
  font-weight: 500;
}

/* 하단 저장 */
.rs-save-area {
  text-align: center;
  padding: 0.7rem 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.rs-btn-save {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.9rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
  font-family: inherit;
  min-width: 180px;
}

.rs-btn-save:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.rs-btn-save:active {
  transform: translateY(-1px);
}

.rs-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* rs-toast: 제거됨 - showGlobalToast() 사용 (Risk_Index.html) */

/* ==================== Risk_Survey.html ==================== */

/* ========================================
           Survey Premium Design - Matching Login
           ======================================== */

:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eff6ff;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --text-dark: #1e293b;
  --text-gray: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: linear-gradient(
    160deg,
    #1e40af 0%,
    #2563eb 30%,
    #3b82f6 60%,
    #60a5fa 100%
  );
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
  padding: 2rem 1.25rem 3rem;
  position: relative;
  overflow-x: hidden;
}

/* Subtle background pattern - matches Login */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* Floating orb decoration */
body::after {
  content: "";
  position: fixed;
  top: 10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.survey-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: surveySlideUp 0.6s ease-out;
}

@keyframes surveySlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
           Header - Transparent on Blue
           ===================== */
.header-card {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 0 2rem 0;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 50;
  border-radius: 0;
  box-shadow: none;
}

.header-card::after {
  content: none;
}

.header-title {
  font-size: 1.65rem;
  font-weight: 800;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
  margin: 0;
  padding-top: 0.25rem;
  letter-spacing: -0.5px;
}

.header-logo {
  width: 240px;
  height: auto;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.header-desc {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.75rem;
  font-weight: 400;
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 0 0.5rem;
}

/* =====================
           Form Cards - White on Blue
           ===================== */
.q-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  border: none;
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.5s ease-out both;
}

.q-card:nth-child(2) {
  animation-delay: 0.1s;
}

.q-card:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Blue accent line at top of card - matches Login */
.q-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  border-radius: 0 0 4px 4px;
}

/* =====================
           Section Header
           ===================== */
.form-section-head {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-badge {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-right: 0.75rem;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
  flex-shrink: 0;
}

.form-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-800);
  letter-spacing: -0.3px;
}

/* =====================
           Input Groups
           ===================== */
.input-group {
  background: var(--slate-50);
  border-radius: 14px;
  margin-bottom: 1rem;
  border: 1.5px solid var(--slate-200);
  transition: all 0.25s ease;
  box-shadow: none;
  position: relative;
  min-height: 4.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-group:focus-within {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

/* Floating Label */
.input-label {
  position: absolute;
  top: 0.65rem;
  left: 1.15rem;
  font-size: 0.72rem;
  color: var(--slate-500);
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Select */
.custom-select {
  width: 100%;
  height: 100%;
  padding: 1.45rem 1.15rem 0.45rem 1.15rem;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--slate-800);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  z-index: 5;
  position: relative;
  pointer-events: auto;
}

.custom-select:focus {
  outline: none;
}

.custom-select.placeholder {
  color: var(--slate-400);
}

/* Custom Arrow */
.custom-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--slate-400);
  z-index: 10;
  font-size: 0.7rem;
}

/* Text Input */
.custom-input {
  width: 100%;
  height: 100%;
  padding: 1.45rem 1.15rem 0.45rem 1.15rem;
  border: none;
  background: transparent;
  font-size: 0.98rem;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--slate-800);
  border-radius: 14px;
  font-weight: 500;
}

.custom-input:focus {
  outline: none;
}

.custom-input::placeholder {
  color: var(--slate-400);
  font-weight: 400;
}

/* Textarea */
.custom-textarea {
  width: 100%;
  min-height: 7.5rem;
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  border-radius: 14px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  transition: all 0.25s ease;
  color: var(--slate-800);
  line-height: 1.7;
}

.custom-textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.custom-textarea::placeholder {
  color: var(--slate-400);
  font-weight: 400;
}

/* =====================
           Question Text
           ===================== */
.q-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 0.35rem;
  letter-spacing: -0.2px;
}

.q-sub {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-bottom: 0.6rem;
  line-height: 1.5;
  font-weight: 400;
}

.input-group.textarea-group {
  height: auto;
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 2rem;
}

.input-group.textarea-group:focus-within {
  box-shadow: none;
}

/* =====================
           Footer Note
           ===================== */
.footer-note {
  margin-top: 2rem;
  margin-bottom: 4rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  word-break: keep-all;
  text-align: center;
  font-weight: 400;
  backdrop-filter: blur(10px);
}

/* =====================
           Submit Button - Premium Style
           ===================== */
.submit-btn {
  background: #ffffff;
  background-size: 200% 200%;
  color: var(--blue-600);
  border: none;
  padding: 1.1rem;
  border-radius: 16px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  animation: none;
}

@keyframes gradientBtn {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.08),
    transparent
  );
  transition: 0.5s;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 15px 40px -5px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.3);
  background: #ffffff;
}

/* =====================
           Toast
           ===================== */
#toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 21000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: #ffffff;
  color: #334155;
  padding: 0.85rem 1.2rem;
  border-radius: 50px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: toastPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  text-align: center;
  letter-spacing: -0.01em;
}

.toast .toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.toast.error .toast-icon {
  background: #fef2f2;
  color: #ef4444;
}

.toast.success .toast-icon {
  background: #f0fdf4;
  color: #22c55e;
}

.toast.info .toast-icon {
  background: #eff6ff;
  color: #3b82f6;
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* All-No Encouragement Card */
.all-no-hint {
  display: none;
  background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  animation: cardFadeIn 0.4s ease-out;
}

.all-no-hint .hint-icon {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.all-no-hint .hint-text {
  color: #475569;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.6;
}

.all-no-hint .hint-highlight {
  color: #3b82f6;
  font-weight: 700;
}

/* =====================
           Language Selector
           ===================== */
.lang-dropdown-wrapper {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.85rem;
}

.lang-selected {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
  min-width: 7.5rem;
  justify-content: space-between;
  color: #ffffff;
}

.lang-selected:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.lang-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.lang-arrow {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}

.lang-options {
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.2);
  width: 10.5rem;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
  z-index: 10000;
  padding: 4px 0 4px;
}

.lang-options.show {
  display: flex;
}

.lang-option {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--slate-700);
  font-weight: 500;
  border-radius: 8px;
  margin: 1px 4px;
}

.lang-option:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
           Loading Overlay
           ===================== */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 20000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--blue-100);
  border-top: 4px solid var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.checkmark-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #fff;
  stroke-miterlimit: 10;
  margin: 10% auto;
  box-shadow: inset 0px 0px 0px #22c55e;
  animation:
    fill 0.4s ease-in-out 0.4s forwards,
    scale 0.3s ease-in-out 0.9s both;
  flex-shrink: 0;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* =====================
           Input Error State
           ===================== */
.input-error {
  border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
  background: linear-gradient(
    135deg,
    rgba(254, 226, 226, 0.3),
    rgba(255, 255, 255, 0.95)
  ) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08) !important;
}

/* =====================
           Toggle Buttons - Clean Premium
           ===================== */
.toggle-container {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
  margin-top: 0.75rem;
}

.toggle-input {
  display: none;
}

.radio-label {
  padding: 0.85rem 0;
  background: #ffffff;
  color: var(--slate-500);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  border: 1.5px solid var(--slate-200);
  flex: 1;
  text-align: center;
  box-shadow: none;
}

.radio-label:hover {
  transform: translateY(-1px);
  border-color: var(--slate-300);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.toggle-input:checked + .radio-label {
  transform: translateY(-1px);
}

/* Yes/No checked states - Cleaner */
#q1-y:checked + label,
#q2-y:checked + label,
#q3-y:checked + label,
#q4-y:checked + label,
#q5-y:checked + label {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
  font-weight: 700;
}

#q1-n:checked + label,
#q2-n:checked + label,
#q3-n:checked + label,
#q4-n:checked + label,
#q5-n:checked + label {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #86efac;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.12);
  font-weight: 700;
}

/* =====================
           Textarea Wrapper
           ===================== */
.textarea-wrapper {
  display: none;
  margin-top: 1rem;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-note {
  font-size: 0.78rem;
  color: #ef4444;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* =====================
           Progress Bar - Glass on Blue
           ===================== */
.progress-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  margin: 0 -16px 1rem -16px;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.progress-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.progress-header {
  display: none;
}

.progress-label {
  display: none;
}

.progress-percentage {
  display: none;
}

.progress-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1, #3b82f6);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 100px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* =====================
           Responsive - Tablet
           ===================== */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .survey-container {
    max-width: 100%;
  }

  .q-card {
    padding: 1.75rem;
    border-radius: 20px;
  }
}

/* =====================
           Responsive - Mobile
           ===================== */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem 2.5rem;
  }

  .header-title {
    font-size: 1.35rem;
  }

  .header-desc {
    font-size: 0.82rem;
    padding: 0 0.25rem;
  }

  .header-logo {
    width: 150px;
  }

  .q-card {
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
    margin-bottom: 1.25rem;
  }

  .form-section-head {
    align-items: flex-start;
  }

  .form-section-title {
    font-size: 1rem;
    word-break: keep-all;
  }

  .section-badge {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
    margin-right: 0.6rem;
  }

  .section-note {
    font-size: 0.7rem;
    display: block;
    margin-left: 0;
    margin-top: 0.2rem;
  }

  .toggle-container {
    justify-content: flex-start;
  }

  .radio-label {
    flex: 1;
  }

  /* Adjust the flex container for section 2 header to wrap */
  .q-card .form-section-head {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .q-card .form-section-head > div:first-child {
    margin-bottom: 0.3rem;
  }

  /* Enhanced mobile touch targets */
  .custom-select,
  .custom-input {
    min-height: 48px;
    font-size: 16px;
    /* Prevents iOS auto-zoom */
  }

  .toggle-container label {
    min-height: 48px;
    padding: 0.875rem 1.5rem;
  }

  .submit-btn {
    min-height: 56px;
    font-size: 1.05rem;
    border-radius: 14px;
  }

  .input-group {
    border-radius: 12px;
  }

  .lang-dropdown-wrapper {
    top: 0.5rem;
    right: 0.5rem;
  }

  .lang-selected {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    min-width: 6.5rem;
  }
}

/* =====================
           Responsive - Very small (320px)
           ===================== */
@media (max-width: 360px) {
  body {
    padding: 0.75rem 0.5rem 2rem;
  }

  .header-title {
    font-size: 1.2rem;
  }

  .q-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .section-badge {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .form-section-title {
    font-size: 0.92rem;
  }

  .q-title {
    font-size: 0.82rem;
  }

  .q-sub {
    font-size: 0.72rem;
  }
}

/* =====================
           Responsive - Desktop wider
           ===================== */
@media (min-width: 768px) {
  body {
    padding: 3rem 2rem 4rem;
  }

  .survey-container {
    max-width: 620px;
  }

  .q-card {
    padding: 2.25rem 2.5rem;
  }

  .header-title {
    font-size: 1.85rem;
  }

  .header-desc {
    font-size: 0.92rem;
  }
}

/* ==================== Script.html ==================== */

@keyframes ping {
  75%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ==================== Stress.html ==================== */

:root {
  --primary: #002b5e; /* HI AIR KOREA Deep Blue */
  --primary-light: #2563eb;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-sub: #64748b;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family:
    "Noto Sans KR",
    "Inter",
    -apple-system,
    sans-serif;
  background: var(--surface);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Header / Logo ── */
.survey-header {
  text-align: left;
  margin-bottom: 2rem;
  width: 100%;
}
.logo-wrap {
  width: 130px;
  margin-bottom: 2.5rem;
}
.logo-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.survey-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.survey-subtitle {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ── Minimalist Notice List ── */
.notice-list {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--primary);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.notice-item {
  display: flex;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  align-items: flex-start;
}
.notice-item:last-child {
  border-bottom: none;
}

.notice-head {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.notice-number {
  width: 45px;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-light);
  font-family: "Inter", sans-serif;
  margin-right: 12px;
  margin-top: -2px;
}

.notice-content {
  flex: 1;
}
.notice-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.notice-text {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.6;
}
.notice-text b {
  color: var(--text-main);
  font-weight: 700;
}

/* ── Buttons ── */
.btn-main {
  display: block;
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 1.1rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  letter-spacing: -0.5px;
}
.btn-main:hover {
  background: var(--primary);
} /* 호버 시 기본색 유지 */
.btn-main:active {
  background: #001f44;
  transform: scale(0.99);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
} /* 누르면 진하게 */
.btn-main:disabled {
  background: var(--border);
  color: var(--text-sub);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Prev button */
.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  text-align: left;
  width: 100%;
}
.btn-back:hover {
  color: var(--primary);
}
.btn-back:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Gender Selection ── */
.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.gender-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}
.gender-card:hover {
  border-color: var(--primary-light);
  background: var(--bg-light);
}
.gender-card.selected {
  border-color: var(--primary);
  background: var(--bg-light);
  box-shadow: 0 0 0 1px var(--primary);
}
.gender-card .gc-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: block;
  margin-top: 8px;
}
.gender-card.selected .gc-label {
  color: var(--primary);
}
.gender-card .gc-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
  display: block;
  margin-top: 2px;
}
.gender-card .gc-line {
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 4px;
  transition: 0.2s;
}
.gender-card.selected .gc-line {
  background: var(--primary);
}

/* ── Question Area ── */
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
}
.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary-light);
  width: 0%;
  transition: width 0.4s ease;
}

.cat-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-light);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}
.q-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 2.5rem;
  letter-spacing: -0.5px;
}

.scale-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scale-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-sub);
  transition: 0.2s;
  text-align: left;
}
.scale-opt:hover {
  border-color: var(--border);
  color: var(--text-sub);
  background: var(--surface);
} /* 호버 시 기본색(변화없음) */
.scale-opt:active {
  transform: scale(0.99);
  background: #f8fafc;
}
.scale-opt.selected {
  border-color: var(--primary);
  background: var(--bg-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--primary);
}

.radio-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: 0.2s;
}
.scale-opt.selected .radio-ring {
  border-color: var(--primary);
}
.scale-opt.selected .radio-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--primary);
  border-radius: 50%;
}

/* ── Screen Result ── */
.score-num {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--primary);
}
.score-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-sub);
}
.risk-tag {
  display: inline-block;
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 10px;
}

/* Result table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 1.25rem;
}
.result-table th {
  border-bottom: 2px solid var(--text-main);
  color: var(--text-main);
  font-weight: 800;
  padding: 10px 6px;
  text-align: center;
}
.result-table td {
  padding: 11px 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-weight: 600;
  text-align: center;
}
.result-table tr:last-child td {
  border-bottom: none;
}
.risk-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
.slide-in-right {
  animation: slideInR 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-in-left {
  animation: slideInL 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-out-left {
  animation: slideOutL 0.2s ease forwards;
}
.slide-out-right {
  animation: slideOutR 0.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInR {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideInL {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideOutL {
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}
@keyframes slideOutR {
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .page-wrap {
    padding: 1.75rem 1.1rem 2rem;
  }
  .survey-title {
    font-size: 1.8rem;
  }
  .notice-item {
    flex-direction: column;
    padding: 1rem 0;
    gap: 6px;
  }
  .notice-number {
    width: auto;
    font-size: 1.1rem;
    margin-right: 0;
    margin-bottom: 2px;
  }
  .q-heading {
    font-size: 1.1rem;
  }
  .scale-opt {
    padding: 0.9rem 1.1rem;
    font-size: 0.92rem;
  }
  .result-table {
    font-size: 0.82rem;
    margin-top: 1rem;
  }
  .result-table td {
    padding: 9px 4px;
  }
  .result-table th {
    padding: 8px 4px;
  }
  .score-num {
    font-size: 2.6rem;
  }
  .logo-wrap {
    width: 100px;
    margin-bottom: 1.5rem;
  }
  #secResult {
    padding-top: 0.5rem !important;
  }
  #resultBlock {
    margin: 1.2rem 0 !important;
  }
}

/* ==================== Stress_Dash.html ==================== */

/* chart-card은 다른 대시보드의 content-card 스타일 유지 */
/* KPI 카드 로딩 전후 크기 고정 */
#stress-view .kpi-card-new .card-body {
  min-height: 100px;
}
.stress-chart-card {
  background: white;
  border-radius: 20px;
  border: 1px solid #eaecf0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 18px 24px;
  height: 300px; /* TBM_Dash.html의 300px 카드와 완전히 일치 */
  display: flex;
  flex-direction: column;
}
.stress-chart-card h6 {
  font-weight: 700;
  color: #334155;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.cat-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.85rem;
  border-collapse: collapse;
}
.cat-table th {
  width: 16.666%;
  background: #f8fafc;
  color: #94a3b8;
  font-weight: 700;
  padding: 8px 3px;
  text-align: center;
  border-bottom: none;
  font-size: 0.75rem;
  position: sticky;
  top: -1px;
  z-index: 10;
  word-break: break-all;
}
.cat-table td {
  padding: 9px 5px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  color: #475569;
  font-weight: 500;
  font-size: 0.8rem;
}
.cat-table td:first-child {
  text-align: center;
  font-weight: 700;
  color: #334155;
}
.cat-table tr:last-child td {
  border-bottom: none;
}

.stress-tab-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: #f1f5f9;
  color: #64748b;
}
.stress-tab-btn.active {
  background: #2563eb;
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.table-container {
  overflow-y: visible;
}

/* ── 문항설정 모달 (AI/Edu 스타일 통일) ── */
#stressQModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
#stressQModal.open {
  display: flex;
}
#stressQModalInner {
  background: white;
  border-radius: 20px;
  width: 1300px;
  max-width: 95vw;
  height: 750px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  animation: stressModalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes stressModalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* 레이더 차트 포인트 레이블 */
.radar-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}
.radar-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
}

/* ==================== TBM.html ==================== */

/* ═══════════════════════════════════════
           TBM Final Design: A Clean + B Interactions
           ═══════════════════════════════════════ */

* {
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eff6ff;
  --primary-50: #f0f6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-medium: #cbd5e1;
  --radius: 16px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

body {
  font-family:
    "Pretendard",
    -apple-system,
    sans-serif;
  background: var(--bg-body);
  margin: 0;
  padding: 0;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

/* ── Progress Bar ── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  width: 0%;
  z-index: 200;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}

/* ── Header ── */
header {
  background: rgba(255, 255, 255, 0.97);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.header-inner {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 5px 10px;
  border-radius: 8px;
}

/* ── Container ── */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 16px;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-card {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 16px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.35);
  min-height: 90px;
}

.info-card::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.info-card::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 160px;
  height: 160px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* Info card inner layout: 2 rows */
.info-inner {
  position: relative;
  z-index: 1;
  padding: 18px 20px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.info-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.info-dept {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.info-time-value {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.info-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0.5) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 4s linear infinite;
}

@keyframes textShimmer {
  0% {
    background-position: 300% center;
  }

  100% {
    background-position: 0% center;
  }
}

.info-weather {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-weather i {
  font-size: 0.7rem;
}

/* ── F6: Load Previous TBM Button ── */
.prev-tbm-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  margin-bottom: 12px;
  background: white;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.25s ease;
}

.prev-tbm-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.prev-tbm-btn:active {
  transform: scale(0.98);
}

.prev-tbm-btn i {
  font-size: 0.8rem;
}

.prev-tbm-btn .prev-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Photo Thumbnail */
.photo-thumb-wrap {
  position: relative;
  display: inline-block;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.photo-thumb-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.photo-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.info-sub {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-top: 4px;
  font-weight: 500;
}

.info-time-label {
  font-size: 0.72rem;
  opacity: 0.6;
  margin-top: 2px;
}

/* ── Notice Card ── */
.notice-card {
  margin-bottom: 12px;
  display: none;
  animation: slideDown 0.3s ease-out;
  border-radius: var(--radius);
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: visible;
  padding: 16px 18px 14px;
  background: #fff;
}
/* 안전보건팀 - amber glow 펄스 */
.notice-safety {
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.08);
  animation:
    slideDown 0.3s ease-out,
    noticePulseAmber 2.4s ease-in-out infinite;
}
/* 생산팀 - green glow 펄스 */
.notice-dept {
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.08);
  animation:
    slideDown 0.3s ease-out,
    noticePulseGreen 2.4s ease-in-out infinite;
}
@keyframes noticePulseAmber {
  0%,
  100% {
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.08);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(245, 158, 11, 0.16),
      0 4px 24px rgba(245, 158, 11, 0.2);
  }
}
@keyframes noticePulseGreen {
  0%,
  100% {
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.08);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(16, 185, 129, 0.16),
      0 4px 24px rgba(16, 185, 129, 0.2);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-bottom: 0;
    padding: 0;
  }
}
.notice-card.dismissing {
  animation: slideUp 0.3s ease-in forwards !important;
  pointer-events: none;
}

.notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.notice-header::before {
  display: none;
}

/* 팀 이름 배지 - 솔리드 스타일 */
.notice-team-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 20px;
  border: none;
}
.notice-safety .notice-team-tag {
  background: #fef3c7;
  color: #92400e;
}
.notice-dept .notice-team-tag {
  background: #d1fae5;
  color: #065f46;
}

/* 확인 버튼 - 프리미엄 pill */
.notice-confirm-btn {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.notice-safety .notice-confirm-btn {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.notice-safety .notice-confirm-btn:hover {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}
.notice-dept .notice-confirm-btn {
  background: #10b981;
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.notice-dept .notice-confirm-btn:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.notice-icon-badge {
  display: none;
}
.notice-title {
  display: none;
}

.notice-content {
  font-size: 0.9rem;
  line-height: 1.7;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  color: var(--text-main);
}

/* ── Section Card ── */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  animation: fadeUp 0.4s ease-out both;
  scroll-margin-top: 72px;
  transition:
    border-color 0.5s ease,
    box-shadow 0.5s ease;
}

.section-card.section-done {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(16, 185, 129, 0.06);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-num {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-num.completed {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow:
    0 0 12px rgba(16, 185, 129, 0.5),
    0 2px 8px rgba(16, 185, 129, 0.3);
  animation: sectionComplete 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.section-num.completed::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.4);
  animation: sectionRipple 0.8s ease-out forwards;
}

@keyframes sectionComplete {
  0% {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.35) rotate(5deg);
    opacity: 1;
  }
  60% {
    transform: scale(0.95) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes sectionRipple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.section-num.optional {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.2);
}

/* ═══ Skeleton Loading ═══ */
.skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-item {
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ═══ Celebration Confetti Overlay ═══ */
.celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* B Style: Worker Count Badge */
.worker-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: auto;
}

/* ── Input ── */
.input-wrapper {
  background: var(--bg-body);
  border-radius: 12px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select,
input[type="text"] {
  width: 100%;
  padding: 14px 0;
  font-size: 0.95rem;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text-main);
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

.input-wrapper::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within::after {
  transform: translateY(-50%) rotate(180deg);
  color: var(--primary);
}

.input-wrapper.no-arrow::after {
  display: none !important;
}

/* ── Textarea ── */
textarea {
  width: 100%;
  padding: 14px;
  font-size: 0.92rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: var(--bg-body);
  resize: none;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.6;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--text-main);
}

textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea::placeholder {
  color: var(--text-muted);
}

/* ── Photo Upload ── */
.file-upload-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.file-upload-btn {
  border: 2px dashed var(--border-color);
  color: var(--text-sub);
  background: var(--bg-body);
  padding: 40px 16px;
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.file-upload-btn i {
  font-size: 1.6rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.file-upload-btn:active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.file-upload-btn:active i {
  color: var(--primary);
}

.file-upload-btn.uploaded {
  display: none;
}

.file-upload-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* ── Signature Area ── */
.worker-card {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-color);
  animation: fadeUp 0.3s ease-out;
}

.worker-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.worker-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  display: inline-block;
}

.signature-wrapper {
  position: relative;
  height: 170px;
  margin-top: 10px;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: all 0.2s ease;
}

.signature-wrapper:focus-within,
.signature-wrapper.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.sig-mask {
  position: absolute;
  inset: 0;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  gap: 6px;
  transition: all 0.15s ease;
}

.sig-mask:active {
  background: var(--primary-light);
}

.sig-mask i {
  font-size: 1.3rem;
  opacity: 0.6;
}

.sig-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.72rem;
  padding: 6px 10px;
  color: var(--text-sub);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: all 0.15s ease;
}

.sig-clear:active {
  background: var(--danger-light);
  color: var(--danger);
}

/* ── Checkbox Items (A card + B round check) ── */
.check-item-card {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-body);
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.check-item-card:last-child {
  margin-bottom: 0;
}

.check-item-card:active {
  transform: scale(0.98);
}

.check-item-card.checked {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

.check-item-card label {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
}

.check-item-card span {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
  flex: 1;
  line-height: 1.4;
}

/* B Style: Round Checkboxes with Bounce */
.dept-check-item,
.worker-check-item {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
  border-radius: 50%;
  border: 2.5px solid #cbd5e1;
  background: white;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dept-check-item:checked,
.worker-check-item:checked {
  border-color: var(--success);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.dept-check-item:checked::after,
.worker-check-item:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  animation: checkBounce 0.3s ease;
}

@keyframes checkBounce {
  0% {
    transform: rotate(45deg) scale(0);
    opacity: 0;
  }

  50% {
    transform: rotate(45deg) scale(1.3);
  }

  100% {
    transform: rotate(45deg) scale(1);
    opacity: 1;
  }
}

/* ── Submit Button (B2: Progress Integrated, Non-sticky) ── */
.bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 4px;
  margin-top: 8px;
}

.save-all-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.3px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.save-all-btn.in-progress {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.save-all-btn.in-progress .btn-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border-radius: 14px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

.save-all-btn .btn-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-all-btn.ready {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%,
  100% {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5);
  }
}

.save-all-btn:active {
  transform: scale(0.98);
}

.save-all-btn:disabled {
  background: var(--border-medium);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  animation: none;
}

/* ── Loading Overlay ── */
#tbm-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 9999;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#tbm-msg {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: scaleIn 0.4s ease-out;
}

.success-icon i {
  font-size: 2.2rem;
  color: var(--success);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 0.88rem;
}

.empty-state i {
  font-size: 1.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 40, 0.92);
  color: white;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  z-index: 1001;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: 88vw;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast.show {
  display: flex;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Required Field Indicators ── */
.field-required {
  border: 1.5px dashed rgba(245, 158, 11, 0.45) !important;
  background: rgba(255, 251, 235, 0.3) !important;
}

.field-error {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
  animation: fieldShake 0.5s ease;
}

@keyframes fieldShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-4px);
  }

  40% {
    transform: translateX(4px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }
}

.section-card.field-error {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
  animation: fieldShake 0.5s ease;
}

/* ═══ [NEW] Step Indicator ═══ */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.step-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  transform: scale(1.3);
}

.step-dot.done {
  background: var(--success);
}

.step-dot::after {
  display: none;
}

.step-dot.active::after {
  display: none;
}

/* ═══ [NEW] Weather Chip ═══ */
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: white;
  font-weight: 600;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.weather-chip i {
  font-size: 0.9rem;
}

/* ═══ [NEW] Photo Preview Card ═══ */
.photo-preview-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
}

.photo-preview-card img {
  width: 100%;
  display: block;
  max-height: 260px;
  object-fit: cover;
}

.photo-preview-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.photo-preview-delete:hover {
  background: var(--danger);
}

.photo-preview-info {
  position: absolute;
  top: auto;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: white;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* ═══ [NEW] Check Confetti ═══ */
.confetti-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10;
}

.confetti-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: confettiBurst 0.6s ease-out forwards;
}

@keyframes confettiBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* ═══ [NEW] Leader Signature Badge ═══ */
.leader-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.92rem;
}

.sig-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-light);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  margin-left: 8px;
  animation: fadeIn 0.3s ease;
}

/* ═══ [NEW] Success Overlay Enhancement ═══ */
.success-overlay-content {
  text-align: center;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 2.2rem;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.35);
  position: relative;
}

.success-checkmark::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(16, 185, 129, 0.3);
  animation: successRipple 1s ease-out;
}

@keyframes successRipple {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.success-summary {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.success-stat {
  text-align: center;
}

.success-stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary);
}

.success-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══ [NEW] History Section ═══ */
.history-section {
  margin-top: 8px;
  margin-bottom: 20px;
}

.history-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.history-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-date-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.history-detail {
  color: var(--text-sub);
}

.history-detail strong {
  color: var(--text-main);
}

.history-attendee {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ═══ [F3] Voice Input Button ═══ */
.voice-input-area {
  position: relative;
}

.voice-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: white;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.voice-btn:active {
  transform: scale(0.92);
}

.voice-btn.recording {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  animation: voicePulse 1.4s infinite;
}

@keyframes voicePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.voice-btn.unsupported {
  display: none;
}

.voice-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--danger);
  font-weight: 600;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.voice-status.active {
  display: flex;
}

.voice-status .voice-dot {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: voicePulse 1.4s infinite;
}

/* ── global-toast — 메인 대시보드와 동일 스타일 ── */
.global-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 99999;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.3s;
  font-family: "Pretendard", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  min-width: 200px;
  max-width: 80vw;
  pointer-events: none;
  line-height: 1.5;
}
.global-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==================== TBM_Dash.html ==================== */

:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  --light-bg: #f8fafc;
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body {
  /* font-family: 'Noto Sans KR', sans-serif; REMOVED to inherit Pretendard */
  background-color: var(--light-bg);
  /* Font removed to inherit global defaults like Edu_Dash */
  padding-bottom: 40px;
}

/* KPI Cards */
.kpi-card {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  height: 100%;
  position: relative;
}

/* KPI Cards - Uses global kpi-card-new from Style.html */

.kpi-icon {
  position: absolute;
  bottom: -10px;
  right: 10px;
  font-size: 3.5rem;
  opacity: 0.25;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.header-pill {
  width: 4px;
  height: 16px;
  background-color: var(--primary-color);
  border-radius: 99px;
}

.team-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 6px;
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.team-card:hover.completed {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.1);
}

.team-status-badge {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.text-sat {
  color: #3b82f6 !important;
  font-weight: 700 !important;
}

.text-sun {
  color: #ef4444 !important;
  font-weight: 700 !important;
}

/* Modal */
.tbm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.tbm-modal-card {
  background: white;
  border-radius: 20px;
  padding: 30px 30px 40px 30px;
  width: 95%;
  max-width: 1150px;
  height: auto;
  min-height: 650px;
  max-height: 96vh;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
}
.tbm-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 1.5rem;
  z-index: 10;
}
.tbm-img-preview {
  width: 100%;
  height: 450px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: block;
  background: #f8fafc;
  cursor: pointer;
}
.tbm-img-preview:hover {
  opacity: 1;
}
.tbm-img-container {
  width: 100%;
  height: 450px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #f8fafc;
  border-radius: 12px;
  overflow: hidden;
}
.team-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-right: 4px;
}
.team-card.completed {
  border: 1px solid #10b981;
  background-color: #f0fdf4;
}
.team-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.team-leader {
  font-size: 0.85rem;
  color: #64748b;
  margin-left: 8px;
  font-weight: normal;
}
.team-card.completed .team-name {
  color: #14532d;
}

/* ★ 사진 있는 카드 표시 (초록점) */
.team-card {
  position: relative;
}
.team-card[data-photo-url]::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  border: 1.5px solid white;
}
/* Body 레벨 사진 프리뷰 */
#tbm-photo-preview {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 315px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  border: 3px solid white;
  z-index: 99999;
  pointer-events: none;
  background: #f1f5f9;
}
#tbm-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#tbm-photo-preview.visible {
  display: block;
  animation: photoFadeIn 0.12s ease;
}
@keyframes photoFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.tbm-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tbm-info-label i {
  color: #2563eb;
  font-size: 0.8rem;
}
.tbm-info-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 10px;
  line-height: 1.5;
  color: #1e293b;
}
.tbm-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

/* TBM Horizontal Liquid Tank (inherited from Edu_Dash) */
.tbm-liq-tank-hz {
  height: 32px;
  background: #f1f5f9;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}
.tbm-liq-fill-hz {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tbm-liq-solid-hz {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
.tbm-liq-wave-hz {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 14px;
  height: 300%;
  margin-left: -5px;
  z-index: 3;
  background-size: 100% 33.333%;
  animation: tbmLiqSlideHz 1.5s infinite linear;
}
.tbm-liq-wave-hz-back {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 18px;
  height: 300%;
  margin-left: -8px;
  z-index: 1;
  background-size: 100% 33.333%;
  animation: tbmLiqSlideHz 2.2s infinite linear reverse;
  opacity: 0.6;
}
.tbm-liq-shimmer {
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 30%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.35),
    transparent
  );
  pointer-events: none;
  z-index: 5;
  animation: tbmShimmerSweep 5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  mix-blend-mode: lighten;
}
@keyframes tbmLiqSlideHz {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-33.333%);
  }
}
@keyframes tbmShimmerSweep {
  0% {
    transform: translateX(-150%) skewX(-15deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  60% {
    transform: translateX(300%) skewX(-15deg);
    opacity: 1;
  }
  100% {
    transform: translateX(300%) skewX(-15deg);
    opacity: 0;
  }
}

/* SVG Wave CSS Classes for TBM */
.tbm-wave-purple {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%237c3aed'/%3E%3C/svg%3E");
}
.tbm-wave-purple-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23a78bfa'/%3E%3C/svg%3E");
}
.tbm-wave-amber {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23d97706'/%3E%3C/svg%3E");
}
.tbm-wave-amber-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23fbbf24'/%3E%3C/svg%3E");
}

/* ===== Premium Calendar ===== */
.tbm-cal-header-row {
  display: none;
}
.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 0px;
  row-gap: 0px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  height: 100%;
}
.tbm-cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  cursor: pointer;
  padding: 2px 1px;
  border-radius: 6px;
  transition: all 0.15s ease;
  position: relative;
}
.tbm-cal-day:hover {
  background-color: #f1f5f9;
  transform: scale(1.05);
}
.tbm-cal-day.active-day-bg {
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}
/* 날짜 숫자 */
.tbm-date-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.tbm-date-text.status-done {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}
.tbm-date-text.status-partial {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white !important;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}
.tbm-date-text.status-missed {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white !important;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.25);
}
.cal-legend {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 4px 0 0;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}
.cal-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

/* ★ 인쇄 시 테이블만 표시 */
@media print {
  body * {
    visibility: hidden !important;
  }
  #tbm-print-area,
  #tbm-print-area * {
    visibility: visible !important;
  }
  #tbm-print-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
  }
  #tbm-print-area table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
  }
  #tbm-print-area th,
  #tbm-print-area td {
    border: 1px solid #555;
    padding: 3px 4px;
    text-align: center;
  }
  #tbm-print-area th {
    background: #d1d5db !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
  }
  #tbm-print-area h2 {
    text-align: center;
    margin: 8px 0;
    font-size: 14px;
  }
}

" +
            "@page {
  margin: 0;
}
" +
            "body {
  font-family: "Malgun Gothic", sans-serif;
  margin: 0;
  padding: 10mm 15mm;
}
" +
            "h2 {
  text-align: center;
  font-size: 14px;
  margin: 8px 0 12px;
}
" +
            "table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}
" +
            "th,
td {
  border: 1px solid #555;
  padding: 3px 4px;
  text-align: center;
}
" +
            "th {
  background: #d1d5db;
  font-weight: 700;
}
' +
            '

/* ==================== Template_Dash.html ==================== */

    /* ── Template Dash — 리스트 및 인라인 폼 스타일 (파란색 테마) ── */

    /* 게시판 툴바 */
    .tmpl-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 8px;
}
.tmpl-board-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tmpl-board-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto; /* 우측 정렬 유지 */
}
.tmpl-total-count {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}
.tmpl-total-count span {
  color: #2563eb;
  font-weight: 800;
}

/* 검색창 */
.tmpl-search-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
}
.tmpl-search-wrap:focus-within {
  border-color: #3b82f6;
}
.tmpl-search-input {
  border: none;
  outline: none;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  color: #1e293b;
  width: 200px;
  background: transparent;
}
.tmpl-search-btn {
  background: none;
  border: none;
  padding: 7px 10px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.tmpl-search-btn:hover {
  color: #2563eb;
}

/* 글쓰기 버튼 */
.tmpl-write-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.tmpl-write-btn.icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tmpl-write-btn:hover {
  opacity: 0.88;
}
/* 게시판 테이블 - 프리미엄 세련된 UI */
.tmpl-table-wrap {
  overflow-x: auto;
  background: #fff;
}
.tmpl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tmpl-table thead th {
  background: #1e293b;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
  border-bottom: none;
  border-right: none;
  white-space: nowrap;
}
.tmpl-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff !important;
  transition: all 0.2s ease-in-out;
  height: 60px;
}
.tmpl-table tbody tr:nth-child(even),
.tmpl-table tbody tr:nth-child(odd) {
  background-color: #ffffff !important;
}
.tmpl-table tbody tr:hover {
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.tmpl-table tbody tr:last-child {
  border-bottom: none;
}
.tmpl-table td {
  padding: 6px 12px;
  color: #1e293b;
  text-align: center;
  vertical-align: middle;
  border-right: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmpl-table td:last-child {
  border-right: none;
}
.tmpl-table td.td-title {
  text-align: left;
}
.tmpl-title-text {
  font-weight: 800;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
  font-size: 0.9rem;
}
.tmpl-title-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.tmpl-td-no {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 700;
  min-width: 50px;
}
.tmpl-td-author {
  font-size: 0.85rem;
  color: #475569;
  min-width: 80px;
  font-weight: 500;
}
.tmpl-td-date {
  font-size: 0.82rem;
  color: #94a3b8;
  white-space: nowrap;
  min-width: 100px;
}
.tmpl-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.tmpl-dl-btn:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* 빈 상태 / 데이터 없음 */
.tmpl-empty-row td {
  height: 350px !important;
  text-align: center !important;
  color: #94a3b8;
  vertical-align: middle;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.tmpl-empty-row:hover {
  background: transparent !important;
}
.tmpl-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
  color: #cbd5e1;
}

/* 체크박스 디자인 */
.tmpl-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ef4444;
  margin-top: 2px;
}

/* 삭제 모드 버튼 */
.tmpl-del-btn-multi {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
  margin-right: 6px;
}
.tmpl-del-btn-multi:hover {
  opacity: 0.88;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* 하단 정보 및 페이지네이션 */
.tmpl-bottom-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px;
  margin-top: auto;
  gap: 10px;
}
/* 타이틀/검색 등 왼쪽 그룹 */
.tmpl-bottom-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
/* 가운데 페이지네이션 */
.tmpl-bottom-mid {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 오른쪽 버튼/검색바 그룹 */
.tmpl-bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.tmpl-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.tmpl-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.tmpl-page-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}
.tmpl-page-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}
.tmpl-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #e2e8f0;
  color: #94a3b8;
  background: #fff;
}

/* ── 글쓰기 섹션 (인라인) ── */
.tmpl-upload-section {
  background: #fafaf9;
  border-bottom: 1px solid #f1f5f9;
  padding: 20px 24px;
  display: none;
}
.tmpl-upload-section.open {
  display: block;
}

.tmpl-form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tmpl-form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.tmpl-form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tmpl-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 14px;
}
.tmpl-dropzone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.tmpl-drop-icon {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}
.tmpl-drop-text {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 4px;
}
.tmpl-drop-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.tmpl-file-preview {
  display: none;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.tmpl-file-icon {
  font-size: 1.5rem;
  color: #ef4444;
}
.tmpl-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  word-break: break-all;
}
.tmpl-file-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}
.tmpl-file-remove:hover {
  color: #ef4444;
}

.tmpl-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.tmpl-btn-cancel {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.tmpl-btn-cancel:hover {
  background: #e2e8f0;
}

@media (max-width: 640px) {
  .tmpl-table thead th.th-hide-mobile,
  .tmpl-table td.td-hide-mobile {
    display: none;
  }
  .tmpl-search-input {
    width: 140px;
  }
}

/* ==================== Vendor_Dash.html ==================== */

/* ── Vendor Dash ── */
.vendor-container {
  padding: 0;
}

/* 페이지 헤더 */
.vendor-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.vendor-page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vendor-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.vendor-page-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}
.vendor-page-header p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 2px 0 0;
}

/* 글쓰기 버튼 */
.vendor-write-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
  transition:
    opacity 0.15s,
    transform 0.1s;
  white-space: nowrap;
}
.vendor-write-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* 게시글 목록 툴바 */
.vendor-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.vendor-list-toolbar h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vendor-refresh-btn {
  background: none;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.vendor-refresh-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* 게시글 카드 */
.vendor-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vendor-post-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.15s,
    transform 0.15s,
    border-color 0.15s;
}
.vendor-post-card:hover {
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
  border-color: #bfdbfe;
}
.vendor-post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 10px;
}
.vendor-post-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}
.vendor-post-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.vendor-badge-co {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  white-space: nowrap;
}
.vendor-badge-dept {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #16a34a;
  white-space: nowrap;
}
.vendor-post-date {
  font-size: 0.73rem;
  color: #94a3b8;
  white-space: nowrap;
}
.vendor-post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
}
.vendor-meta-item {
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
}
.vendor-meta-item i {
  color: #94a3b8;
  font-size: 0.75rem;
}
.vendor-meta-item strong {
  color: #1e293b;
  font-weight: 700;
}
.vendor-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 4px;
}
.vendor-pdf-link:hover {
  background: #fee2e2;
}

/* Empty / Loading */
.vendor-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.vendor-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.vendor-loading {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
}

/* 게시판 테이블 - 프리미엄 세련된 UI (서식자료 일치) */
.vendor-table-wrap {
  overflow-x: auto;
  background: #fff;
}
.vendor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.vendor-table thead th {
  background: #1e293b;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
  border-bottom: none;
  border-right: none;
  white-space: nowrap;
}
.vendor-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff !important;
  transition: all 0.2s ease-in-out;
  height: 50px;
}
.vendor-table tbody tr:nth-child(even),
.vendor-table tbody tr:nth-child(odd) {
  background-color: #ffffff !important;
}
.vendor-table tbody tr:hover {
  background: #f0f9ff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.vendor-table tbody tr:last-child {
  border-bottom: none;
}
.vendor-table td {
  padding: 6px 12px;
  color: #1e293b;
  text-align: center;
  vertical-align: middle;
  border-right: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 버튼 공통 스타일 (서식자료 일치) */
.vendor-write-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.vendor-write-btn.icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vendor-write-btn:hover {
  opacity: 0.88;
}

.vendor-del-btn-multi {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
  margin-right: 6px;
}
.vendor-del-btn-multi:hover {
  opacity: 0.88;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ── 툴바 ── */
.vendor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  justify-content: center;
  align-items: center;
}
.vendor-modal-overlay.open {
  display: flex;
}
.vendor-modal-card {
  background: white;
  border-radius: 20px;
  width: 1000px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: vendorModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes vendorModalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.vendor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  flex-shrink: 0;
}
.vendor-modal-title {
  margin: 0;
  font-weight: 800;
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vendor-modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #fff;
}
.vendor-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.vendor-modal-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.vendor-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.vendor-modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.vendor-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.vendor-field-row .vendor-field {
  margin-bottom: 0;
}
.vendor-field {
  margin-bottom: 0;
}
/* PDF 업로드 영역 */
.vendor-file-drop {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  background: #f8fafc;
  margin-bottom: 14px;
}
.vendor-file-drop:hover,
.vendor-file-drop.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}
.vendor-file-drop i {
  font-size: 1.8rem;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}
.vendor-file-drop p {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
}
.vendor-file-drop small {
  font-size: 0.75rem;
  color: #94a3b8;
}
.vendor-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #dc2626;
  font-weight: 600;
  margin-bottom: 14px;
}
.vendor-file-preview i {
  font-size: 1rem;
  flex-shrink: 0;
}
.vendor-file-remove {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.6;
  font-size: 0.9rem;
  padding: 2px 4px;
}
.vendor-file-remove:hover {
  opacity: 1;
}
/* 제출 버튼 */
.vendor-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.vendor-btn-cancel {
  background: white;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.vendor-btn-cancel:hover {
  background: #f1f5f9;
}
.vendor-btn-submit {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.15s;
}
.vendor-btn-submit:hover {
  opacity: 0.88;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.vendor-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==== Stress Survey Styles ==== */

:root {
  --primary: #002b5e; /* HI AIR KOREA Deep Blue */
  --primary-light: #2563eb;
  --surface: #ffffff;
  --text-main: #1e293b;
  --text-sub: #64748b;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family:
    "Noto Sans KR",
    "Inter",
    -apple-system,
    sans-serif;
  background: var(--surface);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Header / Logo ── */
.survey-header {
  text-align: left;
  margin-bottom: 2rem;
  width: 100%;
}
.logo-wrap {
  width: 130px;
  margin-bottom: 2.5rem;
}
.logo-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.survey-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.survey-subtitle {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ── Minimalist Notice List ── */
.notice-list {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--primary);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.notice-item {
  display: flex;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  align-items: flex-start;
}
.notice-item:last-child {
  border-bottom: none;
}

.notice-head {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.notice-number {
  width: 45px;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-light);
  font-family: "Inter", sans-serif;
  margin-right: 12px;
  margin-top: -2px;
}

.notice-content {
  flex: 1;
}
.notice-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.notice-text {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.6;
}
.notice-text b {
  color: var(--text-main);
  font-weight: 700;
}

/* ── Buttons ── */
.btn-main {
  display: block;
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 1.1rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  letter-spacing: -0.5px;
}
.btn-main:hover {
  background: var(--primary);
} /* 호버 시 기본색 유지 */
.btn-main:active {
  background: #001f44;
  transform: scale(0.99);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
} /* 누르면 진하게 */
.btn-main:disabled {
  background: var(--border);
  color: var(--text-sub);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Prev button */
.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  text-align: left;
  width: 100%;
}
.btn-back:hover {
  color: var(--primary);
}
.btn-back:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Gender Selection ── */
.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.gender-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}
.gender-card:hover {
  border-color: var(--primary-light);
  background: var(--bg-light);
}
.gender-card.selected {
  border-color: var(--primary);
  background: var(--bg-light);
  box-shadow: 0 0 0 1px var(--primary);
}
.gender-card .gc-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: block;
  margin-top: 8px;
}
.gender-card.selected .gc-label {
  color: var(--primary);
}
.gender-card .gc-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
  display: block;
  margin-top: 2px;
}
.gender-card .gc-line {
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 4px;
  transition: 0.2s;
}
.gender-card.selected .gc-line {
  background: var(--primary);
}

/* ── Question Area ── */
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
}
.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary-light);
  width: 0%;
  transition: width 0.4s ease;
}

.cat-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-light);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}
.q-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 2.5rem;
  letter-spacing: -0.5px;
}

.scale-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scale-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-sub);
  transition: 0.2s;
  text-align: left;
}
.scale-opt:hover {
  border-color: var(--border);
  color: var(--text-sub);
  background: var(--surface);
} /* 호버 시 기본색(변화없음) */
.scale-opt:active {
  transform: scale(0.99);
  background: #f8fafc;
}
.scale-opt.selected {
  border-color: var(--primary);
  background: var(--bg-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--primary);
}

.radio-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: 0.2s;
}
.scale-opt.selected .radio-ring {
  border-color: var(--primary);
}
.scale-opt.selected .radio-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--primary);
  border-radius: 50%;
}

/* ── Screen Result ── */
.score-num {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--primary);
}
.score-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-sub);
}
.risk-tag {
  display: inline-block;
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 10px;
}

/* Result table */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 1.25rem;
}
.result-table th {
  border-bottom: 2px solid var(--text-main);
  color: var(--text-main);
  font-weight: 800;
  padding: 10px 6px;
  text-align: center;
}
.result-table td {
  padding: 11px 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-weight: 600;
  text-align: center;
}
.result-table tr:last-child td {
  border-bottom: none;
}
.risk-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
.slide-in-right {
  animation: slideInR 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-in-left {
  animation: slideInL 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-out-left {
  animation: slideOutL 0.2s ease forwards;
}
.slide-out-right {
  animation: slideOutR 0.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInR {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideInL {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideOutL {
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}
@keyframes slideOutR {
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .page-wrap {
    padding: 1.75rem 1.1rem 2rem;
  }
  .survey-title {
    font-size: 1.8rem;
  }
  .notice-item {
    flex-direction: column;
    padding: 1rem 0;
    gap: 6px;
  }
  .notice-number {
    width: auto;
    font-size: 1.1rem;
    margin-right: 0;
    margin-bottom: 2px;
  }
  .q-heading {
    font-size: 1.1rem;
  }
  .scale-opt {
    padding: 0.9rem 1.1rem;
    font-size: 0.92rem;
  }
  .result-table {
    font-size: 0.82rem;
    margin-top: 1rem;
  }
  .result-table td {
    padding: 9px 4px;
  }
  .result-table th {
    padding: 8px 4px;
  }
  .score-num {
    font-size: 2.6rem;
  }
  .logo-wrap {
    width: 100px;
    margin-bottom: 1.5rem;
  }
  #secResult {
    padding-top: 0.5rem !important;
  }
  #resultBlock {
    margin: 1.2rem 0 !important;
  }
}

/* ==== c:\D back\20230216 D back\이호성\작업중\GAS\gas_project\AI.html Styles ==== */

:root {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-ai: #f8fafd;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --border: #e2e8f0;
  --input-bg: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(145deg, #1e3a5f 0%, #0f2240 40%, #162032 100%);
  font-family:
    "Inter",
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* 메인 컨테이너 */
.chat-app {
  width: 100%;
  max-width: 500px;
  /* Reverted to 500px */
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .chat-app {
    height: 85vh;
    /* Adjusted height */
    max-height: 900px;
    max-width: 1200px;
    /* Widen for tables */
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
  }
}

/* 헤더 */
.chat-header {
  background: linear-gradient(135deg, #0f2240 0%, #1a3a6e 100%);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  /* Clip zoomed image */
  /* [Fix] Padding instead of transform for cleaner rendering */
  padding: 4px 4px 0px 4px;
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Transform removed */
  filter: contrast(1.15) saturate(1.1);
  /* [UX] Sharpen image */
}

.bot-info h1 {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* 드롭다운 메뉴 */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 70px;
  right: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  min-width: 180px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item i {
  color: var(--accent);
  width: 18px;
}

/* 채팅 영역 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #f8fafd 0%, #ffffff 100%);
  position: relative;
  z-index: 1;
}

/* 스크롤바 세련화 */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.chat-messages::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background-image: url("https://lh3.googleusercontent.com/d/1acvybrygscssOAHamXpOoQFcXZhtpiVV");
  background-repeat: no-repeat;
  background-position: center 65%;
  background-size: 78%;
  opacity: 0.2;
  mix-blend-mode: multiply;
  z-index: -1;
  pointer-events: none;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 90%;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  overflow: hidden;
  /* Clip zoomed image */
  /* [Fix] Padding for cleaner rendering */
  padding: 3px 3px 0px 3px;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Transform removed */
  filter: contrast(1.15) saturate(1.1);
  /* [UX] Sharpen image */
}

.message.user .message-avatar {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.message-avatar i {
  color: #fff;
  font-size: 14px;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-bubble {
  padding: 13px 17px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  position: relative;
  transition: all 0.2s;
  letter-spacing: -0.1px;
}

.message.ai .message-bubble {
  background: #ffffff;
  color: var(--text-primary);
  border-radius: 4px 18px 18px 18px;
  box-shadow:
    0 2px 10px rgba(15, 34, 64, 0.07),
    0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid #edf2f7;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  border-radius: 18px 4px 18px 18px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.message-time {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0 4px;
}

.message.user .message-time {
  text-align: right;
}

/* AI 메시지 스타일 */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.message-bubble strong {
  color: var(--text-primary);
  background: linear-gradient(180deg, transparent 60%, #fef08a 60%);
}

/* Markdown Styles for Marked.js */
.message-bubble ul,
.message-bubble ol {
  margin: 8px 0 8px 24px;
  /* Indent lists */
  padding: 0;
  list-style-position: outside;
  /* Ensure bullets show */
}

.message-bubble ul {
  list-style-type: disc;
  /* Force dots */
}

.message-bubble ol {
  list-style-type: decimal;
}

.message-bubble li {
  margin-bottom: 4px;
}

.message-bubble p {
  margin: 0 0 8px 0;
  /* Paragraph spacing */
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

/* Law Title Link Styling */
.law-title {
  color: #2563eb !important;
  font-weight: 600 !important;
  font-family: "Inter", "Pretendard", sans-serif !important;
  background: none !important;
  padding: 0 !important;
  display: inline !important;
  margin: 0 !important;
  cursor: pointer;
  transition: all 0.15s;
  border: none !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(37, 99, 235, 0.4) !important;
}

.law-title:hover {
  text-decoration-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.06) !important;
  border-radius: 3px !important;
  padding: 1px 3px !important;
  margin: 0 -3px !important;
}

/* === Premium Safety Theme Design === */

/* 1. Highlight (Yellow Marker) */
.message-bubble strong {
  color: #1e293b;
  font-weight: 700;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(253, 224, 71, 0.5) 50%
  );
  padding: 0 2px;
  border-radius: 2px;
}

/* Remove top margin from first element in bubble for cleaner look */
.message-bubble > :first-child {
  margin-top: 0 !important;
}

/* 2. Headers (Trust Navy & Emerald) */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  color: #0f172a;
  font-size: 15px !important;
  font-weight: 700;
  margin: 16px 0 8px 0;
  padding: 0 0 4px 0;
  display: inline-block;
  border-bottom: 3px solid rgba(16, 185, 129, 0.4);
  letter-spacing: -0.2px;
}

/* 3. List Item Bullets (Emerald) */
.message-bubble ul,
.message-bubble ol {
  list-style: none;
  padding-left: 5px;
  margin: 10px 0;
}

.message-bubble li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  line-height: 1.7;
}

.message-bubble ul li::before {
  content: "•";
  color: #10b981;
  font-weight: 800;
  position: absolute;
  left: 0;
  top: -1px;
  font-size: 1.2em;
}

.message-bubble p {
  margin: 0 0 12px;
  line-height: 1.65;
  color: #334155;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

/* 4. Blockquote (Reference / Quote Box) */
.message-bubble blockquote {
  border-left: 4px solid #10b981;
  background: #f8fafc;
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 0 8px 8px 0;
  color: #475569;
  font-size: 0.95em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.message-bubble blockquote p:last-child {
  margin-bottom: 0;
}

/* 5. Inline Code / Tags */
.message-bubble code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "Inter", monospace;
  font-size: 0.9em;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* 4. Tables */
.message-bubble table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}

.message-bubble th,
.message-bubble td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.message-bubble th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e40af;
}

.message-bubble tr:last-child td {
  border-bottom: none;
}

/* 퀵 버튼 (Scrollable Row) */
.quick-actions {
  display: flex;
  /* Flex instead of Grid */
  overflow-x: auto;
  gap: 8px;
  margin-top: 4px;
  /* Reduced top margin since label is added */
  width: 100%;
  padding: 4px 4px 8px 4px;
  /* Added padding to prevent hover clipping */
  scrollbar-width: none;
  /* Firefox */
}

.quick-actions::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.quick-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.15);
}

/* 로딩 애니메이션 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: 6px 18px 18px 18px;
  box-shadow: var(--shadow);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.typing-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 입력 영역 */
.chat-input-area {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #edf2f7;
  flex-shrink: 0;
}

.input-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 28px;
  padding: 6px 8px 6px 18px;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-container:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: #ffffff;
}

.input-container textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  padding: 8px 0;
}

.input-container textarea::placeholder {
  color: var(--text-secondary);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.input-btn:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.input-btn.active {
  color: var(--accent);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 17px;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.send-btn.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.send-btn.active:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

/* 파일 인디케이터 */
.file-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fef3c7;
  border-radius: 20px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #92400e;
}

.file-indicator.show {
  display: flex;
}

.file-indicator .remove {
  cursor: pointer;
  margin-left: auto;
}

/* 자동완성 */
.autocomplete {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
  z-index: 50;
}

.autocomplete.show {
  display: block;
}

.autocomplete-item {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f3f4f6;
}

.autocomplete-item i {
  color: var(--accent);
  font-size: 12px;
}

/* 토스트 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 14px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  /* Force single line */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 모달 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  width: 90%;
  max-width: 320px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  font-size: 24px;
  cursor: pointer;
  opacity: 0.8;
}

.modal-close:hover {
  opacity: 1;
}

.contact-list {
  list-style: none;
}

.contact-item {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-name {
  font-weight: 600;
  color: var(--text-primary);
}

.call-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* 재시도 버튼 */
.retry-btn {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.retry-btn:hover {
  background: #fee2e2;
}

/* 스크롤바 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* Feedback UI */
.feedback-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  justify-content: flex-end;
}

.feedback-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
}

/* [Fix] Reduced Top Margin for Bubbles */
.message-bubble > :first-child {
  margin-top: 0 !important;
}

.feedback-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}
.feedback-btn.fb-good:hover {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}
.feedback-btn.fb-bad:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.feedback-btn.active {
  color: var(--accent);
  background: #eff6ff;
  font-weight: 600;
}

/* 상세 보기 버튼 shimmer */
.detail-btn {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #eef2ff 100%);
  color: #4f46e5 !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  position: relative;
  overflow: hidden;
}
.detail-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: detailShimmer 2.5s ease-in-out infinite;
}
@keyframes detailShimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 150%;
  }
  100% {
    left: 150%;
  }
}
.detail-btn:hover {
  background: linear-gradient(
    135deg,
    #e0e7ff 0%,
    #c7d2fe 50%,
    #e0e7ff 100%
  ) !important;
  color: #4338ca !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ==== c:\D back\20230216 D back\이호성\작업중\GAS\gas_project\AI_Dash.html Styles ==== */

/* AI Dashboard Scoped Styles */
:root {
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --primary-color: #3b82f6;
  --text-dark: #1e293b;
  --text-gray: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 16px;
}

/* Removed body selector to avoid global conflict */
.ai-dash-container {
  /* font-family: 'Pretendard', sans-serif; */
  background-color: var(--bg-color);
  color: var(--text-dark);
  max-width: 100%;
  padding: 0;
}

/* Adjusted container class */
.ai-dash-inner-container {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

/* 헤더 스타일 */

.header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title i {
  color: var(--primary-color);
  font-size: 26px;
}

.refresh-btn {
  background-color: var(--bg-color);
  color: var(--text-gray);
  border: 1px solid #e2e8f0;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-dark);
}

.refresh-btn.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* 통계 카드 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border-left: 5px solid transparent;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 카드별 포인트 컬러 */
.stat-card.blue {
  border-left-color: var(--primary-color);
}

.stat-card.blue .stat-icon-bg {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.stat-card.green {
  border-left-color: var(--success);
}

.stat-card.green .stat-icon-bg {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card.orange {
  border-left-color: var(--warning);
}

.stat-card.orange .stat-icon-bg {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-card.purple {
  border-left-color: var(--purple);
}

.stat-card.purple .stat-icon-bg {
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 5px;
}

.stat-icon-bg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

.stat-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 5px;
}

/* 차트 섹션 */
.section-card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-container {
  height: 300px;
  width: 100%;
}

/* 테이블 섹션 */
table.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
  margin-top: 10px !important;
}

table.dataTable thead th {
  background-color: #f8fafc !important;
  color: var(--text-gray) !important;
  font-weight: 700 !important;
  font-size: 13px;
  border-bottom: 2px solid #e2e8f0 !important;
  padding: 12px 15px !important;
}

table.dataTable tbody td {
  padding: 14px 15px !important;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

table.dataTable tbody tr:hover {
  background-color: #f8fafc !important;
  cursor: pointer;
}

/* 비용 배지 (알약 모양) */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-cheap {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-normal {
  background-color: #fff7ed;
  color: #c2410c;
}

/* 로딩 및 에러 */
#loading {
  text-align: center;
  padding: 60px;
  color: var(--text-gray);
}

.error-box {
  background: #fef2f2;
  color: #dc2626;
  padding: 15px;
  border-radius: 10px;
  font-weight: 500;
}

/* 모달 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  width: 600px;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.modal-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
}

.close-btn {
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
}

.close-btn:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
}

.detail-box {
  background: #f8fafc;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.detail-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
  display: block;
}

.detail-text {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
}

/* 말줄임표 처리 */
.text-truncate {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table Header Center Align Force */
table.dataTable thead th,
table.dataTable thead td {
  text-align: center !important;
}

/* Podium Styles */
.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  justify-content: center;
  gap: 80px;
  height: 80px;
  width: 100%;
  padding-bottom: 5px;
}

.podium-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  transition: transform 0.3s ease;
}

.podium-column:hover {
  transform: translateY(-5px);
}

.podium-bar {
  width: 70px;
  border-radius: 12px 12px 4px 4px;
  display: flex;
  align-items: flex-start;
  /* Score at top */
  justify-content: center;
  padding-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: white;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

/* Glass Shine Effect */
.podium-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.podium-label {
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
  text-align: center;
  max-width: 110px;
  /* Increased width */
  white-space: normal;
  /* Allow wrapping */
  word-break: keep-all;
  /* Prevent breaking in middle of words */
  line-height: 1.25;
}

.podium-score {
  font-size: 0.9rem;
  z-index: 1;
}

.podium-avatar,
.podium-crown {
  font-size: 1.8rem;
  margin-bottom: 5px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: float 3s ease-in-out infinite;
}

.podium-crown {
  font-size: 2.2rem;
  animation-delay: 0.5s;
}

/* Ranks */
.rank-1 .podium-bar {
  height: 60px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  /* Gold */
}

.rank-1 {
  z-index: 3;
}

.rank-2 .podium-bar {
  height: 45px;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  /* Silver */
}

.rank-2 {
  z-index: 2;
}

.rank-3 .podium-bar {
  height: 35px;
  background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
  /* Bronze */
}

.rank-3 {
  z-index: 1;
}

/* Float Animation */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* AI Keyword Ranking - Liquid Tank Bars */
.ai-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 8px;
  height: 100%;
  justify-content: center;
}
.ai-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-rank-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.ai-rank-num.r1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.ai-rank-num.r2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}
.ai-rank-num.r3 {
  background: linear-gradient(135deg, #fb923c, #ea580c);
}
.ai-rank-num.r4 {
  background: #cbd5e1;
  color: #475569;
}
.ai-rank-num.r5 {
  background: #e2e8f0;
  color: #64748b;
}
.ai-rank-label {
  width: 72px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.ai-rank-val {
  width: 42px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* AI Liquid Tank horizontal */
.ai-liq-tank-hz {
  height: 26px;
  background: #f1f5f9;
  border-radius: 13px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  flex: 1;
}
.ai-liq-fill-hz {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-liq-solid-hz {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
.ai-liq-wave-hz {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 12px;
  height: 300%;
  margin-left: -4px;
  z-index: 3;
  background-size: 100% 33.333%;
  animation: aiLiqSlide 1.5s infinite linear;
}
.ai-liq-wave-hz-back {
  position: absolute;
  top: -100%;
  left: 100%;
  width: 16px;
  height: 300%;
  margin-left: -7px;
  z-index: 1;
  background-size: 100% 33.333%;
  animation: aiLiqSlide 2.2s infinite linear reverse;
  opacity: 0.6;
}
@keyframes aiLiqSlide {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-33.333%);
  }
}
/* Wave color classes */
.ai-wave-blue {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%233b82f6'/%3E%3C/svg%3E");
}
.ai-wave-blue-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%2360a5fa'/%3E%3C/svg%3E");
}
.ai-wave-indigo {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%234f46e5'/%3E%3C/svg%3E");
}
.ai-wave-indigo-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23818cf8'/%3E%3C/svg%3E");
}
.ai-wave-emerald {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%2310b981'/%3E%3C/svg%3E");
}
.ai-wave-emerald-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%2334d399'/%3E%3C/svg%3E");
}
.ai-wave-amber {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23d97706'/%3E%3C/svg%3E");
}
.ai-wave-amber-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23fbbf24'/%3E%3C/svg%3E");
}
.ai-wave-rose {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23f43f5e'/%3E%3C/svg%3E");
}
.ai-wave-rose-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23fb7185'/%3E%3C/svg%3E");
}
.ai-wave-purple {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%238b5cf6'/%3E%3C/svg%3E");
}
.ai-wave-purple-back {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 100' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M5,0 C12,25 -2,75 5,100 L0,100 L0,0 Z' fill='%23c4b5fd'/%3E%3C/svg%3E");
}

/* Daily Trend CSS Mini Bars (Simple) */
.ai-trend-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  padding: 12px 10px 40px;
  position: relative;
}
.ai-trend-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.ai-trend-bar {
  width: 100%;
  max-width: 12px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #3b82f6, #60a5fa);
  transition: height 0s;
  min-height: 0;
  position: relative;
}
.ai-trend-bar.empty {
  background: transparent;
}

.ai-trend-val {
  font-size: 0.65rem;
  color: #3b82f6;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0s;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}
.ai-trend-val.show {
  opacity: 1;
}

.ai-trend-day {
  font-size: 0.55rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1;
  position: absolute;
  bottom: -20px;
}

/* Global Background Fix */
.ai-dash-container {
  background-color: transparent !important;
}

/* ==== Template_Dash.html Styles ==== */

/* ── Template Dash — 리스트 및 인라인 폼 스타일 (파란색 테마) ── */

/* 게시판 툴바 */
.tmpl-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 8px;
}
.tmpl-board-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tmpl-board-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto; /* 우측 정렬 유지 */
}
.tmpl-total-count {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}
.tmpl-total-count span {
  color: #2563eb;
  font-weight: 800;
}

/* 검색창 */
.tmpl-search-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
}
.tmpl-search-wrap:focus-within {
  border-color: #3b82f6;
}
.tmpl-search-input {
  border: none;
  outline: none;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  color: #1e293b;
  width: 200px;
  background: transparent;
}
.tmpl-search-btn {
  background: none;
  border: none;
  padding: 7px 10px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.tmpl-search-btn:hover {
  color: #2563eb;
}

/* 글쓰기 버튼 */
.tmpl-write-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.tmpl-write-btn.icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tmpl-write-btn:hover {
  opacity: 0.88;
}
/* 게시판 테이블 - 프리미엄 세련된 UI */
.tmpl-table-wrap {
  overflow-x: auto;
  background: #fff;
}
.tmpl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tmpl-table thead th {
  background: #1e293b;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
  border-bottom: none;
  border-right: none;
  white-space: nowrap;
}
.tmpl-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff !important;
  transition: all 0.2s ease-in-out;
  height: 60px;
}
.tmpl-table tbody tr:nth-child(even),
.tmpl-table tbody tr:nth-child(odd) {
  background-color: #ffffff !important;
}
.tmpl-table tbody tr:hover {
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.tmpl-table tbody tr:last-child {
  border-bottom: none;
}
.tmpl-table td {
  padding: 6px 12px;
  color: #1e293b;
  text-align: center;
  vertical-align: middle;
  border-right: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmpl-table td:last-child {
  border-right: none;
}
.tmpl-table td.td-title {
  text-align: left;
}
.tmpl-title-text {
  font-weight: 800;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
  font-size: 0.9rem;
}
.tmpl-title-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.tmpl-td-no {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 700;
  min-width: 50px;
}
.tmpl-td-author {
  font-size: 0.85rem;
  color: #475569;
  min-width: 80px;
  font-weight: 500;
}
.tmpl-td-date {
  font-size: 0.82rem;
  color: #94a3b8;
  white-space: nowrap;
  min-width: 100px;
}
.tmpl-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.tmpl-dl-btn:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* 빈 상태 / 데이터 없음 */
.tmpl-empty-row td {
  height: 350px !important;
  text-align: center !important;
  color: #94a3b8;
  vertical-align: middle;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.tmpl-empty-row:hover {
  background: transparent !important;
}
.tmpl-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
  color: #cbd5e1;
}

/* 체크박스 디자인 */
.tmpl-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ef4444;
  margin-top: 2px;
}

/* 삭제 모드 버튼 */
.tmpl-del-btn-multi {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
  margin-right: 6px;
}
.tmpl-del-btn-multi:hover {
  opacity: 0.88;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* 하단 정보 및 페이지네이션 */
.tmpl-bottom-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px;
  margin-top: auto;
  gap: 10px;
}
/* 타이틀/검색 등 왼쪽 그룹 */
.tmpl-bottom-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
/* 가운데 페이지네이션 */
.tmpl-bottom-mid {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 오른쪽 버튼/검색바 그룹 */
.tmpl-bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.tmpl-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.tmpl-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.tmpl-page-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}
.tmpl-page-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}
.tmpl-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #e2e8f0;
  color: #94a3b8;
  background: #fff;
}

/* ── 글쓰기 섹션 (인라인) ── */
.tmpl-upload-section {
  background: #fafaf9;
  border-bottom: 1px solid #f1f5f9;
  padding: 20px 24px;
  display: none;
}
.tmpl-upload-section.open {
  display: block;
}

.tmpl-form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tmpl-form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.tmpl-form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tmpl-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 14px;
}
.tmpl-dropzone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.tmpl-drop-icon {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}
.tmpl-drop-text {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 4px;
}
.tmpl-drop-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.tmpl-file-preview {
  display: none;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.tmpl-file-icon {
  font-size: 1.5rem;
  color: #ef4444;
}
.tmpl-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  word-break: break-all;
}
.tmpl-file-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}
.tmpl-file-remove:hover {
  color: #ef4444;
}

.tmpl-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.tmpl-btn-cancel {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.tmpl-btn-cancel:hover {
  background: #e2e8f0;
}

@media (max-width: 640px) {
  .tmpl-table thead th.th-hide-mobile,
  .tmpl-table td.td-hide-mobile {
    display: none;
  }
  .tmpl-search-input {
    width: 140px;
  }
}

/* ==== Vendor_Dash.html Styles ==== */

/* ── Vendor Dash ── */
.vendor-container {
  padding: 0;
}

/* 페이지 헤더 */
.vendor-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.vendor-page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vendor-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.vendor-page-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}
.vendor-page-header p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 2px 0 0;
}

/* 글쓰기 버튼 */
.vendor-write-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
  transition:
    opacity 0.15s,
    transform 0.1s;
  white-space: nowrap;
}
.vendor-write-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* 게시글 목록 툴바 */
.vendor-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.vendor-list-toolbar h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vendor-refresh-btn {
  background: none;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.vendor-refresh-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* 게시글 카드 */
.vendor-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vendor-post-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.15s,
    transform 0.15s,
    border-color 0.15s;
}
.vendor-post-card:hover {
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
  border-color: #bfdbfe;
}
.vendor-post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 10px;
}
.vendor-post-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}
.vendor-post-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.vendor-badge-co {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  white-space: nowrap;
}
.vendor-badge-dept {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #16a34a;
  white-space: nowrap;
}
.vendor-post-date {
  font-size: 0.73rem;
  color: #94a3b8;
  white-space: nowrap;
}
.vendor-post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
}
.vendor-meta-item {
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
}
.vendor-meta-item i {
  color: #94a3b8;
  font-size: 0.75rem;
}
.vendor-meta-item strong {
  color: #1e293b;
  font-weight: 700;
}
.vendor-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 4px;
}
.vendor-pdf-link:hover {
  background: #fee2e2;
}

/* Empty / Loading */
.vendor-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.vendor-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.vendor-loading {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
}

/* 게시판 테이블 - 프리미엄 세련된 UI (서식자료 일치) */
.vendor-table-wrap {
  overflow-x: auto;
  background: #fff;
}
.vendor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.vendor-table thead th {
  background: #1e293b;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
  border-bottom: none;
  border-right: none;
  white-space: nowrap;
}
.vendor-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff !important;
  transition: all 0.2s ease-in-out;
  height: 50px;
}
.vendor-table tbody tr:nth-child(even),
.vendor-table tbody tr:nth-child(odd) {
  background-color: #ffffff !important;
}
.vendor-table tbody tr:hover {
  background: #f0f9ff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.vendor-table tbody tr:last-child {
  border-bottom: none;
}
.vendor-table td {
  padding: 6px 12px;
  color: #1e293b;
  text-align: center;
  vertical-align: middle;
  border-right: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 버튼 공통 스타일 (서식자료 일치) */
.vendor-write-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.vendor-write-btn.icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vendor-write-btn:hover {
  opacity: 0.88;
}

.vendor-del-btn-multi {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
  margin-right: 6px;
}
.vendor-del-btn-multi:hover {
  opacity: 0.88;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ── 툴바 ── */
.vendor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  justify-content: center;
  align-items: center;
}
.vendor-modal-overlay.open {
  display: flex;
}
.vendor-modal-card {
  background: white;
  border-radius: 20px;
  width: 1000px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: vendorModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes vendorModalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.vendor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  flex-shrink: 0;
}
.vendor-modal-title {
  margin: 0;
  font-weight: 800;
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vendor-modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #fff;
}
.vendor-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.vendor-modal-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.vendor-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  margin-bottom: 14px;
}
.vendor-modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.vendor-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.vendor-field-row .vendor-field {
  margin-bottom: 0;
}
.vendor-field {
  margin-bottom: 0;
}
/* PDF 업로드 영역 */
.vendor-file-drop {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  background: #f8fafc;
  margin-bottom: 14px;
}
.vendor-file-drop:hover,
.vendor-file-drop.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}
.vendor-file-drop i {
  font-size: 1.8rem;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}
.vendor-file-drop p {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
}
.vendor-file-drop small {
  font-size: 0.75rem;
  color: #94a3b8;
}
.vendor-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #dc2626;
  font-weight: 600;
  margin-bottom: 14px;
}
.vendor-file-preview i {
  font-size: 1rem;
  flex-shrink: 0;
}
.vendor-file-remove {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.6;
  font-size: 0.9rem;
  padding: 2px 4px;
}
.vendor-file-remove:hover {
  opacity: 1;
}
/* 제출 버튼 */
.vendor-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.vendor-btn-cancel {
  background: white;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.vendor-btn-cancel:hover {
  background: #f1f5f9;
}
.vendor-btn-submit {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.15s;
}
.vendor-btn-submit:hover {
  opacity: 0.88;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.vendor-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==== Risk_Index.html Styles ==== */

/* ═══ CSS Variables ═══ */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eff6ff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #ffffff;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --sidebar-width: 280px;
  --header-height: 64px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --toast-bg: #1e293b;
  --toast-color: #fff;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --success: #16a34a;
  --success-light: #dcfce7;
  --info-color: #3b82f6;
  --info-light: #dbeafe;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1180px;
}

body {
  margin: 0;
  font-family: "Inter", "Noto Sans KR", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
  min-width: 1180px;
}

/* Sidebar Styles */
aside {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
}

.logo-area {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo-icon {
  margin-right: 0.75rem;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-menu {
  flex: 1;
  padding: 1.5rem 0.75rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding-left: 0.75rem;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  letter-spacing: 1.5px;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 0.88rem;
  position: relative;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
  transform: translateX(2px);
}

.nav-item.active svg {
  stroke: white;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  margin-right: 0.7rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 0 2.5rem 2rem 2.5rem;
  background: transparent;
  min-width: 900px;
}

.content-header {
  margin-bottom: 2rem;
}

.content-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.content-header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.page-section {
  display: none;
  animation: slideUpFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-section.active {
  display: block;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 공통: fadeSlideUp 애니메이션 ── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 공통: 배너 넘버 ── */
.banner-num {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered card fade-in */
.page-section.active .card,
.page-section.active .opt5-card,
.page-section.active .ra-card,
.page-section.active .ms-card,
.page-section.active .rs-card {
  animation: staggerCard 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.page-section.active > :nth-child(1) {
  animation-delay: 0s;
}

.page-section.active > :nth-child(2) {
  animation-delay: 0.06s;
}

.page-section.active > :nth-child(3) {
  animation-delay: 0.12s;
}

.page-section.active > :nth-child(4) {
  animation-delay: 0.18s;
}

.page-section.active > :nth-child(5) {
  animation-delay: 0.24s;
}

.page-section.active > :nth-child(6) {
  animation-delay: 0.3s;
}

.page-section.active > :nth-child(7) {
  animation-delay: 0.36s;
}

@keyframes staggerCard {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card Style (Global) */
.card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  color: var(--primary);
}

/* Input Groups (Global idea) */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-body);
}

/* Login Overlay Styles Removed */

/* ── Kebab Menu ── */
.nav-item-wrapper {
  position: relative;
}

.nav-kebab {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.2s;
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.nav-item.active ~ .nav-kebab,
.nav-item-wrapper:hover .nav-kebab {
  opacity: 1;
  pointer-events: auto;
}

.nav-item.active ~ .nav-kebab {
  color: rgba(255, 255, 255, 0.85);
}

.nav-item-wrapper:not(:has(.nav-item.active)) .nav-kebab {
  color: #94a3b8;
}

.nav-kebab:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-kebab svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.nav-dropdown {
  position: absolute;
  right: -4px;
  top: calc(100% + 4px);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  padding: 0.35rem;
  z-index: 100;
  display: none;
  animation: dropdownFade 0.15s ease;
}

.nav-dropdown.show {
  display: block;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-dropdown-item:hover {
  background: var(--bg-hover);
}

.nav-dropdown-item svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

/* ═══ Global Toast ═══ */
.g-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
}

.g-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  background: var(--toast-bg);
  color: var(--toast-color);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: "Noto Sans KR", sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 480px;
  white-space: normal;
  word-break: keep-all;
}

.g-toast.show {
  transform: translateX(0);
}

.g-toast.success {
  background: var(--success);
  color: #fff;
}

.g-toast.error {
  background: var(--danger);
  color: #fff;
}

.g-toast.warning {
  background: var(--warning);
  color: #1e293b;
}

.g-toast.info {
  background: var(--info-color);
  color: #fff;
}

.g-toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-toast-retry {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: inherit;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.g-toast-retry:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ═══ Progress Bar (저장바 상단) ═══ */
.progress-card {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0.6rem 0;
  gap: 0;
  min-height: 48px;
  margin: 0 auto;
}

.progress-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  margin-right: 0.8rem;
  letter-spacing: 0.3px;
}

.progress-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.progress-loading .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-steps {
  display: flex;
  align-items: center;
  flex: 1;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #94a3b8;
  flex-shrink: 0;
}

.progress-step:hover {
  background: #f1f5f9;
  color: #475569;
}

/* 완료 */
.progress-step.done {
  color: #16a34a;
}

.progress-step.done .step-icon {
  color: #22c55e;
}

/* 미실시 */
.progress-step.pending {
  color: #ef4444;
}

.progress-step.pending .step-icon {
  color: #ef4444;
}

/* 현재 탭 */
.progress-step.current {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #1d4ed8;
  font-weight: 700;
  border: 1.5px solid #93c5fd;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  position: relative;
  animation: currentPulse 2s ease-in-out infinite;
}

@keyframes currentPulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  }

  50% {
    box-shadow: 0 2px 16px rgba(59, 130, 246, 0.35);
  }
}

.progress-step.current::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #3b82f6;
}

.progress-step.current.pending .step-icon {
  color: #ef4444;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.15rem;
  color: #1e293b;
  font-size: 0.75rem;
  user-select: none;
  flex-shrink: 0;
}

/* 저장 버튼 (우측 끝단, 스크롤 안 따라옴) */
.floating-save-btn {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* 스크롤 상단 이동 (우하단) */
.scroll-top-fab {
  position: fixed;
  bottom: 2rem;
  right: 2.5rem;
  height: 40px;
  padding: 0 1rem 0 0.75rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #64748b, #475569);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 4px 16px rgba(71, 85, 105, 0.3);
  transition: all 0.3s;
  z-index: 100;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
}

.scroll-top-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(71, 85, 105, 0.4);
}

.scroll-top-fab svg {
  width: 16px;
  height: 16px;
}

/* ═══ Logout Feedback ═══ */
.logout-active {
  background: #fef2f2 !important;
  color: #ef4444 !important;
}

/* ==== Risk_Login.html Styles ==== */

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: linear-gradient(
    160deg,
    #1e40af 0%,
    #2563eb 30%,
    #3b82f6 60%,
    #60a5fa 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle background pattern */
body::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Floating orbs */
body::after {
  content: "";
  position: absolute;
  top: 10%;
  right: 5%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

/* Top branding area */
.brand-area {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.brand-logo img {
  height: 36px;
  filter: brightness(0) invert(1);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Login Card */
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Blue accent line at top of card */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  border-radius: 0 0 4px 4px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--slate-700);
  letter-spacing: 0.2px;
}

.form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--slate-200);
  border-radius: 12px;
  background: var(--slate-50);
  color: var(--slate-800);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.form-select:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background-color: #fff;
}

.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}

.divider span {
  font-size: 0.72rem;
  color: var(--slate-400);
  font-weight: 500;
  white-space: nowrap;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-survey {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--blue-200);
  background: var(--blue-50);
  color: var(--blue-700);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.2px;
}

.btn-survey:hover {
  background: var(--blue-100);
  border-color: var(--blue-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn-survey:active {
  transform: translateY(0);
}

.btn-survey svg {
  flex-shrink: 0;
}

/* Loading */
.loading-state {
  text-align: center;
  padding: 2rem 0;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.88rem;
  color: var(--slate-400);
  font-weight: 500;
}

/* Footer */
.footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 20px;
  }

  .brand-title {
    font-size: 1.3rem;
  }
}

/* Subtle entrance animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-wrapper {
  animation: slideUp 0.5s ease-out;
}

/* ==== Risk_Info.html Styles ==== */

/* Save/Load Toolbar Styles */
.risk-info-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  min-width: 900px;
  transition: background 0.3s;
}

.risk-info-toolbar .btn {
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.btn-delete {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.btn-delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #ef4444;
}

/* Option 5: Premium Card Styles */
.opt5-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: fadeSlideUp 0.4s ease-out;
  min-width: 900px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.opt5-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

/* Full-width Banner Header */
.opt5-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* Legacy opt5-title kept for compatibility but restyled */
.opt5-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1.5rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* fadeSlideUp: Risk_Index.html 공통 키프레임 상속 */

.opt5-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.opt5-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.opt5-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-input);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.opt5-input:disabled {
  background: var(--bg-input);
  color: var(--text-light);
  cursor: not-allowed;
}

.opt5-input::placeholder {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.85rem;
}

.opt5-input:focus {
  background: var(--bg-white);
  border-color: #93c5fd;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.opt5-grid-5 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 0.5fr;
  gap: 1rem;
  align-items: center;
}

.opt5-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1.5rem;
}

.opt5-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.opt5-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.opt5-selection-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.5rem;
}

.opt5-selection-card {
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  user-select: none;
}

.opt5-selection-card:hover {
  background: #eff6ff;
  color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.opt5-selection-card.checked {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.opt5-selection-card input {
  accent-color: #333;
  width: 14px;
  height: 14px;
}

.opt5-selection-card.checked input {
  accent-color: #333;
}

.opt5-sub-header {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 2px dashed var(--border-color);
}

.opt5-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.opt5-table th {
  text-align: center;
  color: #64748b;
  font-weight: 700;
  padding: 0 0.5rem;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.opt5-table td {
  padding: 0 0.25rem;
  vertical-align: middle;
}

.opt5-table input {
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  text-align: center;
}

.hidden-input {
  display: none;
  margin-top: 0.5rem;
  border-left: 3px solid #3b82f6;
  padding-left: 0.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast Notification Styles */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  background: white;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateX(100%);
  border: 1px solid #f1f5f9;
  pointer-events: auto;
}

/* Clean style without left border */
.toast.success,
.toast.error,
.toast.info {
  border-left: none;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: #16a34a;
  background: #dcfce7;
}

.toast.error .toast-icon {
  color: #dc2626;
  background: #fee2e2;
}

.toast.info .toast-icon {
  color: #2563eb;
  background: #dbeafe;
}

.toast-content {
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
}

/* Toolbar Buttons */
.btn-load {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  transition: all 0.2s;
}

.btn-load:hover {
  background: #e0f2fe;
  transform: translateY(-1px);
}

.btn-save {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  transition: all 0.2s;
}

.btn-save:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.toast.success .toast-icon {
  color: #22c55e;
  background: #dcfce7;
}

.toast.error .toast-icon {
  color: #ef4444;
  background: #fee2e2;
}

.toast.info .toast-icon {
  color: #3b82f6;
  background: #dbeafe;
}

.toast-content {
  font-size: 0.95rem;
  color: #334155;
  font-weight: 600;
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ═══════════════════════════════════════════
       PROCESS STEP CARD
    ═══════════════════════════════════════════ */
.process-step-card {
  border: none;
  border-radius: 12px;
  margin-bottom: 1.2rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition:
    box-shadow 0.2s,
    opacity 0.2s,
    transform 0.15s;
}

.process-step-card.dragging {
  opacity: 0.4;
  box-shadow: 0 0 0 2px #3b82f6;
}

.process-step-card.drag-over {
  border-top: 3px solid #3b82f6;
}

.process-step-card:hover {
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.15);
}

/* Step Number Banner */
.step-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
}

.step-number {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.step-divider {
  width: 1.5px;
  height: 18px;
  background: rgba(255, 255, 255, 0.25);
}

.step-title-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  transition: all 0.15s;
}

.step-title-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.step-title-input:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Process Description */
.process-desc {
  padding: 0.9rem 1.5rem;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}

.process-desc .opt5-label {
  color: #2563eb;
  font-weight: 700;
  font-size: 0.72rem;
}

.process-desc .input {
  background: #fff;
  border: 1px solid #bfdbfe;
  box-shadow: none;
  font-size: 0.88rem;
  padding: 0.6rem 0.85rem;
  width: 100%;
  border-radius: 8px;
}

.process-desc .input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Process Body */
.process-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
}

/* Sub-section Box */
.sub-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
}

.sub-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid #dbeafe;
  letter-spacing: 0.2px;
}

/* Compact Table for Sub-items */
.compact-table {
  width: 100%;
  border-collapse: collapse;
}

.compact-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0.3rem 0.35rem;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.3px;
}

.compact-table td {
  padding: 0.25rem 0.2rem;
}

.compact-table input {
  width: 100%;
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.compact-table input:focus {
  border-color: #60a5fa;
  outline: none;
}

/* Step Actions */
.step-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1.2rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.btn-step-delete {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-step-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

.btn-add-sub {
  background: #fff;
  border: 1.5px dashed #bfdbfe;
  color: #3b82f6;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 0.5rem;
}

.btn-add-sub:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

/* ── 참여자 자동완성 ── */
.ac-wrapper {
  position: relative;
  overflow: visible;
}

.ac-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  width: 260px;
}

.ac-dropdown.show {
  display: block;
}

.ac-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.active {
  background: #eff6ff;
}

.ac-item .ac-name {
  font-weight: 700;
  color: #1e293b;
}

.ac-item .ac-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.4rem;
}

/* ==== Risk_Survey.html Styles ==== */

/* ========================================
           Survey Premium Design - Matching Login
           ======================================== */

:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eff6ff;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --text-dark: #1e293b;
  --text-gray: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Noto Sans KR",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: linear-gradient(
    160deg,
    #1e40af 0%,
    #2563eb 30%,
    #3b82f6 60%,
    #60a5fa 100%
  );
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
  padding: 2rem 1.25rem 3rem;
  position: relative;
  overflow-x: hidden;
}

/* Subtle background pattern - matches Login */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* Floating orb decoration */
body::after {
  content: "";
  position: fixed;
  top: 10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.survey-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: surveySlideUp 0.6s ease-out;
}

@keyframes surveySlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
           Header - Transparent on Blue
           ===================== */
.header-card {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 0 2rem 0;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 50;
  border-radius: 0;
  box-shadow: none;
}

.header-card::after {
  content: none;
}

.header-title {
  font-size: 1.65rem;
  font-weight: 800;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
  margin: 0;
  padding-top: 0.25rem;
  letter-spacing: -0.5px;
}

.header-logo {
  width: 240px;
  height: auto;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.header-desc {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.75rem;
  font-weight: 400;
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 0 0.5rem;
}

/* =====================
           Form Cards - White on Blue
           ===================== */
.q-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  border: none;
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.5s ease-out both;
}

.q-card:nth-child(2) {
  animation-delay: 0.1s;
}

.q-card:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Blue accent line at top of card - matches Login */
.q-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  border-radius: 0 0 4px 4px;
}

/* =====================
           Section Header
           ===================== */
.form-section-head {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-badge {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-right: 0.75rem;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
  flex-shrink: 0;
}

.form-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-800);
  letter-spacing: -0.3px;
}

/* =====================
           Input Groups
           ===================== */
.input-group {
  background: var(--slate-50);
  border-radius: 14px;
  margin-bottom: 1rem;
  border: 1.5px solid var(--slate-200);
  transition: all 0.25s ease;
  box-shadow: none;
  position: relative;
  min-height: 4.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-group:focus-within {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

/* Floating Label */
.input-label {
  position: absolute;
  top: 0.65rem;
  left: 1.15rem;
  font-size: 0.72rem;
  color: var(--slate-500);
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Select */
.custom-select {
  width: 100%;
  height: 100%;
  padding: 1.45rem 1.15rem 0.45rem 1.15rem;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--slate-800);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  z-index: 5;
  position: relative;
  pointer-events: auto;
}

.custom-select:focus {
  outline: none;
}

.custom-select.placeholder {
  color: var(--slate-400);
}

/* Custom Arrow */
.custom-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--slate-400);
  z-index: 10;
  font-size: 0.7rem;
}

/* Text Input */
.custom-input {
  width: 100%;
  height: 100%;
  padding: 1.45rem 1.15rem 0.45rem 1.15rem;
  border: none;
  background: transparent;
  font-size: 0.98rem;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--slate-800);
  border-radius: 14px;
  font-weight: 500;
}

.custom-input:focus {
  outline: none;
}

.custom-input::placeholder {
  color: var(--slate-400);
  font-weight: 400;
}

/* Textarea */
.custom-textarea {
  width: 100%;
  min-height: 7.5rem;
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  border-radius: 14px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  transition: all 0.25s ease;
  color: var(--slate-800);
  line-height: 1.7;
}

.custom-textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.custom-textarea::placeholder {
  color: var(--slate-400);
  font-weight: 400;
}

/* =====================
           Question Text
           ===================== */
.q-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 0.35rem;
  letter-spacing: -0.2px;
}

.q-sub {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-bottom: 0.6rem;
  line-height: 1.5;
  font-weight: 400;
}

.input-group.textarea-group {
  height: auto;
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 2rem;
}

.input-group.textarea-group:focus-within {
  box-shadow: none;
}

/* =====================
           Footer Note
           ===================== */
.footer-note {
  margin-top: 2rem;
  margin-bottom: 4rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  word-break: keep-all;
  text-align: center;
  font-weight: 400;
  backdrop-filter: blur(10px);
}

/* =====================
           Submit Button - Premium Style
           ===================== */
.submit-btn {
  background: #ffffff;
  background-size: 200% 200%;
  color: var(--blue-600);
  border: none;
  padding: 1.1rem;
  border-radius: 16px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  animation: none;
}

@keyframes gradientBtn {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.08),
    transparent
  );
  transition: 0.5s;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 15px 40px -5px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.3);
  background: #ffffff;
}

/* =====================
           Toast
           ===================== */
#toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 21000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: #ffffff;
  color: #334155;
  padding: 0.85rem 1.2rem;
  border-radius: 50px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: toastPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  text-align: center;
  letter-spacing: -0.01em;
}

.toast .toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.toast.error .toast-icon {
  background: #fef2f2;
  color: #ef4444;
}

.toast.success .toast-icon {
  background: #f0fdf4;
  color: #22c55e;
}

.toast.info .toast-icon {
  background: #eff6ff;
  color: #3b82f6;
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* All-No Encouragement Card */
.all-no-hint {
  display: none;
  background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  animation: cardFadeIn 0.4s ease-out;
}

.all-no-hint .hint-icon {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.all-no-hint .hint-text {
  color: #475569;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.6;
}

.all-no-hint .hint-highlight {
  color: #3b82f6;
  font-weight: 700;
}

/* =====================
           Language Selector
           ===================== */
.lang-dropdown-wrapper {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.85rem;
}

.lang-selected {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
  min-width: 7.5rem;
  justify-content: space-between;
  color: #ffffff;
}

.lang-selected:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.lang-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.lang-arrow {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}

.lang-options {
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.2);
  width: 10.5rem;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
  z-index: 10000;
  padding: 4px 0 4px;
}

.lang-options.show {
  display: flex;
}

.lang-option {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--slate-700);
  font-weight: 500;
  border-radius: 8px;
  margin: 1px 4px;
}

.lang-option:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
           Loading Overlay
           ===================== */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 20000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--blue-100);
  border-top: 4px solid var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.checkmark-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #fff;
  stroke-miterlimit: 10;
  margin: 10% auto;
  box-shadow: inset 0px 0px 0px #22c55e;
  animation:
    fill 0.4s ease-in-out 0.4s forwards,
    scale 0.3s ease-in-out 0.9s both;
  flex-shrink: 0;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* =====================
           Input Error State
           ===================== */
.input-error {
  border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
  background: linear-gradient(
    135deg,
    rgba(254, 226, 226, 0.3),
    rgba(255, 255, 255, 0.95)
  ) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08) !important;
}

/* =====================
           Toggle Buttons - Clean Premium
           ===================== */
.toggle-container {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
  margin-top: 0.75rem;
}

.toggle-input {
  display: none;
}

.radio-label {
  padding: 0.85rem 0;
  background: #ffffff;
  color: var(--slate-500);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  border: 1.5px solid var(--slate-200);
  flex: 1;
  text-align: center;
  box-shadow: none;
}

.radio-label:hover {
  transform: translateY(-1px);
  border-color: var(--slate-300);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.toggle-input:checked + .radio-label {
  transform: translateY(-1px);
}

/* Yes/No checked states - Cleaner */
#q1-y:checked + label,
#q2-y:checked + label,
#q3-y:checked + label,
#q4-y:checked + label,
#q5-y:checked + label {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
  font-weight: 700;
}

#q1-n:checked + label,
#q2-n:checked + label,
#q3-n:checked + label,
#q4-n:checked + label,
#q5-n:checked + label {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #86efac;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.12);
  font-weight: 700;
}

/* =====================
           Textarea Wrapper
           ===================== */
.textarea-wrapper {
  display: none;
  margin-top: 1rem;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-note {
  font-size: 0.78rem;
  color: #ef4444;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* =====================
           Progress Bar - Glass on Blue
           ===================== */
.progress-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  margin: 0 -16px 1rem -16px;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.progress-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.progress-header {
  display: none;
}

.progress-label {
  display: none;
}

.progress-percentage {
  display: none;
}

.progress-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1, #3b82f6);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 100px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* =====================
           Responsive - Tablet
           ===================== */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .survey-container {
    max-width: 100%;
  }

  .q-card {
    padding: 1.75rem;
    border-radius: 20px;
  }
}

/* =====================
           Responsive - Mobile
           ===================== */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem 2.5rem;
  }

  .header-title {
    font-size: 1.35rem;
  }

  .header-desc {
    font-size: 0.82rem;
    padding: 0 0.25rem;
  }

  .header-logo {
    width: 150px;
  }

  .q-card {
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
    margin-bottom: 1.25rem;
  }

  .form-section-head {
    align-items: flex-start;
  }

  .form-section-title {
    font-size: 1rem;
    word-break: keep-all;
  }

  .section-badge {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
    margin-right: 0.6rem;
  }

  .section-note {
    font-size: 0.7rem;
    display: block;
    margin-left: 0;
    margin-top: 0.2rem;
  }

  .toggle-container {
    justify-content: flex-start;
  }

  .radio-label {
    flex: 1;
  }

  /* Adjust the flex container for section 2 header to wrap */
  .q-card .form-section-head {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .q-card .form-section-head > div:first-child {
    margin-bottom: 0.3rem;
  }

  /* Enhanced mobile touch targets */
  .custom-select,
  .custom-input {
    min-height: 48px;
    font-size: 16px;
    /* Prevents iOS auto-zoom */
  }

  .toggle-container label {
    min-height: 48px;
    padding: 0.875rem 1.5rem;
  }

  .submit-btn {
    min-height: 56px;
    font-size: 1.05rem;
    border-radius: 14px;
  }

  .input-group {
    border-radius: 12px;
  }

  .lang-dropdown-wrapper {
    top: 0.5rem;
    right: 0.5rem;
  }

  .lang-selected {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    min-width: 6.5rem;
  }
}

/* =====================
           Responsive - Very small (320px)
           ===================== */
@media (max-width: 360px) {
  body {
    padding: 0.75rem 0.5rem 2rem;
  }

  .header-title {
    font-size: 1.2rem;
  }

  .q-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .section-badge {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .form-section-title {
    font-size: 0.92rem;
  }

  .q-title {
    font-size: 0.82rem;
  }

  .q-sub {
    font-size: 0.72rem;
  }
}

/* =====================
           Responsive - Desktop wider
           ===================== */
@media (min-width: 768px) {
  body {
    padding: 3rem 2rem 4rem;
  }

  .survey-container {
    max-width: 620px;
  }

  .q-card {
    padding: 2.25rem 2.5rem;
  }

  .header-title {
    font-size: 1.85rem;
  }

  .header-desc {
    font-size: 0.92rem;
  }
}

/* ==== Risk_Assessment.html Styles ==== */

/* ============================================= */
/* Risk Assessment - Premium Design              */
/* ============================================= */

.risk-assessment-container {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  max-width: 100%;
  min-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Premium Card */
.ra-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ra-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

/* Section Banner - Left light → Right dark */
.ra-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* Step Display */
.ra-step-display {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 1rem 0;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-light);
}

.step-label-text {
  color: #3b82f6;
  font-weight: 800;
  font-size: 1.05rem;
}

.step-name-text {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

/* ---- Flowchart Cards ---- */
.flowchart-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  padding: 0.1rem;
}

/* 공정 간 화살표 */
.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
}

.flow-arrow svg {
  width: 18px;
  height: 18px;
  stroke: #94a3b8;
  stroke-width: 2.5;
  fill: none;
}

.flow-step {
  flex: 0 0 calc(12.5% - 0.57rem);
  min-width: 90px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 0.8rem 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Status: not done = subtle red tint */
.flow-step.status-not-done {
  background: #fff5f5;
  border-color: #fecaca;
}

/* Status: done = clean white (default) */
.flow-step.status-done {
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* Subtle shimmer on hover */
.flow-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(59, 130, 246, 0.04) 50%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.flow-step:hover::after {
  opacity: 1;
}

.flow-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(59, 130, 246, 0.12);
  border-color: #93c5fd;
}

/* Active card - glow + pulse */
.flow-step.active {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #60a5fa;
  box-shadow:
    0 0 0 3px rgba(96, 165, 250, 0.2),
    0 8px 24px -4px rgba(59, 130, 246, 0.2);
  transform: translateY(-3px);
  animation: flowPulse 2s ease-in-out infinite;
}

.flow-step.active .flow-step-title {
  animation: textPulse 2s ease-in-out infinite;
}

@keyframes flowPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(96, 165, 250, 0.2),
      0 8px 24px -4px rgba(59, 130, 246, 0.2);
  }

  50% {
    box-shadow:
      0 0 0 6px rgba(96, 165, 250, 0.12),
      0 8px 24px -4px rgba(59, 130, 246, 0.3);
  }
}

@keyframes textPulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.flow-step-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

.flow-step.active .flow-step-num {
  color: #3b82f6;
}

.flow-step-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  white-space: normal;
  word-break: keep-all;
  transition: color 0.3s;
}

.flow-step.active .flow-step-title {
  color: #1e40af;
}

.flow-step-desc {
  display: none;
}

/* Instruction text */
.flow-instruction {
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 0 0 0;
  letter-spacing: 0.2px;
}

/* ---- Table ---- */
.ra-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4rem;
}

.ra-table th {
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 0.5rem 0.6rem 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ra-table td {
  padding: 0 0.2rem;
  vertical-align: middle;
}

/* Row hover */
.ra-row {
  transition: background 0.15s;
}

.ra-row:hover td {
  background: rgba(248, 250, 252, 0.6);
}

/* Input - matching opt5 */
.opt5-input-cell {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-input);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.opt5-input-cell:focus {
  background: var(--bg-white);
  border-color: #93c5fd;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.opt5-input-cell::placeholder {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.85rem;
}

/* ---- Risk Level Radio (Card Style) ---- */
.risk-check-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.4rem;
}

.risk-check-item {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.risk-check-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.risk-check-item input {
  display: none;
}

.custom-check-circle {
  display: none;
}

/* 상 = Red */
.risk-check-item[data-level="H"]:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.risk-check-item[data-level="H"].checked {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

/* 중 = Yellow/Amber */
.risk-check-item[data-level="M"]:hover {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #d97706;
}

.risk-check-item[data-level="M"].checked {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

/* 하 = Green */
.risk-check-item[data-level="L"]:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
}

.risk-check-item[data-level="L"].checked {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

/* ---- Buttons ---- */
.btn-add-row {
  background: #fff;
  border: 1.5px dashed #93c5fd;
  color: #3b82f6;
  width: 100%;
  padding: 0.75rem;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.btn-add-row:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.ra-row-delete {
  background: transparent;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.ra-row-delete:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Empty State */
.flow-empty {
  width: 100%;
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
  font-style: italic;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
}

/* Code cell - plain text */
.code-cell-input {
  background: transparent !important;
  color: #64748b;
  text-align: center;
  cursor: default;
  border: none !important;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: none !important;
  letter-spacing: 0.5px;
}

.code-cell-input:focus {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ---- Bottom Save Area ---- */
.bottom-save-area {
  text-align: center;
  padding: 0.7rem 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.btn-save-bottom {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.9rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
  min-width: 180px;
}

.btn-save-bottom:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.btn-save-bottom:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* ra-toast: 제거됨 - showGlobalToast() 사용 (Risk_Index.html) */

/* ── Validation Error Highlight ── */
.ra-validation-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  animation: raShake 0.4s ease;
}

.risk-check-group.ra-validation-error {
  border: 2px solid #ef4444 !important;
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  animation: raShake 0.4s ease;
}

@keyframes raShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-4px);
  }

  40% {
    transform: translateX(4px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }
}

/* ---- Animations ---- */
/* fadeSlideUp: Risk_Index.html 공통 키프레임 상속 */

.ra-card {
  animation: fadeSlideUp 0.4s ease-out;
}

#assessment-card {
  animation: none;
}

/* ═══════════════════════════════════════════ */
/* Banner Action Buttons                        */
/* ═══════════════════════════════════════════ */

#assessment-banner {
  justify-content: space-between;
}

.ra-banner-title {
  flex: 1;
}

.ra-banner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ra-banner-btn {
  position: relative;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 10px;
  border: 1.5px solid #bfdbfe;
  background: #eff6ff;
  color: #3b82f6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ra-banner-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.15);
}

.ra-banner-btn-enc {
  border-color: #fde68a;
  background: #fffbeb;
  color: #d97706;
}

.ra-banner-btn-enc:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #b45309;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.15);
}

.ra-banner-btn-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  line-height: 16px;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* ═══════════════════════════════════════════ */
/* Reference Modal                              */
/* ═══════════════════════════════════════════ */

.ref-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
}

.ref-modal-overlay.active {
  display: flex;
}

.ref-modal {
  display: none;
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 680px;
  height: 560px;
  overflow: hidden;
  flex-direction: column;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-modal.active {
  display: flex;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ref-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  flex-shrink: 0;
}

.ref-modal-header-fb {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.ref-modal-header-enc {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.ref-modal-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
}

.ref-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.ref-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ref-modal-body {
  padding: 1.2rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.ref-modal-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ref-modal-tab {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.ref-modal-tab:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

.ref-modal-tab.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.ref-modal-tab .tab-count {
  display: inline-block;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.05rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  margin-left: 0.2rem;
}

.ref-modal-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

.ref-modal-footer {
  padding: 0.8rem 1.2rem;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ref-modal-add-btn {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
  color: white;
}

.ref-modal-add-btn-fb {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.ref-modal-add-btn-fb:hover {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  transform: translateY(-1px);
}

.fb-btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
}

.fb-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fbSpin 0.6s linear infinite;
}

@keyframes fbSpin {
  to {
    transform: rotate(360deg);
  }
}

.ref-modal-add-btn-enc {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ref-modal-add-btn-enc:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

.ref-modal-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Checkbox Items (shared for feedback + encyclopedia) */
.ref-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.25rem;
}

.ref-check-item:hover {
  background: #f1f5f9;
}

.ref-check-item.checked {
  background: #eff6ff;
}

.ref-check-item.added {
  opacity: 0.5;
  pointer-events: none;
}

.ref-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.ref-check-item-text {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.4;
  flex: 1;
}

.ref-check-item-added {
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 600;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════ */
/* Feedback Items (inside modal)                */
/* ═══════════════════════════════════════════ */

/* Category group */
.fb-ref-group {
  margin-bottom: 1rem;
}

.fb-ref-group:last-child {
  margin-bottom: 0;
}

.fb-ref-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f1f5f9;
}

.fb-ref-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fb-ref-group-count {
  font-weight: 600;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-left: auto;
}

.fb-ref-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  margin-bottom: 0.35rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: all 0.2s;
}

.fb-ref-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.fb-ref-item-text {
  flex: 1;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.5;
  word-break: keep-all;
}

.fb-ref-item-author {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.fb-ref-apply-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid #93c5fd;
  background: white;
  color: #2563eb;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.fb-ref-apply-btn:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.fb-ref-apply-btn.applied {
  background: #dcfce7;
  color: #16a34a;
  border-color: #86efac;
  cursor: default;
  pointer-events: none;
}

.fb-ref-empty {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.fb-ref-empty svg {
  width: 32px;
  height: 32px;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

/* Loading state */
.fb-ref-loading {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.fb-ref-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: fbSpin 0.8s linear infinite;
  margin: 0 auto 0.5rem;
}

@keyframes fbSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════ */
/* Encyclopedia Items (inside modal)            */
/* ═══════════════════════════════════════════ */

.hz-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.hz-cat-tab {
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.hz-cat-tab:hover {
  border-color: #f59e0b;
  color: #92400e;
  background: #fffbeb;
}

.hz-cat-tab.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}

.hz-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hz-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  transition: all 0.2s;
  cursor: default;
}

.hz-item:hover {
  background: #fef3c7;
  border-color: #fde68a;
}

.hz-item-text {
  flex: 1;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.4;
}

.hz-item-add {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border: 1.5px solid #fbbf24;
  background: white;
  color: #d97706;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.hz-item-add:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.hz-item-add.added {
  background: #dcfce7;
  color: #16a34a;
  border-color: #86efac;
  cursor: default;
  pointer-events: none;
}

/* ==== Risk_Measures.html Styles ==== */

/* ============================================= */
/* Improvement Measures - Premium Design          */
/* ============================================= */

.measures-container {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  max-width: 100%;
  min-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Card */
.ms-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: msFadeUp 0.4s ease-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

@keyframes msFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Banner */
.ms-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* 통계 필터 바 */
.ms-filter-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
}

.ms-filter-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid #e2e8f0;
  user-select: none;
}

.ms-filter-item:last-child {
  border-right: none;
}

.ms-filter-item:hover {
  background: #eff6ff;
  color: #2563eb;
}

.ms-filter-item.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.ms-filter-item.active .ms-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ms-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
  transition: all 0.2s;
}

.ms-filter-item[data-filter="H"] .ms-filter-count {
  background: #fee2e2;
  color: #dc2626;
}

.ms-filter-item[data-filter="H"].active .ms-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ms-filter-item[data-filter="M"] .ms-filter-count {
  background: #fef3c7;
  color: #d97706;
}

.ms-filter-item[data-filter="M"].active .ms-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ms-filter-item[data-filter="H"].active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.ms-filter-item[data-filter="M"].active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Table */
.ms-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4rem;
  font-size: 0.88rem;
}

.ms-table thead th {
  text-align: center;
  color: #64748b;
  font-weight: 700;
  padding: 0 0.5rem 0.6rem 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  background: transparent;
  border: none;
  white-space: nowrap;
}

.ms-table td {
  padding: 0 0.2rem;
  vertical-align: middle;
}

.ms-table tbody tr {
  transition: background 0.15s;
}

.ms-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

/* 구분 숫자 */
.ms-row-num {
  text-align: center;
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* 코드 표시 */
.ms-code-cell {
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
  letter-spacing: 0.5px;
}

/* 위험등급 뱃지 */
.ms-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 32px;
}

.ms-risk-badge.level-H {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.ms-risk-badge.level-M {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* 읽기전용 텍스트 셀 */
.ms-readonly-cell {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
  word-break: keep-all;
  padding: 0.5rem 0.6rem;
}

/* 입력 필드 */
.ms-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-input:focus {
  background: #fff;
  border-color: #93c5fd;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.ms-input::placeholder {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.82rem;
}

.ms-input[type="date"] {
  cursor: pointer;
}

/* 빈 상태 */
.ms-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
}

.ms-empty-state svg {
  width: 48px;
  height: 48px;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.ms-empty-state h3 {
  color: #64748b;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
}

.ms-empty-state p {
  font-size: 0.85rem;
  margin: 0;
}

/* 하단 저장 영역 */
.ms-save-area {
  text-align: center;
  padding: 0.7rem 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.ms-btn-save {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.9rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
  font-family: inherit;
  min-width: 180px;
}

.ms-btn-save:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.ms-btn-save:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.ms-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ms-toast: 제거됨 - showGlobalToast() 사용 (Risk_Index.html) */

/* ── Validation Error Highlight ── */
.ms-validation-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
  animation: msShake 0.4s ease;
}

@keyframes msShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-4px);
  }

  40%,
  80% {
    transform: translateX(4px);
  }
}

/* ==== Risk_Results.html Styles ==== */

/* ============================================= */
/* Improvement Results - Premium Design           */
/* ============================================= */

.results-container {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  max-width: 100%;
  min-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Card Wrapper */
.rs-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 2rem 2rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: rsFadeUp 0.4s ease-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rs-card:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(59, 130, 246, 0.06);
  border-color: #c7d2fe;
}

@keyframes rsFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Banner */
.rs-section-banner {
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 0;
  margin: 0 0 1.2rem 0;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* banner-num: Risk_Index.html 공통 스타일 상속 */

/* 빈 상태 */
.rs-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
}

.rs-empty-state svg {
  width: 48px;
  height: 48px;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.rs-empty-state h3 {
  color: #64748b;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
}

.rs-empty-state p {
  font-size: 0.85rem;
  margin: 0;
}

/* ── 결과 카드 아이템 ── */
.rs-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 0.8rem;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rs-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

/* 카드 헤더 */
.rs-item-header {
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.rs-header-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.rs-header-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.35rem 1rem;
  font-size: 0.78rem;
}

.rs-detail-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rs-detail-label {
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.rs-detail-value {
  color: #1e293b;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-code-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.rs-manager-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

.rs-manager-name {
  font-size: 0.88rem;
  color: #1e293b;
  font-weight: 700;
}

.rs-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  margin-left: auto;
}

.rs-risk-badge.level-H {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.rs-risk-badge.level-M {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

/* 카드 바디 */
.rs-item-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.rs-before-col,
.rs-after-col {
  padding: 0.7rem 1rem;
}

.rs-before-col {
  border-right: 1px solid #e2e8f0;
}

.rs-col-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
}

.rs-col-label svg {
  width: 16px;
  height: 16px;
}

.rs-col-label.before {
  background: #f1f5f9;
  color: #64748b;
}

.rs-col-label.after {
  background: #eff6ff;
  color: #2563eb;
}

/* 사진 업로드 영역 */
.rs-photo-area {
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.rs-photo-area:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.rs-photo-area.has-image {
  border-style: solid;
  border-color: #e2e8f0;
}

.rs-photo-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.rs-photo-placeholder {
  text-align: center;
  color: #cbd5e1;
  pointer-events: none;
}

.rs-photo-placeholder svg {
  width: 28px;
  height: 28px;
  margin-bottom: 0.3rem;
}

.rs-photo-placeholder p {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0;
}

/* 업로드 스피너 */
.rs-upload-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: rsSpinAnim 0.8s linear infinite;
  margin: 0 auto 0.5rem;
}

@keyframes rsSpinAnim {
  to {
    transform: rotate(360deg);
  }
}

.rs-photo-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3b82f6;
  border-radius: 10px;
  flex-direction: column;
  gap: 0.3rem;
}

/* ── 크롭 팝업 모달 ── */
.rs-crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rsCropFadeIn 0.2s ease;
}

@keyframes rsCropFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.rs-crop-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 480px;
  max-width: 92vw;
  overflow: hidden;
}

.rs-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.rs-crop-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.rs-crop-close:hover {
  color: #ef4444;
}

.rs-crop-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.rs-crop-canvas-wrap:active {
  cursor: grabbing;
}

.rs-crop-canvas-wrap img {
  position: absolute;
  transform-origin: 0 0;
  pointer-events: none;
}

.rs-crop-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.2rem;
  border-top: 1px solid #e2e8f0;
}

.rs-crop-controls label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.rs-crop-controls input[type="range"] {
  flex: 1;
  accent-color: #3b82f6;
}

.rs-crop-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.7rem 1.2rem;
  border-top: 1px solid #e2e8f0;
}

.rs-crop-btn {
  padding: 0.5rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}

.rs-crop-btn.cancel {
  background: #f1f5f9;
  color: #64748b;
}

.rs-crop-btn.cancel:hover {
  background: #e2e8f0;
}

.rs-crop-btn.confirm {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.rs-crop-btn.confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.35);
}

/* 삭제 버튼 */
.rs-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.rs-photo-area:hover .rs-photo-delete {
  opacity: 1;
}

/* 내용 입력 */
.rs-textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1e293b;
  resize: vertical;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) inset;
  transition: all 0.25s;
}

.rs-textarea:focus {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.3);
  outline: none;
}

.rs-textarea::placeholder {
  color: #cbd5e1;
  font-weight: 500;
}

/* 하단 저장 */
.rs-save-area {
  text-align: center;
  padding: 0.7rem 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.rs-btn-save {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.9rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
  font-family: inherit;
  min-width: 180px;
}

.rs-btn-save:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.rs-btn-save:active {
  transform: translateY(-1px);
}

.rs-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* rs-toast: 제거됨 - showGlobalToast() 사용 (Risk_Index.html) */

/* ==== Risk_Feedback.html Styles ==== */

/* ═══════════════════════════════════════════ */
/* Feedback - Premium Redesign v2              */
/* ═══════════════════════════════════════════ */

.fb-page-wrapper {
  /* font-family: Risk_Index.html 공통 폰트 상속 */
  min-width: 900px;
}

/* ── Section Title ── */
.fb-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fb-section-title-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ═══ Stat Cards v2 ═══ */

/* staggered 입장 애니메이션 */
@keyframes fbCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fb-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1vw, 0.75rem);
  margin-bottom: 1.5rem;
}

.fb-stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: clamp(0.75rem, 1.1vw, 1rem) clamp(0.6rem, 0.9vw, 0.85rem);
  border: 1.5px solid #e2e8f0;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;

  /* staggered 입장 */
  animation: fbCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fb-stat-card:nth-child(1) {
  animation-delay: 0s;
}

.fb-stat-card:nth-child(2) {
  animation-delay: 0.06s;
}

.fb-stat-card:nth-child(3) {
  animation-delay: 0.12s;
}

.fb-stat-card:nth-child(4) {
  animation-delay: 0.18s;
}

.fb-stat-card:nth-child(5) {
  animation-delay: 0.24s;
}

.fb-stat-card:nth-child(6) {
  animation-delay: 0.3s;
}

/* 상단 액센트 바 */
.fb-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 호버 글로우 */
.fb-stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.fb-stat-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: transparent;
}

.fb-stat-card:hover::after {
  opacity: 1;
}

/* active 상태 */
.fb-stat-card.active {
  border-color: transparent;
  transform: translateY(-2px);
}

.fb-stat-card.active::before {
  height: 4px;
}

/* 아이콘 영역 — 그라디언트 배경 */
.fb-stat-icon-top {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.fb-stat-card:hover .fb-stat-icon-top {
  transform: scale(1.1);
}

.fb-stat-icon-top svg {
  width: 20px;
  height: 20px;
}

/* 텍스트 영역 */
.fb-stat-value {
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.15rem;
  transition: color 0.3s;
}

.fb-stat-unit {
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 0.1rem;
  opacity: 0.7;
}

.fb-stat-label {
  font-size: clamp(0.62rem, 0.72vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 0;
  opacity: 0.85;
}

/* ── Card Color Themes (그라디언트 팔레트) ── */

/* total — blue→indigo */
.fb-stat-card[data-key="total"] {
  color: #475569;
}

.fb-stat-card[data-key="total"]::before {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.fb-stat-card[data-key="total"]::after {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.06),
    rgba(99, 102, 241, 0.06)
  );
}

.fb-stat-card[data-key="total"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.fb-stat-card[data-key="total"].active {
  box-shadow:
    0 0 0 2px #3b82f6,
    0 8px 28px rgba(59, 130, 246, 0.18);
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
}

.fb-stat-card[data-key="total"] .fb-stat-value {
  color: #1e40af;
}

/* nearmiss — amber→red */
.fb-stat-card[data-key="nearmiss"] {
  color: #92400e;
}

.fb-stat-card[data-key="nearmiss"]::before {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.fb-stat-card[data-key="nearmiss"]::after {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.06),
    rgba(239, 68, 68, 0.06)
  );
}

.fb-stat-card[data-key="nearmiss"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.fb-stat-card[data-key="nearmiss"].active {
  box-shadow:
    0 0 0 2px #f59e0b,
    0 8px 28px rgba(245, 158, 11, 0.18);
  background: linear-gradient(135deg, #fffbeb 0%, #fef2f2 100%);
}

.fb-stat-card[data-key="nearmiss"] .fb-stat-value {
  color: #b45309;
}

/* workplace — red→orange */
.fb-stat-card[data-key="workplace"] {
  color: #991b1b;
}

.fb-stat-card[data-key="workplace"]::before {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.fb-stat-card[data-key="workplace"]::after {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.06),
    rgba(249, 115, 22, 0.06)
  );
}

.fb-stat-card[data-key="workplace"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.fb-stat-card[data-key="workplace"].active {
  box-shadow:
    0 0 0 2px #ef4444,
    0 8px 28px rgba(239, 68, 68, 0.18);
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
}

.fb-stat-card[data-key="workplace"] .fb-stat-value {
  color: #dc2626;
}

/* travel — violet */
.fb-stat-card[data-key="travel"] {
  color: #5b21b6;
}

.fb-stat-card[data-key="travel"]::before {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.fb-stat-card[data-key="travel"]::after {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.06),
    rgba(168, 85, 247, 0.06)
  );
}

.fb-stat-card[data-key="travel"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.fb-stat-card[data-key="travel"].active {
  box-shadow:
    0 0 0 2px #8b5cf6,
    0 8px 28px rgba(139, 92, 246, 0.18);
  background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
}

.fb-stat-card[data-key="travel"] .fb-stat-value {
  color: #7c3aed;
}

/* improve — green→cyan */
.fb-stat-card[data-key="improve"] {
  color: #065f46;
}

.fb-stat-card[data-key="improve"]::before {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.fb-stat-card[data-key="improve"]::after {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.06),
    rgba(6, 182, 212, 0.06)
  );
}

.fb-stat-card[data-key="improve"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.fb-stat-card[data-key="improve"].active {
  box-shadow:
    0 0 0 2px #10b981,
    0 8px 28px rgba(16, 185, 129, 0.18);
  background: linear-gradient(135deg, #ecfdf5 0%, #ecfeff 100%);
}

.fb-stat-card[data-key="improve"] .fb-stat-value {
  color: #059669;
}

/* opinion — indigo→purple */
.fb-stat-card[data-key="opinion"] {
  color: #3730a3;
}

.fb-stat-card[data-key="opinion"]::before {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.fb-stat-card[data-key="opinion"]::after {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.06),
    rgba(139, 92, 246, 0.06)
  );
}

.fb-stat-card[data-key="opinion"] .fb-stat-icon-top {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.fb-stat-card[data-key="opinion"].active {
  box-shadow:
    0 0 0 2px #6366f1,
    0 8px 28px rgba(99, 102, 241, 0.18);
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
}

.fb-stat-card[data-key="opinion"] .fb-stat-value {
  color: #4f46e5;
}

/* ── Divider ── */
.fb-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
  margin: 0.5rem 0 1rem 0;
}

/* ═══ Response Items v2 ═══ */

@keyframes fbItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fb-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fbItemIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fb-item:nth-child(1) {
  animation-delay: 0.05s;
}

.fb-item:nth-child(2) {
  animation-delay: 0.1s;
}

.fb-item:nth-child(3) {
  animation-delay: 0.15s;
}

.fb-item:nth-child(4) {
  animation-delay: 0.2s;
}

.fb-item:nth-child(5) {
  animation-delay: 0.25s;
}

.fb-item:nth-child(6) {
  animation-delay: 0.3s;
}

.fb-item:nth-child(7) {
  animation-delay: 0.35s;
}

.fb-item:nth-child(8) {
  animation-delay: 0.4s;
}

.fb-item:nth-child(n + 9) {
  animation-delay: 0.45s;
}

.fb-item:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  border-color: #c7d2fe;
  transform: translateY(-3px);
}

.fb-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
  border-bottom: 1px solid #e8ecf4;
}

.fb-item-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
}

.fb-item-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.fb-item-body {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.8;
  word-break: keep-all;
  padding: 0.75rem 1rem;
}

.fb-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.fb-row:last-child {
  margin-bottom: 0;
}

.fb-row-text {
  flex: 1;
  min-width: 0;
}

/* 태그 pill — 그라디언트 미세 적용 */
.fb-item-body .fb-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0;
  border-radius: 6px;
  min-width: 65px;
  width: 65px;
  text-align: center;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fb-tag-near {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.fb-tag-work {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
}

.fb-tag-travel {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
}

.fb-tag-improve {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}

.fb-tag-opinion {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

.fb-item-body .fb-no-hazard {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.82rem;
}

/* Refresh Button */
.fb-btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
}

.fb-btn-refresh:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.fb-btn-refresh:disabled {
  opacity: 0.5;
  cursor: wait;
}

.fb-center-text {
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Empty State */
.fb-center {
  text-align: center;
  padding: 3rem 1rem;
}

.fb-center-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.fb-center-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

.fb-center svg {
  width: 40px;
  height: 40px;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

/* ── Skeleton UI ── */
@keyframes fbShimmer {
  0% {
    background-position: -400px 0;
  }

  100% {
    background-position: 400px 0;
  }
}

.fb-skeleton-bar {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 800px 100%;
  animation: fbShimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

.fb-skeleton-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1vw, 0.75rem);
  margin-bottom: 1.5rem;
}

.fb-skeleton-stat-card {
  border-radius: 16px;
  padding: clamp(0.75rem, 1.1vw, 1rem) clamp(0.6rem, 0.9vw, 0.85rem);
  border: 1px solid #f1f5f9;
  background: #fafbfc;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.fb-skeleton-stat-card .sk-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
}

.fb-skeleton-stat-card .sk-value {
  width: 40px;
  height: 20px;
  margin-bottom: 0.25rem;
}

.fb-skeleton-stat-card .sk-label {
  width: 52px;
  height: 12px;
}

.fb-skeleton-item {
  border-radius: 14px;
  border: 1px solid #f1f5f9;
  background: #fafbfc;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.fb-skeleton-item-header {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.fb-skeleton-item-header .sk-name {
  width: 60px;
  height: 14px;
}

.fb-skeleton-item-header .sk-meta {
  width: 100px;
  height: 12px;
}

.fb-skeleton-item-body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fb-skeleton-item-body .sk-line {
  height: 14px;
  border-radius: 6px;
}

.fb-skeleton-item-body .sk-line:nth-child(1) {
  width: 85%;
}

.fb-skeleton-item-body .sk-line:nth-child(2) {
  width: 65%;
}

/* ── Load More Button ── */
.fb-load-more-wrap {
  text-align: center;
  margin-top: 1rem;
}

.fb-btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.6rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-btn-load-more:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.fb-btn-load-more svg {
  width: 16px;
  height: 16px;
}

/* ==== Risk_Dash.html Styles ==== */

.risk-dash-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
  padding: 60px 20px;
}

.risk-dash-placeholder .placeholder-icon {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #f59e0b;
}

.risk-dash-placeholder .placeholder-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
}

.risk-dash-placeholder .placeholder-desc {
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  line-height: 1.6;
  max-width: 400px;
}

.risk-dash-placeholder .placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: #f1f5f9;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

