:root {
  color-scheme: dark;
  --bg: #070b12;
  --bg-soft: #0b111c;
  --panel: #111827;
  --panel-2: #151f2e;
  --text: #eef4ff;
  --muted: #93a4ba;
  --line: #263449;
  --brand: #22c55e;
  --brand-dark: #16a34a;
  --accent: #38bdf8;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --soft: #10251b;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 34rem),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans Thai", sans-serif;
  font-size: 15px;
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

a:hover {
  color: #bae6fd;
}

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0a0f18 0%, #101827 100%);
  border-right: 1px solid var(--line);
  color: var(--text);
  padding: 22px 14px;
}

.brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 24px;
  padding: 0 10px;
}

.nav a {
  display: block;
  color: #b9c7d9;
  padding: 11px 12px;
  border-radius: 8px;
  margin-bottom: 5px;
  border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
  background: #172235;
  border-color: #2b3b53;
  color: #ffffff;
}

.nav a.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.main {
  min-width: 0;
  padding: 26px;
}

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

h1 {
  font-size: 28px;
  margin: 0;
}

h2 {
  font-size: 18px;
  margin: 0 0 15px;
}

.panel {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(13, 20, 32, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.metric {
  background: linear-gradient(180deg, #121c2b, #0f1724);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.metric .label {
  color: var(--muted);
  font-size: 13px;
}

.metric .value {
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
  color: #ffffff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.product-thumb {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e5edf7;
}

.product-thumb.large {
  width: 120px;
  height: 120px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  background: #172235;
  z-index: 1;
}

tbody tr:hover td {
  background: rgba(56, 189, 248, 0.055);
}

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

button,
.button {
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #03120a;
  border-radius: 8px;
  padding: 9px 13px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
.button:hover {
  filter: brightness(1.08);
  color: #03120a;
}

.button.secondary,
button.secondary {
  background: #1d293a;
  border-color: #33445d;
  color: #dbeafe;
}

.button.danger,
button.danger {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #30415a;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  background: #0c1320;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

textarea {
  min-height: 78px;
}

label {
  display: block;
  color: #a9b8cc;
  font-size: 13px;
  margin-bottom: 6px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  color: var(--text);
}

.checkline input {
  width: auto;
  accent-color: var(--accent);
}

button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.3);
}

.notice {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  font-weight: 650;
}

.notice.ok {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.28);
  color: #196b31;
}

.notice.warn {
  background: rgba(255, 159, 10, 0.14);
  border-color: rgba(255, 159, 10, 0.3);
  color: #8a4f00;
}

.tag.info {
  background: rgba(0, 113, 227, 0.12);
  color: #0057b8;
}

.tag.danger {
  background: rgba(255, 59, 48, 0.12);
  color: #b42318;
}

.serial-label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.serial-label {
  display: grid;
  align-content: center;
  justify-items: stretch;
  min-height: 82px;
  border: 1px dashed rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 10px;
  page-break-inside: avoid;
}

.serial-label strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0;
}

.serial-barcode {
  display: block;
  width: 100%;
  height: 34px;
  margin: 5px 0 3px;
}

.serial-label span,
.serial-label small {
  overflow-wrap: anywhere;
}

.serial-label span {
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.serial-label small {
  margin-top: 2px;
  color: #4b5563;
  text-align: center;
}

.label-designer {
  position: sticky;
  top: 12px;
  z-index: 4;
}

.label-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.label-controls > div,
.label-controls input,
.label-controls select {
  min-width: 0;
  width: 100%;
}

.label-options,
.label-selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.stock-browser {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.stock-filter-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding-right: 14px;
}

.stock-filter-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 16px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock-filter-heading:first-child {
  margin-top: 0;
}

.stock-filter-heading a {
  color: var(--brand);
  font-weight: 700;
}

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

.stock-filter-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
}

.stock-filter-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stock-filter-link strong {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  text-align: center;
  font-size: 11px;
}

.stock-filter-link:hover,
.stock-filter-link.active {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: var(--brand);
}

.stock-results {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.stock-results table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.stock-search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.stock-filter-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.serial-label.print-excluded {
  display: none !important;
}

body.label-printing .label-product-name.label-hidden,
body.label-printing .label-product-sku.label-hidden,
body.label-printing .label-serial-code.label-hidden {
  display: none !important;
}

@media print {
  body.label-printing .main > .panel:not(.label-print-panel) {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .sidebar,
  .topbar,
  .no-print,
  .actions,
  nav {
    display: none !important;
  }

  .app {
    display: block;
  }

  .main {
    padding: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  .serial-label-grid {
    grid-template-columns: repeat(var(--label-columns, 1), var(--label-width, 60mm));
    gap: var(--label-gap, 0mm);
  }

  .serial-label {
    box-sizing: border-box;
    width: var(--label-width, 60mm);
    height: var(--label-height, 40mm);
    min-height: 0;
    overflow: hidden;
    padding: var(--label-padding, 2mm);
    border: 0;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .serial-barcode {
    height: min(13mm, calc(var(--label-height, 40mm) * 0.38));
  }

  body.label-printing .serial-label-grid {
    width: calc(var(--label-columns, 1) * var(--label-width, 60mm) + (var(--label-columns, 1) - 1) * var(--label-gap, 0mm));
  }
}

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

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

  .stock-filter-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px;
  }
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-4 {
  grid-column: span 4;
}

.bulk-rows {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bulk-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1422;
}

.bulk-row .span-2 {
  grid-column: span 1;
}

.pos-form {
  display: grid;
  gap: 14px;
}

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

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

.pos-left {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pos-right {
  position: sticky;
  top: 20px;
}

.pos-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: #0c1422;
}

.pos-actions > div {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.pos-actions > div strong {
  font-size: 18px;
}

.select-product-button {
  min-height: 50px;
  min-width: 168px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 17px;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.22);
}

.select-product-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(3, 18, 10, 0.25);
  color: #03120a;
  font-size: 22px;
  line-height: 1;
}

.cart-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1422;
  overflow: hidden;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #142033;
  border-bottom: 1px solid var(--line);
}

.cart-lines {
  display: grid;
}

.cart-empty {
  padding: 18px;
  color: var(--muted);
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 102px 68px 220px 112px auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

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

.cart-product {
  display: grid;
  gap: 4px;
}

.cart-product span,
.cart-price {
  color: var(--muted);
  font-size: 13px;
}

.cart-qty {
  text-align: center;
}

.line-discount {
  display: grid;
  grid-template-columns: 66px 66px minmax(72px, 1fr);
  gap: 6px;
  align-items: center;
}

.line-discount select,
.line-discount input {
  min-height: 34px;
  padding: 6px 7px;
  font-size: 13px;
}

.line-discount span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cart-line-total {
  text-align: right;
}

.pos-total {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.pos-settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

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

.customer-summary span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.pos-total > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1422;
}

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

.pos-total strong {
  font-size: 20px;
}

.pos-total .grand {
  border-color: rgba(34, 197, 94, 0.45);
  background: #0f2a1c;
}

.pos-total .grand strong {
  color: #86efac;
  font-size: 26px;
}

.pos-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #101827, #0c1422);
  box-shadow: var(--shadow);
}

.pos-summary h2 {
  margin-bottom: 0;
}

.checkout-button {
  min-height: 58px;
  font-size: 17px;
  width: 100%;
}

.customer-modal-window {
  width: min(980px, 100%);
}

.customer-modal-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
}

.customer-search-panel,
.customer-form-panel {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.customer-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.customer-item {
  display: grid;
  gap: 4px;
  text-align: left;
  background: #0c1422;
  color: var(--text);
  border-color: var(--line);
}

.customer-item:hover {
  background: #122033;
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.5);
}

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

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

.customer-form-panel .span-2,
.customer-form-panel button {
  grid-column: span 2;
}

.checkout-modal-window {
  width: min(560px, 100%);
}

.sale-complete-window {
  width: min(440px, 100%);
}

.checkout-panel {
  display: grid;
  gap: 12px;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1422;
}

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

.checkout-total strong {
  font-size: 24px;
  color: #86efac;
}

.payment-info {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  background: #0c1422;
  color: var(--muted);
}

.payment-info strong {
  color: var(--text);
}

.selected-product {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid #30415a;
  border-radius: 8px;
  background: #0c1320;
}

.selected-product strong,
.selected-product span {
  display: block;
}

.selected-product span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.76);
  backdrop-filter: blur(8px);
}

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

.modal-window {
  width: min(940px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #33445d;
  border-radius: 8px;
  background: linear-gradient(180deg, #111827, #0b111c);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.modal-head p {
  margin: 4px 0 0;
}

.stock-adjust-modal {
  width: min(620px, calc(100vw - 36px));
}

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

.stock-adjust-summary > div {
  padding: 12px;
  border: 1px solid #d8e2ed;
  border-radius: 10px;
  background: #f8fbff;
}

.stock-adjust-summary span,
.stock-adjust-summary strong {
  display: block;
}

.stock-adjust-summary span {
  color: #64748b;
  font-size: 13px;
}

.stock-adjust-summary strong {
  margin-top: 3px;
  font-size: 20px;
}

.stock-adjust-form {
  overflow: auto;
  padding: 2px;
}

.picker-list {
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.picker-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border-color: #263449;
  background: #0c1422;
  color: var(--text);
}

.picker-item:hover {
  background: #122033;
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--text);
}

.picker-item:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.4);
}

.picker-main,
.picker-side {
  display: grid;
  gap: 4px;
}

.picker-main span,
.picker-side span {
  color: var(--muted);
  font-size: 13px;
}

.picker-side {
  justify-items: end;
}

.product-thumb-placeholder {
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 11px;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #11283b;
  color: #7dd3fc;
}

.tag.warn {
  background: #302211;
  color: #fbbf24;
}

.tag.ok {
  background: #0f2a1c;
  color: #86efac;
}

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

.login {
  max-width: 390px;
  margin: 10vh auto;
}

.login .panel {
  padding: 26px;
}

.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .main {
    padding: 16px;
  }

  .grid.cols-4,
  .grid.cols-2,
  .form-grid,
  .pos-top,
  .pos-layout,
  .customer-modal-grid,
  .customer-form-panel,
  .bulk-row,
  .cart-line,
  .pos-total {
    grid-template-columns: 1fr;
  }

  .pos-right {
    position: static;
  }

  .form-grid .span-2,
  .form-grid .span-4,
  .bulk-row .span-2 {
    grid-column: span 1;
  }

  .pos-actions {
    align-items: stretch;
  }

  .pos-actions > div,
  .select-product-button {
    width: 100%;
    min-width: 0;
  }

  .customer-form-panel .span-2,
  .customer-form-panel button {
    grid-column: span 1;
  }

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

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

  .line-discount span {
    grid-column: span 2;
  }

  .cart-line-total {
    text-align: left;
  }

  .selected-product,
  .modal-head,
  .picker-item {
    grid-template-columns: 1fr;
  }

  .selected-product,
  .modal-head {
    align-items: stretch;
  }

  .picker-side {
    justify-items: start;
  }
}

/* Apple-inspired light workspace theme */
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-soft: #fbfbfd;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --brand: #0071e3;
  --brand-dark: #0066cc;
  --accent: #0071e3;
  --danger: #d70015;
  --warn: #b54708;
  --ok: #248a3d;
  --soft: #f0f7ff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.055);
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-dark);
}

.app {
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid rgba(0, 0, 0, 0.09);
  color: var(--text);
  padding: 24px 14px;
  backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  position: relative;
  font-size: 19px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 22px;
  padding: 2px 12px 13px 38px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.brand::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 1px;
  width: 18px;
  height: 22px;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(145deg, #1d1d1f, #555559);
}

.brand::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
}

.nav {
  display: grid;
  gap: 3px;
}

.nav a {
  position: relative;
  color: #424245;
  padding: 10px 12px 10px 30px;
  border-radius: 8px;
  margin: 0;
  border: 0;
  font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav a::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aeaeb2;
  transform: translateY(-50%);
}

.nav a:hover {
  background: #f0f0f2;
  color: #000000;
}

.nav a.active {
  background: #e8f2ff;
  color: #0066cc;
  box-shadow: none;
  font-weight: 650;
}

.nav a.active::before {
  background: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.main {
  padding: 28px clamp(18px, 3vw, 42px) 44px;
}

.topbar {
  min-height: 50px;
  margin-bottom: 24px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

h1 {
  color: #1d1d1f;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
}

h2 {
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 650;
}

.panel,
.metric {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 19px 18px 18px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #0071e3;
}

.metric:nth-child(4n + 2)::before { background: #248a3d; }
.metric:nth-child(4n + 3)::before { background: #bf5af2; }
.metric:nth-child(4n + 4)::before { background: #ff9f0a; }

.metric .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric .value {
  color: #1d1d1f;
  font-size: 28px;
  font-weight: 700;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom-color: #e5e5e7;
  padding: 11px 9px;
}

th {
  color: #6e6e73;
  background: #f5f5f7;
  font-size: 12px;
  font-weight: 650;
}

tbody tr:hover td {
  background: #f7fbff;
}

.product-thumb {
  border-color: #dedee2;
  background: #f5f5f7;
}

button,
.button {
  border-color: #0071e3;
  background: #0071e3;
  color: #ffffff;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
}

button:hover,
.button:hover {
  filter: none;
  background: #0077ed;
  border-color: #0077ed;
  color: #ffffff;
}

button:active,
.button:active {
  transform: scale(0.985);
}

.button.secondary,
button.secondary {
  background: #ffffff;
  border-color: #c7c7cc;
  color: #1d1d1f;
}

.button.secondary:hover,
button.secondary:hover {
  background: #f5f5f7;
  border-color: #a9a9ae;
  color: #000000;
}

.button.danger,
button.danger {
  background: #ffffff;
  border-color: #d70015;
  color: #d70015;
}

.button.danger:hover,
button.danger:hover {
  background: #fff1f2;
  border-color: #d70015;
  color: #b00012;
}

.test-reset-panel {
  border: 1px solid #f0b4bc;
  background: #fffafb;
}

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

.test-reset-summary > div {
  padding: 14px;
  border: 1px solid #ececf0;
  border-radius: 12px;
  background: #fff;
}

.test-reset-summary span,
.test-reset-summary strong {
  display: block;
}

.test-reset-summary span {
  color: #6e6e73;
  font-size: 0.86rem;
}

.test-reset-summary strong {
  margin-top: 3px;
  font-size: 1.45rem;
}

.test-reset-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.test-reset-form .checkline {
  flex-basis: 100%;
}

.test-reset-form input[name="confirmation"] {
  width: 160px;
}

.pos-loading[hidden] {
  display: none;
}

.pos-loading {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(2px);
  color: #1d1d1f;
}

.pos-loading strong {
  font-size: 1.08rem;
}

.pos-loading span:last-child {
  color: #6e6e73;
  font-size: 0.9rem;
}

.pos-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #dbeafe;
  border-top-color: #0071e3;
  border-radius: 50%;
  animation: pos-spin 0.75s linear infinite;
}

@keyframes pos-spin {
  to { transform: rotate(360deg); }
}

input,
select,
textarea {
  border-color: #c7c7cc;
  background: #ffffff;
  color: #1d1d1f;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #a1a1a6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

label {
  color: #515154;
  font-weight: 550;
}

.checkline {
  color: var(--text);
}

.checkline input {
  accent-color: #0071e3;
}

.bulk-row,
.pos-actions,
.cart-box,
.customer-summary,
.pos-total > div,
.payment-info,
.selected-product,
.customer-item,
.picker-item {
  background: #fbfbfd;
  border-color: #dedee2;
}

.pos-actions {
  border-color: #cfe5ff;
}

.cart-head {
  background: #f5f5f7;
  border-bottom-color: #dedee2;
}

.cart-line {
  border-bottom-color: #e5e5e7;
}

.select-product-button {
  box-shadow: 0 5px 16px rgba(0, 113, 227, 0.18);
}

.select-product-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.pos-summary {
  background: #ffffff;
  border-color: #d2d2d7;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.pos-total .grand {
  border-color: #b8ddc1;
  background: #f2fbf4;
}

.pos-total .grand strong,
.checkout-total strong {
  color: #1f7a36;
}

.checkout-total {
  border-color: #dedee2;
  background: #fbfbfd;
}

.customer-item:hover,
.picker-item:hover {
  background: #f0f7ff;
  border-color: #80bfff;
  color: var(--text);
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: saturate(150%) blur(12px);
}

.modal-window {
  border-color: rgba(0, 0, 0, 0.12);
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.tag {
  background: #e8f2ff;
  color: #0066cc;
}

.tag.warn {
  background: #fff5e6;
  color: #9a4d00;
}

.tag.ok {
  background: #eaf8ed;
  color: #1f7a36;
}

.product-thumb-placeholder {
  color: #86868b;
}

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

.error {
  color: #b00012;
  background: #fff1f2;
  border-color: #ffc2c8;
}

.login {
  max-width: 410px;
}

.login .panel {
  padding: 30px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1200px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .brand {
    margin-bottom: 10px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .nav a::before {
    display: none;
  }

  .main {
    min-width: 0;
    padding: 18px 14px 36px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .grid.cols-4,
  .grid.cols-2,
  .form-grid,
  .pos-top,
  .pos-layout,
  .customer-modal-grid,
  .customer-form-panel,
  .bulk-row,
  .cart-line,
  .pos-total {
    grid-template-columns: minmax(0, 1fr);
  }

  .pos-right {
    position: static;
    min-width: 0;
  }

  .form-grid .span-2,
  .form-grid .span-4,
  .bulk-row .span-2,
  .customer-form-panel .span-2,
  .customer-form-panel button {
    grid-column: span 1;
  }

  .pos-actions {
    align-items: stretch;
  }

  .pos-actions > div,
  .select-product-button {
    width: 100%;
    min-width: 0;
  }

  .customer-summary,
  .picker-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .picker-side {
    justify-items: start;
  }

  .cart-box,
  .panel {
    min-width: 0;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  h1 {
    font-size: 25px;
  }

  .panel {
    padding: 15px;
  }
}

/* Workflow navigation and focused stock workspace */
.sidebar-head {
  display: block;
}

.mobile-menu-button {
  display: none;
}

.nav-group {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.nav-group-label {
  padding: 0 12px 4px;
  color: #86868b;
  font-size: 11px;
  font-weight: 650;
}

.stock-search-primary {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #dedee2;
  border-radius: 8px;
  background: #f8f8fa;
}

.stock-filter-drawer {
  min-width: 0;
}

.stock-filter-drawer > summary {
  display: none;
}

.stock-filter-drawer:not([open]) > .stock-filter-panel {
  display: block;
}

.stock-mobile-list {
  display: none;
}

.stock-mobile-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dedee2;
  border-radius: 8px;
  background: #ffffff;
}

.stock-mobile-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.stock-mobile-card-head > div {
  min-width: 0;
}

.stock-mobile-card-head strong,
.stock-mobile-card-head span {
  display: block;
}

.stock-mobile-card-head > div > strong {
  font-size: 16px;
}

.stock-mobile-card-head > div > span,
.stock-mobile-detail {
  color: var(--muted);
  font-size: 12px;
}

.stock-mobile-detail {
  margin-top: 7px;
}

.stock-mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stock-mobile-metrics > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f5f5f7;
}

.stock-mobile-metrics span,
.stock-mobile-metrics strong {
  display: block;
}

.stock-mobile-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.stock-mobile-metrics strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.stock-mobile-action {
  display: block;
  margin-top: 10px;
  text-align: center;
}

@media (max-width: 900px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar {
    padding: 9px 12px;
  }

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

  .brand {
    margin: 0;
    padding-top: 7px;
    padding-bottom: 7px;
    border-bottom: 0;
    font-size: 18px;
  }

  .brand::before {
    top: 6px;
  }

  .brand::after {
    top: 12px;
  }

  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 23px;
    line-height: 1;
  }

  .nav {
    display: none;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    padding: 10px 0 4px;
    border-top: 1px solid #e5e5e7;
  }

  .nav.mobile-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .nav-group {
    margin: 0;
  }

  .nav-group-label {
    padding-left: 8px;
  }

  .nav a {
    width: 100%;
    padding: 9px 10px;
  }

  .main {
    padding-top: 14px;
  }

  .topbar {
    min-height: 0;
    margin-bottom: 14px;
    padding-bottom: 12px;
    align-items: center;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar .muted {
    display: none;
  }

  .topbar .button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .stock-workspace {
    padding: 14px;
  }

  .stock-intro {
    align-items: center;
  }

  .stock-intro p {
    display: none;
  }

  .stock-intro h2 {
    margin: 0;
    font-size: 17px;
  }

  .stock-intro .button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .stock-search-primary {
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin-top: 12px;
    padding: 10px;
  }

  .stock-search-primary input,
  .stock-search-primary button,
  .stock-search-primary .button {
    min-height: 42px;
  }

  .stock-search-primary button,
  .stock-search-primary .button {
    align-self: end;
    padding: 9px 10px;
  }

  .stock-browser {
    gap: 12px;
    margin-top: 12px;
  }

  .stock-filter-drawer > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-weight: 650;
    list-style: none;
  }

  .stock-filter-drawer > summary::-webkit-details-marker {
    display: none;
  }

  .stock-filter-drawer > summary::after {
    content: "+";
    margin-left: auto;
    padding-left: 10px;
    color: var(--brand);
    font-size: 20px;
    line-height: 1;
  }

  .stock-filter-drawer[open] > summary::after {
    content: "−";
  }

  .stock-filter-drawer > summary strong {
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e8f2ff;
    color: #0066cc;
    font-size: 11px;
  }

  .stock-filter-drawer:not([open]) > .stock-filter-panel {
    display: none;
  }

  .stock-filter-panel {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    background: #fbfbfd;
  }

  .stock-filter-heading {
    margin-top: 12px;
  }

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

  .stock-model-list {
    max-height: 190px;
    overflow-y: auto;
    padding-right: 3px;
  }

  .stock-filter-link {
    min-height: 42px;
    padding: 8px;
  }

  .stock-filter-summary {
    margin: 0 0 10px;
  }

  .stock-desktop-table {
    display: none;
  }

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

@media (max-width: 430px) {
  .stock-search-primary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .stock-search-primary .button {
    grid-column: 1 / -1;
    text-align: center;
  }
}

.shipping-workflow { display: grid; gap: 18px; }
.shipping-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.shipping-step { padding: 8px 10px; border-radius: 999px; background: #f1f1f3; opacity: .65; }
.shipping-step.active { background: #dff4e8; opacity: 1; box-shadow: inset 0 0 0 1px #62a77d; }
.shipping-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; border: 1px solid #d2d2d7; border-radius: 10px; }
.shipping-history { border-top: 1px solid #e5e5e7; padding-top: 12px; }
.shipping-history p { display: flex; gap: 10px; align-items: center; }
.order-item-editor { display: grid; gap: 10px; margin: 16px 0; }
.order-item-edit-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px auto auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid #e5e5e7; border-radius: 10px; }
.order-item-edit-row input { min-width: 0; }
@media (max-width: 760px) { .order-item-edit-row { grid-template-columns: 1fr 1fr; } .order-item-edit-row strong { grid-column: 1 / -1; } }
.order-cart-box { margin-top: 16px; }
.order-cart-line { grid-template-columns: minmax(220px, 1fr) 110px 90px 110px auto auto; }
.order-line-summary { display: grid; gap: 3px; }
.order-add-bar { margin-top: 14px; padding: 14px; border: 1px solid #b9d8c5; border-radius: 10px; background: #f4fbf7; display: grid; grid-template-columns: minmax(240px, 1fr) 120px auto auto; gap: 12px; align-items: end; }
.order-add-bar[hidden] { display: none; }
@media (max-width: 850px) { .order-cart-line, .order-add-bar { grid-template-columns: 1fr 1fr; } .order-cart-line .cart-product, .order-add-bar > div { grid-column: 1 / -1; } }
.invoice-resend-alert { border: 2px solid #e6a700; background: #fff9e8; }
.invoice-resend-alert h2 { margin: 8px 0; }
.invoice-resend-alert p { margin: 6px 0; }
.invoice-action-steps { gap: 10px; align-items: center; }
.invoice-step-print,
.invoice-step-send,
.invoice-step-complete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 14px;
  color: #1e293b;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.invoice-step-print { background: #fff; }
.invoice-step-print:hover { background: #f1f5f9; border-color: #94a3b8; }
.invoice-step-send { background: #1677e8; border-color: #1268c9; color: #fff; }
.invoice-step-send:hover { background: #1268c9; }
.invoice-step-complete { background: #e8f1ff; border-color: #a8c8f5; color: #0b5cab; }
.invoice-step-complete:hover { background: #dbeafe; border-color: #7fb3ef; }
.invoice-sent-ok { border-color: #9bc8aa; background: #f3fbf5; }
.kex-processing-note { margin: 12px 0; padding: 11px 13px; border: 1px solid #f0bd54; border-radius: 9px; background: #fff8df; color: #805300; }
.kex-export-modal { width: min(620px, calc(100vw - 36px)); padding: 24px; }
.kex-export-modal h2 { margin: 8px 0; }
.kex-export-modal p { margin: 7px 0; line-height: 1.6; }
.kex-export-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; margin: 16px 0; }
.kex-export-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid #d8e2ed; border-radius: 9px; cursor: pointer; background: #fff; }
.kex-export-item:hover { background: #f7fbff; border-color: #a9c8ec; }
.kex-export-item input { width: auto; margin: 0; }
.kex-export-item span { display: grid; gap: 2px; }
.kex-export-item small { color: #64748b; }
.mobile-label { display: none; }
.facebook-contact-card {
  padding: 0;
  overflow: hidden;
  border-color: #cfe0f5;
}
.facebook-contact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid #dce8f5;
  background: linear-gradient(135deg, #f7fbff 0%, #eef6ff 100%);
}
.facebook-contact-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.facebook-contact-head h2 {
  margin: 0;
  font-size: 19px;
}
.facebook-contact-eyebrow {
  color: #0066cc;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
}
.facebook-chat-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 18px;
  white-space: nowrap;
}
.facebook-contact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 18px 22px 22px;
}
.facebook-contact-form > div:first-child {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.facebook-contact-form input {
  width: 100%;
  min-height: 42px;
}
.facebook-contact-form button {
  min-height: 42px;
  white-space: nowrap;
}
.chat-url-details {
  border: 1px solid #d8e3ee;
  border-radius: 10px;
  background: #fafcff;
  padding: 11px 13px;
}
.chat-url-details summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.chat-url-details summary::-webkit-details-marker { display: none; }
.chat-url-details summary span { font-weight: 700; }
.chat-url-details summary strong { color: #2563a8; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-url-details input { margin-top: 12px; }
.chat-url-details .muted { display: block; margin-top: 6px; }
.shipping-raw-field { display: grid; gap: 7px; }
.shipping-raw-field textarea { min-height: 132px; }
.kex-address-preview {
  border: 1px solid #9bc8aa;
  border-radius: 10px;
  background: #f4fbf6;
  padding: 16px;
}
.kex-address-preview h3 { margin: 4px 0 12px; font-size: 16px; }
.kex-address-preview p { margin: -6px 0 14px; }
.kex-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kex-fields > div { display: grid; gap: 6px; }
.kex-fields .span-2 { grid-column: 1 / -1; }
.kex-address-preview dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.kex-address-preview dl > div { display: contents; }
.kex-address-preview dt { color: #5d6873; }
.kex-address-preview dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.facebook-contact-actions { display: flex; justify-content: flex-end; }
@media (max-width: 760px) {
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .facebook-contact-head {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }
  .facebook-chat-button,
  .facebook-contact-form button {
    width: 100%;
  }
  .invoice-action-steps,
  .invoice-action-steps form { width: 100%; }
  .invoice-action-steps .invoice-step-print,
  .invoice-action-steps .invoice-step-send,
  .invoice-action-steps .invoice-step-complete { width: 100%; }
  .facebook-contact-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 18px 18px;
  }
  .chat-url-details summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .kex-address-preview dl { grid-template-columns: 1fr; gap: 2px; }
  .kex-fields { grid-template-columns: 1fr; }
  .kex-fields .span-2 { grid-column: auto; }
  .kex-address-preview dt:not(:first-child) { margin-top: 8px; }
}
.packing-items { display: grid; gap: 10px; }
.packing-item { display: grid; grid-template-columns: minmax(220px,1fr) auto auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid #e5e5e7; border-radius: 10px; }
.packing-item > div { display: grid; gap: 3px; }
.packing-item.complete { border-color: #9bc8aa; background: #f3fbf5; }
@media (max-width: 700px) { .packing-item { grid-template-columns: 1fr auto; } .packing-item form { grid-column: 1 / -1; } }
