/* ============================================================================
   AITIP 가맹점 운영 포털 (배민 외식업광장 셀프서비스 / 토스플레이스급 모던 B2B 테마)
   특성: 배민 2.0 라이트 테마, 이모지 0%, 순수 SVG 라인 아이콘, 정밀 타이포그래피
   ============================================================================ */

:root {
  /* 배경 & 서피스 */
  --bg-app: #f4f6f8;
  --bg-sidebar: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --bg-active: #f1f5f9;

  /* 테두리 & 디바이더 */
  --border-light: #f1f3f5;
  --border-default: #e5e8eb;
  --border-strong: #d1d6db;
  --border-focus: #2ac1bc;

  /* 텍스트 컬러 */
  --text-primary: #191f28;
  --text-secondary: #4e5968;
  --text-muted: #8b95a1;
  --text-disabled: #b0b8c1;
  --text-white: #ffffff;

  /* 배민 시그니처 민트 (Brand Accent) */
  --brand-mint: #2ac1bc;
  --brand-mint-hover: #22a7a2;
  --brand-mint-light: #e6f7f6;
  --brand-mint-border: #b3ebe8;
  --brand-mint-text: #0e706c;

  /* 상태 컬러 */
  --color-success: #1b8a5a;
  --color-success-bg: #eafbf3;
  --color-warning: #c25e00;
  --color-warning-bg: #fff8eb;
  --color-danger: #e53e3e;
  --color-danger-bg: #fff0f0;
  --color-info: #3182ce;
  --color-info-bg: #ebf8ff;

  /* 섀도우 */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

  /* 타이포그래피 */
  --font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* 레이아웃 치수 */
  --sidebar-width: 280px;
  --header-height: 64px;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 메뉴 관리 일체형 블록 (배민 셀프서비스 정규 규격) */
.menu-group-block {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
  overflow: hidden;
}

.menu-group-block-header {
  padding: 16px 20px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.group-item-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f3f5;
  padding: 3px 8px;
  border-radius: 9999px;
}

.group-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-item-row {
  display: grid;
  grid-template-columns: 72px 1fr 130px 90px 140px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

.menu-item-row:hover {
  background: #fafbfc;
}

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

.menu-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  background: #f1f3f5;
  border: 1px solid var(--border-default);
  cursor: pointer;
}

.menu-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.menu-info-col:hover .menu-title-text {
  color: var(--brand-mint);
  text-decoration: underline;
}

.menu-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-title-text {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-desc-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.menu-options-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.empty-group-box {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 스케줄 관리 스타일 (영업 캘린더 & 메뉴 타임세일) */
.quick-pause-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff8eb;
  border: 1px solid #fed7aa;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
}

.pause-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pause-title {
  font-weight: 700;
  color: #9a3412;
  font-size: 13.5px;
}

.pause-desc {
  font-size: 12px;
  color: #c25e00;
}

.pause-btns {
  display: flex;
  gap: 6px;
}

.btn-pause {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  border: 1px solid #ea580c;
  background: #ffffff;
  color: #ea580c;
  transition: all 0.15s ease;
}

.btn-pause:hover {
  background: #ea580c;
  color: #ffffff;
}

/* 7일 영업 스케줄 테이블 */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.schedule-table th {
  background: #fafbfc;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-default);
  font-size: 13px;
  color: var(--text-secondary);
}

.schedule-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 13px;
}

.day-badge {
  display: inline-block;
  width: 32px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  background: var(--bg-app);
  color: var(--text-primary);
}

.day-badge.weekend {
  background: #fee2e2;
  color: #dc2626;
}

/* 메뉴 등록 요일 칩 선택기 (SwadKart FEAT-7) */
.schedule-day-chips {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.schedule-day-chip {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.schedule-day-chip.active {
  background: var(--brand-mint);
  border-color: var(--brand-mint);
  color: #ffffff;
  font-weight: 700;
}

.settings-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-default);
  margin-bottom: 20px;
}

.settings-tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.settings-tab-btn:hover {
  color: var(--text-primary);
}

.settings-tab-btn.active {
  color: var(--brand-mint);
  font-weight: 700;
}

.settings-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-mint);
}

/* 카테고리 (대분류 · 소분류) 관리 카드 스타일 */
.category-card {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.category-card:hover {
  border-color: var(--border-strong);
}

.category-card-header {
  padding: 14px 18px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-name-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-order-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f3f5;
  padding: 3px 8px;
  border-radius: 4px;
}

.category-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.category-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.category-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-card-body {
  padding: 16px 18px;
}

.subcat-chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.subcat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.subcat-chip .chip-del {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
}

.subcat-chip .chip-del:hover {
  color: var(--color-danger);
}

.btn-add-subcat {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-mint-text);
  background: var(--brand-mint-light);
  border: 1px dashed var(--brand-mint-border);
  border-radius: 6px;
  cursor: pointer;
}

.btn-add-subcat:hover {
  background: #d5f7f5;
}

/* 픽업 전용 배지 및 버튼 */
.tag-pickup {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.btn-pickup-call {
  background: #0284c7;
  color: #ffffff;
  border: none;
  font-weight: 700;
}

.btn-pickup-call:hover {
  background: #0369a1;
}

/* --------------------------------------------------------------------------
   전체 컨테이너 레이아웃
   -------------------------------------------------------------------------- */
.portal-container {
  display: flex;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   1. 좌측 모던 B2B 사이드바 (배민 2.0 라이트 테마)
   -------------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-default);
}

.brand-badge {
  background: var(--brand-mint);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  letter-spacing: 0.5px;
}

.brand-store-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-nav-group {
  margin-bottom: 8px;
  border-radius: var(--border-radius-sm);
  transition: background-color 0.15s ease;
}

.sidebar-nav-group.sidebar-group-ghost {
  opacity: 0.4;
  background: var(--brand-mint-light);
  outline: 2px dashed var(--brand-mint);
  border-radius: var(--border-radius-sm);
}

.sidebar-nav-group.sidebar-group-chosen {
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.menu-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 10px 6px;
  user-select: none;
}

.group-drag-handle {
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  cursor: grab;
  opacity: 0.35;
  transition: opacity 0.15s ease, stroke 0.15s ease;
}

.group-drag-handle:hover {
  opacity: 1;
  stroke: var(--brand-mint);
}

.group-drag-handle:active {
  cursor: grabbing;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--brand-mint-light);
  color: var(--brand-mint-text);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  stroke: var(--brand-mint);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--border-light);
  color: var(--text-secondary);
}

.nav-badge.urgent {
  background: #fee2e2;
  color: #dc2626;
  font-weight: 800;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-app);
}

.terminal-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
}

.terminal-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-success);
  font-weight: 600;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(27, 138, 90, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(27, 138, 90, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(27, 138, 90, 0); }
}

/* --------------------------------------------------------------------------
   2. 우측 메인 영역 및 상단 글로벌 바
   -------------------------------------------------------------------------- */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-navbar {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-trail .current {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
}

.navbar-center {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-app);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-default);
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 스위치 스타일 */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-strong);
  transition: 0.2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--brand-mint);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.store-meta {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   3. 메인 콘텐츠 뷰 영역
   -------------------------------------------------------------------------- */
.content-body {
  padding: 28px;
  flex: 1;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* --------------------------------------------------------------------------
   4. 카드 & 패널 컴포넌트
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

/* --------------------------------------------------------------------------
   5. 버튼 시스템
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-mint);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-mint-hover);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   6. 폼 & 입력 필드 (정밀 B2B 그리드)
   -------------------------------------------------------------------------- */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-mint);
  box-shadow: 0 0 0 3px rgba(42, 193, 188, 0.15);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* --------------------------------------------------------------------------
   7. 테이블 & 인라인 편집 그리드 (DOC-07 명세 규격)
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: #fafbfc;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover {
  background: #fbfcfd;
}

/* 인라인 편집 인풋 */
.inline-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  background: transparent;
  transition: all 0.15s ease;
}

.inline-input:hover {
  border-color: var(--border-default);
  background: #ffffff;
}

.inline-input:focus {
  outline: none;
  border-color: var(--brand-mint);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(42, 193, 188, 0.2);
}

/* 태그 & 배지 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-mint {
  background: var(--brand-mint-light);
  color: var(--brand-mint-text);
  border: 1px solid var(--brand-mint-border);
}

.tag-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.tag-neutral {
  background: var(--bg-app);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.tag-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* 법정동 배달지역 태그 클라우드 */
.region-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-sm);
  min-height: 48px;
}

.region-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.region-chip .chip-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}

.region-chip .chip-remove:hover {
  color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   8. 실시간 주방 주문 접수 (KDS) 전용 카드 스타일
   -------------------------------------------------------------------------- */
.kds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.kds-card {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kds-card:hover {
  box-shadow: var(--shadow-md);
}

.kds-card-header {
  padding: 14px 18px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kds-order-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.kds-order-time {
  font-size: 12px;
  color: var(--text-muted);
}

.kds-card-body {
  padding: 18px;
  flex: 1;
}

.kds-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
}

.kds-meta-row .label {
  color: var(--text-secondary);
}

.kds-meta-row .val {
  font-weight: 600;
  color: var(--text-primary);
}

.kds-items-box {
  background: var(--bg-app);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  margin: 12px 0;
  font-size: 13px;
}

.kds-item-title {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.kds-item-options {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  padding-left: 8px;
  border-left: 2px solid var(--border-strong);
}

.kds-card-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-default);
  background: #ffffff;
}

.time-selection-btns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.time-btn {
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.time-btn.active {
  background: var(--brand-mint);
  border-color: var(--brand-mint);
  color: #ffffff;
}

/* 인라인 인풋 단위 그룹 (글자 줄바꿈 100% 방지) */
.input-unit-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.input-unit-group input {
  padding: 8px 10px;
  text-align: right;
  font-weight: 600;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 13.5px;
}

.input-unit-group input:focus {
  outline: none;
  border-color: var(--brand-mint);
  box-shadow: 0 0 0 2px rgba(42, 193, 188, 0.2);
}

.input-unit-group .unit-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* 이미지 업로더 박스 (SwadKart / Enatega 규격) */
.image-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--border-radius-md);
  padding: 24px;
  text-align: center;
  background: var(--bg-app);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.image-upload-zone:hover {
  border-color: var(--brand-mint);
  background: var(--brand-mint-light);
}

.image-preview-box {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  display: none;
}

.image-preview-box.show {
  display: block;
}

/* --------------------------------------------------------------------------
   9. 모달 다이얼로그
   -------------------------------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #ffffff;
  width: 540px;
  max-width: 90vw;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: #fafbfc;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 정산 관리 캘린더 & 세무 스타일 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.calendar-header-cell {
  background: #f8fafc;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.calendar-header-cell.sunday { color: #ef4444; }
.calendar-header-cell.saturday { color: #2563eb; }

.calendar-day-cell {
  background: #ffffff;
  min-height: 85px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.15s;
}

.calendar-day-cell:hover {
  background: #f8fafc;
}

.calendar-day-cell.today {
  background: #f0fdfa;
  border: 1.5px solid var(--primary-mint);
}

.calendar-day-cell.other-month {
  background: #fafbfc;
  opacity: 0.4;
}

.calendar-day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-day-cell.sunday .calendar-day-num { color: #ef4444; }
.calendar-day-cell.saturday .calendar-day-num { color: #2563eb; }

.calendar-payout-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  text-align: right;
  margin-top: 4px;
}

.calendar-payout-badge.completed {
  background: #ecfdf5;
  color: #059669;
}

.calendar-payout-badge.pending {
  background: #eff6ff;
  color: #2563eb;
}

.calendar-payout-badge.holiday {
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 500;
  font-size: 10.5px;
}

/* PWA 모바일 프리뷰어 스타일 (NextOrders / 배민 규격) */
.mobile-device-frame {
  width: 360px;
  height: 680px;
  background: #f8fafc;
  border: 12px solid #1e293b;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
  position: relative;
}

.mobile-notch {
  width: 120px;
  height: 18px;
  background: #1e293b;
  border-radius: 0 0 12px 12px;
  margin: 0 auto;
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.mobile-screen {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
  background: #ffffff;
}

.mobile-header-banner {
  background: linear-gradient(135deg, #2ac1bc, #0f766e);
  color: white;
  padding: 30px 16px 16px;
}

.mobile-category-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  overflow-x: auto;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-category-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
}

.mobile-category-pill.active {
  background: #191f28;
  color: #ffffff;
}

.mobile-food-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #f8fafc;
  align-items: center;
  position: relative;
}

.mobile-food-card.soldout {
  opacity: 0.5;
}

.mobile-food-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.mobile-food-info {
  flex: 1;
  min-width: 0;
}

.mobile-food-title {
  font-size: 14px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 2px;
}

.mobile-food-desc {
  font-size: 11.5px;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.mobile-food-price {
  font-size: 13.5px;
  font-weight: 800;
  color: #191f28;
}

/* --------------------------------------------------------------------------
   TastyPrinter ESC/POS 80mm 감열지 영수증 / 주방 전표 스타일
   -------------------------------------------------------------------------- */
.receipt-paper {
  width: 360px;
  background: #ffffff;
  padding: 24px 20px;
  font-family: 'Courier New', Courier, monospace;
  color: #000000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  border-radius: 4px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.4;
}

.receipt-dashed {
  border-top: 1px dashed #000000;
  margin: 10px 0;
}

.receipt-double-dashed {
  border-top: 2px dashed #000000;
  margin: 12px 0;
}

.receipt-kitchen-title {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.receipt-order-seq {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  padding: 4px 0;
  border: 2px solid #000000;
  margin: 8px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.receipt-row.bold {
  font-weight: 800;
  font-size: 15px;
}

.receipt-subrow {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #222222;
  padding-left: 12px;
  margin-bottom: 2px;
}

.receipt-memo-box {
  border: 1px solid #000000;
  padding: 8px 10px;
  font-weight: 700;
  margin: 8px 0;
  background: #fafafa;
}

.receipt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  justify-content: center;
}

.receipt-tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  color: #334155;
}

.receipt-tab-btn.active {
  background: #191f28;
  color: #ffffff;
  border-color: #191f28;
}

@media print {
  body * {
    visibility: hidden;
  }
  .receipt-paper, .receipt-paper *,
  .printable-qr-area, .printable-qr-area * {
    visibility: visible;
  }
  .receipt-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
  .printable-qr-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #ffffff;
  }
}

/* QR 관리 및 인쇄 모달 스타일 */
.qr-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e5e8eb;
  margin-bottom: 16px;
}

.qr-tab-btn {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.qr-tab-btn.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}

.qr-store-stand-card {
  max-width: 320px;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  border: 2px solid #1e293b;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.qr-table-grid-sheet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.qr-table-sticker-card {
  padding: 16px 12px;
  background: #ffffff;
  border: 1.5px dashed #0f766e;
  border-radius: 10px;
  text-align: center;
}

/* ============================================================================
   실시간 홀·테이블 예약 관리 워크스페이스 스타일 (Dine-in Reservation)
   ============================================================================ */

.dinein-metrics-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.dinein-metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dinein-metric-item .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.dinein-metric-item .val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.dinein-metric-item .val.color-vacant { color: #1b8a5a; }
.dinein-metric-item .val.color-occupied { color: #2563eb; }
.dinein-metric-item .val.color-reserved { color: #7c3aed; }
.dinein-metric-item .val.color-waiting { color: #ea580c; }

.dinein-layout-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 24px;
  align-items: start;
}

.dinein-left-col, .dinein-right-col {
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.dinein-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

/* 테이블 카드 그리드 */
.table-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.table-box {
  border: 1.5px solid var(--border-default);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.table-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.table-box.status-vacant {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.table-box.status-occupied {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.table-box.status-reserved {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.table-box.status-waiting {
  border-color: #fed7aa;
  background: #fff7ed;
}

.table-box-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.table-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.table-subinfo {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.table-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
}

.table-status-badge.status-vacant { background: #dcfce7; color: #166534; }
.table-status-badge.status-occupied { background: #dbeafe; color: #1e40af; }
.table-status-badge.status-reserved { background: #ede9fe; color: #5b21b6; }
.table-status-badge.status-waiting { background: #ffedd5; color: #9a3412; }

.table-box-body {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.table-empty-hint {
  font-size: 12px;
  color: #15803d;
  font-weight: 600;
  padding: 8px 0;
}

.table-res-time {
  font-weight: 800;
  color: #6d28d9;
  font-size: 13px;
  margin-bottom: 4px;
}

.table-guest-line {
  font-size: 12.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.table-memo-line {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-table-action {
  width: 100%;
  padding: 8px 0;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-seat-direct {
  color: #166534;
  border-color: #86efac;
  background: #f0fdf4;
}
.btn-seat-direct:hover { background: #dcfce7; }

.btn-complete-table {
  color: #1e40af;
  border-color: #93c5fd;
  background: #eff6ff;
}
.btn-complete-table:hover { background: #dbeafe; }

.btn-confirm-seat {
  color: #5b21b6;
  border-color: #c4b5fd;
  background: #faf5ff;
}
.btn-confirm-seat:hover { background: #ede9fe; }

.btn-quick-confirm {
  color: #9a3412;
  border-color: #fdba74;
  background: #fff7ed;
}
.btn-quick-confirm:hover { background: #ffedd5; }

/* 예약 탭 및 피드 카드 */
.badge-waiting-pill {
  background: #ffedd5;
  color: #c2410c;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 9999px;
}

.dinein-res-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
}

.res-tab-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-sm);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.res-tab-btn.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.res-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.res-item-card {
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

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

.res-seq-tag {
  background: #f1f3f5;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
}

.res-time-text {
  font-size: 14px;
  font-weight: 800;
  color: #6d28d9;
}

.res-table-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-mint-text);
  background: var(--brand-mint-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.res-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
}

.res-badge-waiting { background: #ffedd5; color: #9a3412; }
.res-badge-confirmed { background: #ede9fe; color: #5b21b6; }
.res-badge-seated { background: #dbeafe; color: #1e40af; }
.res-badge-completed { background: #f1f3f5; color: #64748b; }
.res-badge-canceled { background: #fee2e2; color: #b91c1c; }

.res-item-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.res-guest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
}

.guest-phone {
  font-size: 12px;
  color: var(--text-muted);
}

.res-menu-box {
  background: #fafbfc;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
}

.res-menu-box.no-preorder {
  background: #f8fafc;
  color: var(--text-muted);
}

.menu-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.menu-content {
  font-weight: 700;
  color: var(--text-primary);
}

.menu-price {
  font-weight: 800;
  color: #2563eb;
  font-size: 12px;
  margin-top: 4px;
}

.res-request-box {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  border-radius: 4px;
  padding: 6px 10px;
  line-height: 1.4;
}

.request-label {
  font-weight: 700;
}

.res-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.res-created-at {
  font-size: 11px;
  color: var(--text-muted);
}

.res-actions-wrap {
  display: flex;
  gap: 6px;
}

.btn-action-res {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-res-confirm {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}
.btn-res-confirm:hover { background: #c2410c; }

.btn-res-seat {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}
.btn-res-seat:hover { background: #6d28d9; }

.btn-res-complete {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.btn-res-complete:hover { background: #1d4ed8; }

.btn-res-cancel {
  background: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-res-cancel:hover { background: #fee2e2; }
