/* Social Booth — Receipts. Phone-first. */
:root {
  --pink: #f0319a;
  --pink-dark: #c81f7e;
  --ink: #1a1330;
  --muted: #7a7390;
  --line: #e7e3ef;
  --bg: #f5f3fa;
  --card: #ffffff;
  --asset: #6b3df0;
  --expense: #1f9d6b;
  --warn: #e2533b;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(40, 20, 80, 0.08);
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 540px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* App bar */
.appbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px calc(14px); position: sticky; top: 0; z-index: 5;
  background: rgba(245,243,250,0.92); backdrop-filter: blur(8px);
}
.appbar img { width: 34px; height: 34px; border-radius: 9px; }
.appbar h1 { font-size: 19px; margin: 0; font-weight: 700; }
.appbar .who { margin-left: auto; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.appbar .who button { background: none; border: 0; color: var(--pink); font-weight: 600; font-size: 14px; padding: 6px; }

/* Screens */
.screen { display: none; flex: 1; padding: 8px 18px 140px; animation: fade .2s ease; }
.screen.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

/* PIN pad */
.pin-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; gap: 22px; }
.pin-logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: var(--shadow); }
.pin-wrap h2 { margin: 0; font-size: 22px; }
.pin-wrap .sub { color: var(--muted); margin-top: -12px; }
.pin-dots { display: flex; gap: 16px; height: 22px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; background: #d9d3e6; transition: .15s; }
.pin-dots i.f { background: var(--pink); transform: scale(1.05); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 78px); gap: 16px; }
.pin-pad button {
  height: 78px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow);
  font-size: 28px; font-weight: 600; color: var(--ink); transition: .1s;
}
.pin-pad button:active { transform: scale(.94); background: #faf6fc; }
.pin-pad button.blank { box-shadow: none; background: none; }
.pin-pad button.act { font-size: 20px; color: var(--muted); }
.pin-err { color: var(--warn); min-height: 20px; font-size: 15px; font-weight: 600; }

/* Cards & fields */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
input, select, textarea {
  width: 100%; font: inherit; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); }
textarea { resize: vertical; min-height: 70px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7390' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* Camera capture */
.capture { display: block; border: 2px dashed #cfc7e2; border-radius: var(--radius); background: #fbfaff;
  padding: 30px 18px; text-align: center; color: var(--muted); position: relative; }
.capture.has { padding: 0; border-style: solid; overflow: hidden; }
.capture .ico { font-size: 40px; }
.capture .big { font-size: 19px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.capture img { width: 100%; display: block; }
.capture input { position: absolute; inset: 0; opacity: 0; }
.retake { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; border: 0;
  border-radius: 20px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.reading { display: flex; align-items: center; gap: 10px; color: var(--pink); font-weight: 600; font-size: 15px; margin-top: 12px; }
.spin { width: 18px; height: 18px; border: 3px solid #f0d6e8; border-top-color: var(--pink); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Category grid */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat { padding: 14px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--ink); transition: .12s; }
.cat:active { transform: scale(.97); }
.cat.on { border-color: var(--pink); background: #fff0f8; color: var(--pink-dark); box-shadow: 0 0 0 1px var(--pink) inset; }
.cat small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cat.on small { color: var(--pink); }

/* Tag chip */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 20px; font-size: 14px; font-weight: 700; }
.chip.asset { background: #efe9fd; color: var(--asset); }
.chip.expense { background: #e6f6ef; color: var(--expense); }
.chip.route { background: #eef0f5; color: var(--muted); font-weight: 600; }
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Buttons */
.btn { width: 100%; border: 0; border-radius: 14px; padding: 17px; font: inherit; font-weight: 700; font-size: 18px; }
.btn.primary { background: var(--pink); color: #fff; box-shadow: 0 8px 20px rgba(240,49,154,.32); }
.btn.primary:active { background: var(--pink-dark); }
.btn.primary:disabled { background: #e7c9dd; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.btn.sm { width: auto; padding: 11px 16px; font-size: 15px; border-radius: 11px; }
.submitbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 18px calc(14px + var(--safe));
  background: linear-gradient(transparent, var(--bg) 28%); max-width: 540px; margin: 0 auto; }

/* Stocked picker */
.stocked-list { max-height: 220px; overflow: auto; border: 1.5px solid var(--line); border-radius: 12px; margin-top: 8px; }
.stocked-list .it { padding: 11px 13px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.stocked-list .it:last-child { border-bottom: 0; }
.stocked-list .it small { color: var(--muted); }
.stocked-list .it button { background: var(--pink); color: #fff; border: 0; border-radius: 9px; padding: 6px 12px; font-weight: 600; }
.picked { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.picked .p { background: #fff0f8; color: var(--pink-dark); border-radius: 18px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.picked .p b { cursor: pointer; margin-left: 6px; }
.jobline { font-size: 14px; font-weight: 600; margin-top: 8px; }
.jobline.ok { color: var(--expense); }
.jobline.no { color: var(--warn); }

/* Done screen */
.done { text-align: center; padding-top: 60px; }
.done .tick { width: 92px; height: 92px; border-radius: 50%; background: #e6f6ef; color: var(--expense);
  display: flex; align-items: center; justify-content: center; font-size: 50px; margin: 0 auto 22px; }
.done h2 { font-size: 24px; margin: 0 0 8px; }
.done p { color: var(--muted); margin: 0 0 28px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 24px; font-size: 15px; font-weight: 600;
  z-index: 50; box-shadow: var(--shadow); max-width: 90%; }
.toast.err { background: var(--warn); }
.hidden { display: none !important; }

/* Review console */
.q-item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.q-top { display: flex; gap: 14px; padding: 16px; }
.q-thumb { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; flex: none; background: #eee; cursor: zoom-in; }
.q-meta { flex: 1; min-width: 0; }
.q-meta .m { font-size: 14px; color: var(--muted); margin: 2px 0; }
.q-meta .big { font-size: 18px; font-weight: 700; color: var(--ink); }
.q-body { padding: 0 16px 16px; border-top: 1px solid var(--line); display: none; }
.q-item.open .q-body { display: block; padding-top: 14px; }
.q-actions { display: flex; gap: 10px; padding: 14px 16px; background: #faf8fd; }
.q-actions .btn { flex: 1; }
.q-empty { text-align: center; color: var(--muted); padding: 50px 0; }
.lightbox { position: fixed; inset: 0; background: rgba(20,10,40,.9); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* file (PDF / non-image) attachments */
.q-doc { display: flex; align-items: center; justify-content: center; background: #efe9fd; color: var(--asset); font-weight: 800; font-size: 14px; letter-spacing: .04em; text-decoration: none; }
.filechip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 28px 16px; text-align: center; }
.filechip .ico { font-size: 42px; }
.filechip .fn { font-weight: 700; color: var(--ink); word-break: break-all; font-size: 15px; }

/* ===== Review console v2 ===== */
.app.wide { max-width: 900px; }
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav-btn { background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 12px; border-radius: 10px; }
.nav-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.pill { background: var(--pink); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }
.banner { background: #fff7e6; border: 1px solid #ffe2a8; color: #7a5b00; padding: 10px 16px; border-radius: 12px; margin: 0 18px 14px; font-size: 13px; }

.s3 { padding: 13px 16px; border-radius: var(--radius) var(--radius) 0 0; }
.s3.asset { background: #efe9fd; } .s3.expense { background: #e6f6ef; }
.s3-row { display: flex; align-items: center; gap: 10px; }
.s3-cat { font-size: 20px; font-weight: 800; color: var(--ink); }
.s3.asset .s3-cat { color: var(--asset); } .s3.expense .s3-cat { color: var(--expense); }
.s3-tag { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .07em; padding: 3px 9px; border-radius: 20px; background: rgba(0,0,0,.06); color: var(--muted); }
.mk-chip { background: #fff; border-radius: 18px; padding: 3px 12px; font-weight: 800; font-size: 14px; color: var(--ink); box-shadow: var(--shadow); }
.s3-desc { margin-top: 6px; font-size: 15px; color: var(--ink); }
.q-caret { align-self: center; color: var(--muted); font-size: 18px; }

.simpro-send { display: inline-flex; gap: 6px; align-items: center; }
.mode-sel { width: auto; padding: 10px; border-radius: 10px; font-size: 14px; }
.btn.brand-xero { background: #13B5EA; color: #fff; box-shadow: 0 6px 16px rgba(19,181,234,.3); }
.btn.brand-simpro { background: #0072CE; color: #fff; box-shadow: 0 6px 16px rgba(0,114,206,.3); }

.modal { position: fixed; inset: 0; background: rgba(20,10,40,.55); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px; }
.modal-card { background: #fff; border-radius: 18px; max-width: 460px; width: 100%; padding: 0 22px 22px; box-shadow: var(--shadow); overflow: hidden; }
.modal-brandbar { height: 8px; margin: 0 -22px 16px; background: var(--pink); }
.brand-xero-bg { background: #13B5EA; } .brand-simpro-bg { background: #0072CE; }
.modal-card h3 { margin: 14px 0 8px; font-size: 20px; }
.send-body { font-size: 15px; color: var(--ink); }
.confirm-list { margin: 12px 0; padding-left: 18px; } .confirm-list li { margin: 5px 0; }
.dry { background: #fff7e6; border-radius: 10px; padding: 8px 12px; font-size: 13px; color: #7a5b00; margin-top: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; } .modal-actions .btn { flex: 1; }

.li-table, .dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.li-table th, .li-table td { padding: 4px; border-bottom: 1px solid var(--line); text-align: left; }
.li-table input { padding: 8px; } .li-table .num input { text-align: right; } .li-table .ctr { text-align: center; }
.dash-table th, .dash-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dash-table .num { text-align: right; } .dash-table th { color: var(--muted); font-size: 12px; }
.dest { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; margin: 1px; }
.dest.xero { background: #e1f4fb; color: #0b7aa3; } .dest.simpro { background: #e0eefb; color: #0a5ca8; } .dest.monday { background: #fde9f4; color: var(--pink-dark); }
.status-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #eee; }
.st-sent { background: #e6f6ef; color: var(--expense); } .st-pending_review { background: #fff0f8; color: var(--pink-dark); } .st-returned { background: #fdecea; color: var(--warn); }

/* BUILD per-line booth allocation (capture) */
.build-lines { display: flex; flex-direction: column; gap: 8px; }
.bl-row { display: flex; align-items: center; gap: 10px; }
.bl-desc { flex: 1; font-size: 14px; color: var(--ink); min-width: 0; }
.bl-mk { width: 120px; flex: none; padding: 11px; }
