/* Benoli Orders — shared styles */
:root {
  --steel: #e4e8ec;
  --paper: #ffffff;
  --ink: #18202b;
  --ink-2: #4a5566;
  --line: #c9d0d8;
  --place: #2348c9;
  --place-dark: #1a379c;
  --receive: #12805c;
  --receive-dark: #0c5f44;
  --warn: #a8640f;
  --warn-bg: #fff3df;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --ok-bg: #e5f5ee;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font: 17px/1.45 var(--font);
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--place); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--ink); color: #fff;
}
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.topbar .sub { font-size: 14px; opacity: .75; }
.topbar a, .topbar button.link { color: #fff; }
.chip-btn {
  background: transparent; border: 1.5px solid rgba(255,255,255,.5); color: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ---------- layout ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 48px; }
.panel {
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 20px 18px; border: 1px solid var(--line);
}
.panel + .panel { margin-top: 14px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  background: none; border: 0; padding: 6px 0; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.screen-title { font-size: 30px; font-weight: 700; margin-bottom: 16px; }

/* ---------- home: two big actions ---------- */
.actions { display: grid; gap: 14px; margin-top: 6px; }
.action {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 128px;
  border: 0; border-radius: var(--radius-lg); padding: 22px; text-align: left; cursor: pointer;
  color: #fff;
}
.action svg { flex: none; width: 52px; height: 52px; }
.action strong { display: block; font: 700 30px/1.05 var(--font-head); }
.action span { display: block; font-size: 16px; opacity: .85; margin-top: 4px; }
.action.place { background: var(--place); }
.action.place:active { background: var(--place-dark); }
.action.receive { background: var(--receive); }
.action.receive:active { background: var(--receive-dark); }
.foot-link { display: block; text-align: center; margin-top: 28px; color: var(--ink-2); font-size: 15px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 400; color: var(--ink-2); }
.input, select.input {
  width: 100%; min-height: 54px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  font-size: 18px;
}
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2318202b' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px;
}
.input:focus { border-color: var(--place); outline: none; box-shadow: 0 0 0 3px rgba(35,72,201,.2); }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 18px; }
.money .input { padding-left: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 22px; border-radius: var(--radius-sm); border: 0;
  font: 700 19px/1 var(--font-head); letter-spacing: .01em; cursor: pointer; color: #fff; background: var(--ink);
}
.btn.block { width: 100%; }
.btn.place { background: var(--place); }
.btn.receive { background: var(--receive); }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 40px; font-size: 16px; padding: 0 14px; }

.msg { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-weight: 500; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--ok-bg); color: var(--receive-dark); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- delivery tickets (orders to receive) ---------- */
.tickets { display: grid; gap: 12px; margin-bottom: 8px; }
.ticket {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px 14px 22px;
}
/* perforated left edge, like a delivery ticket stub */
.ticket::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 0;
  border-left: 2px dashed var(--line);
}
.ticket .vendor { font: 700 22px/1.1 var(--font-head); }
.ticket .meta { color: var(--ink-2); margin-top: 4px; font-size: 16px; }
.ticket .amt { position: absolute; right: 16px; top: 14px; font-weight: 700; font-size: 18px; }
.ticket .flag { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 999px; }
.ticket[aria-pressed="true"] { border-color: var(--receive); box-shadow: 0 0 0 3px rgba(18,128,92,.25); }
.ticket[aria-pressed="true"]::before { border-color: var(--receive); }
.empty { color: var(--ink-2); text-align: center; padding: 18px 8px; }

/* ---------- invoice capture ---------- */
.capture { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.capture label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 104px; border-radius: var(--radius-sm); border: 2px dashed var(--receive);
  color: var(--receive-dark); font-weight: 700; text-align: center; cursor: pointer; padding: 10px;
  background: #f4fbf8;
}
.capture label svg { width: 34px; height: 34px; }
.capture input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-bottom: 16px; }
.page {
  position: relative; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden;
  background: #f1f3f5; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-2); text-align: center; padding: 4px;
}
.page img { width: 100%; height: 100%; object-fit: cover; }
.page .num { position: absolute; left: 4px; bottom: 4px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.page .rm {
  position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(24,32,43,.85); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}

/* ---------- done screen ---------- */
.done { text-align: center; padding: 28px 18px; }
.done .check { width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.done .check svg { width: 46px; height: 46px; }
.done h2 { font-size: 30px; margin-bottom: 8px; }
.done p { color: var(--ink-2); margin: 0 0 22px; }
.done .btns { display: grid; gap: 10px; }

.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
