:root {
  color-scheme: light;
  --ink: #1c1916;
  --muted: #6e665e;
  --paper: #f7f2ea;
  --surface: #fffdf8;
  --line: #ddd2c4;
  --sage: #607464;
  --sage-dark: #25382e;
  --rose: #9f3f45;
  --gold: #b68635;
  --teal: #226b70;
  --charcoal: #171615;
  --shadow: 0 22px 54px rgba(32, 27, 22, 0.12);
  --soft-shadow: 0 12px 32px rgba(32, 27, 22, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fbf8f2 0%, var(--paper) 44%, #f2ede6 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Keep every field at 16px so iOS never auto-zooms into a form control. */
input,
select,
textarea {
  font-size: 16px;
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

.app-shell {
  min-height: 100vh;
}

.startup-status {
  width: min(980px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 14px 16px;
  color: #7a271f;
  background: #fff4ec;
  border: 1px solid #e6b6a7;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(92, 41, 30, 0.08);
}

.startup-status strong,
.startup-status span {
  display: block;
}

.startup-status span {
  margin-top: 4px;
  color: #6c453b;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(92px, 0.42fr);
  gap: 14px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(255, 253, 248, 0.88);
  border-bottom: 1px solid rgba(182, 134, 53, 0.28);
  box-shadow: 0 8px 26px rgba(28, 25, 22, 0.06);
  backdrop-filter: blur(18px) saturate(140%);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--charcoal);
  background: transparent;
  border: 1px solid rgba(182, 134, 53, 0.34);
  border-radius: 8px;
  font-weight: 800;
}

.brand-mark.has-logo {
  width: 58px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.brand-mark.has-logo img {
  padding: 0;
  mix-blend-mode: multiply;
}

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

.brand strong {
  max-width: 30ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.mode-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  padding: 4px;
  background: rgba(238, 231, 221, 0.82);
  border: 1px solid rgba(182, 134, 53, 0.24);
  border-radius: 8px;
}

.mode-tab,
.cart-toggle,
.ghost-action,
.primary-action,
.pay-option,
.icon-button {
  border: 0;
  border-radius: 8px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.mode-tab {
  min-width: 76px;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.mode-tab.is-active {
  color: #fff;
  background: var(--charcoal);
}

.cart-toggle {
  justify-self: end;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  color: #fff;
  background: var(--charcoal);
  font-size: 14px;
  font-weight: 800;
}

.cart-toggle strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--charcoal);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
}

.hero {
  position: relative;
  min-height: clamp(470px, 72vh, 740px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.hero-media {
  --hero-media-url: url("assets/hero-fabrics.png");
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 16, 14, 0.78), rgba(18, 16, 14, 0.34) 48%, rgba(18, 16, 14, 0.12)),
    var(--hero-media-url) center / cover;
  transform: scale(1.01);
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media.has-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 16, 14, 0.78), rgba(18, 16, 14, 0.34) 48%, rgba(18, 16, 14, 0.12));
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18%;
  background: linear-gradient(transparent, var(--paper));
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  margin: 0 clamp(16px, 5vw, 64px) clamp(54px, 11vh, 110px);
}

.hero-copy p {
  max-width: 580px;
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.45;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  max-width: 900px;
  font-size: 84px;
  line-height: 0.96;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.3);
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1.05;
}

h3 {
  margin: 0;
  font-size: 19px;
}

.hero-actions,
.catalog-tools,
.pos-metrics,
.payment-grid,
.discount-row,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-action,
.ghost-action {
  min-height: 44px;
  padding: 12px 18px;
  font-weight: 750;
}

.primary-action {
  color: #fff;
  background: linear-gradient(180deg, #ad4950, var(--rose));
  box-shadow: 0 10px 22px rgba(159, 63, 69, 0.22);
}

@media (hover: hover) {
  .primary-action:hover,
  .ghost-action:hover,
  .cart-toggle:hover,
  .icon-button:hover,
  .pay-option:hover {
    transform: translateY(-1px);
  }
}

.ghost-action {
  color: var(--ink);
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(182, 134, 53, 0.24);
}

.compact {
  min-height: 42px;
  padding: 9px 13px;
  background: var(--surface);
  border-color: var(--line);
}

.primary-action.compact {
  color: #fff;
  background: var(--rose);
}

.wide {
  width: 100%;
}

.section {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 66px;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-wrap,
.scan-row label,
.discount-row label,
.auth-card label,
.checkout-form label,
.card-fields label {
  display: grid;
  gap: 6px;
}

.search-wrap span,
.scan-row span,
.discount-row span,
.auth-card span,
.checkout-form span,
.card-fields span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-search {
  width: min(320px, 100%);
  min-width: 260px;
}

.store-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(170px, 200px);
  gap: 16px;
  align-items: end;
  justify-content: end;
}

.store-toolbar .search-wrap {
  width: 100%;
}

.store-toolbar input,
.store-toolbar select {
  height: 50px;
  font-size: 16px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 320px) auto;
  gap: 12px;
  align-items: end;
  justify-content: end;
  width: min(880px, 100%);
}

.admin-toolbar .admin-search {
  justify-self: stretch;
}

.toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-height: 42px;
}

.toolbar-actions .compact {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

input,
select,
textarea {
  height: 42px;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(182, 134, 53, 0.15);
}

textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

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

.product-card,
.quick-card,
.checkout-panel,
.pos-register,
.order-card,
.auth-card,
.profile-card,
.admin-product-card,
.metric-card,
.stock-card,
.insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.product-card {
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover: hover) {
  .product-card:hover {
    border-color: rgba(182, 134, 53, 0.42);
    box-shadow: 0 20px 46px rgba(32, 27, 22, 0.14);
    transform: translateY(-3px);
  }
}

.product-link {
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.product-image {
  aspect-ratio: 5 / 4;
  width: 100%;
  object-fit: cover;
  display: block;
  background: #ddd2c2;
}

.product-info {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.sku,
.stock-pill {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-pill {
  padding: 4px 7px;
  background: #f4eee4;
  border: 1px solid rgba(182, 134, 53, 0.2);
  border-radius: 999px;
}

.product-name {
  min-height: 42px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

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

.price-row strong {
  color: var(--rose);
  font-size: 20px;
}

.variant-scroll-cue {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.variant-scroll-cue.is-scrollable::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 8px;
  z-index: 2;
  width: 54px;
  background: linear-gradient(90deg, rgba(255, 253, 249, 0), var(--surface) 58%);
  border-radius: 0 8px 8px 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.variant-scroll-cue.is-scrollable::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 3;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: rgba(52, 72, 59, 0.58);
  background: transparent;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  transform: translateY(calc(-50% - 4px));
  transition: opacity 160ms ease;
}

.variant-scroll-cue.is-at-end::before,
.variant-scroll-cue.is-at-end::after {
  opacity: 0;
}

.variant-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.variant-chip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 18px auto;
  column-gap: 7px;
  align-items: center;
  min-width: 124px;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  line-height: 1.15;
}

.variant-chip::before {
  content: "";
  width: 18px;
  height: 18px;
  grid-row: span 2;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
}

.variant-chip small {
  color: var(--muted);
  font-weight: 700;
}

.variant-chip.is-active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 113, 117, 0.14);
}

.quantity-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.quantity-control input {
  width: 100%;
}

.length-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.length-hint {
  min-width: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cm-chip {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--sage-dark);
  background: #edf1ea;
  border: 1px solid #d5dfd4;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.cm-chip:active:not(:disabled) {
  transform: translateY(1px);
}

.add-button {
  min-width: 92px;
  min-height: 44px;
  color: #fff;
  background: var(--sage-dark);
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

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

.auth-layout,
.admin-login-layout,
.backoffice-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-login-layout {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
}

.backoffice-layout {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.branding-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 210px));
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(52, 43, 35, 0.08);
}

.branding-panel p,
.printer-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.printer-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(190px, 240px) minmax(160px, 210px) minmax(100px, 130px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(52, 43, 35, 0.08);
}

.printer-panel label {
  display: grid;
  gap: 6px;
}

.logo-upload {
  display: grid;
  gap: 6px;
}

.logo-upload span,
.printer-panel label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.printer-panel input,
.printer-panel select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.printer-panel input:disabled {
  color: #938a80;
  background: #f4eee6;
}

.printer-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

.logo-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  grid-column: span 2;
}

.logo-preview img,
.logo-preview video {
  width: auto;
  min-width: 58px;
  max-width: 128px;
  height: 56px;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
  mix-blend-mode: multiply;
}

.hero-preview {
  justify-content: flex-start;
}

.hero-preview img,
.hero-preview video {
  max-width: 170px;
  height: 82px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  mix-blend-mode: normal;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: start;
  margin-top: 18px;
}

.detail-gallery,
.detail-copy,
.pending-strip,
.media-admin-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(52, 43, 35, 0.08);
}

.detail-gallery,
.detail-copy {
  padding: 16px;
}

.detail-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8dfd3;
  border-radius: 8px;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.detail-price {
  display: block;
  margin: 18px 0;
  font-size: 26px;
}

.detail-rolls {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  background: #f6efe7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-rolls-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.detail-rolls-head strong {
  font-size: 14px;
}

.detail-rolls-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-roll-list {
  display: grid;
  gap: 6px;
}

.detail-roll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.detail-roll strong {
  color: var(--teal);
  font-size: 13px;
  white-space: nowrap;
}

.detail-roll.is-empty {
  opacity: 0.55;
}

.detail-roll-sku {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.detail-roll-location {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.thumb-row,
.color-options {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.thumb-row {
  flex-wrap: wrap;
}

.color-options {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.media-thumb {
  width: 78px;
  height: 62px;
  padding: 3px;
  background: #eee5d9;
  border: 2px solid transparent;
  border-radius: 8px;
}

.media-thumb.is-active {
  border-color: var(--teal);
}

.thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.color-swatch {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.color-swatch::before,
.mini-swatch {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.color-swatch.is-active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 113, 117, 0.14);
}

.pending-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 15px;
}

.pending-strip p {
  margin: 4px 0 0;
  color: var(--muted);
}

.media-admin,
.color-admin {
  display: grid;
  gap: 10px;
}

.color-admin {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.media-admin-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  box-shadow: none;
}

.admin-media-thumb {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.color-editor-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  background: #f6efe7;
  border-radius: 8px;
}

.color-editor-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 42px;
  gap: 9px;
  align-items: center;
}

.color-editor-head strong,
.color-editor-head small {
  display: block;
}

.color-editor-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.editor-roll-list,
.stock-roll-list {
  display: grid;
  gap: 8px;
}

.editor-roll-row,
.stock-roll-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.15fr) minmax(105px, 0.7fr) minmax(130px, 1fr) 42px;
  gap: 8px;
  align-items: end;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.editor-roll-row label,
.stock-roll-row label {
  display: grid;
  gap: 4px;
}

.editor-roll-row label span,
.stock-roll-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-roll-row input,
.stock-roll-row input {
  width: 100%;
  height: 40px;
}


.pos-register,
.checkout-panel,
.auth-card,
.profile-card {
  padding: 16px;
}

.auth-card {
  display: grid;
  gap: 13px;
}

.auth-card h3,
.profile-card h3 {
  margin-bottom: 4px;
}

.profile-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-products {
  display: grid;
  gap: 12px;
}

.admin-product-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.admin-product-card img {
  width: 84px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.admin-product-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.product-form {
  position: sticky;
  top: 92px;
}

.scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  margin-bottom: 14px;
}

.icon-button {
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: #efe6da;
  font-size: 22px;
}

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

.quick-card {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 10px;
  text-align: left;
}

.variant-sale-card {
  align-content: start;
}

.variant-sale-card:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.variant-card-name {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.variant-card-name::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
}

.variant-card-stock {
  color: var(--teal);
  font-weight: 850;
}

.pos-variant-strip {
  margin-top: 0;
  padding-bottom: 5px;
}

.pos-variant-chip {
  min-width: 118px;
  padding: 7px 8px;
  font-size: 13px;
}

.pos-add-button {
  width: 100%;
  min-height: 42px;
}

.quick-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
}

.quick-card strong {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

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

.ticket-lines {
  display: grid;
  gap: 10px;
  min-height: 88px;
  margin-bottom: 14px;
}

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

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #f5eee5;
  border-radius: 8px;
}

.line-item strong,
.line-item span {
  display: block;
}

.line-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.line-main {
  min-width: 0;
}

.line-adjustments {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(221, 210, 196, 0.7);
}

.line-adjustments label {
  display: grid;
  gap: 4px;
}

.line-adjustments span {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
}

.line-adjustments input {
  width: 100%;
  height: 40px;
  padding-inline: 9px;
}

.line-note-field {
  grid-column: 1 / -1;
}

.qty-actions {
  display: grid;
  grid-template-columns: 38px 76px 38px;
  gap: 4px;
  align-items: center;
}

.qty-actions button {
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  font-weight: 900;
}

.qty-actions input {
  width: 76px;
  height: 38px;
  text-align: center;
}

.line-remove {
  width: 40px;
  height: 40px;
  color: var(--rose);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.line-remove:active:not(:disabled) {
  transform: translateY(1px);
}

.discount-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

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

.total-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.total-row.grand {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

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

.pay-option {
  height: 44px;
  color: var(--sage-dark);
  background: #edf1ea;
  border: 1px solid #d5dfd4;
  font-weight: 800;
}

.pay-option.is-active {
  color: #fff;
  background: var(--sage-dark);
}

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

.order-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 15px;
}

.order-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.status-pill {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: capitalize;
}

.status-pill.pending {
  color: #7a4c05;
  background: #fff0ca;
}

.status-pill.completed {
  color: #275138;
  background: #dcecdf;
}

.order-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: center;
}

.stock-summary,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 15px;
}

.metric-card span,
.metric-card small,
.insight-note {
  color: var(--muted);
}

.metric-card span,
.metric-card small {
  font-weight: 750;
}

.metric-card strong {
  font-size: 25px;
  line-height: 1.1;
}

.stock-list {
  display: grid;
  gap: 14px;
}

.stock-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.stock-card-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.stock-card-head img {
  width: 72px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.stock-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.stock-color-group {
  display: grid;
  gap: 9px;
  padding: 10px;
  background: #f6efe7;
  border-radius: 8px;
}

.stock-color-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
}

.stock-color-head strong {
  color: var(--teal);
  font-size: 13px;
  white-space: nowrap;
}

.stock-variant-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.insight-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.insight-card {
  display: grid;
  gap: 12px;
  padding: 15px;
}

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

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

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

.insight-row span:first-child {
  min-width: 0;
}

.insight-row strong,
.insight-row small {
  display: block;
}

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

.insight-row small {
  margin-top: 2px;
  color: var(--muted);
}

.insight-row > span:last-child {
  flex: 0 0 auto;
  font-weight: 900;
}

.insight-note {
  margin: 6px 0 0;
  line-height: 1.55;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.cart-drawer.is-open {
  display: block;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(31, 28, 25, 0.42);
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  max-width: 100%;
  height: 100%;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: auto;
}

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

.checkout-form,
.card-fields {
  display: grid;
  gap: 11px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.card-fields {
  grid-template-columns: 1fr 120px;
  padding: 0;
  border-top: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 14px;
  color: #fff;
  background: var(--sage-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .mode-tabs {
    order: 3;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .mode-tab {
    min-width: 0;
    padding-inline: 10px;
  }

  h1 {
    font-size: 60px;
  }

  h2 {
    font-size: 32px;
  }

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

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

  .checkout-panel {
    order: 1;
  }

  .pos-register {
    order: 2;
  }

  .auth-layout,
  .admin-login-layout,
  .backoffice-layout,
  .insight-layout {
    grid-template-columns: 1fr;
  }

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

  .branding-panel,
  .printer-panel {
    grid-template-columns: 1fr;
  }

  .logo-preview {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .product-form {
    position: static;
  }

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

  .admin-toolbar {
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  .store-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
    justify-content: stretch;
    width: 100%;
  }

  .admin-search {
    width: 100%;
    min-width: 0;
  }

  .toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .editor-roll-row,
  .stock-roll-row {
    grid-template-columns: minmax(130px, 1fr) minmax(105px, 0.65fr) minmax(130px, 1fr) 42px;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
    padding: 12px;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    max-width: 22ch;
    font-size: 15px;
  }

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

  .mode-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .mode-tab {
    flex: 0 0 auto;
    min-width: max-content;
    font-size: 13px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-copy p {
    font-size: 17px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 28px;
  }

  .section-heading,
  .catalog-tools {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .product-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .pos-metrics,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .ghost-action {
    width: 100%;
  }

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

  .stock-summary,
  .insight-grid,
  .stock-variant-list {
    grid-template-columns: 1fr;
  }

  .stock-card-head {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .stock-card-head button {
    grid-column: 1 / -1;
  }

  .color-editor-head,
  .stock-color-head {
    grid-template-columns: 24px minmax(0, 1fr) 42px;
  }

  .color-editor-head .ghost-action,
  .stock-color-head .ghost-action {
    grid-column: 2 / -1;
  }

  .stock-color-head strong {
    grid-column: 2 / -1;
  }

  .editor-roll-row,
  .stock-roll-row {
    grid-template-columns: 1fr 1fr 42px;
  }

  .editor-roll-row label:nth-child(3),
  .stock-roll-row label:nth-child(3) {
    grid-column: 1 / 3;
  }

  .admin-product-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .admin-product-card button {
    grid-column: 1 / -1;
  }

  .card-fields {
    grid-template-columns: 1fr;
  }

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

  .line-item {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .line-item .line-main {
    grid-column: 1 / -1;
  }

  .line-item .qty-actions {
    justify-self: start;
  }

  .line-adjustments {
    grid-template-columns: 1fr;
  }

  .line-adjustments .line-note-field {
    grid-column: 1 / -1;
  }

  .qty-actions {
    grid-template-columns: 42px 80px 42px;
  }
}
