:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #64706a;
  --line: #dce3df;
  --panel: #ffffff;
  --soft: #f5f7f2;
  --green: #167a55;
  --green-dark: #0e5f42;
  --red: #b73535;
  --gold: #d69528;
  --blue: #2f6f9f;
  --shadow: 0 20px 55px rgba(27, 38, 31, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef3ee;
  color: var(--ink);
}

.manager-topbar {
  display: none;
}

/* Vedrix POS manager workspace */
body[data-app-mode="back-office"] {
  background: #edf2f7;
}

body[data-app-mode="back-office"] .manager-topbar {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 32px;
  background: linear-gradient(110deg, #e74d3b, #ce3c32);
  color: #fff;
  box-shadow: 0 2px 9px rgba(71, 28, 25, .2);
}

.manager-logo {
  color: #fff;
  font-size: 1.55rem;
  font-weight: 950;
  font-style: italic;
  letter-spacing: .08em;
  text-decoration: none;
}

.manager-logo span {
  display: block;
  margin-top: -4px;
  font-size: .56rem;
  font-style: normal;
  letter-spacing: .28em;
}

.manager-breadcrumb {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 1.1rem;
  font-weight: 700;
}

.menu-glyph {
  font-size: 1.45rem;
}

.manager-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 750;
}

.manager-logout {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  padding: 0 12px;
  font-weight: 800;
}

body[data-app-mode="back-office"] .app-shell {
  min-height: calc(100vh - 76px);
  grid-template-columns: 270px minmax(0, 1fr);
}

body[data-app-mode="back-office"] .sidebar {
  padding: 22px 15px;
  gap: 20px;
  color: #253647;
  background: #fff;
  border-right: 1px solid #d6dee7;
}

body[data-app-mode="back-office"] .brand-block {
  padding: 0 10px 12px;
}

body[data-app-mode="back-office"] .brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #e84e3d, #af2f2d);
  color: #fff;
  box-shadow: 0 6px 15px rgba(207, 60, 50, .22);
}

body[data-app-mode="back-office"] .sidebar .eyebrow,
body[data-app-mode="back-office"] .store-picker span {
  color: #7d8b9a;
}

body[data-app-mode="back-office"] .nav-tabs {
  gap: 4px;
}

body[data-app-mode="back-office"] .tab-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  color: #34485c;
  font-weight: 760;
}

body[data-app-mode="back-office"] .tab-button:hover {
  background: #f1f4f7;
}

body[data-app-mode="back-office"] .tab-button.active {
  background: #e8eef4;
  color: #d24435;
  box-shadow: inset 3px 0 #e74d3b;
}

body[data-app-mode="back-office"] .status-panel {
  color: #587084;
  margin-top: 8px;
}

body[data-app-mode="back-office"] .store-picker {
  color: #34485c;
}

body[data-app-mode="back-office"] .store-picker select {
  border-color: #cfd9e2;
  background: #fff;
}

body[data-app-mode="back-office"] .workspace {
  padding: 28px 34px 42px;
}

body[data-app-mode="back-office"] .workspace-header {
  min-height: 68px;
  margin-bottom: 22px;
}

body[data-app-mode="back-office"] .workspace-header h2 {
  color: #1d3043;
  font-size: 1.78rem;
}

body[data-app-mode="back-office"] .dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

body[data-app-mode="back-office"] .metric-tile {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 56, 77, .14);
}

body[data-app-mode="back-office"] .metric-tile::after {
  position: absolute;
  right: 18px;
  bottom: 8px;
  color: rgba(255,255,255,.18);
  font-size: 4rem;
  font-weight: 900;
}

body[data-app-mode="back-office"] .metric-tile span {
  color: rgba(255,255,255,.9);
}

body[data-app-mode="back-office"] .metric-tile strong {
  font-size: 2.2rem;
}

body[data-app-mode="back-office"] .metric-tile:nth-child(1) { background: linear-gradient(135deg, #00a85a, #008d59); }
body[data-app-mode="back-office"] .metric-tile:nth-child(1)::after { content: "$"; }
body[data-app-mode="back-office"] .metric-tile:nth-child(2) { background: linear-gradient(135deg, #17bde5, #079bc6); }
body[data-app-mode="back-office"] .metric-tile:nth-child(2)::after { content: "✓"; }
body[data-app-mode="back-office"] .metric-tile:nth-child(3) { background: linear-gradient(135deg, #e94f3d, #c73c35); }
body[data-app-mode="back-office"] .metric-tile:nth-child(3)::after { content: "◷"; }
body[data-app-mode="back-office"] .metric-tile:nth-child(4) { background: linear-gradient(135deg, #ff9d1d, #ee7612); }
body[data-app-mode="back-office"] .metric-tile:nth-child(4)::after { content: "▣"; }
body[data-app-mode="back-office"] .metric-tile:nth-child(5) { background: linear-gradient(135deg, #526bde, #3d55bc); }
body[data-app-mode="back-office"] .metric-tile:nth-child(5)::after { content: "▤"; }
body[data-app-mode="back-office"] .metric-tile:nth-child(6) { background: linear-gradient(135deg, #7b5fd2, #5942a8); }
body[data-app-mode="back-office"] .metric-tile:nth-child(6)::after { content: "%"; }

body[data-app-mode="back-office"] .panel-section,
body[data-app-mode="back-office"] .orders-table-wrap,
body[data-app-mode="back-office"] .item-form,
body[data-app-mode="back-office"] .settings-form {
  border: 1px solid #d7e0e8;
  border-top: 4px solid #12a765;
  border-radius: 6px;
  box-shadow: 0 5px 18px rgba(44, 60, 77, .07);
}

body[data-app-mode="back-office"] .dashboard-layout {
  grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr);
  gap: 22px;
}

body[data-app-mode="back-office"] .action-button,
body[data-app-mode="back-office"] .recent-order {
  border-radius: 5px;
  box-shadow: none;
}

body[data-app-mode="back-office"] .report-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-app-mode="back-office"] .report-row {
  padding: 13px 0;
}

body[data-app-mode="back-office"] .primary-button {
  background: #e14b3b;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eef3ee;
}

.login-screen[hidden] {
  display: none !important;
}

.login-screen.is-unlocked {
  display: none !important;
}

.pos-sleep-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: radial-gradient(circle at center, #1c2d3c, #080d12 70%);
  color: #fff;
  text-align: center;
}

.pos-sleep-screen[hidden] {
  display: none;
}

.pos-sleep-screen strong {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.pos-sleep-screen span:last-child {
  color: #b8c6d2;
  font-size: 1rem;
}

.sleep-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  border-radius: 18px;
  background: #e74d3b;
  font-size: 2rem;
  font-weight: 950;
}

.login-box {
  width: min(380px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.login-role {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.login-role.active {
  border-color: #e74d3b;
  background: #fff0ed;
  color: #c63e31;
}

.login-help {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: #16241d;
  color: #f7faf6;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0bb47, #e86e4a);
  color: #16241d;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar .eyebrow {
  color: #aab9b0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: 1.25rem;
}

h2 {
  font-size: 1.6rem;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.mode-links {
  display: grid;
  gap: 8px;
}

.mode-links a {
  color: #f7faf6;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 11px 14px;
}

.tab-button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: transparent;
  color: #f7faf6;
  text-align: left;
  padding: 0 14px;
  font-weight: 800;
}

.tab-button.active {
  background: #f7faf6;
  color: #16241d;
}

.status-panel {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c8d5ce;
  font-weight: 700;
}

.store-picker {
  display: grid;
  gap: 6px;
  color: #f7faf6;
  font-weight: 800;
}

.store-picker span {
  color: #aab9b0;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #54d188;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.register-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

/* Dedicated counter layout for a touch-screen register. */
body[data-app-mode="register"] {
  background: #101010;
}

body[data-app-mode="register"] .app-shell {
  display: block;
  background: #101010;
}

body[data-app-mode="register"] .sidebar {
  display: none;
}

body[data-app-mode="register"] .workspace {
  padding: 8px;
}

body[data-app-mode="register"] .workspace-header {
  min-height: 56px;
  margin-bottom: 8px;
  padding: 8px 14px;
  color: #f4f4f4;
  background: #050505;
  border: 1px solid #343434;
}

body[data-app-mode="register"] .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body[data-app-mode="register"] .logout-button {
  min-height: 38px;
  border-color: #a9ff43;
  background: transparent;
  color: #a9ff43;
}

body[data-app-mode="register"] .fullscreen-button {
  min-height: 38px;
  border-color: #86c6ff;
  background: transparent;
  color: #86c6ff;
}

body[data-app-mode="register"] .workspace-header .eyebrow {
  color: #b7ff43;
}

body[data-app-mode="register"] .register-layout {
  grid-template-columns: 320px 72px minmax(0, 1fr);
  grid-template-areas: "cart actions menu";
  gap: 7px;
  height: calc(100vh - 80px);
  min-height: 0;
}

body[data-app-mode="register"] .cart-panel {
  grid-area: cart;
  position: static;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 0;
  box-shadow: none;
  background: #080808;
  color: #e8e8e8;
}

body[data-app-mode="register"] .cart-panel .eyebrow,
body[data-app-mode="register"] .cart-panel .line-meta,
body[data-app-mode="register"] .cart-panel .summary span {
  color: #a9ff43;
}

body[data-app-mode="register"] .cart-panel input,
body[data-app-mode="register"] .cart-panel select {
  min-height: 36px;
  border-radius: 0;
}

body[data-app-mode="register"] .cart-items {
  flex: 1;
  min-height: 80px;
  max-height: none;
}

body[data-app-mode="register"] .line-row,
body[data-app-mode="register"] .empty-state {
  border-radius: 0;
  background: #f2f2f2;
  color: #111;
}

body[data-app-mode="register"] .summary {
  margin-top: auto;
  border-top-color: #555;
}

body[data-app-mode="register"] .summary .total {
  color: #a9ff43;
}

body[data-app-mode="register"] .menu-panel {
  grid-area: menu;
  position: relative;
  height: calc(100vh - 80px);
  min-height: 0;
  overflow: hidden;
  padding: 10px 100px 10px 10px;
  border: 1px solid #555;
  border-radius: 0;
  box-shadow: none;
  background: #161616;
}

body[data-app-mode="register"] .toolbar {
  grid-template-columns: minmax(140px, 230px) minmax(140px, 230px);
  margin-bottom: 8px;
}

body[data-app-mode="register"] .search-field span {
  color: #eee;
}

body[data-app-mode="register"] .search-field input {
  min-height: 36px;
  border-radius: 0;
}

body[data-app-mode="register"] .category-strip {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: 82px;
  display: grid;
  grid-auto-rows: minmax(48px, 1fr);
  align-content: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 4px;
}

body[data-app-mode="register"] .category-button {
  min-height: 48px;
  white-space: normal;
  border-radius: 0;
  border-color: #5336c7;
  background: linear-gradient(#5938e8, #3a1eb4);
  color: #fff;
  font-size: .72rem;
  line-height: 1.05;
  padding: 5px;
}

body[data-app-mode="register"] .category-button.active {
  border-color: #fff;
  background: linear-gradient(#59aef2, #1976bf);
  color: #fff;
}

body[data-app-mode="register"] .menu-grid {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 4px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 2px;
}

body[data-app-mode="register"] .menu-item {
  min-height: 92px;
  border-radius: 0;
  border: 1px solid #671000;
  background: linear-gradient(#f83a21, #a70800);
  color: #fff700;
  text-align: center;
  padding: 7px;
  text-shadow: 1px 1px #480000;
}

body[data-app-mode="register"] .menu-item .item-chip,
body[data-app-mode="register"] .menu-item span {
  display: none;
}

body[data-app-mode="register"] .menu-item.chip-combos {
  border-color: #7c6900;
  background: linear-gradient(#fff94e, #e5bd00);
  color: #272100;
  text-shadow: none;
}

body[data-app-mode="register"] .menu-item.chip-sides {
  border-color: #777;
  background: linear-gradient(#fff, #d9d9d9);
  color: #9d3030;
  text-shadow: none;
}

body[data-app-mode="register"] .menu-item.chip-drinks {
  border-color: #006773;
  background: linear-gradient(#51d2dd, #008b98);
  color: #fff;
}

.register-action-rail {
  display: none;
}

body[data-app-mode="register"] .register-action-rail {
  grid-area: actions;
  display: grid;
  grid-auto-rows: 1fr;
  gap: 3px;
  min-height: 0;
}

.pos-action {
  display: grid;
  place-items: center;
  border: 1px solid #999;
  border-radius: 0;
  background: linear-gradient(#fff, #cfcfcf);
  color: #222;
  text-align: center;
  font: 700 .7rem/1.05 Inter, sans-serif;
  text-decoration: none;
  padding: 3px;
}

.pos-action.pay-action { background: linear-gradient(#587aff, #1d2cba); color: #fff; }
.pos-action.customer-action { background: linear-gradient(#df6ae7, #942ca1); color: #fff; }
.pos-action[data-void-line] { background: linear-gradient(#ff4d4d, #bd0000); color: #fff; }
.pos-action.manager-action { background: linear-gradient(#7955ef, #3c25ad); color: #fff; }

body[data-app-mode="register"] .payment-grid .pay-method,
body[data-app-mode="register"] .checkout-button,
body[data-app-mode="register"] .icon-button {
  border-radius: 0;
}

.menu-panel,
.cart-panel,
.orders-table-wrap,
.item-form,
.settings-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.menu-panel {
  min-height: calc(100vh - 124px);
  padding: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(160px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.search-field span,
.settings-form span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.report-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.report-range-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-range-label select {
  min-width: 150px;
}

.custom-range-fields {
  display: flex;
  gap: 10px;
}

.report-range-label input[type="date"] {
  min-width: 142px;
}

.report-caption {
  margin: -8px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.report-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.report-row:last-child {
  border-bottom: 0;
}

.report-row strong,
.report-row span {
  display: block;
}

.report-row span {
  color: var(--muted);
  font-size: .88rem;
}

.is-hidden {
  display: none !important;
}

.metric-tile,
.panel-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-tile {
  min-height: 124px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

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

.metric-tile strong {
  font-size: 1.9rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.panel-section {
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.quick-actions,
.recent-orders {
  display: grid;
  gap: 10px;
}

.action-button,
.recent-order {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.action-button span,
.recent-order span {
  color: var(--muted);
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.category-button,
.segment,
.pay-method,
.secondary-button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
  white-space: nowrap;
}

.link-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.danger-button {
  color: var(--red);
}

body[data-app-mode="register"] .mode-links {
  display: none;
}

body[data-app-mode="register"] .store-picker {
  pointer-events: none;
}

.category-button.active,
.segment.active,
.pay-method.active {
  border-color: var(--green);
  background: #e7f4ee;
  color: var(--green-dark);
}

.segmented,
.payment-grid {
  display: flex;
  gap: 8px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.menu-item {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: space-between;
  transition: transform 140ms ease, border-color 140ms ease;
}

.menu-item:hover {
  transform: translateY(-2px);
  border-color: #a6beb2;
}

.item-chip {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}

.chip-tenders {
  background: var(--red);
}

.chip-combos {
  background: var(--green);
}

.chip-sides {
  background: var(--gold);
}

.chip-drinks {
  background: var(--blue);
}

.chip-desserts {
  background: #7b5aa6;
}

.menu-item strong,
.line-name {
  font-size: 0.98rem;
}

.menu-item span,
.line-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.cart-panel {
  position: sticky;
  top: 24px;
  padding: 16px;
}

.cart-head,
.line-row,
.summary div,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-row,
.promo-row,
.summary,
.payment-grid {
  margin-top: 12px;
}

.customer-row.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
}

.cart-items {
  min-height: 220px;
  max-height: 36vh;
  overflow-y: auto;
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.line-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-weight: 900;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.toggle-line input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.toggle-line.compact {
  min-height: 44px;
}

.summary {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.summary span {
  color: var(--muted);
}

.summary .total {
  font-size: 1.25rem;
  color: var(--ink);
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.checkout-button,
.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font-weight: 900;
}

.checkout-button {
  width: 100%;
  margin-top: 12px;
  font-size: 1rem;
}

#checkoutShortcut {
  opacity: .72;
  font-size: .78rem;
  margin-left: 5px;
}

.checkout-button:disabled {
  background: #9aa8a1;
  cursor: not-allowed;
}

.orders-table-wrap {
  overflow-x: auto;
}

body[data-app-mode="register"] .manager-only {
  display: none;
}

.retention-panel {
  display: grid;
  grid-template-columns: minmax(230px, .9fr) minmax(380px, 1.1fr);
  gap: 20px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #f0c9c4;
  border-left: 4px solid #d85045;
  border-radius: 7px;
  background: #fff8f7;
}

.retention-panel h3,
.retention-panel p {
  margin: 0;
}

.retention-panel > div > p:not(.eyebrow) {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.retention-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(150px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.retention-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.retention-preview {
  grid-column: 1 / -1;
  color: #8b3b33;
  font-weight: 700;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.item-form,
.settings-form {
  padding: 16px;
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.item-form {
  grid-template-columns: 1.3fr 1fr 110px 110px 110px 150px 130px 120px;
  align-items: end;
}

.promo-form {
  grid-template-columns: 1.3fr 1.4fr 110px 120px 110px 120px;
}

.backoffice-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.item-list {
  display: grid;
  gap: 8px;
}

.item-list-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 120px 90px;
  gap: 12px;
  align-items: center;
}

.settings-form {
  max-width: 520px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  width: min(420px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(18, 26, 22, 0.48);
}

.receipt {
  padding: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.receipt h3,
.receipt p {
  margin: 0 0 10px;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}

.receipt-item-barcode {
  margin: -2px 0 10px;
  text-align: center;
}

.receipt-barcode {
  display: block;
  width: min(100%, 230px);
  height: 66px;
  margin: 0 auto;
  fill: #111;
}

.receipt-barcode text {
  font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 1px;
}

.dialog-actions {
  padding: 14px;
  border-top: 1px solid var(--line);
}

@media print {
  body * {
    visibility: hidden;
  }

  #receiptDialog,
  #receiptDialog * {
    visibility: visible;
  }

  #receiptDialog {
    position: absolute;
    inset: 0;
    width: 100%;
    box-shadow: none;
  }

  .dialog-actions {
    display: none;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px;
    gap: 12px;
  }

  .brand-block {
    align-items: center;
  }

  .nav-tabs {
    display: flex;
    overflow-x: auto;
  }

  .tab-button {
    min-width: 110px;
    text-align: center;
  }

  .status-panel {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .register-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .dashboard-layout,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .report-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .cart-panel {
    position: static;
  }

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

  .item-form {
    grid-template-columns: 1fr;
  }

  .promo-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h2 {
    font-size: 1.35rem;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-item {
    min-height: 126px;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

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

  .customer-row.split {
    grid-template-columns: 1fr;
  }

  .item-list-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body[data-app-mode="register"] .workspace {
    padding: 5px;
  }

  body[data-app-mode="register"] .register-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "cart" "actions" "menu";
    height: auto;
  }

  body[data-app-mode="register"] .register-action-rail {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 56px;
  }

  body[data-app-mode="register"] .menu-panel {
    height: auto;
    padding-right: 10px;
    overflow: visible;
  }

  body[data-app-mode="register"] .category-strip {
    position: static;
    width: auto;
    display: flex;
    margin: 10px 0 0;
    overflow-x: auto;
  }

  body[data-app-mode="register"] .category-button {
    min-width: 86px;
  }

  body[data-app-mode="register"] .menu-grid {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 980px) {
  body[data-app-mode="back-office"] .manager-topbar {
    height: 64px;
    gap: 16px;
    padding: 0 16px;
  }

  body[data-app-mode="back-office"] .app-shell {
    display: block;
    min-height: auto;
  }

  body[data-app-mode="back-office"] .sidebar {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(140px, 1fr);
    gap: 10px 16px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid #d6dee7;
  }

  body[data-app-mode="back-office"] .brand-block {
    padding: 0;
  }

  body[data-app-mode="back-office"] .nav-tabs {
    grid-column: 1 / -1;
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body[data-app-mode="back-office"] .tab-button {
    min-width: max-content;
    padding: 0 14px;
    text-align: left;
  }

  body[data-app-mode="back-office"] .status-panel {
    display: none;
  }

  body[data-app-mode="back-office"] .store-picker {
    align-self: center;
  }

  body[data-app-mode="back-office"] .workspace {
    padding: 20px 16px 32px;
  }

  body[data-app-mode="back-office"] .dashboard-grid,
  body[data-app-mode="back-office"] .dashboard-layout,
  body[data-app-mode="back-office"] .report-layout {
    grid-template-columns: 1fr;
  }

  body[data-app-mode="back-office"] .metric-tile {
    min-height: 116px;
  }

  body[data-app-mode="back-office"] .report-actions {
    align-items: stretch;
    width: 100%;
  }

  .retention-panel {
    grid-template-columns: 1fr;
  }

  .retention-controls {
    grid-template-columns: 1fr 1fr;
  }

  .retention-controls .danger-button {
    grid-column: 1 / -1;
  }

  body[data-app-mode="back-office"] .custom-range-fields {
    width: 100%;
  }

  body[data-app-mode="back-office"] .custom-range-fields .report-range-label {
    flex: 1;
  }
}

@media (max-width: 560px) {
  body[data-app-mode="back-office"] .manager-topbar {
    height: 58px;
    padding: 0 12px;
  }

  body[data-app-mode="back-office"] .manager-logo {
    font-size: 1.15rem;
  }

  body[data-app-mode="back-office"] .manager-breadcrumb {
    gap: 8px;
    font-size: .92rem;
  }

  body[data-app-mode="back-office"] .manager-account > span {
    display: none;
  }

  body[data-app-mode="back-office"] .manager-logout {
    min-height: 32px;
    padding: 0 9px;
    font-size: .78rem;
  }

  body[data-app-mode="back-office"] .sidebar {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  body[data-app-mode="back-office"] .brand-block {
    display: none;
  }

  body[data-app-mode="back-office"] .store-picker {
    grid-row: 1;
  }

  body[data-app-mode="back-office"] .workspace {
    padding: 16px 12px 28px;
  }

  body[data-app-mode="back-office"] .workspace-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  body[data-app-mode="back-office"] .workspace-header h2 {
    font-size: 1.42rem;
  }

  body[data-app-mode="back-office"] .metric-tile strong {
    font-size: 1.85rem;
  }

  body[data-app-mode="back-office"] .panel-section,
  body[data-app-mode="back-office"] .orders-table-wrap,
  body[data-app-mode="back-office"] .item-form,
  body[data-app-mode="back-office"] .settings-form {
    padding: 13px;
  }

  .retention-controls {
    grid-template-columns: 1fr;
  }
}
