:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-2: #eef2f5;
  --ink: #17202a;
  --muted: #687684;
  --line: #d8e0e6;
  --blue: #1261a6;
  --green: #138a5b;
  --amber: #a86405;
  --red: #b83232;
  --shadow: 0 10px 28px rgba(20, 31, 42, 0.08);
  --app-viewport-height: 100dvh;
  --app-header-height: 58px;
  --app-main-block-pad: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body.menu-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 6px 14px;
  background: #12202f;
  color: white;
  position: sticky;
  top: 0;
  z-index: 24;
}

.menu-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.menu-button[aria-expanded="true"] {
  background: white;
  color: #12202f;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  flex: 1 1 auto;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.26));
  flex: 0 0 auto;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.35;
  padding-block: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-store-title {
  display: none;
}

h2 {
  font-size: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.debug-mode-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.debug-mode-button img { width: 29px; height: 29px; pointer-events: none; }
.debug-mode-button[aria-pressed="true"] { border-color: #f6b850; box-shadow: 0 0 0 2px rgba(246, 184, 80, .35); }
.debug-mode-button:focus-visible { outline: 2px solid #f6b850; outline-offset: 2px; }

.manual-sumup-button {
  width: 42px;
  min-width: 42px;
  height: 38px;
  min-height: 38px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 3px;
  background: white;
  color: #123f7a;
  cursor: pointer;
}

.manual-sumup-button img {
  width: 34px;
  height: 27px;
  object-fit: contain;
}

.manual-sumup-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.manual-sumup-orphan-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #12202f;
  border-radius: 999px;
  padding: 0 5px;
  background: #e8a326;
  color: #12202f;
  font-size: 11px;
  line-height: 1;
}

.mode-toggle-button[aria-pressed="true"] {
  background: #f8fbff;
  color: var(--blue);
  border-color: rgba(255, 255, 255, 0.72);
}

.sync-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

html.standard-tpv-mode .tab[data-view="store"] {
  display: none;
}

.iphone-layout-toggle {
  display: none;
}

html.iphone-device .iphone-layout-toggle {
  display: inline-flex;
}

.iphone-nav {
  display: none;
}

html.iphone-store-mode .menu-button,
html.iphone-store-mode .tabs,
html.iphone-store-mode #modeToggleButton,
html.iphone-store-mode #activeEventBadge,
html.iphone-store-mode #connectionBadge,
html.iphone-store-mode #installButton,
html.iphone-store-mode #refreshButton {
  display: none !important;
}

html.iphone-store-mode .brand-full-title {
  display: none;
}

html.iphone-store-mode .brand-store-title {
  display: inline;
}

html.iphone-store-mode .view:not(#view-sales):not(#view-store):not(#view-stock):not(#view-dashboard):not(#view-cash) {
  display: none !important;
}

html.iphone-store-mode #view-store.active,
html.iphone-store-mode #view-sales.active,
html.iphone-store-mode #view-stock.active,
html.iphone-store-mode #view-dashboard.active {
  display: block;
}

html.iphone-store-mode #view-cash.active {
  display: block;
}

html.iphone-store-mode .app-header {
  min-height: 50px;
  padding-inline: 6px;
}

html.iphone-store-mode .header-actions {
  flex: 0 0 auto;
  gap: 4px;
}

html.iphone-store-mode .debug-mode-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  flex-basis: 34px;
}

html.iphone-store-mode .debug-mode-button img { width: 26px; height: 26px; }

html.iphone-store-mode #syncButton {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

html.iphone-store-mode .iphone-layout-toggle {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

html.iphone-store-mode .manual-sumup-button {
  width: 42px;
  min-width: 42px;
  height: 38px;
  min-height: 38px;
}

html.iphone-store-mode .manual-sumup-button img {
  width: 34px;
  height: 27px;
}

html.iphone-store-mode .iphone-nav {
  position: sticky;
  top: 50px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.iphone-nav-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iphone-nav-button.active,
.iphone-nav-button[aria-pressed="true"] {
  background: #12202f;
  border-color: #12202f;
  color: white;
}

/* Esta composición solo se activa en el modo compacto de iPhone. La venta
   sigue usando el mismo carrito, cobro y stock que la versión de tablet. */
html.iphone-store-mode #view-sales.active {
  height: calc(100dvh - 132px - env(safe-area-inset-bottom, 0px));
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

html.iphone-store-mode #view-sales .shift-status-bar {
  min-height: 0;
  padding: 8px 10px;
}

html.iphone-store-mode #view-sales .shift-status-bar strong {
  font-size: 14px;
}

html.iphone-store-mode #view-sales .shift-status-bar span {
  font-size: 11px;
}

html.iphone-store-mode #view-sales .shift-actions {
  flex-wrap: nowrap;
}

html.iphone-store-mode #view-sales .shift-actions .primary-button,
html.iphone-store-mode #view-sales .shift-actions .ghost-button {
  min-height: 36px;
  padding-inline: 9px;
  font-size: 12px;
}

html.iphone-store-mode #view-sales .sales-layout {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(218px, 0.9fr);
  gap: 8px;
  overflow: hidden;
}

html.iphone-store-mode #view-sales .product-panel,
html.iphone-store-mode #view-sales .ticket-panel {
  min-height: 0;
}

html.iphone-store-mode #view-sales .product-toolbar {
  justify-content: flex-start;
  gap: 5px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

html.iphone-store-mode #view-sales .product-toolbar::-webkit-scrollbar { display: none; }

html.iphone-store-mode #view-sales .toolbar-shift-revenue {
  min-width: 76px;
  min-height: 34px;
  padding-inline: 7px;
}

html.iphone-store-mode #view-sales .toolbar-shift-revenue span {
  display: none;
}

html.iphone-store-mode #view-sales .toolbar-shift-revenue strong {
  font-size: 13px;
}

html.iphone-store-mode #view-sales .product-toolbar .ghost-button {
  flex-shrink: 0;
  min-height: 34px;
  padding-inline: 9px;
  font-size: 12px;
}

html.iphone-store-mode #view-sales .quick-stock-button {
  width: 34px;
  height: 34px;
  padding: 5px;
}

html.iphone-store-mode #view-sales .potato-timer-button {
  min-width: 34px;
  height: 34px;
  padding: 4px;
}

html.iphone-store-mode #view-sales .potato-timer-button.is-cooking {
  min-width: 84px;
}

html.iphone-store-mode #view-sales #toggleProductSortButton {
  display: none;
}

html.iphone-store-mode #view-sales .product-grid,
html.iphone-store-mode #view-sales .product-grid.sort-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  grid-auto-rows: minmax(58px, auto);
  align-content: start;
  gap: 6px;
  padding: 6px;
  overflow: auto;
}

html.iphone-store-mode #view-sales .product-card,
html.iphone-store-mode #view-sales .product-grid.fit-layout .product-card {
  min-height: 58px;
  height: auto;
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 9px 11px;
}

html.iphone-store-mode #view-sales .product-card .product-thumb,
html.iphone-store-mode #view-sales .product-card .drag-handle,
html.iphone-store-mode #view-sales .product-card .sort-controls {
  display: none;
}

html.iphone-store-mode .variant-picker-options img {
  display: none;
}

html.iphone-store-mode #view-sales .product-card strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 15px;
  line-height: 1.15;
}

html.iphone-store-mode #view-sales .product-card .price,
html.iphone-store-mode #view-sales .product-card .price-stack {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
  font-size: 16px;
}

html.iphone-store-mode #view-sales .product-card .stock {
  grid-column: 1;
  grid-row: 2;
  font-size: 11px;
}

html.iphone-store-mode #view-sales .product-card .sale-mode-badge,
html.iphone-store-mode #view-sales .product-card .low-stock-badge {
  position: static;
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: start;
}

html.iphone-store-mode #view-sales .ticket-panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

html.iphone-store-mode #view-sales .ticket-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 0;
}

html.iphone-store-mode #view-sales .ticket-panel h2 {
  font-size: 16px;
}

html.iphone-store-mode #view-sales .ticket-heading {
  gap: 4px;
}

html.iphone-store-mode #view-sales .ticket-heading-copy {
  display: grid;
  gap: 0;
}

html.iphone-store-mode #view-sales .ticket-slot-tabs {
  gap: 3px;
}

html.iphone-store-mode #view-sales .ticket-slot-tabs button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  font-size: 14px;
}

html.iphone-store-mode #view-sales .ticket-head-actions {
  width: auto;
  display: flex;
  gap: 4px;
}

html.iphone-store-mode #view-sales .ticket-head-actions .ghost-button {
  min-height: 34px;
  padding-inline: 7px;
  font-size: 11px;
}

html.iphone-store-mode #view-sales .cart-lines {
  padding: 6px 10px;
}

html.iphone-store-mode #view-sales .cart-line {
  padding: 7px 0;
}

html.iphone-store-mode #view-sales .ticket-summary {
  padding: 7px 10px;
}

html.iphone-store-mode #view-sales .takeaway-toggle {
  min-height: 34px;
  margin-bottom: 7px;
  font-size: 12px;
}

html.iphone-store-mode #view-sales .ticket-actions {
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
}

html.iphone-store-mode #view-sales .ticket-actions .checkout-button {
  min-height: 46px;
  font-size: 18px;
}

.status-badge.online {
  background: rgba(19, 138, 91, 0.9);
}

.status-badge.offline {
  background: rgba(184, 50, 50, 0.9);
}

.event-badge {
  background: rgba(255, 255, 255, 0.18);
}

.trailer-badge {
  background: rgba(225, 155, 48, 0.9);
}

.tabs {
  width: min(280px, calc(100vw - 40px));
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 22;
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 74px 12px 16px;
  background: #12202f;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 18px 0 34px rgba(20, 31, 42, 0.2);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

.tab {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  min-height: 48px;
  padding: 0 14px;
  text-align: left;
  font-weight: 800;
}

.tab.active {
  color: #12202f;
  background: white;
  border-color: white;
  box-shadow: none;
}

body.menu-open .tabs {
  transform: translateX(0);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 21;
  background: rgba(18, 32, 47, 0.18);
}

main {
  padding: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#view-sales.active {
  height: calc(var(--app-viewport-height, 100dvh) - var(--app-header-height, 58px) - var(--app-main-block-pad, 24px) - env(safe-area-inset-bottom, 0px));
  min-height: 0;
  overflow: visible;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.sales-layout,
.store-layout,
.dashboard-layout,
.tickets-layout,
.stock-layout,
.supply-layout,
.finance-layout,
.cash-calculator-layout,
.sync-layout,
.settings-layout {
  display: grid;
  gap: 16px;
}

.sales-layout {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 27vw, 460px);
  align-items: stretch;
}

#view-cash {
  max-width: 1280px;
  margin-inline: auto;
}

.cash-calculator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cash-calculator-head .muted {
  line-height: 1.5;
}

.cash-calculator-head button {
  flex: 0 0 auto;
}

.cash-calculator-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
}

.panel.cash-calculator-count-panel {
  display: grid;
  min-width: 0;
  padding: 20px;
  gap: 24px;
}

.cash-denomination-group {
  display: grid;
  gap: 10px;
}

.cash-denomination-group h3 {
  margin: 0;
  font-size: 15px;
}

.cash-denomination-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cash-denomination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.cash-denomination > span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.cash-denomination input {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #b7c6d2;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cash-denomination input[readonly] {
  cursor: pointer;
  caret-color: transparent;
}

.cash-denomination input:focus {
  outline: 3px solid rgba(18, 97, 166, 0.2);
  border-color: var(--blue);
}

.cash-denomination small {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.panel.cash-calculator-total-panel {
  position: sticky;
  top: calc(var(--app-header-height) + 16px);
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  background: #12202f;
  color: white;
}

.cash-calculator-total-panel > span {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cash-calculator-total-panel strong {
  color: white;
  font-size: 36px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cash-calculator-total-panel .muted,
.cash-calculator-total-panel small {
  color: rgba(255, 255, 255, 0.74);
}

.cash-calculator-total-panel p {
  margin: 0;
  font-weight: 800;
}

.cash-calculator-total-panel small {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.shift-status-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.shift-status-bar.open {
  border-left-color: var(--green);
  background: #f2fbf7;
}

.shift-status-bar strong {
  display: block;
  font-size: 16px;
}

.shift-status-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.shift-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.potato-ready-banner {
  position: fixed;
  top: calc(var(--app-header-height) + 8px);
  right: 10px;
  z-index: 30;
  width: min(430px, calc(100vw - 20px));
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 2px solid #b94e19;
  border-radius: 12px;
  background: #fff0d6;
  color: #612d12;
  box-shadow: 0 8px 26px rgba(71, 35, 13, .25);
  animation: potato-banner-pulse 1.5s ease-in-out infinite;
}

.potato-ready-banner img { width: 40px; height: 40px; flex: 0 0 40px; }
.potato-ready-banner strong { flex: 1 1 auto; font-size: 17px; line-height: 1.15; }
.potato-ready-banner .primary-button { flex: 0 0 auto; min-height: 38px; padding-inline: 10px; }

@keyframes potato-banner-pulse {
  50% { border-color: #f39936; box-shadow: 0 8px 26px rgba(71, 35, 13, .25), 0 0 0 5px rgba(243, 153, 54, .24); }
}

html.iphone-store-mode .potato-ready-banner { top: 108px; min-height: 54px; padding: 6px 9px; }
html.iphone-store-mode .potato-ready-banner img { width: 32px; height: 32px; flex-basis: 32px; }
html.iphone-store-mode .potato-ready-banner strong { font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .potato-ready-banner { animation: none; box-shadow: 0 0 0 4px rgba(243, 153, 54, .3); }
}

.sales-locked .product-panel,
.sales-locked .ticket-panel {
  opacity: 0.62;
}

.product-grid.locked {
  cursor: not-allowed;
}

.product-grid.locked .product-card {
  cursor: not-allowed;
}

.tickets-layout {
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.finance-layout,
.store-layout,
.sync-layout,
.settings-layout {
  grid-template-columns: minmax(310px, 0.85fr) minmax(0, 1.15fr);
}

.finance-expense-panel {
  grid-column: 1 / -1;
}

.cash-movements-panel {
  grid-column: 1 / -1;
}

.shift-summary-panel {
  grid-column: 1 / -1;
}

.shift-hourly-chart {
  padding-top: 0;
}

.shift-product-ranking {
  padding: 8px 12px 14px;
  max-height: 350px;
  overflow: auto;
}

.shift-product-row {
  display: grid;
  grid-template-columns: 34px minmax(130px, 1fr) minmax(70px, auto) minmax(62px, auto) minmax(96px, auto);
  gap: 10px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.shift-product-row.header-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-height: auto;
  background: var(--panel-2);
  margin: 0 -12px;
  padding: 10px 12px;
}

.shift-product-position {
  color: var(--blue);
  font-size: 17px;
}

.revenue-visibility-toggle {
  min-width: 48px;
  font-size: 20px;
  line-height: 1;
}

.revenue-sensitive {
  transition: filter 160ms ease;
}

.revenue-sensitive.is-hidden {
  filter: blur(7px);
  user-select: none;
}

.store-shopping-panel,
.store-stock-panel {
  grid-column: 1 / -1;
}

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

.stock-layout {
  grid-template-columns: minmax(0, 1fr);
}

.stock-layout.editor-open {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  align-items: start;
}

.supply-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  align-items: start;
}

.supply-layout.editor-open {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr) minmax(280px, 340px);
}

.supply-mode-tabs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
}

.supply-mode-tabs .ghost-button[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.supply-layout.inventory-mode {
  grid-template-columns: minmax(0, 1fr);
}

.supply-layout.stock-mode {
  grid-template-columns: minmax(0, 1fr);
}

.supply-layout.shopping-mode {
  grid-template-columns: minmax(0, 1fr);
}

.supply-layout.stock-mode.editor-open {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.supply-layout.inventory-mode .supply-list-panel,
.supply-layout.inventory-mode .supply-shopping-panel,
.supply-layout.inventory-mode .supply-editor-panel,
.supply-layout.stock-mode .supply-grid-panel,
.supply-layout.stock-mode .supply-shopping-panel,
.supply-layout.shopping-mode .supply-grid-panel,
.supply-layout.shopping-mode .supply-list-panel,
.supply-layout.shopping-mode .supply-editor-panel {
  display: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-input,
input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
}

.search-input {
  max-width: 330px;
}

.search-input:disabled {
  opacity: 0.62;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  gap: 6px;
}

.primary-button,
.ghost-button,
.icon-button,
.checkout-button,
.file-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.primary-button,
.checkout-button {
  background: var(--blue);
  color: white;
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled,
.checkout-button:disabled,
.file-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost-button,
.icon-button,
.file-button {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button[aria-pressed="true"] {
  background: #12202f;
  color: white;
  border-color: #12202f;
}

.checkout-button {
  width: 100%;
  min-height: 60px;
  font-size: 20px;
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

.ticket-head-actions {
  display: flex;
  gap: 4px;
}

/* El ancho útil del panel puede ser menor que el viewport reportado por algunas tablets. */
.ticket-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.ticket-panel .ticket-head-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.ticket-panel .ticket-head-actions .ghost-button {
  min-width: 0;
  min-height: 38px;
  padding-inline: 3px;
  font-size: 13px;
}

.ticket-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ticket-heading-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.ticket-heading-copy h2,
.ticket-heading-copy p {
  margin: 0;
}

.ticket-heading-copy p {
  white-space: nowrap;
}

.ticket-slot-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.ticket-slot-tabs button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background: white;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
}

.ticket-slot-tabs button[aria-selected="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 3px 9px rgba(18, 97, 166, 0.24);
}

.ticket-slot-tabs button[data-has-items="true"]::after {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  top: 3px;
  right: 3px;
  border-radius: 999px;
  background: #e8a326;
}

.product-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.product-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.product-toolbar::-webkit-scrollbar { display: none; }
.product-toolbar > .ghost-button { flex-shrink: 0; }

.potato-timer-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

html.iphone-store-mode .potato-timer-buttons { margin-left: 0; }

@media (max-width: 520px) {
  .standard-tpv-mode .potato-timer-buttons { margin-left: 0; }
}

.potato-timer-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid #c9d4dc;
  border-radius: 8px;
  background: #fff8ed;
  box-shadow: 0 2px 6px rgba(20, 31, 42, .08);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.potato-timer-button img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
  pointer-events: none;
}

.potato-timer-button.is-cooking {
  width: auto;
  min-width: 94px;
  background: #fff0dc;
  border-color: #e6ab60;
}

.potato-timer-button.is-ready {
  background: #ffebcb;
  border-color: #c56c24;
  animation: potato-ready-pulse 1.1s ease-in-out infinite;
}

.potato-timer-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.potato-timer-time {
  display: none;
  min-width: 48px;
  color: #814516;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.potato-timer-button.is-cooking .potato-timer-time { display: inline; }

@media (max-width: 520px) {
  .standard-tpv-mode #view-sales .product-toolbar {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .standard-tpv-mode #view-sales .product-toolbar::-webkit-scrollbar { display: none; }
  .standard-tpv-mode #view-sales .product-toolbar .ghost-button { flex-shrink: 0; }
}

@keyframes potato-ready-pulse {
  50% { background: #ffc979; box-shadow: 0 0 0 4px rgba(242, 148, 51, .24); }
}

@media (prefers-reduced-motion: reduce) {
  .potato-timer-button.is-ready { animation: none; box-shadow: 0 0 0 3px rgba(242, 148, 51, .35); }
}

.potato-timers-card {
  width: min(500px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

.potato-timers-list {
  display: grid;
  gap: 8px;
  max-height: min(48dvh, 400px);
  overflow-y: auto;
  margin: 0 0 16px;
  text-align: left;
}

.potato-timers-list > .muted { margin: 0; padding: 14px; }

.potato-timer-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid #e9d7bb;
  border-radius: 10px;
  background: #fffaf2;
}

.potato-timer-row.is-ready { border-color: #e9a858; background: #fff0d8; }
.potato-timer-row img { width: 34px; height: 34px; object-fit: contain; }
.potato-timer-row-info { min-width: 0; display: grid; gap: 2px; }
.potato-timer-row-info strong { font-size: 14px; line-height: 1.2; }
.potato-timer-row-info span { color: #86511f; font-size: 13px; font-variant-numeric: tabular-nums; }
.potato-timer-row-actions { display: flex; gap: 5px; }
.potato-timer-row-actions .ghost-button { min-height: 34px; padding: 6px 8px; font-size: 12px; }

@media (max-width: 390px) {
  .potato-timer-row { grid-template-columns: 28px minmax(0, 1fr); }
  .potato-timer-row img { width: 28px; height: 28px; }
  .potato-timer-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.quick-stock-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.quick-stock-button {
  width: 40px;
  height: 40px;
  min-width: 0;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid #c9d4dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(20, 31, 42, 0.08);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.quick-stock-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.quick-stock-button:hover,
.quick-stock-button:focus-visible {
  border-color: var(--blue);
  outline: 2px solid rgba(18, 97, 166, 0.16);
  outline-offset: 1px;
}

.quick-stock-button:active,
.quick-stock-button[aria-expanded="true"] {
  background: #e9f2fa;
  border-color: var(--blue);
  transform: translateY(1px);
}

.quick-stock-popover {
  position: fixed;
  z-index: 120;
  width: min(360px, calc(100vw - 16px));
  max-height: min(440px, calc(100dvh - 16px));
  overflow: hidden;
  padding: 10px;
  border: 1px solid #c9d4dc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(20, 31, 42, 0.24);
  pointer-events: none;
}

.quick-stock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
}

.quick-stock-head strong {
  font-size: 14px;
}

.quick-stock-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.quick-stock-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: min(370px, calc(100dvh - 92px));
  padding-top: 8px;
  overflow: auto;
}

.quick-stock-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #f2f5f7;
  font-size: 12px;
}

.quick-stock-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-stock-item strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 14px;
}

.quick-stock-item.low {
  background: #fff2d8;
}

.quick-stock-item.low strong {
  color: var(--amber);
}

.quick-stock-item.out {
  background: #fde9e9;
}

.quick-stock-item.out strong {
  color: var(--red);
}

.quick-stock-item.untracked strong {
  color: var(--muted);
  font-size: 11px;
}

.quick-stock-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 520px) {
  .quick-stock-popover {
    width: min(300px, calc(100vw - 16px));
  }

  .quick-stock-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.toolbar-shift-revenue {
  position: relative;
  align-self: stretch;
  min-width: 180px;
  min-height: 40px;
  margin-right: auto;
  border: 0;
  border-radius: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #ffffff;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 6px;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 100ms ease;
}

.toolbar-shift-revenue:hover,
.toolbar-shift-revenue:active,
.toolbar-shift-revenue:focus,
.toolbar-shift-revenue:focus-visible {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.toolbar-shift-revenue::selection,
.toolbar-shift-revenue span::selection,
.toolbar-shift-revenue strong::selection {
  color: inherit;
  background: transparent;
}

.toolbar-shift-revenue > span:not(.revenue-money-burst) {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar-shift-revenue strong {
  position: relative;
  z-index: 2;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.toolbar-shift-revenue.is-visible {
  color: #171b20;
}

.toolbar-shift-revenue::after {
  content: "";
  position: absolute;
  left: 53%;
  top: 50%;
  width: 118px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(235, 190, 55, 0.28), rgba(70, 166, 104, 0.12) 48%, transparent 72%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.55);
  pointer-events: none;
  z-index: 0;
}

.toolbar-shift-revenue.is-sparking::after {
  animation: revenue-money-glow 820ms ease-out both;
}

.revenue-money-burst {
  position: absolute;
  top: 50%;
  left: 53%;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 3;
}

.revenue-money-burst i {
  --money-x: 0px;
  --money-y: 0px;
  --money-r: 0deg;
  position: absolute;
  inset: -8px auto auto -8px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #d09a16;
  background: linear-gradient(145deg, #fff1a8, #e8b62d 58%, #c78a0c);
  color: #6f4a00;
  box-shadow: 0 2px 5px rgba(129, 84, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  opacity: 0;
}

.revenue-money-burst .money-bill {
  width: 25px;
  border-radius: 3px;
  border-color: #4c9b63;
  background: linear-gradient(145deg, #dff6d9, #7fc98d 58%, #4b9b63);
  color: #174f2d;
  box-shadow: 0 2px 5px rgba(24, 91, 48, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.revenue-money-burst i:nth-child(1) { --money-x: -101px; --money-y: -14px; --money-r: -42deg; }
.revenue-money-burst i:nth-child(2) { --money-x: -70px; --money-y: 14px; --money-r: 34deg; }
.revenue-money-burst i:nth-child(3) { --money-x: -35px; --money-y: -16px; --money-r: -18deg; }
.revenue-money-burst i:nth-child(4) { --money-x: 5px; --money-y: 15px; --money-r: 28deg; }
.revenue-money-burst i:nth-child(5) { --money-x: 42px; --money-y: -15px; --money-r: -30deg; }
.revenue-money-burst i:nth-child(6) { --money-x: 73px; --money-y: 14px; --money-r: 19deg; }
.revenue-money-burst i:nth-child(7) { --money-x: 105px; --money-y: -12px; --money-r: 45deg; }

.toolbar-shift-revenue.is-sparking .revenue-money-burst i {
  animation: revenue-money-pop 900ms cubic-bezier(0.16, 0.75, 0.22, 1) both;
}

.toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(2n) { animation-delay: 55ms; }
.toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(3n) { animation-delay: 105ms; }

@keyframes revenue-money-pop {
  0% { opacity: 0; transform: translate(0, 0) scale(0.15) rotate(0deg); }
  18% { opacity: 1; }
  68% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--money-x), var(--money-y)) scale(0.82) rotate(var(--money-r)); }
}

@keyframes revenue-money-glow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
  28% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

@keyframes revenue-money-fade {
  0%, 100% { opacity: 0; }
  28%, 72% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .toolbar-shift-revenue.is-sparking .revenue-money-burst i {
    display: none;
  }

  .toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(1),
  .toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(3),
  .toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(5) {
    display: grid;
    animation: revenue-money-fade 650ms ease-out both;
  }

  .toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(1) { transform: translate(-42px, 0); }
  .toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(3) { transform: translate(0, 0); }
  .toolbar-shift-revenue.is-sparking .revenue-money-burst i:nth-child(5) { transform: translate(42px, 0); }

  .toolbar-shift-revenue.is-sparking::after {
    animation: revenue-money-glow 350ms ease-out both;
  }
}

.product-grid {
  --product-grid-gap: var(--density-product-grid-gap, clamp(6px, 0.7vw, 12px));
  --product-grid-pad: var(--density-product-grid-pad, clamp(8px, 0.9vw, 14px));
  --product-card-min: var(--density-product-card-min, clamp(96px, 9.5vw, 150px));
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--product-card-min), 1fr));
  grid-auto-rows: minmax(var(--product-card-min), 1fr);
  gap: var(--product-grid-gap);
  padding: var(--product-grid-pad);
  overflow: auto;
  align-content: stretch;
}

.product-grid.fit-layout {
  grid-template-columns: repeat(var(--product-grid-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--product-grid-rows), minmax(0, 1fr));
  grid-auto-rows: minmax(var(--product-fit-min), 1fr);
  overflow: auto;
  overscroll-behavior: contain;
}

.product-grid.sort-mode {
  grid-template-columns: repeat(auto-fit, minmax(clamp(132px, 12vw, 170px), 1fr));
  grid-auto-rows: minmax(168px, 1fr);
  grid-template-rows: none;
  overflow: auto;
  align-content: start;
  user-select: none;
}

.product-card {
  position: relative;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  aspect-ratio: 1 / 1;
  gap: 4px;
  align-content: stretch;
  overflow: hidden;
}

.product-grid.fit-layout .product-card {
  aspect-ratio: auto;
}

.product-card.sorting {
  cursor: grab;
  touch-action: none;
  position: relative;
}

.product-card.sorting .product-thumb {
  min-height: 38px;
}

.product-card.sorting.dragging {
  cursor: grabbing;
  border-color: var(--blue);
  background: #f4f9ff;
  opacity: 0.78;
  box-shadow: 0 14px 26px rgba(20, 31, 42, 0.14);
}

.drag-handle {
  min-height: 28px;
  border-radius: 8px;
  background: #12202f;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.sort-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.sort-controls button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 950;
}

.sort-controls button:active,
.sort-controls button:focus-visible {
  border-color: var(--blue);
  outline: 2px solid rgba(18, 97, 166, 0.18);
}

.product-thumb {
  width: 100%;
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* Cans are matched to the visual height of Coca-Cola clásica without stretching them. */
.product-thumb.beverage-thumb img,
.variant-picker-options img.beverage-product-image {
  transform: translateY(var(--beverage-image-offset-y, 0)) scale(var(--beverage-image-scale, 1));
  transform-origin: center;
}

.variant-picker-card {
  max-width: 460px;
}

.variant-picker-card .center-popup-actions {
  grid-template-columns: max-content;
  justify-content: center;
  margin-top: 12px;
}

.variant-picker-card .center-popup-actions .ghost-button {
  min-height: 38px;
  padding: 0 14px;
}

.variant-picker-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.variant-picker-options button {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 7px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.variant-picker-options button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.variant-picker-options img {
  width: 48px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

.variant-picker-options span,
.variant-picker-options strong,
.variant-picker-options small {
  display: block;
}

.variant-picker-options small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 750;
}

.product-thumb-empty {
  color: var(--muted);
  font-size: 28px;
  font-weight: 950;
}

.product-card strong,
.cart-title,
.row-title {
  overflow-wrap: anywhere;
}

.product-card strong {
  font-size: 13px;
  line-height: 1.1;
}

.product-card .price {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.price-stack {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.price-original {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-decoration: line-through;
}

.product-grid.discount-mode .product-card {
  border-color: rgba(19, 138, 91, 0.38);
  background: #f4fbf7;
}

.product-grid.invitation-mode .product-card {
  border-color: rgba(18, 97, 166, 0.38);
  background: #f4f9ff;
}

.sale-mode-badge {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 1;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  color: white;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.discount-badge {
  background: var(--green);
}

.invitation-badge {
  background: var(--blue);
}

.product-card .stock {
  color: var(--muted);
  font-size: 11px;
  display: none;
}

.product-card.low {
  border-color: #d9a54d;
  background: #fffaf0;
}

.product-card.low-stock-sale {
  border-color: rgba(184, 50, 50, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.96) 0%, rgba(255, 230, 178, 0.72) 48%, rgba(184, 50, 50, 0.13) 100%),
    #fffaf0;
  box-shadow: inset 0 0 0 1px rgba(168, 100, 5, 0.12);
}

.product-card.low-stock-sale .product-thumb {
  background: rgba(255, 255, 255, 0.76);
}

.product-card.drink-suggestion {
  border-color: var(--blue);
  background: #f4f9ff;
  box-shadow: 0 0 0 3px rgba(18, 97, 166, 0.18);
}

.low-stock-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  max-width: calc(100% - 14px);
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(184, 50, 50, 0.22);
  border-radius: 999px;
  background: rgba(184, 50, 50, 0.92);
  color: white;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(184, 50, 50, 0.22);
}

.product-card.out {
  opacity: 0.55;
}

.supply-grid-panel,
.supply-list-panel,
.supply-shopping-panel {
  min-height: 0;
}

.supply-grid {
  --supply-card-min: clamp(118px, 10vw, 170px);
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--supply-card-min), 1fr));
  grid-auto-rows: minmax(222px, auto);
  gap: clamp(8px, 0.8vw, 12px);
  padding: clamp(8px, 0.9vw, 14px);
  overflow: auto;
  align-content: start;
}

.supply-card {
  min-width: 0;
  width: 100%;
  min-height: 222px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-rows: 86px minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
}

.supply-card-image {
  min-width: 0;
  width: 100%;
  height: 86px;
  border-radius: 7px;
  background: white;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
}

.supply-card-image img {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.supply-card:disabled {
  cursor: not-allowed;
}

.supply-card-main {
  display: grid;
  align-content: start;
  gap: 4px;
}

.supply-card-main strong {
  font-size: 15px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.supply-card-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.supply-card-stock {
  color: var(--blue);
  font-size: 22px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.supply-card-action {
  min-height: 30px;
  border-radius: 8px;
  background: #12202f;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 950;
}

.supply-card.stock-low {
  border-color: #d9a54d;
  background: #fffaf0;
}

.supply-card.stock-out {
  border-color: rgba(184, 50, 50, 0.42);
  background: #fff5f5;
  opacity: 0.74;
}

.supply-card.stock-out .supply-card-stock,
.supply-card.stock-out .supply-card-action {
  color: var(--red);
}

.supply-card.stock-out .supply-card-action {
  background: white;
  border: 1px solid rgba(184, 50, 50, 0.25);
}

.supply-list-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: var(--blue);
  font-weight: 950;
  flex: 0 0 auto;
  overflow: hidden;
}

.supply-list-icon img,
.supply-row-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.supply-row-image {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: white;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.supply-image-fallback {
  color: var(--blue);
  background: var(--panel-2);
  font-weight: 950;
}

.supply-row-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.shopping-list {
  display: grid;
  gap: 8px;
  padding: clamp(8px, 0.9vw, 14px);
}

.shopping-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(120px, 150px) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.shopping-row.stock-low {
  border-color: #d9a54d;
  background: #fffaf0;
}

.shopping-row.stock-out {
  border-color: rgba(184, 50, 50, 0.42);
  background: #fff5f5;
}

.shopping-row-pending {
  opacity: 0.62;
}

.shopping-check {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
}

.shopping-check input {
  width: 28px;
  min-height: 28px;
  accent-color: var(--green);
}

.shopping-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.shopping-main strong {
  font-size: 16px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.shopping-main span,
.shopping-quantity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.shopping-quantity {
  display: grid;
  gap: 4px;
}

.shopping-quantity input {
  width: 100%;
  min-height: 42px;
  text-align: right;
  font-size: 18px;
  font-weight: 900;
}

.shopping-row > button {
  min-height: 42px;
}

.store-supply-list {
  display: grid;
  gap: 8px;
  padding: clamp(8px, 0.9vw, 14px);
}

.store-supply-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.store-supply-row.stock-low {
  border-color: #d9a54d;
  background: #fffaf0;
}

.store-supply-row.stock-out {
  border-color: rgba(184, 50, 50, 0.42);
  background: #fff5f5;
}

.store-supply-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.store-supply-main strong {
  font-size: 16px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.store-supply-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.store-supply-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, auto));
  gap: 6px;
}

.store-supply-actions button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 950;
}

.ticket-panel {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  position: static;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.ticket-summary {
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  padding: 12px 14px;
}

.takeaway-toggle {
  width: 100%;
  margin: 0 0 12px;
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: white;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.takeaway-toggle[aria-pressed="true"] {
  border-color: #d97706;
  background: #fff7ed;
  color: #9a3412;
}

.ticket-total-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ticket-total-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-total-row strong {
  color: var(--blue);
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 1180px) {
  .app-header {
    gap: 6px;
    padding-inline: 8px;
  }

  .brand-lockup {
    display: none;
  }

  .header-actions {
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .header-actions .status-badge {
    display: none;
  }

  .header-actions #activeTrailerBadge {
    display: inline-flex;
  }

  .header-actions .primary-button,
  .header-actions .ghost-button,
  .header-actions .icon-button {
    min-width: 0;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 14px;
  }

  .ticket-panel .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: center;
  }

  .ticket-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .ticket-head-actions .ghost-button {
    min-width: 0;
    min-height: 38px;
    padding-inline: 3px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  #view-sales.active {
    height: auto;
    overflow: visible;
  }

  .sales-layout {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .ticket-panel {
    min-height: 520px;
  }
}

.ticket-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px)) 14px;
  border-top: 1px solid var(--line);
  background: white;
}

.ticket-actions .checkout-button {
  margin-top: 0;
  min-width: 0;
  padding-inline: 8px;
  white-space: normal;
  font-size: clamp(16px, 1.7vw, 20px);
}

.cart-lines {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: clamp(8px, 0.9vw, 14px) clamp(10px, 1vw, 16px);
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line > :first-child {
  min-width: 0;
}

.cart-line-extra {
  margin-left: 18px;
  padding-left: 12px;
  border-left: 3px solid var(--amber);
  background: #fffaf0;
}

.cart-line-extra .cart-title,
.ticket-line-extra .row-title {
  color: #8a5700;
}

.cart-line.split-selected {
  background: #edf8f0;
  box-shadow: inset 4px 0 0 var(--green);
  padding-left: 10px;
}

.cart-line.split-selectable {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 66px;
  align-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.split-quantity-controls {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  align-items: center;
  gap: 3px;
}

.split-quantity-controls button {
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  font-size: 17px;
  font-weight: 900;
}

.split-quantity-controls span {
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.cart-title {
  font-weight: 900;
}

.cart-meta,
.line-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.quantity-controls {
  display: grid;
  grid-template-columns: repeat(4, clamp(36px, 2.8vw, 46px));
  align-items: center;
  gap: 4px;
}

.quantity-controls button {
  min-width: 0;
  min-height: clamp(38px, 2.8vw, 46px);
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  font-weight: 900;
}

.row-actions button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  font-weight: 900;
}

.quantity-controls span {
  text-align: center;
  font-weight: 900;
}

.checkout-screen {
  min-height: 0;
  height: 100%;
  display: grid;
  align-items: stretch;
  padding: 8px;
  overflow: hidden;
}

.checkout-screen.hidden {
  display: none !important;
}

.payment-panel {
  width: min(900px, 100%);
  height: 100%;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.payment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.payment-head > div {
  text-align: right;
}

.payment-entry,
.payment-complete {
  display: grid;
  gap: 14px;
  padding: 18px;
  min-height: 0;
  overflow: hidden;
}

.checkout-amount {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.checkout-amount > span,
.complete-total span,
.payment-preview span,
.complete-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.checkout-total-row {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 12px;
}

.checkout-total-row strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--blue);
  font-size: 64px;
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
}

.checkout-total-row .card-pay-button {
  grid-column: 3;
  grid-row: 1;
  width: 150px;
  min-height: 88px;
  border-width: 2px;
  border-color: #b7cde0;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 10px;
  box-shadow: 0 8px 16px rgba(20, 31, 42, 0.08);
}

.checkout-total-row .card-pay-button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 0 0 3px rgba(18, 97, 166, 0.18);
}

.checkout-total-row .card-pay-button.active .card-icon {
  background: linear-gradient(135deg, #ffffff, #b8d9ff);
  box-shadow: inset 0 -8px 0 rgba(18, 97, 166, 0.28);
}

.payment-method-buttons {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  gap: 8px;
}

.payment-method-buttons .card-pay-button {
  grid-column: auto;
  grid-row: auto;
  width: 150px;
  min-height: 72px;
}

.checkout-total-row .card-icon {
  width: 56px;
  height: 36px;
}

.card-pay-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contactless-mark {
  width: 32px;
  height: 28px;
  border-radius: 8px;
  background: #f8fbff;
  border: 1px solid rgba(18, 97, 166, 0.22);
  position: relative;
  display: inline-block;
}

.contactless-mark span,
.contactless-mark::before,
.contactless-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  border: 2px solid var(--blue);
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  transform: translateY(-50%);
}

.contactless-mark span {
  left: 8px;
  width: 6px;
  height: 12px;
  border-radius: 0 14px 14px 0;
}

.contactless-mark::before {
  left: 10px;
  width: 10px;
  height: 18px;
  border-radius: 0 22px 22px 0;
}

.contactless-mark::after {
  left: 13px;
  width: 13px;
  height: 23px;
  border-radius: 0 29px 29px 0;
}

.card-pay-button.active .contactless-mark {
  border-color: rgba(255, 255, 255, 0.58);
}

.card-pay-button.active .card-button-label {
  color: white;
}

.sumup-payment-status {
  width: min(760px, 100%);
  border: 1px solid rgba(18, 97, 166, 0.24);
  border-radius: 8px;
  background: #f4f9ff;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.sumup-payment-status strong {
  color: var(--ink);
  font-size: 14px;
}

.sumup-payment-status span {
  color: var(--muted);
  font-weight: 800;
}

.sumup-payment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.sumup-payment-status[data-status="ok"] {
  border-color: rgba(20, 131, 80, 0.28);
  background: #e9f8f1;
}

.sumup-payment-status[data-status="error"] {
  border-color: rgba(184, 50, 50, 0.32);
  background: #fff2f2;
}

.card-button-label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.payment-cash-controls {
  width: min(720px, 100%);
  margin: 0 auto;
}

.payment-cash-controls .quick-cash-buttons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payment-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: min(620px, 100%);
  margin: 0 auto;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.payment-preview div {
  min-height: 86px;
  background: white;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  text-align: center;
}

.payment-preview strong {
  font-size: 26px;
  overflow-wrap: anywhere;
}

.complete-payment-check {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f8;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.complete-payment-check-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.complete-payment-check b {
  font-weight: 900;
}

.complete-payment-check strong {
  color: var(--ink);
  font-weight: 900;
}

.confirm-checkout-button,
.new-sale-button {
  width: min(360px, 100%);
  margin: 0 auto;
}

.complete-actions {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  margin: 0 auto;
}

.complete-actions .checkout-button,
.complete-actions .ghost-button {
  width: 100%;
}

.split-print-options {
  display: grid;
  gap: 10px;
  text-align: center;
}

.split-print-options p {
  margin: 0;
  font-weight: 800;
}

.saved-tickets-popup-card {
  max-width: 620px;
}

.saved-tickets-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: left;
}

.saved-tickets-list {
  display: grid;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow: auto;
}

.saved-ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.saved-ticket-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.confirm-checkout-button {
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -8px 18px rgba(20, 31, 42, 0.08);
}

.complete-total {
  min-height: 230px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 24px;
  border: 4px solid var(--red);
  border-radius: 14px;
  background: #fff4f4;
  text-align: center;
}

.complete-total strong {
  color: var(--red);
  font-size: clamp(64px, 10vw, 112px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.complete-change-total > span {
  color: var(--red);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0.035em;
}

.complete-change-total.no-change {
  border-color: var(--green);
  background: #eefaf4;
}

.complete-change-total.no-change > span,
.complete-change-total.no-change > strong {
  color: var(--green);
}

.cash-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cash-total-panel {
  background: #12202f;
  color: white;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.cash-total-text {
  display: grid;
  gap: 4px;
}

.cash-total-text span {
  color: #9bb7c8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cash-total-text strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.card-pay-button {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  padding: 0;
}

.card-pay-button:focus-visible {
  outline: 3px solid #f1d078;
  outline-offset: 3px;
}

.card-pay-button.active {
  background: #e9f3ff;
  border-color: #93c5fd;
}

.card-icon {
  width: 34px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f7fbff, #b8d9ff);
  box-shadow: inset 0 -7px 0 rgba(18, 97, 166, 0.26);
  position: relative;
}

.card-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 5px;
  background: #12202f;
  opacity: 0.82;
}

.card-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: 11px;
  height: 3px;
  border-radius: 2px;
  background: rgba(18, 32, 47, 0.52);
}

.cash-controls {
  display: grid;
  gap: 10px;
}

.quick-cash-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-cash-button {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 950;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  padding: 8px;
}

.cash-icon {
  width: min(100%, 94px);
  height: 50px;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  padding: 0 12px;
  position: relative;
  overflow: hidden;
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.cash-icon::before,
.cash-icon::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.cash-icon::before {
  inset: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
}

.cash-icon::after {
  top: 0;
  bottom: 0;
  left: 0;
  width: 23px;
  background:
    radial-gradient(circle at 50% 12px, rgba(255, 255, 255, 0.28) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 25px, rgba(255, 255, 255, 0.22) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 38px, rgba(255, 255, 255, 0.28) 0 3px, transparent 4px),
    rgba(255, 255, 255, 0.14);
}

.cash-symbol,
.cash-icon-value {
  position: absolute;
}

.cash-symbol {
  right: 7px;
  bottom: -10px;
  z-index: 0;
  font-size: 58px;
  line-height: 1;
  opacity: 0.18;
  font-weight: 950;
}

.cash-icon-value {
  z-index: 1;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.cash-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-cash-button.cash-exact .cash-icon,
.quick-cash-button.cash-exact-note .cash-icon {
  width: 94px;
  height: 62px;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: #3e2a00;
  box-shadow: none;
}

.quick-cash-button.cash-exact .cash-icon::before,
.quick-cash-button.cash-exact-note .cash-icon::before {
  inset: 0 12px 0 10px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #fff176 0%, #ffc928 45%, #f0a400 100%);
  clip-path: polygon(47% 0, 86% 0, 66% 34%, 91% 34%, 34% 100%, 44% 59%, 12% 59%);
  box-shadow: 0 8px 14px rgba(161, 103, 0, 0.24);
}

.quick-cash-button.cash-exact .cash-icon::after,
.quick-cash-button.cash-exact-note .cash-icon::after {
  display: block;
  top: 9px;
  left: 33px;
  width: 15px;
  height: 34px;
  background: rgba(255, 255, 255, 0.36);
  clip-path: polygon(45% 0, 90% 0, 61% 38%, 82% 38%, 20% 100%, 35% 54%, 0 54%);
}

.quick-cash-button.cash-exact .cash-symbol,
.quick-cash-button.cash-exact-note .cash-symbol {
  display: none;
}

.quick-cash-button.cash-exact .cash-icon-value,
.quick-cash-button.cash-exact-note .cash-icon-value {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #3e2a00;
  font-size: 22px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.quick-cash-button.cash-1 .cash-icon,
.quick-cash-button.cash-2 .cash-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55) 0 7px, transparent 8px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12) 0 21px, transparent 22px),
    linear-gradient(135deg, #c3922c, #f1d078 48%, #9c6f1f);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.34),
    inset 0 0 0 7px rgba(125, 85, 21, 0.18);
}

.quick-cash-button.cash-2 .cash-icon {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55) 0 7px, transparent 8px),
    radial-gradient(circle at 50% 50%, rgba(220, 235, 242, 0.9) 0 18px, transparent 19px),
    linear-gradient(135deg, #b68425, #f2cf72 48%, #8e631c);
}

.quick-cash-button.cash-1 .cash-icon::before,
.quick-cash-button.cash-2 .cash-icon::before {
  inset: 8px;
  border-radius: 50%;
  border-color: rgba(255, 255, 255, 0.42);
}

.quick-cash-button.cash-1 .cash-icon::after,
.quick-cash-button.cash-2 .cash-icon::after {
  display: none;
}

.quick-cash-button.cash-1 .cash-symbol,
.quick-cash-button.cash-2 .cash-symbol {
  right: 50%;
  bottom: 3px;
  transform: translateX(50%);
  font-size: 48px;
  opacity: 0.16;
}

.quick-cash-button.cash-1 .cash-icon-value,
.quick-cash-button.cash-2 .cash-icon-value {
  right: 50%;
  transform: translate(50%, -50%);
  color: #4a3510;
  font-size: 22px;
  text-shadow: none;
}

.quick-cash-button.cash-5 .cash-icon {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 24px, transparent 24px),
    linear-gradient(135deg, #5d6670, #a9b0b5);
}

.quick-cash-button.cash-10 .cash-icon {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 24px, transparent 24px),
    linear-gradient(135deg, #9e2f38, #d96461);
}

.quick-cash-button.cash-20 .cash-icon {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 24px, transparent 24px),
    linear-gradient(135deg, #245aa4, #5b9bdc);
}

.quick-cash-button.cash-50 .cash-icon {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 24px, transparent 24px),
    linear-gradient(135deg, #9d5b1d, #d79b3a);
}

.quick-cash-button.cash-100 .cash-icon {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 24px, transparent 24px),
    linear-gradient(135deg, #2d7b56, #72b381);
}

.quick-cash-button.cash-200 .cash-icon {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 24px, transparent 24px),
    linear-gradient(135deg, #a98127, #d8c15b);
}

.quick-cash-button.active {
  background: #12202f;
  color: white;
  border-color: #12202f;
}

.quick-cash-button.active .cash-label {
  color: white;
}

.manual-cash {
  margin-top: 2px;
}

.manual-cash input[readonly] {
  cursor: pointer;
  caret-color: transparent;
}

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

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

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

.grand-total {
  font-size: 22px;
  color: var(--blue);
}

.ticket-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: calc(100vh - 230px);
  overflow: auto;
}

.ticket-mode-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  flex: 1 1 320px;
  gap: 6px;
}

#view-tickets .panel-head {
  flex-wrap: wrap;
}

.ticket-mode-tabs .ghost-button {
  min-width: 0;
  padding-inline: 8px;
  gap: 4px;
  font-size: 13px;
}

#ticketManualCardPaymentCount {
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(18, 97, 166, 0.12);
  font-size: 11px;
}

.ticket-mode-tabs .ghost-button[aria-pressed="true"] #ticketManualCardPaymentCount {
  background: rgba(255, 255, 255, 0.22);
}

.manual-payment-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff1cd;
  color: #72500d !important;
  font-size: 11px !important;
  font-weight: 950 !important;
}

.manual-payment-state.review {
  background: #fff0f0;
  color: #9a2525 !important;
}

.manual-payment-match-list {
  display: grid;
  gap: 8px;
}

.manual-payment-match {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.manual-payment-match span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.manual-payment-match b {
  color: var(--blue);
  font-size: 18px;
}

.ticket-mode-tabs .ghost-button[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.ticket-list-item {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
}

.ticket-list-item.active {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue);
  background: #f4f9ff;
}

.ticket-list-load-more {
  width: 100%;
  min-height: 48px;
}

.ticket-list-item.open-shift {
  border-color: rgba(19, 138, 91, 0.45);
  background: #f2fbf7;
  box-shadow: inset 4px 0 0 var(--green);
}

.ticket-list-item.open-shift.active {
  border-color: var(--green);
  background: #e9f8f1;
}

.shift-state-pill {
  width: max-content;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 0 8px;
  background: var(--green);
  color: white !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
}

.ticket-list-main,
.ticket-list-side {
  display: grid;
  gap: 5px;
}

.ticket-list-main strong,
.ticket-list-side strong {
  overflow-wrap: anywhere;
}

.ticket-list-main span,
.ticket-list-side span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ticket-list-side {
  text-align: right;
}

.ticket-list-side strong {
  color: var(--blue);
  font-size: 20px;
}

.ticket-detail-panel {
  position: sticky;
  top: 70px;
}

.ticket-detail {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.ticket-print-actions,
.ticket-admin-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ticket-payment-editor {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.ticket-payment-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-right: auto;
}

.ticket-detail-kpis,
.ticket-detail-info {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.ticket-detail-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ticket-detail-info {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ticket-detail-kpis div,
.ticket-detail-info div {
  min-height: 86px;
  background: white;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
}

.ticket-detail-kpis span,
.ticket-detail-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-detail-kpis strong,
.ticket-detail-info strong {
  overflow-wrap: anywhere;
}

.ticket-detail-kpis strong {
  color: var(--blue);
  font-size: 22px;
}

.open-shift-notice {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(19, 138, 91, 0.28);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: #f2fbf7;
  color: var(--green);
  padding: 10px 12px;
  font-weight: 900;
}

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

.ticket-line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(58px, auto) minmax(88px, auto) minmax(88px, auto);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.ticket-line-row.ticket-line-admin {
  grid-template-columns: minmax(180px, 1fr) minmax(58px, auto) minmax(88px, auto) minmax(88px, auto) minmax(74px, auto);
}

.ticket-line-remove {
  min-height: 36px;
  padding: 0 10px;
}

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

.ticket-line-row.header-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-height: auto;
  background: var(--panel-2);
}

.ticket-line-button {
  width: 100%;
  border: 0;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.ticket-line-button:hover,
.ticket-line-button:focus-visible {
  background: #f4f9ff;
  outline: 2px solid rgba(18, 97, 166, 0.16);
  outline-offset: -2px;
}

.product-form,
.supply-form,
.store-expense-form,
.store-supply-form,
.expense-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.store-submit-button,
.expense-submit-button {
  grid-column: 1 / -1;
}

.cash-movement-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.cash-movement-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cash-movement-help {
  padding: 0 16px 16px;
  margin: 0;
}

.cash-current {
  background: #effbf5;
  border-color: #9ed9b9;
}

.stock-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(480px, 52vw);
}

.stock-editor-panel,
.supply-editor-panel {
  position: sticky;
  top: 70px;
}

.stock-editor-panel .product-form,
.supply-editor-panel .supply-form {
  grid-template-columns: 1fr;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.data-table {
  padding: 8px 12px 14px;
  overflow: auto;
}

.stock-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.stock-summary-item {
  min-height: 70px;
  padding: 12px 16px;
  display: grid;
  align-content: center;
  gap: 3px;
  border-right: 1px solid var(--line);
}

.stock-summary-item:last-child {
  border-right: 0;
}

.stock-summary-item span,
.stock-card-quantity span,
.stock-card-quantity small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock-summary-item strong {
  font-size: 22px;
}

.stock-summary-item.is-alert strong {
  color: var(--amber);
}

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

.stock-inventory-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 10px;
  background: white;
  padding: 14px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow);
}

.stock-inventory-card.stock-low {
  border-top-color: var(--amber);
  background: #fffdf6;
}

.stock-inventory-card.stock-out {
  border-top-color: var(--red);
  background: #fff8f8;
}

.stock-card-head,
.stock-card-product,
.stock-card-actions {
  display: flex;
  align-items: center;
}

.stock-card-head {
  justify-content: space-between;
  gap: 10px;
}

.stock-card-product {
  min-width: 0;
  gap: 10px;
}

.stock-card-product img,
.stock-card-fallback {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  background: white;
  object-fit: contain;
  flex: 0 0 auto;
}

.stock-card-fallback {
  display: grid;
  place-items: center;
  background: #eaf4ff;
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.stock-card-product h3,
.stock-card-product p,
.stock-card-quantity {
  margin: 0;
}

.stock-card-product h3 {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.stock-card-product p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stock-card-status {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eaf8f0;
  color: var(--green);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
}

.stock-low .stock-card-status {
  background: #fff0ce;
  color: #965c00;
}

.stock-out .stock-card-status {
  background: #ffe4e4;
  color: var(--red);
}

.stock-card-quantity {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stock-card-quantity strong {
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

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

.stock-card-actions button,
.stock-card-edit {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.stock-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stock-quick-button {
  font-size: 21px;
}

.stock-quick-button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.stock-adjust-button {
  background: var(--panel-2) !important;
}

.stock-card-edit {
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
}

.stock-inventory-card.sale-paused,
.settings-product-sale-row.sale-paused {
  opacity: 0.72;
}

.stock-inventory-card.sale-paused .stock-card-status,
.settings-product-sale-row.sale-paused span {
  background: #ffe4e4;
  color: var(--red);
}

.settings-product-sale-list {
  display: grid;
  gap: 8px;
}

.settings-product-sale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.settings-product-sale-row strong,
.settings-product-sale-row span {
  display: block;
}

.settings-product-sale-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.settings-product-sale-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  padding: 0 10px;
  cursor: pointer;
}

.product-setting-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.product-setting-toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.product-stock-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-stock-fields.is-disabled {
  opacity: 0.5;
}

.stock-card-actions button:active,
.stock-card-edit:active {
  transform: translateY(1px);
}

.data-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(90px, auto)) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.data-row.expense-row {
  grid-template-columns: minmax(160px, 1fr) minmax(110px, auto) minmax(100px, auto);
}

.data-row.cash-movement-row {
  grid-template-columns: minmax(160px, 1fr) minmax(130px, auto) minmax(105px, auto);
}

.cash-movement-row.cash-in strong { color: var(--green); }
.cash-movement-row.cash-out strong { color: var(--red); }

.data-row.event-row {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.data-row.header-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-height: auto;
  background: var(--panel-2);
  margin: 0 -12px;
  padding: 10px 12px;
}

.stock-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.stock-col-product {
  width: auto;
}

.stock-col-price {
  width: 98px;
}

.stock-col-discount {
  width: 98px;
}

.stock-col-stock,
.stock-col-min {
  width: 88px;
}

.stock-col-actions {
  width: 132px;
}

.supply-stock-table {
  min-width: 860px;
}

.supply-stock-table .stock-col-actions {
  width: 290px;
}

.supply-stock-table .row-actions {
  flex-wrap: wrap;
}

.stock-table th,
.stock-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: middle;
}

.stock-table th {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stock-table th:first-child,
.stock-table td:first-child {
  padding-left: 0;
  text-align: left;
}

.stock-table th:nth-child(n + 2),
.stock-table td:nth-child(n + 2) {
  text-align: right;
}

.stock-table th:last-child,
.stock-table td:last-child {
  padding-right: 0;
}

.stock-product-row {
  cursor: pointer;
}

.stock-product-row:hover td {
  background: #f4f9ff;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.number-input-stock-actions {
  display: contents;
}

.stock-product-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-product-edit {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.stock-product-edit:focus-visible {
  outline: 2px solid rgba(18, 97, 166, 0.2);
  outline-offset: 3px;
  border-radius: 8px;
}

.stock-product-title img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  flex: 0 0 auto;
}

.stock-ok {
  color: var(--green);
  font-weight: 900;
}

.stock-low {
  color: var(--amber);
  font-weight: 900;
}

.stock-out,
.negative {
  color: var(--red);
  font-weight: 900;
}

.positive {
  color: var(--green);
  font-weight: 900;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.kpi {
  min-height: 104px;
  background: white;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.kpi span,
.sync-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.dashboard-head {
  align-items: center;
}

.dashboard-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  width: min(100%, 560px);
  gap: 10px;
  align-items: end;
}

.dashboard-period-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 6px;
}

.dashboard-period-controls button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.dashboard-period-controls button[aria-pressed="true"] {
  background: #12202f;
  border-color: #12202f;
  color: white;
}

.dashboard-event-filter {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.dashboard-kpi-grid .kpi-primary {
  background: #12202f;
}

.dashboard-kpi-grid .kpi-primary span,
.dashboard-kpi-grid .kpi-primary strong {
  color: white;
}

.dashboard-insights-panel {
  padding-bottom: 0;
}

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.dashboard-insights-grid > div {
  min-height: 106px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  background: white;
}

.dashboard-insights-grid span,
.dashboard-insights-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-insights-grid strong {
  font-size: 25px;
}

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

.dashboard-chart-panel {
  min-width: 0;
}

.dashboard-chart {
  min-height: 230px;
  padding: 12px;
  overflow-x: auto;
}

.dashboard-bars {
  min-width: min(100%, calc(var(--bar-count) * 46px));
  min-height: 206px;
  display: grid;
  grid-template-columns: repeat(var(--bar-count), minmax(38px, 1fr));
  align-items: end;
  gap: 7px;
}

.dashboard-bar-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 130px auto auto;
  align-items: end;
  gap: 5px;
  text-align: center;
}

.dashboard-bar-item.is-drilldown {
  cursor: pointer;
}

.dashboard-bar-item.is-drilldown:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.dashboard-bar-track {
  width: 100%;
  height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f5;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.dashboard-bar-fill {
  width: 100%;
  height: var(--bar-height);
  min-height: 0;
  border-radius: 7px 7px 0 0;
  background: var(--blue);
}

.dashboard-bars.daily .dashboard-bar-fill {
  background: var(--green);
}

.dashboard-bars.weekly .dashboard-bar-fill {
  background: var(--amber);
}

.dashboard-bar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-item strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.dashboard-empty-chart {
  min-height: 206px;
}

.dashboard-products-table {
  padding: 8px 12px 14px;
  max-height: 430px;
  overflow: auto;
}

.dashboard-product-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.55fr) minmax(170px, 1.35fr) minmax(70px, 0.4fr) minmax(70px, 0.4fr) minmax(96px, 0.55fr) minmax(96px, 0.55fr);
  gap: 10px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

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

.dashboard-product-row.header-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-height: auto;
  background: var(--panel-2);
  margin: 0 -12px;
  padding: 10px 12px;
}

.dashboard-product-row > span,
.dashboard-product-row > strong {
  text-align: right;
}

.dashboard-product-row > span:first-child,
.dashboard-product-row > div,
.dashboard-product-row.header-row > span:first-child {
  text-align: left;
}

.dashboard-product-row.header-row > span:nth-child(2) {
  text-align: left;
}

.dashboard-prep-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.5fr) repeat(3, minmax(110px, 0.6fr));
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-prep-row.header-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-height: auto;
  background: var(--panel-2);
  margin: 0 -12px;
  padding: 10px 12px;
}

.dashboard-prep-row > span,
.dashboard-prep-row > strong {
  text-align: right;
}

.dashboard-prep-row > strong {
  color: var(--green-dark, #18794e);
  font-size: 18px;
}

.compact-table .data-row {
  min-height: 50px;
}

.sync-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.sync-status div {
  background: white;
  min-height: 88px;
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.sync-status strong {
  overflow-wrap: anywhere;
}

.backup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px;
}

.file-button input {
  display: none;
}

.sync-log {
  min-height: 140px;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.settings-list {
  display: grid;
}

.settings-row {
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.settings-row > div:first-child {
  display: grid;
  gap: 5px;
}

.settings-row strong {
  overflow-wrap: anywhere;
}

.settings-row span,
.settings-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 6px;
}

.segmented-control button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.segmented-control button[aria-pressed="true"] {
  background: #12202f;
  border-color: #12202f;
  color: white;
}

.settings-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.settings-status div {
  min-height: 88px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background: white;
  padding: 14px;
}

.settings-status strong {
  overflow-wrap: anywhere;
}

.settings-section {
  border-top: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 14px;
}

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

.settings-section h3,
.settings-section h4 {
  margin: 0;
  letter-spacing: 0;
}

.settings-section h3 {
  font-size: 17px;
}

.settings-section h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.status-pill {
  min-height: 30px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 950;
}

.status-pill[data-status="connected"] {
  background: #e9f8f1;
  color: var(--green);
}

.status-pill[data-status="error"],
.status-pill[data-status="unsupported"] {
  background: #fff2f2;
  color: var(--red);
}

.status-pill[data-status="connecting"] {
  background: #fff8e8;
  color: var(--amber);
}

.status-pill[data-status="disabled"] {
  background: #eef2f5;
  color: var(--muted);
}

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

.printer-actions,
.settings-toggles,
.print-job-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.category-order-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.category-order-position {
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  font-weight: 950;
}

.category-order-row strong {
  overflow-wrap: anywhere;
}

.category-order-actions {
  display: flex;
  gap: 6px;
}

.category-order-actions button {
  min-width: 44px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.danger-button {
  color: var(--red);
  border-color: rgba(184, 50, 50, 0.32);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-form-wide {
  grid-column: 1 / -1;
}

.settings-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-form-actions .danger-button {
  margin-right: auto;
}

.event-form {
  align-items: end;
}

.event-edit-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
}

.popup-switch-row {
  margin-top: 12px;
}

.event-row.editing {
  background: #f4f9ff;
}

.ticket-preview-editor {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.ticket-preview {
  width: min(360px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #111820;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.28;
  white-space: pre;
  overflow: auto;
}

.switch-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.switch-row-inline {
  width: max-content;
  max-width: 100%;
}

.switch-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--blue);
}

.settings-inline-select {
  width: min(320px, 100%);
}

.settings-inline-select select {
  margin-top: 2px;
}

.settings-warning,
.settings-ok {
  border: 1px solid;
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.settings-warning {
  background: #fff2f2;
  border-color: rgba(184, 50, 50, 0.28);
  color: var(--red);
}

.settings-ok {
  margin: 16px;
  background: #f2fbf7;
  border-color: rgba(19, 138, 91, 0.28);
  color: var(--green);
}

.settings-diagnostic-warnings {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-diagnostic-warnings:empty {
  display: none;
}

.queue-section {
  border-top: 1px solid var(--line);
}

.print-queue-list,
.print-queue-group {
  display: grid;
  gap: 10px;
}

.print-job {
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.print-job.pending {
  border-left-color: var(--amber);
}

.print-job.printed {
  border-left-color: var(--green);
}

.print-job.error {
  border-left-color: var(--red);
}

.print-job.printing {
  border-left-color: var(--blue);
}

.print-job-main {
  display: grid;
  gap: 4px;
}

.print-job-main span,
.print-job-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.print-job-main small {
  color: var(--red);
}

.print-job-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.print-job-actions button:disabled {
  opacity: 0.45;
}

.small-empty {
  min-height: 54px;
  justify-content: start;
  justify-items: start;
  padding: 10px 0;
}

.payment-print-status {
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: #fbfcfd;
}

.payment-print-status strong {
  font-size: 16px;
}

.payment-print-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.payment-print-status.ok {
  border-left-color: var(--green);
  background: #f2fbf7;
}

.payment-print-status.error {
  border-left-color: var(--red);
  background: #fff2f2;
}

.payment-print-status.queued {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #12202f;
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  z-index: 30;
  max-width: min(520px, calc(100vw - 28px));
  text-align: center;
  font-weight: 800;
  white-space: pre-line;
}

.center-popup {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 32, 47, 0.18);
}

.debug-panel {
  position: fixed;
  z-index: 35;
  width: min(410px, calc(100vw - 20px));
  max-height: min(620px, calc(100dvh - 20px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #52748f;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(10, 30, 50, .35);
}

.debug-panel-handle {
  min-height: 46px;
  display: grid;
  grid-template-columns: 32px 1fr 22px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #163d59;
  color: white;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.debug-panel-handle:active { cursor: grabbing; }
.debug-panel-handle strong { font-size: 15px; }
.debug-panel-grip { opacity: .8; font-size: 21px; line-height: 1; text-align: right; }
.debug-panel-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 7px;
  background: rgba(255, 255, 255, .12);
  color: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.debug-panel-body { display: grid; gap: 10px; padding: 14px; overflow-y: auto; }
.debug-panel-body > p { margin: 0; color: var(--muted); font-size: 13px; }
.debug-potato-list { display: grid; gap: 8px; max-height: 310px; overflow-y: auto; }
.debug-potato-row {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #d5e3ee;
  border-radius: 9px;
  background: #f7fbff;
}
.debug-potato-row.is-ready { background: #fff2df; border-color: #eab969; }
.debug-potato-row-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.debug-potato-row-head strong { font-size: 13px; }
.debug-potato-row-time { font-variant-numeric: tabular-nums; color: #80501d; font-weight: 700; }
.debug-potato-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.debug-potato-actions button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.debug-panel-body > button { min-height: 38px; }
.debug-preview-actions { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.debug-preview-actions > strong { font-size: 13px; }
.debug-preview-actions > button { min-height: 38px; }
.debug-preview-card { max-height: calc(100dvh - 36px); overflow-y: auto; }
.debug-preview-note { margin: 10px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.debug-preview-shift { text-align: left; }
.debug-preview-shift .popup-field { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14px; }
.debug-preview-shift .popup-field strong { color: var(--muted); text-align: right; }
.debug-preview-shift .opening-checklist { margin-bottom: 8px; }
.debug-shift-ready-preview { display: grid; justify-items: center; gap: 8px; margin: 14px 0; padding: 22px 16px; border: 3px solid #23865c; border-radius: 14px; background: #e3f7eb; color: #105f3d; }
.debug-shift-ready-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #168154; color: white; font-size: 39px; font-weight: 800; line-height: 1; }
.debug-shift-ready-preview > strong { font-size: 24px; }
.debug-shift-ready-preview p { margin: 0; font-size: 16px; font-weight: 700; }
.debug-shift-ready-caption { color: #356b55; font-size: 12px; line-height: 1.4; }

.center-popup-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-top: 5px solid var(--amber);
  border-radius: 8px;
  background: white;
  box-shadow: 0 20px 50px rgba(20, 31, 42, 0.22);
  padding: 20px;
  text-align: center;
}

.open-shift-card { max-height: calc(100dvh - 36px); overflow-y: auto; }
.opening-checklist {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  padding: 12px;
  border: 1px solid #d8e0e6;
  border-radius: 10px;
  background: #f8fafb;
  text-align: left;
}
.opening-checklist > strong { font-size: 16px; line-height: 1.2; }
.opening-checklist > label { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 700; }
.opening-checklist > label input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; }
.opening-checklist-status { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.opening-checklist-status strong { font-size: 13px; text-align: right; line-height: 1.3; color: #a05a19; }
.opening-checklist-status strong[data-state="connected"] { color: #12734c; }
.opening-checklist-status strong[data-state="not-used"] { color: var(--muted); }
.opening-checklist-pending { margin: 2px 0 0 !important; padding: 8px; border-radius: 7px; background: #fff0d7; color: #74401a !important; font-size: 12px !important; line-height: 1.4; }
.opening-checklist-pending.is-complete { background: #e1f4e9; color: #12603f !important; }
.opening-checklist-history { display: grid; gap: 5px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.opening-checklist-history strong { font-size: 15px; }
.opening-checklist-history span { color: var(--muted); font-size: 13px; line-height: 1.35; }

.wide-popup-card {
  width: min(620px, 100%);
}

.close-shift-count-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  text-align: left;
}

#closeShiftPopup .center-popup-card {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

.close-shift-count-fields .cash-denomination-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.close-shift-count-result {
  padding: 12px;
  border-radius: 8px;
  background: #eef5fa;
  font-weight: 800;
}

.sync-conflict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.sync-conflict-row small {
  display: block;
  margin-top: 5px;
}

.sync-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 960px) {
  .cash-calculator-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel.cash-calculator-total-panel {
    position: static;
    order: -1;
    padding: 16px;
    gap: 4px;
  }

  .cash-calculator-total-panel small {
    margin-top: 4px;
  }
}

@media (max-width: 720px) {
  .sync-conflict-row {
    grid-template-columns: 1fr;
  }
}

.center-popup-card strong {
  display: block;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.center-popup-card p {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.center-popup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.startup-trailer-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.startup-trailer-choice {
  min-height: 112px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 14px;
  display: grid;
  gap: 5px;
  text-align: left;
}

.startup-trailer-choice strong {
  font-size: 18px;
}

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

.startup-trailer-choice:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.startup-trailer-choice.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(19, 105, 196, 0.14);
}

button.trailer-badge {
  border: 0;
  cursor: pointer;
}

@media (max-width: 560px) {
  .startup-trailer-choices {
    grid-template-columns: 1fr;
  }
}

.popup-field {
  margin: 0 0 16px;
  text-align: left;
}

.popup-field input {
  min-height: 58px;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.number-input-card {
  width: min(390px, 100%);
}

.number-input-card p {
  display: grid;
  gap: 5px;
}

.manual-sumup-status-card {
  max-width: 430px;
  text-align: center;
}

.manual-sumup-status-card > img {
  width: 150px;
  height: 110px;
  margin: 0 auto;
  object-fit: contain;
}

.manual-sumup-status-card > strong {
  font-size: 22px;
}

.manual-sumup-status-amount {
  color: var(--blue);
  font-size: 42px;
  font-weight: 950;
}

.manual-sumup-status-card[data-status="ok"] {
  border-color: rgba(20, 131, 80, 0.5);
}

.manual-sumup-status-card[data-status="error"] {
  border-color: rgba(184, 50, 50, 0.52);
}

.manual-sumup-status-card[data-status="error"] #manualSumupStatusText {
  color: #9a2525;
}

.number-input-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.number-input-field {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.number-input-field input {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--soft);
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
  text-align: right;
}

.number-input-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.number-input-keypad button {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font-size: 24px;
  font-weight: 950;
}

.number-input-keypad button:active {
  transform: translateY(1px);
  background: var(--soft);
}

.number-input-keypad button:disabled {
  opacity: 0.38;
  transform: none;
}

.number-key-wide {
  grid-column: 1 / -1;
  font-size: 18px !important;
}

.popup-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}

.popup-summary div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: white;
  padding: 12px;
  text-align: left;
}

.popup-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.popup-summary strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}

html[data-ui-density="compact"] {
  --density-product-grid-gap: 5px;
  --density-product-grid-pad: 6px;
  --density-product-card-min: clamp(68px, 6.8vw, 108px);
  --app-main-block-pad: 12px;
}

html[data-ui-density="compact"] body {
  font-size: 13px;
}

html[data-ui-density="compact"] .app-header {
  min-height: 44px;
  padding: 3px 8px;
}

html[data-ui-density="compact"] .brand-logo {
  width: 30px;
  height: 30px;
}

html[data-ui-density="compact"] h1 {
  font-size: 14px;
}

html[data-ui-density="compact"] h2 {
  font-size: 15px;
}

html[data-ui-density="compact"] main {
  padding: 6px;
}

html[data-ui-density="compact"] #view-sales.active {
  gap: 6px;
}

html[data-ui-density="compact"] .sales-layout,
html[data-ui-density="compact"] .dashboard-layout,
html[data-ui-density="compact"] .dashboard-chart-layout,
html[data-ui-density="compact"] .tickets-layout,
html[data-ui-density="compact"] .stock-layout,
html[data-ui-density="compact"] .supply-layout,
html[data-ui-density="compact"] .finance-layout,
html[data-ui-density="compact"] .sync-layout,
html[data-ui-density="compact"] .settings-layout {
  gap: 10px;
}

html[data-ui-density="compact"] .sales-layout {
  grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 320px);
}

html[data-ui-density="compact"] .panel-head,
html[data-ui-density="compact"] .payment-head {
  padding: 8px 10px;
}

html[data-ui-density="compact"] .primary-button,
html[data-ui-density="compact"] .ghost-button,
html[data-ui-density="compact"] .icon-button,
html[data-ui-density="compact"] .file-button {
  min-height: 34px;
  padding: 0 8px;
}

html[data-ui-density="compact"] .checkout-button {
  min-height: 46px;
  font-size: 16px;
}

html[data-ui-density="compact"] .product-toolbar,
html[data-ui-density="compact"] .product-card,
html[data-ui-density="compact"] .supply-card {
  padding: 5px;
}

html[data-ui-density="compact"] .product-card strong,
html[data-ui-density="compact"] .product-card .price,
html[data-ui-density="compact"] .supply-card-main strong {
  font-size: 11px;
}

html[data-ui-density="compact"] .cart-lines,
html[data-ui-density="compact"] .ticket-detail,
html[data-ui-density="compact"] .payment-entry,
html[data-ui-density="compact"] .payment-complete {
  padding: 10px;
}

html[data-ui-density="compact"] .ticket-total-row strong {
  font-size: clamp(20px, 1.9vw, 28px);
}

html[data-ui-density="compact"] .ticket-summary {
  padding: 10px 18px 10px 10px;
}

html[data-ui-density="compact"] .ticket-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

html[data-ui-density="compact"] .ticket-head-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

html[data-ui-density="compact"] .ticket-head-actions .ghost-button {
  min-width: 0;
  min-height: 36px;
  padding-inline: 3px;
  font-size: 13px;
}

html[data-ui-density="compact"] .cart-line,
html[data-ui-density="compact"] .ticket-line-row,
html[data-ui-density="compact"] .data-row {
  min-height: 44px;
  padding-top: 6px;
  padding-bottom: 6px;
}

html[data-ui-density="compact"] .quantity-controls {
  grid-template-columns: repeat(4, 32px);
}

html[data-ui-density="compact"] .quantity-controls button,
html[data-ui-density="compact"] .row-actions button {
  min-height: 32px;
}

html[data-ui-density="compact"] .quick-cash-button {
  min-height: 64px;
}

html[data-ui-density="compact"] .checkout-total-row strong {
  font-size: 44px;
}

html[data-ui-density="compact"] .checkout-total-row .card-pay-button {
  min-height: 74px;
}

html[data-ui-density="large"] {
  --density-product-card-min: clamp(112px, 10.5vw, 168px);
}

html[data-ui-density="large"] body {
  font-size: 17px;
}

html[data-ui-density="large"] .product-card strong,
html[data-ui-density="large"] .product-card .price {
  font-size: 15px;
}

html[data-ui-density="large"] .checkout-button {
  min-height: 66px;
  font-size: 22px;
}

@media (max-width: 980px) {
  .dashboard-chart-layout,
  .tickets-layout,
  .stock-layout,
  .supply-layout,
  .store-layout,
  .finance-layout,
  .sync-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .sales-layout {
    grid-template-columns: minmax(0, 1fr) clamp(250px, 31vw, 320px);
    gap: 10px;
  }

  .product-grid {
    --product-card-min: var(--density-product-card-min, clamp(90px, 13vw, 128px));
    gap: var(--density-product-grid-gap, 6px);
    padding: var(--density-product-grid-pad, 8px);
  }

  .supply-grid {
    --supply-card-min: clamp(112px, 22vw, 150px);
  }

  .shopping-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .shopping-quantity,
  .shopping-row > button {
    grid-column: 2;
  }

  .store-supply-row {
    grid-template-columns: 1fr;
  }

  .store-supply-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-card {
    padding: 6px;
  }

  .product-thumb {
    min-height: 0;
  }

  .product-card strong,
  .product-card .price {
    font-size: 12px;
  }

  .product-card .stock {
    font-size: 10px;
  }

  .ticket-panel,
  .ticket-detail-panel {
    position: static;
  }

  .cart-lines {
    max-height: none;
  }

  .ticket-list {
    max-height: none;
  }

  .print-job {
    grid-template-columns: 1fr;
  }

  .print-job-actions {
    justify-content: flex-start;
  }

  .checkout-screen {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .app-header {
    min-height: 54px;
    padding: 5px 8px;
    gap: 8px;
  }

  .menu-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: 16px;
  }

  .header-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .status-badge {
    display: none;
  }

  .header-actions .primary-button,
  .header-actions .ghost-button,
  .header-actions .icon-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .manual-sumup-button {
    width: 42px;
    min-width: 42px;
  }

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

  main {
    padding: 8px;
    --app-main-block-pad: 16px;
  }

  .stock-head-actions {
    min-width: 0;
    width: 100%;
    justify-content: stretch;
  }

  .stock-head-actions .search-input {
    min-width: 0;
    flex: 1;
  }

  .stock-summary-item {
    padding: 10px;
  }

  .stock-summary-item strong {
    font-size: 18px;
  }

  .stock-inventory-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-product-sale-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-product-sale-row button {
    width: 100%;
  }

  .product-stock-fields {
    grid-template-columns: 1fr;
  }

  .settings-row,
  .settings-section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .settings-form-grid,
  .settings-status,
  .printer-status-grid {
    grid-template-columns: 1fr;
  }

  .printer-actions,
  .print-job-actions,
  .category-order-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .printer-actions button,
  .print-job-actions button,
  .category-order-actions button,
  .switch-row-inline {
    width: 100%;
  }

  .stock-head-actions {
    width: 100%;
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  #view-sales.active {
    height: auto;
    overflow: visible;
  }

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

  .shift-status-bar,
  .shift-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .shift-actions > * {
    width: 100%;
  }

  .product-grid {
    overflow: visible;
    grid-auto-rows: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .panel-head,
  .product-form,
  .supply-form,
  .store-expense-form,
  .store-supply-form,
  .expense-form,
  .cash-movement-form,
  .dashboard-kpi-grid,
  .dashboard-insights-grid,
  .kpi-grid,
  .sync-status,
  .settings-row,
  .settings-status {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .cash-movement-actions {
    grid-template-columns: 1fr;
  }

  .cash-calculator-head {
    gap: 12px;
    margin: 4px 4px 12px;
  }

  .panel.cash-calculator-count-panel {
    padding: 14px;
    gap: 20px;
  }

  .cash-denomination-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .cash-denomination {
    padding: 8px;
  }

  .cash-denomination > span {
    font-size: 16px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-actions {
    justify-content: stretch;
  }

  .sync-actions button {
    flex: 1 1 150px;
  }

  .search-input {
    max-width: none;
  }

  .payment-head {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .payment-head > div {
    text-align: left;
  }

  .checkout-total-row strong {
    font-size: 42px;
  }

  .checkout-total-row {
    grid-template-columns: 1fr;
  }

  .checkout-total-row strong,
  .checkout-total-row .card-pay-button,
  .payment-method-buttons {
    grid-column: 1;
    grid-row: auto;
  }

  .payment-method-buttons {
    grid-template-columns: 1fr;
    justify-self: stretch;
  }

  .checkout-total-row .card-pay-button,
  .payment-method-buttons .card-pay-button {
    width: min(260px, 100%);
    justify-self: center;
  }

  .payment-cash-controls .quick-cash-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .complete-total strong {
    font-size: clamp(52px, 16vw, 84px);
  }

  .complete-total {
    min-height: 210px;
    padding: 18px 10px;
  }

  .complete-change-total > span {
    font-size: clamp(22px, 8vw, 34px);
  }

  .ticket-list-item,
  .ticket-detail-kpis,
  .ticket-detail-info,
  .ticket-line-row {
    grid-template-columns: 1fr;
  }

  .ticket-list-side {
    text-align: left;
  }

  .data-row,
  .dashboard-product-row,
  .dashboard-prep-row,
  .data-row.expense-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .dashboard-filter-bar {
    width: 100%;
    grid-template-columns: 1fr;
  }

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

  .dashboard-product-row > span,
  .dashboard-product-row > strong,
  .dashboard-prep-row > span,
  .dashboard-prep-row > strong,
  .dashboard-product-row.header-row > span {
    text-align: left;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

/* El panel de venta no puede conservar dos columnas cuando ya no caben completas. */
@media (max-width: 900px) {
  #view-sales.active {
    height: auto;
    overflow: visible;
  }

  .sales-layout {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .ticket-panel {
    min-height: 520px;
  }
}
