:root {
  --ink: #43133a;
  --muted: #76546f;
  --line: #dfd4c7;
  --panel: #ffffff;
  --wash: #fbf7ef;
  --mint: #f0e3ce;
  --mint-strong: #d4a44a;
  --sea: #43133a;
  --coral: #cf5a47;
  --gold: #c99a43;
  --danger: #b43728;
  --shadow: 0 16px 42px rgba(67, 19, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-header {
  height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: 92px;
}

.brand-logo {
  width: auto;
  height: 52px;
  display: block;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 750;
}

.top-nav a.active {
  background: var(--mint);
}

.nav-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #eef3ef;
  color: var(--ink);
  font-size: 22px;
}

.pos-shell {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 14px;
}

.workspace,
.cart-panel {
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.customer-strip,
.catalog-head,
.cart-title,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-strip {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

.secondary,
.ghost,
.primary {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.secondary {
  background: #edf4ee;
  color: var(--sea);
}

.compact {
  min-height: 38px;
  padding: 0 12px;
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.primary {
  background: var(--sea);
  color: #fff;
}

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

.collection-tile {
  height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.collection-tile strong {
  display: block;
  font-size: 14px;
}

.collection-tile span {
  color: var(--muted);
  font-size: 12px;
}

.collection-tile.active {
  border-color: var(--sea);
  background: var(--mint);
}

.payment-reference,
.customer-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.product-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  grid-auto-rows: minmax(118px, auto);
  gap: 10px;
  padding-right: 4px;
}

.product-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 10px;
}

.product-tile h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.product-tile .meta {
  color: var(--muted);
  font-size: 12px;
}

.variant-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px;
  border-radius: 8px;
  background: #f5f7f5;
}

.variant-row span {
  min-width: 0;
  font-size: 13px;
}

.variant-row strong {
  white-space: nowrap;
  font-size: 13px;
}

.cart-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto auto auto;
  gap: 12px;
  padding: 14px;
}

.cart-lines {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-line.modifier {
  margin-left: 11px;
  padding-left: 8px;
  border-left: 3px solid var(--gold);
  background: #f8f1e6;
}

.cart-line strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cart-line span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.qty-controls {
  display: grid;
  grid-template-columns: 26px 22px 26px;
  align-items: center;
  gap: 3px;
}

.qty-controls button {
  height: 26px;
  border-radius: 7px;
  background: #eef3ef;
  color: var(--ink);
  font-weight: 900;
  padding: 0;
}

.qty-controls output {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

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

.warning {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--danger);
  background: #fae8e5;
  font-size: 13px;
  font-weight: 750;
}

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

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

.totals strong {
  color: var(--ink);
}

.totals .grand {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.checkout {
  height: 52px;
  font-size: 17px;
}

.cart-actions {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

.cart-actions .checkout,
.cart-actions .save-cart {
  width: 100%;
}

.order-result {
  min-height: 20px;
  color: var(--sea);
  font-weight: 800;
  font-size: 13px;
}

.customer-dialog,
.checkout-dialog {
  width: min(860px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  border: 0;
  padding: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.customer-dialog::backdrop,
.checkout-dialog::backdrop {
  background: rgba(23, 33, 29, .38);
}

.customer-card,
.checkout-card,
.staff-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.customer-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 32px);
}

.checkout-dialog {
  width: min(520px, calc(100vw - 28px));
}

.checkout-card {
  gap: 12px;
}

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

.checkout-summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f1e6;
}

.checkout-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.checkout-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.checkout-confirm {
  height: 50px;
  font-size: 16px;
}

.customer-results {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.customer-result {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  align-content: center;
}

.customer-result strong {
  display: block;
}

.customer-result span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

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

.staff-dialog {
  width: min(740px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.staff-dialog::backdrop {
  background: rgba(23, 33, 29, .38);
}

.admin-login,
.staff-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.staff-form {
  grid-template-columns: 1.3fr .8fr .7fr auto;
}

.staff-form select,
.admin-login input,
.staff-form input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.staff-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

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

.staff-row strong {
  display: block;
}

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

.staff-row button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 10px;
  background: #eef3ef;
  color: var(--ink);
  font-weight: 800;
}

.staff-row button[data-staff-active="false"] {
  background: #fae8e5;
  color: var(--danger);
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 247, 243, .96);
}

.lock-screen.unlocked {
  display: none;
}

.lock-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.lock-panel h2 {
  font-size: 28px;
}

.pin-display {
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--sea);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .18em;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-pad button {
  height: 68px;
  border-radius: 8px;
  background: #eef3ef;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.pin-pad [data-pin-clear],
.pin-pad [data-pin-submit] {
  font-size: 15px;
  color: var(--sea);
}

.pin-pad [data-pin-submit] {
  background: var(--sea);
  color: #fff;
}

.lock-error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 800;
  text-align: center;
}

.app-header {
  background: var(--sea);
  border-bottom-color: rgba(251, 247, 239, .18);
  color: var(--wash);
}

.top-nav a {
  color: var(--wash);
}

.top-nav a.active {
  background: rgba(251, 247, 239, .14);
}

.nav-count {
  height: 18px;
  min-width: 18px;
  font-size: 10px;
}

.status-pill {
  border-color: rgba(251, 247, 239, .24);
  color: var(--wash);
}

.icon-button {
  background: rgba(251, 247, 239, .14);
  color: var(--wash);
}

.pos-shell {
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 8px;
  padding: 8px;
}

.workspace.workflow-stage {
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  padding: 8px;
  background: var(--sea);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.workflow-steps button {
  min-height: 36px;
  border-radius: 8px;
  background: rgba(251, 247, 239, .1);
  color: var(--wash);
  font-weight: 850;
}

.workflow-steps .done,
.workflow-steps .active {
  background: var(--gold);
  color: var(--ink);
}

.workspace-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 126px minmax(190px, .64fr) minmax(280px, 1fr);
  gap: 8px;
}

.catalog-head {
  display: flex;
  min-height: 30px;
}

.catalog-head h1 {
  color: var(--wash);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.collection-stack {
  grid-template-columns: 1fr;
  grid-auto-rows: 52px;
}

.collection-stack .collection-tile {
  height: auto;
  background: rgba(251, 247, 239, .08);
  color: var(--wash);
  border-color: rgba(251, 247, 239, .18);
}

.collection-stack .collection-tile span {
  color: currentColor;
  opacity: .68;
}

.collection-stack .collection-tile.active {
  border-color: var(--wash);
  background: var(--wash);
  color: var(--ink);
}

.treatment-list {
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(58px, auto);
  align-content: start;
  gap: 8px;
  padding-right: 2px;
}

.treatment-list .product-tile {
  border: 1px solid rgba(251, 247, 239, .18);
  background: rgba(251, 247, 239, .08);
  color: var(--wash);
  align-content: center;
  gap: 3px;
  padding: 10px;
}

.treatment-list .product-tile strong {
  font-size: 14px;
  line-height: 1.15;
}

.treatment-list .product-tile span {
  color: currentColor;
  opacity: .72;
  font-size: 12px;
}

.treatment-list .product-tile.active {
  background: var(--wash);
  color: var(--ink);
}

.treatment-detail {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--wash);
  border: 1px solid rgba(251, 247, 239, .18);
}

.detail-heading {
  display: grid;
  gap: 4px;
}

.detail-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  line-height: 1;
}

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

.detail-options,
.modifier-section,
.addon-grid,
.discount-list,
.detail-payment-grid {
  display: grid;
  gap: 8px;
}

.discount-option {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.discount-option.active {
  border-color: var(--gold);
  background: #f1e6d5;
}

.discount-option strong,
.discount-option em {
  display: block;
}

.discount-option em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.discount-option b {
  color: var(--gold);
  font-size: 13px;
}

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

.detail-payment-grid button {
  min-height: 58px;
  border-radius: 8px;
  background: #f1e6d5;
  color: var(--ink);
  font-weight: 900;
}

.detail-payment-grid button.active {
  background: var(--gold);
}

.detail-payment-grid + .payment-reference {
  margin-top: 8px;
}

.treatment-detail .variant-row {
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
}

.treatment-detail .variant-row.selected {
  background: #eee6d8;
  color: var(--muted);
}

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

.modifier-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.addon-button {
  min-height: 46px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1e6d5;
  color: var(--ink);
  text-align: left;
}

.addon-button.selected,
.addon-button:disabled {
  cursor: default;
  background: #e4dfd6;
  color: #958696;
  opacity: .72;
}

.addon-button span {
  font-size: 13px;
  font-weight: 850;
}

.addon-button strong {
  color: var(--gold);
  font-size: 12px;
}

.cart-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
  padding: 10px;
}

.cart-customer-button {
  min-width: 0;
  min-height: 46px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f1e6;
  color: var(--ink);
  text-align: left;
}

.cart-line.modifier {
  margin-left: 9px;
  padding-left: 7px;
}

.cart-line strong {
  font-size: 12px;
}

.qty-controls {
  grid-template-columns: 24px 20px 24px;
}

.qty-controls button {
  height: 24px;
}

.totals {
  gap: 5px;
  padding-top: 8px;
}

.totals div {
  font-size: 12px;
}

.totals strong {
  font-size: 12px;
  text-align: right;
}

.totals .grand {
  font-size: 17px;
}

.totals .grand strong {
  font-size: 17px;
}

.checkout {
  height: 46px;
}

.cart-actions {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px;
}

.cart-customer-button strong {
  display: block;
  min-width: 0;
  max-height: 34px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.customer-status {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

@media (max-width: 900px) {
  .pos-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cart-panel {
    min-height: 70vh;
  }

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

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

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

  .admin-login,
  .staff-form,
  .staff-row {
    grid-template-columns: 1fr;
  }
}
