:root {
  --ink: #18212a;
  --muted: #65717d;
  --line: #dfe5ea;
  --paper: #f6f8fa;
  --panel: #ffffff;
  --nav: #102331;
  --nav-soft: #1a394b;
  --accent: #007f73;
  --accent-strong: #00695e;
  --warn: #f3b23d;
  --hot: #dd614a;
  --blue: #2e7bcf;
  --free: #45b36b;
  --shadow: 0 16px 40px rgba(27, 38, 49, .12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

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

.sidebar {
  color: #fff;
  background: var(--nav);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f7c85f;
  color: #102331;
  font-weight: 800;
  font-size: 26px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 13px;
}

.brand span {
  margin-top: 2px;
  color: #b7c6cf;
  font-size: 11px;
}

.nav-stack {
  display: grid;
  gap: 9px;
}

.nav-button {
  min-height: 74px;
  border-radius: 8px;
  color: #dce7ed;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 3px;
}

.nav-button.active,
.nav-button:focus-visible {
  color: #fff;
  background: var(--nav-soft);
  outline: 2px solid #f7c85f;
  outline-offset: 0;
}

.nav-icon {
  font-size: 25px;
  line-height: 1;
}

.nav-button span:last-child {
  font-size: 12px;
  font-weight: 700;
}

.user-panel {
  margin-top: auto;
  display: grid;
  gap: 6px;
}

.user-panel label {
  color: #b7c6cf;
  font-size: 12px;
}

.user-panel select {
  width: 100%;
  min-height: 45px;
  border: 1px solid #365467;
  border-radius: 8px;
  color: #fff;
  background: #183448;
  padding: 0 6px;
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.view {
  min-height: 0;
  display: none;
}

.view.active {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.cover {
  min-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(360px, 1.1fr);
  gap: 24px;
  align-items: center;
  padding: 34px;
}

.cover-copy img {
  width: min(320px, 80%);
  display: block;
  margin-bottom: 22px;
}

.cover-copy h1 {
  max-width: 620px;
  font-size: 44px;
}

.cover-copy p:not(.eyebrow) {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.4;
}

.cover-actions {
  display: grid;
  gap: 14px;
}

.cover-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: #f8fbfb;
  text-align: left;
}

.cover-card strong,
.cover-card span {
  display: block;
}

.cover-card strong {
  font-size: 24px;
}

.cover-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.topbar,
.panel,
.status-strip {
  border: 1px solid var(--line);
}

.topbar {
  min-height: 78px;
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
}

.status-strip {
  min-height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f9fbfc;
  padding: 6px;
}

.status-strip span {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.status-strip b {
  color: var(--ink);
}

.export-button {
  min-width: 180px;
  min-height: 56px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 900;
}

.report-panel,
.people-panel,
.personal-form {
  padding: 16px;
}

.report-filters {
  display: grid;
  grid-template-columns: 160px 180px auto;
  gap: 10px;
  align-items: end;
}

.report-filters label,
.personal-form label,
.device-frame label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-filters input,
.report-filters select,
.personal-form input,
.personal-form select,
.device-frame select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfb;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  margin-top: 4px;
  font-size: 24px;
}

.table-wrap {
  max-height: 56vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #edf5f4;
  color: var(--accent-strong);
  font-size: 13px;
  text-transform: uppercase;
}

.personal-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.personal-form {
  align-content: start;
  display: grid;
  gap: 12px;
}

.people-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.person-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfb;
}

.person-card strong,
.person-card span {
  display: block;
}

.person-card strong {
  font-size: 18px;
}

.person-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.waiter-stage {
  min-height: 0;
  display: grid;
  place-items: start center;
  overflow: auto;
}

.device-frame {
  width: min(390px, 100%);
  border: 12px solid #111827;
  border-radius: 28px;
  padding: 14px;
  background: #f6f8fa;
  box-shadow: 0 20px 50px rgba(16, 35, 49, .24);
  display: grid;
  gap: 12px;
}

.waiter-status {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px;
  color: var(--accent-strong);
  background: #e7f3f1;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.waiter-table-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.waiter-table-card {
  min-height: 74px;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: #111;
  text-align: center;
  border: 3px solid transparent;
}

.waiter-table-card.free { background: var(--free); }
.waiter-table-card.serving { background: var(--warn); }
.waiter-table-card.cooking { background: var(--hot); }
.waiter-table-card.ready { background: var(--blue); }

.waiter-table-card.blocked {
  opacity: .72;
}

.waiter-table-card.selected {
  border-color: #111;
  box-shadow: inset 0 0 0 2px #fff;
}

.waiter-table-card strong {
  font-size: 24px;
  line-height: 1;
}

.waiter-table-card span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.device-top {
  min-height: 54px;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  background: var(--nav);
}

.waiter-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.waiter-dish {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  display: grid;
  align-content: space-between;
}

.waiter-dish strong {
  font-size: 15px;
}

.waiter-dish span {
  color: var(--accent-strong);
  font-weight: 900;
}

.waiter-ticket {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.waiter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.waiter-actions button {
  min-height: 54px;
  border-radius: 8px;
  font-weight: 900;
}

.waiter-actions button:disabled,
.waiter-dish:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.waiter-ticket > div:first-child,
.waiter-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.waiter-line {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.main-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.panel {
  min-width: 0;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-panel,
.order-panel {
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.panel-head.compact {
  min-height: 44px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-tools {
  min-width: min(230px, 100%);
  display: grid;
  gap: 9px;
}

.undo-button {
  min-height: 42px;
  border-radius: 8px;
  color: #fff;
  background: rgb(255, 0, 0);
  border: 3px solid #fff;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.undo-button.armed {
  color: #111;
  background: #f7c85f;
  border-color: #111;
}

.undo-button:disabled {
  color: rgba(255, 255, 255, .62);
  background: rgba(255, 0, 0, .38);
  border-color: rgba(255, 255, 255, .45);
  cursor: not-allowed;
}

.segmented button {
  min-width: 86px;
  min-height: 42px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.selected {
  color: #fff;
  background: var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend .free { background: var(--free); }
.legend .serving { background: var(--warn); }
.legend .cooking { background: var(--hot); }
.legend .ready { background: var(--blue); }

.table-map {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  grid-auto-rows: minmax(260px, auto);
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.table-card {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 11px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  color: #111;
  text-align: left;
  min-height: 260px;
  cursor: pointer;
}

.table-card.free {
  grid-template-rows: 1fr;
}

.table-card.free { background: var(--free); }
.table-card.serving { background: var(--warn); color: #111; }
.table-card.cooking { background: var(--hot); color: #111; }
.table-card.ready { background: var(--blue); color: #111; }
.table-card.selected {
  border-color: #111;
  box-shadow: inset 0 0 0 2px #fff;
}

.free-table-summary {
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
}

.free-table-summary .table-number {
  font-size: 48px;
}

.free-table-summary .table-subtitle {
  margin-top: 0;
  font-size: 18px;
}

.table-card:focus-visible {
  outline: 3px solid #111;
  outline-offset: 2px;
}

.table-number {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.table-header {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(118px, .9fr) auto;
  gap: 8px;
  align-items: start;
}

.table-id-block {
  min-width: 58px;
}

.paid-button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  color: var(--accent-strong);
  background: #f0fbf8;
  border: 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.paid-button:active {
  transform: translateY(1px);
}

.paid-button:disabled {
  color: rgba(16, 35, 49, .55);
  background: rgba(255, 255, 255, .55);
  border-color: rgba(16, 35, 49, .35);
  box-shadow: none;
  cursor: not-allowed;
}

.table-card.serving .paid-button {
  color: var(--accent-strong);
  background: #f0fbf8;
}

.paid-button.prepaid {
  color: #fff;
  background: rgb(255, 0, 0);
}

.table-card.prepaid {
  box-shadow: inset 0 0 0 4px rgb(255, 0, 0), var(--shadow);
}

.table-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  opacity: .9;
}

.table-total {
  min-width: 104px;
  min-height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .22);
  color: #111;
  font-weight: 900;
  padding: 0 10px;
  font-size: 19px;
}

.dish-checklist {
  display: grid;
  gap: 7px;
  align-content: start;
}

.dish-check {
  min-height: 38px;
  border-radius: 8px;
  padding: 7px;
  display: grid;
  grid-template-columns: 30px 34px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  background: rgba(255, 255, 255, .18);
  color: #111;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.dish-quantity {
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.dish-check input {
  width: 26px;
  height: 26px;
  accent-color: var(--accent);
}

.dish-name {
  line-height: 1.15;
  min-width: 0;
}

.dish-check.done .dish-name {
  text-decoration: line-through;
  opacity: .72;
}

.unit-checks {
  display: inline-flex;
  justify-content: flex-end;
  gap: 7px;
  min-width: 24px;
}

.unit-check {
  width: 19px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #111;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.table-card.serving .dish-check,
.table-card.serving .table-total {
  background: rgba(255, 255, 255, .34);
}

.chef-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.chef-actions button {
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.chef-actions .prebill {
  color: var(--accent-strong);
  background: #f0fbf8;
}

.chef-actions .invoice {
  color: #fff;
  background: var(--nav);
}

.order-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.order-title span:not(.state-pill) {
  color: var(--muted);
  font-size: 13px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.state-pill.cooking { background: var(--hot); }
.state-pill.ready { background: var(--blue); }

.state-pill.serving { background: var(--warn); color: #33230b; }
.state-pill.free { background: var(--free); }

.detail-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  width: min(440px, calc(100vw - 150px));
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 14px;
  transform: translateX(calc(100% + 36px));
  transition: transform .24s ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-close {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  color: #fff;
  background: var(--nav);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.drawer-total {
  min-height: 70px;
  border-radius: 8px;
  padding: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f3f8f7;
  border: 1px solid #cfe7e3;
}

.drawer-total span {
  color: var(--muted);
  font-weight: 800;
}

.drawer-total strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.drawer-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.drawer-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.drawer-section-head span {
  min-height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--accent-strong);
  background: #e7f3f1;
  font-weight: 900;
  white-space: nowrap;
}

.drawer-checklist {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow: auto;
}

.drawer-checklist .dish-check {
  min-height: 56px;
  grid-template-columns: 38px 38px minmax(0, 1fr) auto;
  color: var(--ink);
  background: #f5f8f9;
  border: 1px solid var(--line);
  font-size: 16px;
}

.drawer-checklist .dish-check input {
  width: 32px;
  height: 32px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.drawer-actions button {
  min-height: 58px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
}

.receipt-preview {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.receipt-preview.open {
  opacity: 1;
  pointer-events: auto;
}

.receipt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 35, 49, .44);
}

.receipt-panel {
  position: relative;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  box-shadow: 0 22px 70px rgba(16, 35, 49, .32);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.receipt-toolbar {
  min-height: 76px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.thermal-ticket {
  width: 302px;
  max-width: calc(100vw - 64px);
  margin: 18px auto;
  padding: 14px 12px;
  color: #111;
  background: #fff;
  border: 1px solid #d8dee3;
  box-shadow: 0 12px 28px rgba(27, 38, 49, .16);
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.ticket-logo {
  width: 190px;
  max-width: 100%;
  display: block;
  margin: 0 auto 4px;
}

.thermal-ticket h3 {
  margin: 4px 0 6px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.thermal-ticket p {
  margin: 2px 0;
}

.ticket-business {
  font-weight: 900;
}

.ticket-divider {
  border-top: 1px dashed #111;
  margin: 9px 0;
}

.ticket-info,
.receipt-lines,
.receipt-total {
  display: grid;
  gap: 4px;
  text-align: left;
}

.ticket-info div,
.receipt-line,
.receipt-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.receipt-line span:first-child {
  min-width: 0;
}

.receipt-total {
  font-size: 14px;
  font-weight: 900;
}

.receipt-total strong {
  font-size: 16px;
}

.ticket-note {
  margin-top: 10px;
  font-size: 11px;
  text-align: center;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.confirm-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 35, 49, .62);
  backdrop-filter: blur(2px);
}

.confirm-box {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px 24px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(16, 35, 49, .32);
  overflow: hidden;
}

.confirm-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--accent);
}

.confirm-heading {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
}

.confirm-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-size: 32px;
  font-weight: 900;
}

.confirm-box h2 {
  font-size: 28px;
  line-height: 1.1;
}

.confirm-box p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.4;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.confirm-actions.with-alt {
  grid-template-columns: 1fr 1fr 1fr;
}

.confirm-actions button {
  min-height: 72px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

#confirmCancel {
  color: var(--accent-strong);
  background: #e7f3f1;
}

#confirmAlt {
  color: #102331;
  background: #f7c85f;
}

#confirmAccept {
  color: #fff;
  background: var(--accent);
}

.confirm-actions .hidden {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  min-width: 260px;
  max-width: min(520px, calc(100vw - 28px));
  min-height: 54px;
  border-radius: 8px;
  padding: 14px 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--nav);
  box-shadow: 0 14px 36px rgba(16, 35, 49, .28);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, 120px);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.category-row button,
.pay-grid button,
.action-bar button,
.primary,
.secondary,
.ghost {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 850;
}

.category-row button {
  color: var(--muted);
  background: #eef3f5;
}

.category-row button.active {
  color: #fff;
  background: var(--accent);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dish-button {
  min-height: 76px;
  border-radius: 8px;
  padding: 8px;
  background: #f5f8f9;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  display: grid;
  align-content: space-between;
}

.dish-button strong {
  font-size: 14px;
  line-height: 1.15;
}

.dish-button span {
  color: var(--accent-strong);
  font-weight: 900;
}

.ticket {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.ticket-head,
.ticket-line,
.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ticket-head {
  padding: 10px;
  background: #f3f6f8;
}

.ticket-lines {
  max-height: 118px;
  overflow: auto;
}

.ticket-line {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.totals {
  border-top: 1px solid var(--line);
  padding: 10px;
  font-size: 14px;
}

.totals strong {
  font-size: 20px;
  color: var(--accent-strong);
}

.action-bar {
  display: grid;
  grid-template-columns: .9fr .75fr 1.25fr;
  gap: 8px;
}

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:active,
.primary:focus-visible {
  background: var(--accent-strong);
}

.secondary {
  color: var(--accent-strong);
  background: #e7f3f1;
}

.ghost {
  min-width: 92px;
  color: var(--accent-strong);
  background: #edf5f4;
}

.queue-panel,
.payment-panel {
  padding: 12px;
}

.command-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.command-card {
  min-height: 82px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--hot);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 4px;
  background: #fffafa;
}

.command-card strong {
  font-size: 15px;
}

.command-card span {
  color: var(--muted);
  font-size: 13px;
}

.client-fields {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  margin: 8px 0;
}

.client-fields input {
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-grid button {
  background: #f2f5f7;
  color: var(--ink);
}

.pay-grid .wide,
.primary.full {
  grid-column: 1 / -1;
}

.primary.full {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .pos-shell {
    grid-template-columns: 94px minmax(0, 1fr);
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    width: min(430px, calc(100vw - 112px));
  }

  .table-map {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    grid-auto-rows: minmax(260px, auto);
  }
}

@media (max-width: 760px) {
  .pos-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 8px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .brand {
    min-height: 52px;
    grid-template-columns: auto;
  }

  .brand div:last-child {
    display: none;
  }

  .nav-stack {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-button {
    min-height: 56px;
  }

  .user-panel {
    width: 118px;
    margin: 0;
  }

  .workspace {
    padding: 10px;
    overflow: visible;
  }

  .topbar {
    display: grid;
  }

  .status-strip {
    overflow: auto;
  }

  .table-map {
    grid-template-columns: 1fr;
  }

  .table-header {
    grid-template-columns: minmax(58px, auto) 1fr;
  }

  .table-total {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .menu-grid,
  .command-list {
    grid-template-columns: 1fr 1fr;
  }

  .action-bar,
  .category-row {
    grid-template-columns: 1fr 1fr;
  }

  .action-bar .primary {
    grid-column: 1 / -1;
  }

  .detail-drawer {
    top: 82px;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}
