:root {
  --demo-top: 0px;
  --bg: #fdf7f2;
  --bg-2: #f8ece0;
  --surface: #ffffff;
  --surface-2: #fffaf5;
  --text: #1c0f07;
  --text-2: #4a2d1c;
  --muted: #8a6a53;
  --faint: #b8a08c;
  --border: #f0e0d1;
  --border-2: #e2cbb2;
  --primary: #ea580c;
  --primary-2: #f97316;
  --primary-soft: #ffedd5;
  --accent: #fbbf24;
  --accent-soft: #fef3c7;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --shadow-sm: 0 1px 2px rgba(28, 15, 7, 0.05);
  --shadow: 0 4px 14px rgba(28, 15, 7, 0.08);
  --shadow-lg: 0 18px 40px rgba(28, 15, 7, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --topbar-h: 60px;
  --font: system-ui, 'Segoe UI', Tahoma, sans-serif;
  --service: 10;
}
html[data-theme='dark'] {
  --bg: #1a0d05;
  --bg-2: #2a1608;
  --surface: #26140a;
  --surface-2: #321a0c;
  --text: #ffedd5;
  --text-2: #fed7aa;
  --muted: #c89968;
  --faint: #8a6a45;
  --border: #4a2410;
  --border-2: #6d3718;
  --primary: #fb923c;
  --primary-2: #fdba74;
  --primary-soft: #431407;
  --accent: #fbbf24;
  --accent-soft: #3b2a06;
  --success: #4ade80;
  --success-soft: #052e1a;
  --warn: #fbbf24;
  --warn-soft: #3b2a06;
  --danger: #f87171;
  --danger-soft: #3b0e0e;
  --info: #60a5fa;
  --info-soft: #0c1e3d;
  --purple: #a78bfa;
  --purple-soft: #1e1b4b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  padding-top: var(--demo-top, 0px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 8px;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: linear-gradient(160deg, var(--primary) 0%, #c2410c 55%, #9a3412 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.45s,
    visibility 0.45s;
}
html[data-theme='dark'] .splash {
  background: linear-gradient(160deg, #431407 0%, #2a0a05 60%, #1a0604 100%);
}
.splash.hide {
  opacity: 0;
  visibility: hidden;
}
.splash-inner {
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: splashIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.splash-logo {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(6px);
  font-size: 38px;
}
.splash-brandname {
  filter: blur(7px);
  font-weight: 800;
  font-size: 20px;
}
.splash-generic {
  font-size: 12px;
  opacity: 0.85;
  margin-top: -8px;
}
.splash-title {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}
.splash-credit {
  font-size: 10.5px;
  letter-spacing: 3px;
  font-weight: 300;
  opacity: 0.75;
  margin-top: 24px;
}
.splash-credit span {
  animation: glow 2.6s ease-in-out infinite;
}
@keyframes glow {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: var(--demo-top, 0px);
  z-index: 60;
  height: auto;
  min-height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px;
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.topbar-title {
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-title .t-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.spacer {
  flex: 1;
}
/* Phone top bar: the title keeps a row of its own, the sample-data badge below it. */
.topbar-break {
  display: none;
}
html.mobile-layout .topbar-row {
  flex-wrap: wrap;
  gap: 2px 6px;
}
html.mobile-layout .topbar-row .spacer {
  display: none;
}
html.mobile-layout .topbar-row .badge-demo {
  order: 10;
  margin-inline-start: auto;
}
html.mobile-layout .topbar-row .topbar-break {
  flex-basis: 100%;
  display: block;
}
html.mobile-layout .topbar-title {
  overflow: hidden;
  flex: 1 1 auto;
}
html.mobile-layout .topbar-title .t-txt {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  overflow: hidden;
}
.badge-demo {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--bg-2);
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.dot-badge {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-badge {
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.role-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch;
}
.role-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  background: var(--bg-2);
  color: var(--muted);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.role-tab:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.role-tab.active {
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 25%, transparent);
}
.role-tab .rt-ic {
  font-size: 15px;
}

.side-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--bg-2);
}
.side-toggle input {
  width: auto;
  min-height: auto;
}

.content {
  padding: 16px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
html.mobile-layout .content {
  padding: 12px 12px 96px;
}

/* Bottom nav */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}
html.mobile-layout .bottom-nav {
  display: flex;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  min-height: 48px;
  justify-content: center;
  position: relative;
}
.bn-item svg {
  width: 20px;
  height: 20px;
}
.bn-item.active {
  color: var(--primary);
}
.bn-ic-wrap {
  padding: 3px 10px;
  border-radius: 10px;
  display: flex;
}
.bn-item.active .bn-ic-wrap {
  background: var(--primary-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition:
    transform 0.1s,
    background 0.15s;
  min-height: 42px;
}
.btn:hover {
  background: var(--bg-2);
}
.btn:active {
  transform: scale(0.975);
}
.btn svg {
  width: 17px;
  height: 17px;
}
.btn-primary {
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}
.btn-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  min-height: 36px;
}
.btn-lg {
  padding: 13px 22px;
  font-size: 15px;
  min-height: 50px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 14.5px;
  font-weight: 800;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.grid {
  display: grid;
  gap: 14px;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
html.mobile-layout .grid-2,
html.mobile-layout .grid-3,
html.mobile-layout .grid-4 {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
  min-height: 42px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.field input.err {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field-err {
  font-size: 11.5px;
  color: var(--danger);
  font-weight: 600;
  min-height: 14px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 21px;
  font-weight: 800;
  margin: 0;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 0;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.kpi .k-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 9px;
  font-size: 17px;
}
.kpi .k-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.kpi .k-val {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.kpi .k-sub {
  font-size: 11px;
  color: var(--faint);
  margin-top: 3px;
  font-weight: 600;
}
.kpi.green .k-ic {
  background: var(--success-soft);
  color: var(--success);
}
.kpi.amber .k-ic {
  background: var(--warn-soft);
  color: var(--warn);
}
.kpi.red .k-ic {
  background: var(--danger-soft);
  color: var(--danger);
}
.kpi.purple .k-ic {
  background: var(--purple-soft);
  color: var(--purple);
}
.kpi.blue .k-ic {
  background: var(--info-soft);
  color: var(--info);
}

/* Customer view */
.menu-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  position: sticky;
  top: calc(var(--topbar-h) + var(--demo-top, 0px) + 90px);
  background: var(--bg);
  padding: 10px 0;
  z-index: 30;
  -webkit-overflow-scrolling: touch;
}
.menu-tab {
  padding: 9px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.menu-section {
  margin-bottom: 24px;
}
.menu-section-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .item-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
html.mobile-layout .item-grid {
  grid-template-columns: 1fr;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.2s;
  text-align: start;
  width: 100%;
  display: flex;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.item-card.unavailable {
  opacity: 0.55;
}
.item-card.unavailable::after {
  content: 'خلص';
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.item-thumb {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  overflow: hidden;
}
.item-thumb svg {
  width: 100%;
  height: 100%;
}
.item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.item-name {
  font-weight: 800;
  font-size: 14.5px;
  margin: 0;
  line-height: 1.4;
}
.item-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.item-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.item-price {
  font-weight: 900;
  font-size: 15px;
  color: var(--primary);
}
.item-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.item-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}
.badge-pop {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-spicy {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-veg {
  background: var(--success-soft);
  color: var(--success);
}

.table-info-bar {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.table-info-bar::before {
  content: '';
  position: absolute;
  top: -30%;
  inset-inline-end: -10%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.table-info-bar .tib-ic {
  font-size: 32px;
  position: relative;
  z-index: 1;
}
.table-info-bar .tib-txt {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}
.table-info-bar .tib-title {
  font-weight: 900;
  font-size: 17px;
  margin: 0;
}
.table-info-bar .tib-sub {
  font-size: 12px;
  opacity: 0.9;
  margin: 2px 0 0;
}

.cat-icon-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cat-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  min-width: 72px;
  cursor: pointer;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
}
.cat-icon:hover {
  border-color: var(--primary);
}
.cat-icon .ci-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.cat-icon .ci-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-2);
  text-align: center;
  line-height: 1.2;
}

/* Cart drawer (customer) */
.cart-bar {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  inset-inline: 20px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  z-index: 80;
  max-width: 640px;
  margin: 0 auto;
  transition: transform 0.2s;
}
.cart-bar.hidden {
  transform: translateY(calc(100% + 40px));
  pointer-events: none;
}
html.mobile-layout .cart-bar {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.cart-bar .cb-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 15px;
}
.cart-bar .cb-txt {
  flex: 1;
  font-weight: 800;
  font-size: 14px;
}
.cart-bar .cb-total {
  font-weight: 900;
  font-size: 16px;
}

/* Table map (cashier) */
.tables-map {
  position: relative;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 500px;
  border: 1px dashed var(--border-2);
  overflow: hidden;
}
.table-shape {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.table-shape:hover {
  transform: scale(1.06);
  border-color: var(--primary);
  z-index: 5;
}
.table-shape.square {
  width: 70px;
  height: 70px;
  border-radius: 12px;
}
.table-shape.round {
  width: 70px;
  height: 70px;
  border-radius: 50%;
}
.table-shape.st-empty {
  background: var(--muted);
}
.table-shape.st-ordered {
  background: var(--warn);
}
.table-shape.st-eating {
  background: var(--info);
}
.table-shape.st-wants_bill {
  background: var(--success);
  animation: wantBill 1.6s infinite;
}
.table-shape.st-needs_cleaning {
  background: var(--danger);
}
@keyframes wantBill {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(22, 163, 74, 0);
  }
}
.table-shape .ts-num {
  font-size: 17px;
}
.table-shape .ts-sub {
  font-size: 9.5px;
  font-weight: 700;
  opacity: 0.95;
  margin-top: 1px;
  line-height: 1.1;
  text-align: center;
  padding: 0 2px;
}
.table-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.table-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lg-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}
.lg-dot.sq {
  border-radius: 3px;
}
.lg-dot.rd {
  border-radius: 50%;
}

/* Kitchen board */
.kitchen-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.kitchen-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}
.kitchen-card.urgent {
  border-color: var(--warn);
}
.kitchen-card.critical {
  border-color: var(--danger);
  background: linear-gradient(180deg, var(--danger-soft) 0%, var(--surface) 40%);
}
.kitchen-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.kitchen-head .kh-id {
  font-weight: 900;
  font-size: 15px;
}
.kitchen-head .kh-type {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
}
.kitchen-head .kh-type.takeaway {
  background: var(--info-soft);
  color: var(--info);
}
.kitchen-head .kh-type.delivery {
  background: var(--purple-soft);
  color: var(--purple);
}
.kitchen-timer {
  margin-inline-start: auto;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--success-soft);
  color: var(--success);
}
.kitchen-timer.urgent {
  background: var(--warn-soft);
  color: var(--warn);
}
.kitchen-timer.critical {
  background: var(--danger-soft);
  color: var(--danger);
  animation: pulseTimer 1.2s infinite;
}
@keyframes pulseTimer {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
.kitchen-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kitchen-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.15s;
}
.kitchen-item:hover {
  background: var(--primary-soft);
}
.kitchen-item.done {
  opacity: 0.55;
  text-decoration: line-through;
}
.kitchen-item .ki-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--surface);
  font-size: 12px;
}
.kitchen-item.done .ki-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.kitchen-item .ki-body {
  flex: 1;
  min-width: 0;
}
.kitchen-item .ki-name {
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1.4;
}
.kitchen-item .ki-opts {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 1px;
}
.kitchen-item .ki-qty {
  font-weight: 900;
  font-size: 14px;
  color: var(--primary);
  flex-shrink: 0;
}
.kitchen-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.kitchen-actions .btn {
  flex: 1;
}

/* Cashier / bill */
.bill-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bill-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  align-items: flex-start;
}
.bill-item:last-child {
  border-bottom: none;
}
.bill-item .bi-l {
  flex: 1;
  min-width: 0;
}
.bill-item .bi-name {
  font-weight: 700;
}
.bill-item .bi-opts {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.bill-item .bi-r {
  font-weight: 800;
  text-align: end;
  flex-shrink: 0;
}
.bill-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}
.bill-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.bill-row.total {
  font-size: 19px;
  font-weight: 900;
  color: var(--text);
  padding-top: 11px;
  border-top: 1px dashed var(--border);
  margin-top: 6px;
}
.split-person {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 11px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.split-person-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 6px;
}
.split-person-items {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.split-person-amount {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary);
}
.split-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

/* Printable receipt */
.receipt {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  max-width: 420px;
  margin: 0 auto;
  font-family: var(--font);
}
html[data-theme='dark'] .receipt {
  background: #1a0f08;
  color: #f5e2d0;
  border-color: var(--border);
}
.receipt .rh {
  text-align: center;
  border-bottom: 2px dashed #999;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.receipt .rh .r-brand {
  font-weight: 900;
  font-size: 17px;
  filter: blur(6px);
}
.receipt .rh .r-sub {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}
.receipt .r-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12.5px;
}
.receipt .r-row.bold {
  font-weight: 900;
  font-size: 14px;
  padding-top: 8px;
  border-top: 1px solid #ccc;
  margin-top: 6px;
}
.receipt .r-total {
  text-align: center;
  font-weight: 900;
  font-size: 18px;
  padding-top: 10px;
  border-top: 2px dashed #999;
  margin-top: 10px;
}
.receipt .r-foot {
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 2.5px;
  color: #999;
  margin-top: 14px;
  font-weight: 300;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.search-wrap input {
  padding-inline-start: 36px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  min-height: 42px;
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.chip {
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:hover {
  background: var(--bg-2);
}
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active {
  color: var(--primary);
  border-color: var(--primary);
}
.tab .t-count {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
}
.tab.active .t-count {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Table */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.tbl th,
table.tbl td {
  padding: 11px 13px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl th {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
table.tbl tr:last-child td {
  border-bottom: none;
}
table.tbl tbody tr:hover {
  background: var(--surface-2);
}
.num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s,
    visibility 0.2s;
  backdrop-filter: blur(3px);
}
.overlay.show {
  opacity: 1;
  visibility: visible;
}
html.mobile-layout .overlay {
  align-items: flex-end;
  padding: 0;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.overlay.show .modal {
  transform: none;
}
html.mobile-layout .modal {
  border-radius: 22px 22px 0 0;
  max-width: none;
  max-height: 94vh;
  transform: translateY(100%);
}
html.mobile-layout .overlay.show .modal {
  transform: none;
}
.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.modal-body {
  padding: 18px;
}
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  flex-wrap: wrap;
}
.grabber {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-2);
  margin: 9px auto 0;
}

/* Toast */
.toasts {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
html.mobile-layout .toasts {
  bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  inset-inline: 14px;
}
.toast {
  background: var(--text);
  color: var(--surface);
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
  max-width: 340px;
}
html[data-theme='dark'] .toast {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast button {
  color: var(--primary-2);
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: underline;
}

/* Tour */
.tour-spot {
  position: fixed;
  z-index: 400;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(8, 12, 16, 0.62);
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
  border: 2px solid var(--primary-2);
}
.tour-tip {
  position: fixed;
  z-index: 401;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.tour-tip .t-step {
  font-size: 11px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.tour-tip .t-txt {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 11px;
}
.tour-tip .t-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tour-tip .t-skip {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
}

/* Empty */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty .e-ic {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  margin: 0 auto 14px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.empty h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
}
.empty p {
  margin: 0 0 16px;
  font-size: 13px;
}

/* Skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--border) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shim 1.1s infinite;
  border-radius: 8px;
}
@keyframes shim {
  to {
    background-position: -200% 0;
  }
}

/* Chart */
.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.bar-anim {
  transform-origin: bottom;
  animation: barGrow 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
}
@keyframes barGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* Side-by-side mode */
.side-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .side-layout {
    grid-template-columns: 1fr;
  }
}

/* Phone mode */
html.phone-mode {
  background: #0c1216;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 0;
}
html.phone-mode body {
  width: 390px;
  height: 790px;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 44px;
  border: 11px solid #1b2429;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding-top: 0;
  position: relative;
  background: var(--bg);
}
html.phone-mode .app-shell {
  height: 100%;
  overflow: hidden;
}
html.phone-mode .content {
  overflow-y: auto;
  height: calc(100% - 130px);
  padding-bottom: 96px;
}
html.phone-mode .bottom-nav {
  display: flex;
  position: absolute;
}
html.phone-mode .toasts {
  position: absolute;
}
html.phone-mode .overlay {
  position: absolute;
}
html.phone-mode .tour-spot,
html.phone-mode .tour-tip {
  position: absolute;
}
html.phone-mode .cart-bar {
  position: absolute;
}
html.phone-mode .item-grid {
  grid-template-columns: 1fr;
}
.mobile-toggle {
  display: none;
}
@media (min-width: 768px) {
  .mobile-toggle {
    display: inline-flex;
  }
}
html.phone-mode .mobile-toggle {
  display: inline-flex;
}

/* Print */
@media print {
  body {
    background: #fff;
    padding: 0;
  }
  .topbar,
  .bottom-nav,
  .toasts,
  .no-print,
  .tour-spot,
  .tour-tip,
  .cart-bar {
    display: none !important;
  }
  .content {
    padding: 0;
    max-width: none;
  }
  .card,
  .tbl-wrap,
  .receipt {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

@media (max-width: 520px) {
  .page-title {
    font-size: 19px;
  }
  .kpi .k-val {
    font-size: 20px;
  }
  .table-info-bar {
    padding: 12px 14px;
  }
}
