/* 직원 포스 화면 — 키오스크와 같은 색감(초록 #53AB58, 배경 #DFF7C2) */
:root {
  --bg: #DFF7C2;
  --green: #53AB58;
  --white: #fff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  font-family: "210 키위바나나", "Lazydog", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #2f3a2f;
  min-height: 100vh;
}

/* ── 상단바 ── */
#pos-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 14px rgba(60, 110, 60, .25);
}
#pos-header h1 { font-size: 30px; }
.header-right { display: flex; align-items: center; gap: 12px; }
#pos-status {
  font-size: 18px;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .22);
  white-space: nowrap;
}
#pos-status.off { background: #e7b93a; color: #5a3d00; }

/* 페이지 간 이동 링크 (포스 ↔ 주문내역) */
.pos-link {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .22);
  white-space: nowrap;
}
.pos-link:active { background: rgba(255, 255, 255, .35); }

/* ── 주문내역: 날짜 컨트롤 ── */
#hist-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px 6px;
}
#hist-date {
  font-family: inherit;
  font-size: 24px;
  font-weight: bold;
  color: #2f3a2f;
  padding: 8px 16px;
  border: 3px solid var(--green);
  border-radius: 14px;
  background: #fff;
}
.date-nav, .today-btn {
  font-family: inherit;
  font-weight: bold;
  border: 3px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 14px;
  cursor: pointer;
}
.date-nav { width: 48px; height: 48px; font-size: 28px; line-height: 1; }
.today-btn { height: 48px; padding: 0 20px; font-size: 20px; }
.date-nav:active, .today-btn:active { background: var(--green); color: #fff; }

/* ── 주문내역: 요약 줄 ── */
#hist-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  padding: 10px 24px 4px;
  font-size: 22px;
  color: #4a5a44;
}
#hist-summary .s-item b { color: var(--green); font-size: 26px; }
#hist-summary .s-rev b { color: #d6763a; }
#hist-summary .s-loading { color: #8aa17e; font-size: 20px; }

#hist-main { padding: 14px 22px 30px; }
#hist-empty {
  padding: 60px 0;
  text-align: center;
  font-size: 26px;
  color: #9bbf85;
}
.oc-badge.wait { color: var(--green); border-color: var(--green); }

/* ── 본문: 새 주문 / 완료 두 칸 ── */
#pos-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 22px;
  align-items: start;
}
.col h2 {
  font-size: 26px;
  color: var(--green);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.col h2 .count {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 19px;
  background: var(--green);
  color: #fff;
  font-size: 22px;
  line-height: 38px;
  text-align: center;
}
#col-done h2 .count { background: #9bbf85; }

.orders {
  /* 카드 한 장이 열 전체를 차지 — 태블릿에서도 크게, 글자 안 잘리게 */
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ── 주문 카드 ── */
.order-card {
  background: var(--white);
  border: 4px solid var(--green);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 6px 16px rgba(60, 110, 60, .14);
  animation: pop .35s ease;
}
@keyframes pop {
  0% { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.order-card.done {
  border-color: #c3d8b4;
  opacity: .6;
  box-shadow: none;
}

.oc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 3px dashed #cfe7bb;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.oc-no { font-size: 46px; font-weight: bold; color: var(--green); }
.order-card.done .oc-no { color: #9bbf85; }
.oc-time { font-size: 22px; color: #8aa17e; margin-left: auto; }

/* 결제 수단 배지 (카드/현금) */
.oc-pay {
  font-size: 20px;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 14px;
  margin-left: 12px;
  white-space: nowrap;
}
.oc-pay.card { background: #E3EDFB; color: #2A5CA8; }
.oc-pay.cash { background: #FFF3D6; color: #9A6B00; }
.order-card.done .oc-pay { opacity: .7; }

.oc-items { list-style: none; margin-bottom: 12px; }
.oc-items li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 28px;
  padding: 7px 0;
  word-break: keep-all;
}
/* 메뉴 이미지 썸네일 — 글 못 읽는 아이들도 그림으로 구분 */
.i-thumb {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #EFF7E6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.i-thumb img { max-width: 72%; max-height: 82%; }
.order-card.done .i-thumb { opacity: .65; }
.oc-items .i-name { flex: 1; min-width: 0; }
.oc-items .i-qty { font-weight: bold; color: var(--green); white-space: nowrap; }
.order-card.done .oc-items .i-qty { color: #9bbf85; }
.oc-items .i-amt { text-align: right; color: #6b7d63; white-space: nowrap; }

.oc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.oc-total { font-size: 28px; font-weight: bold; color: #2f3a2f; }
.oc-done {
  border: none;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 26px;
  font-weight: bold;
  padding: 10px 26px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform .1s;
}
.oc-done:active { transform: scale(.94); }
.oc-badge {
  font-size: 22px;
  font-weight: bold;
  color: #9bbf85;
  padding: 8px 18px;
  border: 3px solid #c3d8b4;
  border-radius: 16px;
}

/* 태블릿(가로 포함)에서는 새 주문/완료를 위아래로 쌓아 카드가 크게 보이게 */
@media (max-width: 1180px) {
  #pos-main { grid-template-columns: 1fr; }
}

/* ── 로그인 잠금 화면 ── */
#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
#login-box {
  width: min(90vw, 420px);
  background: #fff;
  border: 5px solid var(--green);
  border-radius: 28px;
  padding: 40px 34px;
  box-shadow: 0 16px 40px rgba(60, 110, 60, .25);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
#login-box .login-emoji { font-size: 56px; }
#login-box h2 { font-size: 34px; color: var(--green); }
#login-box .login-sub { font-size: 18px; color: #8aa17e; margin-bottom: 6px; }
#login-box input {
  font-family: inherit;
  font-size: 22px;
  padding: 14px 18px;
  border: 3px solid #c3d8b4;
  border-radius: 14px;
  outline: none;
}
#login-box input:focus { border-color: var(--green); }
#login-box button {
  font-family: inherit;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  margin-top: 4px;
}
#login-box button:disabled { opacity: .6; cursor: default; }
#login-box .login-err { min-height: 24px; font-size: 18px; color: #d24b3a; }

#logout-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  color: var(--green);
  background: #fff;
  border: 3px solid var(--green);
  border-radius: 18px;
  padding: 8px 18px;
  cursor: pointer;
  opacity: .85;
}
#logout-btn:active { background: var(--green); color: #fff; }
