/* Tempo Orders — plain, clean, mobile-friendly. No external fonts. */
* { box-sizing: border-box; }
:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #d1d5db;
  --bg: #f9fafb;
  --card: #ffffff;
  --accent: #166534;
  --accent-dark: #14532d;
  --danger: #b91c1c;
  --warn-bg: #fef3c7;
  --warn-ink: #92400e;
  --ok-bg: #dcfce7;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
header {
  background: var(--accent);
  color: #fff;
  padding: 18px 16px;
}
header h1 { margin: 0; font-size: 1.5rem; }
header p { margin: 4px 0 0; opacity: .9; font-size: .95rem; }
main { max-width: 760px; margin: 0 auto; padding: 16px 12px 120px; }
footer {
  max-width: 760px; margin: 0 auto; padding: 0 12px 32px;
  color: var(--muted); font-size: .85rem; text-align: center;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
h2 { font-size: 1.15rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
select, input[type="email"], input[type="text"], input[type="number"], input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.notice {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: .95rem;
}
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.error { background: #fee2e2; color: var(--danger); }
.notice.ok { background: var(--ok-bg); color: var(--accent-dark); }
.hidden { display: none !important; }

/* Product list */
.category { margin-top: 20px; }
.category > h3 {
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid #e5e7eb;
}
.product:last-child { border-bottom: none; }
.product-info { flex: 1; min-width: 0; }
.product-name { font-weight: 600; font-size: .98rem; }
.product-meta { color: var(--muted); font-size: .85rem; }
.stepper { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.stepper button {
  width: 38px; height: 38px;
  font-size: 1.25rem; line-height: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px 0 0 8px;
}
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper button:active { background: #e5e7eb; }
.stepper input.qty {
  width: 52px; height: 38px;
  text-align: center;
  border: 1px solid var(--line);
  border-left: none; border-right: none;
  border-radius: 0;
  padding: 0 4px;
  font-size: 1rem;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input.qty::-webkit-outer-spin-button,
.stepper input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.line-total {
  min-width: 74px;
  text-align: right;
  font-weight: 600;
  font-size: .95rem;
}
.line-total.zero { color: var(--muted); font-weight: 400; }

/* Sticky totals bar */
.totals-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  z-index: 10;
}
.totals-inner {
  max-width: 760px; margin: 0 auto;
  padding: 10px 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
}
.totals-inner .row { font-size: .95rem; }
.totals-inner .row b { font-size: 1.05rem; }
.totals-inner .total-row { font-size: 1.1rem; }
#submit-order {
  margin-left: auto;
  padding: 12px 22px;
  font-size: 1.05rem;
}
button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 1rem;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { background: #f3f4f6; }
button.danger { background: var(--danger); }
button.small { padding: 6px 10px; font-size: .9rem; }
a.btn { display: inline-block; text-decoration: none; }

/* Confirmation / breakdown tables */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
tr.total-row td { font-weight: 700; border-top: 2px solid var(--ink); }
tr.mismatch td { background: #fee2e2; }
tr.mismatch td:first-child { border-left: 4px solid var(--danger); }
.flag { color: var(--danger); font-weight: 700; }
.ok-flag { color: var(--accent); font-weight: 700; }

/* Admin */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .95rem;
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab .status { font-size: .8rem; opacity: .8; }
.person { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.person h3 { margin-top: 0; }
.badge {
  display: inline-block; font-size: .8rem; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}
.badge.open { background: var(--ok-bg); color: var(--accent-dark); }
.badge.closed { background: #fee2e2; color: var(--danger); }
.badge.pending { background: var(--warn-bg); color: var(--warn-ink); }
.badge.sent { background: var(--ok-bg); color: var(--accent-dark); }
.badge.failed { background: #fee2e2; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-row > * { flex: 1; min-width: 120px; }
.inline-row button { flex: 0 0 auto; }
.price-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.price-row .nm { flex: 1; min-width: 0; }
.price-row input { width: 110px; flex-shrink: 0; }

/* Word form preview */
.word-form { border: 1px solid var(--ink); padding: 16px; background: #fff; }
.word-form h2 { text-align: center; font-size: 1.2rem; text-transform: uppercase; }
.word-form .word-meta { text-align: center; color: var(--muted); margin-bottom: 12px; }
.word-form h3 {
  background: #e5e7eb; padding: 6px 8px; margin: 16px -16px 0;
}
.word-form table td.your-order { text-align: center; font-weight: 700; width: 90px; }
.word-form table td.blank { color: #d1d5db; text-align: center; }

@media (max-width: 560px) {
  .line-total { display: none; }
  .product-name { font-size: .92rem; }
  #submit-order { width: 100%; margin-left: 0; }
}
