/* 제이뷰티 피부힐링샵 - 공비서 스타일 공통 CSS */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,500&display=swap');

* { box-sizing: border-box; }
html, body {
  font-family: 'Noto Sans KR', sans-serif;
  background: #F8F6F1;
  color: #33342E;
  -webkit-font-smoothing: antialiased;
}
html { overflow-x: hidden; }
body.modal-open { overflow: hidden; }
.font-display { font-family: 'Playfair Display', serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5c7; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a9bba5; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #6B8F71 0%, #57755D 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 40;
}
.main-content { margin-left: 240px; flex: 1; min-width: 0; }
.sidebar-brand-mark {
  width: 100%;
  max-width: 150px;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0;
  border-radius: 18px;
  background: #FFF2C2;
  box-shadow: 0 8px 22px rgba(35,52,39,.2);
  overflow: hidden;
}
.sidebar-logo { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; display: block; }
.dashboard-greeting { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.dashboard-greeting-logo {
  width: 38px; height: 38px; object-fit: cover; flex: 0 0 38px;
  border-radius: 10px; background: #fff; border: 1px solid #E5E1D5;
  box-shadow: 0 3px 10px rgba(76,107,80,.12);
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

.nav-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1.25rem; margin: .15rem .75rem;
  border-radius: 12px; color: rgba(255,255,255,.85);
  font-size: .92rem; font-weight: 500; transition: all .15s ease;
}
.nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-link.active { background: #fff; color: #4C6B50; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.nav-link i { width: 18px; text-align: center; }

/* Cards */
.card {
  background: #fff; border-radius: 18px; border: 1px solid #EDEAE1;
  box-shadow: 0 2px 10px rgba(76,107,80,.05);
}
.stat-card { padding: 1.25rem 1.4rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; font-weight: 600; font-size: .875rem; padding: .55rem 1.1rem; border-radius: 10px; transition: all .15s ease; cursor: pointer; white-space: nowrap; }
.btn-primary { background: #6B8F71; color: #fff; }
.btn-primary:hover { background: #58775e; }
.btn-secondary { background: #F1EFE7; color: #4C4C42; }
.btn-secondary:hover { background: #e7e3d6; }
.btn-outline { background: transparent; border: 1px solid #D8D3C4; color: #56564C; }
.btn-outline:hover { background: #F5F3EC; }
.btn-danger { background: #FBE9E7; color: #C0392B; }
.btn-danger:hover { background: #f6d9d5; }
.btn-gold { background: #C9A66B; color: #fff; }
.btn-gold:hover { background: #b8945a; }
.btn-sm { padding: .35rem .75rem; font-size: .78rem; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-green { background: #E7F1E4; color: #4C6B50; }
.badge-gold { background: #F6ECD9; color: #9C7A34; }
.badge-red { background: #FBE5E3; color: #C0392B; }
.badge-gray { background: #EFEDE7; color: #77756A; }
.badge-blue { background: #E4EEF7; color: #2E6DA4; }
.quick-ticket-badge {
  display: inline-flex; align-items: center; gap: .28rem; margin-left: .35rem;
  padding: .18rem .55rem; border: 1px solid #E9D5AA; border-radius: 999px;
  background: #F7ECD7; color: #8A6729; font-size: .7rem; font-weight: 800;
  line-height: 1.2; white-space: nowrap; cursor: pointer;
}
.quick-ticket-badge:hover { background: #EFDEBC; border-color: #D9BA7E; }
.quick-ticket-modal-box { max-width: 680px; }
.quick-ticket-balance {
  display: grid; grid-template-columns: 1.3fr .8fr 1fr; gap: .6rem;
  padding: .85rem; border: 1px solid #E8E2D5; border-radius: 14px; background: #FAF8F1;
}
.quick-ticket-balance > div { min-width: 0; }
.quick-ticket-balance span { display: block; color: #8B8A7E; font-size: .7rem; font-weight: 700; }
.quick-ticket-balance strong { display: block; margin-top: .15rem; color: #33342E; font-size: .86rem; overflow-wrap: anywhere; }
.rollback-confirm-modal-box { max-width: 660px; }
.rollback-confirm-ticket { padding: 1rem; border: 1px solid #E8E2D5; border-radius: 14px; background: #FAF8F1; }
.rollback-confirm-customer { color: #33342E; font-size: 1rem; font-weight: 800; }
.rollback-confirm-ticket-name { margin-top: .18rem; color: #77756A; font-size: .82rem; font-weight: 600; }
.rollback-confirm-log { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .75rem; color: #5F5D54; font-size: .78rem; }
.rollback-confirm-memo { display: flex; align-items: flex-start; gap: .4rem; margin-top: .65rem; padding-top: .65rem; border-top: 1px solid #E8E2D5; color: #6F6B5F; font-size: .78rem; line-height: 1.5; }
.rollback-confirm-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
.rollback-confirm-preview > div { padding: .85rem; border: 1px solid #EDD1CB; border-radius: 12px; background: #FFF7F5; }
.rollback-confirm-preview span { display: block; color: #96746D; font-size: .72rem; font-weight: 700; }
.rollback-confirm-preview strong { display: flex; align-items: center; flex-wrap: wrap; gap: .42rem; margin-top: .35rem; color: #514641; font-size: .84rem; }
.rollback-confirm-preview strong i { color: #B59B95; font-size: .7rem; }
.rollback-confirm-preview strong em { color: #B44838; font-style: normal; font-weight: 800; }
.rollback-confirm-check { display: flex; align-items: flex-start; gap: .7rem; padding: .9rem; border: 1px solid #E6C6BF; border-radius: 12px; background: #FFF9F7; color: #554A46; font-size: .86rem; font-weight: 700; line-height: 1.5; cursor: pointer; }
.rollback-confirm-check input { flex: 0 0 auto; width: 21px; height: 21px; margin-top: .05rem; accent-color: #B44838; cursor: pointer; }
.rollback-confirm-warning { display: flex; align-items: flex-start; gap: .4rem; color: #A65A4A; font-size: .74rem; line-height: 1.5; }
.destructive-confirm-modal-box { max-width: 660px; }
.destructive-confirm-details { padding: 1rem; border: 1px solid #EDD1CB; border-radius: 14px; background: #FFF8F6; color: #514641; }
.destructive-confirm-details:empty { display: none; }
.destructive-confirm-subject { color: #33342E; font-size: 1rem; font-weight: 800; overflow-wrap: anywhere; }
.destructive-confirm-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; margin-top: .45rem; color: #777067; font-size: .78rem; }
.destructive-confirm-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .75rem; }
.destructive-confirm-counts > div { padding: .65rem .75rem; border: 1px solid #E8DED9; border-radius: 10px; background: #fff; }
.destructive-confirm-counts span { display: block; color: #927A73; font-size: .7rem; font-weight: 700; }
.destructive-confirm-counts strong { display: block; margin-top: .15rem; color: #B44838; font-size: .9rem; overflow-wrap: anywhere; }
.destructive-confirm-note { display: flex; align-items: flex-start; gap: .4rem; margin-top: .75rem; color: #8A5D53; font-size: .76rem; line-height: 1.5; }
.destructive-confirm-check { display: flex; align-items: flex-start; gap: .7rem; padding: .9rem; border: 1px solid #E6C6BF; border-radius: 12px; background: #FFF9F7; color: #554A46; font-size: .86rem; font-weight: 700; line-height: 1.5; cursor: pointer; }
.destructive-confirm-check input { flex: 0 0 auto; width: 21px; height: 21px; margin-top: .05rem; accent-color: #B44838; cursor: pointer; }
.destructive-confirm-warning { display: flex; align-items: flex-start; gap: .4rem; color: #A65A4A; font-size: .74rem; line-height: 1.5; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { text-align: left; padding: .7rem .9rem; color: #8B8A7E; font-weight: 600; font-size: .78rem; border-bottom: 1px solid #EFEDE4; white-space: nowrap; }
.data-table td { padding: .75rem .9rem; border-bottom: 1px solid #F4F2EB; vertical-align: middle; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #FAF9F4; }

/* Inputs */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: .55rem .8rem; border: 1px solid #DEDBCE; border-radius: 10px;
  font-size: .875rem; background: #fff; color: #33342E; transition: border-color .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: #6B8F71; box-shadow: 0 0 0 3px rgba(107,143,113,.12); }
.form-label { font-size: .8rem; font-weight: 600; color: #56564C; margin-bottom: .3rem; display: block; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30,34,26,.58); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal-box { background: #fff; border-radius: 20px; max-width: 760px; width: 100%; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; transform: translateY(12px) scale(.98); transition: transform .18s ease; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.modal-box-wide { max-width: 960px; }
.modal-box-detail { max-width: 860px; }
.modal-box > .p-6 { padding: 2rem; }
.modal-backdrop.show .modal-box { transform: translateY(0) scale(1); }
.modal-close-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; color: #77756A; background: #F5F3EC; transition: background .15s ease, color .15s ease; }
.modal-close-btn:hover { background: #EAE6DA; color: #33342E; }

/* Naver reservation customer matching */
.customer-match-modal-box { max-width: 760px; }
.customer-match-source { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; padding: .85rem; border: 1px solid #E8E3D7; border-radius: 14px; background: #FAF9F4; }
.customer-match-source > div { min-width: 0; }
.customer-match-source span { display: block; color: #8B8A7E; font-size: .7rem; font-weight: 700; }
.customer-match-source strong { display: block; margin-top: .2rem; color: #33342E; font-size: .88rem; overflow-wrap: anywhere; }
.customer-match-results { display: grid; gap: .45rem; max-height: 220px; margin-top: .55rem; overflow-y: auto; }
.customer-match-result { display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; padding: .72rem .8rem; border: 1px solid #E7E3D8; border-radius: 11px; background: #fff; text-align: left; transition: border-color .15s ease, background .15s ease; }
.customer-match-result:hover, .customer-match-result.selected { border-color: #7D9D82; background: #F0F6EE; }
.customer-match-result > span { display: flex; min-width: 0; flex-direction: column; gap: .12rem; color: #33342E; font-size: .88rem; font-weight: 800; }
.customer-match-result small { color: #8B8A7E; font-size: .72rem; font-weight: 500; }
.customer-match-result em { flex: 0 0 auto; padding: .22rem .5rem; border-radius: 999px; background: #E7F1E4; color: #4F7557; font-size: .7rem; font-style: normal; font-weight: 800; }
.customer-match-empty { padding: .8rem; border: 1px dashed #DDD8CC; border-radius: 11px; color: #8B8A7E; font-size: .78rem; text-align: center; }
.customer-match-selected { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; padding: .85rem; border: 1px solid #BDD0BA; border-radius: 13px; background: #EEF5EC; color: #46664C; }
.customer-match-selected > div { display: flex; min-width: 0; flex-direction: column; }
.customer-match-selected span { color: #6E866F; font-size: .7rem; font-weight: 700; }
.customer-match-selected strong { color: #33342E; font-size: .95rem; }
.customer-match-selected small { margin-top: .15rem; color: #71806F; font-size: .72rem; }
.customer-match-selected > i { flex: 0 0 auto; font-size: 1.25rem; }
.customer-match-alias { display: flex; align-items: flex-start; gap: .65rem; margin-top: .65rem; padding: .8rem; border: 1px solid #E4D5B9; border-radius: 12px; background: #FFF9EA; color: #67563D; font-size: .84rem; line-height: 1.45; cursor: pointer; }
.customer-match-alias input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: #B68E50; }
.customer-match-alias strong { color: #9A6C23; }
.customer-match-duplicate { margin-top: .75rem; padding: .85rem; border: 1px solid #E8C9C2; border-radius: 13px; background: #FFF7F5; }
.customer-match-duplicate > p { color: #A64B3E; font-size: .86rem; font-weight: 800; }
#match-duplicate-details { display: flex; gap: .6rem; margin: .5rem 0 .65rem; color: #675952; font-size: .78rem; }
.customer-match-duplicate > label { display: flex; align-items: flex-start; gap: .55rem; margin-top: .45rem; color: #625853; font-size: .78rem; line-height: 1.45; cursor: pointer; }
.customer-match-duplicate input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #B44838; }
.customer-match-duplicate-confirm { padding: .65rem; border: 1px solid #E5C2BA; border-radius: 9px; background: #fff; font-weight: 800; }
.customer-match-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #EFECE3; }
.import-match-suggestion { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.import-match-suggestion button { padding: .25rem .5rem; border: 1px solid #B9CDB7; border-radius: 8px; background: #EEF5EC; color: #4C6B50; font-size: .72rem; font-weight: 800; }

/* Progress bar */
.progress-track { height: 8px; border-radius: 999px; background: #EFEDE4; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#6B8F71,#8CAB8C); }

/* Toast */
#toast-container { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; }
.toast { padding: .8rem 1.1rem; border-radius: 12px; color: #fff; font-size: .87rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.15); animation: toastIn .2s ease; max-width: 320px; }
.toast.success { background: #6B8F71; }
.toast.error { background: #C0392B; }
.toast.info { background: #3D6285; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.empty-state { text-align: center; padding: 3rem 1rem; color: #A6A497; }
.spinner { width: 20px; height: 20px; border: 3px solid #E4E1D6; border-top-color: #6B8F71; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; background: #F1EFE7; font-size: .72rem; color: #6B6A5E; margin: .1rem; }

/* ---------- Calendar / Scheduler ---------- */
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .75rem; font-weight: 700; color: #8B8A7E; padding-bottom: .5rem; }
.calendar-weekdays .sun { color: #C0392B; }
.calendar-weekdays .sat { color: #2E6DA4; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-cell {
  position: relative; min-height: 104px; padding: .35rem .4rem;
  border-radius: 10px; background: #FAF9F4; border: 1px solid #F1EFE7;
  cursor: pointer; transition: all .12s ease; overflow: hidden;
}
.calendar-cell:hover { background: #F1EFE7; border-color: #DEDBCE; }
.calendar-cell.other-month { background: transparent; border-color: transparent; cursor: default; opacity: .35; }
.calendar-cell.other-month:hover { background: transparent; }
.calendar-cell.today { border-color: #6B8F71; box-shadow: inset 0 0 0 1px #6B8F71; }
.calendar-cell.selected { background: #E7F1E4; border-color: #6B8F71; }
.calendar-cell.sun .calendar-daynum { color: #C0392B; }
.calendar-cell.sat .calendar-daynum { color: #2E6DA4; }
.calendar-daynum { font-size: .8rem; font-weight: 700; color: #56564C; display: flex; align-items: center; gap: .3rem; }
.calendar-today-tag { font-size: .58rem; font-weight: 700; background: #6B8F71; color: #fff; padding: 0 .35rem; border-radius: 999px; }
.calendar-count-badge {
  position: absolute; top: .35rem; right: .4rem; font-size: .64rem; font-weight: 800;
  color: #fff; background: #C0392B; padding: .05rem .45rem; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); line-height: 1.3;
}
.calendar-events { display: flex; flex-direction: column; gap: 2px; margin-top: .35rem; }
.calendar-event {
  display: flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 750;
  padding: .14rem .35rem; border-radius: 6px; color: #fff; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.calendar-event-time { flex-shrink: 0; opacity: .94; font-size: .68rem; font-weight: 800; }
.calendar-event-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.calendar-event-alias {
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #FFE1A6; font-size: .7rem; font-weight: 850;
}
.calendar-event.dot-blue { background: #3D6285; }
.calendar-event.dot-green { background: #4C6B50; }
.calendar-event.dot-complete { background: #73766F; }
.calendar-event.dot-complete .calendar-event-alias { color: inherit; font-weight: 750; opacity: .9; }
.calendar-event.dot-cancelled { background: #B6B4AB; text-decoration: line-through; }
.calendar-event.dot-red { background: #C0392B; }
.calendar-event.dot-gray { background: #8B8A7E; }
.calendar-more { font-size: .62rem; color: #6B8F71; font-weight: 800; margin-top: 1px; }

/* Dashboard selected-day reservation list */
.dashboard-reservation-row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center;
  gap: .9rem; min-height: 64px; padding: .65rem .8rem .65rem 0;
  border: 1px solid #E8E4D9; border-left-width: 5px; border-radius: 13px;
}
.dashboard-reservation-row.is-upcoming { background: #F5F8FB; border-left-color: #3D6285; }
.dashboard-reservation-row.is-complete { background: #F2F2EF; border-left-color: #73766F; }
.dashboard-reservation-row.is-noshow { background: #FDF4F2; border-left-color: #C0392B; }
.dashboard-reservation-row.is-cancelled { background: #F6F5F1; border-left-color: #8B8A7E; }
.dashboard-reservation-time {
  align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; border-right: 1px solid rgba(107,106,94,.14); color: #3C5942;
}
.dashboard-reservation-time span { font-size: .7rem; font-weight: 700; color: #7B7A70; }
.dashboard-reservation-time strong { font-size: 1rem; line-height: 1.1; letter-spacing: .01em; }
.dashboard-reservation-info {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 1rem; min-width: 0;
}
.dashboard-reservation-name { flex: 0 1 auto; min-width: 0; font-size: .92rem; font-weight: 800; color: #33342E; line-height: 1.35; }
.dashboard-reservation-phone { font-size: .75rem; font-weight: 600; color: #9A988C; }
.dashboard-reservation-detail { display: flex; flex: 0 1 auto; align-items: center; gap: .85rem; min-width: 0; margin-top: 0; color: #747368; font-size: .78rem; }
.dashboard-reservation-detail > span { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.dashboard-reservation-detail i { color: #8CA18B; }
.dashboard-reservation-memo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.customer-inline-name { display: inline; font-size: inherit; font-weight: inherit; }
.customer-inline-name .customer-inline-alias { display: inline; color: #A06F27; font-size: inherit; font-weight: inherit; }
.dashboard-reservation-status { align-self: center; padding-right: .1rem; }
.customer-memo-cell { min-width: 240px; max-width: 360px; }
.customer-memo-preview {
  display: flex; align-items: flex-start; gap: .42rem; padding: .48rem .58rem;
  border: 1px solid #E9DFC9; border-radius: 10px; background: #FBF6E9;
  color: #625843; font-size: .76rem; line-height: 1.45; text-align: left;
}
.customer-memo-preview i { flex: 0 0 auto; margin-top: .16rem; color: #A9823F; }
.customer-detail-memo { padding: 1rem; border: 1px solid #DFC58E; border-left: 5px solid #B88B3E; border-radius: 14px; background: #FFF8E8; }
.customer-detail-memo-title { display: flex; align-items: center; gap: .42rem; color: #835F25; font-size: .78rem; font-weight: 800; }
.customer-detail-memo-text { margin-top: .48rem; color: #403B31; font-size: .92rem; font-weight: 600; line-height: 1.65; overflow-wrap: anywhere; }

/* Reservation registration menu picker */
.reservation-modal-box { max-width: 900px; }
.reservation-menu-picker {
  padding: 1rem; border: 1px solid #E5E1D5; border-radius: 16px; background: #FCFBF7;
}
.reservation-menu-categories {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; overflow-x: auto;
  scrollbar-width: thin; padding-bottom: .15rem;
}
.reservation-menu-category {
  flex: 0 0 auto; min-height: 42px; padding: .55rem .85rem;
  border: 1px solid #DCD8CC; border-radius: 11px; background: #fff;
  color: #68675D; font-size: .82rem; font-weight: 800; white-space: nowrap;
  transition: all .15s ease;
}
.reservation-menu-category:hover { border-color: #8CAB8C; color: #4C6B50; background: #F7FAF5; }
.reservation-menu-category.active {
  border-color: #5F8064; background: #E8F0E5; color: #3F6045;
  box-shadow: inset 0 0 0 1px rgba(95,128,100,.12);
}
.reservation-menu-options {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem;
  max-height: 280px; overflow-y: auto; padding: .1rem;
}
.reservation-menu-option {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  min-width: 0; min-height: 58px; padding: .72rem .8rem;
  border: 1px solid #E2DED2; border-radius: 12px; background: #fff; text-align: left;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.reservation-menu-option:hover { border-color: #9CB19B; background: #FAFCF9; }
.reservation-menu-option.selected {
  border-color: #5F8064; background: #EDF4EB; box-shadow: 0 0 0 2px rgba(95,128,100,.11);
}
.reservation-menu-option-name {
  min-width: 0; color: #33342E; font-size: .86rem; font-weight: 800; line-height: 1.35;
  overflow-wrap: anywhere;
}
.reservation-menu-option-meta {
  display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: .1rem;
  color: #8B8A7E; font-size: .69rem; white-space: nowrap;
}
.reservation-menu-option-meta span { display: inline-flex; align-items: center; gap: .25rem; }
.reservation-menu-option-meta strong { color: #4C6B50; font-size: .78rem; }
.reservation-menu-selected {
  display: flex; align-items: center; gap: .5rem; min-height: 42px; margin-top: .7rem; padding: .58rem .72rem;
  border: 1px solid #E4E0D5; border-radius: 11px; background: #F5F3EC;
  color: #77756A; font-size: .78rem; line-height: 1.4;
}
.reservation-menu-selected.has-selection { border-color: #BCD0B9; background: #EEF5EC; color: #3E5F44; }
.reservation-menu-selected i { flex: 0 0 auto; }
.reservation-menu-selected strong { color: #33342E; font-size: .86rem; }
.reservation-menu-selected em { color: #667264; font-style: normal; font-weight: 700; }
.reservation-menu-special-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.reservation-menu-custom { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid #E7E3D9; }
.reservation-menu-empty {
  grid-column: 1 / -1; padding: 1rem; border: 1px dashed #DCD8CC; border-radius: 11px;
  color: #8B8A7E; font-size: .78rem; text-align: center;
}

/* Reservation table: desktop table + compact mobile accordion */
.reservation-mobile-only { display: none; }
.reservation-customer-cell { min-width: 210px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .main-content { width: 100%; }
  .main-content > header {
    padding: 4.5rem 1rem 1rem !important;
    align-items: stretch !important;
  }
  .main-content > header h2 { font-size: 1.4rem !important; line-height: 1.35; }
  .dashboard-greeting { gap: .4rem; }
  .dashboard-greeting-logo { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; }
  .main-content > header > .btn,
  .main-content > header > .flex {
    width: 100%;
  }
  .main-content > header > .flex {
    flex-direction: column;
    align-items: stretch;
  }
  .main-content > header .btn { width: 100%; white-space: normal; text-align: center; }
  .main-content > section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .main-content > section.flex { align-items: stretch !important; }
  .main-content > section.flex > * {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  .main-content > section.flex > .ml-auto { margin-left: 0 !important; text-align: right; }
  .mobile-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; }
  .mobile-stat-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mobile-stat-grid .stat-card { padding: 1rem; }
  .mobile-stat-grid .text-3xl { font-size: 1.5rem !important; }
  .mobile-stat-grid .text-2xl { font-size: 1.25rem !important; }
  .calendar-card-header { align-items: flex-start !important; }
  .calendar-controls { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .calendar-controls .btn { min-width: 44px; }
  .calendar-controls a { margin-left: auto; }
  .main-content .card.p-5 { padding: .75rem !important; }
  .calendar-grid { gap: 2px; }
  .calendar-cell { min-height: 108px; padding: .22rem .18rem; border-radius: 8px; }
  .calendar-daynum { font-size: .72rem; }
  .calendar-today-tag { display: none; }
  .calendar-count-badge { top: .22rem; right: .18rem; font-size: .52rem; padding: 0 .22rem; }
  .calendar-events { display: flex; gap: 2px; margin-top: .28rem; }
  .calendar-event { display: block; min-width: 0; padding: .14rem .08rem; font-size: .64rem; line-height: 1.18; text-align: center; border-radius: 4px; }
  .calendar-event-time,
  .calendar-event-name { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-event-time { font-size: .58rem; font-weight: 800; }
  .calendar-event-name { margin-top: 1px; font-size: .66rem; font-weight: 800; }
  .calendar-event-alias { display: none; }
  .calendar-more { font-size: .55rem; line-height: 1.15; text-align: center; margin-top: 1px; }

  .dashboard-reservation-row {
    grid-template-columns: 64px minmax(0, 1fr) auto; gap: .55rem;
    min-height: 68px; padding: .55rem .55rem .55rem 0; border-left-width: 4px;
  }
  .dashboard-reservation-time strong { font-size: .82rem; }
  .dashboard-reservation-time span { font-size: .62rem; }
  .dashboard-reservation-info { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .dashboard-reservation-name { font-size: .86rem; }
  .dashboard-reservation-detail { flex-direction: column; align-items: flex-start; gap: .08rem; font-size: .7rem; }
  .dashboard-reservation-memo { max-width: 100%; }
  .dashboard-reservation-status .badge { padding: .18rem .42rem; font-size: .66rem; }
  .quick-ticket-badge { margin-left: .2rem; padding: .15rem .42rem; font-size: .64rem; }
  .quick-ticket-balance { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .quick-ticket-actions { display: grid !important; grid-template-columns: minmax(0, 1fr); }
  .quick-ticket-actions > .btn,
  .quick-ticket-actions > div,
  .quick-ticket-actions > div .btn { width: 100%; margin-left: 0 !important; }
  .quick-ticket-actions > div { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rollback-confirm-preview { grid-template-columns: minmax(0, 1fr); }
  .destructive-confirm-counts { grid-template-columns: minmax(0, 1fr); }
  .customer-memo-cell { min-width: 0; max-width: none; }

  .data-table.mobile-cards,
  .data-table.mobile-cards tbody {
    display: block;
    width: 100%;
  }
  .data-table.mobile-cards thead { display: none; }
  .data-table.mobile-cards tr {
    display: block;
    margin: .75rem;
    border: 1px solid #E5E1D5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(76,107,80,.06);
    overflow: hidden;
  }
  .data-table.mobile-cards td {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .9rem;
    text-align: right;
    border-bottom: 1px solid #F1EFE7;
    white-space: normal;
  }
  .data-table.mobile-cards td::before {
    content: attr(data-label);
    flex: 0 0 76px;
    text-align: left;
    color: #8B8A7E;
    font-size: .76rem;
    font-weight: 700;
  }
  .data-table.mobile-cards td:last-child { border-bottom: 0; }
  .data-table.mobile-cards td:last-child::before { display: none; }
  .data-table.mobile-cards td > .flex { justify-content: flex-end; }
  .data-table.mobile-cards .action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    width: 100%;
  }
  .data-table.mobile-cards .action-buttons.actions-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-table.mobile-cards .action-buttons .btn { min-height: 42px; padding-left: .55rem; padding-right: .55rem; }

  .reservation-table,
  .reservation-table tbody { display: block; width: 100%; }
  .reservation-table thead,
  .reservation-table .reservation-desktop-cell { display: none; }
  .reservation-table .reservation-row {
    display: block; margin: .7rem; border: 1px solid #E4E0D5; border-radius: 14px;
    background: #fff; box-shadow: 0 2px 8px rgba(76,107,80,.06); overflow: hidden;
  }
  .reservation-table .reservation-mobile-only {
    display: block; width: 100%; padding: 0; border: 0; white-space: normal; text-align: left;
  }
  .reservation-mobile-summary { padding: .75rem .8rem; }
  .reservation-mobile-primary {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .55rem;
  }
  .reservation-mobile-time {
    color: #3D6285; font-size: .9rem; font-weight: 900; letter-spacing: .01em; white-space: nowrap;
  }
  .reservation-mobile-name {
    min-width: 0; overflow: hidden; color: #33342E; font-size: .9rem; font-weight: 800;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .reservation-mobile-status { white-space: nowrap; }
  .reservation-mobile-status .badge { padding: .18rem .42rem; font-size: .64rem; }
  .reservation-mobile-secondary {
    display: flex; align-items: center; gap: .45rem; min-width: 0; margin-top: .5rem;
  }
  .reservation-mobile-menu {
    display: inline-flex; align-items: center; gap: .35rem; min-width: 0; flex: 1 1 auto;
    overflow: hidden; color: #6F6E64; font-size: .74rem; font-weight: 700;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .reservation-mobile-menu i { flex: 0 0 auto; color: #79917A; }
  .reservation-mobile-ticket { flex: 0 0 auto; margin-left: 0; }
  .reservation-mobile-expand {
    display: inline-flex; flex: 0 0 auto; align-items: center; gap: .28rem; min-height: 32px;
    padding: .25rem .45rem; border-radius: 8px; background: #F3F1EA;
    color: #77756A; font-size: .68rem; font-weight: 800; white-space: nowrap;
  }
  .reservation-mobile-expand i { transition: transform .15s ease; }
  .reservation-mobile-expand.open i { transform: rotate(180deg); }
  .reservation-mobile-details {
    padding: .75rem .8rem .85rem; border-top: 1px solid #EEEAE0; background: #FAF9F5;
  }
  .reservation-mobile-detail-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem;
  }
  .reservation-mobile-detail-grid > div {
    min-width: 0; padding: .5rem .58rem; border: 1px solid #ECE7DC; border-radius: 9px; background: #fff;
  }
  .reservation-mobile-detail-grid span {
    display: block; color: #969489; font-size: .64rem; font-weight: 700;
  }
  .reservation-mobile-detail-grid strong {
    display: block; margin-top: .12rem; overflow: hidden; color: #4E4D46; font-size: .74rem;
    font-weight: 800; text-overflow: ellipsis; white-space: nowrap;
  }
  .reservation-mobile-memo {
    display: flex; align-items: flex-start; gap: .4rem; margin-top: .55rem; padding: .58rem;
    border: 1px solid #E9DFC9; border-radius: 9px; background: #FFF9EB;
    color: #625843; font-size: .72rem; line-height: 1.45;
  }
  .reservation-mobile-memo i { flex: 0 0 auto; margin-top: .14rem; color: #A9823F; }
  .reservation-mobile-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: end; gap: .45rem; margin-top: .6rem;
  }
  .reservation-mobile-actions .btn:only-child { grid-column: 1 / -1; }
  .reservation-mobile-actions .btn { width: 100%; min-height: 40px; }

  .reservation-menu-picker { padding: .75rem; }
  .reservation-menu-categories { margin-left: -.1rem; margin-right: -.1rem; }
  .reservation-menu-category { min-height: 44px; padding: .58rem .75rem; font-size: .8rem; }
  .reservation-menu-options { grid-template-columns: minmax(0, 1fr); max-height: 260px; }
  .reservation-menu-option { min-height: 58px; padding: .7rem; }
  .reservation-menu-special-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reservation-menu-special-actions .btn { width: 100%; white-space: normal; }

  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-box,
  .modal-box-wide,
  .modal-box-detail {
    width: 100%;
    max-width: none;
    max-height: 96vh;
    border-radius: 20px 20px 0 0;
  }
  .modal-box > .p-6 { padding: 1.25rem; }
  .modal-box .grid.grid-cols-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .customer-match-source { grid-template-columns: minmax(0, 1fr); }
  .customer-match-result { align-items: flex-start; }
  .customer-match-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #match-confirm-btn { grid-column: 1 / -1; }
  .modal-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-actions .btn { width: 100%; white-space: normal; }
  #customer-delete-btn { grid-column: 1 / -1; }
  .customer-save-actions { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-left: 0 !important; }
  #menu-delete-btn { grid-column: 1 / -1; }
  .menu-save-actions { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-left: 0 !important; }
  .reservation-delete-btn { grid-column: 1 / -1; }
  .detail-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-actions .btn { width: 100%; margin-left: 0 !important; white-space: normal; }
  .form-input, .form-select, .form-textarea { min-height: 46px; font-size: 16px; }
  #toast-container { left: 1rem; right: 1rem; top: .75rem; }
  .toast { max-width: none; width: 100%; }
}

/* Day detail panel (used in reservations calendar view) */
.calendar-day-panel { border-top: 1px solid #F1EFE7; margin-top: .75rem; padding-top: .75rem; }
