/* ─── 브레디스헬스케어 CRM 커스텀 스타일 ─── */

:root {
  --bh-navy:       #1A3A5C;
  --bh-navy-dark:  #122a45;
  --bh-navy-light: #2a5080;
  --bh-accent:     #2E86C1;
  --bh-accent-light: #5DADE2;
  --bh-bg:         #F5F7FA;
  --bh-sidebar-w:  230px;
}

body {
  background-color: var(--bh-bg);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  color: #2c3e50;
}

/* ─── 네비게이션 바 ─── */
.bh-navbar {
  background-color: var(--bh-navy) !important;
  height: 58px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* ─── 사이드바 ─── */
.bh-sidebar {
  width: var(--bh-sidebar-w);
  min-width: var(--bh-sidebar-w);
  background-color: var(--bh-navy-dark);
  min-height: calc(100vh - 58px);
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}

.bh-nav-link {
  color: rgba(255,255,255,0.72) !important;
  border-radius: 8px;
  padding: 9px 14px !important;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}

.bh-nav-link:hover,
.bh-nav-link.active {
  background-color: rgba(255,255,255,0.12) !important;
  color: #ffffff !important;
}

.bh-nav-link.active {
  background-color: var(--bh-accent) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.bh-nav-section {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* ─── 카드 ─── */
.bh-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e4eaf2;
  box-shadow: 0 1px 4px rgba(26,58,92,0.06);
}

/* ─── 버튼 ─── */
.btn-bh-primary {
  background-color: var(--bh-accent);
  border-color: var(--bh-accent);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 20px;
}
.btn-bh-primary:hover {
  background-color: var(--bh-navy);
  border-color: var(--bh-navy);
  color: #fff;
}

.btn-bh-outline {
  border: 1.5px solid var(--bh-accent);
  color: var(--bh-accent);
  border-radius: 8px;
  font-weight: 500;
}
.btn-bh-outline:hover {
  background-color: var(--bh-accent);
  color: #fff;
}

/* ─── 로그인 페이지 ─── */
.bh-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("/static/images/background.bd4eef3670da.png") center center / cover no-repeat;
}

.bh-login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(26,58,92,0.22);
  padding: 2.5rem 2.5rem;
  width: 100%;
  max-width: 420px;
}

.bh-login-logo {
  text-align: center;
  margin-bottom: 1.8rem;
}

.bh-login-logo .logo-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bh-navy);
  margin-top: 0.5rem;
}

.bh-login-logo .logo-subtitle {
  font-size: 0.78rem;
  color: #7f8c9a;
  margin-top: 0.1rem;
}

/* ─── 폼 ─── */
.form-control:focus,
.form-select:focus {
  border-color: var(--bh-accent);
  box-shadow: 0 0 0 0.2rem rgba(46,134,193,0.18);
}

.form-label {
  font-weight: 600;
  font-size: 0.87rem;
  color: #3a4a5c;
  margin-bottom: 4px;
}

/* ─── 테이블 ─── */
.bh-table {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(26,58,92,0.06);
}

.bh-table thead th {
  background-color: var(--bh-navy);
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 0.83rem;
  border: none;
  padding: 12px 16px;
}

.bh-table tbody tr:hover {
  background-color: #f0f6fc;
}

/* ─── 상태 뱃지 ─── */
.badge-pending   { background-color: #f39c12; color: #fff; }
.badge-approved  { background-color: #27ae60; color: #fff; }
.badge-rejected  { background-color: #e74c3c; color: #fff; }
.badge-reviewing { background-color: #2980b9; color: #fff; }
.badge-done      { background-color: #8e44ad; color: #fff; }

/* ─── 페이지 헤더 ─── */
.bh-page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e4eaf2;
}

.bh-page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bh-navy);
  margin: 0;
}

/* ─── 대시보드 스탯 카드 ─── */
.bh-stat-card {
  background: #fff;
  border-radius: 12px;
  border-left: 4px solid var(--bh-accent);
  box-shadow: 0 2px 8px rgba(26,58,92,0.07);
  padding: 1.2rem 1.5rem;
  transition: transform 0.15s;
}

.bh-stat-card:hover {
  transform: translateY(-2px);
}

.bh-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bh-navy);
  line-height: 1;
}

.bh-stat-card .stat-label {
  font-size: 0.82rem;
  color: #7f8c9a;
  margin-top: 4px;
}

/* ─── 페이지네이션 ─── */
.pagination .page-link {
  color: var(--bh-accent);
  border-color: #dee2e6;
  border-radius: 6px !important;
  margin: 0 2px;
  min-width: 36px;
  text-align: center;
}
.pagination .page-item.active .page-link {
  background-color: var(--bh-accent);
  border-color: var(--bh-accent);
  color: #fff !important;
}
.pagination .page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(46,134,193,0.2);
}

/* ─── 로딩 스피너 오버레이 ─── */
.bh-spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,58,92,0.35);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.bh-spinner-overlay.show {
  display: flex;
}
.bh-spinner-overlay .spinner-border {
  width: 3.5rem;
  height: 3.5rem;
  border-width: 0.35em;
  color: #fff;
}
.bh-spinner-overlay .bh-spinner-text {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ─── 페이지당 건수 셀렉터 ─── */
.bh-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: #6c757d;
}
.bh-per-page select {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  font-size: 0.83rem;
  cursor: pointer;
}
.bh-per-page select:focus {
  outline: none;
  border-color: var(--bh-accent);
}

/* ─── stat-card opacity helper ─── */
.opacity-40 { opacity: 0.4; }

/* ─── 알림(alert) 스타일 강화 ─── */
.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}
.alert-danger, .alert-error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* ─── 반응형 ─── */
@media (max-width: 768px) {
  .bh-sidebar {
    width: 56px;
    min-width: 56px;
  }
  .bh-nav-link span,
  .bh-nav-section,
  .bh-sidebar .small,
  .bh-sidebar .px-3.py-3 span {
    display: none;
  }
  .bh-nav-link {
    justify-content: center;
    padding: 12px 6px !important;
  }
  .bh-nav-link i {
    margin: 0 !important;
    font-size: 1.15rem;
  }
  main.flex-grow-1 {
    padding: 1rem !important;
  }
  .bh-stat-card .stat-value {
    font-size: 1.6rem;
  }
  /* 상단 네비 — 햄버거 버튼 없이 아이콘만 표시 */
  .bh-navbar .navbar-brand span {
    font-size: 0.85rem;
  }
  #mainNav .nav-link {
    padding: 6px 8px !important;
  }
  #mainNav .nav-link span.user-label {
    display: none;
  }
}
