@import url("https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap");
:root {
  font-family: "Sarabun", sans-serif;
  color: #1c2733;
  background: #f4f6f8;
  font-synthesis: none;
  --ink: #1c2733;
  --muted: #758191;
  --line: #e5e9ee;
  --panel: #fff;
  --navy: #172b4d;
  --blue: #2764e7;
  --green: #17865d;
  --orange: #c97716;
  --red: #c64242;
  --shadow: 0 8px 24px rgba(26, 42, 64, 0.055);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f6f8;
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.topbar {
  height: 74px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #e8efff;
  color: #2457d6;
  font-size: 23px;
  font-weight: 700;
}
.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}
.brand small {
  color: var(--muted);
  font-size: 11px;
}
.top-meta {
  display: flex;
  align-items: center;
  gap: 18px;
}
.top-meta label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
select {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink);
}
.demo-pill {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #885c10;
  background: #fff4d9;
  border: 1px solid #f6e1ad;
  border-radius: 999px;
  padding: 6px 10px;
}
.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 74px);
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.side-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #98a2af;
  padding: 8px 12px;
}
.space-top {
  margin-top: 23px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #5f6b7b;
  text-align: left;
  padding: 12px 13px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}
.nav-item span {
  font-size: 19px;
  width: 22px;
  text-align: center;
}
.nav-item b {
  margin-left: auto;
  font-size: 11px;
  background: #edf1f5;
  padding: 2px 7px;
  border-radius: 8px;
}
.nav-item.active {
  background: #edf3ff;
  color: #245bd7;
}
.nav-item.active b {
  background: #d9e5ff;
  color: #245bd7;
}
.side-bottom {
  margin-top: auto;
  padding: 15px 11px;
  color: #697586;
  font-size: 12px;
  line-height: 1.8;
  border-top: 1px solid var(--line);
}
.side-bottom small {
  font-size: 10px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2aa575;
  border-radius: 50%;
  margin-right: 5px;
}
.main-area {
  padding: 30px;
  min-width: 0;
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #7f8b9a;
  margin-bottom: 4px;
}
.page-head h1 {
  font-size: 29px;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 700;
}
.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.btn {
  border-radius: 9px;
  padding: 10px 15px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: #2864e8;
  color: #fff;
  box-shadow: 0 3px 8px #2864e822;
}
.btn-primary:hover {
  background: #1e53ce;
}
.btn-outline {
  border-color: #dce2ea;
  background: #fff;
  color: #334155;
}
.btn-quiet {
  background: #f7f8fa;
  border-color: #e8ebef;
  color: #5f6b7b;
  padding: 7px 11px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px 19px;
  box-shadow: var(--shadow);
}
.summary-card span {
  display: block;
  color: #6d7887;
  font-size: 12px;
}
.summary-card strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.5;
}
.summary-card small {
  color: #98a2af;
  font-size: 11px;
}
.green-text {
  color: var(--green) !important;
}
.orange-text {
  color: var(--orange) !important;
}
.workspace-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.workspace-head,
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
}
.workspace-head h2,
.table-toolbar h2 {
  margin: 0;
  font-size: 16px;
}
.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #6d7887;
  font-size: 11px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.free {
  background: #2fa77a;
}
.legend-dot.busy {
  background: #e2a23a;
}
.legend-dot.ready {
  background: #4882ed;
}
.floor-plan {
  position: relative;
  min-height: 440px;
  margin: 20px;
  border: 1px dashed #d7dee7;
  border-radius: 12px;
  overflow: hidden;
  background-color: #fbfcfe;
  background-image: radial-gradient(#dce3ed 0.9px, transparent 0.9px);
  background-size: 20px 20px;
}
.floor-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.8%, #eef1f5 50%, transparent 50.2%),
    linear-gradient(transparent 49.8%, #eef1f5 50%, transparent 50.2%);
  opacity: 0.35;
}
.table-node {
  position: absolute;
  z-index: 2;
  min-width: 100px;
  min-height: 86px;
  border: 1px solid #cfd9e5;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 5px 13px #20334e12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
  touch-action: manipulation;
  color: var(--ink);
}
.table-node.round {
  min-width: 88px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
}
.table-node.long {
  min-width: 135px;
}
.table-node:hover {
  box-shadow: 0 8px 22px #20334e20;
  transform: translateY(-1px);
}
.table-node .table-icon {
  font-size: 21px;
  line-height: 1.2;
}
.table-node strong {
  font-size: 13px;
}
.table-node small {
  font-size: 10px;
  color: #8591a0;
}
.table-node.free {
  border-color: #c7e9d9;
}
.table-node.busy {
  background: #fffaf0;
  border-color: #efd49e;
}
.table-node.ready {
  background: #f2f7ff;
  border-color: #c4d7fb;
}
.table-node .table-status {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
}
.table-node.busy .table-status {
  color: #b87817;
}
.table-node.ready .table-status {
  color: #2864d9;
}
.layout-mode .table-node {
  outline: 2px dashed #5b87ec;
  cursor: move;
}
.layout-mode .table-node:hover {
  outline: 3px solid #2864e8;
}
.section-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  margin: 8px 2px;
}
.counter-chip {
  background: #edf3ff;
  color: #2c5fd0;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
}
.ticket-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  align-items: start;
}
.ticket {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ticket-head {
  padding: 15px 16px;
  background: #f9fafc;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.ticket-head strong {
  font-size: 16px;
}
.ticket-head small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.ticket-time {
  font-size: 11px;
  color: #667386;
}
.ticket-body {
  padding: 15px 16px;
}
.ticket-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2f5;
}
.ticket-item:last-child {
  border-bottom: 0;
}
.ticket-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.ticket-note {
  background: #fff7e8;
  color: #966016;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 11px;
  margin-top: 9px;
}
.ticket-foot {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.ticket-foot button {
  flex: 1;
}
.ticket-status {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff1d7;
  color: #946114;
  height: max-content;
}
.ticket-status.ready {
  background: #e1f6ec;
  color: #16774f;
}
.ticket-status.doing {
  background: #e7efff;
  color: #2759c4;
}
.empty-state {
  grid-column: 1/-1;
  padding: 55px 20px;
  text-align: center;
  background: #fff;
  border: 1px dashed #d7dee7;
  border-radius: 13px;
  color: var(--muted);
}
.empty-state strong {
  display: block;
  color: #445164;
  font-size: 16px;
  margin-bottom: 5px;
}
.inventory-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.table-toolbar input {
  min-width: 230px;
}
.search-input {
  border: 1px solid #dfe5ec;
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
}
.search-input:focus {
  border-color: #7ea1f5;
  box-shadow: 0 0 0 3px #e8efff;
}
.table-scroll {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.data-table th {
  background: #fafbfd;
  color: #7c8795;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 13px 18px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 12px;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table td strong {
  font-size: 13px;
}
.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f0f4fa;
  font-size: 18px;
}
.stock-number {
  font-size: 14px;
  font-weight: 700;
}
.stock-number.low {
  color: var(--red);
}
.stock-number.ok {
  color: var(--green);
}
.pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
}
.pill.low {
  background: #fff0ef;
  color: #bb3939;
}
.pill.ok {
  background: #e5f7ee;
  color: #14754c;
}
.pill.neutral {
  background: #f0f2f5;
  color: #647184;
}
.mini-btn {
  border: 1px solid #dce3eb;
  background: #fff;
  border-radius: 7px;
  padding: 5px 8px;
  margin-right: 4px;
  color: #465468;
}
.log-card {
  margin-top: 18px;
}
.negative {
  color: #bd3939;
  font-weight: 700;
}
.positive {
  color: #17865d;
  font-weight: 700;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #17263c80;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 90px #0c1b3038;
}
.modal.narrow {
  width: min(460px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 18px;
  margin: 0;
}
.icon-btn {
  border: 0;
  background: #f1f3f6;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 18px;
}
.modal-body {
  padding: 20px 22px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field span {
  display: block;
  color: #657185;
  font-size: 12px;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dfe5ec;
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
  background: #fff;
}
.field textarea {
  min-height: 65px;
  resize: vertical;
}
.menu-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.menu-pick {
  border: 1px solid #e0e6ee;
  background: #fff;
  border-radius: 10px;
  text-align: left;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-pick:hover {
  border-color: #7ea1f5;
  background: #f8faff;
}
.menu-pick small {
  color: var(--muted);
}
.order-lines {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.order-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-controls button {
  width: 26px;
  height: 26px;
  border: 1px solid #dfe5ec;
  background: #fff;
  border-radius: 7px;
}
.order-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 0 4px;
}
.modal-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  background: #172b4d;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px #10203a33;
  transition: all 0.2s;
  max-width: calc(100vw - 30px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .main-area {
    padding: 22px;
  }
  .ticket-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-grid {
    gap: 10px;
  }
  .summary-card {
    padding: 14px;
  }
  .summary-card strong {
    font-size: 25px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 67px;
    padding: 11px 14px;
    gap: 10px;
  }
  .brand-mark {
    width: 35px;
    height: 35px;
  }
  .brand strong {
    font-size: 16px;
  }
  .top-meta {
    gap: 7px;
  }
  .top-meta label {
    font-size: 0;
  }
  .top-meta select {
    font-size: 11px;
    max-width: 125px;
    padding: 7px;
  }
  .demo-pill {
    font-size: 9px;
    padding: 5px 7px;
  }
  .btn-quiet {
    display: none;
  }
  .app-shell {
    display: block;
    min-height: calc(100vh - 67px);
  }
  .sidebar {
    position: sticky;
    top: 67px;
    z-index: 15;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 7px 10px;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 5px;
  }
  .side-label,
  .side-bottom {
    display: none;
  }
  .nav-item {
    white-space: nowrap;
    padding: 9px 11px;
    font-size: 12px;
    gap: 7px;
  }
  .nav-item span {
    font-size: 15px;
    width: auto;
  }
  .nav-item b {
    font-size: 10px;
  }
  .main-area {
    padding: 18px 12px;
  }
  .page-head {
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 10px;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .page-head p {
    font-size: 12px;
  }
  .head-actions {
    gap: 6px;
  }
  .btn {
    font-size: 12px;
    padding: 9px 10px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 15px;
  }
  .summary-card {
    padding: 12px 13px;
  }
  .summary-card strong {
    font-size: 25px;
  }
  .workspace-head,
  .table-toolbar {
    align-items: flex-start;
    padding: 15px;
    flex-wrap: wrap;
  }
  .legend {
    gap: 8px;
  }
  .floor-plan {
    min-height: 440px;
    margin: 12px;
  }
  .table-node {
    min-width: 83px;
    min-height: 76px;
    padding: 6px;
  }
  .table-node.round {
    min-width: 73px;
    width: 73px;
    height: 73px;
  }
  .table-node.long {
    min-width: 105px;
  }
  .table-node .table-icon {
    font-size: 17px;
  }
  .table-node strong {
    font-size: 11px;
  }
  .table-node small {
    font-size: 9px;
  }
  .section-foot {
    display: block;
    line-height: 1.8;
  }
  .ticket-board {
    grid-template-columns: 1fr;
  }
  .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-summary .summary-card:last-child {
    grid-column: 1/-1;
  }
  .table-toolbar input {
    min-width: 0;
    width: 100%;
  }
  .menu-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-body {
    padding: 16px;
  }
  .modal-head {
    padding: 15px 16px;
  }
  .modal-foot {
    padding: 13px 16px;
  }
  .data-table th,
  .data-table td {
    padding: 11px 12px;
  }
  .counter-chip {
    font-size: 11px;
    padding: 7px 9px;
  }
}
@media (max-width: 390px) {
  .demo-pill {
    display: none;
  }
  .page-head {
    flex-direction: column;
  }
  .head-actions {
    width: 100%;
  }
  .head-actions .btn {
    flex: 1;
  }
  .nav-item {
    padding: 8px 9px;
  }
  .floor-plan {
    margin: 8px;
  }
  .summary-card strong {
    font-size: 23px;
  }
}

/* Iteration 2: floor objects, multi-floor map, product/sales back office, split bill/menu */
.floor-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -8px 0 18px;
  padding: 12px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.floor-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.floor-controls .muted {
  margin: 0;
}
.floor-plan {
  min-height: 620px;
  background-color: #fbfcfe;
}
.table-node.free {
  background: #eef1f4;
  border-color: #d3d9e0;
  color: #4e5b6a;
}
.table-node.free .table-status {
  color: #647184;
}
.table-node.busy {
  background: #e1f6e9;
  border: 2px solid #2aa66a;
  color: #125b3d;
  box-shadow: 0 4px 16px #17865d20;
}
.table-node.busy .table-status {
  color: #14784d;
}
.table-node.busy small {
  color: #237652;
}
.table-node.ready {
  background: #e1f6e9;
  border-color: #2aa66a;
}
.floor-object {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #cbd3dd;
  border-radius: 8px;
  background: #e8edf3;
  color: #4b5868;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  user-select: none;
}
.floor-object span {
  font-size: 17px;
}
.floor-object strong {
  font-size: 11px;
  white-space: nowrap;
}
.object-wall {
  background: #4d5968;
  color: white;
  border: 0;
  border-radius: 2px;
  padding: 0;
  height: 8px !important;
}
.object-wall span,
.object-wall strong {
  display: none;
}
.object-stairs {
  background: #fff0d6;
  border: 1px solid #e7c78f;
}
.object-bar {
  background: #e4f2eb;
  border-color: #b6d9c5;
  color: #236647;
}
.object-door {
  background: #f5e9e5;
  border-color: #e2c7bd;
}
.object-plant {
  background: #e4f4e7;
  border-color: #c4e0c8;
  border-radius: 14px;
}
.layout-mode .floor-object {
  outline: 2px dashed #5b87ec;
  cursor: move;
  z-index: 4;
}
.layout-mode .table-node {
  z-index: 5;
}
.order-modal {
  width: min(1180px, 100%);
  max-height: 94vh;
}
.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  min-height: 460px;
}
.menu-panel {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.bill-panel {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-heading h3,
.order-lines h3 {
  margin: 0;
  font-size: 16px;
}
.panel-heading .search-input {
  width: 200px;
  min-width: 0;
}
.category-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0 15px;
}
.category-tab {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #dfe5ec;
  background: #fff;
  color: #5d6878;
  font-size: 12px;
}
.category-tab.selected {
  background: #e8efff;
  color: #245bd7;
  border-color: #bfd0fb;
}
.menu-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: start;
}
.menu-pick {
  min-width: 0;
  min-height: 82px;
}
.menu-pick span {
  font-weight: 600;
  line-height: 1.45;
}
.menu-pick strong {
  font-size: 14px;
}
.bill-panel #bill-lines {
  flex: 1;
  overflow: auto;
  max-height: 330px;
}
.bill-empty {
  padding: 32px 10px;
}
.bill-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.bill-total strong {
  font-size: 24px;
}
.move-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 0;
}
.move-field span {
  grid-column: 1/-1;
}
.move-field select {
  width: 100%;
  min-width: 0;
}
.move-field .btn {
  padding: 9px 12px;
}
.bill-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bill-actions button {
  flex: 1;
}
.modal-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0 0;
}
.sales-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .side-label,
  .side-bottom {
    display: none;
  }
  .nav-item {
    padding: 9px 10px;
  }
  .main-area {
    padding: 18px;
  }
  .order-workspace {
    grid-template-columns: 1fr;
  }
  .menu-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .bill-panel #bill-lines {
    max-height: 240px;
  }
  .order-modal {
    max-height: 96vh;
  }
  .floor-plan {
    min-height: 540px;
  }
}
@media (max-width: 560px) {
  .topbar {
    padding: 10px 12px;
    height: auto;
    align-items: flex-start;
    gap: 10px;
  }
  .top-meta {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .demo-pill {
    display: none;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .summary-grid,
  .inventory-summary,
  .sales-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-card {
    padding: 13px;
  }
  .summary-card strong {
    font-size: 23px;
  }
  .floor-plan {
    min-height: 480px;
    margin: 10px;
  }
  .table-node {
    min-width: 82px;
    min-height: 72px;
    padding: 5px;
  }
  .table-node.round {
    min-width: 72px;
    width: 72px;
    height: 72px;
  }
  .table-node.long {
    min-width: 98px;
  }
  .table-node small {
    font-size: 9px;
  }
  .floor-object {
    font-size: 10px;
    padding: 3px;
  }
  .floor-object strong {
    font-size: 9px;
  }
  .menu-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .menu-panel,
  .bill-panel {
    padding: 14px;
  }
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-heading .search-input {
    width: 100%;
  }
  .move-field {
    grid-template-columns: 1fr;
  }
  .move-field span {
    grid-column: auto;
  }
  .bill-actions {
    flex-direction: column;
  }
}

/* UX pass 3: tap floor tabs, swipe floors, product/stock forms and filtered sales */
.floor-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -8px 0 18px;
  padding: 12px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.floor-controls > .muted {
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.floor-tabs {
  display: flex;
  gap: 7px;
  align-items: center;
}
.floor-tab,
.period-tab {
  border: 1px solid #dce3ec;
  background: #f7f9fc;
  color: #596679;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  transition: 0.15s;
}
.floor-tab {
  min-width: 95px;
}
.floor-tab.active,
.period-tab.active {
  background: #2864e8;
  border-color: #2864e8;
  color: #fff;
  box-shadow: 0 3px 8px #2864e822;
}
.floor-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.table-node.free {
  background: #eef1f4;
  border-color: #d3d9e0;
  color: #4e5b6a;
}
.table-node.free .table-status {
  color: #647184;
}
.table-node.busy {
  background: #e1f6e9;
  border: 2px solid #2aa66a;
  color: #125b3d;
  box-shadow: 0 4px 16px #17865d20;
}
.table-node.busy .table-status {
  color: #14784d;
}
.table-node.busy small {
  color: #237652;
}
.floor-object {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #cbd3dd;
  border-radius: 8px;
  background: #e8edf3;
  color: #4b5868;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  user-select: none;
  transform-origin: center center;
}
.floor-object span {
  font-size: 17px;
}
.floor-object strong {
  font-size: 11px;
  white-space: nowrap;
}
.object-wall {
  background: #4d5968;
  color: white;
  border: 0;
  border-radius: 2px;
  padding: 0;
}
.object-wall span,
.object-wall strong {
  display: none;
}
.object-stairs {
  background: #fff0d6;
  border-color: #e7c78f;
}
.object-bar {
  background: #e4f2eb;
  border-color: #b6d9c5;
  color: #236647;
}
.object-door {
  background: #f5e9e5;
  border-color: #e2c7bd;
}
.object-plant {
  background: #e4f4e7;
  border-color: #c4e0c8;
  border-radius: 14px;
}
.layout-mode .floor-object {
  outline: 2px dashed #5b87ec;
  cursor: move;
  z-index: 4;
}
.layout-mode .floor-object.selected {
  outline: 3px solid #2864e8;
}
.product-photo,
.product-photo-placeholder {
  display: inline-flex;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  align-items: center;
  justify-content: center;
  background: #f0f4fa;
  font-size: 21px;
}
.menu-photo {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f4fa;
  align-self: center;
}
.product-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f0f4fa;
  font-size: 18px;
}
.menu-pick {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 7px;
  padding: 10px;
}
.menu-pick > span:not(.product-photo-placeholder) {
  font-weight: 600;
  line-height: 1.4;
}
.menu-pick strong {
  font-size: 14px;
}
.menu-pick small {
  color: var(--muted);
}
.sales-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.sales-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #596679;
}
.sales-filters input,
.sales-filters select {
  max-width: 210px;
}
.sales-filters [hidden] {
  display: none !important;
}
.period-tabs {
  display: flex;
  gap: 5px;
  background: #f0f3f8;
  padding: 4px;
  border-radius: 12px;
}
.period-tab {
  padding: 8px 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.period-tab.active {
  box-shadow: 0 2px 6px #1b4db022;
}
.modal {
  max-height: 94vh;
  overflow-y: auto;
}
.product-form-modal,
.stock-form-modal,
.object-edit-modal {
  width: min(700px, 100%);
  padding-bottom: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 20px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #455366;
  font-weight: 600;
  font-size: 12px;
  min-width: 0;
}
.form-field.full,
.image-field {
  grid-column: 1/-1;
}
.form-field input:not([type="checkbox"]):not([type="file"]),
.form-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce3ec;
  background: #fff;
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}
.form-field input:focus,
.form-field select:focus {
  border-color: #7ea1f5;
  box-shadow: 0 0 0 3px #e8efff;
}
.form-field small,
.field-label small {
  font-weight: 400;
  color: var(--muted);
}
.checkbox-field {
  flex-direction: row;
  align-items: center;
}
.checkbox-field input {
  width: 18px;
  height: 18px;
}
.image-upload-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.image-upload-row > div:last-child {
  flex: 1;
  min-width: 180px;
}
.image-upload-row input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}
.image-upload-row p {
  margin: 6px 0;
}
.image-upload-row #product-image-preview {
  width: 110px;
  height: 110px;
  border: 1px dashed #ccd5e1;
  border-radius: 12px;
  background: #f7f9fc;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
}
.image-upload-row #product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 20px;
}
.form-spacer {
  flex: 1;
}
.btn-danger {
  background: #fff0f0;
  color: #b42f38;
  border-color: #f0c8ca;
}
.stock-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 20px 0;
  padding: 14px;
  background: #f5f8fc;
  border-radius: 10px;
  color: #667386;
}
.stock-current strong {
  font-size: 22px;
  color: #1d6a4c;
}
.object-edit-modal .form-grid {
  padding-bottom: 24px;
}
.object-edit-modal input[type="range"] {
  width: 100%;
  accent-color: #2864e8;
}
.object-edit-modal output {
  color: #2864e8;
  font-weight: 700;
  margin-left: 5px;
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .side-label,
  .side-bottom {
    display: none;
  }
  .nav-item {
    padding: 9px 10px;
  }
  .main-area {
    padding: 18px;
  }
  .order-workspace {
    grid-template-columns: 1fr;
  }
  .menu-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .bill-panel #bill-lines {
    max-height: 240px;
  }
  .order-modal {
    max-height: 96vh;
  }
  .floor-plan {
    min-height: 540px;
  }
}
@media (max-width: 560px) {
  .topbar {
    padding: 10px 12px;
    height: auto;
    align-items: flex-start;
    gap: 10px;
  }
  .top-meta {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .demo-pill {
    display: none;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .summary-grid,
  .inventory-summary,
  .sales-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-card {
    padding: 13px;
  }
  .summary-card strong {
    font-size: 23px;
  }
  .floor-controls {
    gap: 8px;
    padding: 10px;
  }
  .floor-tabs {
    display: flex;
    flex: 1;
    gap: 8px;
  }
  .floor-tab {
    flex: 1;
    min-width: 0;
    padding: 12px 10px;
    font-size: 14px;
  }
  .floor-controls > .muted {
    flex-basis: 100%;
    font-size: 11px;
  }
  .floor-plan {
    min-height: 480px;
    margin: 10px;
    touch-action: pan-y;
  }
  .table-node {
    min-width: 82px;
    min-height: 72px;
    padding: 5px;
  }
  .table-node.round {
    min-width: 72px;
    width: 72px;
    height: 72px;
  }
  .table-node.long {
    min-width: 98px;
  }
  .table-node small {
    font-size: 9px;
  }
  .floor-object {
    font-size: 10px;
    padding: 3px;
  }
  .floor-object strong {
    font-size: 9px;
  }
  .menu-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .menu-panel,
  .bill-panel {
    padding: 14px;
  }
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-heading .search-input {
    width: 100%;
  }
  .move-field {
    grid-template-columns: 1fr;
  }
  .move-field span {
    grid-column: auto;
  }
  .bill-actions {
    flex-direction: column;
  }
  .sales-filters {
    align-items: stretch;
    gap: 10px;
  }
  .period-tabs {
    width: 100%;
    justify-content: stretch;
  }
  .period-tab {
    flex: 1;
  }
  .sales-filters label {
    justify-content: space-between;
  }
  .sales-filters input,
  .sales-filters select {
    max-width: 62%;
    min-width: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .form-field.full,
  .image-field {
    grid-column: auto;
  }
  .form-actions {
    padding: 0 16px;
    flex-wrap: wrap;
  }
  .product-form-modal,
  .stock-form-modal,
  .object-edit-modal {
    max-height: 95vh;
  }
  .image-upload-row {
    align-items: flex-start;
  }
}

/* UX pass 4: free object resize/rotation, removable floors, receiving invoice photo */
.floor-tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dce3ec;
  background: #f7f9fc;
  border-radius: 12px;
}
.floor-tab-wrap .floor-tab {
  border: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}
.floor-tab-wrap .floor-tab.active {
  background: #2864e8;
  color: #fff;
}
.floor-delete {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #fff0f0;
  color: #b42f38;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.floor-delete:hover {
  background: #fbdcde;
}
.object-resize-handle {
  display: none;
}
.layout-mode .object-resize-handle {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 15px;
  height: 15px;
  border-radius: 4px 0 6px 0;
  background: #2864e8;
  border: 2px solid #fff;
  cursor: nwse-resize;
  z-index: 8;
  touch-action: none;
}
.layout-mode .floor-object {
  overflow: visible;
  touch-action: none;
}
.layout-mode .floor-object strong {
  pointer-events: none;
}
#product-category-filter {
  min-width: 175px;
  max-width: 220px;
}
.receipt-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.receipt-preview {
  width: 100%;
  min-height: 90px;
  max-height: 250px;
  border: 1px dashed #ccd5e1;
  border-radius: 10px;
  background: #f7f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  color: #778397;
  font-size: 12px;
  overflow: hidden;
}
.receipt-preview img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 7px;
}
.receipt-upload small {
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}
.receipt-view-modal {
  width: min(760px, 100%);
}
.receipt-view-modal .modal-body img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
}
.receipt-view-modal .modal-body p {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 560px) {
  .floor-tab-wrap {
    flex: 1;
    min-width: 0;
    justify-content: space-between;
  }
  .floor-tab-wrap .floor-tab {
    flex: 1;
    min-width: 0;
    padding: 11px 8px;
  }
  .floor-delete {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }
  #product-category-filter {
    width: 100%;
    max-width: none;
  }
  .receipt-preview {
    min-height: 70px;
  }
}

/* UX revision 5: named areas, freely adjustable tables */
.floor-tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dce3ec;
  background: #f7f9fc;
  border-radius: 12px;
}
.floor-tab-wrap .floor-tab {
  border: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}
.floor-tab-wrap .floor-tab.active {
  background: #2864e8;
  color: #fff;
}
.floor-rename,
.floor-delete {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #3b526e;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 27px;
}
.floor-rename:hover {
  background: #e4edff;
  color: #1f58c7;
}
.floor-delete {
  background: #fff0f0;
  color: #b42f38;
  font-size: 18px;
}
.floor-delete:hover {
  background: #fbdcde;
}
.layout-mode .table-resize-handle {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  border-radius: 4px 0 7px 0;
  background: #2864e8;
  border: 2px solid #fff;
  cursor: nwse-resize;
  z-index: 8;
  touch-action: none;
}
.layout-mode .table-node {
  overflow: visible;
  touch-action: none;
  min-width: 45px;
  min-height: 45px;
}
.layout-mode .table-node strong,
.layout-mode .table-node small,
.layout-mode .table-node .table-icon,
.layout-mode .table-node .table-status {
  pointer-events: none;
}
.table-node {
  transform-origin: center center;
}
@media (max-width: 560px) {
  .floor-tab-wrap {
    flex: 1;
    min-width: 0;
    justify-content: space-between;
  }
  .floor-tab-wrap .floor-tab {
    flex: 1;
    min-width: 0;
    padding: 10px 6px;
  }
  .floor-rename,
  .floor-delete {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }
}

/* Audit log and admin sign-in (prototype only) */
.audit-lock-label {
  margin-left: auto;
  font-size: 11px;
  color: #7b8795;
}
.audit-login-modal {
  width: min(440px, calc(100vw - 28px));
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.audit-login-modal .form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #5f6b7b;
  font-weight: 600;
}
.audit-login-modal input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
}
.audit-login-modal .muted {
  line-height: 1.6;
}
.audit-login-modal .form-actions {
  margin-top: 4px;
}
.audit-login-modal .modal-head {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
#view-audit .table-toolbar .search-input {
  min-width: min(320px, 100%);
}
#view-audit .data-table td {
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
#view-audit .data-table td:nth-child(1) {
  white-space: nowrap;
  min-width: 130px;
}
#view-audit .data-table td:nth-child(5),
#view-audit .data-table td:nth-child(6) {
  min-width: 140px;
  color: #596779;
  font-size: 12px;
}
.audit-lock-label {
  display: inline-block;
}
@media (max-width: 700px) {
  #view-audit .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  #view-audit .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  #view-audit .table-toolbar .search-input {
    width: 100%;
    min-width: 0;
  }
  .audit-login-modal {
    padding: 18px;
  }
}

/* Main POS PIN gate */
.pos-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
}
.pos-login-overlay[hidden] {
  display: none;
}
.pos-login-card {
  width: min(100%, 380px);
  background: #fff;
  color: #1c2733;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 20px 70px #0004;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pos-login-card h1 {
  margin: 0;
  font-size: 25px;
}
.pos-login-card p {
  margin: 0 0 8px;
  color: #758191;
}
.pos-login-card label {
  font-weight: 600;
}
.pos-login-card input {
  width: 100%;
  padding: 13px;
  border: 1px solid #d5dce5;
  border-radius: 10px;
  font-size: 22px;
  letter-spacing: 0.25em;
  text-align: center;
}
.pos-login-card small {
  color: #758191;
}
.pos-login-card #pos-login-error {
  color: #c64242;
  min-height: 18px;
  font-size: 12px;
}
.pos-login-card button {
  width: 100%;
}
.pos-login-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #e8efff;
  color: #2457d6;
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 700;
}
/* Sales report export controls */
.sales-export-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sales-export-actions .btn {
  white-space: nowrap;
}
#sales-export-status:empty {
  display: none;
}
#sales-export-status {
  margin-top: 8px;
  line-height: 1.5;
}
#sales-export-status a {
  font-weight: 700;
  text-decoration: underline;
  margin-left: 6px;
}
@media (max-width: 900px) {
  #view-sales .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .sales-export-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 560px) {
  .sales-export-actions .btn {
    flex: 1 1 145px;
  }
}

/* Beer keg accounting and floating stock ledger */
.draft-beer-card .table-toolbar {
  align-items: flex-start;
}
.draft-beer-month-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.draft-beer-month-filter input {
  min-width: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}
#draft-beer-reset {
  border-color: var(--red);
  color: var(--red);
}
@media (max-width: 900px) {
  .draft-beer-month-filter {
    width: 100%;
  }
  .draft-beer-month-filter input {
    flex: 1;
  }
}
.draft-beer-card .table-toolbar .head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
#draft-beer-rows td small {
  color: var(--muted);
  line-height: 1.65;
}
#draft-beer-rows td:first-child {
  min-width: 200px;
}
#draft-beer-rows td:last-child {
  min-width: 145px;
}
#draft-beer-rows .stock-number {
  font-size: 18px;
}
#draft-beer-rows .stock-number.low {
  color: var(--red);
}
#stock-float-rows .stock-number {
  font-weight: 700;
}
#stock-float-rows .stock-number.low {
  color: var(--red);
}
#draft-beer-log-rows td,
#stock-float-log-rows td {
  white-space: normal;
  vertical-align: top;
}
@media (max-width: 900px) {
  .draft-beer-card .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .draft-beer-card .table-toolbar .head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .draft-beer-card .head-actions .btn {
    flex: 1 1 160px;
  }
}

/* Inventory category filtering stays readable on desktop and touch screens. */
#view-inventory .table-toolbar select.search-input {
  min-width: 165px;
  max-width: 240px;
}
@media (max-width: 760px) {
  #view-inventory .table-toolbar select.search-input {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

/* Compact paginated history tables and bill cancellation dialog */
.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line, #e5e7eb);
  flex-wrap: wrap;
}
.pagination-info {
  font-size: 12px;
  color: var(--muted, #64748b);
}
.pagination-buttons {
  display: flex;
  gap: 8px;
}
.pagination-buttons .btn {
  padding: 7px 12px;
  min-height: 34px;
}
.pagination-buttons .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.bill-cancel-items {
  display: grid;
  gap: 8px;
  margin: 12px 0 18px;
}
.bill-cancel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
}
.bill-cancel-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.bill-cancel-item small {
  color: var(--muted, #64748b);
}
.bill-cancel-item input {
  width: 90px;
  min-width: 90px;
}
.negative {
  color: #b42318;
}
@media (max-width: 640px) {
  .history-pagination {
    align-items: flex-start;
  }
  .bill-cancel-item {
    align-items: flex-start;
  }
  .bill-cancel-item input {
    width: 72px;
    min-width: 72px;
  }
}
