.pos-shell {
  --pos-border: #d9dde3;
  --pos-muted: #68707d;
  --pos-panel: #ffffff;
  --pos-soft: #f5f7f9;
  --pos-ink: #16191d;
  --pos-danger: #9b2424;
  --pos-success: #176a43;
  color: var(--pos-ink);
}

.pos-shell .container {
  width: min(1180px, calc(100% - 28px));
}

.pos-muted {
  color: var(--pos-muted);
}

.pos-warning-text {
  color: var(--pos-danger);
  font-weight: 700;
}

.pos-visually-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--pos-muted);
  margin-bottom: 4px;
}

.pos-hero,
.pos-section-heading,
.pos-checkout-summary,
.pos-cart-row,
.pos-product-card,
.pos-checkout-items,
.pos-payment-form,
.pos-detail-summary,
.pos-complete-card,
.pos-login-card {
  border: 1px solid var(--pos-border);
  border-radius: 18px;
  background: var(--pos-panel);
}

.pos-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(22px, 4vw, 40px);
  margin-bottom: 18px;
}

.pos-hero h1,
.pos-section-heading h1,
.pos-section-heading h2 {
  margin-top: 4px;
  margin-bottom: 8px;
}

.pos-hero-action,
.pos-touch-button,
.pos-checkout-button,
.pos-complete-sale-button,
.pos-cart-shortcut,
.pos-nav-link,
.pos-nav-logout button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-hero-action {
  min-width: 190px;
  font-size: 1.05rem;
  font-weight: 800;
}

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

.pos-metric-card {
  padding: 18px;
  border: 1px solid var(--pos-border);
  border-radius: 16px;
  background: var(--pos-soft);
}

.pos-metric-card span,
.pos-metric-card strong {
  display: block;
}

.pos-metric-card span {
  color: var(--pos-muted);
  font-size: .9rem;
}

.pos-metric-card strong {
  margin-top: 6px;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.pos-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.pos-action-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--pos-border);
  border-radius: 16px;
  background: var(--pos-panel);
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.pos-action-card:hover,
.pos-action-card:focus-visible,
.pos-sale-row:hover,
.pos-sale-row:focus-visible {
  border-color: #7b8794;
  box-shadow: 0 6px 22px rgba(30, 36, 43, .08);
}

.pos-action-card--primary {
  background: #1b1e22;
  color: #fff;
  border-color: #1b1e22;
}

.pos-action-kicker {
  font-size: .75rem;
  opacity: .7;
}

.pos-action-card strong {
  font-size: 1.15rem;
}

.pos-action-card > span:last-child {
  font-size: .9rem;
  opacity: .8;
}

.pos-section-heading {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 18px 0 12px;
}

.pos-section-heading--top {
  margin-top: 0;
}

.pos-sale-list {
  display: grid;
  gap: 10px;
}

.pos-sale-list--history {
  margin-bottom: 24px;
}

.pos-sale-row {
  min-height: 72px;
  border: 1px solid var(--pos-border);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pos-sale-row span,
.pos-sale-row small {
  display: block;
}

.pos-sale-row small {
  color: var(--pos-muted);
  margin-top: 4px;
}

.pos-empty-state {
  border: 1px dashed #b9c0c8;
  border-radius: 16px;
  padding: 24px;
  background: var(--pos-soft);
  display: grid;
  gap: 8px;
}

.pos-search-panel {
  border: 1px solid var(--pos-border);
  border-radius: 16px;
  padding: 16px;
  background: var(--pos-soft);
  margin-bottom: 16px;
}

.pos-search-panel > label,
.pos-form-group > label,
.pos-cart-actions label {
  display: block;
  font-weight: 800;
  margin-bottom: 7px;
}

.pos-search-row,
.pos-inline-control {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.pos-search-input,
.pos-number-input,
.pos-money-input,
.pos-payment-form input[type="text"],
.pos-payment-form input[type="tel"],
.pos-payment-form textarea,
.pos-login-form input {
  min-height: 50px;
  border: 1px solid #aeb6c0;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.pos-search-input {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
}

.pos-number-input {
  width: 88px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.pos-product-grid,
.pos-cart-list {
  display: grid;
  gap: 14px;
}

.pos-product-card {
  padding: 18px;
}

.pos-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pos-product-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--pos-border);
}

.pos-variant-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pos-variant-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--pos-soft);
  border-radius: 14px;
}

.pos-variant-copy {
  min-width: 0;
}

.pos-variant-copy strong,
.pos-variant-copy span {
  display: block;
}

.pos-variant-copy span {
  margin-top: 3px;
  color: var(--pos-muted);
  font-size: .9rem;
}

.pos-add-form {
  display: flex;
  gap: 8px;
  align-items: end;
}

.pos-stock-badge {
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .85rem;
}

.pos-stock-badge--empty {
  color: #7c2a2a;
  background: #f9e9e9;
}

.pos-cart-row {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
}

.pos-cart-copy h2 {
  margin-top: 0;
  margin-bottom: 5px;
}

.pos-cart-copy p {
  margin: 4px 0;
  color: var(--pos-muted);
}

.pos-line-total {
  display: block;
  margin-top: 10px;
  font-size: 1.25rem;
}

.pos-cart-actions {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.pos-danger-button {
  min-height: 48px;
  border-color: #d9a6a6;
  color: var(--pos-danger);
  background: #fff;
}

.pos-checkout-summary {
  margin-top: 16px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.pos-checkout-summary span,
.pos-checkout-summary strong {
  display: block;
}

.pos-checkout-summary strong {
  margin-top: 2px;
  font-size: 1.7rem;
}

.pos-checkout-button {
  min-width: 190px;
}

.pos-alert {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.pos-alert--error {
  border: 1px solid #e0a9a9;
  background: #fff1f1;
  color: #7d2020;
}

.pos-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.pos-checkout-items,
.pos-payment-form {
  padding: 18px;
}

.pos-checkout-item,
.pos-checkout-subtotal,
.pos-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #eceff2;
}

.pos-checkout-subtotal {
  border-bottom: 0;
  margin-top: 6px;
  font-size: 1.15rem;
}

.pos-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}

.pos-fieldset legend {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.pos-fieldset legend small {
  color: var(--pos-muted);
  font-weight: 500;
}

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

.pos-payment-option {
  min-height: 58px;
  border: 1px solid #aeb6c0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.pos-payment-option:has(input:checked) {
  border-color: #1b1e22;
  background: #1b1e22;
  color: #fff;
}

.pos-payment-option input {
  width: 20px;
  height: 20px;
}

.pos-form-group {
  margin-bottom: 14px;
}

.pos-money-input,
.pos-payment-form input[type="text"],
.pos-payment-form input[type="tel"],
.pos-payment-form textarea {
  width: 100%;
  box-sizing: border-box;
}

.pos-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pos-complete-sale-button {
  width: 100%;
  min-height: 60px;
  font-size: 1.1rem;
  font-weight: 800;
}

.pos-form-help {
  text-align: center;
  color: var(--pos-muted);
  font-size: .85rem;
}

.pos-complete-card,
.pos-detail-summary,
.pos-login-card {
  padding: clamp(22px, 4vw, 36px);
}

.pos-complete-card {
  max-width: 760px;
  margin: 0 auto;
}

.pos-complete-number {
  padding: 10px 12px;
  background: var(--pos-soft);
  border-radius: 12px;
}

.pos-receipt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.pos-receipt-grid > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--pos-soft);
}

.pos-receipt-grid dt {
  color: var(--pos-muted);
  font-size: .82rem;
}

.pos-receipt-grid dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.pos-receipt-total {
  background: #1b1e22 !important;
  color: #fff;
}

.pos-receipt-total dt {
  color: #d5dae0;
}

.pos-complete-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pos-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.pos-detail-row {
  border: 1px solid var(--pos-border);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 9px;
}

.pos-login-wrap {
  display: flex;
  justify-content: center;
}

.pos-login-card {
  width: min(520px, 100%);
}

.pos-login-form p {
  display: grid;
  gap: 6px;
}

.pos-login-form input {
  width: 100%;
  box-sizing: border-box;
}

.primary-nav .pos-nav-link {
  padding-inline: 12px;
}

.primary-nav .pos-nav-link--primary {
  font-weight: 800;
}

.primary-nav .pos-nav-link--active {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.pos-nav-logout {
  display: inline-flex;
  margin: 0;
}

.pos-nav-logout button {
  font: inherit;
  cursor: pointer;
}

@media (max-width: 900px) {
  .pos-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 640px) {
  .pos-shell .container {
    width: min(100% - 18px, 1180px);
  }

  .pos-hero,
  .pos-section-heading,
  .pos-checkout-summary,
  .pos-cart-row {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-hero,
  .pos-section-heading,
  .pos-checkout-summary {
    display: flex;
  }

  .pos-metric-grid,
  .pos-action-grid,
  .pos-two-column,
  .pos-receipt-grid {
    grid-template-columns: 1fr;
  }

  .pos-action-card {
    min-height: 112px;
  }

  .pos-variant-row,
  .pos-cart-row {
    grid-template-columns: 1fr;
  }

  .pos-add-form,
  .pos-search-row,
  .pos-inline-control {
    flex-direction: column;
  }

  .pos-number-input,
  .pos-hero-action,
  .pos-checkout-button {
    width: 100%;
    box-sizing: border-box;
  }

  .pos-cart-actions {
    min-width: 0;
  }

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

  .pos-sale-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
