/* v2.1.0: snelle verkoop, voorraad, betalingen, bonnen en dashboards */
.quick-sale-toolbar,
.split-payment-fields,
.discount-fields,
.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-sale-toolbar {
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  margin: 12px 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.secondary-button.is-active {
  background: #f1b434;
  color: #101820;
}

.product-button {
  position: relative;
}

.product-button.is-sold-out {
  filter: grayscale(0.9);
  opacity: 0.55;
  cursor: not-allowed;
}

.favorite-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1b434;
  color: #101820;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.stock-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f4eb;
  color: #185c32;
  font-size: 0.72rem;
  font-weight: 800;
}

.stock-badge.is-low {
  background: #fff0d2;
  color: #8c5600;
}

.editor-subsection {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(16, 24, 32, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.editor-subsection h3 {
  margin: 0;
}

.live-dashboard-panel {
  margin-top: 18px;
}

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

.dashboard-card {
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  background: #f7f3e8;
}

.dashboard-card h3 {
  margin: 0 0 10px;
}

.dashboard-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(16, 24, 32, 0.08);
}

.dashboard-big {
  display: block;
  font-size: 2.4rem;
}

.receipt-modal-card {
  max-width: 520px;
}

.printable-receipt {
  padding: 20px;
  border: 1px dashed rgba(16, 24, 32, 0.3);
  background: white;
}

.printable-receipt > img {
  width: min(100%, 300px);
}

.receipt-table > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(16, 24, 32, 0.22);
}

.managed-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.managed-user-row > div:first-child {
  display: grid;
  gap: 3px;
}

.managed-user-row.is-disabled {
  opacity: 0.58;
}

.recovery-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(16, 24, 32, 0.12);
}

.recovery-form h2 {
  margin: 0;
}

@media (max-width: 1000px) {
  .quick-sale-toolbar,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .quick-sale-toolbar,
  .split-payment-fields,
  .discount-fields,
  .inline-fields,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* v2.0.0: medewerkers, pre-orders, diensten en volledige back-ups */
.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.preorder-toggle {
  margin-top: 6px;
}

.preorder-fields {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(29, 88, 61, 0.22);
  border-radius: 14px;
  background: rgba(231, 244, 235, 0.7);
}

.preorder-fields[hidden] {
  display: none;
}

.sale-row-preorder {
  border-left: 5px solid #c88a1b;
}

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

.shift-layout.active {
  display: grid;
}

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

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
}

@media (max-width: 800px) {
  .shift-layout.active {
    grid-template-columns: 1fr;
  }

  .shift-history-panel {
    grid-column: auto;
  }

  .user-badge {
    width: 100%;
    justify-content: center;
  }
}

:root {
  color: #2f3137;
  background: #f5f5f5;
  font-family:
    "Sora", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --brand-red: #f00613;
  --brand-red-dark: #d90410;
  --brand-text: #2f3137;
  --brand-muted: #777d86;
  --brand-line: #e5e6ea;
  --brand-soft: #f1f2f4;
  --brand-white: #ffffff;
  --shadow: 0 12px 30px rgba(34, 38, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f5f5f5;
}

.login-body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.9)),
    url("./../images/spatlap.jpeg") center/cover no-repeat fixed;
}

button,
input,
select {
  font: inherit;
}

input,
select {
  font-family: "Sora", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: 100vh;
  padding: 0 0 24px;
}

.promo-bar {
  align-items: center;
  background: var(--brand-red);
  color: #ffffff;
  display: flex;
  font-size: 0.74rem;
  font-weight: 600;
  height: 18px;
  justify-content: center;
  letter-spacing: 0;
}

.topbar {
  background: #ffffff;
  display: grid;
  gap: 16px 22px;
  grid-template-columns: auto minmax(320px, 1fr) auto;
  margin: 0 auto 24px;
  max-width: 1440px;
  padding: 14px 24px;
}

.topbar-side {
  align-items: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  align-self: center;
  width: 100%;
}

.brand-block {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: auto;
  max-width: 290px;
  width: clamp(170px, 21vw, 290px);
}

.brand-copy {
  display: grid;
  gap: 6px;
  align-content: center;
  padding-top: 4px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  letter-spacing: 0;
  line-height: 0.98;
  color: var(--brand-text);
}

h2 {
  font-size: 1.05rem;
  letter-spacing: 0;
  color: var(--brand-text);
}

.topbar-actions {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  display: flex;
  padding: 4px;
}

.display-link {
  align-items: center;
  background: var(--brand-red);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 800;
  min-height: 42px;
  padding: 0 18px;
  text-decoration: none;
  white-space: nowrap;
}

.header-links {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-self: end;
  align-self: center;
}

.sync-indicator {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 16px;
  display: grid;
  min-width: 150px;
  padding: 10px 14px;
  justify-self: center;
  text-align: left;
}

.sync-indicator strong {
  font-size: 0.92rem;
}

.sync-indicator[data-tone="ok"] {
  background: #f4faf5;
  border-color: #cfe5d4;
}

.sync-indicator[data-tone="warning"] {
  background: #fff7f1;
  border-color: #f2d2b4;
}

.sync-indicator[data-tone="syncing"] {
  background: #fff3f4;
  border-color: #f7c6cb;
}

.sync-diagnostics {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 14px;
}

.sync-diagnostics span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.tab {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--brand-muted);
  font-weight: 700;
  min-height: 38px;
  padding: 0 18px;
}

.tab.active {
  background: #ffffff;
  color: var(--brand-text);
  box-shadow: 0 6px 16px rgba(34, 38, 48, 0.1);
}

.register-layout,
.overview-layout,
.cash-layout,
.settings-layout {
  margin: 0 auto;
  max-width: 1440px;
}

.overview-layout {
  display: grid;
  gap: 18px;
  padding: 0 24px;
}

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

.products-panel,
.panel,
.receipt-panel {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.products-panel {
  display: grid;
  gap: 22px;
  padding: 20px;
}

.catalog-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

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

.catalog-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sort-strip {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
}

.sort-chip {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--brand-muted);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 900;
  justify-content: center;
  min-height: 38px;
  min-width: 58px;
  padding: 0 12px;
  white-space: nowrap;
}

.sort-chip.active {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(34, 38, 48, 0.08);
  color: var(--brand-text);
}

.catalog-tab {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  color: var(--brand-muted);
  flex: 0 0 auto;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

.catalog-tab.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #ffffff;
}

.catalog-panel {
  display: grid;
  gap: 22px;
}

.product-group {
  display: grid;
  gap: 14px;
}

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

.group-dot {
  align-items: center;
  background: #fff1f2;
  border-radius: 999px;
  color: var(--brand-red);
  display: inline-flex;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

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

.product-card {
  display: grid;
  gap: 8px;
}

.product-button.is-draggable {
  cursor: grab;
}

.product-drag-handle {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
}

.product-button {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  color: var(--brand-text);
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  min-height: 112px;
  overflow: hidden;
  padding: 16px;
  text-align: left;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.product-image {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  display: block;
  margin-bottom: 2px;
  object-fit: cover;
  width: 100%;
}

.product-button:hover {
  background: #fffafa;
  border-color: var(--brand-red);
  transform: translateY(-1px);
}

.product-edit-button {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  color: var(--brand-text);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
}

.product-name {
  display: block;
  font-size: 0.97rem;
  font-weight: 900;
  line-height: 1.25;
  max-width: 100%;
  min-height: 2.5em;
  overflow-wrap: anywhere;
  word-break: normal;
}

.product-price {
  color: var(--brand-text);
  font-size: 1.25rem;
  line-height: 1.1;
  margin-top: auto;
  white-space: nowrap;
}

.receipt-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  position: sticky;
  top: 20px;
}

.entry-mode-card {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.entry-mode-copy {
  display: grid;
  gap: 4px;
}

.entry-mode-copy strong {
  font-size: 0.98rem;
}

.entry-mode-copy span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
}

.entry-mode-tabs {
  background: #ffffff;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
}

.entry-mode-tab {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--brand-muted);
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

.entry-mode-tab.active {
  background: var(--brand-red);
  color: #ffffff;
}

.entry-mode-card[data-mode="correction"] {
  background: #fff3f4;
  border-color: #f7c6cb;
}

.entry-mode-card[data-mode="correction"] .entry-mode-tabs {
  background: #fffafa;
}

.receipt-header,
.panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.receipt-header h2 {
  font-size: 2rem;
  letter-spacing: 0;
}

.icon-button,
.qty-control button {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  color: var(--brand-text);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.icon-button {
  font-weight: 900;
  padding: 0 14px;
  width: auto;
}

.receipt-lines {
  border-bottom: 1px solid var(--brand-line);
  border-top: 1px solid var(--brand-line);
  display: grid;
  gap: 10px;
  min-height: 120px;
  padding: 12px 0;
}

.empty-state {
  align-items: center;
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  gap: 8px;
  justify-items: center;
  place-self: center;
  text-align: center;
}

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

.receipt-line div:nth-child(2) {
  display: grid;
  gap: 3px;
}

.receipt-thumb {
  border-radius: 10px;
  display: block;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

.receipt-line span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.qty-control {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px 28px 42px;
  justify-items: center;
}

.receipt-line-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receipt-line-total {
  color: var(--brand-text) !important;
  font-weight: 800;
}

.line-badge {
  background: #fff1f2;
  border-radius: 999px;
  color: var(--brand-red-dark);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  min-height: 24px;
  padding: 0 10px;
  align-items: center;
}

.ticket-summary {
  background: var(--brand-soft);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.ticket-summary div,
.total-row,
.payment-totals div {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.field {
  display: grid;
  gap: 6px;
}

.toggle-field {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.toggle-field span {
  color: var(--brand-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.toggle-switch {
  display: inline-flex;
  position: relative;
}

.toggle-switch input {
  height: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

.toggle-slider {
  background: #d8dce2;
  border-radius: 999px;
  display: inline-flex;
  height: 30px;
  position: relative;
  transition: background 160ms ease;
  width: 54px;
}

.toggle-slider::after {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(34, 38, 48, 0.18);
  content: "";
  height: 24px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 160ms ease;
  width: 24px;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--brand-red);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(24px);
}

.field span {
  color: var(--brand-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field select,
.cash-row input {
  background: #ffffff;
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.compact-field span {
  font-size: 0.8rem;
}

.password-field {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.password-toggle {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  color: var(--brand-text);
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 52px;
  padding: 0 12px;
}

.password-toggle-icon {
  align-items: center;
  display: inline-flex;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.password-toggle-icon svg {
  display: block;
  height: 20px;
  width: 20px;
}

.checkout-button,
.secondary-button,
.danger-button {
  align-items: center;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
}

.checkout-button {
  background: var(--brand-red);
  color: #ffffff;
  font-size: 1.05rem;
}

.secondary-button {
  background: var(--brand-soft);
  color: var(--brand-text);
}

.danger-button {
  background: #fff0f1;
  color: var(--brand-red-dark);
}

.logout-button {
  min-width: 120px;
}

.wide {
  width: 100%;
}

.login-shell {
  display: grid;
  min-height: 100vh;
}

.modal-backdrop {
  align-items: center;
  background: rgba(47, 49, 55, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 40;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(34, 38, 48, 0.18);
  display: grid;
  gap: 16px;
  max-width: 560px;
  padding: 20px;
  width: min(100%, 560px);
}

.modal-form,
.modal-fields {
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

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

.category-row-copy,
.category-row-actions {
  display: grid;
  gap: 4px;
}

.category-row-copy span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
}

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

.image-dropzone {
  align-items: center;
  background: #fff7f8;
  border: 1px dashed #f3b3ba;
  border-radius: 12px;
  color: var(--brand-muted);
  display: flex;
  justify-content: center;
  min-height: 96px;
  padding: 14px;
  text-align: center;
}

.product-preview {
  background: var(--brand-soft);
  border-radius: 12px;
  display: grid;
  justify-items: start;
  padding: 10px;
}

.product-preview img {
  border-radius: 10px;
  display: block;
  max-height: 180px;
  max-width: 180px;
  object-fit: cover;
  width: 100%;
}

.login-card {
  align-self: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 230, 234, 0.92);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(34, 38, 48, 0.12);
  display: grid;
  gap: 20px;
  margin: 32px auto;
  max-width: 520px;
  padding: 28px;
  width: calc(100% - 32px);
}

.login-logo {
  width: min(320px, 100%);
}

.login-copy,
.login-form {
  display: grid;
  gap: 12px;
}

.login-text {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.login-message {
  border-radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 12px 14px;
}

.login-message[data-tone="neutral"] {
  background: var(--brand-soft);
  color: var(--brand-muted);
}

.login-message[data-tone="warning"] {
  background: #fff7f1;
  color: #9a4e14;
}

.login-message[data-tone="error"] {
  background: #fff1f2;
  color: var(--brand-red-dark);
}

.metric-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.order-filters {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(140px, 0.75fr));
  align-items: end;
}

.metric {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.metric span,
.muted {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.metric strong {
  font-size: 1.65rem;
}

.cash-layout,
.settings-layout {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.55fr);
  padding: 0 24px;
}

.overview-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.55fr);
  align-items: stretch;
}

.panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.panel-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 48px;
}

.panel-heading h2 {
  align-items: center;
  display: flex;
  min-height: 42px;
}

.panel-actions,
.stacked-actions {
  display: grid;
  gap: 10px;
}

.panel-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-grid > .panel:first-child {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.overview-grid > .panel:last-child {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.overview-grid > .panel:last-child .panel-heading {
  align-items: center;
}

.chart-panel {
  align-content: start;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  gap: 6px;
}

.chart-row-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.chart-row-header span {
  font-size: 0.9rem;
}

.chart-bar {
  background: var(--brand-soft);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.chart-bar-fill {
  background: var(--brand-red);
  border-radius: 999px;
  height: 100%;
}

.sales-list,
.product-totals,
.audit-list {
  display: grid;
  gap: 8px;
}

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

.sale-row div {
  display: grid;
  gap: 4px;
}

.sale-row-main {
  min-width: 0;
}

.sale-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sale-row-button {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  color: var(--brand-text);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
}

.sale-row-button.danger {
  background: #fff3f4;
  border-color: #f7c6cb;
  color: var(--brand-red-dark);
}

.sale-row span,
.sale-row em {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.sale-row em {
  font-style: normal;
  font-weight: 800;
}

.sale-row-correction strong {
  color: var(--brand-red-dark);
}

.sale-row-voided {
  opacity: 0.55;
}

.audit-row {
  border-bottom: 1px solid var(--brand-line);
  display: grid;
  gap: 6px;
  padding: 10px 0;
}

.audit-row strong {
  font-size: 0.96rem;
}

.audit-row span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
}

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

.sales-pager {
  justify-content: center;
  margin-top: 16px;
}

.payment-method-form,
.payment-method-row,
.seller-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-method-form input { flex: 1; }
.payment-method-list, .seller-stats { display: grid; gap: 10px; margin-top: 12px; }
.payment-method-row, .seller-stat-row { justify-content: space-between; padding: 12px; border: 1px solid rgba(16, 24, 32, 0.14); border-radius: 12px; }
.seller-stat-row { grid-template-columns: minmax(140px, 1fr) repeat(3, auto); }

.audit-page-label {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  min-width: 130px;
  text-align: center;
}

.total-row {
  border-bottom: 1px solid var(--brand-line);
  min-height: 38px;
}

.payment-totals {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.payment-totals div {
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.cash-grid {
  display: grid;
  gap: 8px;
}

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

.cash-metric {
  background: var(--brand-soft);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.cash-metric span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cash-metric strong {
  font-size: 1.2rem;
}

#cash-difference.is-positive {
  color: #1b7f38;
}

#cash-difference.is-negative {
  color: var(--brand-red-dark);
}

.cash-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 110px 1fr 110px;
}

.cash-row strong {
  text-align: right;
}

.action-panel {
  align-content: start;
}

.action-panel p {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.cloud-state {
  background: var(--brand-soft);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.cloud-state strong {
  font-size: 0.95rem;
}

.cloud-state span {
  color: var(--brand-muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

.save-note {
  align-items: center;
  color: var(--brand-muted);
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px 0;
}

.view {
  display: none !important;
}

.view.active {
  display: grid !important;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar-side {
    justify-items: start;
    width: auto;
  }

  .header-links {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .register-layout,
  .overview-grid,
  .cash-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .receipt-panel {
    position: static;
  }

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

  .order-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0 0 12px;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 14px 12px;
  }

  .topbar-side {
    justify-items: stretch;
  }

  .brand-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo {
    width: min(240px, 100%);
  }

  .topbar-actions {
    overflow-x: auto;
  }

  .sync-indicator {
    min-width: 0;
  }

  .catalog-tabs {
    flex-direction: column;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-strip {
    justify-content: space-between;
  }

  .catalog-tab {
    width: 100%;
  }

  .display-link {
    justify-content: center;
    width: 100%;
  }

  .header-links {
    flex-direction: column;
  }

  .logout-button {
    width: 100%;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-actions {
    justify-content: stretch;
    width: 100%;
  }

  .audit-pager {
    justify-content: stretch;
    width: 100%;
  }

  .tab {
    flex: 1;
    min-width: 106px;
  }

  .products-panel,
  .panel,
  .receipt-panel {
    padding: 14px;
  }

  .register-layout,
  .overview-layout,
  .overview-grid,
  .cash-layout,
  .settings-layout {
    padding: 0 12px;
  }

  .product-grid,
  .metric-row,
  .chart-grid,
  .order-filters {
    grid-template-columns: 1fr;
  }

  .product-button {
    min-height: 92px;
  }

  .product-name {
    min-height: auto;
  }

  .receipt-line {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .receipt-thumb {
    height: 44px;
    width: 44px;
  }

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

  .cash-row strong {
    text-align: left;
  }

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

  .sale-row-actions {
    justify-content: flex-start;
  }

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

  .category-row-actions {
    justify-content: flex-start;
  }
}
