/*
  style.css — JT 방문자 관리 시스템 디자인 파일
  다크모드 + 글래스모피즘 스타일
  남건이 보기 쉽게 각 섹션에 한글 주석을 달았습니다!
*/

/* =========================================================
   1. 구글 폰트 & 전역 CSS 변수(색상, 크기 등) 정의
   ========================================================= */
:root {
  /* 배경 색상 */
  --bg-start: #0a0f1e;
  --bg-end: #0d1b2a;

  /* 카드/유리 효과 색상 */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.07);

  /* 주요 포인트 색상 (파란색 계열) */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.3);

  /* 강조 색상 (청록색) */
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --accent-light: rgba(6, 182, 212, 0.15);

  /* 성공/경고/위험 색상 */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);

  /* 텍스트 색상 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* 테두리/구분선 색상 */
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);

  /* 폰트 */
  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 둥근 모서리 크기 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 그림자 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);

  /* 전환 애니메이션 속도 */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* =========================================================
   2. 브라우저 기본값 초기화 & 공통 설정
   ========================================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-start);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* =========================================================
   3. 배경 그라디언트 장식
   ========================================================= */
/* 화면 뒤에 퍼지는 은은한 빛 효과 */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(59,130,246,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(6,182,212,0.06) 0%, transparent 60%),
    linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  pointer-events: none; /* 클릭 이벤트는 통과시킵니다 */
}

/* =========================================================
   4. 앱 전체 레이아웃
   ========================================================= */
.app-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;              /* 화면 전체 너비 사용 */
  max-width: 100%;          /* 최대 너비 제한 해제 */
  margin: 0;
  padding: 1.5rem 2rem 3rem; /* 좌우 여백을 2rem으로 */
  box-sizing: border-box;
  display: flex;
  flex-direction: row;    /* 가로 배치 */
  align-items: flex-start;
  gap: 1.5rem;
  min-height: 100vh;
}

/* =========================================================
   5. 사이드바 (LNB) & 헤더
   ========================================================= */
.app-sidebar {
  width: 200px;           /* 200px로 줄여 오른쪽 공간 최대화 */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 1.5rem;
  height: fit-content;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-header .logo-icon { font-size: 2rem; }
.sidebar-header .header-title { font-size: 1.25rem; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-icon { font-size: 1.2rem; }
.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.25);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(59,130,246,0.5));
}

.header-title {
  font-size: 1.3rem;
  font-weight: 700;
  /* 텍스트에 그라디언트 색상을 입힙니다 */
  background: linear-gradient(135deg, #60a5fa, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.header-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-feature-settings: "tnum"; /* 숫자 너비를 균일하게 */
  text-align: right;
}

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


/* =========================================================
   8. 카드 (글래스모피즘 스타일)
   ========================================================= */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-icon {
  font-size: 1.2rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* =========================================================
   9. 폼 스타일 (입력 필드, 라벨 등)
   ========================================================= */
/* 2열 그리드 레이아웃 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* 3열 그리드 레이아웃 (직원 추가 폼) */
.form-grid-3 {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

/* 각 입력 필드 묶음 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* 라벨 텍스트 */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* 필수 입력 표시 (빨간 별표) */
.required {
  color: var(--danger);
}

/* 입력 필드 (input, select) */
.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

/* 입력 필드 안에 클릭할 때 (포커스 상태) */
.form-input:focus {
  border-color: var(--border-focus);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 플레이스홀더(안내 문구) 색상 */
.form-input::placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* 드롭다운(select) 화살표 색상 */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* 드롭다운 옵션의 배경 (어두운 배경에서도 읽히도록) */
.form-select option {
  background: #1e293b;
  color: var(--text-primary);
}

/* datetime-local 입력 필드 달력 아이콘 색상 */
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

/* 직원 추가 폼에서 버튼이 아래 정렬되도록 */
.form-group-btn {
  justify-content: flex-end;
}

/* 폼 구분선 */
.visitor-form,
.employee-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* =========================================================
   10. 버튼 스타일
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

/* 파란색 주요 버튼 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

/* 청록색 강조 버튼 */
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 15px rgba(6,182,212,0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6,182,212,0.4);
}

/* 빨간색 위험 버튼 (삭제용) */
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239,68,68,0.4);
}

/* 투명한 보조 버튼 */
.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* 아이콘만 있는 작은 버튼 */
.btn-icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.85rem;
  min-width: 34px;
  min-height: 34px;
}

.btn-icon-only:hover {
  background: rgba(239,68,68,0.25);
}

/* 버튼이 가득 찰 때 */
.btn-full {
  width: 100%;
}

/* 로딩 중 버튼 비활성화 스타일 */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* =========================================================
   11. 검색 바
   ========================================================= */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 0.9rem;
  transition: all var(--transition);
}

.search-bar:focus-within {
  border-color: var(--border-focus);
  background: rgba(59,130,246,0.06);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  transition: all var(--transition);
}

.search-clear:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* =========================================================
   12. 방문 기록 카드 목록
   ========================================================= */
.records-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 각 방문 기록 카드 */
.record-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition);
  animation: fadeSlideIn 0.25s ease;
}

.record-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.12);
  transform: translateX(3px);
}

/* 카드 왼쪽 색상 바 */
.record-card::before {
  content: '';
  flex-shrink: 0;
  width: 3px;
  height: 100%;
  min-height: 50px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* 카드 정보 영역 */
.record-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.record-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* 회사명, 방문목적 등의 태그 그룹 */
.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.record-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* 회사 태그 (파란색 계열) */
.tag-company {
  background: var(--primary-light);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.2);
}

/* 직원 태그 (초록색 계열) */
.tag-employee {
  background: var(--success-light);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.2);
}

/* 방문목적 태그 (청록 계열) */
.tag-purpose {
  background: var(--accent-light);
  color: #67e8f9;
  border: 1px solid rgba(6,182,212,0.2);
}

/* 날짜/시간 */
.record-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* 연락처 */
.record-phone {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* 카드 오른쪽 삭제 버튼 */
.record-actions {
  flex-shrink: 0;
}

/* =========================================================
   13. 직원 목록
   ========================================================= */
.employees-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* 각 직원 카드 */
.employee-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all var(--transition);
  animation: fadeSlideIn 0.25s ease;
}

.employee-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.12);
}

.employee-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.employee-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.employee-dept {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =========================================================
   14. 로딩 / 빈 상태 표시
   ========================================================= */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.empty-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* 회전하는 로딩 스피너 */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59,130,246,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================================================
   15. 토스트 알림 (화면 오른쪽 하단 팝업)
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}

.toast-success {
  background: rgba(16,185,129,0.9);
  color: #fff;
  border: 1px solid rgba(16,185,129,0.5);
}

.toast-error {
  background: rgba(239,68,68,0.9);
  color: #fff;
  border: 1px solid rgba(239,68,68,0.5);
}

.toast-info {
  background: rgba(59,130,246,0.9);
  color: #fff;
  border: 1px solid rgba(59,130,246,0.5);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}



/* =========================================================
   17. 하단 푸터
   ========================================================= */


/* =========================================================
   18. 반응형 디자인 (모바일 화면 최적화)
   ========================================================= */
@media (max-width: 640px) {
  .app-wrapper {
    padding: 1rem 0.75rem 2rem;
    gap: 1rem;
  }

  /* 모바일에서 헤더 시간 숨김 */
  .header-time {
    display: none;
  }

  .header-title {
    font-size: 1.1rem;
  }


  /* 폼을 1열로 변경 */
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.25rem;
  }

  /* 직원 카드를 1열로 */
  .employees-list {
    grid-template-columns: 1fr;
  }

  /* 방문 기록 카드 간소화 */
  .record-card {
    padding: 0.9rem 1rem;
  }
}

/* =========================================================
   19. 스크롤바 커스텀
   ========================================================= */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.18);
}

/* =========================================================
   20. 4단계 위자드 전용 스타일
   ========================================================= */

/* 위자드 카드는 내부 gap을 좀 더 줍니다 */
.wizard-card {
  gap: 2rem;
}

/* ── 프로그레스 바 ── */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.5rem 0 0.25rem;
}

/* 각 단계 원 + 라벨 묶음 */
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* 단계 번호 원 */
.progress-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  transition: all 0.35s ease;
}

/* 활성화된 단계 원 */
.progress-step.active .progress-circle {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

/* 완료된 단계 원 */
.progress-step.done .progress-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 0 12px rgba(16,185,129,0.4);
}

/* 단계 라벨 텍스트 */
.progress-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.35s ease;
  white-space: nowrap;
}

.progress-step.active .progress-label {
  color: var(--primary);
}

.progress-step.done .progress-label {
  color: var(--success);
}

/* 단계 사이 연결선 */
.progress-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 0 4px;
  margin-bottom: 20px; /* 라벨 높이만큼 올려서 원 중간에 맞춤 */
  transition: background 0.35s ease;
}

.progress-line.active {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ── 위자드 단계 콘텐츠 ── */
.wizard-step {
  display: none;
  flex-direction: column;
  gap: 1.4rem;
  animation: fadeSlideIn 0.3s ease;
}

.wizard-step.active {
  display: flex;
}

/* 단계 헤더 */
.step-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── 방문 목적 버튼 선택 ── */
.purpose-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.purpose-btn {
  padding: 0.6rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.purpose-btn:hover {
  border-color: rgba(59,130,246,0.4);
  color: var(--text-primary);
  background: var(--primary-light);
}

/* 선택된 방문 목적 버튼 */
.purpose-btn.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ── 건강 체크 / 준수사항 문항 ── */
.health-questions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 개별 문항 행 */
.hq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.hq-item:hover {
  background: rgba(255,255,255,0.05);
}

/* 문항 텍스트 영역 */
.hq-text {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* 문항 번호 원 */
.hq-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 예/아니오 버튼 묶음 */
.yn-buttons {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* 예/아니오 버튼 공통 */
.yn-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

/* '예' 버튼 기본 */
.yn-yes {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.2);
  color: var(--danger);
}

.yn-yes:hover {
  background: rgba(239,68,68,0.2);
}

/* '예' 버튼 선택됨 */
.yn-yes.selected {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

/* '아니오' 버튼 기본 */
.yn-no {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.2);
  color: var(--success);
}

.yn-no:hover {
  background: rgba(16,185,129,0.2);
}

/* '아니오' 버튼 선택됨 */
.yn-no.selected {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.4);
}

/* ── 동의 문구 박스 ── */
.agreement-box {
  background: var(--primary-light);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: #93c5fd;
  text-align: center;
  line-height: 1.6;
}

/* ── 서명 패드 ── */
.signature-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-md);
  border: 2px dashed rgba(255,255,255,0.3);
  cursor: crosshair;
  touch-action: none; /* 모바일에서 터치 서명 지원 */
  display: block;
}

.signature-clear-btn {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
}

.signature-clear-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

/* ── 적합/부적합 버튼 ── */
.fitness-buttons {
  display: flex;
  gap: 0.75rem;
}

.fitness-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}

/* 적합 버튼 기본 */
.fitness-ok {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
  color: var(--success);
}

.fitness-ok:hover, .fitness-ok.active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.4);
}

/* 부적합 버튼 기본 */
.fitness-ng {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: var(--danger);
}

.fitness-ng:hover, .fitness-ng.active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239,68,68,0.4);
}

/* ── 결재 상태 배지 ── */
.approval-badge-wrap {
  padding: 0.55rem 0;
}

.approval-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-pending {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.3);
}

.badge-approved {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.3);
}

.badge-rejected {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}

/* ── 위자드 하단 버튼 영역 ── */
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

/* 텍스트 영역 (특이사항) */
.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* ── 방문 기록 카드 - 추가 배지 ── */
.tag-fitness-ok {
  background: var(--success-light);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.2);
}

.tag-fitness-ng {
  background: var(--danger-light);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.2);
}

.tag-pending {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.2);
}

/* 반응형: 모바일에서 위자드 조정 */
@media (max-width: 640px) {
  .progress-circle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .progress-label {
    font-size: 0.62rem;
  }

  .hq-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .yn-buttons {
    width: 100%;
  }

  .yn-btn {
    flex: 1;
    text-align: center;
  }

  .purpose-buttons {
    flex-direction: column;
  }

  .purpose-btn {
    width: 100%;
  }

  .fitness-buttons {
    flex-direction: column;
  }

  .wizard-actions {
    flex-wrap: wrap;
  }

  .wizard-actions .btn {
    flex: 1;
    min-width: 80px;
  }
}

/* =========================================================
   모바일 반응형 (하단 네비게이션)
   ========================================================= */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
    padding-bottom: 80px; /* 하단 탭 공간 확보 */
  }
  .app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
    z-index: 1000;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.95);
  }
  .sidebar-header {
    display: none; /* 모바일에서는 로고 숨김 */
  }
  .sidebar-nav {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }
  .nav-btn {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem;
    flex: 1;
    text-align: center;
    justify-content: center;
  }
  .nav-icon {
    font-size: 1.5rem;
  }
  .nav-text {
    font-size: 0.75rem;
  }
  .nav-badge {
    position: absolute;
    top: 5px;
    right: 20%;
  }
}

/* =========================================================
   모달 (Modal) 스타일
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  animation: fadeSlideIn 0.2s ease;
}

.modal-lg { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--glass-hover); }

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* =========================================================
   관리자 탭 / 직원 그리드
   ========================================================= */
.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding-top: 0.5rem;
}

.employee-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all var(--transition);
}
.employee-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.employee-info { flex: 1; min-width: 0; }
.employee-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.employee-dept {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 역할 배지 */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  margin-top: 0.35rem;
}
.role-guide {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.3);
}
.role-approver {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.3);
}
.role-both {
  background: rgba(139,92,246,0.15);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.3);
}

/* =========================================================
   비밀번호 표시 토글 (눈알 버튼)
   ========================================================= */
.pw-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrapper .form-input {
  padding-right: 2.5rem; /* 버튼 들어갈 공간 확보 */
}

.pw-toggle-btn {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  opacity: 0.6;
}

.pw-toggle-btn:hover {
  opacity: 1;
}
