/* NEXE-restaurant 設計系統 V0.1.0
 * 米白背景、白色卡片、深色文字、細緻邊框、線性圖示、品牌深綠（取自 Logo #325146）。
 * 所有元件以 nx- 開頭。顏色一律使用變數，不寫死色碼。
 */
:root {
  --nx-bg: #F8F6F1;
  --nx-surface: #FFFFFF;
  --nx-surface-2: #FAF8F4;
  --nx-sunken: #EFECE6;
  --nx-ink: #1F1F1F;
  --nx-ink-2: #3D3D3A;
  --nx-muted: #6B6B68;
  --nx-faint: #8C8476;
  --nx-line: #E8E5DF;
  --nx-line-2: #F1EFEA;
  --nx-primary: #325146;
  --nx-primary-hover: #283F37;
  --nx-primary-ink: #FFFFFF;
  --nx-primary-soft: #E6EEE9;
  --nx-primary-line: #C9DDD2;
  --nx-sage: #C9CDB8;
  --nx-cream: #E9DFC4;
  --nx-danger: #9A3D12;
  --nx-danger-soft: #FBEDE4;
  --nx-warn: #8A5A10;
  --nx-warn-ink: #5E3E08;
  --nx-warn-soft: #FFF4DB;
  --nx-warn-line: #E9C97A;
  --nx-note: #7A3A00;
  --nx-note-soft: #FFF1E0;
  --nx-note-line: #E8A35A;
  --nx-info-soft: #EEF3F0;
  --nx-radius-sm: 10px;
  --nx-radius: 14px;
  --nx-radius-lg: 20px;
  --nx-shadow: 0 6px 20px rgba(31, 31, 31, .08);
  --nx-shadow-lg: 0 20px 48px rgba(31, 31, 31, .18);
  --nx-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --nx-ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--nx-bg); color: var(--nx-ink);
  font-family: var(--nx-font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--nx-primary); }
a:hover { color: var(--nx-primary-hover); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(50, 81, 70, .35); outline-offset: 2px; }
.nx-sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nx-muted { color: var(--nx-muted); }
.nx-small { font-size: 13px; }
.nx-tiny { font-size: 12px; }
.nx-bold { font-weight: 700; }
.nx-right { text-align: right; }
.nx-center { text-align: center; }
.nx-nowrap { white-space: nowrap; }
.nx-hide { display: none !important; }
[hidden] { display: none !important; }

/* ---------- 版面工具 ---------- */
.nx-stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.nx-row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.nx-row--nowrap { flex-wrap: nowrap; }
.nx-spacer { flex: 1; }
.nx-grid { display: grid; gap: var(--gap, 12px); grid-template-columns: repeat(auto-fit, minmax(var(--min, 200px), 1fr)); }
.nx-container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- 卡片 ---------- */
.nx-card { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: var(--nx-radius); padding: 18px 20px; }
.nx-card--flat { padding: 0; overflow: hidden; }
.nx-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.nx-card__head h2 { flex: 1; }
.nx-kpi__label { font-size: 13px; color: var(--nx-muted); }
.nx-kpi__value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.nx-kpi__sub { font-size: 13px; color: var(--nx-muted); margin-top: 4px; }

/* ---------- 按鈕 ---------- */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-line); background: var(--nx-surface); color: var(--nx-ink);
  font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.nx-btn:hover { background: var(--nx-surface-2); color: var(--nx-ink); }
.nx-btn:active { transform: scale(.97); }
.nx-btn[disabled], .nx-btn.is-disabled { background: var(--nx-line); border-color: var(--nx-line); color: var(--nx-muted); cursor: not-allowed; transform: none; }
.nx-btn--primary { background: var(--nx-primary); border-color: var(--nx-primary); color: var(--nx-primary-ink); font-weight: 700; }
.nx-btn--primary:hover { background: var(--nx-primary-hover); border-color: var(--nx-primary-hover); color: var(--nx-primary-ink); }
.nx-btn--outline { border-color: var(--nx-primary); color: var(--nx-primary); font-weight: 700; }
.nx-btn--danger { background: var(--nx-danger); border-color: var(--nx-danger); color: #fff; font-weight: 700; }
.nx-btn--danger:hover { background: #7f320f; color: #fff; }
.nx-btn--danger-ghost { color: var(--nx-danger); }
.nx-btn--ghost { border-color: transparent; background: transparent; }
.nx-btn--ghost:hover { background: var(--nx-line-2); }
.nx-btn--lg { min-height: 52px; font-size: 16px; border-radius: var(--nx-radius); padding: 0 22px; }
.nx-btn--xl { min-height: 56px; font-size: 17px; border-radius: 16px; }
.nx-btn--sm { min-height: 36px; font-size: 14px; padding: 0 14px; border-radius: 9px; }
.nx-btn--block { width: 100%; }
.nx-btn--icon { width: 44px; padding: 0; border-radius: 22px; }
.nx-link { border: 0; background: none; padding: 0; color: var(--nx-primary); cursor: pointer; font-size: 14px; min-height: 44px; }
.nx-link { text-decoration: none; }
.nx-link:hover { text-decoration: underline; }

/* ---------- 標籤 ---------- */
.nx-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--nx-line-2); color: var(--nx-ink-2); }
.nx-badge--ok { background: var(--nx-primary-soft); color: var(--nx-ok); }
.nx-badge--warn { background: var(--nx-warn-soft); color: var(--nx-warn); }
.nx-badge--danger { background: var(--nx-danger-soft); color: var(--nx-danger); }
.nx-badge--outline { background: var(--nx-surface); border: 1px solid var(--nx-line); color: var(--nx-muted); }
.nx-badge--solid { background: var(--nx-primary); color: #fff; }
.nx-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--nx-danger-soft); color: var(--nx-danger); }

/* ---------- 表單 ---------- */
.nx-field { display: flex; flex-direction: column; gap: 6px; }
.nx-label { font-size: 14px; font-weight: 700; }
.nx-label small, .nx-help { font-size: 13px; font-weight: 400; color: var(--nx-muted); }
.nx-input, .nx-select, .nx-textarea {
  width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--nx-line); border-radius: var(--nx-radius-sm);
  background: var(--nx-surface); font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease;
}
.nx-textarea { padding: 12px; min-height: 80px; resize: vertical; }
.nx-input:focus, .nx-select:focus, .nx-textarea:focus { outline: none; border-color: var(--nx-primary); box-shadow: 0 0 0 3px rgba(50, 81, 70, .15); }
.nx-input--code { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; }
.nx-error { font-size: 13px; color: var(--nx-danger); }
.nx-field.has-error .nx-input, .nx-field.has-error .nx-select, .nx-field.has-error .nx-textarea { border-color: var(--nx-danger); }
.nx-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.nx-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--nx-primary); flex: none; }
.nx-switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.nx-switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--nx-line); position: relative; cursor: pointer; transition: background .2s ease; flex: none; margin: 0; }
.nx-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--nx-ease); }
.nx-switch input:checked { background: var(--nx-primary); }
.nx-switch input:checked::after { transform: translateX(18px); }

/* 可選擇的選項（單選／複選按鈕） */
.nx-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nx-option {
  min-height: 48px; padding: 0 14px; border-radius: var(--nx-radius-sm); border: 1px solid var(--nx-line); background: var(--nx-surface);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 15px; text-align: left;
  transition: transform .12s ease, background-color .18s ease, border-color .18s ease;
}
.nx-option:active { transform: scale(.97); }
.nx-option[aria-pressed="true"], .nx-option.is-on { border: 1.5px solid var(--nx-primary); background: var(--nx-primary-soft); font-weight: 700; }
.nx-option[disabled] { opacity: .5; cursor: not-allowed; }
.nx-option__extra { font-size: 13px; color: var(--nx-muted); font-weight: 400; }

/* 數量加減 */
.nx-stepper { display: inline-flex; align-items: center; border: 1px solid var(--nx-line); border-radius: 12px; background: var(--nx-surface); flex: none; }
.nx-stepper button { width: 44px; height: 48px; border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 12px; }
.nx-stepper button:active { background: var(--nx-line-2); }
.nx-stepper output { min-width: 28px; text-align: center; font-weight: 700; font-size: 16px; }

/* 分段切換 */
.nx-segment { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--nx-sunken); }
.nx-segment button, .nx-segment a { height: 36px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: var(--nx-muted); cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; font-size: 14px; }
.nx-segment .is-on, .nx-segment [aria-selected="true"] { background: var(--nx-surface); color: var(--nx-ink); font-weight: 700; box-shadow: 0 1px 3px rgba(31, 31, 31, .12); }

/* 分類膠囊 */
.nx-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.nx-chips::-webkit-scrollbar { display: none; }
.nx-chip { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--nx-line); background: var(--nx-surface); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .18s ease; }
.nx-chip.is-on { background: var(--nx-primary); border-color: var(--nx-primary); color: #fff; }

/* ---------- 提示框 ---------- */
.nx-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; background: var(--nx-info-soft); color: var(--nx-ok); }
.nx-alert--warn { background: var(--nx-warn-soft); color: var(--nx-warn-ink); border: 1px solid var(--nx-warn-line); }
.nx-alert--danger { background: var(--nx-danger-soft); color: var(--nx-danger); }
.nx-alert--solid-danger { background: var(--nx-danger); color: #fff; font-weight: 500; }
.nx-alert svg { flex: none; margin-top: 2px; }
.nx-note { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--nx-note-line); background: var(--nx-note-soft); color: var(--nx-note); font-size: 14px; }

/* ---------- 表格 ---------- */
.nx-table-wrap { overflow-x: auto; }
.nx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nx-table th { font-weight: 500; color: var(--nx-muted); text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--nx-line); white-space: nowrap; }
.nx-table td { padding: 10px 8px; border-bottom: 1px solid var(--nx-line-2); vertical-align: middle; }
.nx-table tbody tr { transition: background-color .15s ease; }
.nx-table tbody tr:hover { background: var(--nx-surface-2); }
.nx-list { list-style: none; margin: 0; padding: 0; }
.nx-list > li { padding: 12px 0; border-bottom: 1px solid var(--nx-line-2); }
.nx-list > li:last-child { border-bottom: 0; }

/* ---------- 空狀態、骨架 ---------- */
.nx-empty { text-align: center; padding: 40px 16px; color: var(--nx-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nx-empty strong { color: var(--nx-ink); font-size: 16px; }
.nx-skel { background: linear-gradient(90deg, #EFECE6 0, #F7F5F0 50%, #EFECE6 100%); background-size: 800px 100%; animation: nx-shimmer 1.2s linear infinite; border-radius: var(--nx-radius); }

/* ---------- 遮罩、底部面板、側邊面板、對話框 ---------- */
.nx-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(31, 31, 31, .42); animation: nx-fade .2s ease-out; }
.nx-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--nx-surface); border-radius: var(--nx-radius-lg) var(--nx-radius-lg) 0 0; animation: nx-up .3s var(--nx-ease);
  max-width: 560px; margin: 0 auto;
}
.nx-sheet__body { flex: 1; overflow-y: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 20px; }
.nx-sheet__foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--nx-line); display: flex; gap: 12px; align-items: center; }
.nx-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: 440px; max-width: 100%; display: flex; flex-direction: column;
  background: var(--nx-surface); border-left: 1px solid var(--nx-line); box-shadow: -12px 0 32px rgba(31, 31, 31, .10); animation: nx-right .3s var(--nx-ease);
}
.nx-drawer__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--nx-line); }
.nx-drawer__body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.nx-drawer__foot { padding: 14px 20px 20px; border-top: 1px solid var(--nx-line); display: flex; gap: 10px; flex-wrap: wrap; }
.nx-dialog {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 420px; max-width: calc(100% - 32px);
  background: var(--nx-surface); border-radius: 16px; padding: 24px; box-shadow: var(--nx-shadow-lg);
  display: flex; flex-direction: column; gap: 14px; animation: nx-modal .22s ease-out;
}
.nx-dialog__title { font-size: 19px; font-weight: 700; }
.nx-dialog__body { font-size: 15px; color: var(--nx-muted); line-height: 1.6; }
.nx-dialog__actions { display: flex; gap: 10px; margin-top: 6px; }
.nx-dialog__actions .nx-btn { flex: 1; }
.nx-overlay--top { z-index: 50; }

/* ---------- 提示訊息 ---------- */
.nx-toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.nx-toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: #1F1F1F; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); animation: nx-rise .22s ease-out; pointer-events: auto; }
.nx-toast--error { background: var(--nx-danger); }
.nx-toast.is-leaving { animation: nx-fade-out .2s ease-in forwards; }

/* 連線狀態橫幅 */
.nx-conn { position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: var(--nx-danger); color: #fff; font-size: 14px; font-weight: 500; text-align: center; }

/* ---------- 啟動畫面 ---------- */
.nx-splash { position: fixed; inset: 0; z-index: 100; background: var(--nx-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.nx-splash__mark { position: relative; width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; }
.nx-splash__halo { position: absolute; inset: -6px; border-radius: 40px; background: #E3EAE5; animation: nx-halo 1.1s ease-out .35s both; }
.nx-splash__logo { position: relative; width: 120px; height: 123px; object-fit: contain; animation: nx-logo .7s var(--nx-ease) both; }
.nx-splash__word { margin-top: 32px; font-size: 24px; font-weight: 700; color: var(--nx-primary); letter-spacing: .06em; padding-left: .06em; animation: nx-word .6s ease-out .55s both; }
.nx-splash__sub { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--nx-muted); letter-spacing: .28em; padding-left: .28em; animation: nx-rise .5s ease-out .75s both; }
.nx-splash__track { margin-top: 40px; width: 120px; height: 3px; border-radius: 2px; background: var(--nx-line); overflow: hidden; animation: nx-rise .4s ease-out .9s both; }
.nx-splash__bar { width: 40%; height: 3px; border-radius: 2px; background: var(--nx-primary); animation: nx-bar 1.1s cubic-bezier(.45, 0, .55, 1) infinite; }
.nx-splash__status { margin-top: 14px; font-size: 13px; color: var(--nx-muted); min-height: 20px; animation: nx-rise .5s ease-out .75s both; }
.nx-splash__ver { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); padding: 4px 12px; border-radius: 999px; background: #EAE7E0; font-size: 13px; font-weight: 600; color: var(--nx-muted); letter-spacing: .08em; animation: nx-rise .5s ease-out .9s both; }
.nx-splash__slow { position: absolute; left: 20px; right: 20px; bottom: 80px; max-width: 360px; margin: 0 auto; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--nx-line); text-align: center; display: none; flex-direction: column; gap: 10px; animation: nx-rise .3s ease-out; }
.nx-splash.is-slow .nx-splash__slow { display: flex; }
.nx-splash.is-leaving { animation: nx-out .35s ease-in forwards; }
.nx-splash-skip .nx-splash { display: none !important; }

/* ---------- 品牌 ---------- */
.nx-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--nx-ink); }
.nx-brand img { width: 36px; height: 37px; object-fit: contain; }
.nx-brand__name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.nx-brand__sub { font-size: 12px; color: var(--nx-muted); }
.nx-avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--nx-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none; overflow: hidden; }
.nx-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 老闆端版面 ---------- */
.nx-shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.nx-side { flex: 1 1 220px; max-width: 100%; background: var(--nx-surface); border-right: 1px solid var(--nx-line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.nx-side__brand { padding: 4px 8px 20px; }
.nx-nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--nx-ink-2); text-decoration: none; font-size: 15px; transition: background-color .15s ease; }
.nx-nav:hover { background: #F4F2ED; color: var(--nx-ink); }
.nx-nav.is-on { background: var(--nx-primary-soft); color: var(--nx-ink); font-weight: 700; }
.nx-nav svg { flex: none; color: var(--nx-muted); }
.nx-nav.is-on svg { color: var(--nx-primary); }
.nx-nav .nx-count { margin-left: auto; }
.nx-side__foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--nx-line); font-size: 12px; color: var(--nx-muted); line-height: 1.7; }
.nx-main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; animation: nx-rise .28s ease-out both; }
.nx-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.nx-page-head__title { flex: 1 1 260px; }
.nx-page-head__sub { font-size: 14px; color: var(--nx-muted); margin-top: 4px; }
@media (max-width: 800px) {
  .nx-side { flex-basis: 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--nx-line); padding: 10px; gap: 4px; }
  .nx-side__brand, .nx-side__foot { display: none; }
  .nx-nav { flex: none; }
  .nx-main { padding: 20px 16px 40px; }
}

/* ---------- 工作區（服務生端、廚房端）上方列 ---------- */
.nx-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--nx-surface); border-bottom: 1px solid var(--nx-line); flex-wrap: wrap; }
.nx-topbar__title { font-size: 18px; font-weight: 700; }
.nx-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.nx-tab { min-height: 44px; padding: 0 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; color: var(--nx-ink-2); text-decoration: none; font-size: 15px; }
.nx-tab:hover { background: var(--nx-line-2); color: var(--nx-ink); }
.nx-tab.is-on { background: var(--nx-primary-soft); font-weight: 700; color: var(--nx-ink); }
.nx-conn-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--nx-muted); }
.nx-conn-dot::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: #3E9B6E; }
.nx-conn-dot.is-off { color: #C2410C; }
.nx-conn-dot.is-off::before { background: #C2410C; }

/* 看板欄 */
.nx-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px 16px 16px; align-items: start; }
.nx-col { background: var(--nx-surface-2); border: 1px solid var(--nx-line); border-radius: 16px; display: flex; flex-direction: column; min-height: 200px; }
.nx-col__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; font-size: 18px; font-weight: 700; }
.nx-col__body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .nx-board { grid-template-columns: 1fr; } }

.nx-ticket { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: 14px; padding: 14px 16px 16px; display: flex; flex-direction: column; animation: nx-rise .25s ease-out both; }
.nx-ticket.is-late { border: 2px solid #C2410C; }
.nx-ticket.is-new { animation: nx-rise .25s ease-out both, nx-flash 1.6s ease-out .25s 2; }
.nx-ticket__head { display: flex; align-items: baseline; gap: 10px; }
.nx-ticket__table { font-size: 24px; font-weight: 700; }
.nx-ticket__time { margin-left: auto; font-size: 15px; font-weight: 700; padding: 3px 10px; border-radius: 8px; color: var(--nx-muted); }
.nx-ticket__time.is-warn { background: #F6D58E; color: #3D2600; }
.nx-ticket__time.is-late { background: var(--nx-danger); color: #fff; }
.nx-ticket__item { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 8px 4px; min-height: 44px; border: 0; border-bottom: 1px solid var(--nx-line-2); background: transparent; font-size: 20px; font-weight: 500; cursor: pointer; }
.nx-ticket__item.is-done { text-decoration: line-through; opacity: .45; }
.nx-ticket__qty { flex: none; min-width: 44px; font-weight: 700; }
.nx-ticket__qty.is-multi { color: var(--nx-primary); }
.nx-ticket__opts { display: block; font-size: 15px; font-weight: 400; color: var(--nx-muted); margin-top: 2px; }

/* 廚房高對比模式 */
.nx-contrast { --nx-bg: #121412; --nx-surface: #1E211F; --nx-surface-2: #181A18; --nx-ink: #F4F2EC; --nx-ink-2: #E0DDD5; --nx-muted: #B4B0A6; --nx-line: #363B35; --nx-line-2: #2A2E29; --nx-primary: #7FC2A4; --nx-primary-hover: #95D0B5; --nx-primary-ink: #0E1A14; --nx-primary-soft: #23332B; --nx-note-soft: #3A2510; --nx-note: #FFD8A8; }
.nx-contrast .nx-btn--primary { color: var(--nx-primary-ink); }

/* 桌位格子 */
.nx-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.nx-tile { border-radius: 12px; padding: 12px; min-height: 84px; text-align: left; cursor: pointer; border: 1px solid var(--nx-line); background: var(--nx-surface); color: var(--nx-muted); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.nx-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(31, 31, 31, .08); }
.nx-tile strong { font-size: 17px; color: var(--nx-ink); }
.nx-tile--busy { background: var(--nx-primary-soft); border-color: var(--nx-primary-line); color: var(--nx-ink); }
.nx-tile--dirty { background: var(--nx-warn-soft); border: 1px dashed #D9B66A; color: var(--nx-warn-ink); }

/* 進度條 */
.nx-bar { height: 8px; border-radius: 4px; background: var(--nx-line-2); overflow: hidden; }
.nx-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--nx-primary); transition: width .4s var(--nx-ease); }

/* 步驟指示（開通精靈） */
.nx-steps { display: flex; gap: 6px; }
.nx-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--nx-line); }
.nx-steps span.is-done { background: var(--nx-primary); }
.nx-wizard { max-width: 560px; margin: 0 auto; padding: 28px 20px 48px; display: flex; flex-direction: column; gap: 20px; animation: nx-rise .28s ease-out both; }

/* 狀態線（客人訂單） */
.nx-track { display: flex; flex-direction: column; }
.nx-track__step { display: flex; gap: 12px; align-items: center; height: 40px; font-size: 15px; color: var(--nx-faint); }
.nx-track__dot { width: 14px; height: 14px; border-radius: 7px; background: #fff; border: 2px solid #D9D4CB; flex: none; }
.nx-track__step.is-done { color: var(--nx-ink); }
.nx-track__step.is-done .nx-track__dot { background: var(--nx-primary); border-color: var(--nx-primary); }
.nx-track__step.is-current { color: var(--nx-ink); font-weight: 700; }
.nx-track__step.is-current .nx-track__dot { background: var(--nx-primary-soft); border: 3px solid var(--nx-primary); animation: nx-pulse 1.6s ease-out infinite; }

/* ---------- 動畫 ---------- */
@keyframes nx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nx-fade-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes nx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nx-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes nx-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes nx-modal { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes nx-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes nx-pulse { 0% { box-shadow: 0 0 0 0 rgba(50, 81, 70, .45); } 70% { box-shadow: 0 0 0 10px rgba(50, 81, 70, 0); } 100% { box-shadow: 0 0 0 0 rgba(50, 81, 70, 0); } }
@keyframes nx-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(50, 81, 70, 0); } 30% { box-shadow: 0 0 0 4px rgba(50, 81, 70, .35); } }
@keyframes nx-logo { 0% { opacity: 0; transform: translateY(10px) scale(.84); } 60% { opacity: 1; transform: translateY(0) scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes nx-halo { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: .9; } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes nx-word { from { opacity: 0; transform: translateY(10px); letter-spacing: .42em; } to { opacity: 1; transform: none; letter-spacing: .22em; } }
@keyframes nx-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes nx-out { to { opacity: 0; transform: scale(1.04); visibility: hidden; } }
@keyframes nx-call { 0% { transform: scale(.94); } 40% { transform: scale(1.04); } 70% { transform: scale(.99); } 100% { transform: scale(1); } }
@keyframes nx-ring { 0% { box-shadow: 0 0 0 0 rgba(50, 81, 70, .5); } 70% { box-shadow: 0 0 0 18px rgba(50, 81, 70, 0); } 100% { box-shadow: 0 0 0 0 rgba(50, 81, 70, 0); } }
.nx-anim-rise { animation: nx-rise .28s ease-out both; }
.nx-anim-call { animation: nx-call .5s ease-out, nx-ring 1.6s ease-out .5s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  body { background: #fff; }
  .nx-noprint, .nx-topbar, .nx-side, .nx-tabbar, .nx-mobile-nav, .nx-start-gate, #nx-toasts, #nx-offline { display: none !important; }
  .nx-card { box-shadow: none !important; break-inside: avoid; }
}

/* ---------- 條款確認 ---------- */
.nx-legal-box { max-height: 260px; overflow-y: auto; padding: 16px; border: 1px solid var(--nx-line); border-radius: 12px; background: var(--nx-surface-2); line-height: 1.8; font-size: 14px; -webkit-overflow-scrolling: touch; }
.nx-legal-box h1 { font-size: 18px; margin-bottom: 8px; }
.nx-legal-box h2 { font-size: 15px; margin: 12px 0 4px; }
.nx-progress { height: 6px; border-radius: 3px; background: var(--nx-line); overflow: hidden; }
.nx-progress > span { display: block; height: 100%; border-radius: 3px; background: var(--nx-primary); transition: width .4s var(--nx-ease); }

/* ---------- 工作平板：點一下開始（解鎖提示音與螢幕常亮） ---------- */
.nx-start-gate { position: fixed; inset: 0; z-index: 90; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(248, 246, 241, .94); color: var(--nx-ink); font: inherit; cursor: pointer; animation: nx-fade .2s ease-out; }
.nx-start-gate strong { font-size: 26px; }
.nx-start-gate span { font-size: 15px; color: var(--nx-muted); }
.nx-start-gate__icon { color: var(--nx-primary) !important; width: 96px; height: 96px; border-radius: 48px; background: var(--nx-primary-soft); display: flex; align-items: center; justify-content: center; animation: nx-pulse 1.8s infinite; }
.nx-start-gate.is-leaving { animation: nx-out .25s ease-in forwards; }

/* ---------- 服務生端：客人呼叫 ---------- */
.nx-calls { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 16px 0; }
.nx-call { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; background: #FFF4E5; border: 1px solid #F5C98B; animation: nx-rise .25s ease-out; }
.nx-call.is-checkout { background: var(--nx-primary-soft); border-color: var(--nx-primary-line); }
.nx-call__table { font-size: 20px; font-weight: 700; }
.nx-call__label { font-size: 16px; font-weight: 600; }

/* ---------- 拖曳排序 ---------- */
.nx-handle { display: none; width: 32px; height: 40px; align-items: center; justify-content: center; font-size: 22px; color: var(--nx-muted); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; flex: none; border-radius: 8px; }
.nx-handle:active { cursor: grabbing; background: var(--nx-line-2); }
.is-sorting .nx-handle { display: inline-flex; }
.nx-sort-hint { display: none !important; }
.is-sorting .nx-sort-hint { display: flex !important; }
.is-sorting [data-sort-id] { transition: box-shadow .15s ease; }
.is-dragging { position: relative; z-index: 5; box-shadow: 0 10px 28px rgba(0, 0, 0, .18) !important; background: var(--nx-surface) !important; opacity: .96; }
tr.is-dragging td { background: var(--nx-primary-soft); }

/* ---------- 觸控友善 ---------- */
.nx-tap { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; margin: -4px; }
input[type=file].nx-input, .nx-field input[type=file] { min-height: 44px; padding: 8px; max-width: 100%; box-sizing: border-box; width: 100%; }

/* 員工登入密碼盤（平板用手指點） */
.nx-pinpad { width: min(360px, calc(100vw - 32px)); }
.nx-pinpad__value { font-size: 28px; letter-spacing: 12px; text-align: center; margin: 12px 0; }
.nx-pinpad__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nx-pinpad__keys .nx-btn { min-height: 56px; font-size: 22px; justify-content: center; }
.nx-segment--wrap { display: flex; flex-wrap: wrap; }
.nx-segment--wrap button { flex: 1 1 auto; justify-content: center; padding: 0 12px; }
.nx-faint { color: var(--nx-faint); }
/* 更新內容 */
.nx-whatsnew { width: min(520px, calc(100vw - 32px)); }
.nx-whatsnew__kicker { font-size: 13px; font-weight: 700; color: var(--nx-primary); letter-spacing: .5px; }
.nx-whatsnew__body { max-height: min(60vh, 520px); overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }
.nx-whatsnew__ver { margin: 16px 0 6px; font-size: 13px; font-weight: 700; color: var(--nx-muted); }
.nx-whatsnew__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.nx-whatsnew__list li { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--nx-primary-soft); }
.nx-whatsnew__list span { color: var(--nx-muted); font-size: 14px; line-height: 1.6; }
.nx-ver-link { font-size: 12px; color: var(--nx-muted); background: none; border: 0; cursor: pointer; padding: 4px; }
