/* ========================================
   EyeChartPro - Component Styles
   버튼, 메뉴, 공지 등 재사용 컴포넌트
   ======================================== */

/* ========================================
   Accessibility - 접근성
   ======================================== */

/* 스크린 리더 전용 텍스트 (시각적으로 숨김) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 포커스 시 표시 (키보드 네비게이션용) */
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* 유틸리티: 요소 숨김 (JS 토글용) */
.hidden {
  display: none !important;
}

/* ========================================
   Global Toast - 전역 토스트(dn-toast)
   ======================================== */
.dn-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-md);
  line-height: 1.45;
  color: var(--color-bg-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: var(--z-tooltip);
  animation: dnToastSlideIn 0.3s ease forwards;
}

.dn-toast--success { background: var(--color-success); }
.dn-toast--error { background: var(--color-danger); }
.dn-toast--warning { background: var(--color-warning); }
.dn-toast--info { background: var(--color-blue-light); }

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

/* 포커스 표시 스타일 */
:focus-visible {
  outline: 2px solid var(--color-blue-primary, #1e3a8a);
  outline-offset: 2px;
}

/* 버튼 및 링크 포커스 */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-blue-primary, #1e3a8a);
  outline-offset: 2px;
}

/* ========================================
   Hamburger Button - 햄버거 버튼
   ======================================== */
.hamburger-btn {
  width: 28px;
  height: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

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

.hamburger-line {
  width: 16px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition-normal);
}

/* 햄버거 활성화 상태 (X 모양) */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ========================================
   Menu Item - 메뉴 아이템
   ======================================== */
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  /* 36px → 32px (약 10% 축소) */
  padding: 0 var(--spacing-sm);
  gap: var(--spacing-xs);
  text-decoration: none;
  color: var(--color-text);
  font-size: 12px;
  /* 13px → 12px (약 10% 축소) */
  font-weight: var(--font-weight-medium);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
}

.menu-item:hover {
  background: var(--color-bg-hover);
}

.menu-item.active {
  background: var(--color-bg-active);
  font-weight: var(--font-weight-semibold);
}

/* BCRM 드릴다운 모드: 상단 복귀 버튼 + 섹션 타이틀 */
.menu-item--drillback {
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
  font-weight: 600;
}

.menu-item--drillback:hover {
  background: var(--color-info-bg);
}

.menu-item--drill-title {
  height: 28px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: default;
}

.menu-item--drill-title:hover {
  background: var(--color-bg-subtle);
}

.menu-icon {
  font-size: 11px;
  /* 12px → 11px (약 10% 축소) */
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3-state 색상: 검은색=API완료, 붉은색=API미연동(더미), 회색=페이지미구현 */
.menu-text.no-api-text {
  color: #dc2626;
}

.menu-text.no-page-text {
  color: #9ca3af;
}

.menu-item.active .menu-text.no-api-text {
  color: #dc2626;
}

.menu-item.active .menu-text.no-page-text {
  color: #9ca3af;
}

/* ========================================
   Menu Group - 메뉴 그룹 (하위 메뉴)
   ======================================== */
.menu-group {
  display: flex;
  flex-direction: column;
}

.menu-item.has-submenu {
  cursor: pointer;
}

.menu-item.has-submenu:focus,
.menu-item.has-submenu:focus-visible {
  background: var(--color-bg-hover);
  outline: none;
}

.menu-item.has-submenu::after {
  content: '▼';
  font-size: 8px;
  color: var(--color-border-dark);
  margin-left: auto;
  transition: transform var(--transition-fast);
}

.menu-group.open > .menu-item.has-submenu::after {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  flex-direction: column;
  background: var(--color-bg-subtle);
}

.menu-group.open > .submenu {
  display: flex;
}

/* 중첩 서브메뉴 그룹 (BCRM 공용, 포인트 등) */
.menu-group--nested {
  flex-direction: column;
}

.menu-group--nested > .menu-item.has-submenu {
  padding-left: 21px;
  height: 30px;
  font-size: 11px;
}

.menu-group--nested > .submenu .menu-item {
  padding-left: 32px;
}

.submenu .menu-item {
  padding-left: 21px;
  height: 30px;
  font-size: 11px;
}

.submenu .menu-group--nested > .menu-item.has-submenu {
  padding-left: 21px;
  height: 30px;
  font-size: 11px;
}

.submenu .menu-item.menu-item--depth-2 {
  padding-left: 33px;
}

.submenu .menu-group--nested > .submenu {
  background: var(--color-border-light);
}

.submenu .menu-item:hover {
  background: var(--color-border);
}

.submenu .menu-item.active {
  background: var(--color-border);
  color: var(--color-primary);
  font-weight: 600;
}

/* ========================================
   Notice - 공지사항
   ======================================== */
.notice-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.notice-icon {
  color: var(--color-notice);
  font-size: var(--font-size-sm);
}

.notice-slider {
  position: relative;
  height: 20px;
  overflow: hidden;
}

.notice-item {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.notice-item.active {
  opacity: 1;
}

/* ========================================
   CRM Panels - CRM 패널
   ======================================== */
.crm-panel {
  background: var(--color-bg-white);
  border: 1px solid #9ca3af;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  height: 100%;
  /* 그리드 셀 높이에 맞춤, 컨텐츠가 늘어나도 패널 크기 고정 */
}

.crm-panel:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: box-shadow var(--transition-normal);
}

/* Panel Header */
.panel-header {
  height: 34px;
  min-height: 34px;
  padding: 0 var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-light);
  background: #fafafa;
}

.panel-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

/* Panel Actions */
.panel-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.action-btn {
  height: 26px;
  border: 1px solid var(--color-border-medium);
  background: var(--color-bg-white);
  color: var(--color-text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}

.action-btn:hover {
  background: var(--color-info);
  color: var(--color-bg-white);
  border-color: var(--color-info);
}

/* 수술 관련 버튼 - 파란색 스타일 */
.action-btn[data-button-id*="surgery"],
.action-btn.btn-surgery {
  border-color: var(--color-info);
  color: var(--color-info);
}

.action-btn[data-button-id*="surgery"]:hover,
.action-btn.btn-surgery:hover {
  background: var(--color-info);
  color: var(--color-bg-white);
  border-color: var(--color-info);
}

/* 연동 버튼 - 초록색 스타일 */
.action-btn[data-button-id*="link"],
.action-btn.btn-link {
  border-color: var(--color-success);
  color: var(--color-success);
}

.action-btn[data-button-id*="link"]:hover,
.action-btn.btn-link:hover {
  background: var(--color-success);
  color: var(--color-bg-white);
  border-color: var(--color-success);
}

/* 삭제/제거 버튼 - 빨간색 스타일 */
.action-btn[data-button-id*="delete"],
.action-btn[data-button-id*="remove"],
.action-btn.btn-delete {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.action-btn[data-button-id*="delete"]:hover,
.action-btn[data-button-id*="remove"]:hover,
.action-btn.btn-delete:hover {
  background: var(--color-danger);
  color: var(--color-bg-white);
  border-color: var(--color-danger);
}

.action-btn.icon-only {
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Panel Content */
.panel-content {
  flex: 1;
  overflow-y: auto;
  /* Allow vertical scrolling */
  padding: var(--spacing-md);
  position: relative;
}

/* Empty State */
.empty-state {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* Memo Textarea */
.memo-textarea {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  font-family: var(--font-family);
  font-size: 11px;
  color: var(--color-text);
  outline: none;
  background: transparent;
  line-height: var(--line-height);
  overflow: hidden;
  /* 텍스트 많아져도 스크롤바 숨김 (필요시 auto로 변경) */
}

.memo-textarea::placeholder {
  color: var(--color-text-light);
}

/* ========================================
   Floating Label Form - 플로팅 라벨 공통
   ======================================== */
.floating-group {
  position: relative;
  margin-bottom: 0px;
}

.floating-group.full-width {
  grid-column: 1 / -1;
  /* Span all columns */
}

/* Span 2 helper */
.floating-group.span-2 {
  grid-column: span 2;
}

.floating-input,
.floating-select {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text);
  background: var(--color-bg-white);
  transition: border-color 0.2s;
}

.floating-input {
  text-align: right;
}

.floating-select {
  padding-right: 28px;
  /* 오른쪽에 화살표 공간 확보 + 텍스트 간격 */
  background: var(--color-bg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: right;
  /* 우측 정렬로 변경 */
  cursor: pointer;
}

/* Utility to override text alignment */
.floating-input.text-left,
.floating-select.text-left {
  text-align: left !important;
}

/* Hover highlight */
.floating-input:hover,
.floating-select:hover {
  border-color: var(--color-info);
}

/* Focus highlight (:focus + :focus-visible 모두 처리) */
.floating-input:focus,
.floating-input:focus-visible,
.floating-select:focus,
.floating-select:focus-visible {
  outline: none;
  border-color: var(--color-info);
}

.floating-input.highlight {
  background: #fffde7;
  font-weight: 600;
}

/* readonly 필드: 회색 배경 + 커서 변경 */
.floating-input:read-only {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  cursor: default;
}

/* Floating Label styling */
.floating-label {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  background-color: transparent;
  /* Initially transparent */
  padding: 0 2px;
  font-size: 12px;
  /* Match input size (reduced) */
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: all 0.2s ease-out;
}

/* Active Floating State (Focus or Value present) */
.floating-input:focus~.floating-label,
.floating-input:not(:placeholder-shown)~.floating-label,
.floating-select:focus~.floating-label,
.floating-select:not(.is-empty)~.floating-label {
  top: 0;
  left: 8px;
  transform: translateY(-50%);
  background-color: var(--color-bg-white);
  color: var(--color-info);
  font-size: 11px;
  /* 통일된 폰트 크기 */
  font-weight: 600;
  padding: 0 4px;
  /* 좌우 패딩으로 border 가림 */
  z-index: 1;
}

/* 플로팅 라벨 사이즈 변형 */
.floating-sm .floating-input,
.floating-sm .floating-select,
.floating-sm .floating-label {
  font-size: 11px;
}

/* Helper Text (e.g. Age/Gender) */
.input-helper-text {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--color-text-muted);
  pointer-events: none;
}

/* Inline Checkboxes (Lunar/Married) - floating-group 내 우측 오버레이 */
.checkbox-group-inline {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  font-size: 12px;
}

/* floating-group 내 아이콘 버튼 (검색 등) */
.floating-group .icon-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
}

.checkbox-group-inline input[type="checkbox"] {
  width: 11px;
  height: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.chk-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Checkbox size - 30% smaller */
.chk-label input[type="checkbox"] {
  width: 11px;
  height: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Checkbox inside floating input box */
.checkbox-input-box {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text);
  background: var(--color-bg-white);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.checkbox-input-box input[type="checkbox"] {
  width: 11px;
  height: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Always active floating label */
.floating-label-active {
  top: 0 !important;
  left: 8px !important;
  transform: translateY(-50%) !important;
  background-color: var(--color-bg-white) !important;
  color: var(--color-info) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 0 4px !important;
  z-index: 1 !important;
}

/* ========================================
   Memo Component - 메모 공통 컴포넌트
   ======================================== */
.memo-container {
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-sm);
  background: var(--color-bg-white);
  padding: 6px 8px 0;
}

.memo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.memo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-info);
  font-weight: 600;
  font-size: var(--font-size-2xs);
}

.memo-counter {
  font-size: var(--font-size-2xs);
  color: var(--color-text-light);
  background: var(--color-border-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.memo-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-memo-box {
  width: 100%;
  min-height: 59px;
  border: none;
  outline: none;
  resize: none;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  padding: 0 8px;
  text-align: left;
}

.customer-memo-box::placeholder {
  font-size: 12px;
}

.tab-content {
  border: 1px solid var(--color-border-light);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-white);
  min-height: 90px;
}

/* ========================================
   Home Dashboard Styles
   ======================================== */
.home-dashboard {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Welcome Section */
.welcome-section {
  padding: 24px 0;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
}

/* Quick Actions - Card Grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-normal);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--color-notice);
}

.quick-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: var(--radius-md);
}

.quick-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

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

/* Today Summary */
.today-summary {
  padding: 24px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.summary-card {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--color-border-light);
}

.summary-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
  color: #2563eb;
}

/* Logo Link Style */
.logo {
  text-decoration: none;
  color: inherit;
}

/* ========================================
   User Dropdown Menu
   ======================================== */
.user-area {
  position: relative;
}

.user-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
}

.user-trigger:hover {
  background: var(--color-bg-hover);
}

.user-name {
  font-weight: 600;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 120px;
  z-index: 1000;
  margin-top: 4px;
  overflow: hidden;
}

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

.user-menu-link {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.user-menu-link:last-child {
  border-bottom: none;
}

.user-menu-link:hover {
  background: #f9fafb;
}

.user-menu-link.logout {
  color: #ef4444;
}

/* ========================================
   Customer Search Modal Styles (Refined)
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(1px);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-container {
  background: #fff;
  width: 980px;
  max-width: 95vw;
  max-height: 90vh;
  /* 최대 높이 제한 */
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #6b7280;
  /* Darker border for contrast */
}

/* Header */
.modal-header {
  background: linear-gradient(to right, #2563eb, #1e40af);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.modal-icon {
  font-size: 14px;
  line-height: 1;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  width: 20px;
  height: 20px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: white;
}

/* Body */
.modal-body {
  flex: 1;
  /* 남은 공간 차지 */
  min-height: 0;
  /* Flexbox 스크롤 활성화 */
  padding: 12px;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  /* 자식 요소에서 스크롤 처리 */
}

/* Search Form Panel */
.search-form-container {
  background: #fff;
  border: 1px solid #d1d5db;
  padding: 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Gap between rows */
  flex-shrink: 0;
  /* 크기 고정, 축소되지 않음 */
}

/* 6-Column Single Row Grid Layout for Search */
.search-grid-layout {
  display: grid;
  grid-template-columns: repeat(6, minmax(auto, 130px)) auto;
  grid-template-rows: 29px;
  column-gap: 8px;
  align-items: center;
}

/* Grid Layout for Rows */
.modal-row {
  display: grid;
  grid-template-columns: 100px 180px 100px 1fr;
  /* Fixed widths for nice alignment (O-wa-yeol) */
  gap: 8px;
  align-items: center;
}

.modal-row.row-2 {
  grid-template-columns: 100px 200px 200px 1fr;
  /* Slightly different for dates */
}

.modal-row.row-bottom {
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dotted #e5e7eb;
}

/* Floating Group Overrides for Modal */
.modal-body .floating-group {
  position: relative;
  height: 29px;
  /* 높이 복원 */
  margin: 0;
}

.modal-body .floating-input {
  height: 29px;
  /* 높이 복원 */
  font-size: 12px;
  /* 폰트 복원 */
  padding: 0 8px;
  /* padding 복원 */
}

.modal-body .floating-select {
  height: 29px;
  /* 높이 복원 */
  font-size: 12px;
  /* 폰트 복원 */
  padding: 0 32px 0 8px;
  /* padding 복원 */
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 12px;
  /* 아이콘 복원 */
}

/* Label Fix - 항상 흰색 배경 */
.modal-body .floating-label {
  left: 8px;
  /* 복원 */
  font-size: 12px;
  /* 복원 */
  font-weight: var(--font-weight-normal);
  padding: 0 2px;
  background: #fff;
  /* 항상 흰색 배경 적용 */
}

/* Active State for Label - prevented shooting up too high */
.modal-body .floating-input:focus~.floating-label,
.modal-body .floating-input:not(:placeholder-shown)~.floating-label,
.modal-body .floating-select:focus~.floating-label,
.modal-body .floating-select:not(.is-empty)~.floating-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 11px;
  /* 복원 */
  font-weight: 600;
  background: #fff;
  /* White background to cover border */
  color: #2563eb;
  z-index: 5;
}

/* Resident No specific */
.resident-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Checkbox Date Label Corrected */
.chk-date-group {
  display: flex;
  align-items: center;
  gap: 4px;
  /* Gap between checkbox label and input */
  height: 26px;
}

.chk-label-box {
  display: flex;
  align-items: center;
  white-space: nowrap;
  /* Prevent vertical text */
  height: 100%;
  padding-right: 4px;
}

.chk-label-box label {
  font-size: 12px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Radio Group */
.radio-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Radio Group for Floating Label */
.radio-group-floating {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 29px;
  /* 10% 증가 */
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
}

.radio-group-floating .radio-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

.radio-group-floating input[type="radio"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
}

/* ========================================
   Unified Search Layout Styles
   ======================================== */
.unified-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.select-group {
  width: 120px;
  position: relative;
}

.input-group-wide {
  flex: 1;
  position: relative;
  max-width: 400px;
}

/* Compact Radio Area */
.radio-area.compact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #e5e7eb;
}

.radio-area.compact .label-text {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

/* Row 2 Action Area */
.row-2-action {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 4px;
}

/* Primary Search Button */
.btn-search-action.primary {
  background: #2563eb;
  color: white;
  border: 1px solid #1d4ed8;
  height: 32px;
  padding: 0 24px;
  font-weight: 600;
}

.btn-search-action.primary:hover {
  background: #1d4ed8;
}

/* Search Button */
.btn-search-large {
  grid-column: 7;
  justify-self: end;
  background: #2563eb;
  color: white;
  border: 1px solid #1d4ed8;
  border-radius: 4px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  min-width: 70px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-search-large:hover {
  background: #1d4ed8;
}


/* Adjustments for Unified Inputs */
.unified-search-row .floating-input,
.unified-search-row .floating-select {
  height: 26px;
  /* 통일된 높이 */
}

.unified-search-row .floating-group {
  height: 26px;
}

/* ========================================
   Search Result Grid Styles (Table 기반)
   - 단일 스크롤 컨테이너 + sticky 헤더
   ======================================== */
.search-result-grid {
  flex: 1;
  min-height: 0;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.grid-scroll-container {
  max-height: 400px;
  overflow: auto;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Sticky Header */
.grid-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.grid-table th {
  padding: 8px 4px;
  text-align: center;
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  white-space: nowrap;
}

.grid-table th:last-child {
  border-right: none;
}

/* Column Widths - Compact */
.grid-table th:nth-child(1),
.grid-table td:nth-child(1) {
  width: 50px;
}

.grid-table th:nth-child(2),
.grid-table td:nth-child(2) {
  width: 35px;
}

.grid-table th:nth-child(3),
.grid-table td:nth-child(3) {
  width: 75px;
}

.grid-table th:nth-child(4),
.grid-table td:nth-child(4) {
  width: 65px;
}

.grid-table th:nth-child(5),
.grid-table td:nth-child(5) {
  width: 110px;
}

.grid-table th:nth-child(6),
.grid-table td:nth-child(6) {
  width: 110px;
}

.grid-table th:nth-child(7),
.grid-table td:nth-child(7) {
  width: 95px;
}

.grid-table th:nth-child(8),
.grid-table td:nth-child(8) {
  width: 85px;
}

.grid-table th:nth-child(9),
.grid-table td:nth-child(9) {
  width: 85px;
}

.grid-table th:nth-child(10),
.grid-table td:nth-child(10) {
  width: 95px;
}

/* Table Body */
.grid-table tbody tr {
  transition: background-color 0.1s;
}

.grid-table tbody tr:hover {
  background-color: #f8fafc;
}

.grid-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #4b5563;
}

.grid-table td:last-child {
  border-right: none;
}

.btn-grid-select {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: none;
  background-color: #2563eb;
  color: white;
  cursor: pointer;
}

.btn-grid-select:hover {
  background-color: #1d4ed8;
}

/* ========================================
   Memo History List - 메모 히스토리
   ======================================== */
.panel-memo .panel-content {
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 메모&SMS 전용 탭 바 (vision-tabs/vision-tab-btn과 완전 분리) */
.memo-tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--color-border-medium);
  margin-bottom: 0;
  flex-wrap: wrap;
  padding-left: 6px;
  flex-shrink: 0;
}

.memo-tab-btn {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-medium);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.memo-tab-btn:hover {
  background: var(--color-border-light);
}

.memo-tab-btn.active {
  background: var(--color-bg-white);
  color: var(--color-navy);
  border-color: var(--color-border-medium);
  border-bottom: 1px solid var(--color-bg-white);
  font-weight: 600;
  margin-bottom: -1px;
}

/* 메모&SMS 탭 콘텐츠 표시/숨김 */
.memo-tab-content {
  display: none;
}

.memo-tab-content.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 빈 상태 안내 메시지 */
.memo-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 12px;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
}

.memo-empty-icon {
  display: flex;
  align-items: center;
  opacity: 0.5;
}

.memo-history-list,
.sms-history-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.memo-item {
  border-bottom: 1px solid var(--color-border);
}

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

/* memo-item 전용 헤더 (memo-container의 .memo-header와 분리) */
.memo-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--color-border-lighter);
}

.memo-date {
  color: var(--color-text-secondary);
}

.memo-badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  color: #fff;
  background: var(--color-primary);
}
.memo-badge--MMS { background: #6366f1; }
.memo-badge--카카오알림톡 { background: #f59e0b; color: #1a1a1a; }
.memo-badge--카카오친구톡 { background: #fbbf24; color: #1a1a1a; }

.memo-type {
  color: var(--color-text-secondary);
}

.memo-author {
  color: var(--color-text-muted);
  margin-left: auto;
}

.memo-body {
  padding: 6px 8px;
  font-size: var(--font-size-xs);
  line-height: 1.5;
  color: var(--color-text-secondary);
  background: var(--color-bg-white);
}

/* ========================================
   Component Loading States
   ======================================== */

/* 로딩 상태 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: #9ca3af;
  font-size: 14px;
}

/* 에러 상태 */
.error-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 200px;
  color: #ef4444;
  font-size: 14px;
  padding: 20px;
  text-align: center;
}

.error-message button {
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.error-message button:hover {
  background: #2563eb;
}

/* Tab Content Visibility */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========================================
   Air Datepicker Custom Styles
   ======================================== */
.air-datepicker {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e7eb;
  --adp-font-size: 14px;
  --adp-day-cell-height: 32px;
  --adp-width: 220px;
  --adp-background-color: #fff;
  --adp-color: #000;
  --adp-color-secondary: #9ca3af;
  --adp-accent-color: #3b82f6;
}

/* Navigation (월/년) */
.air-datepicker-nav {
  padding: 8px 4px;
  border-bottom: 1px solid #f3f4f6;
}

.air-datepicker-nav--title {
  font-size: 15px;
  font-weight: 700;
  color: #000;
}

.air-datepicker-nav--action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.air-datepicker-nav--action:hover {
  background: #f3f4f6;
}

.air-datepicker-nav--action svg {
  width: 12px;
  height: 12px;
}

/* 요일 헤더 */
.air-datepicker-body--day-names {
  margin: 4px 0;
}

.air-datepicker-body--day-name {
  font-size: 12px;
  font-weight: 600;
  color: #000 !important;
}

/* 토요일 (7번째) - 빨간색 */
.air-datepicker-body--day-name:nth-child(7) {
  color: #ef4444 !important;
}

/* 일요일 (1번째) - 빨간색 */
.air-datepicker-body--day-name:nth-child(1) {
  color: #ef4444 !important;
}

/* 날짜 셀 */
.air-datepicker-cell.-day- {
  font-size: 13px;
  font-weight: 600;
  color: #000 !important;
  border-radius: 6px;
  transition: all 0.15s ease;
}

/* 일요일 날짜 (1번째 열) - 빨간색 */
.air-datepicker-body--cells.-days- .air-datepicker-cell.-day-:nth-child(7n+1) {
  color: #ef4444 !important;
}

/* 토요일 날짜 (7번째 열) - 빨간색 */
.air-datepicker-body--cells.-days- .air-datepicker-cell.-day-:nth-child(7n) {
  color: #ef4444 !important;
}

.air-datepicker-cell.-day-:hover {
  background: #f3f4f6;
}

/* 오늘 */
.air-datepicker-cell.-day-.-current- {
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

/* 선택된 날짜 */
.air-datepicker-cell.-day-.-selected- {
  background: #3b82f6 !important;
  color: #fff !important;
}

.air-datepicker-cell.-day-.-selected-:hover {
  background: #2563eb !important;
}

/* 다른 달 날짜 */
.air-datepicker-cell.-day-.-other-month- {
  color: #d1d5db;
}

/* 버튼 영역 */
.air-datepicker-buttons {
  border-top: 1px solid #f3f4f6;
  padding: 8px;
}

.air-datepicker-button {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  border-radius: 4px;
  padding: 4px 8px;
}

.air-datepicker-button:hover {
  background: #eff6ff;
}

/* ========================================
   Header Icon Button - 헤더 아이콘 버튼
   ======================================== */
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
}

.header-icon-btn:hover {
  background: var(--color-border-light);
  color: var(--color-text-secondary);
}

.header-icon-btn:focus,
.header-icon-btn:focus-visible {
  outline: none;
  background: var(--color-border-light);
  box-shadow: none;
}

.header-icon-btn:active {
  background: var(--color-border);
}

.header-icon-btn svg {
  flex-shrink: 0;
}

/* Header DateTime - 헤더 날짜/시간 */
.header-datetime {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-2xs);
  line-height: 1;
  color: #475569;
  font-family: 'Consolas', 'Monaco', 'SF Mono', monospace;
  white-space: nowrap;
  padding: 4px 8px;
  background: linear-gradient(135deg, var(--color-bg-gray-light) 0%, var(--color-border-lighter) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  margin-right: 4px;
}

.header-datetime .datetime-icon {
  color: #3b82f6;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  vertical-align: middle;
}

.header-datetime .datetime-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-datetime .datetime-date {
  color: #334155;
  font-weight: 500;
}

.header-datetime .datetime-time {
  color: #3b82f6;
  font-weight: 600;
  padding-left: 6px;
  border-left: 1px solid #cbd5e1;
}

/* Header Loading Shimmer - 세션 동기화 로딩 표시 */
.loading-shimmer {
  position: relative;
  overflow: hidden;
  color: transparent !important;
}

.loading-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-border) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Header Divider - 헤더 구분선 */
.header-divider {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  margin: 0 12px;
}

/* ========================================
   Header Dropdown - 헤더 드롭다운
   ======================================== */
.header-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  min-width: 112px;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

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

.header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-decoration: none;
  color: #374151;
  font-size: 12px;
  transition: background 0.1s;
}

.header-dropdown-item:hover {
  background: #f9fafb;
}

.header-dropdown-item.logout {
  color: #dc2626;
}

.header-dropdown-item.logout:hover {
  background: #fef2f2;
}

.header-dropdown-item svg {
  color: #9ca3af;
  flex-shrink: 0;
}

.header-dropdown-item:hover svg {
  color: #6b7280;
}

.header-dropdown-item.logout svg {
  color: #dc2626;
}

.header-dropdown-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 4px 0;
}

/* ========================================
   Language Selector - 다국어 선택
   ======================================== */
.lang-selector {
  position: relative;
  margin-left: 4px;
}

.lang-trigger {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 6px !important;
}

/* Flag Icons - 외부 이미지 기반 국기 아이콘 */
.flag-icon {
  display: inline-block;
  width: 20px;
  min-width: 20px;
  height: 14px;
  min-height: 14px;
  flex-shrink: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.flag-kr {
  background-image: url("../../images/flags/kr.svg");
}

.flag-us {
  background-image: url("../../images/flags/us.svg");
}

.flag-jp {
  background-image: url("../../images/flags/jp.svg");
}

/* ========================================
   User Area - 사용자 영역 (Refined)
   ======================================== */
.header-right .user-area {
  position: relative;
}

.header-right .user-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 160px;
  padding: 4px 6px;
  margin-right: 0;
  margin-top: -2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.header-right .user-trigger:hover {
  background: #f3f4f6;
}

/* 사용자 이름 */
.header-right .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}

/* 소속 라벨 뱃지 */
.user-dept-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  margin-left: 6px;
}

.header-right .user-trigger svg {
  color: #9ca3af;
  flex-shrink: 0;
  margin-left: 2px;
}

/* User Dropdown Header */
.user-dropdown {
  min-width: 135px;
  right: 0;
  top: calc(100% + 11px);
}

.user-dropdown-header {
  padding: 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}

.user-dropdown-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.user-dropdown-dept {
  display: inline-flex;
  padding: 2px 6px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  border-radius: 3px;
}

.user-dropdown-role {
  color: #6b7280;
}

/* ========================================
   Custom Confirm Modal (confirm 대체)
   ======================================== */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.confirm-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  min-width: 280px;
  max-width: 360px;
  overflow: hidden;
}

.confirm-dialog__body {
  padding: 24px 20px 16px;
  font-size: 14px;
  color: #1f2937;
  text-align: center;
  line-height: 1.5;
}

.confirm-dialog__footer {
  display: flex;
  border-top: 1px solid #e5e7eb;
}

.confirm-dialog__btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.confirm-dialog__btn--cancel {
  background: #f9fafb;
  color: #6b7280;
}

.confirm-dialog__btn--cancel:hover {
  background: #f3f4f6;
}

.confirm-dialog__btn--ok {
  background: #2563eb;
  color: #fff;
}

.confirm-dialog__btn--ok:hover {
  background: #1d4ed8;
}

/* ========================================
   초기화 선택 다이얼로그
   ======================================== */
.reset-dialog {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  width: 378px;
  overflow: hidden;
  animation: resetDialogIn 0.15s ease-out;
}

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

.reset-dialog__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #1f2937;
}

.reset-dialog__header > svg {
  color: #fff;
  flex-shrink: 0;
}

.reset-dialog__header > span {
  flex: 1;
  text-align: center;
}

.reset-dialog__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.reset-dialog__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.reset-dialog__close:focus,
.reset-dialog__close:focus-visible {
  outline: none;
}

.reset-dialog__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

/* 옵션 카드 버튼 */
.reset-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.reset-option:hover {
  border-color: #2563eb;
  background: #2563eb;
}

.reset-option:hover .reset-option__title,
.reset-option:hover .reset-option__desc {
  color: #fff;
}

.reset-option:hover .reset-option__icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.reset-option:hover .reset-option__arrow {
  color: rgba(255, 255, 255, 0.6);
  transform: translateX(2px);
}

.reset-option:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* 아이콘 원형 배지 */
.reset-option__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.reset-option__icon--current {
  background: #eff6ff;
  color: #2563eb;
}

.reset-option__icon--all {
  background: #fef2f2;
  color: #dc2626;
}

/* 텍스트 */
.reset-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.reset-option__title {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reset-option__desc {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.3;
}

/* 화살표 */
.reset-option__arrow {
  color: #d1d5db;
  flex-shrink: 0;
  transition: transform 0.15s;
}

/* ========================================
   공통 페이지 툴바 (front.html 기준 통일 패턴)
   ======================================== */

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 50px;
  background: #fff;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

/* 툴바 메뉴명 (JS 자동 삽입) */
.page-toolbar-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-btn-group {
  display: flex;
  gap: 4px;
  align-items: stretch;
  margin-left: auto;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--color-border-medium);
  background: var(--color-bg-white);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  background: var(--color-text-secondary);
  color: var(--color-bg-white);
  border-color: var(--color-text-secondary);
}

.page-btn:active:not(:disabled) {
  transform: none;
}

.page-btn.primary {
  background: var(--color-info);
  color: var(--color-bg-white);
  border-color: var(--color-info);
}

.page-btn.primary:hover:not(:disabled) {
  background: var(--color-blue-lighter);
  border-color: var(--color-blue-lighter);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn:focus,
.page-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* 아이콘 포함 버튼 */
.page-btn.page-btn--icon {
  gap: 4px;
}

.page-btn.page-btn--icon .btn-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.page-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* 날짜 그룹 */
.page-date-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-date-sep {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

/* 날짜 퀵버튼 (오늘/금주/당월/전월) */
.page-date-quick-group {
  display: flex;
  gap: 3px;
  align-items: center;
}

.page-date-quick {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--color-border-medium);
  background: var(--color-bg-white);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.page-date-quick:hover {
  background: var(--color-blue-primary);
  color: var(--color-bg-white);
  border-color: var(--color-blue-primary);
}

.page-date-quick.active {
  background: var(--color-blue-primary);
  color: var(--color-bg-white);
  border-color: var(--color-blue-primary);
}

.page-date-quick:focus,
.page-date-quick:focus-visible {
  outline: none;
  box-shadow: none;
}

/* 체크박스 라벨 (자동조회 등) */
.page-checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  cursor: pointer;
}

/* 라디오 그룹 */
.page-radio-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.page-radio-group label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  white-space: nowrap;
}

.page-radio-label {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
}

/* 체크박스 그룹 */
.page-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.page-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  white-space: nowrap;
}

/* ========================================
   비밀번호 변경 모달 (modal-overlay 레이어팝업)
   ======================================== */
.pw-modal {
  width: 420px;
  max-width: 90vw;
}

.pw-modal-body {
  background: #fff;
  padding: 20px;
}

.pw-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pw-modal-group {
  margin-bottom: 12px;
}

.pw-modal-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.pw-modal-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.pw-modal-input:focus,
.pw-modal-input:focus-visible {
  border-color: var(--color-blue-primary);
  outline: none;
}

.pw-modal-error {
  min-height: 18px;
  font-size: 13px;
  color: var(--color-danger);
  margin: 4px 0 0;
}

.pw-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* ========================================
   모바일 레이아웃 (≤768px)
   ======================================== */
@media (max-width: 768px) {
  /* 체크박스 박스: 높이 자동 + 줄바꿈 */
  .checkbox-input-box {
    height: auto;
    min-height: 26px;
    flex-wrap: wrap;
    gap: 6px 10px;
    justify-content: flex-start;
    padding: 4px 8px;
  }

  /* 구분선 숨김 (모바일에서 공간 절약) */
  .chk-divider {
    display: none;
  }
}

/* iOS 자동 확대 방지는 viewport meta (maximum-scale=1)로 처리 */

/* ========================================
   Data Table Component (공통 데이터 테이블)
   모든 데이터 테이블의 Single Source of Truth
   ======================================== */

/* --- Base --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  background: var(--color-border-light);
  padding: 5px 4px;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-medium);
  text-align: center;
  white-space: nowrap;
}

.data-table td {
  padding: 4px;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.data-table tbody tr:hover {
  background: var(--color-bg-subtle);
}

.data-table td.text-left {
  text-align: left;
}

.data-table td.text-right {
  text-align: right;
}

/* --- Wrapper --- */
.data-table-wrapper {
  border: 1px solid var(--color-border-medium);
  border-radius: 4px;
  overflow: auto;
}

/* --- Sticky Header --- */
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* --- Empty State --- */
.tab-empty-message {
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-light);
}

.data-table:has(.empty-row:not(.hidden)) {
  height: 100%;
}

.data-table tbody > tr.empty-row {
  height: 100%;
}

.data-table tbody > tr.empty-row:hover {
  background: transparent;
}

.data-table tbody > tr.empty-row > .tab-empty-message {
  height: 100%;
  vertical-align: middle;
  border-bottom: none;
}

