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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

body { font-family: 'Segoe UI', sans-serif; background: var(--gray-50); color: var(--gray-900); }

/* 로그인 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { background: white; padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; max-width: 360px; text-align: center; }
.login-container h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--gray-500); margin-bottom: 1.5rem; }

/* 공통 */
.form-group { margin-bottom: 1rem; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 1rem; outline: none;
}
input:focus, select:focus { border-color: var(--primary); }

.btn { padding: 0.6rem 1.2rem; border: none; border-radius: var(--radius); cursor: pointer; font-size: 0.95rem; font-weight: 500; transition: background 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }

.error-msg { color: var(--danger); margin-top: 0.75rem; font-size: 0.9rem; }
.hidden { display: none !important; }

/* 레이아웃 */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: var(--gray-900); color: white; padding: 1rem; flex-shrink: 0; }
.sidebar h2 { font-size: 1.1rem; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-700); }
.sidebar nav a { display: block; padding: 0.6rem 0.8rem; color: var(--gray-300); text-decoration: none; border-radius: var(--radius); margin-bottom: 0.25rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--primary); color: white; }
.main-content { flex: 1; padding: 1.5rem; overflow-y: auto; }

/* 카드 */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-size: 1.1rem; font-weight: 600; }

/* 테이블 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { background: var(--gray-50); font-weight: 600; font-size: 0.9rem; }

/* 배지 */
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-sold-out { background: var(--gray-200); color: var(--gray-500); }

/* 홀 화면 */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.order-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; border-left: 4px solid var(--gray-300); }
.order-card.pending { border-left-color: var(--warning); }
.order-card.confirmed { border-left-color: var(--primary); }
.order-card.completed { border-left-color: var(--success); }

/* 고객 메뉴 화면 */
.menu-page { max-width: 480px; margin: 0 auto; padding: 1rem; }
.category-tabs { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.category-tab { padding: 0.4rem 1rem; border-radius: 999px; border: 1px solid var(--gray-300); background: white; cursor: pointer; white-space: nowrap; font-size: 0.9rem; }
.category-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 5rem; }
.menu-item { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.75rem; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; }
.menu-item:hover { border-color: var(--primary); }
.menu-item.sold-out { opacity: 0.5; cursor: not-allowed; }
.menu-item .name { font-weight: 600; margin-bottom: 0.25rem; }
.menu-item .price { color: var(--primary); font-size: 0.95rem; }

/* 장바구니 */
.cart-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--primary); color: white; padding: 1rem; display: flex; justify-content: space-between; align-items: center; max-width: 480px; margin: 0 auto; cursor: pointer; }
.cart-bar.hidden { display: none; }
.cart-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: flex-end; }
.cart-content { background: white; width: 100%; max-width: 480px; margin: 0 auto; border-radius: var(--radius) var(--radius) 0 0; padding: 1.5rem; max-height: 80vh; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-200); }

/* 모바일 관리자 레이아웃 */
.admin-mobile { padding-bottom: 70px; }
.mobile-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--gray-900); color: white;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem;
}
.mobile-header span { font-weight: 600; font-size: 1rem; }
.mobile-main { padding: 1rem; }

/* 하단 탭바 */
.bottom-tab {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: white; border-top: 1px solid var(--gray-200);
  display: flex;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 0.5rem 0; border: none; background: transparent;
  cursor: pointer; color: var(--gray-500); font-size: 0.75rem;
}
.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 1.3rem; line-height: 1; }
.tab-label { margin-top: 0.2rem; }

/* PC에서도 괜찮게 */
@media (min-width: 768px) {
  .mobile-main { max-width: 768px; margin: 0 auto; }
  .bottom-tab { max-width: 768px; left: 50%; transform: translateX(-50%); }
}

/* 탭바 아이콘 제거 + 폰트 키우기 */
.tab-icon { display: none; }
.tab-label { font-size: 0.95rem; font-weight: 600; margin-top: 0; }
.tab-item { padding: 1rem 0; }

/* 전체 폰트 크기 상향 */
body { font-size: 18px; }
.btn { font-size: 1rem; padding: 0.7rem 1.3rem; }
.btn-sm { font-size: 0.95rem; padding: 0.45rem 0.9rem; }
input, select, textarea { font-size: 1rem; padding: 0.75rem 1rem; }
th, td { font-size: 1rem; padding: 0.75rem; }
.tab-label { font-size: 1rem; }
.card-title { font-size: 1.2rem; }
.badge { font-size: 0.9rem; }
.mobile-header span { font-size: 1.1rem; }

/* 아이템 카드 */
.item-card { padding: 1rem 0; border-bottom: 1px solid var(--gray-100); }
.item-card:last-child { border-bottom: none; }
.item-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.item-name { font-weight: 600; font-size: 1.05rem; }
.item-card-sub { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 0.6rem; }
.item-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* 통계 요약 */
.summary-box { display: flex; gap: 1rem; padding: 0.5rem 0; }
.summary-item { flex: 1; background: var(--gray-50); border-radius: var(--radius); padding: 1rem; text-align: center; }
.summary-label { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 0.4rem; }
.summary-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }

/* 인라인 QR 영역 */
.qr-inline-area {
  margin-top: 1rem;
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
}
.qr-inline-area img {
  display: block;
  margin: 0 auto 1rem;
  max-width: 180px;
  border: 1px solid var(--gray-100);
}
.qr-url-text {
  font-size: 0.75rem;
  color: #888;
  word-break: break-all;
  margin-bottom: 1rem;
  display: block;
}
