/* 小酒馆员工端 PWA · 深棕金主题（工作台） */
:root {
  --bg: #f2efe8;
  --card: #fff;
  --line: #e8e2d5;
  --gold: #b8873f;
  --gold-d: #8a5f1d;
  --gold-l: #f4ead8;
  --green: #0f6e56;
  --green-d: #0c5844;
  --ink: #2a2318;
  --ink-2: #6c6559;
  --ink-3: #a09889;
  --danger: #b05b4a;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.5; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }

/* 登录 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #2a2318, #1c2128); }
.login-box { width: 100%; max-width: 360px; background: var(--card); border-radius: 20px; padding: 34px 26px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.login-logo { width: 60px; height: 60px; border-radius: 17px; background: linear-gradient(135deg, var(--gold), #d8a24a); color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.login-title { font-size: 22px; font-weight: 800; }
.login-sub { font-size: 13px; color: var(--ink-2); margin: 4px 0 26px; }
.pwd-input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; font-size: 15px; outline: none; text-align: center; }
.pwd-input:focus { border-color: var(--gold); }
.login-box .pwd-input + .pwd-input { margin-top: 12px; }
.login-tip { font-size: 11px; color: var(--ink-2); margin-top: 16px; line-height: 1.6; }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 12px; }
.enroll-account { font-size: 15px; color: var(--gold); font-weight: 700; margin: -14px 0 18px; letter-spacing: .5px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; padding: calc(11px + var(--safe-t)) 16px 12px;
  background: linear-gradient(135deg, #2a2318, #1c2128); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--gold), #d8a24a); display: flex; align-items: center; justify-content: center; font-size: 21px; }
.shop-name { font-size: 16px; font-weight: 700; }
.conn-status { font-size: 11px; color: #d8c9a8; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.dot.off { background: #f87171; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; font-size: 19px; }
.icon-btn.muted { opacity: .4; }
.icon-btn:active { background: rgba(255,255,255,.12); }

/* 统计 */
.stat-row { display: flex; gap: 9px; padding: 14px 14px 0; }
.stat-card { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 13px 6px; text-align: center; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--gold-d); line-height: 1.1; }
.stat-card:nth-child(2) .stat-num { color: var(--green); }
.stat-card:nth-child(3) .stat-num { color: var(--ink-2); }
.stat-label { font-size: 11px; color: var(--ink-2); margin-top: 5px; }

/* tab + 工具栏 */
.tabs { display: flex; gap: 8px; padding: 14px 14px 0; }
.tab { flex: 1; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; font-size: 14px; color: var(--ink-2); }
.tab.active { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; }
.auto-txt { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; }
.auto-txt b { color: var(--gold-d); }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 7px; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.refresh-btn { font-size: 12px; color: var(--gold-d); padding: 5px 12px; border: 1px solid var(--gold); border-radius: 16px; }

/* 订单列表 */
.order-list { padding: 10px 14px 30px; display: flex; flex-direction: column; gap: 10px; }
.loading, .empty { text-align: center; color: var(--ink-3); padding: 50px 10px; font-size: 14px; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 2px 8px rgba(42,35,24,.03); }
.order-card.new { border-color: var(--gold); box-shadow: 0 2px 14px rgba(184,135,63,.18); }
.oc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.oc-id { font-size: 12px; color: var(--ink-3); }
.oc-badge { font-size: 11px; padding: 3px 9px; border-radius: 11px; background: var(--gold-l); color: var(--gold-d); }
.oc-badge.paid { background: #e4f2e9; color: var(--green); }
.oc-badge.served { background: #eef0f3; color: var(--ink-2); }
.oc-customer { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.oc-items { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.oc-items .qty { color: var(--gold-d); font-weight: 600; }
.oc-msg { font-size: 12.5px; color: var(--gold-d); background: var(--gold-l); border-radius: 8px; padding: 7px 10px; margin-top: 8px; }
.oc-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }
.oc-amount { font-size: 13px; color: var(--ink-2); }
.oc-amount b { font-size: 20px; color: var(--danger); margin-left: 4px; }
.oc-actions { display: flex; gap: 8px; }
.mini-btn { font-size: 13px; padding: 8px 14px; border-radius: 9px; }
.mini-btn.pay { background: var(--gold); color: #fff; font-weight: 600; }
.mini-btn.pay:active { background: var(--gold-d); }
.mini-btn.serve { background: var(--green); color: #fff; }
.mini-btn.cancel { border: 1px solid var(--line); color: var(--ink-2); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; z-index: 50; background: rgba(20,18,14,.6); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 460px; border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); position: relative; max-height: 94vh; overflow-y: auto; animation: slideup .22s ease; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.modal-close { position: absolute; right: 14px; top: 12px; font-size: 26px; color: var(--ink-3); line-height: 1; }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; }
.pay-amount { text-align: center; font-size: 14px; color: var(--ink-2); margin: 10px 0 14px; }
.pay-amount span { font-size: 32px; font-weight: 800; color: var(--danger); }
.qr-box { width: 200px; height: 200px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; background: #f7f3ec; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-missing { color: var(--ink-3); font-size: 13px; text-align: center; padding: 18px; line-height: 1.7; }
.pay-tip { text-align: center; font-size: 12.5px; color: var(--ink-2); margin: 12px 0 16px; }
.field-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.field-row label { width: 40px; flex: 0 0 40px; font-size: 13px; color: var(--ink-2); }
.field-input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; min-width: 0; }
.field-input:focus { border-color: var(--gold); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.actual-pay { font-size: 20px; font-weight: 800; color: var(--green); }
.order-detail { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; margin-top: 12px; max-height: 120px; overflow-y: auto; }
.ok-btn { background: var(--green); }
.ok-btn:active { background: var(--green-d); }
.ghost-btn { margin-top: 8px; border: 1px solid var(--line); color: var(--ink-2); padding: 11px; font-size: 14px; border-radius: 12px; }
.primary-btn { background: var(--gold); color: #fff; border-radius: 12px; padding: 13px 20px; font-size: 15px; font-weight: 600; }
.primary-btn.wide, .ghost-btn.wide { width: 100%; }
.primary-btn[disabled] { background: #ded6c7; }

/* 轻提示 */
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.9); background: rgba(42,35,24,.95); color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px; z-index: 90; opacity: 0; pointer-events: none; transition: .18s; text-align: center; max-width: 80vw; }
.toast.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
