/* ============================================================
   ALG POS — pos.css
   ALG (알뜰공감) 테마 (딥그린 + 골드 포인트)
   주 컬러: #0d6e4f (브랜드그린) / #064e3b (딥그린) / #16a373 (라이트)
   포인트: #f59e0b (골드) / #ef4444 (레드 강조)
   반응형: PC / 탭 / 모바일 자동 전환 + 강제 모드 토글
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body.pos {
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== 상단 헤더 ===== */
.header {
  height: 56px;
  background: linear-gradient(135deg, #064e3b 0%, #0d6e4f 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header .logo-area { display: flex; align-items: center; gap: 10px; }
.header .logo {
  width: 40px; height: 36px;
  background: #fff; color: #0d6e4f;
  font-weight: 900; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  letter-spacing: 1px;
}
.header .brand { font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.header .info {
  display: flex; gap: 24px;
  margin-left: 32px;
  font-size: 13px;
  flex: 1;
}
.header .info b { font-weight: 700; margin-left: 4px; }
.header .actions { display: flex; align-items: center; gap: 6px; }
.header .actions button,
.header .actions .link-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}
.header .actions button:hover,
.header .actions .link-btn:hover { background: rgba(255,255,255,0.25); }

/* === 화면 모드 토글 === */
.view-mode-toggle {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 2px;
  margin-right: 4px;
}
.view-mode-toggle button {
  background: transparent !important;
  border: none !important;
  color: rgba(255,255,255,0.7) !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.view-mode-toggle button.active {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}
.view-mode-toggle button:hover { color: #fff !important; }

/* ===== 메인 영역 ===== */
.main {
  display: flex;
  height: calc(100vh - 56px - 64px);
  gap: 8px;
  padding: 8px;
}

/* ===== 왼쪽 (카트 + 합계) ===== */
.left {
  flex: 0 0 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* 카트 테이블 */
.cart {
  flex: 1;
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 13px;
  display: block;
  overflow-y: auto;
}
.cart thead {
  background: #0d6e4f;
  color: #fff;
  position: sticky;
  top: 0;
  display: table;
  width: 100%;
  table-layout: fixed;
}
.cart thead th {
  padding: 8px 6px;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
}
.cart thead th:nth-child(1) { width: 36px; }
.cart thead th:nth-child(2) { width: auto; }
.cart thead th:nth-child(3) { width: 80px; }
.cart thead th:nth-child(4) { width: 60px; }
.cart thead th:nth-child(5) { width: 90px; }

.cart tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.cart tbody tr {
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}
.cart tbody tr.selected { background: #fef3c7; }
.cart tbody tr:hover { background: #f8fafc; }
.cart tbody tr.selected:hover { background: #fde68a; }
.cart tbody td {
  padding: 7px 6px;
  text-align: center;
}
.cart tbody td:nth-child(1) { width: 36px; color: #64748b; }
.cart tbody td:nth-child(2) { width: auto; text-align: left; padding-left: 10px; font-weight: 600; }
.cart tbody td:nth-child(3) { width: 80px; text-align: right; padding-right: 10px; }
.cart tbody td:nth-child(4) { width: 60px; }
.cart tbody td:nth-child(5) { width: 90px; text-align: right; padding-right: 10px; font-weight: 700; color: #0d6e4f; }

/* 카트 액션 버튼들 */
.cart-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.cart-actions button {
  padding: 10px 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.cart-actions button:hover { background: #f1f5f9; }
.cart-actions button.warn { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.cart-actions button.warn:hover { background: #d97706; }
.cart-actions button.danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.cart-actions button.danger:hover { background: #dc2626; }

/* 바코드 입력 */
.barcode-input input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 2px solid #0d6e4f;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
}
.barcode-input input:focus { outline: none; border-color: #16a373; box-shadow: 0 0 0 3px rgba(22,163,115,0.15); }

/* 합계 박스 */
.totals {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.totals > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.totals > div span { color: #64748b; }
.totals > div b { font-weight: 700; }
.totals > div.big {
  border-top: 2px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 4px;
  font-size: 18px;
}
.totals > div.big span { color: #0f172a; font-weight: 700; }

/* 회원 정보 */
.member-info {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.member-info > div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.member-info > div span { color: #78350f; }
.member-info > div b { color: #0f172a; font-weight: 700; }

/* ===== 오른쪽 (카테고리 + 단축키) ===== */
.right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  min-width: 0;
}
.category-tabs, .sub-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.category-tabs button, .sub-tabs button {
  padding: 8px 14px;
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.category-tabs button:hover, .sub-tabs button:hover { background: #cbd5e1; }
.category-tabs button.active {
  background: #0d6e4f;
  color: #fff;
}
.sub-tabs button.active {
  background: #f59e0b;
  color: #fff;
}
.sub-tabs { padding-left: 4px; min-height: 36px; }

/* 단축키 그리드 */
.shortcut-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(80px, 1fr);
  gap: 6px;
  overflow-y: auto;
  padding: 4px;
}
.shortcut-grid button {
  padding: 8px 6px;
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: all 0.1s;
  text-align: center;
  line-height: 1.2;
}
.shortcut-grid button:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  transform: translateY(-1px);
}
.shortcut-grid button:active {
  transform: translateY(0);
  background: #fde68a;
}
.shortcut-grid button .label {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
  word-break: keep-all;
}
.shortcut-grid button .price {
  font-size: 12px;
  color: #ef4444;
  font-weight: 800;
}

/* 색상 카테고리별 단축키 */
.shortcut-grid button.color-blue { background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%); border-color: #60a5fa; }
.shortcut-grid button.color-green { background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%); border-color: #34d399; }
.shortcut-grid button.color-yellow { background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%); border-color: #fbbf24; }
.shortcut-grid button.color-pink { background: linear-gradient(180deg, #fce7f3 0%, #fbcfe8 100%); border-color: #f472b6; }
.shortcut-grid button.color-orange { background: linear-gradient(180deg, #ffedd5 0%, #fed7aa 100%); border-color: #fb923c; }
.shortcut-grid button.color-purple { background: linear-gradient(180deg, #ede9fe 0%, #ddd6fe 100%); border-color: #a78bfa; }

/* ===== 하단 메뉴 ===== */
.bottom-menu {
  height: 64px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 4px;
  padding: 8px;
  align-items: center;
}
.bottom-menu button {
  flex: 1;
  height: 48px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.bottom-menu button:hover { background: #e2e8f0; }
.bottom-menu button.primary {
  background: linear-gradient(135deg, #0d6e4f 0%, #16a373 100%);
  color: #fff;
  border: none;
  flex: 1.5;
  font-size: 15px;
}
.bottom-menu button.primary:hover {
  background: linear-gradient(135deg, #064e3b 0%, #0d6e4f 100%);
}

/* ============================================================
   반응형 — 자동 (사용자가 모드 강제 안 했을 때)
   .mode-pc / .mode-tablet / .mode-mobile 클래스가 없을 때만 적용
   ============================================================ */

/* 1280px 이하 — 자동 탭 모드 */
@media (max-width: 1280px) {
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .left { flex: 0 0 380px; }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .shortcut-grid { grid-template-columns: repeat(5, 1fr); }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .header .info { gap: 16px; font-size: 12px; }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .bottom-menu button { font-size: 11px; padding: 0 4px; }
}

/* 768px 이하 — 자동 모바일 모드 */
@media (max-width: 768px) {
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .header .info { display: none; }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .main { flex-direction: column; height: calc(100vh - 56px - 110px); }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .left { flex: 0 0 auto; max-height: 50vh; }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .right { flex: 1 1 auto; }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .shortcut-grid { grid-template-columns: repeat(3, 1fr); }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .bottom-menu { flex-wrap: wrap; height: auto; padding: 4px; }
  body.pos:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .bottom-menu button { flex: 1 1 calc(33% - 4px); height: 40px; font-size: 11px; }
}

/* ============================================================
   강제 모드 — 사용자가 토글 클릭한 경우
   ============================================================ */

/* PC 강제 */
body.pos.mode-pc .main { flex-direction: row; height: calc(100vh - 56px - 64px); }
body.pos.mode-pc .left { flex: 0 0 480px; max-height: none; }
body.pos.mode-pc .right { flex: 1; }
body.pos.mode-pc .shortcut-grid { grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(80px, 1fr); }
body.pos.mode-pc .bottom-menu { flex-wrap: nowrap; height: 64px; padding: 8px; }
body.pos.mode-pc .bottom-menu button { flex: 1; height: 48px; font-size: 13px; }
body.pos.mode-pc .bottom-menu button.primary { flex: 1.5; font-size: 15px; }
body.pos.mode-pc .header .info { display: flex; }
body.pos.mode-pc .member-info { display: grid; }

/* 태블릿 강제 */
body.pos.mode-tablet .main { flex-direction: row; height: calc(100vh - 56px - 110px); padding: 6px; gap: 6px; }
body.pos.mode-tablet .left { flex: 0 0 380px; max-height: none; }
body.pos.mode-tablet .right { flex: 1; }
body.pos.mode-tablet .shortcut-grid { grid-template-columns: repeat(5, 1fr); grid-auto-rows: minmax(70px, 1fr); }
body.pos.mode-tablet .shortcut-grid button { font-size: 12px; }
body.pos.mode-tablet .shortcut-grid button .label { font-size: 12px; }
body.pos.mode-tablet .bottom-menu { flex-wrap: wrap; height: auto; padding: 4px; }
body.pos.mode-tablet .bottom-menu button { flex: 1 1 calc(20% - 4px); height: 44px; font-size: 11px; }
body.pos.mode-tablet .bottom-menu button.primary { flex: 1 1 calc(33% - 4px); font-size: 13px; }
body.pos.mode-tablet .header .info { font-size: 12px; gap: 12px; }
body.pos.mode-tablet .header .info span:first-child { display: none; }
body.pos.mode-tablet .cart-actions button { font-size: 12px; padding: 8px 0; }
body.pos.mode-tablet .totals { padding: 8px 12px; }
body.pos.mode-tablet .totals > div { font-size: 13px; }
body.pos.mode-tablet .totals > div.big { font-size: 16px; }

/* 모바일 강제 */
body.pos.mode-mobile { font-size: 13px; }
body.pos.mode-mobile .header { height: 48px; padding: 0 8px; }
body.pos.mode-mobile .header .logo { width: 32px; height: 28px; font-size: 11px; }
body.pos.mode-mobile .header .brand { font-size: 14px; }
body.pos.mode-mobile .header .info { display: none; }
body.pos.mode-mobile .header .actions button,
body.pos.mode-mobile .header .actions .link-btn { padding: 4px 8px; font-size: 11px; }
body.pos.mode-mobile .view-mode-toggle button { padding: 3px 6px !important; font-size: 10px !important; }
body.pos.mode-mobile .main { flex-direction: column; height: calc(100vh - 48px - 130px); padding: 4px; gap: 4px; }
body.pos.mode-mobile .left { flex: none; max-height: 50vh; gap: 4px; }
body.pos.mode-mobile .right { flex: 1; min-height: 200px; padding: 4px; }
body.pos.mode-mobile .cart { font-size: 11px; }
body.pos.mode-mobile .cart thead th { padding: 6px 4px; font-size: 11px; }
body.pos.mode-mobile .cart tbody td { padding: 5px 4px; }
body.pos.mode-mobile .cart-actions { grid-template-columns: repeat(3, 1fr); gap: 3px; }
body.pos.mode-mobile .cart-actions button { padding: 8px 0; font-size: 12px; }
body.pos.mode-mobile .barcode-input input { padding: 8px 10px; font-size: 13px; }
body.pos.mode-mobile .totals { padding: 8px 10px; }
body.pos.mode-mobile .totals > div { font-size: 12px; padding: 2px 0; }
body.pos.mode-mobile .totals > div.big { font-size: 15px; }
body.pos.mode-mobile .member-info { display: none; }  /* 모바일은 회원정보 숨김 */
body.pos.mode-mobile .category-tabs button,
body.pos.mode-mobile .sub-tabs button { padding: 5px 10px; font-size: 11px; }
body.pos.mode-mobile .shortcut-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 65px; gap: 4px; }
body.pos.mode-mobile .shortcut-grid button { padding: 4px 2px; font-size: 11px; }
body.pos.mode-mobile .shortcut-grid button .label { font-size: 11px; line-height: 1.1; }
body.pos.mode-mobile .shortcut-grid button .price { font-size: 10px; }
body.pos.mode-mobile .bottom-menu { flex-wrap: wrap; height: auto; padding: 3px; gap: 3px; }
body.pos.mode-mobile .bottom-menu button { flex: 1 1 calc(33.33% - 3px); height: 36px; font-size: 11px; padding: 0 4px; }
body.pos.mode-mobile .bottom-menu button.primary { flex: 1 1 calc(50% - 3px); font-size: 12px; }

/* 모달 — 모든 모드 적용 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 12px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  min-width: 400px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
@media (max-width: 480px) {
  .modal { min-width: 0; width: 100%; }
  body.pos.mode-mobile .modal { min-width: 0; width: 100%; }
}
.modal-header {
  background: #0d6e4f;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-header .close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: #f8fafc;
  flex-wrap: wrap;
}
.modal-footer button {
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  font-weight: 700;
  background: #fff;
}
.modal-footer button.primary {
  background: #0d6e4f;
  color: #fff;
  border-color: #0d6e4f;
}
.modal-footer button.danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* 결제 모달 — 키패드 */
.pay-modal .pay-amount {
  background: #f1f5f9;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.pay-modal .pay-amount .row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  margin: 4px 0;
}
.pay-modal .pay-amount .row.big {
  font-size: 22px;
  font-weight: 800;
  color: #ef4444;
  border-top: 1px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
}
.pay-modal .keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.pay-modal .keypad button {
  padding: 18px 0;
  font-size: 22px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}
.pay-modal .keypad button.special { background: #f1f5f9; }
.pay-modal .keypad button:hover { background: #e2e8f0; }
.pay-modal .quick-amount {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.pay-modal .quick-amount button {
  padding: 12px 0;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.pay-modal .quick-amount button:hover { background: #bbf7d0; }
.pay-modal .input-display {
  text-align: right;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid #0d6e4f;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  min-height: 52px;
}

/* 회원 검색 모달 */
.member-modal .search-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.member-modal .search-row input {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.member-modal .search-row button {
  padding: 12px 20px;
  background: #0d6e4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}
.member-modal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.member-modal table th {
  background: #f1f5f9;
  padding: 8px;
  text-align: left;
  border-bottom: 2px solid #cbd5e1;
}
.member-modal table td {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}
.member-modal table tr:hover { background: #fef3c7; }

/* 알림 토스트 */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toastIn 0.2s ease-out;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.warn { background: #f59e0b; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 폼 입력 공통 */
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 13px;
  color: #475569;
  margin-bottom: 4px;
  font-weight: 700;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: #0d6e4f; }

/* ============================================================
   Admin 화면 반응형 (대시보드, 단축키관리, 일매출/마감, 직원, 매장설정)
   ============================================================ */

/* 자동 반응형 — 모드 강제 안 했을 때 */
@media (max-width: 1024px) {
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .admin-header .nav { gap: 2px; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .admin-header .nav a { padding: 6px 8px; font-size: 12px; }
}
@media (max-width: 768px) {
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .admin-header { height: auto; flex-wrap: wrap; padding: 8px; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .admin-header .nav { order: 3; flex-basis: 100%; overflow-x: auto; padding: 4px 0; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .admin-header .nav a { padding: 5px 8px; font-size: 11px; white-space: nowrap; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .admin-body { padding: 8px; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .summary-grid { grid-template-columns: 1fr 1fr; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .panels { grid-template-columns: 1fr; }
  body:not(.mode-pc):not(.mode-tablet):not(.mode-mobile) .stats { grid-template-columns: 1fr 1fr; }
}

/* === 강제 PC === */
body.mode-pc .admin-header { height: 56px; flex-wrap: nowrap; }
body.mode-pc .admin-header .nav { gap: 4px; }
body.mode-pc .admin-header .nav a { padding: 8px 14px; font-size: 14px; }
body.mode-pc .admin-body { padding: 24px; max-width: 1400px; }
body.mode-pc .summary-grid { grid-template-columns: repeat(4, 1fr); }
body.mode-pc .panels { grid-template-columns: 1fr 1fr; }
body.mode-pc .stats { grid-template-columns: repeat(4, 1fr); }
body.mode-pc .admin-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* === 강제 탭 === */
body.mode-tablet .admin-header { height: auto; flex-wrap: wrap; padding: 6px 12px; min-height: 50px; }
body.mode-tablet .admin-header .brand { font-size: 16px; }
body.mode-tablet .admin-header .nav { gap: 2px; flex: 1; flex-wrap: wrap; }
body.mode-tablet .admin-header .nav a { padding: 6px 10px; font-size: 12px; }
body.mode-tablet .admin-header .actions a { padding: 5px 10px; font-size: 12px; }
body.mode-tablet .admin-body { padding: 12px; }
body.mode-tablet .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
body.mode-tablet .summary-box { padding: 14px; }
body.mode-tablet .summary-box.big { grid-column: span 2; }
body.mode-tablet .summary-box .val { font-size: 22px; }
body.mode-tablet .summary-box.big .val { font-size: 28px; }
body.mode-tablet .panels { grid-template-columns: 1fr; gap: 10px; }
body.mode-tablet .stats { grid-template-columns: repeat(4, 1fr); }
body.mode-tablet .grid-table { font-size: 12px; }
body.mode-tablet .grid-table th, body.mode-tablet .grid-table td { padding: 6px 8px; }
body.mode-tablet .toolbar { flex-wrap: wrap; gap: 6px; }

/* === 강제 모바일 === */
body.mode-mobile .admin-header { height: auto; flex-wrap: wrap; padding: 6px 8px; min-height: 44px; }
body.mode-mobile .admin-header .brand { font-size: 13px; flex-basis: 100%; text-align: center; margin-bottom: 4px; }
body.mode-mobile .admin-header .nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 2px; padding: 2px 0; }
body.mode-mobile .admin-header .nav a { padding: 5px 8px; font-size: 11px; white-space: nowrap; }
body.mode-mobile .admin-header .actions { margin-left: auto; }
body.mode-mobile .admin-header .actions a { padding: 4px 10px; font-size: 11px; }
body.mode-mobile .admin-body { padding: 8px; }
body.mode-mobile .admin-body h2 { font-size: 16px; }
body.mode-mobile .summary-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
body.mode-mobile .summary-box { padding: 10px; }
body.mode-mobile .summary-box .val { font-size: 17px; }
body.mode-mobile .summary-box.big { grid-column: span 2; }
body.mode-mobile .summary-box.big .val { font-size: 22px; }
body.mode-mobile .panels { grid-template-columns: 1fr; gap: 6px; }
body.mode-mobile .panel { padding: 10px; }
body.mode-mobile .panel h3 { font-size: 14px; }
body.mode-mobile .stats { grid-template-columns: 1fr 1fr; gap: 6px; }
body.mode-mobile .stats .stat-box { padding: 8px; }
body.mode-mobile .stats .stat-box .val { font-size: 16px; }
body.mode-mobile .grid-table { font-size: 11px; display: block; overflow-x: auto; white-space: nowrap; }
body.mode-mobile .grid-table th, body.mode-mobile .grid-table td { padding: 4px 6px; }
body.mode-mobile .grid-table input, body.mode-mobile .grid-table select { font-size: 11px; padding: 3px 5px; }
body.mode-mobile .grid-table .actions button { padding: 3px 6px; font-size: 10px; margin-right: 2px; }
body.mode-mobile .toolbar { flex-wrap: wrap; padding: 6px; gap: 4px; }
body.mode-mobile .toolbar input, body.mode-mobile .toolbar select { font-size: 11px; padding: 5px 8px; flex: 1 1 100px; }
body.mode-mobile .toolbar button { padding: 5px 10px; font-size: 11px; }
body.mode-mobile .admin-cards { grid-template-columns: 1fr; gap: 8px; }
body.mode-mobile .admin-card { padding: 14px; }
body.mode-mobile .admin-card .ico { font-size: 24px; }
body.mode-mobile .admin-card h3 { font-size: 15px; }
body.mode-mobile .admin-card p { font-size: 12px; }
body.mode-mobile .save-bar { padding: 10px; }
body.mode-mobile .save-bar button { padding: 10px 16px; font-size: 13px; }

/* ============================================================
   모달 반응형 강화 (모든 모드)
   ============================================================ */

/* 자동 — 480px 이하 */
@media (max-width: 480px) {
  .modal { min-width: 0 !important; width: 100%; max-width: 100%; max-height: 95vh; }
  .modal-overlay { padding: 6px; }
  .modal-header { padding: 10px 14px; }
  .modal-header h2 { font-size: 15px; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px; gap: 6px; }
  .modal-footer button { padding: 8px 14px; font-size: 12px; flex: 1 1 auto; }
}

/* 강제 모바일 — 모달 풀폭 */
body.mode-mobile .modal { min-width: 0 !important; width: 100%; max-width: 100%; max-height: 95vh; }
body.mode-mobile .modal-overlay { padding: 6px; align-items: flex-end; }
body.mode-mobile .modal { border-radius: 12px 12px 0 0; }
body.mode-mobile .modal-header { padding: 10px 14px; }
body.mode-mobile .modal-header h2 { font-size: 15px; }
body.mode-mobile .modal-body { padding: 14px; }
body.mode-mobile .modal-footer { padding: 10px; gap: 6px; }
body.mode-mobile .modal-footer button { padding: 8px 12px; font-size: 12px; flex: 1 1 auto; }

/* 결제 모달 — 모바일 키패드 축소 */
body.mode-mobile .pay-modal .pay-amount { padding: 12px; margin-bottom: 12px; }
body.mode-mobile .pay-modal .pay-amount .row { font-size: 13px; }
body.mode-mobile .pay-modal .pay-amount .row.big { font-size: 18px; }
body.mode-mobile .pay-modal .keypad { gap: 4px; }
body.mode-mobile .pay-modal .keypad button { padding: 14px 0; font-size: 18px; }
body.mode-mobile .pay-modal .quick-amount { grid-template-columns: repeat(2, 1fr); gap: 4px; }
body.mode-mobile .pay-modal .quick-amount button { padding: 8px 0; font-size: 12px; }
body.mode-mobile .pay-modal .input-display { font-size: 18px; padding: 10px 12px; min-height: 42px; }

/* 회원검색 모달 — 모바일 */
body.mode-mobile .member-modal .search-row input { font-size: 13px; padding: 8px; }
body.mode-mobile .member-modal .search-row button { padding: 8px 14px; font-size: 12px; }
body.mode-mobile .member-modal table { font-size: 11px; display: block; overflow-x: auto; }
body.mode-mobile .member-modal table th, body.mode-mobile .member-modal table td { padding: 5px 6px; white-space: nowrap; }

/* 폼 행 — 모바일 */
body.mode-mobile .form-row label { font-size: 12px; }
body.mode-mobile .form-row input, body.mode-mobile .form-row select, body.mode-mobile .form-row textarea { font-size: 13px; padding: 8px 10px; }
body.mode-mobile .form-row .hint { font-size: 11px; }

/* 미리보기 박스 — 모바일 */
body.mode-mobile .preview { font-size: 11px; padding: 10px; }
