:root {
  /* Professional Palette */
  --primary: #0f172a;
  /* Deep Navy for headings/text */
  --accent: #2563eb;
  /* Royal Blue for primary actions */
  --accent-hover: #1d4ed8;
  --success: #10b981;
  --bg-body: #f1f5f9;
  /* Slate 100 - Clean Light Gray */
  --surface: #ffffff;
  --border: #e2e8f0;
  /* Slate 200 */
  --text-main: #334155;
  /* Slate 700 */
  --text-sub: #64748b;
  /* Slate 500 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Premium Effects */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --grad-primary: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --grad-accent: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --grad-admin: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
  /* Orange-Gold for Admin */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    Roboto,
    sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem 2rem;
  /* 상단 여백 복구 */
}

/* Navigation Bar & Sticky Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  box-shadow: var(--shadow-md);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: 70px;
  background: white;
  border-bottom: 1px solid var(--border);
}

.nav-brand,
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 40px !important;
  /* 강제 고정하여 타 페이지 크기 문제 해결 */
  width: auto;
}

.nav-title {
  font-size: 1.25rem !important;
  /* Fixed size to match main exactly */
  font-weight: 800 !important;
  /* Thicker weight for premium look */
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav-tabs-wrapper {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.nav-tabs-wrapper .tabs-container {
  display: flex;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
}

.nav-tabs-wrapper .tab-btn {
  border: none;
  background: none;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tabs-wrapper .tab-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.5);
}

.nav-tabs-wrapper .tab-btn.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Remove bottom bar as we use pill style now */
.nav-tabs-wrapper .tab-btn.active::after {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.nav-actions .divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.report-btn {
  font-size: 0.9rem;
  color: var(--text-sub);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.report-btn:hover {
  color: var(--accent);
}

/* --- Responsive Navigation Header --- */
@media (max-width: 1200px) {
  .nav-title {
    display: none !important;
  }
  #welcomeMsg {
    display: none !important;
  }
}

@media (max-width: 850px) {
  .navbar {
    height: auto;
    padding: 1rem 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .nav-brand {
    order: 1;
  }
  .nav-actions {
    order: 2;
    margin-left: auto;
  }
  .nav-tabs-wrapper {
    order: 3;
    width: 100%;
    margin-top: 5px;
  }
  .nav-tabs-wrapper .tabs-container {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
}

/* Hero Section */
/* Hero Section - 지연 로딩 및 성능 최적화 버전 */
#global-hero {
  width: calc(100% - 4rem) !important;
  /* 좌우 2rem씩 고정 여백 확보 */
  max-width: 1536px !important;
  /* 하단 컨테이너 내부 폭과 일치 (1600-64) */
  margin: 1.5rem auto 1.5rem !important;
  text-align: center !important;
  /* 배경 이미지는 script.js에서 지연 로딩 처리함 */
  background-color: #0f172a !important;
  /* 배경색 미리 지정으로 로딩 중 답답함 해소 */
  background-size: cover !important;
  background-position: center !important;
  padding: 4rem 2rem !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  color: white !important;
  display: block !important;
  /* Show immediately to avoid CLS and perceived delay */
  min-height: 300px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: opacity 0.5s ease-in-out;
  /* 부드러운 등장 효과 */
}

/* 대문 배경 로드 완료 시 적용될 클래스 */
#global-hero {
  /* Combined gradient overlay and image path for faster parallel download */
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.45)),
    url("../image/hero_bg.png") !important;
  background-size: cover;
  background-position: center;
}

.hero-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}

/* Removed duplicated highlight to allow hero gradient */

.hero-content p {
  color: #cbd5e1;
  /* Light slate text */
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Modern Card (Surface) */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 1rem;
  /* 1.5rem -> 1rem 으로 대폭 축소 */
  margin-bottom: 1rem;
  /* 1.5rem -> 1rem 으로 대폭 축소 */
  transition: box-shadow 0.2s;
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Search Container */
.search-container {
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Login Wall & Lock Effect */
.search-container.locked {
  min-height: 400px;
}

.dashboard-section.is-locked > *:not(.login-wall) {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
}

.login-wall {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  border-radius: inherit;
  /* Match card radius */
}

.login-wall-content {
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  max-width: 380px;
  animation: fadeInUp 0.4s ease-out;
  margin-top: 20px;
  /* Slight offset from header */
}

.lock-icon {
  width: 60px;
  height: 60px;
  background: var(--bg-body);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.login-wall-content h3 {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.login-wall-content p {
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.login-wall-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.missing-row td {
  border-bottom: 1px dashed #fecdd3 !important;
}

.missing-row:hover {
  background-color: #ffe4e6 !important;
  opacity: 1 !important;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.input-group input,
.input-group select,
.input-group textarea {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.95rem;
  color: var(--primary);
  transition: var(--transition-fast);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Cert Filter */
.cert-filter {
  margin-bottom: 2rem;
}

.cert-filter label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.cert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cert-tag {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-sub);
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
}

.cert-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cert-tag.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Worker Filter (Matches Cert Filter) */
.worker-filter {
  margin-bottom: 2rem;
}

.worker-filter label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.worker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.worker-tag {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-sub);
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
}

.worker-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.worker-tag.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Smart Target (Training Course) Chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: white;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.chip .chip-label {
  margin-right: 6px;
}

.chip .chip-remove {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--accent);
  transition:
    background 0.2s,
    color 0.2s;
}

.chip .chip-remove:hover {
  background: #dbeafe;
  color: #1e3a8a;
}

/* Suggestion Box Items */
.suggestion-item {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  transition: background 0.1s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #f8fafc;
  color: var(--primary);
  font-weight: 600;
}

/* [MODERN] Button Styles */
.primary-btn,
.search-btn,
.danger-btn,
.nav-btn.login-btn,
.nav-btn.register-btn,
.nav-btn.logout-btn,
.nav-btn.profile-btn,
.nav-btn.admin-btn {
  background: var(--grad-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
  text-decoration: none;
  font-size: 0.95rem;
}

/* [NEW] AI 지능형 매칭 작동 시 버튼 스타일링 */
.search-btn.ai-working {
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899) !important;
  animation: pulse-ai 2s infinite;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  color: white !important;
  opacity: 1 !important;
}

@keyframes pulse-ai {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  }
}

.nav-btn.admin-btn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
}

.nav-btn.admin-btn:hover {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
  transform: translateY(-1px);
}

.nav-btn.login-btn,
.nav-btn.register-btn,
.nav-btn.logout-btn,
.nav-btn.profile-btn,
.nav-btn.admin-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.nav-btn.register-btn {
  background: white;
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-btn.logout-btn {
  background: white;
  color: var(--text-sub);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-btn.profile-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.primary-btn:hover,
.search-btn:hover,
.danger-btn:hover,
.nav-btn.login-btn:hover,
.nav-btn.register-btn:hover,
.nav-btn.logout-btn:hover,
.nav-btn.profile-btn:hover,
.nav-btn.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
  filter: brightness(1.1);
}

.nav-btn.register-btn:hover,
.nav-btn.logout-btn:hover,
.nav-btn.profile-btn:hover {
  background: #f8fafc;
  border-color: var(--accent);
  color: var(--accent);
}

.danger-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.danger-btn:hover {
  box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.primary-btn:active,
.search-btn:active,
.nav-btn:active {
  transform: translateY(0);
}

.search-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

/* AI 매칭 작동 효과 */
.search-btn.ai-working {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  animation: aiPulse 1.5s infinite;
  border: none;
}

@keyframes aiPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(168, 85, 247, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}

.export-btn {
  padding: 0.5rem 1rem;
  background: white;
  color: var(--success);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.export-btn:hover:not(:disabled) {
  background: #f0fdf4;
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.2);
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
}

/* [NEW] Credit Button Style (Integrated with Design System) */
.credit-btn {
  padding: 0.5rem 1rem;
  background: white;
  color: #475569;
  /* Slate 700 - Professional gray */
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.credit-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
  color: var(--primary);
}

.credit-btn:active {
  transform: translateY(0);
}

/* [NEW] Modal Renewal Styles (Side-by-Side Layout) */
.modal-grid {
  display: grid;
  grid-template-columns: 5.5fr 4.5fr;
  /* 1.1fr 0.9fr balance */
  gap: 2rem;
  margin-top: 1rem;
  align-items: start;
  /* Prevent mismatched heights from breaking layout */
}

/* CRITICAL: Prevent grid children from expanding beyond parent */
.modal-grid > div {
  min-width: 0;
}

/* Single column on small screens */
@media (max-width: 900px) {
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.info-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}

.info-box h4 {
  margin-bottom: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
}

.detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.detail-table th {
  text-align: left;
  color: #64748b;
  font-size: 0.85rem;
  width: 120px;
  font-weight: 600;
  vertical-align: top;
}

.detail-table td {
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 500;
}

.crm-premium-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.05),
    0 8px 10px -6px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* [NEW] Horizontal scroll for participation history */
.history-scroll-wrapper {
  white-space: nowrap;
  overflow-x: auto;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.6;
  max-width: 100%;
  /* Ensure it stays within parent */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.history-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.history-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.history-scroll-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* Info Section */
.info-card h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0;
}

.download-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Results Header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.results-header h2 {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
}

/* Results Table */
.results-table-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.results-table th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}

.results-table th i {
  font-size: 0.75rem;
  margin-left: 0.25rem;
  color: #94a3b8;
}

.results-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.925rem;
  color: var(--text-main);
  vertical-align: middle;
}

.company-name-text {
  color: var(--text-main);
  font-weight: 600;
}

/* CRM Status Badges - Optimized Distinct Colors */
.badge.status-target {
  background: #f1f5f9 !important;
  /* Slate 100 */
  color: #475569 !important;
  /* Slate 700 */
  border: 1px solid #cbd5e1;
}

.badge.status-contact {
  background: #fffbeb !important;
  /* Amber 50 */
  color: #b45309 !important;
  /* Amber 700 */
  border: 1px solid #fde68a;
}

.badge.status-contract {
  background: #ecfdf5 !important;
  /* Emerald 50 */
  color: #047857 !important;
  /* Emerald 700 */
  border: 1px solid #a7f3d0;
}

.badge.status-audit {
  background: #f5f3ff !important;
  /* Violet 50 */
  color: #6d28d9 !important;
  /* Violet 700 */
  border: 1px solid #ddd6fe;
}

.badge.status-final {
  background: #eff6ff !important;
  /* Blue 50 */
  color: #1d4ed8 !important;
  /* Blue 700 */
  border: 1px solid #bfdbfe;
}

.badge.status-target,
.badge.status-contact,
.badge.status-contract,
.badge.status-audit,
.badge.status-final {
  min-width: 85px;
  text-align: center;
  border-radius: 99px;
  padding: 4px 10px;
  font-weight: 700;
  display: inline-block;
}

.btn-manage {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary), #475569);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.btn-manage:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  filter: brightness(1.1);
}

.td-name {
  font-weight: 600;
  color: var(--primary);
}

.td-branch {
  color: var(--text-sub);
  white-space: nowrap;
  /* Force single line */
}

.td-id {
  /* Removed monospace */
  font-size: 0.9rem;
  color: var(--text-sub);
  white-space: nowrap;
  /* Force single line */
}

.td-industry {
  max-width: 120px;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-workers {
  min-width: 100px;
  white-space: nowrap;
  text-align: right;
  font-size: 0.925rem;
  font-family: inherit;
}

.td-address {
  min-width: 120px;
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.4;
}

.td-history {
  white-space: nowrap;
  text-align: center;
  width: 60px;
}

/* Badges */
.td-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.kangso {
  background: #ecfccb;
  color: #3f6212;
}

.badge.public {
  background: #e0f2fe;
  color: #0369a1;
}

.badge.innobiz {
  background: #f3e8ff;
  color: #6b21a8;
}

.badge.besthrd {
  background: #ffe4e6;
  color: #9f1239;
}

.badge.skilled {
  background: #ccfbf1;
  color: #0f766e;
}

.badge.research {
  background: #e0e7ff;
  color: #4338ca;
}

.badge.friendly {
  background: #fef3c7;
  color: #b45309;
}

.badge.world {
  background: #ede9fe;
  color: #5b21b6;
}

/* 참 괜찮은 강소기업 배지 (오렌지/피치 계열) */
.badge.nice {
  background: #ffedd5;
  color: #c2410c;
}

.view-more-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: #f1f5f9;
  color: var(--text-sub);
  border-radius: 4px;
  cursor: pointer;
}

.view-more-btn:hover {
  background: #e2e8f0;
  color: var(--primary);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-btn {
  background: white;
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
}

.page-btn:disabled {
  background: #f8fafc;
  color: #cbd5e1;
  cursor: not-allowed;
}

/* Modal */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.5);
  /* Improved backdrop */
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 800px;
  /* Increased from 550px for better visibility of long content */
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

/* [NEW] Specific width for download survey modal */
#downloadModal .modal-content {
  max-width: 450px;
}

.close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--primary);
}

#modalTitle {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  padding-right: 35px;
  /* X 버튼과의 겹침 방지 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.modal-title-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice-meta-badge {
  display: flex;
  gap: 12px;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.notice-meta-badge span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Utilities */
.back-link-container {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.back-link {
  color: var(--text-sub);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.back-link:hover {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
  margin: 3rem auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-sub);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Step Icons */
.step-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  /* Soft shadow for 3D effect */
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-sources strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.footer-sources ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem;
}

.footer-sources li {
  position: relative;
  padding-left: 1rem;
}

.footer-sources li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.footer-sources a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-sources a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-info {
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 1.5rem;
}

.copyright {
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Favorite Star Icon [Phase 5 Enhanced] */
.fav-cell {
  text-align: center;
  min-width: 60px;
  background-color: rgba(245, 158, 11, 0.05);
  /* Very subtle amber highlight */
  border-right: 1px solid rgba(245, 158, 11, 0.1);
}

.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: #cbd5e1;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  margin: 0 auto;
  gap: 2px;
}

.fav-btn:hover {
  transform: scale(1.2);
  color: #f59e0b;
}

.fav-btn.active {
  color: #f59e0b;
  /* Amber 500 */
  filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.5));
}

.fav-btn .fav-count {
  font-size: 0.75rem;
  color: var(--text-sub);
  font-weight: 500;
}

.fav-btn.active .fav-count {
  color: #b45309;
  /* Amber 700 */
  font-weight: 700;
}

/* CRM UI in Modal */
.crm-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #f1f5f9;
}

.crm-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-form-group {
  margin-bottom: 1.25rem;
}

.crm-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
}

.crm-select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 0.95rem;
}

.crm-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
}

.crm-save-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.crm-save-btn:hover {
  background: var(--accent-hover);
}

.crm-save-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Dashboard Styles */
.dashboard-section {
  margin-bottom: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.refresh-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  transition: color 0.2s;
}

.refresh-btn:hover {
  color: var(--accent);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.chart-container {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  min-height: 250px;
}

.hero-section {
  background:
    var(--grad-primary),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&q=80&w=2070")
      center/cover;
  color: white;
  padding: 5rem 2rem;
  text-align: center;
  border-radius: 0 0 24px 24px;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-fast);
}

body.hide-hero #global-hero {
  display: none !important;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-content h1.highlight {
  background: linear-gradient(120deg, #f0f9ff 0%, #e0f2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
  /* Soft glow for entire title */
  display: inline-block;
  /* Required for background-clip: text in some cases */
}

.hero-content p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.stats-list-container {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.stats-list-container h4 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.stats-list {
  list-style: none;
  padding: 0;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.stats-list li:last-child {
  border-bottom: none;
}

.stats-list .rank {
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

.stats-list .count {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Main Tab Navigation Styles [NEW] */
.main-tabs-nav {
  margin: 1.5rem 0;
  position: sticky;
  top: 10px;
  z-index: 100;
}

.tabs-container {
  display: flex;
  gap: 10px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  width: fit-content;
  margin: 0 auto;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn i {
  font-size: 1rem;
  transition: transform 0.3s;
}

.tab-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.5);
}

.tab-btn:hover i {
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.tab-btn.active i {
  color: white;
}

/* Tab Content Logic */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Notice Styles */
.notice-section {
  margin-bottom: 2rem;
}

.notice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.notice-table th {
  background: #f8fafc;
  padding: 12px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 2px solid #e2e8f0;
}

.notice-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.notice-table tr:hover td {
  background: #f8fafc;
}

/* Premium Insight Dashboard */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
}

.kpi-icon {
  width: 60px;
  height: 60px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}

.kpi-icon.accent {
  background: #fffbeb;
  color: #f59e0b;
}

.kpi-icon.success {
  background: #ecfdf5;
  color: #10b981;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.9rem;
  color: var(--text-sub);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.ranking-board {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.ranking-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.ranking-name {
  font-weight: 700;
  color: var(--text-main);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-count {
  color: var(--primary);
  font-weight: 800;
}

.progress-container {
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 99px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  filter: blur(4px);
}

/* Dashboard Enhancements (Unified Tone) */
.dashboard-grid-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 1100px) {
  .dashboard-grid-trio {
    grid-template-columns: 1fr;
  }
}

.stats-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1rem;
  /* Reduced bottom padding from 1.5rem */
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stats-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  /* Reduced from 1.25rem */
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.title-icon {
  width: 32px;
  height: 32px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
}

.title-icon i {
  font-size: 0.9rem;
  line-height: 1 !important;
  margin: 0 !important;
  display: block !important;
}

.title-icon.primary {
  background: #eff6ff;
  color: #3b82f6;
}

.title-icon.accent {
  background: #fff7ed;
  color: #f59e0b;
}

.title-icon.rose {
  background: #fff1f2;
  color: #e11d48;
}

.title-icon.indigo {
  background: #eef2ff;
  color: #6366f1;
}

/* Redesigned Pipeline (Timeline Style) */
.pipeline-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 10px;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 0 0 1.25rem 0;
  /* Reduced from 1.5rem */
  position: relative;
  background: transparent;
  /* Remove box */
  border: none;
}

.pipeline-step::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 24px;
  width: 2px;
  height: calc(100% - 24px);
  background: #e2e8f0;
}

.pipeline-step:last-child::before {
  display: none;
}

.step-number {
  width: 24px;
  height: 24px;
  background: white;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
  z-index: 2;
}

.pipeline-step.active .step-number {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.pipeline-step.active .step-title {
  color: var(--primary);
}

.step-info {
  flex: 1;
}

.step-title {
  font-size: 0.85rem;
  /* Reduced from 0.95rem */
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.step-count {
  font-size: 1rem;
  /* Reduced from 1.1rem */
  font-weight: 800;
  color: var(--primary);
}

.last-update {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-right: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
}

.notice-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 6px;
}

.notice-badge.pinned {
  background: #fee2e2;
  color: #ef4444;
}

.chart-box {
  flex: 1;
  min-height: 250px;
  position: relative;
  max-height: 280px;
}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stats-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.stats-list li:last-child {
  border-bottom: none;
}

.stats-list .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #eff6ff;
  color: #3b82f6;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.75rem;
  margin-right: 8px;
}

.stats-list .count {
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

/* Footer & Margin Adjustments */
footer {
  padding: 1rem 0 3rem;
  /* 상단 여백 줄임 */
  border-top: 1px solid var(--border);
  background: white;
}

.footer-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem;
  /* 좌우 여백 복구 */
}

/* General Layout Support */
.hidden {
  display: none !important;
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  /* Further reduced */
  transition: var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ---------------------------------------------------------
   Notice Detail Modal and Attachments [Optimized]
   --------------------------------------------------------- */
/* notice-detail-header removed to move meta to title area */

.notice-content-body {
  line-height: 1.6;
  color: #334155;
  font-size: 0.95rem;
  min-height: 100px;
}

.attachment-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.attachment-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  text-decoration: none;
  color: #475569;
  font-size: 0.85rem;
  width: fit-content;
  max-width: 100%;
}

.attachment-item:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #e2e8f0;
}

.attachment-icon {
  color: #94a3b8;
  font-size: 0.9rem;
}

.attachment-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.attachment-size {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-left: 5px;
}

/* ---------------------------------------------------------
   [NEW] Password Toggle & Form Guide Styles
   --------------------------------------------------------- */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-icon {
  position: absolute;
  right: 12px;
  cursor: pointer;
  color: var(--text-sub);
  font-size: 1rem;
  transition: var(--transition-fast);
  padding: 5px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-icon:hover {
  color: var(--accent);
}

.form-guide {
  display: block;
  font-size: 0.75rem;
  margin-top: 5px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.form-guide.valid {
  color: #22c55e;
}

.form-guide.invalid {
  color: #ef4444;
}

/* Intelligent Button Styles */
.primary-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.primary-btn.ready {
  background: var(--grad-accent);
  color: white;
}

/* ---------------------------------------------------------
   [NEW] Status Guide Tooltip Styles (Perfected)
   --------------------------------------------------------- */
.status-guide-icon {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #94a3b8;
  vertical-align: middle;
  transition: color 0.2s;
  line-height: 1;
  /* 아이콘 높이 정렬 */
}

.status-guide-icon:hover {
  color: #3b82f6;
}

.status-guide-tooltip {
  visibility: hidden;
  position: absolute;
  z-index: 1001;
  bottom: 150%;
  /* 아이콘 위쪽으로 확실히 배치 */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #ffffff;
  color: #334155;
  text-align: left;
  padding: 12px 18px;
  /* 상하 패딩 감소 16->12 */
  border-radius: 12px;
  width: max-content;
  /* 내용에 맞게 너비 자동 조절 */
  min-width: 300px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  line-height: 1.4;
  /* 줄간격 감소 1.6->1.4 */
}

.status-guide-tooltip strong {
  display: block;
  margin-bottom: 8px;
  /* 하단 여백 감소 12->8 */
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 800;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 6px;
  /* 하단 패딩 감소 8->6 */
}

.status-guide-tooltip ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.status-guide-tooltip li {
  margin-bottom: 4px !important;
  /* 항목 간 간격 감소 8->4 */
  display: flex !important;
  /* 가로 정렬을 위해 flex 사용 */
  align-items: flex-start;
  color: #64748b;
  white-space: nowrap;
  /* 한 줄로 표시 강제 */
}

.status-guide-tooltip li b {
  color: #2563eb;
  margin-right: 8px;
  display: inline-block;
  min-width: 75px;
  /* 균등 정렬을 위한 최소 너비 최적화 */
  flex-shrink: 0;
}

.status-guide-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.status-guide-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -9px;
  border-width: 9px;
  border-style: solid;
  border-color: #e2e8f0 transparent transparent transparent;
  z-index: -1;
}

.status-guide-icon:hover .status-guide-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* [NEW] Cert Guide Icon Styles */
.cert-guide-icon {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #94a3b8;
  vertical-align: middle;
  transition: color 0.2s;
  line-height: 1;
}

.cert-guide-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0; 
  transform: translateX(-15px) translateY(10px);
  background: white;
  border: 1px solid #e2e8f0;
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  color: #334155;
  font-size: 0.95rem;
  z-index: 100;
  min-width: 950px; 
  max-width: 90vw;
  transition: all 0.2s ease;
  pointer-events: none;
  font-weight: normal;
  text-align: left;
  line-height: 1.6;
}

.cert-guide-tooltip ul, .status-guide-tooltip ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.cert-guide-tooltip li, .status-guide-tooltip li {
  margin-bottom: 8px;
  word-break: keep-all; 
}

/* 추가된 툴팁 리스트 공통 디자인 */
.tooltip-list {
  padding-left: 0;
  margin: 0;
}

.tooltip-list li {
  position: relative;
  padding-left: 12px;
  margin-bottom: 6px;
  line-height: 1.5;
  color: var(--text-sub);
}

.tooltip-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: bold;
}

.tooltip-list li b {
  color: var(--text-main);
  font-weight: 700;
}

.tooltip-section-title {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.tooltip-content-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 툴팁 화살표 부분: 아이콘 중앙(약 12px~15px)을 가리키도록 고정 */
.cert-guide-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 15px;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent #e2e8f0 transparent;
}

.cert-guide-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 15px;
  margin-left: -7px;
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent white transparent;
}

.cert-guide-icon:hover .cert-guide-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-15px) translateY(0);
}

.cert-guide-icon:hover {
  color: #3b82f6;
}

/* [NEW] History Section Styles */
.history-section-header {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-detail-table th, .history-detail-table td {
  border-right: 1px solid #f1f5f9;
}

.history-detail-table th:last-child, .history-detail-table td:last-child {
  border-right: none;
}

.history-detail-table tbody tr:hover {
  background: #f8fafc;
}

/* [NEW] Map Link Style */
.clickable-address {
  cursor: pointer;
  transition: color 0.15s, text-decoration 0.15s;
  display: inline-block;
  color: #334155;
}

.clickable-address:hover {
  color: #2563eb;
  text-decoration: underline;
}
