* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8f9fa;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 750px;
  margin: 0 auto;
  background: #f8f9fa;
}

.app.hidden { opacity: 0; }
.app { transition: opacity 0.3s; }

.header {
  background: linear-gradient(135deg, #6aa84f 0%, #93c47d 100%);
  color: white;
  padding: 16px 12px;
  margin: 0 12px;
  border-radius: 0 0 16px 16px;
  text-align: center;
  flex-shrink: 0;
}
.header h1 { font-size: 18px; font-weight: 600; }
.header p { font-size: 12px; opacity: 0.9; margin-top: 4px; }

.tabs {
  display: flex;
  background: white;
  padding: 4px;
  margin: 12px 12px 0 12px;
  gap: 4px;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.tab {
  flex: 1;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 12px;
  color: #666;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}
.tab:hover { background: #f0f0f0; }
.tab.active {
  background: linear-gradient(135deg, #6aa84f 0%, #93c47d 100%);
  color: white;
}

.content {
  flex: 1;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-content > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  min-height: 0;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.card-title { font-size: 15px; font-weight: 600; color: #333; }

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

.btn-group { display: flex; gap: 6px; }

.btn-primary {
  background: linear-gradient(135deg, #6aa84f 0%, #93c47d 100%);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.btn-secondary {
  background: #f0f0f0;
  color: #666;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.scroll-area {
  flex: 1;
  overflow: auto;
  min-height: 0;
  max-height: calc(100vh - 280px);
}

/* 스피너 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #888;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eee;
  border-top-color: #6aa84f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

/* 테이블 */
.customer-table, .product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.customer-table th, .customer-table td,
.product-table th, .product-table td {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #e0e0e0;
  white-space: nowrap;
}

.customer-table th, .product-table th {
  background: #fff;
  font-weight: 600;
  color: #555;
  position: sticky;
  top: 0;
  z-index: 10;
}

.customer-table thead, .product-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.customer-table thead::after, .product-table thead::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #e0e0e0;
}

.btn-cell {
  white-space: nowrap;
}

.product-table th:nth-child(1), .product-table td:nth-child(1) { width: 50px; }
.product-table th:nth-child(2), .product-table td:nth-child(2) { width: 55px; }
.product-table th:nth-child(3), .product-table td:nth-child(3) { width: auto; }
.product-table th:nth-child(4), .product-table td:nth-child(4) { width: 60px; }
.product-table th:nth-child(5), .product-table td:nth-child(5) { width: 70px; }
.product-table th:nth-child(6), .product-table td:nth-child(6) { width: 50px; }
.product-table th:nth-child(7), .product-table td:nth-child(7) { width: 90px; }

.customer-table tr:hover, .product-table tr:hover { background: #fafafa; }

.category-section { margin-bottom: 20px; }
.category-title { font-size: 14px; font-weight: 600; color: #6aa84f; padding: 8px 4px; border-bottom: 2px solid #6aa84f; margin-bottom: 8px; }

.filter-buttons { display: flex; gap: 8px; padding: 8px 0; }
.filter-btn { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 16px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.filter-btn:hover { border-color: #6aa84f; }
.filter-btn.active { background: #6aa84f; color: #fff; border-color: #6aa84f; }

.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: #e8f5e9; color: #2e7d32; }
.cat-badge.topping { background: #fff3e0; color: #e65100; }

.btn-edit, .btn-delete, .btn-subscribe {
  padding: 5px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  border: none;
  font-weight: 500;
}

.btn-edit { background: #e3f2fd; color: #1976d2; }
.btn-subscribe { background: #e8f5e9; color: #2e7d32; }
.btn-delete { background: #ffebee; color: #d32f2f; margin-left: 4px; }

.name-cell { white-space: nowrap; }
.btn-edit-inline {
  padding: 3px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 10px;
  border: none;
  font-weight: 500;
  background: #e3f2fd;
  color: #1976d2;
  margin-left: 6px;
  vertical-align: middle;
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: #999;
}

.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

.schedule-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 4px solid #6aa84f;
}

.schedule-item.delivery { border-left-color: #ff6b6b; }
.schedule-item .time { font-size: 16px; font-weight: 600; color: #333; }
.schedule-item .type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  margin-left: 6px;
  font-weight: 500;
}
.schedule-item .type.pickup { background: #e8f5e9; color: #2e7d32; }
.schedule-item .type.delivery { background: #ffebee; color: #c62828; }
.schedule-item .customer { font-size: 14px; margin-top: 6px; color: #333; font-weight: 500; }
.schedule-item .menu { font-size: 12px; color: #888; margin-top: 2px; }

/* 오늘 일정 테이블 */
.today-table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid #ddd; }
.today-table th { background: #f5f5f5; padding: 10px 8px; text-align: center; font-weight: 600; color: #555; border: 1px solid #ddd; }
.today-table td { padding: 10px 8px; border: 1px solid #ddd; vertical-align: middle; text-align: center; }
.today-table .time-cell { font-size: 15px; font-weight: 600; color: #333; background: #fafafa; }
.today-table .customer-cell { font-weight: 500; }
.today-table .menu-cell { color: #555; }
.today-table .delivery-row { background: #fff8f8; }
.today-table .type-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.today-table .type-badge.pickup { background: #e8f5e9; color: #2e7d32; }
.today-table .type-badge.delivery { background: #ffebee; color: #c62828; }

.day-header {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  padding: 8px 0;
  margin-top: 12px;
  border-bottom: 2px solid #6aa84f;
  margin-bottom: 8px;
}
.day-header.today { color: #6aa84f; }
.day-header:first-child { margin-top: 0; }

.sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; }

.sub-tab {
  padding: 6px 14px;
  border: none;
  background: #f0f0f0;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}
.sub-tab.active { background: #6aa84f; color: white; }

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: #6aa84f; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* 모달 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }

#editSubscriptionModal.active {
  z-index: 1100;
}

.modal-box {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 360px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-wide {
  max-width: 750px;
  width: 95%;
  height: 90vh;
}

.modal-wide > form {
  height: calc(90vh - 60px);
  display: flex;
  flex-direction: column;
}

.modal-wide .modal-body-row {
  height: calc(90vh - 130px);
  display: flex;
  gap: 16px;
  padding: 16px;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 16px; color: #333; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.modal-body { padding: 16px; }

.modal-body-row {
  display: flex;
  gap: 16px;
  padding: 16px;
}

.modal-body-left {
  flex: 1;
  min-width: 220px;
  overflow-y: auto;
}

.modal-body-right {
  flex: 1;
  min-width: 220px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modal-body-right > label {
  margin-bottom: 8px;
}

/* CALENDAR FIX VERSION ABC123XYZ789 */
.modal-body-right .calendar-preview {
  flex: none !important;
  height: calc(90vh - 180px) !important;
  overflow-y: auto !important;
  background: #f5f5f5 !important;
  border-radius: 8px !important;
}

@media (max-width: 600px) {
  .modal-body-row { flex-direction: column; }
}

.form-group { margin-bottom: 10px; }
.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #555;
  font-size: 12px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 10px;
  border: 2px solid #eee;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #6aa84f; }

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
}
.modal-footer .btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.modal-footer .btn-submit { background: linear-gradient(135deg, #6aa84f 0%, #93c47d 100%); color: white; }
.modal-footer .btn-cancel { background: #f0f0f0; color: #666; }

.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #eee;
  border-radius: 20px;
  font-size: 13px;
  outline: none;
}
.search-input:focus { border-color: #6aa84f; }
.search-input::placeholder { color: #aaa; }

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.time-slot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
}
.time-slot-item span { font-weight: 500; }
.time-slot-item .btn-delete { margin-left: 0; }

.init-loading {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #6aa84f 0%, #93c47d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.init-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  margin-bottom: 16px;
}
.init-loading span { color: white; font-size: 14px; font-weight: 500; }

.day-checkboxes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-check {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.day-check input { display: none; }
.day-check span {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f0f0;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}
.day-check input:checked + span { background: #6aa84f; color: white; }
.day-check:hover span { background: #e0e0e0; }
.day-check input:checked:hover + span { background: #5a9740; }

/* 메뉴 개수 선택 */
.menu-count-select {
  display: flex;
  gap: 12px;
}

.radio-btn {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-btn input[type="radio"] {
  margin-right: 4px;
  width: 16px;
  height: 16px;
}

.radio-btn span {
  font-size: 13px;
  color: #333;
}

.day-time-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.day-time-row .day-check span {
  width: 30px;
  height: 30px;
  font-size: 11px;
}
.day-time-select {
  flex: 1;
  padding: 6px 8px;
  border: 2px solid #eee;
  border-radius: 6px;
  font-size: 12px;
  background: #f9f9f9;
  color: #999;
  transition: all 0.2s;
}
.day-time-select:not(:disabled) {
  background: #fff;
  border-color: #6aa84f;
  color: #333;
}
.day-menu-select {
  flex: 2;
  padding: 8px 10px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 13px;
  background: #f9f9f9;
  color: #999;
  transition: all 0.2s;
}
.day-menu-select:not(:disabled) {
  background: #fff;
  border-color: #1976d2;
  color: #333;
}
.day-topping-select {
  flex: 1;
  padding: 8px 6px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 12px;
  background: #f9f9f9;
  color: #999;
  transition: all 0.2s;
  min-width: 70px;
}
.day-topping-select:not(:disabled) {
  background: #fff;
  border-color: #ff9800;
  color: #333;
}

/* 패턴 설정 */
.pattern-days-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pattern-day-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pattern-day-row .day-check span {
  width: 32px;
  height: 32px;
  font-size: 11px;
}
.pattern-time, .pattern-menu-type, .pattern-menu {
  padding: 6px 8px;
  border: 2px solid #eee;
  border-radius: 6px;
  font-size: 12px;
  background: #f9f9f9;
  color: #999;
}
.pattern-time { width: 80px; }
.pattern-menu-type { width: 90px; }
.pattern-menu { flex: 1; min-width: 0; }
.pattern-time:not(:disabled), .pattern-menu-type:not(:disabled), .pattern-menu:not(:disabled) {
  background: #fff;
  border-color: #6aa84f;
  color: #333;
}
.pattern-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.pattern-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.pattern-card-name {
  font-weight: 600;
  font-size: 15px;
  color: #333;
}
.pattern-card-detail {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}
.pattern-card-day {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
  font-size: 11px;
}

/* 자동완성 메뉴 선택 */
.autocomplete-wrap {
  position: relative;
  flex: 2;
  min-width: 0;
}
.autocomplete-input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 13px;
  background: #f9f9f9;
  color: #999;
  box-sizing: border-box;
}
.autocomplete-input:not(:disabled) {
  background: #fff;
  border-color: #1976d2;
  color: #333;
}
.autocomplete-input:focus {
  outline: none;
  border-color: #1565c0;
}
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 2px solid #1976d2;
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  display: none;
}
.autocomplete-list.show {
  display: block;
}
.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover, .autocomplete-item.selected {
  background: #e3f2fd;
}
.autocomplete-item .item-name {
  font-weight: 500;
  color: #333;
}
.autocomplete-item .item-price {
  font-size: 11px;
  color: #888;
  margin-left: 8px;
}

.calendar-preview {
  display: flex;
  flex-direction: column;
  padding: 2px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  /* 2024-02-03 fixed */
}

.calendar-month {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px;
  min-width: 160px;
  scroll-snap-align: start;
  flex-shrink: 0;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 6px;
}

.calendar-month-title {
  font-weight: 600;
  font-size: 11px;
  color: #333;
  margin-bottom: 4px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  font-size: 9px;
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  color: #888;
  padding: 2px 0;
}

.calendar-day {
  text-align: center;
  padding: 2px 1px;
  border-radius: 3px;
  color: #999;
}
.calendar-day.active { background: #6aa84f; color: white; font-weight: 600; display: flex; flex-direction: column; }
.calendar-day.skipped { background: #ffebee; color: #d32f2f; text-decoration: line-through; }
.calendar-day.today { border: 1px solid #6aa84f; }

.calendar-day .day-num { font-size: 9px; }
.calendar-day .day-menu { font-size: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }

.calendar-empty { padding: 15px; text-align: center; color: #999; font-size: 11px; }

.subscription-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 4px solid #6aa84f;
  cursor: pointer;
}

.sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sub-customer { font-size: 15px; font-weight: 600; color: #333; }

.sub-status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.sub-status.active { background: #e8f5e9; color: #2e7d32; }
.sub-status.inactive { background: #ffebee; color: #d32f2f; }

.sub-card-summary { font-size: 12px; color: #666; }
.sub-card-schedule { font-size: 12px; color: #666; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.day-info { background: #e3f2fd; color: #1565c0; padding: 2px 8px; border-radius: 12px; font-size: 11px; white-space: nowrap; }

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #888; font-size: 13px; }
.detail-value { font-weight: 500; font-size: 14px; color: #333; }
.detail-status.active { color: #2e7d32; }
.detail-status.inactive { color: #d32f2f; }

.app-info { padding: 8px 0; color: #888; font-size: 13px; }
.app-info p { margin: 4px 0; }

/* 횟수 입력칸 */
.sessions-input {
  width: 45px;
  padding: 8px 4px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  -moz-appearance: textfield;
}
.sessions-input::-webkit-outer-spin-button,
.sessions-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sessions-input:focus {
  outline: none;
  border-color: #6aa84f;
}

/* 일간 네비게이션 */
.day-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
  position: relative;
}

.day-label-wrap {
  text-align: center;
  cursor: pointer;
}

/* 주간 달력 */
.week-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.week-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}

.week-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  transition: all 0.2s;
}

.week-nav-btn:hover {
  background: #6aa84f;
  color: white;
}

.week-label-wrap {
  text-align: center;
  position: relative;
}

.week-label {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  display: block;
}

.week-range {
  font-size: 11px;
  color: #888;
}

.calendar-icon {
  font-size: 14px;
  margin-left: 4px;
  vertical-align: middle;
}

/* 날짜 선택 팝업 */
.date-picker {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 12px;
  z-index: 100;
  width: 280px;
}

.date-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.date-picker-header button {
  background: #f0f0f0;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
}

.date-picker-header button:hover {
  background: #6aa84f;
  color: white;
}

.date-picker-header span {
  font-weight: 600;
  font-size: 14px;
}

.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.date-picker-days span:first-child { color: #d32f2f; }
.date-picker-days span:last-child { color: #1976d2; }

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-picker-grid span {
  text-align: center;
  padding: 8px 4px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s;
}

.date-picker-grid span:first-child,
.date-picker-grid span:nth-child(7n+1) {
  border-radius: 6px 0 0 6px;
}

.date-picker-grid span:nth-child(7n) {
  border-radius: 0 6px 6px 0;
}

.date-picker-grid span.other-month {
  color: #ccc;
}

.date-picker-grid span.today {
  background: #6aa84f;
  color: white;
  font-weight: 600;
}

.date-picker-grid span.selected-week {
  background: #d4edda;
}

.date-picker-grid span.selected-week.today {
  background: #6aa84f;
}

.date-picker-grid span.hover-week {
  background: #fff3cd;
}

.date-picker-grid span.hover-week.today {
  background: #6aa84f;
}

.date-picker-grid span.hover-week.selected-week {
  background: #c3e6cb;
}

.date-picker-grid span.selected-day {
  background: #6aa84f;
  color: white;
  font-weight: 600;
  border-radius: 6px;
}

/* 고객 달력 버튼 */
.btn-calendar {
  padding: 5px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  border: none;
  background: #fff3cd;
  margin-left: 4px;
}

/* 전체 달력 */
.calendar-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.calendar-sub-select {
  padding: 8px 12px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 12px;
  max-width: 180px;
}

.calendar-sub-select:focus {
  outline: none;
  border-color: #6aa84f;
}

.calendar-nav button {
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
}

.calendar-nav button:hover {
  background: #6aa84f;
  color: white;
}

.calendar-nav span {
  font-weight: 600;
  font-size: 16px;
}

.full-calendar {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

.full-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fa;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  padding: 10px 0;
}

.full-calendar-header .sunday { color: #d32f2f; }
.full-calendar-header .saturday { color: #1976d2; }

.full-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-cell {
  min-height: 70px;
  border: 1px solid #eee;
  padding: 4px;
  font-size: 11px;
}

.calendar-cell.other-month {
  background: #fafafa;
  color: #ccc;
}

.calendar-cell.today {
  background: #e8f5e9;
}

.calendar-cell-date {
  font-weight: 600;
  margin-bottom: 4px;
}

.calendar-cell.sunday .calendar-cell-date { color: #d32f2f; }
.calendar-cell.saturday .calendar-cell-date { color: #1976d2; }
.calendar-cell.other-month .calendar-cell-date { color: #ccc; }

.calendar-event {
  background: #6aa84f;
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 10px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event.delivery {
  background: #ff6b6b;
}

.calendar-legend {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-dot.pickup { background: #6aa84f; }
.legend-dot.delivery { background: #ff6b6b; }

/* 스케줄표 */
.schedule-table-wrap {
  background: white;
  padding: 16px;
  font-family: 'Malgun Gothic', sans-serif;
}

.schedule-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  padding: 12px;
  background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid #ccc;
  padding: 6px 4px;
  text-align: center;
}

.schedule-table th {
  background: #f0f0f0;
  font-weight: 600;
}

.schedule-table tr.row-yellow { background: #fffde7; }
.schedule-table tr.row-green { background: #e8f5e9; }

.schedule-table .price-original { color: #666; }
.schedule-table .price-discount { color: #d32f2f; font-weight: 600; }

.schedule-footer {
  margin-top: 8px;
  font-size: 11px;
}

.schedule-discount-info {
  text-align: center;
  color: #e91e63;
  margin-bottom: 8px;
}

.schedule-summary {
  background: #fff9c4;
  border: 2px solid #fbc02d;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.schedule-summary .label {
  background: #4caf50;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 8px;
}

.schedule-summary .total-original {
  color: #666;
  margin-bottom: 4px;
}

.schedule-summary .discount-badge {
  color: #e91e63;
  font-weight: 600;
}

.schedule-summary .total-final {
  font-size: 18px;
  font-weight: bold;
  color: #d32f2f;
  margin: 8px 0;
}

.schedule-bank {
  background: #e3f2fd;
  padding: 8px;
  border-radius: 4px;
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
}

.schedule-bank strong {
  color: #1976d2;
}

/* 스케줄표 버튼 */
.btn-schedule {
  padding: 5px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  border: none;
  background: #e8f5e9;
  color: #2e7d32;
  margin-left: 4px;
}

.date-picker-grid span.sunday { color: #d32f2f; }
.date-picker-grid span.saturday { color: #1976d2; }
.date-picker-grid span.today.sunday,
.date-picker-grid span.today.saturday { color: white; }
.date-picker-grid span.other-month.sunday { color: #f5a0a0; }
.date-picker-grid span.other-month.saturday { color: #90caf9; }

.date-picker-today {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.date-picker-today:hover {
  background: #6aa84f;
  color: white;
}

.week-calendar {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.week-header-cell {
  text-align: center;
  padding: 8px 4px;
  background: #f8f9fa;
  border-radius: 8px;
}

.week-header-cell.today {
  background: #6aa84f;
  color: white;
}

.week-header-cell.sunday { color: #d32f2f; }
.week-header-cell.saturday { color: #1976d2; }
.week-header-cell.today.sunday,
.week-header-cell.today.saturday { color: white; }

.week-day-name {
  font-size: 12px;
  font-weight: 600;
}

.week-day-date {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.8;
}

.week-body {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  overflow-y: auto;
  align-items: start;
}

.week-day-col {
  background: #fafafa;
  border-radius: 8px;
  padding: 6px;
  min-height: 80px;
  max-height: 100%;
  overflow-y: auto;
}

.week-day-col.today {
  background: #e8f5e9;
}

.week-event {
  background: white;
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 4px;
  border-left: 3px solid #6aa84f;
  font-size: 11px;
  overflow: hidden;
}

.week-event.delivery {
  border-left-color: #ff6b6b;
}

.week-event-time {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.week-event-name {
  color: #555;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-event-menu {
  color: #888;
  font-size: 10px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-empty {
  color: #bbb;
  font-size: 10px;
  text-align: center;
  padding: 10px 0;
}

/* 메뉴 선택 영역 */
.menu-select-area {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px;
  background: #fafafa;
}

.menu-select-header {
  margin-bottom: 6px;
}

.menu-select-header .search-input {
  padding: 8px;
  font-size: 12px;
}

.menu-checkbox-list {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  background: white;
  padding: 4px;
}

.menu-checkbox-item {
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 12px;
}

.menu-checkbox-item:hover {
  background: #f5f5f5;
}

.menu-checkbox-item input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

.menu-checkbox-item .menu-name {
  font-weight: 500;
  flex: 1;
}

.menu-checkbox-item .menu-price {
  color: #888;
  font-size: 11px;
}

.selected-menus-area {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.selected-menus-area > label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}

.selected-menus-list {
  min-height: 40px;
  max-height: 100px;
  overflow-y: auto;
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 4px;
  background: white;
}

.selected-menu-item {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  background: #e8f5e9;
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: grab;
  user-select: none;
  font-size: 12px;
}

.selected-menu-item:active {
  cursor: grabbing;
}

.selected-menu-item.dragging {
  opacity: 0.5;
  background: #c8e6c9;
}

.selected-menu-item .order-num {
  width: 20px;
  height: 20px;
  background: #6aa84f;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0;
}

.selected-menu-item .menu-info {
  flex: 1;
  min-width: 0;
}

.selected-menu-item .menu-info .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-menu-item .topping-select {
  padding: 3px 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 10px;
  background: white;
  color: #555;
  max-width: 70px;
  margin-right: 4px;
  flex-shrink: 0;
}

.selected-menu-item .remove-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: #ffebee;
  color: #d32f2f;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.selected-menus-list.empty::before {
  content: "메뉴를 선택해주세요";
  display: block;
  text-align: center;
  color: #bbb;
  padding: 10px;
  font-size: 11px;
}
