:root {
  color-scheme: light;
  --ink: #20342e;
  --muted: #617067;
  --green: #143c31;
  --green2: #276348;
  --edge: #dce3da;
  --surface: #fffefa;
  --bg: #f4f5ef;
  font-family: Inter,"Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, p {
  margin: 0;
}

button, input, select {
  font: inherit;
}

button, a, select, input {
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .52;
  cursor: wait;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #bd7038;
  outline-offset: 3px;
}

i[data-icon], .icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: fixed;
  z-index: 10;
  left: 8px;
  top: -100px;
  background: white;
  padding: 7px;
}

.skip:focus {
  top: 4px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 212px minmax(0,1fr);
}

.side {
  background: #173b31;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 16px 21px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 9px 54px;
  font-size: 23px;
  font-weight: 740;
  letter-spacing: -1.2px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: #b4cbbd;
  font-size: 12px;
  letter-spacing: 1.75px;
  font-weight: 550;
  margin-top: 6px;
}

.brandmark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 43px;
  color: #e8f2d5;
}

.brandmark svg {
  width: 39px;
  height: 39px;
  stroke-width: 1.9;
}

.side nav {
  display: grid;
  gap: 7px;
}

.side nav button {
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 8px;
  padding: 11px 15px;
  background: transparent;
  color: #c8d7ce;
  min-height: 46px;
  font-weight: 550;
}

.side nav button:hover {
  background: #ffffff13;
  color: white;
}

.side nav button[aria-current] {
  background: #d8e9b7;
  color: #173c30;
  font-weight: 750;
}

.side nav svg {
  width: 19px;
  height: 19px;
}

.session {
  border-top: 1px solid #426053;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 21px 10px 0;
  color: #dbe7de;
  font-size: 13px;
  font-weight: 650;
}

.session small {
  display: block;
  color: #afc4b8;
  font-weight: 400;
  margin-top: 2px;
  font-size: 11px;
}

.lamp {
  background: #b9dc8d;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.workspace {
  min-width: 0;
}

.bar {
  min-height: 67px;
  border-bottom: 1px solid var(--edge);
  background: #fafbf6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(20px,3.6vw,65px);
  gap: 12px;
}

.crumb {
  font-size: 13px;
  color: var(--muted);
}

.crumb span {
  margin: 0 10px;
  color: #a5afa5;
}

.crumb b {
  font-weight: 600;
  color: #414d44;
}

#kiosk-link, .primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  border: 1px solid var(--green);
  color: white;
  border-radius: 7px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 650;
  min-height: 40px;
}

#kiosk-link:hover, .primary:hover {
  background: #295744;
}

#kiosk-link svg {
  width: 16px;
  height: 16px;
}

main {
  max-width: 1540px;
  margin: 0 auto;
  padding: 30px clamp(20px,3.6vw,65px) 54px;
}

.title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}

.eyebrow {
  font-family: Arial,sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .19em;
  color: #567251;
  margin-bottom: 4px;
}

h1 {
  font-size: clamp(26px,3vw,40px);
  line-height: 1.16;
  letter-spacing: -.04em;
  font-weight: 780;
}

h2 {
  font-size: 19px;
  letter-spacing: -.03em;
  line-height: 1.35;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
}

.filters {
  display: flex;
  align-items: center;
  gap: 9px;
}

.filters label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

select, .icon-btn, .secondary, .search, input[type=number] {
  border: 1px solid #cbd5c9;
  background: var(--surface);
  border-radius: 7px;
  color: var(--ink);
  min-height: 40px;
  padding: 6px 10px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  padding: 0;
}

.secondary {
  font-size: 13px;
  font-weight: 600;
}

.icon-btn:hover, .secondary:hover {
  background: #eaf0e2;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat, .panel, .meal-card {
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--surface);
}

.stat {
  padding: 16px 17px;
  min-width: 0;
}

.stat .label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #59685c;
  font-size: 13px;
  font-weight: 600;
}

.stat svg {
  width: 17px;
  height: 17px;
}

.stat strong {
  font-size: clamp(22px,2.45vw,37px);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -.045em;
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.stat strong small {
  font-size: .42em;
  letter-spacing: 0;
  margin-right: .25em;
}

.stat:first-child {
  background: #e5edcf;
  border-color: #d6e2b8;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0,1.04fr) minmax(260px,.9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel-top, .section-top, .rank, .sum, .line, .dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-top {
  margin-bottom: 15px;
}

.panel-top small, .hint, .light, small {
  color: var(--muted);
}

.panel-top small {
  font-size: 12px;
}

.text-link {
  border: 0;
  min-height: 36px;
  background: transparent;
  color: #365d43;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 0;
}

.text-link:hover {
  text-decoration: underline;
}

.rank {
  padding: 8px 0;
  border-top: 1px solid #e9ece4;
}

.rank:first-child {
  border: 0;
}

.rank .info, .line .info {
  min-width: 0;
  flex: 1;
}

.rank .title, .line strong {
  display: block;
  font-weight: 650;
}

.rank small, .line small {
  display: block;
  font-size: 12px;
}

.rank b {
  white-space: nowrap;
  font-size: 14px;
  color: #405e4b;
}

.thumb {
  display: block;
  width: 54px;
  height: 51px;
  object-fit: cover;
  border-radius: 7px;
  background: #e9eddf;
  flex-shrink: 0;
}

.bars {
  height: 168px;
  border-bottom: 1px solid #bcc9bd;
  display: flex;
  gap: clamp(3px,1.7vw,26px);
  align-items: end;
  padding: 0 6px;
  background: repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#e4e9df calc(25% - 1px),#e4e9df 25%);
}

.barcol {
  height: 100%;
  position: relative;
  flex: 1;
  display: flex;
  align-items: end;
  justify-content: center;
}

.barcol span {
  width: min(100%,48px);
  background: #5e8165;
  border-radius: 4px 4px 0 0;
  min-height: 1px;
}

.barcol:last-child span {
  background: #294e39;
}

.chart-labels {
  display: flex;
  justify-content: space-around;
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0 8px;
  gap: 4px;
}

.chart-labels span {
  min-width: 0;
  text-align: center;
  flex: 1;
}

.hint {
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

th, td {
  white-space: nowrap;
  padding: 10px 8px;
  border-bottom: 1px solid #e4e9df;
}

th {
  background: #f2f5ec;
  color: #586559;
  font-size: 12px;
  font-weight: 620;
}

td:first-child {
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 650;
  background: #edf0eb;
  color: #58655a;
}

.status:before {
  content: "";
  background: currentColor;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.s-accepted {
  background: #fff0d3;
  color: #7b5516;
}

.s-preparing {
  background: #f9e7da;
  color: #96491f;
}

.s-ready, .s-on {
  background: #deefda;
  color: #33663d;
}

.s-collected, .s-off {
  background: #e8ede7;
  color: #516156;
}

.section-top {
  margin: 0 0 14px;
}

.section-top label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}

.meals {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
  gap: 15px;
}

.meal-card {
  overflow: hidden;
}

.meal-card img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: #e3e9da;
  display: block;
}

.meal-content {
  padding: 15px;
}

.meal-content .light {
  font-size: 12px;
}

.meal-content h3 {
  margin: 2px 0 9px;
}

.meal-content .line {
  margin-top: 12px;
}

.total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.search {
  max-width: 100%;
}

.empty {
  padding: 25px 0;
  color: var(--muted);
  font-size: 14px;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
}

.recipe {
  padding: 10px 0;
  border-top: 1px solid var(--edge);
}

.recipe summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.recipe ul {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0;
}

.dialog-top {
  margin: 0 0 17px;
}

dialog {
  border: 1px solid var(--edge);
  border-radius: 15px;
  width: min(430px,calc(100vw - 26px));
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 20px 70px #13251a39;
  max-height: 90dvh;
  overflow: auto;
}

dialog::backdrop {
  background: #0c1916a8;
}

.dialog-top .icon-btn {
  height: 34px;
  width: 34px;
  min-height: 34px;
}

.dialog-form {
  display: grid;
  gap: 16px;
}

input[type=number] {
  width: 100%;
  display: block;
  margin-top: 5px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox input {
  accent-color: #315e43;
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}

.dialog-rows {
  margin-top: 16px;
}

.dialog-rows .line, .sum {
  border-top: 1px solid var(--edge);
  padding: 10px 0;
}

.sum b {
  font-size: 19px;
}

.dialog-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0;
}

.status-note {
  margin-top: 12px;
}

.issue {
  color: #963c25;
  font-size: 14px;
}

.alert {
  padding: 10px 13px;
  border-radius: 7px;
  border: 1px solid #b7cbb6;
  background: #eef5e6;
  margin-bottom: 14px;
}

.alert.error {
  border-color: #d6ad90;
  background: #f9ede1;
  color: #813d22;
}

.mobile-tag {
  display: none;
}

@media(max-width:1150px) {
  .shell {
    grid-template-columns: 180px minmax(0,1fr);
  }
  .side {
    padding-left: 11px;
    padding-right: 11px;
  }
  .brand {
    font-size: 21px;
  }
  .panel {
    padding: 16px;
  }
  .stat {
    padding: 14px 12px;
  }
}

@media(max-width:850px) {
  .shell {
    display: block;
  }
  .side {
    position: relative;
    height: auto;
    display: block;
    padding: 0 18px 10px;
  }
  .brand {
    display: flex;
    margin: 0;
    padding: 13px 0;
    min-height: 58px;
    font-size: 21px;
  }
  .brand small {
    display: inline-block;
    vertical-align: middle;
    font-size: 12px;
    letter-spacing: 1px;
    margin: 0 0 0 9px;
  }
  .brandmark, .brandmark svg {
    height: 29px;
    width: 29px;
  }
  .side nav {
    display: flex;
    gap: 3px;
    margin: 0 -5px;
  }
  .side nav button {
    min-height: 40px;
    justify-content: center;
    padding: 6px 10px;
    font-size: 13px;
    gap: 5px;
    white-space: nowrap;
  }
  .side nav svg {
    width: 15px;
  }
  .session {
    display: none;
  }
  .bar {
    min-height: 55px;
    padding: 8px 20px;
  }
  .bar #kiosk-link {
    min-height: 36px;
    padding: 6px 11px;
  }
  main {
    padding-top: 22px;
  }
  .stat strong {
    font-size: 26px;
  }
  .bars {
    height: 146px;
  }
}

@media(max-width:620px) {
  .side {
    padding: 0 12px 8px;
  }
  .side nav {
    margin: 0;
  }
  .side nav button {
    flex: 1;
    padding: 5px 3px;
    font-size: 12px;
  }
  .side nav svg {
    width: 13px;
  }
  .bar {
    padding: 7px 14px;
  }
  .crumb {
    font-size: 12px;
  }
  main {
    padding: 18px 13px 45px;
  }
  .title-row {
    align-items: center;
    margin-bottom: 15px;
    gap: 6px;
  }
  .filters {
    gap: 5px;
  }
  .filters label {
    font-size: 0;
    gap: 0;
  }
  .filters select {
    font-size: 13px;
    max-width: 125px;
    min-height: 36px;
    padding: 5px;
  }
  .icon-btn {
    width: 35px;
    min-height: 36px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .cards {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin-bottom: 11px;
  }
  .stat {
    padding: 11px;
  }
  .stat strong {
    font-size: 26px;
    margin-top: 6px;
  }
  .stat .label {
    font-size: 12px;
  }
  .grid, .columns {
    grid-template-columns: minmax(0,1fr);
    gap: 11px;
  }
  .panel {
    padding: 14px;
  }
  .panel-top {
    margin-bottom: 10px;
  }
  .bars {
    height: 126px;
  }
  .meals {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
  }
  .meal-card img {
    height: 105px;
  }
  .meal-content {
    padding: 10px;
  }
  .meal-content .line {
    gap: 4px;
  }
  .meal-content .secondary {
    padding: 4px 7px;
    font-size: 12px;
  }
  .section-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .search {
    width: 100%;
  }
  h2 {
    font-size: 17px;
  }
  .chart-labels {
    font-size: 10px;
  }
  .hint {
    font-size: 11px;
  }
  th, td {
    padding: 8px 6px;
  }
  .thumb {
    width: 51px;
    height: 45px;
  }
}

@media(prefers-reduced-motion:no-preference) {
  .side nav button, .primary, .icon-btn, .secondary {
    transition: background .13s ease;
  }
}

.chart-svg {
  width: 100%;
  height: 146px;
  stroke: none;
  fill: none;
  display: block;
  overflow: visible;
}

.chart-svg .gridline {
  stroke: #d9e3d6;
  stroke-width: 1;
}

.chart-svg .plotbar {
  fill: #648c68;
  stroke: none;
}

.chart-svg .last {
  fill: #315b3b;
}

.chart-svg .plotbar:hover {
  fill: #c27143;
}

.bar-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.bar-legend b {
  color: #426046;
}

.dialog-error {
  margin: 9px 0;
}

.stock-nowrap {
  white-space: normal;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section-top p {
  font-size: 13px;
  color: var(--muted);
}

.stat .total small {
  margin-left: 4px;
}

.page-scope {
  font-size: 12px;
  letter-spacing: .035em;
  line-height: 1.55;
  font-family: inherit;
  font-weight: 600;
}

.notice-retry {
  display: inline-flex;
  margin-left: 8px;
  padding: 0;
  color: inherit;
  border: 0;
  text-decoration: underline;
  background: transparent;
}

.orderkey {
  background: transparent;
  border: 0;
  color: var(--green);
  font-weight: 700;
  padding: 4px 0;
  text-align: left;
}

.orderkey:hover {
  text-decoration: underline;
}

.order-lines ul {
  margin: 3px 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 12px;
}

.kiosk-prompt {
  display: inline-flex;
  margin-top: 10px;
}

.sr {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}

.stock-name {
  min-width: 6em;
}

[hidden] {
  display: none !important;
}


.custom-inquiry { display: inline-block; font-size: .8rem; color: inherit; text-underline-offset: .2em; }
.custom-inquiry:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
