* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: #1e1e24;
  color: #f0f0f0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #14141a;
  border-bottom: 2px solid #333;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.brand-home {
  margin: 0;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 22px;
  font-weight: bold;
  padding: 0;
  cursor: pointer;
}

.brand-home:active {
  color: #ffcb66;
}

#current-table-label {
  font-size: 18px;
  color: #ffcb66;
}

.view {
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 20px;
}

.view.hidden {
  display: none;
}

.zone-section h2 {
  margin: 0 0 12px 4px;
  font-size: 20px;
  color: #ffcb66;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.table-btn {
  min-height: 96px;
  border: none;
  border-radius: 14px;
  background: #2f2f3a;
  color: #f0f0f0;
  font-size: 20px;
  font-weight: bold;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
}

.table-btn .table-icon {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.table-btn:active {
  background: #3d3d4c;
}

.table-btn.occupied {
  background: #7a3b3b;
}

.table-btn .table-sub {
  font-size: 13px;
  font-weight: normal;
  opacity: 0.85;
}

.menu-layout {
  display: flex;
  height: 100%;
  gap: 16px;
}

.menu-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.category-tab {
  border: none;
  border-radius: 10px;
  background: #2f2f3a;
  color: #f0f0f0;
  font-size: 17px;
  padding: 14px 18px;
  cursor: pointer;
}

.category-tab.active {
  background: #ffcb66;
  color: #1e1e24;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 20px;
}

.item-btn {
  min-height: 84px;
  border: none;
  border-radius: 12px;
  background: #33333f;
  color: #f0f0f0;
  font-size: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
}

.item-btn:active {
  background: #454556;
}

.item-btn .item-thumb {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.item-btn .item-name {
  text-align: center;
}

.item-btn .item-price {
  font-size: 14px;
  color: #ffcb66;
}

.cart-panel {
  width: 320px;
  background: #14141a;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* 좁은 화면(모바일)에서는 메뉴 패널 옆에 320px 고정폭 장바구니를 나란히 두면
   메뉴 패널이 거의 0으로 눌려 항목이 안 보이게 됨 — 세로로 쌓아 순서대로 스크롤하도록 전환 */
@media (max-width: 720px) {
  .menu-layout {
    flex-direction: column;
    height: auto;
  }

  .cart-panel {
    width: 100%;
  }
}

.cart-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #23232c;
  border-radius: 10px;
  padding: 10px 12px;
}

.cart-row .cart-name {
  flex: 1;
  font-size: 15px;
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: #3a3a48;
  color: #f0f0f0;
  font-size: 18px;
  cursor: pointer;
}

.qty-btn:active {
  background: #4a4a5c;
}

.cart-qty {
  min-width: 24px;
  text-align: center;
  font-size: 15px;
}

.cart-remove {
  margin-left: 10px;
  border: none;
  background: transparent;
  color: #ff8080;
  font-size: 18px;
  cursor: pointer;
}

.cart-total {
  font-size: 20px;
  font-weight: bold;
  text-align: right;
  padding: 14px 4px;
  color: #ffcb66;
}

.btn-back,
.btn-confirm {
  border: none;
  border-radius: 10px;
  font-size: 17px;
  padding: 16px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-back {
  background: #2f2f3a;
  color: #f0f0f0;
}

.btn-confirm {
  background: #ffcb66;
  color: #1e1e24;
  font-weight: bold;
}

.btn-confirm:disabled {
  background: #5a5a3f;
  color: #999;
  cursor: not-allowed;
}

.btn-settlement {
  display: inline-block;
  border: none;
  border-radius: 10px;
  background: #2f2f3a;
  color: #f0f0f0;
  font-size: 15px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
}

.topbar-links {
  display: flex;
  gap: 10px;
}

.bill-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 520px;
}

.receipt-shop-info {
  max-width: 520px;
  margin-bottom: 20px;
  padding: 16px;
  background: #23232c;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #ccc;
}

.receipt-shop-name {
  font-size: 20px;
  font-weight: bold;
  color: #ffcb66;
  margin-bottom: 6px;
}

/* 결제완료 화면: 실제 영수증처럼 흰 종이 위에 출력되는 느낌으로 표시 */
.receipt-paper {
  max-width: 380px;
  margin: 0 0 20px;
  padding: 28px 22px;
  background: #fdfdf8;
  color: #1a1a1a;
  font-family: 'Courier New', Consolas, monospace;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  border-radius: 2px;
}

.receipt-paper .receipt-shop-info {
  max-width: none;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  color: #1a1a1a;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.receipt-paper .receipt-shop-name {
  font-size: 20px;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.receipt-paper .receipt-divider {
  border-top: 1px dashed #999;
  margin: 16px 0;
}

.receipt-paper .bill-items {
  max-width: none;
  margin-bottom: 0;
  gap: 8px;
}

.receipt-paper .bill-row {
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 14px;
  color: #1a1a1a;
}

.receipt-paper .bill-amount {
  color: #1a1a1a;
  font-weight: normal;
}

.receipt-paper .cart-total {
  color: #1a1a1a;
  padding: 0;
  font-size: 15px;
}

.video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.video-overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.video-overlay-label {
  font-size: 20px;
  color: #ffcb66;
  font-weight: bold;
}

.video-overlay-box video {
  width: min(480px, 90vw);
  border-radius: 12px;
  background: #000;
}

.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #23232c;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 16px;
}

.bill-amount {
  color: #ffcb66;
  font-weight: bold;
}

.detail-actions {
  display: flex;
  gap: 12px;
  max-width: 520px;
}

.detail-actions .btn-back,
.detail-actions .btn-confirm {
  flex: 1;
  margin-top: 0;
}

.payment-methods {
  display: flex;
  gap: 16px;
  max-width: 520px;
  margin-bottom: 24px;
}

.method-btn {
  flex: 1;
  min-height: 88px;
  border: none;
  border-radius: 14px;
  background: #2f2f3a;
  color: #f0f0f0;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.method-btn.active {
  background: #ffcb66;
  color: #1e1e24;
}

.discount-btn {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: 56px;
  margin-bottom: 20px;
  border: 2px solid #4caf7d;
  border-radius: 12px;
  background: transparent;
  color: #4caf7d;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.discount-btn.active {
  background: #4caf7d;
  color: #1e1e24;
}

.card-approval-group {
  max-width: 520px;
  margin-bottom: 24px;
}

.card-approval-group label {
  display: block;
  margin-bottom: 8px;
  color: #ffcb66;
}

.card-approval-group input {
  width: 100%;
  font-size: 18px;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: #23232c;
  color: #f0f0f0;
}

.card-approval-group.hidden {
  display: none;
}

.settlement-box {
  max-width: 520px;
  margin-bottom: 24px;
}

.settlement-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  background: #23232c;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 17px;
}

.settlement-row.settlement-grand {
  background: #33333f;
  font-weight: bold;
  color: #ffcb66;
}

.hidden {
  display: none !important;
}

body.order-page {
  overflow: auto;
}

.status-message {
  margin: 40px 20px;
  font-size: 18px;
  text-align: center;
  color: #ffcb66;
}

.order-main {
  padding: 16px;
  padding-bottom: 100px;
}

.order-cart-heading {
  margin: 20px 0 12px;
  font-size: 17px;
  color: #ffcb66;
}

.order-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #14141a;
  border-top: 2px solid #333;
}

.order-bar #cart-total {
  font-size: 17px;
  font-weight: bold;
  color: #ffcb66;
}

.order-bar .btn-confirm {
  margin: 0;
  padding: 14px 24px;
}

.order-page .item-grid,
.order-page .category-tabs {
  overflow: visible;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.qr-card {
  background: #23232c;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.qr-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #ffcb66;
  margin-bottom: 10px;
}

.qr-image {
  width: 100%;
  max-width: 200px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.qr-url {
  margin-top: 10px;
  font-size: 12px;
  word-break: break-all;
  color: #999;
}

.dash-section {
  margin-bottom: 36px;
  max-width: 720px;
}

.dash-section h2 {
  font-size: 18px;
  color: #ffcb66;
  margin-bottom: 12px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-empty {
  color: #999;
  font-size: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 110px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.bar-track {
  background: #23232c;
  border-radius: 6px;
  height: 18px;
  overflow: hidden;
}

.bar-fill {
  background: #ffcb66;
  height: 100%;
}

.bar-value {
  text-align: right;
  color: #ffcb66;
}

.menu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.menu-table th,
.menu-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #333;
}

.menu-table th {
  color: #ffcb66;
}

.menu-unsold-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-unsold-list li {
  background: #3a2323;
  color: #ff9d9d;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
}

.report-box {
  margin-top: 16px;
  padding: 16px;
  background: #23232c;
  border-radius: 10px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  max-width: 720px;
}

.report-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.report-list li {
  margin-bottom: 6px;
}

.report-list a {
  color: #ffcb66;
}
