:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #77827c;
  --soft: #a5aea8;
  --line: #e7ebe7;
  --paper: #fff;
  --canvas: #f5f6f2;
  --green: #173d32;
  --green-2: #2e6552;
  --mint: #e8f1eb;
  --lime: #d7edaa;
  --orange: #d87544;
  --orange-soft: #fff1e8;
  --blue: #547d93;
  --blue-soft: #ebf3f7;
  --red: #b94d43;
  --red-soft: #fff0ee;
  --shadow: 0 18px 50px rgba(27, 47, 37, .09);
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(63, 126, 94, .25); outline-offset: 2px; }
button:disabled { cursor: not-allowed !important; opacity: .55; }

.app-shell { min-height: 100vh; }
.sidebar {
  width: 248px; position: fixed; inset: 0 auto 0 0; z-index: 20;
  display: flex; flex-direction: column; padding: 26px 17px 18px;
  color: #eef5ef; background: var(--green);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 30px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; color: var(--green); background: var(--lime); font-family: Georgia, serif; font-size: 19px; font-weight: 700; }
.brand-name { font-family: Georgia, "Songti SC", serif; font-size: 18px; letter-spacing: .04em; }
.brand-caption { color: #b2c8bb; margin-top: 3px; font-size: 10px; letter-spacing: .18em; }
.nav-label { padding: 0 12px; margin: 6px 0 10px; color: #88a295; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.nav-list { display: grid; gap: 5px; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; padding: 11px 12px; text-align: left; color: #c4d4ca; background: transparent; cursor: pointer; transition: background .16s ease, color .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: var(--green); background: #eff5e9; font-weight: 700; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-badge { margin-left: auto; min-width: 21px; padding: 2px 6px; border-radius: 20px; color: #3f271d; background: #ffc28f; font-size: 10px; font-weight: 800; text-align: center; }
.records-panel { overflow: hidden; }
.records-scroll { overflow-x: auto; }
.records-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
.records-table th { padding: 11px 16px; color: #89948c; background: #f8faf7; font-size: 10px; font-weight: 700; white-space: nowrap; }
.records-table td { max-width: 280px; padding: 12px 16px; border-top: 1px solid #eef1ed; color: #637168; vertical-align: middle; }
.records-table td strong { color: var(--ink); }
.records-table td:last-child { text-align: right; white-space: nowrap; }
.muted { color: #9aa39d; font-size: 10px; }
.report-filter { display: flex; align-items: end; gap: 10px; margin: -8px 0 18px; padding: 12px 14px; border: 1px solid #e6ebe5; border-radius: 10px; background: #fff; }
.report-filter label { display: grid; gap: 5px; color: #77827c; font-size: 10px; }
.report-filter input { min-height: 32px; padding: 0 8px; border: 1px solid #e1e8e1; border-radius: 7px; color: var(--ink); background: #fff; font-size: 11px; }
.report-metrics { margin-bottom: 17px; }
.report-metric { min-height: 94px; }
.report-metric .metric-value { margin-top: 11px; font-size: 22px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 17px; }
.refund-status { display: inline-flex; padding: 4px 8px; border-radius: 20px; color: #718078; background: #eef1ee; font-size: 10px; }
.refund-success { color: #47704e; background: #edf5eb; }
.refund-processing { color: #8b6840; background: #fbf3e2; }
.refund-failed { color: #9c4f3b; background: #fff0e8; }
.config-stations { margin-bottom: 15px; }
.config-chip-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }
.config-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e4ebe3; border-radius: 8px; color: #43594a; background: #f7faf6; font-size: 10px; }
.config-chip small { color: #8d9a91; font-size: 9px; }
.config-chip-action { padding: 0; border: 0; color: var(--green-2); background: none; font-size: 9px; cursor: pointer; }
.config-chip-action:hover { text-decoration: underline; }
.item-chip em { color: #a06b42; font-style: normal; }
.refund-order-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding: 11px 12px; border-radius: 8px; background: #f7f8f5; font-size: 11px; }
.refund-order-summary span { color: #8a958d; font-size: 10px; }
.store-check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.store-check-list .check-field { margin: 0; padding: 7px 9px; border: 1px solid #e2e9e2; border-radius: 7px; background: #fafcf9; }
.staff-state { color: #a76454; font-size: 10px; }
.staff-state.is-active { color: #4e7b56; }
.dish-image-editor { display: flex; align-items: start; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.dish-image-preview { display: grid; place-items: center; flex: 0 0 104px; width: 104px; height: 104px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--muted); font-size: 12px; }
.dish-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.dish-image-preview [hidden] { display: none; }
.dish-image-fields { flex: 1 1 220px; min-width: 0; }
.dish-image-fields input[type="file"] { height: auto; padding: 9px; max-width: 100%; }
.dish-image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.date-search { display: flex; min-height: 36px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #e4e9e4; border-radius: 8px; color: #77827c; background: #fff; font-size: 10px; white-space: nowrap; }
.date-search input { min-width: 120px; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; }
.sales-panel { margin-top: 17px; }
.sales-ranking { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.sales-row { min-height: 42px; display: grid; grid-template-columns: 22px minmax(90px, 1fr) auto auto; align-items: center; gap: 10px; border-top: 1px solid #eff1ee; font-size: 11px; }
.sales-row:first-child, .sales-row:nth-child(2) { border-top: 0; }
.sales-rank { color: #a98c53; font-family: Georgia, serif; font-size: 15px; }
.sales-row > span:not(.sales-rank) { color: #87938a; font-size: 10px; }
.sales-row .sales-amount { color: #3d5d4c; font-weight: 700; white-space: nowrap; }
.qr-modal { width: min(980px, 100%); }
.qr-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-height: 65vh; overflow-y: auto; padding: 18px 22px; }
.qr-card { min-width: 0; display: grid; justify-items: center; margin: 0; padding: 12px; border: 1px solid #e8ece8; border-radius: 10px; background: #fff; break-inside: avoid; }
.qr-card img { width: min(100%, 190px); aspect-ratio: 1; object-fit: contain; }
.qr-card figcaption { display: grid; gap: 3px; margin-top: 6px; text-align: center; }
.qr-card figcaption strong { color: var(--ink); font-size: 12px; }
.qr-card figcaption span { color: var(--muted); font-size: 9px; }
.qr-actions { align-items: center; justify-content: space-between; }
.sidebar-spacer { flex: 1; }
.sidebar-note { margin: 10px 4px 17px; padding: 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.055); }
.sidebar-note-title { color: #eaf1e8; font-family: Georgia, "Songti SC", serif; font-size: 14px; }
.sidebar-note-text { margin-top: 7px; color: #9bb5a7; font-size: 11px; line-height: 1.65; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.14); }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: #d5e2d7; font-size: 12px; font-weight: 800; }
.user-info { min-width: 0; flex: 1; }
.user-name { overflow: hidden; color: #f1f7f1; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-role { margin-top: 3px; color: #93ac9f; font-size: 10px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #b7cabe; background: transparent; cursor: pointer; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.1); }
.icon-button svg { width: 16px; height: 16px; }
.mobile-brandbar { display: none; }

.main { min-height: 100vh; margin-left: 248px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 42px; border-bottom: 1px solid #eaede9; background: rgba(255,255,255,.72); }
.crumb { color: var(--muted); font-size: 12px; }
.crumb b { color: var(--ink); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.store-switcher { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 9px 0 11px; border: 1px solid #dfe8df; border-radius: 8px; color: #718078; background: #fff; font-size: 10px; }
.store-switcher select { max-width: 180px; border: 0; outline: 0; color: #345849; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.store-add-button { white-space: nowrap; }
.sync-state { display: flex; align-items: center; gap: 7px; color: #7b8981; font-size: 11px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #68a675; box-shadow: 0 0 0 3px #e5f0e6; }
.top-date { padding-left: 14px; border-left: 1px solid var(--line); color: #79847e; font-size: 11px; }
.content { max-width: 1540px; margin: 0 auto; padding: 34px 42px 52px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 7px; color: #7f8a83; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(27px, 3vw, 35px); font-weight: 500; letter-spacing: -.035em; }
.heading-sub { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: #fff; background: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { background: #245544; box-shadow: 0 6px 15px rgba(23,61,50,.15); transform: translateY(-1px); }
.button svg { width: 15px; height: 15px; }
.button-secondary { color: #345849; border-color: #dce5dc; background: #fff; }
.button-secondary:hover { color: var(--green); background: #f7faf6; box-shadow: none; }
.button-quiet { min-height: 32px; padding: 0 10px; color: #66756c; border-color: transparent; background: transparent; }
.button-quiet:hover { color: var(--green); background: #edf3ed; box-shadow: none; }
.button-danger { color: var(--red); border-color: #f0d8d4; background: #fff; }
.button-danger:hover { background: var(--red-soft); box-shadow: none; }
.button-small { min-height: 30px; padding: 0 10px; border-radius: 7px; font-size: 11px; }
.text-button { border: 0; padding: 0; color: var(--green-2); background: none; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button:hover { text-decoration: underline; }

.hero-panel { position: relative; overflow: hidden; min-height: 146px; display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 20px; padding: 26px 30px; border-radius: 14px; color: #eff7ed; background: #214839; }
.hero-panel::after { content: ""; position: absolute; width: 210px; height: 210px; top: -104px; right: 16%; border: 1px solid rgba(221,239,196,.18); border-radius: 50%; box-shadow: 0 0 0 23px rgba(221,239,196,.035), 0 0 0 47px rgba(221,239,196,.03); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.hero-kicker { margin-bottom: 8px; color: #c0d8ae; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.hero-title { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(19px, 2vw, 24px); font-weight: 500; letter-spacing: .01em; }
.hero-caption { margin: 8px 0 0; color: #b7cabe; font-size: 12px; line-height: 1.65; }
.hero-cta { position: relative; z-index: 1; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.hero-panel .button { color: #224639; background: #ddecbe; }
.hero-panel .button:hover { background: #e8f4d1; }
.hero-quiet { color: #e8f2e8; }
.hero-quiet:hover { color: #fff; background: rgba(255,255,255,.09); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-card { min-height: 126px; padding: 18px 19px; border: 1px solid #e8ece8; border-radius: 12px; background: var(--paper); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { color: #7c8780; font-size: 11px; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #3d6f53; background: #edf4ec; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { margin-top: 13px; font-family: Georgia, "Songti SC", serif; font-size: 26px; letter-spacing: -.03em; }
.metric-meta { margin-top: 4px; color: #a0aaa3; font-size: 10px; }
.metric-warm .metric-icon { color: #ac6942; background: #fbf0e7; }
.metric-blue .metric-icon { color: #52778b; background: #edf3f6; }
.metric-lime .metric-icon { color: #638044; background: #f2f5e8; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(285px, .9fr); gap: 17px; align-items: start; }
.panel { border: 1px solid #e8ece8; border-radius: 12px; background: var(--paper); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 14px; }
.panel-title { margin: 0; font-size: 13px; font-weight: 800; }
.panel-subtitle { margin: 5px 0 0; color: #9aa39d; font-size: 10px; }
.panel-body { padding: 0 20px 18px; }
.order-list { display: grid; }
.order-row { min-height: 59px; display: grid; grid-template-columns: minmax(100px, 1fr) minmax(92px, .8fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #eff1ee; }
.order-row:first-child { border-top: 0; }
.order-id { font-size: 11px; font-weight: 800; }
.order-meta { margin-top: 4px; color: #9aa39d; font-size: 10px; }
.order-items { overflow: hidden; color: #748078; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.order-amount { font-size: 12px; font-weight: 800; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 5px 8px; border-radius: 30px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pending { color: #a75f31; background: #fff1e3; }
.status-accepted { color: #5e7484; background: #eff3f5; }
.status-preparing { color: #567d8f; background: #edf4f7; }
.status-served { color: #5b7544; background: #eff4e7; }
.status-completed { color: #718078; background: #eef1ee; }
.status-cancelled { color: #b45f56; background: #fff0ed; }
.status-rejected { color: #b45f56; background: #fff0ed; }
.status-unknown { color: #6b7780; background: #eef1f2; }
.table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.table-card { min-height: 87px; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; border: 1px solid #e8ece8; border-radius: 10px; background: #fff; }
.table-card.occupied { border-color: #e5d8c6; background: #fffaf2; }
.table-card.ready-to-clear { border-color: #cfe2c6; background: #f8fcf5; }
.table-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; }
.table-name { font-family: Georgia, "Songti SC", serif; font-size: 16px; }
.table-zone { margin-top: 4px; color: #9aa39d; font-size: 9px; }
.table-due { color: #8d6747; font-size: 11px; font-weight: 800; }
.table-occupancy { color: #87928a; font-size: 9px; }
.table-occupied-label { color: #aa703d; font-size: 9px; font-weight: 700; }
.table-occupied-label.ready { color: #4f7d55; }
.table-occupied-label.payment { color: #9a7040; }
.panel-footer { display: flex; justify-content: center; padding: 12px 18px; border-top: 1px solid #eff1ee; }
.empty-state { display: grid; place-items: center; min-height: 135px; color: #99a39c; text-align: center; }
.empty-mark { width: 35px; height: 35px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 12px; color: #6a8b72; background: #eef4ec; font-size: 16px; }
.empty-title { margin-bottom: 4px; color: #526158; font-size: 11px; font-weight: 700; }
.empty-copy { color: #9ca69f; font-size: 10px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid #e8ece8; border-radius: 9px; background: #fff; }
.tab { min-height: 29px; padding: 0 11px; border: 0; border-radius: 6px; color: #849088; background: transparent; font-size: 10px; cursor: pointer; }
.tab:hover { color: var(--green); }
.tab.active { color: #fff; background: var(--green); font-weight: 700; }
.search-box { width: min(245px, 40vw); min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #e4e9e4; border-radius: 8px; color: #9ba59e; background: #fff; }
.search-box svg { width: 14px; height: 14px; flex: 0 0 14px; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-box input::placeholder { color: #a3aca6; }
.order-cards { display: grid; gap: 10px; }
.order-card { padding: 17px 18px; border: 1px solid #e8ece8; border-radius: 11px; background: #fff; }
.order-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-card-main { min-width: 0; }
.order-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.order-card-title strong { font-size: 13px; }
.order-card-meta { margin-top: 5px; color: #98a19b; font-size: 10px; }
.order-card-total { flex: 0 0 auto; font-family: Georgia, "Songti SC", serif; font-size: 18px; }
.order-items-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; padding: 11px 12px; border-radius: 8px; background: #f7f8f5; }
.item-chip { color: #647169; font-size: 10px; }
.item-chip strong { margin-left: 3px; color: #36463c; }
.order-note { margin: 10px 0 0; color: #a06b42; font-size: 10px; }
.print-status-list { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-top: 12px; }
.print-status-row { display: inline-flex; align-items: center; gap: 5px; }
.print-status { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 20px; color: #68766d; background: #f0f3ef; font-size: 10px; }
.print-sent { color: #47704e; background: #edf5eb; }
.print-failed, .print-uncertain { color: #9c4f3b; background: #fff0e8; }
.print-waiting_config { color: #8b6840; background: #fbf3e2; }
.print-agent_claimed { color: #5b6887; background: #eef1fa; }
.print-retry { padding: 2px 4px; font-size: 10px; }
.printer-setup-banner .printer-agent-state { align-self: center; flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; color: #47704e; background: #edf5eb; font-size: 12px; font-weight: 700; }
.printer-setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -3px 0 15px; padding: 12px 15px; border: 1px solid #ecdcc4; border-radius: 9px; background: #fffaf1; }
.printer-setup-banner > div:first-child { display: grid; gap: 4px; }
.printer-setup-banner strong { color: #6d5639; font-size: 11px; }
.printer-setup-banner span { color: #8b8170; font-size: 10px; line-height: 1.5; }
.printer-setup-banner.printer-ready { border-color: #dce9dc; background: #f5faf3; }
.printer-setup-banner.printer-ready strong { color: #43634b; }
.agent-token-result { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; padding: 12px; border: 1px solid #e5d7c4; border-radius: 8px; background: #fbf7ef; }
.agent-token-result code { flex: 1; overflow-wrap: anywhere; color: #594a3a; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.printer-setup-banner.printer-ready span { color: #718171; }
.printer-test-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; }
.order-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #f0f2ef; }
.order-actions { display: flex; align-items: center; gap: 7px; }

.table-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.table-admin-card { min-height: 170px; padding: 17px; border: 1px solid #e6ebe5; border-radius: 11px; background: #fff; }
.table-admin-card.is-occupied { background: linear-gradient(145deg, #fff 40%, #fff8ed); border-color: #eadfce; }
.table-admin-card.is-ready-to-clear { background: linear-gradient(145deg, #fff 40%, #f3faef); border-color: #d3e5cc; }
.table-admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.table-admin-name { font-family: Georgia, "Songti SC", serif; font-size: 20px; }
.table-admin-zone { margin-top: 5px; color: #98a39b; font-size: 10px; }
.table-admin-due { margin-top: 20px; color: #7a877e; font-size: 10px; }
.table-admin-due strong { display: block; margin-top: 4px; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }
.table-admin-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.table-state { display: inline-flex; align-items: center; gap: 6px; color: #738077; font-size: 10px; }
.table-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9ca89f; }
.table-state.busy { color: #a37043; }
.table-state.busy::before { background: #d68a4d; }
.table-state.ready { color: #4f7d55; }
.table-state.ready::before { background: #72a16f; }
.table-state.payment { color: #9a7040; }
.table-state.payment::before { background: #d19a55; }
.table-state.disabled { color: #b3b9b4; }
.table-state.disabled::before { background: #c6cbc7; }
.table-inline-actions { display: flex; gap: 3px; }
.section-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; padding: 13px 16px; border: 1px solid #e6ebe5; border-radius: 10px; background: #fff; }
.section-banner-title { font-size: 11px; font-weight: 800; }
.section-banner-copy { margin-top: 4px; color: #9aa39d; font-size: 10px; }
.notice-strip { display: flex; align-items: center; gap: 12px; margin: -5px 0 19px; padding: 11px 14px; border: 1px solid #e8e9dc; border-radius: 9px; background: #fbfbf5; }
.notice-strip > span { flex: 0 0 auto; color: #8c7942; font-size: 10px; font-weight: 800; }
.notice-strip p { min-width: 0; flex: 1; overflow: hidden; margin: 0; color: #777762; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.menu-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 15px; align-items: start; }
.category-panel { padding: 15px 12px; }
.category-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; }
.category-head strong { font-size: 11px; }
.category-list { display: grid; gap: 3px; }
.category-row { display: flex; align-items: center; gap: 3px; }
.category-select { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 0; border-radius: 7px; padding: 9px 8px; color: #78847b; background: transparent; text-align: left; font-size: 10px; cursor: pointer; }
.category-select:hover { background: #f4f7f2; }
.category-select.active { color: var(--green); background: #edf4ed; font-weight: 800; }
.category-count { color: #a2aaa4; font-size: 9px; }
.category-tools { display: flex; gap: 0; opacity: .2; transition: opacity .14s ease; }
.category-row:hover .category-tools, .category-row:focus-within .category-tools { opacity: 1; }
.tiny-icon { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 5px; color: #89948c; background: transparent; cursor: pointer; }
.tiny-icon:hover { color: var(--green); background: #edf3ed; }
.tiny-icon svg { width: 13px; height: 13px; }
.dish-list { display: grid; gap: 8px; }
.dish-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid #e7ebe6; border-radius: 10px; background: #fff; }
.dish-photo { width: 72px; height: 68px; overflow: hidden; display: grid; place-items: center; border-radius: 8px; color: #87948a; background: #eff2ed; }
.dish-photo img { width: 100%; height: 100%; object-fit: cover; }
.dish-photo-placeholder { font-family: Georgia, serif; font-size: 20px; }
.dish-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; font-weight: 800; }
.dish-description { overflow: hidden; margin: 5px 0 7px; color: #9ca69f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dish-price { color: #385444; font-size: 10px; font-weight: 700; }
.dish-price span { margin-right: 8px; color: #8a968e; font-weight: 500; }
.dish-actions { display: flex; align-items: center; gap: 4px; }
.availability { display: inline-flex; align-items: center; gap: 5px; color: #688251; font-size: 9px; font-weight: 700; }
.availability::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #86a665; }
.availability.off { color: #a7aaa4; }
.availability.off::before { background: #b7bdb8; }
.menu-count { color: #9ba69e; font-size: 10px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); background: #f3f4ef; }
.login-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(35px, 6vw, 78px); color: #eff6ed; background: var(--green); }
.login-aside::before, .login-aside::after { content: ""; position: absolute; width: 370px; height: 370px; right: -70px; bottom: -130px; border: 1px solid rgba(227,243,209,.18); border-radius: 50%; box-shadow: 0 0 0 34px rgba(227,243,209,.04), 0 0 0 72px rgba(227,243,209,.035); }
.login-aside::after { width: 170px; height: 170px; right: 90px; bottom: 24px; border-color: rgba(227,243,209,.12); box-shadow: 0 0 0 21px rgba(227,243,209,.025); }
.login-aside-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-aside-copy { position: relative; z-index: 1; max-width: 560px; margin: auto 0; padding: 70px 0; }
.login-aside-kicker { margin-bottom: 18px; color: #bfd9ad; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.login-aside-title { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 4.8vw, 56px); font-weight: 500; line-height: 1.25; letter-spacing: -.04em; }
.login-aside-text { max-width: 400px; margin: 18px 0 0; color: #b6cbbd; font-size: 13px; line-height: 1.85; }
.login-aside-foot { position: relative; z-index: 1; color: #8da698; font-size: 10px; letter-spacing: .08em; }
.login-main { display: grid; place-items: center; padding: 36px; }
.login-card { width: min(390px, 100%); }
.login-card h1 { margin-bottom: 9px; font-size: 28px; }
.login-copy { margin: 0 0 31px; color: #8b968f; font-size: 12px; line-height: 1.7; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { color: #506057; font-size: 11px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #e1e7e1; border-radius: 8px; color: var(--ink); background: #fff; font-size: 12px; }
.field input, .field select { height: 42px; min-height: 42px; padding: 0 12px; }
.field textarea { min-height: 78px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: #b0b8b2; }
.field-hint { color: #9ca69f; font-size: 9px; line-height: 1.5; }
.check-field { display: flex; align-items: center; gap: 9px; margin: 2px 0 18px; color: #506057; font-size: 11px; font-weight: 700; cursor: pointer; }
.check-field input { width: 15px; height: 15px; accent-color: var(--green-2); }
.dish-editor-section { margin: 21px 0 18px; padding-top: 16px; border-top: 1px solid #edf0ec; }
.dish-editor-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.dish-editor-section-head > div { display: grid; gap: 4px; min-width: 0; }
.dish-editor-section-head strong { color: #506057; font-size: 11px; }
.dish-editor-section-head span { color: #9ca69f; font-size: 9px; }
.dish-variant-list, .dish-option-list { display: grid; gap: 7px; }
.dish-variant-head, .dish-variant-row { display: grid; grid-template-columns: minmax(115px, 1.4fr) repeat(2, minmax(80px, .8fr)) 28px; gap: 7px; align-items: center; }
.dish-variant-head { padding: 0 31px 1px 2px; color: #89968d; font-size: 9px; }
.dish-variant-row input, .dish-option-row input { min-width: 0; min-height: 38px; width: 100%; border: 1px solid #e1e7e1; border-radius: 8px; padding: 9px 10px; color: var(--ink); background: #fff; font-size: 11px; }
.dish-variant-row input:focus, .dish-option-row input:focus { border-color: #a9c7ad; outline: 2px solid rgba(91, 137, 101, .12); }
.dish-option-row { display: grid; grid-template-columns: minmax(115px, .75fr) minmax(0, 1.25fr) 28px; gap: 7px; align-items: center; }
.dish-editor-remove { width: 28px; height: 28px; border: 0; border-radius: 6px; color: #9ca69f; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.dish-editor-remove:hover { color: #a85e53; background: #fbefec; }
.dish-editor-empty { margin: 0; padding: 12px; border: 1px dashed #dfe7df; border-radius: 8px; color: #9ca69f; background: #fbfcfa; font-size: 10px; text-align: center; }
.login-submit { width: 100%; min-height: 44px; margin-top: 6px; font-size: 12px; }
.login-error { display: none; margin: -14px 0 15px; color: #b65248; font-size: 11px; }
.login-error.visible { display: block; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(18,34,26,.43); backdrop-filter: blur(3px); }
.modal { width: min(540px, 100%); max-height: min(90vh, 800px); overflow-y: auto; border: 1px solid rgba(255,255,255,.65); border-radius: 13px; background: #fff; box-shadow: 0 25px 90px rgba(14,31,21,.24); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px 23px 16px; border-bottom: 1px solid #edf0ec; }
.modal-head h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 500; }
.modal-head p { margin: 5px 0 0; color: #929c95; font-size: 10px; line-height: 1.5; }
.modal-close { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #89938c; background: transparent; font-size: 18px; cursor: pointer; }
.modal-close:hover { color: var(--ink); background: #f3f5f2; }
.modal-form { padding: 18px 23px 21px; }
.modal-form .field:last-of-type { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.template-editor-modal { width: min(980px, 100%); }
.template-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, .78fr); gap: 22px; align-items: start; }
.template-editor-fields { min-width: 0; }
.template-setting-section { padding: 15px 0 1px; border-top: 1px solid #edf0ec; }
.template-setting-section:first-child { padding-top: 0; border-top: 0; }
.template-setting-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.template-setting-heading strong { color: #345849; font-size: 12px; }
.template-setting-heading span { color: #9aa39d; font-size: 9px; }
.template-toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 1px; }
.template-toggle-grid .template-toggle { min-height: 35px; margin: 0; padding: 7px 9px; border: 1px solid #e5ebe4; border-radius: 7px; color: #53645a; background: #fafcf9; font-size: 10px; font-weight: 600; }
.template-toggle-grid .template-toggle:hover { border-color: #cfded0; background: #f4f9f2; }
.template-style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.template-preview-panel { position: sticky; top: 0; min-width: 0; padding: 13px; border: 1px solid #e5ebe4; border-radius: 12px; background: #f7f9f5; }
.template-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.template-preview-head > div { display: grid; gap: 4px; }
.template-preview-head strong { color: #345849; font-size: 12px; }
.template-preview-head span { color: #98a39a; font-size: 9px; }
.template-preview-meta { padding: 4px 7px; border-radius: 999px; color: #69806e !important; background: #eaf2e8; white-space: nowrap; }
.template-preview-stage { display: flex; justify-content: center; min-height: 320px; padding: 14px 9px; border: 1px solid #e6ebe4; border-radius: 9px; background: #edf1eb; overflow-x: auto; }
.template-preview-slot { display: flex; justify-content: center; width: 80mm; min-width: 80mm; flex: 0 0 80mm; }
.receipt-preview-paper { width: 80mm; min-width: 80mm; padding: 15px 9px 22px; border: 1px solid #ece5d8; color: #292c28; background: #fffdfa; box-shadow: 0 9px 22px rgba(54, 61, 50, .13); font-family: "Noto Sans Mono CJK SC", "Sarasa Mono SC", "SFMono-Regular", Consolas, monospace; font-size: var(--receipt-font-size, 11px); line-height: 1.45; }
.receipt-preview-line { min-height: 1.45em; overflow-wrap: anywhere; white-space: pre-wrap; word-break: break-all; }
.receipt-preview-centered { text-align: center; }
.receipt-preview-store { margin-bottom: 1px; font-size: 1.28em; letter-spacing: .04em; }
.receipt-preview-title { margin-bottom: 7px; font-size: 1.03em; }
.receipt-preview-right { text-align: right; }
.receipt-preview-columns { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; min-height: 1.45em; }
.receipt-preview-columns > span:first-child { min-width: 0; overflow-wrap: anywhere; word-break: break-all; }
.receipt-preview-columns > span:last-child { white-space: nowrap; text-align: right; }
.receipt-preview-summary > span:last-child { font-weight: 700; }
.receipt-preview-columns-heading { margin-bottom: 3px; color: #72786f; font-size: .88em; }
.receipt-preview-item-main { margin-top: 3px; }
.receipt-preview-item-detail { padding-left: 18px; color: #667068; font-size: .92em; }
.receipt-preview-kitchen-item { font-weight: 700; font-size: 1.07em; }
.receipt-preview-summary { margin-top: 4px; font-size: 1.04em; }
.receipt-preview-line.is-bold { font-weight: 700; }
.receipt-preview-line.is-double-width { transform: scaleX(1.25); transform-origin: center; }
.receipt-preview-line.is-double-height { margin: .15em 0; font-size: 1.45em; line-height: 1.15; }
.receipt-preview-separator { width: 100%; color: transparent; border-bottom: 1px dashed #a3aba1; letter-spacing: .04em; }
.receipt-preview-footer { margin-top: 4px; color: #70786f; }
.receipt-preview-custom { color: #5c6d61; }
.template-preview-note { margin: 10px 1px 0; color: #929c94; font-size: 9px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid #edf0ec; }
.modal-note { margin: -6px 0 14px; color: #959f98; font-size: 10px; line-height: 1.6; }
.toast-layer { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(370px, calc(100vw - 36px)); display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid #dfe8dc; border-radius: 9px; color: #345344; background: #fff; box-shadow: 0 12px 35px rgba(19,44,31,.13); font-size: 11px; animation: toast-in .18s ease-out; }
.toast::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #70a576; }
.toast.error { color: #a34f46; border-color: #f0d9d4; }
.toast.error::before { background: #c26c61; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: translateY(0); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 1180px) {
  .content { padding-inline: 27px; }
  .topbar { padding-inline: 27px; }
  .table-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { gap: 9px; }
  .metric-card { padding-inline: 14px; }
}
@media (max-width: 940px) {
  .sidebar { width: 206px; }
  .main { margin-left: 206px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .table-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .menu-layout { grid-template-columns: 185px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .sidebar { width: auto; height: 65px; inset: auto 0 0; flex-direction: row; align-items: stretch; padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid rgba(255,255,255,.16); box-shadow: 0 -5px 25px rgba(17,42,31,.13); }
  .brand, .nav-label, .sidebar-note, .sidebar-footer { display: none; }
  .sidebar-spacer { display: none; }
  .nav-list { width: 100%; display: grid; grid-template-columns: repeat(var(--nav-count, 4), minmax(0, 1fr)); align-items: stretch; gap: 3px; }
  .nav-item { flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; border-radius: 8px; font-size: 9px; }
  .nav-icon, .nav-icon svg { width: 17px; height: 17px; }
  .nav-badge { position: absolute; transform: translate(16px, -12px); min-width: 16px; padding: 1px 4px; font-size: 8px; }
  .main { margin-left: 0; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .topbar { height: 58px; padding: 0 17px; }
  .topbar-right { gap: 8px; }
  .store-switcher { max-width: 130px; padding-inline: 7px; }
  .store-switcher span { display: none; }
  .store-switcher select { max-width: 112px; font-size: 10px; }
  .store-add-button { display: none; }
  .sync-state { font-size: 0; }
  .sync-dot { width: 8px; height: 8px; }
  .top-date { padding-left: 9px; font-size: 9px; }
  .content { padding: 23px 16px 30px; }
  .page-heading { align-items: flex-start; margin-bottom: 18px; }
  .page-heading h1 { font-size: 27px; }
  .heading-sub { max-width: 235px; line-height: 1.5; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .heading-actions .button { min-height: 34px; padding: 0 10px; font-size: 10px; }
  .hero-panel { align-items: flex-start; flex-direction: column; min-height: 0; padding: 20px; }
  .hero-panel::after { right: -68px; top: -119px; }
  .hero-title { font-size: 19px; }
  .hero-caption { max-width: 300px; font-size: 10px; }
  .hero-cta { width: 100%; }
  .hero-cta .button { min-height: 34px; font-size: 10px; }
  .metric-card { min-height: 111px; padding: 14px; }
  .metric-value { font-size: 23px; }
  .metric-label { font-size: 10px; }
  .metric-icon { width: 25px; height: 25px; }
  .panel-header { padding: 15px 14px 12px; }
  .panel-body { padding: 0 14px 14px; }
  .order-row { grid-template-columns: minmax(80px, 1fr) auto auto; gap: 8px; }
  .order-items { display: none; }
  .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { flex: 0 0 auto; }
  .search-box { width: 100%; }
  .date-search { justify-content: space-between; }
  .date-search input { flex: 1; }
  .order-card { padding: 14px; }
  .order-card-footer { align-items: flex-start; flex-direction: column; }
  .order-actions { width: 100%; justify-content: flex-end; }
  .table-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .table-admin-card { min-height: 157px; padding: 13px; }
  .table-admin-name { font-size: 17px; }
  .table-admin-due strong { font-size: 19px; }
  .section-banner { align-items: flex-start; flex-direction: column; }
  .records-table { min-width: 660px; }
  .report-filter { align-items: stretch; flex-direction: column; }
  .report-filter label { width: 100%; }
  .report-filter input { width: 100%; }
  .report-grid { grid-template-columns: 1fr; }
  .sales-ranking { grid-template-columns: 1fr; }
  .sales-row:nth-child(2) { border-top: 1px solid #eff1ee; }
  .qr-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .menu-layout { grid-template-columns: 1fr; }
  .category-panel { padding: 12px; }
  .category-list { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .category-row { flex: 0 0 auto; }
  .category-select { min-height: 32px; white-space: nowrap; }
  .category-tools { display: none; }
  .dish-card { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .dish-photo { width: 56px; height: 56px; }
  .dish-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 4px; border-top: 1px solid #f0f2ef; }
  .dish-variant-head { display: none; }
  .dish-variant-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px; }
  .dish-variant-row input[name="variantName"] { grid-column: 1 / -1; }
  .dish-option-row { grid-template-columns: minmax(0, 1fr) 28px; }
  .dish-option-row input[name="optionValues"] { grid-column: 1 / -1; }
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { min-height: 100vh; padding: 26px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { max-height: 88vh; border-radius: 15px 15px 0 0; }
  .modal-head { padding: 18px 18px 14px; }
  .modal-form { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
  .toast-layer { top: 10px; right: 10px; left: 10px; }
  .toast { max-width: none; }
}

@media (max-width: 760px) {
  .printer-setup-banner { align-items: flex-start; flex-direction: column; gap: 10px; }
  .printer-test-actions { width: 100%; }
  .template-editor-layout { grid-template-columns: 1fr; gap: 17px; }
  .template-preview-panel { position: static; }
}
@media (max-width: 390px) {
  .metric-grid { gap: 7px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 21px; }
  .table-admin-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .template-toggle-grid, .template-style-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body * { visibility: hidden !important; }
  .qr-modal, .qr-modal * { visibility: visible !important; }
  .modal-backdrop { position: absolute; inset: 0; display: block; padding: 0; background: #fff; }
  .qr-modal { width: 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; }
  .qr-modal .modal-head { padding: 8px 0 14px; }
  .qr-modal .qr-gallery { max-height: none; overflow: visible; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
  .qr-card { border-color: #d5d5d5; }
  .no-print, .qr-actions { display: none !important; }
}
