/* ==========================================================================
   Eun Jung Hair Salon - Premium Boutique Salon Mobile UI System
   Palette: Cream Beige (#FAF7F2), Espresso Dark (#181716), Blush Peach (#E5ADA0)
   ========================================================================== */

:root {
  --bg-main: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-dark: #181716;
  --bg-dark-sub: #262422;
  --primary: #E5ADA0;
  --primary-hover: #D79A8C;
  --primary-light: #FBF0ED;
  --text-main: #22201E;
  --text-muted: #8F8880;
  --text-light: #B8B0A8;
  --border-subtle: #EFE8E0;
  --border-focus: #D79A8C;
  --gender-female: #D9657E;
  --gender-female-bg: #FDF0F3;
  --gender-male: #48729A;
  --gender-male-bg: #EEF4F9;
  --success: #4E9A68;
  --warning: #D98836;
  --shadow-sm: 0 4px 12px rgba(34, 32, 30, 0.04);
  --shadow-md: 0 10px 25px rgba(34, 32, 30, 0.07);
  --shadow-dark: 0 12px 30px rgba(0, 0, 0, 0.25);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;
  --font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: #ECE7DF;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* 스마트폰 디바이스 목업 래퍼 */
.device-container {
  width: 100%;
  max-width: 430px;
  height: 920px;
  background-color: var(--bg-main);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(24, 23, 22, 0.25);
  border-radius: 44px;
  border: 10px solid #181716;
}

@media (max-width: 500px) {
  body {
    background-color: var(--bg-main);
  }
  .device-container {
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* 헤더 영역 (노치/상태표시줄 제거 및 안전영역 safe-area-inset-top 반영) */
.app-header {
  padding: max(18px, env(safe-area-inset-top, 18px)) 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.app-title-wrap h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}
.app-title-wrap .salon-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-hover);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lang-switch-btn {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.lang-switch-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.lang-switch-btn:active {
  transform: scale(0.95);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.icon-btn:active {
  transform: scale(0.95);
  background: #f5efe8;
}

/* 메인 뷰 스크롤 영역 */
.main-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 100px;
  -webkit-overflow-scrolling: touch;
}
.main-viewport::-webkit-scrollbar {
  display: none;
}

/* 탭 패널 전환 */
.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}
.tab-panel.active {
  display: block;
}

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

/* ==========================================================================
   화면 1: 홈 대시보드
   ========================================================================== */
.welcome-banner {
  margin-bottom: 18px;
}
.welcome-banner .subtext {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.welcome-banner .greeting {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

/* 다크 서머리 카드 (레퍼런스 블랙 카드 재현) */
.dark-summary-card {
  background: linear-gradient(145deg, #1f1d1b, #151413);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-dark);
}
.dark-summary-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(229, 173, 160, 0.25) 0%, transparent 70%);
  pointer-events: none;
}
.summary-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.summary-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.summary-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.summary-badge {
  background: rgba(229, 173, 160, 0.2);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
}
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}
.summary-item .item-title {
  font-size: 12px;
  color: var(--text-light);
}
.summary-item .item-val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

/* 섹션 타이틀 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: 17px;
  font-weight: 700;
}
.section-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}

/* 예약 리스트 카드 */
.appointment-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  cursor: pointer;
}
.appointment-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.appt-time-wrap {
  display: flex;
  flex-direction: column;
  min-width: 60px;
}
.appt-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.appt-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 4px;
}
.appt-info {
  flex: 1;
  padding: 0 14px;
}
.appt-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.appt-customer-name {
  font-size: 15px;
  font-weight: 700;
}
.gender-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.gender-badge.female {
  background: var(--gender-female-bg);
  color: var(--gender-female);
}
.gender-badge.male {
  background: var(--gender-male-bg);
  color: var(--gender-male);
}
.appt-service-desc {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.appt-color-tag {
  display: inline-block;
  font-size: 11px;
  background: var(--primary-light);
  color: #B46452;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.appt-action-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F8F4EE;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
}

/* 신규 예약 바텀 버튼 */
.btn-primary-block {
  width: 100%;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(229, 173, 160, 0.4);
  margin-top: 16px;
  transition: all 0.2s ease;
}
.btn-primary-block:hover {
  background: var(--primary-hover);
}
.btn-primary-block:active {
  transform: scale(0.98);
}

/* ==========================================================================
   화면 2: 예약 달력 (Записи)
   ========================================================================== */
.calendar-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.calendar-title {
  font-size: 18px;
  font-weight: 700;
}
.calendar-nav-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

/* 주간 일자 스크롤러 */
.week-strip {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 22px;
  background: var(--bg-card);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.day-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.day-cell .day-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.day-cell .day-num {
  font-size: 15px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}
.day-cell.active {
  background: var(--bg-dark);
}
.day-cell.active .day-name {
  color: var(--text-light);
}
.day-cell.active .day-num {
  background: var(--primary);
  color: #FFFFFF;
}

/* 타임라인 뷰 */
.timeline-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   화면 3: 고객 관리 장부 (Клиенты)
   ========================================================================== */
.search-box-wrap {
  margin-bottom: 18px;
  position: relative;
}
.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 13px 20px 13px 44px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: var(--primary);
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.customer-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}
.customer-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.customer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #F2ECE3;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  margin-right: 14px;
  flex-shrink: 0;
}
.customer-main-info {
  flex: 1;
}
.customer-name-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.customer-name {
  font-size: 16px;
  font-weight: 700;
}
.customer-phone {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.customer-recipe-peek {
  font-size: 12px;
  color: #B46452;
  margin-top: 3px;
  font-weight: 500;
}
.customer-visits-pill {
  font-size: 12px;
  color: var(--text-muted);
  background: #F8F4EE;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   화면 4: 시술 메뉴판 (Услуги)
   ========================================================================== */
.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.category-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chip.active {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-color: var(--bg-dark);
}

.service-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.service-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.service-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.service-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}
.service-duration {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   화면 5: 살롱 프로필 & 설정 (Профиль)
   ========================================================================== */
.profile-hero {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-dark);
}
.profile-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  margin: 0 auto 12px;
  overflow: hidden;
  background: #2A2826;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
}
.profile-salon-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.profile-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 3px;
}

.settings-group {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.settings-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 14px 18px 8px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #FAF6F0;
  cursor: pointer;
}
.settings-row:last-child {
  border-bottom: none;
}
.settings-label {
  font-size: 14px;
  font-weight: 600;
}
.settings-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 토글 스위치 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #E2DBD2;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   하단 네비게이션 탭 바 (5대 탭)
   ========================================================================== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 82px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px 14px;
  z-index: 100;
}
.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  transition: all 0.2s ease;
}
.nav-tab-item svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  fill: none;
  transition: all 0.2s ease;
}
.nav-tab-item.active {
  color: var(--text-main);
}
.nav-tab-item.active svg {
  stroke: var(--bg-dark);
  stroke-width: 2.2;
}

/* ==========================================================================
   모달 오버레이 (신규 예약 및 고객 등록, 레시피 팝업)
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(24, 23, 22, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: flex-end;
}
.modal-overlay.open {
  display: flex;
}
.modal-content {
  width: 100%;
  max-height: 85%;
  background: var(--bg-card);
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  padding: 24px 22px 36px;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}

/* 폼 인풋 스타일 */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #FAF7F2;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: #FFFFFF;
}

/* 성별 선택 세그먼트 버튼 */
.gender-selector {
  display: flex;
  gap: 10px;
}
.gender-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #FAF7F2;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.gender-btn.active-female {
  background: var(--gender-female);
  color: white;
  border-color: var(--gender-female);
}
.gender-btn.active-male {
  background: var(--gender-male);
  color: white;
  border-color: var(--gender-male);
}

/* 알림 벨 토스트 */
.alarm-toast {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  background: var(--bg-dark);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 300;
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.alarm-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-bell-icon {
  font-size: 24px;
  animation: ring 1s infinite;
}
@keyframes ring {
  0% { transform: rotate(0); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(7deg); }
  80% { transform: rotate(-7deg); }
  100% { transform: rotate(0); }
}
