:root {
  --white: #ffffff;
  --bg: #f5f3ef;
  --bg2: #eeeae3;
  --bg3: #e8e3da;
  --surface: #ffffff;
  --surface2: #faf9f7;
  --surface3: #f2f0ec;
  --border: #e8e4dd;
  --border2: #d8d3c9;
  --text: #1a1714;
  --text2: #4a453e;
  --text3: #8a857c;
  --text4: #b8b3aa;
  --orange: #f07320;
  --orange-l: #fff3ec;
  --orange-m: rgba(240,115,32,0.12);
  --orange-b: rgba(240,115,32,0.25);
  --orange-dark: #d45e10;
  --green: #2e9e6b;
  --green-l: #edf7f2;
  --red: #e03b2e;
  --red-l: #fef2f1;
  --blue: #2563eb;
  --blue-l: #eff4ff;
  --yellow: #d97706;
  --yellow-l: #fffbeb;
  --danger-border: #fecaca;
  --danger-bg-hover: #fee2e2;
  --danger-border-hover: #fca5a5;
  --code-bg: #171410;
  --code-text: #f2ede5;
  --hero-grad-start: #fdf8f3;
  --hero-grad-end: #f5ede0;
  --white-85: rgba(255,255,255,0.85);
  --white-40: rgba(255,255,255,0.4);
  --white-72: rgba(255,255,255,0.72);
  --table-busy-bg: #fff8f0;
  --table-busy-border: #fcd3a8;
  --brand-grad-start: #1f1b17;
  --brand-grad-end: #302820;
  --white-8: rgba(255,255,255,0.08);
  --overlay-bg: rgba(26,23,20,0.5);
  --toast-danger: #b91c1c;
  --toast-success: #047857;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.16), 0 8px 20px rgba(0,0,0,0.08);
  --r: 14px;
  --r-sm: 9px;
  --r-xs: 6px;
  --sidebar: 72px;
  --cat: 90px;
  --cart: 380px;
  --sur: var(--surface);
  --sur2: var(--surface2);
  --sur3: var(--surface3);
  --bdr: var(--border);
  --bdr2: var(--border2);
  --txt: var(--text);
  --txt2: var(--text2);
  --txt3: var(--text3);
  --txt4: var(--text4);
  --or: var(--orange);
  --ord: var(--orange-dark);
  --orl: var(--orange-l);
  --orb: var(--orange-b);
  --gr: var(--green);
  --grl: var(--green-l);
  --rd: var(--red);
  --rdl: var(--red-l);
  --yw: var(--yellow);
  --ywl: var(--yellow-l);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.sidebar {
  width: var(--sidebar); background: var(--text); padding: 18px 0 20px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
}
.logo {
  width: 42px; height: 42px; border-radius: 12px; background: var(--orange); color: var(--white);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(240,115,32,0.4);
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 700; font-size: 20px;
}
.nav {
  width: calc(100% - 16px);
  border-radius: 10px; border: 1px solid transparent;
  color: var(--white-40); background: transparent; cursor: pointer;
  padding: 9px 0; margin-bottom: 2px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9px;
  transition: all var(--transition);
}
.nav span { letter-spacing: .6px; }
.sn .ic { font-size: 17px; line-height: 1; }
.nav:hover { background: var(--white-8); color: var(--white-72); }
.nav.on { background: rgba(240,115,32,0.18); border-color: rgba(240,115,32,0.3); color: var(--orange); }
.nav-bottom { margin-top: auto; width: 100%; padding: 0 8px; }
.nav-with-badge { position: relative; }
.nav-badge {
  position: absolute; top: 3px; right: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: var(--white); font-size: 9px; font-style: normal;
  display: flex; align-items: center; justify-content: center;
}

.page { display: none; flex: 1; min-width: 0; overflow: hidden; }
.page.active { display: flex; }
.tables-page, .stats-page, .orders-page, .kitchen-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top {
  padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm);
}
.top h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.top p { font-size: 11px; color: var(--text4); margin-top: 2px; }
.tb-r { display: flex; align-items: center; gap: 8px; }
#sessionInfo {
  font-size: 11px;
  color: var(--text3);
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 999px;
  padding: 4px 10px;
}

input, select, button {
  font-family: inherit;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  padding: 8px 10px;
  font-size: 13px;
}
input, select { background: var(--surface); color: var(--text); }
input:focus, select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-m);
}
button {
  background: var(--orange); color: var(--white); border-color: var(--orange); cursor: pointer;
  transition: all var(--transition);
}
button:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
button.sec { background: var(--surface3); color: var(--text2); border-color: var(--border); }
button.sec:hover { background: var(--surface); border-color: var(--border2); }
button.warn { background: var(--red-l); color: var(--red); border-color: var(--danger-border); }
button.warn:hover { background: var(--danger-bg-hover); border-color: var(--danger-border-hover); }

.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.row.tight { margin: 0; }
h2 { font-size: 16px; margin-bottom: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.item { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 10px; padding: 10px; }
.item h3 { font-size: 14px; margin-bottom: 6px; }
.item p { font-size: 12px; color: var(--text3); }
pre {
  background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 10px; font-size: 12px;
  max-height: 180px; overflow: auto;
}

/* index */
.pos-shell { display: grid; grid-template-columns: var(--cat) minmax(0, 1fr) var(--cart); gap: 0; height: 100vh; padding: 0; width: 100%; }
.cat-panel { display: flex; flex-direction: column; overflow: hidden; background: var(--surface2); border-color: var(--border); width: 100%; border-right: 1px solid var(--border); border-radius: 0; }
.cp-head { padding: 18px 13px 12px; border-bottom: 1px solid var(--border); }
.cp-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text4); margin-bottom: 9px;
}
.search-wrap {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 10px; transition: all var(--transition);
}
.search-wrap:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-m); }
.search-wrap input { border: none; background: none; outline: none; box-shadow: none; flex: 1; padding: 0; font-size: 12px; }
.search-ic { color: var(--text4); }
.cat-scroll { flex: 1; overflow: auto; padding: 7px; }
.cat-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 8px;
  border-radius: var(--r-sm); border: 1px solid transparent; margin-bottom: 1px; background: transparent;
  transition: all var(--transition);
}
.cat-item { position: relative; }
.cat-item:hover { background: var(--surface3); }
.cat-item b { font-size: 12.5px; color: var(--text2); font-weight: 500; }
.cat-item p { font-size: 10.5px; color: var(--text4); margin-top: 1px; }
.cat-item.on { background: var(--orange-l); border-color: var(--orange-b); }
.cat-item.on b { color: var(--orange-dark); font-weight: 600; }
.cat-item.on::before { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; border-radius: 0 2px 2px 0; background: var(--orange); }
.c-em { width: 27px; text-align: center; font-size: 19px; }
.c-name { display: block; }
.c-cnt { display: block; }
.cat-item { cursor: pointer; }
.ci-bdg {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
}
.cp-foot { padding: 11px 13px; border-top: 1px solid var(--border); }
.table-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.tbl-sm {
  width: 100%;
  padding: 10px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
}
.tbl-sm:hover { border-color: var(--orange-b); background: var(--orange-l); }
.tbl-sm-m { font-size: 13px; font-weight: 600; color: var(--text); }
.tbl-sm-s { font-size: 10.5px; color: var(--text4); }

.tag-strip {
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 5px;
  overflow: auto;
}
.tag-pill {
  padding: 5px 14px; border-radius: 20px; font-size: 12px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text3);
}
.tag-pill.on { background: var(--orange); border-color: var(--orange); color: var(--white); }

/* pro_2 tag chips */
.tg {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text3);
  background: var(--surface);
}
.tg:hover { border-color: var(--orange-b); color: var(--orange); }
.tg.on { background: var(--orange); border-color: var(--orange); color: var(--white); }

.menu-wrap { flex: 1; overflow: auto; padding: 16px 20px 20px; }
.menu-area { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mlist .menu-area { grid-template-columns: 1fr; }
.dish-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r);
  transition: all var(--transition); display: flex; flex-direction: column; overflow: hidden;
}
.dish-card:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-2px); }
.dc-img {
  height: 120px; background: linear-gradient(135deg, var(--hero-grad-start), var(--hero-grad-end));
  display: flex; align-items: center; justify-content: center; font-size: 52px; position: relative;
}
.dc-bdg {
  position: absolute; top: 8px; left: 8px; font-size: 9px; font-weight: 700; padding: 3px 8px;
  border-radius: 20px; color: var(--white);
}
.bdg-hot { background: var(--red); }
.bdg-new { background: var(--green); }
.bdg-rec { background: var(--orange); }
.dc-sold {
  position: absolute; top: 8px; right: 8px; font-size: 10px; color: var(--text3);
  background: var(--white-85); padding: 2px 7px; border-radius: 10px;
}
.dc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.dc-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.dc-desc { font-size: 10.5px; color: var(--text4); line-height: 1.55; margin-top: 3px; min-height: 32px; }
.dc-tags { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.dc-tag { font-size: 9.5px; padding: 2px 6px; border-radius: 4px; background: var(--surface3); color: var(--text3); }
.dish-foot { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }
.dish-foot strong { color: var(--orange); font-size: 18px; }
.dc-price { font-size: 20px; font-weight: 700; }
.dc-price small { font-size: 10.5px; font-weight: 400; color: var(--text4); }
.dish-card img {
  width: 100%;
  max-height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.mlist .dish-card { flex-direction: row; }
.mlist .dish-card .dc-img { width: 95px; min-height: 85px; height: auto; font-size: 34px; }

.cart {
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: -4px 0 20px rgba(0,0,0,0.04); border-left: 1px solid var(--border);
  width: 100%;
  border-left: 1px solid var(--border);
  border-radius: 0;
  justify-self: stretch;
  align-self: stretch;
}
.cart-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.ch-row1 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ch-row1 h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.ch-cnt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; border-radius: 999px;
  background: var(--orange); color: var(--white); font-size: 11px; padding: 0 7px;
}
.tbl-cards { display: flex; gap: 8px; }
.tbl-card {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--border); background: var(--surface3);
  border-radius: var(--r-sm); padding: 8px;
}
.tbl-card small { display: block; color: var(--text4); font-size: 10px; line-height: 1; }
.tbl-card b { font-size: 13px; color: var(--text2); line-height: 1.2; }
.cart-body { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 9px 13px; }
.ci { border-radius: var(--r-sm); background: var(--surface2); border: 1.5px solid var(--border); padding: 10px 12px; }
.ci-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ci-sub { font-size: 11px; color: var(--text4); margin-top: 2px; }
.ci-total { font-size: 14px; font-weight: 700; }
.ci-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface2); border: 1.5px solid var(--border); }
.ci-sp { font-size: 10.5px; color: var(--text4); margin-top: 1px; }
.ci-r { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ci-tot { font-size: 12.5px; font-weight: 700; }
.qc { display: inline-flex; align-items: center; border: 1.5px solid var(--orange-b); border-radius: 8px; background: var(--orange-l); overflow: hidden; }
.qb { border: 0; border-radius: 0; background: transparent; color: var(--orange-dark); width: 24px; height: 24px; padding: 0; }
.qn { min-width: 18px; text-align: center; font-size: 12px; font-weight: 700; color: var(--orange-dark); }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text4); }
.ce-ic { font-size: 46px; opacity: .35; }
.ce-t { font-size: 13px; color: var(--text3); }
.ce-s { font-size: 11px; }
.cf { padding: 11px 13px 16px; border-top: 1px solid var(--border); }
.cf-remark { display: flex; align-items: center; gap: 7px; background: var(--surface3); border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 7px 10px; margin-bottom: 9px; }
.cf-remark input { border: 0; background: transparent; padding: 0; flex: 1; font-size: 12px; }
.pays { display: flex; gap: 4px; margin-bottom: 10px; }
.pm { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; padding: 7px 4px; }
.pm .pm-ic { font-size: 16px; line-height: 1; }
.coup-row { width: 100%; justify-content: space-between; display: flex; align-items: center; gap: 7px; background: var(--green-l); border: 1.5px solid rgba(42,157,110,.25); border-radius: var(--r-sm); color: var(--green); }
.sums { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
.sr { display: flex; justify-content: space-between; align-items: center; }
.sl { font-size: 11.5px; color: var(--text3); }
.sv { font-size: 12.5px; color: var(--text2); }
.sr.disc .sv { color: var(--green); }
.divl { height: 1px; background: var(--border); margin: 3px 0; }
.sr.tot .sl { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sr.tot .sv { font-size: 22px; font-weight: 700; color: var(--orange); }
.sub-wrap { display: flex; gap: 6px; }
.sub-ic { padding: 10px 11px; background: var(--surface3); border: 1.5px solid var(--border); border-radius: var(--r-sm); color: var(--text2); }
.sub-main { flex: 1; padding: 12px; background: var(--orange); border-radius: var(--r-sm); color: var(--white); font-size: 14px; font-weight: 700; border: none; }

.topbar { padding: 13px 20px; }
.tb-t { font-size: 16px; font-weight: 700; }
.tb-s { font-size: 10.5px; color: var(--text4); margin-top: 1px; }
.pr { display: flex; gap: 1px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.pt { padding: 4px 10px; border-radius: 6px; font-size: 11.5px; border: 1px solid transparent; background: none; color: var(--text3); }
.pt.on { background: var(--surface); border-color: var(--border); color: var(--text); }
.ib { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text2); font-size: 11.5px; }

/* Prevent cart item styles from affecting category items */
.cat-list .cat-item,
.cat-list .ci {
  display: flex;
  align-items: center;
}

.table-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-height: 260px; overflow: auto; }
.table-btn {
  border-radius: var(--r-sm); aspect-ratio: 1; background: var(--surface); border: 1.5px solid var(--border);
  font-size: 11px; color: var(--text3);
}
.table-btn.on { border-color: var(--orange); background: var(--orange-l); color: var(--orange-dark); box-shadow: 0 0 0 3px var(--orange-m); }
.table-btn.free { background: var(--surface); }
.table-btn.busy { background: var(--table-busy-bg); border-color: var(--table-busy-border); color: var(--orange-dark); }
.table-btn.dirty { background: var(--red-l); border-color: var(--danger-border); color: var(--red); }

/* login */
.auth-page { align-items: center; justify-content: center; overflow: auto; }
.auth-shell { width: min(920px, calc(100vw - 24px)); display: grid; grid-template-columns: 340px 1fr; gap: 14px; }
.auth-brand {
  border-radius: 20px; padding: 26px; color: var(--white);
  background: linear-gradient(160deg, var(--brand-grad-start), var(--brand-grad-end));
  border: 1px solid var(--white-8);
}
.auth-brand h1 { font-size: 28px; margin-top: 8px; }
.auth-brand p { margin-top: 6px; opacity: 0.72; }
.auth-logo { margin-bottom: 6px; }
.brand-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  opacity: 0.7;
}
.auth-card { min-height: 420px; padding: 20px; }
.auth-card h2 { margin-bottom: 12px; }
.auth-sub { font-size: 12px; color: var(--text3); margin-bottom: 12px; }
.auth-card .row input { width: 100%; }
.auth-card button { min-height: 36px; }
.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.auth-actions button:last-child { grid-column: 1 / -1; }

/* admin */
.admin-shell { display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow: auto; }
.admin-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.admin-panel { padding: 14px; box-shadow: var(--shadow-sm); }
.admin-panel h3 { font-size: 14px; margin-bottom: 8px; color: var(--text2); }
.admin-panel .row > * { flex: 1; min-width: 160px; }
.admin-panel .row > button { flex: 0 0 auto; }
#tab-store input, #tab-store select, #tab-store button,
#tab-menu input, #tab-menu select, #tab-menu button,
#tab-api input, #tab-api select, #tab-api button,
#tab-open input, #tab-open select, #tab-open button { min-height: 36px; }
#tab-store.active, #tab-api.active, #tab-open.active { display: block; }
#tab-store .panel, #tab-api .panel, #tab-open .panel { margin-bottom: 0; padding: 14px; }
#tab-menu { display: none; padding: 14px; grid-template-columns: 1fr 1fr; gap: 12px; }
#tab-menu.active { display: grid; }
.img-preview {
  max-width: 180px;
  max-height: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: none;
  background: var(--surface2);
}
.field-help {
  display: block;
  font-size: 11px;
  color: var(--text4);
  margin-top: -2px;
  margin-bottom: 8px;
}

.modal-mask {
  position: fixed; inset: 0; background: var(--overlay-bg); z-index: 80;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
.modal-mask.show { display: flex; }
.modal {
  width: 460px; max-width: calc(100vw - 20px); max-height: 85vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-xl); padding: 20px;
}
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--text3); font-size: 12px; margin-bottom: 10px; }
.modal label { font-size: 12px; color: var(--text3); min-width: 64px; align-self: center; }
.addon-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.addon-wrap label { background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }

.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: var(--white); border-radius: var(--r-sm); padding: 11px 16px; font-size: 13px;
  box-shadow: var(--shadow-lg); min-width: 180px;
}
.toast.err { background: var(--toast-danger); }
.toast.ok { background: var(--toast-success); }
.loading { opacity: .65; pointer-events: none; }

#payBtns .pm.on {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

#couponWrap .item {
  display: block;
  cursor: pointer;
}

#receiptOutput {
  max-height: 280px;
  overflow: auto;
}

/* shared page header */
.page-hd {
  padding: 14px 22px;
  background: var(--sur);
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-hd-t { font-size: 16px; font-weight: 700; color: var(--txt); letter-spacing: -0.1px; }
.ib.pri {
  background: var(--or);
  border-color: var(--or);
  color: var(--white);
}

/* pro_2 functional pages */
.kitch-cols { display: flex; gap: 14px; overflow: auto; }
.kitch-col { min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.kitch-col-hd { padding: 10px 14px; border-radius: 10px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; }
.kh-w { background: rgba(217,119,6,.15); color: #fbbf24; border: 1px solid rgba(217,119,6,.25); }
.kh-c { background: rgba(240,115,32,.15); color: #fb923c; border: 1px solid rgba(240,115,32,.25); }
.kh-r { background: rgba(42,157,110,.15); color: #34d399; border: 1px solid rgba(42,157,110,.25); }
.kitch-card { background: var(--sur); border: 1.5px solid var(--bdr); border-radius: 12px; padding: 14px; }
.kc-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kc-tbl { font-size: 14px; font-weight: 700; }
.kc-time { font-size: 11px; color: var(--txt4); }
.kc-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.kc-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: var(--sur3); border-radius: 7px; }
.kc-item.done { opacity: .65; }
.kc-item .kItem { margin-left: auto; padding: 5px 10px; font-size: 11px; border-radius: 8px; }
.kc-item-em { font-size: 18px; }
.kc-item-n { flex: 1; font-size: 12px; }
.kc-item-q { font-size: 11px; font-weight: 700; color: var(--txt4); }
.kc-btn { width: 100%; padding: 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }

.zone-block { margin-bottom: 22px; }
.zone-t { font-size: 12.5px; font-weight: 700; color: var(--txt2); margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.zone-grid .tbl-card { background: var(--sur); border: 1.5px solid var(--bdr); border-radius: var(--r); padding: 12px 11px; cursor: pointer; transition: all var(--transition); }
.zone-grid .tbl-card:hover { border-color: var(--bdr2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.zone-grid .tbl-card.busy { background: var(--table-busy-bg); border-color: var(--table-busy-border); }
.zone-grid .tbl-card.dirty { background: var(--red-l); border-color: var(--danger-border); }
.zone-grid .tbl-card.reserved { background: #eef4ff; border-color: #c7d7ff; }
.tc-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.tc-num { font-size: 16px; font-weight: 700; color: var(--txt); }
.tc-st { font-size: 10.5px; color: var(--txt4); }
.tc-detail { font-size: 10px; color: var(--txt4); margin-top: 3px; }
.tc-amt { font-size: 11.5px; font-weight: 600; color: var(--or); margin-top: 3px; }
.tc-acts { display:flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tc-btn { padding: 5px 10px; font-size: 11px; border-radius: 10px; }
.tc-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.dot-free { background: var(--gr); }
.dot-busy { background: var(--or); }
.dot-dirty { background: var(--rd); }
.dot-reserved { background: var(--blue); }

.stat-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 11px; }
.sc { background: var(--sur); border: 1.5px solid var(--bdr); border-radius: var(--r); padding: 14px; }
.sc-ic { font-size: 18px; margin-bottom: 6px; }
.sc-v { font-size: 24px; font-weight: 700; color: var(--txt); line-height: 1; }
.sc-l { font-size: 11.5px; color: var(--txt3); margin-top: 6px; }
.sc-c { margin-top: 6px; font-size: 10.5px; }
.sc-c.up { color: var(--gr); }
.sc-c.dn { color: var(--rd); }
.chart-card {
  margin: 12px 22px 0;
  border: 1.5px solid var(--bdr);
  border-radius: var(--r);
  background: var(--sur);
  padding: 12px 12px 10px;
}
.cc-t { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 8px; }
.cc-sub { margin-top: 8px; font-size: 11px; color: var(--txt4); }
.bar-chart { height: 170px; display: grid; grid-template-columns: repeat(11, 1fr); gap: 8px; align-items: end; }
.bc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; }
.bar-chart.bi .barv{
  width: 100%;
  height: var(--h, 2px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  position: relative;
}
.bar-chart.bi .bar{
  width: 100%;
  height: 100%;
  border-radius: 8px 8px 6px 6px;
  background: linear-gradient(180deg, #f7b67f 0%, var(--or) 100%);
  box-shadow: 0 6px 14px rgba(240,115,32,.18);
}
.bar-chart.bi .barv.z .bar{
  background: linear-gradient(180deg, #efece6 0%, #e6e1d8 100%);
  box-shadow: none;
}
.bar-chart.bi .bar-val{
  position:absolute;
  bottom: calc(100% + 6px);
  font-size: 10px;
  color: var(--txt4);
  white-space: nowrap;
}
.bar-l { font-size: 10.5px; color: var(--txt4); }
.top-list { padding: 8px 22px 0; display: flex; flex-direction: column; gap: 8px; }
.top-list.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tdr {
  display: grid;
  grid-template-columns: 34px 34px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--bdr);
  border-radius: var(--r-sm);
  background: var(--sur);
  padding: 8px 10px;
}
.td-rk {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--sur3);
  color: var(--txt3);
}
.td-rk.gld { background: #fff1cf; color: #b7791f; }
.td-em { font-size: 22px; text-align: center; }
.td-n { font-size: 12.5px; color: var(--txt); font-weight: 600; }
.td-c { font-size: 11px; color: var(--txt4); margin-top: 2px; }
.td-a { font-size: 12.5px; font-weight: 700; color: var(--or); }

@media (max-width: 1440px) {
  .menu-area { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1600px) {
  .pos-shell { grid-template-columns: var(--cat) minmax(0, 1fr) var(--cart); }
  .topbar { padding: 16px 24px; }
  .tag-strip { padding: 10px 24px; }
  .menu-wrap { padding: 20px 24px 24px; }
  .menu-area { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
  .dc-img { height: 124px; }
}

@media (min-width: 2400px) {
  .menu-area { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 1360px) and (max-width: 1599px) {
  .menu-area { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1100px) and (max-width: 1359px) {
  .menu-area { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
  .topbar { padding: 12px 14px; }
  .tag-strip { padding: 8px 14px; }
  .menu-wrap { padding: 12px 14px 16px; }
}

@media (max-width: 1180px) {
  .pos-shell { grid-template-columns: var(--cat) 1fr var(--cart); }
  .cart-body { max-height: none; }
  .menu-area { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 62px; }
  .sidebar { width: var(--sidebar); }
  .logo { width: 36px; height: 36px; font-size: 18px; }
  .nav { font-size: 8px; }
  .sn .ic { font-size: 15px; }
  .pos-shell { grid-template-columns: var(--cat) 1fr var(--cart); }
  .cat-panel { width: var(--cat); border-right: 1px solid var(--border); border-bottom: 0; }
  .menu-area { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-r { flex-wrap: wrap; justify-content: flex-end; }
  .ib { padding: 5px 9px; }
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-actions { grid-template-columns: 1fr; }
  .auth-actions button:last-child { grid-column: auto; }
  .admin-grid-two { grid-template-columns: 1fr; }
  #tab-menu.active { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 8px;
    overflow-x: auto;
    align-items: stretch;
    gap: 6px;
  }
  .logo { margin: 0 4px 0 0; flex-shrink: 0; }
  .nav-bottom { margin-top: 0; width: auto; padding: 0; display: flex; gap: 6px; }
  .nav {
    width: auto;
    min-width: 58px;
    margin: 0;
    padding: 7px 6px;
    flex-shrink: 0;
  }
  .page.active { width: 100%; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tb-r { width: 100%; justify-content: flex-start; }
  .menu-area { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tbl-chips { flex-direction: column; }
  .sub-wrap { flex-wrap: wrap; }
  .sub-main { width: 100%; }
}

@media (max-width: 1440px) {
  .page-hd { padding: 12px 16px; }
  #statsWrap .stat-g { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .page-hd { flex-direction: column; align-items: flex-start; gap: 8px; }
  .zone-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #statsWrap .stat-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .chart-card { margin: 10px 10px 0; }
  .top-list { padding: 8px 10px 0; }
  .top-list.grid2 { grid-template-columns: 1fr; gap: 8px; }
  .bar-chart { gap: 6px; }
  .page-hd { padding: 10px 10px; }
  .zone-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #statsWrap .stat-g { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; }
  .tdr { grid-template-columns: 28px 30px 1fr auto; gap: 8px; }
  .td-em { font-size: 18px; }
  .td-a { font-size: 11.5px; }
}

/* mobile switch only */
@media (max-width: 680px) {
  .pos-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "cat"
      "main"
      "cart";
    height: auto;
    min-height: 100vh;
  }
  .cat-panel { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .cat-scroll { max-height: 220px; }
  .cart {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--border);
    box-shadow: none;
  }
  .zone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #statsWrap .stat-g { grid-template-columns: 1fr; }
}
