* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  padding-bottom: 64px;
}

main {
  max-width: 700px;
  margin: auto;
  padding: 12px;
}

/* Phones keep the narrow column; big screens get room for wide tables. */
@media (min-width: 1000px) {
  main {
    max-width: 1200px;
  }
}

.btn {
  min-height: 48px;
  font-size: 18px;
  padding: 8px 16px;
}

.btn-submit {
  width: 100%;
  max-width: 420px;
  display: block;
}

.error {
  color: #b00020;
}

.muted {
  color: #666;
  font-size: 15px;
}

.btn-small {
  min-height: 32px;
  font-size: 14px;
  padding: 2px 10px;
}

.field {
  margin: 14px 0;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 6px;
}

.field input[type="radio"],
.field input[type="checkbox"] {
  display: inline-block;
  width: auto;
  min-height: auto;
}

table {
  border-collapse: collapse;
}

th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

td.num, th.num {
  text-align: right;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #f3f3f3;
  border-top: 1px solid #ccc;
  height: 56px;
}

.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  flex: 1;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

.progress-bar {
  background: #e0e0e0;
  border-radius: 6px;
  height: 14px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  background: #2e7d32;
  height: 100%;
}

.btn-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.btn-grid .btn {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: #2e7d32;
  border-radius: 8px;
  line-height: 48px;
}

.btn-grid .btn.done {
  background: #bbb;
  color: #555;
}

.flash {
  background: #e8f5e9;
  border: 1px solid #2e7d32;
  border-radius: 6px;
  padding: 8px;
}

/* Unmissable save-result banners: pinned to the top of the screen,
   tap anywhere on them to dismiss. */
.banner {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0 -12px 12px;
  padding: 16px 12px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
}

.banner-ok {
  background: #2e7d32;
  color: #fff;
}

.banner-bad {
  background: #b00020;
  color: #fff;
}

/* Saved, but probably not what you meant — louder than a note, not an error. */
.banner-warn {
  background: #fff3cd;
  color: #5a4500;
  border-bottom: 3px solid #e0a800;
}

.recent-list {
  list-style: none;
  padding: 0;
}

.recent-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

tr.low {
  background: #fff3cd;
}

.warnings {
  background: #fff3cd;
  border: 1px solid #e0a800;
  border-radius: 6px;
  padding: 8px 8px 8px 24px;
  margin: 8px 0;
}

.table-scroll {
  overflow-x: auto;
}

.warn {
  background: #fff3cd;
  border: 1px solid #e0a800;
  border-radius: 6px;
  padding: 8px;
}

td.wrap {
  white-space: normal;
}

.product-col {
  min-width: 110px;
  vertical-align: top;
}

.product-col-name {
  font-weight: 700;
}

.product-col-new {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.product-col-new label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}

.product-col-new input {
  width: 100%;
  min-height: 32px;
  font-size: 14px;
  padding: 2px 4px;
}

.login-form {
  max-width: 300px;
  margin: 32px auto 0;
}

.login-form .field input,
.login-form .btn-submit {
  max-width: 100%;
}

.order-grid th {
  font-weight: 700;
}

.order-grid th,
.order-grid td {
  padding: 4px 6px;
  font-size: 14px;
}

.order-grid th small {
  display: block;
  font-weight: 400;
}

.order-grid td.cell-complete {
  background: #e8f5e9;
  color: #1b5e20;
}

.qty-input.qty-over {
  border-color: #b00020;
  background: #fdecea;
}
