* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  color: #000;
  background: #ffffff;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 42px;
}

.app-window {
  position: relative;
  width: 430px;
  height: 490px;
  padding-top: 70px;
  overflow: hidden;
  border: 1px solid #b9b9b9;
  background: #efefef;
  box-shadow: inset 0 0 0 1px #eeeeee;
}

.app-window::before,
.app-window::after {
  content: none;
}

h1 {
  position: absolute;
  top: 84px;
  left: 140px;
  width: 210px;
  margin: 0;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  text-align: left;
  color: #c33422;
  text-decoration: underline;
  text-shadow: 1px 1px 0 #fff;
}

.purchase-form {
  position: absolute;
  top: 116px;
  left: 10px;
  display: grid;
  grid-template-columns: 66px 95px 56px 55px 84px;
  grid-template-rows: 30px 24px;
  align-items: center;
  column-gap: 3px;
  row-gap: 3px;
}

.purchase-form label {
  font-size: 12px;
}

#productSelect {
  width: 95px;
  height: 27px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
}

.quantity-label {
  text-align: right;
}

#quantityInput {
  width: 55px;
  height: 28px;
  padding: 2px 3px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  font-size: 12px;
}

.blue-button {
  border: 1px solid #2d5e8f;
  border-radius: 1px;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  font-family: Arial, Helvetica, sans-serif;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
  cursor: pointer;
  background: linear-gradient(#65a6e8, #1f65a7 52%, #154c82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    2px 2px 3px rgba(0,0,0,0.35);
}

.blue-button:hover {
  background: linear-gradient(#77b3ef, #2a73b9 52%, #195991);
}

.blue-button:active {
  transform: translate(1px, 1px);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.35);
}

.buy-button {
  grid-column: 5;
  grid-row: 1;
  width: 84px;
  height: 32px;
}

.invoice-check {
  grid-column: 1 / span 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 24px;
}

.invoice-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #ffffff;
}

.table-area {
  position: absolute;
  top: 168px;
  left: 10px;
  width: 395px;
}

.cart-table {
  width: 395px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.cart-table th,
.cart-table td {
  border: 1px solid #222;
  height: 28px;
  padding: 2px 4px;
  vertical-align: middle;
  color: #000;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cart-table th {
  height: 28px;
  background: #ffffff;
  text-align: center;
}

.cart-table tbody tr:nth-child(n+1) td {
  height: 30px;
}

.cart-table th:nth-child(1),
.cart-table td:nth-child(1) { width: 80px; }
.cart-table th:nth-child(2),
.cart-table td:nth-child(2) { width: 72px; text-align: center; }
.cart-table th:nth-child(3),
.cart-table td:nth-child(3) { width: 88px; text-align: center; }
.cart-table th:nth-child(4),
.cart-table td:nth-child(4) { width: 82px; text-align: center; }
.cart-table th:nth-child(5),
.cart-table td:nth-child(5) { width: 72px; text-align: center; }

.cart-table tbody {
  height: 180px;
}

.empty-cell {
  color: transparent;
}

.print-button {
  position: absolute;
  left: 10px;
  top: 410px;
  width: 83px;
  height: 31px;
  line-height: 12px;
}

.totals-panel {
  position: absolute;
  top: 382px;
  right: 22px;
  display: grid;
  grid-template-columns: 56px 75px;
  grid-template-rows: repeat(3, 30px);
  align-items: stretch;
}

.total-row {
  display: contents;
}

.total-row span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 30px;
  padding-left: 4px;
  font-size: 12px;
}

.total-row output {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 30px;
  padding: 2px 5px;
  border: 1px solid #222;
  border-bottom: none;
  background: #fff;
  font-size: 12px;
}

.total-row:last-child output {
  border-bottom: 1px solid #222;
}

@media (max-width: 500px) {
  .page {
    padding: 10px;
    align-items: flex-start;
  }

  .app-window {
    transform-origin: top center;
    transform: scale(calc((100vw - 20px) / 430));
  }
}
.cart-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
}