:root {
  color-scheme: light;
  --blue: #0d5599;
  --blue-dark: #083d71;
  --red: #ed1b2f;
  --ink: #172033;
  --muted: #607086;
  --line: #d9e1ea;
  --panel: #f6f8fb;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f9fbfd 0%, #eef3f8 100%);
  color: var(--ink);
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

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

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  color: var(--blue-dark);
}

p {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  font-size: 13px;
  color: var(--muted);
  background: var(--panel);
}

tbody tr:last-child td {
  border-bottom: 0;
}

input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
}

input:focus {
  outline: 2px solid rgba(13, 85, 153, .18);
  border-color: var(--blue);
}

.number-cell {
  width: 150px;
}

.qty-cell {
  width: 120px;
}

.action-cell {
  width: 72px;
  text-align: right;
}

.button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.primary {
  color: var(--white);
  background: var(--red);
}

.secondary {
  color: var(--white);
  background: var(--blue);
}

.ghost {
  width: 42px;
  padding: 0;
  color: var(--red);
  background: #fff1f3;
}

.summary,
.result {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

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

.summary > div,
.result > div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.summary span,
.result span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.summary strong,
.result strong {
  font-size: 24px;
  color: var(--blue-dark);
}

.summary .button {
  height: 82px;
  font-size: 18px;
}

.status {
  min-height: 22px;
  margin-top: 14px;
  font-weight: 700;
  color: var(--blue-dark);
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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