/* Jobs Manager phone. The flavour's colour (#e8710a: TEST orange, LIVE blue) is filled in by build.py. No inline
   styles anywhere (the page's security rules allow only this file). */
:root {
  --brand: #e8710a;
  --ink: #262d36;
  --grey: #6b7280;
  --line: #d9dde3;
  --bg: #f4f5f7;
  --card: #ffffff;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4e00;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
main { padding: 12px 16px 24px; max-width: 720px; margin: 0 auto; }
.boot { padding: 24px 16px; color: var(--grey); }

/* the bar at the top: the flavour's colour, the app's name, Sign out */
/* the header and the bars stay at the top together (a verdict that comes up while scrolled down on a form is in view) */
.head { position: sticky; top: 0; z-index: 3; }
.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--brand); color: #fff;
}
.app-title { margin: 0; font-size: 20px; font-weight: 700; }
.signout { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 6px; padding: 6px 12px; font-size: 15px; }

/* the bars: no signal / the copy's time, and the update offer */
.bar { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 16px; font-size: 15px; border-bottom: 1px solid #f0d78a; }
/* what was found about a change that was not confirmed: stays until Close */
.vbar { display: flex; align-items: flex-start; gap: 10px; background: #e8f0fe; color: var(--ink); padding: 10px 16px; font-size: 15px; border-bottom: 1px solid #b6c8ef; font-weight: 600; }
.vtext { flex: 1; }
.vclose { flex: none; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 14px; }
.updbar {
  display: block; width: 100%; border: 0; text-align: left;
  background: var(--ink); color: #fff; padding: 12px 16px; font-size: 16px; font-weight: 600;
}

/* sign in */
.screen h2 { margin: 8px 0 12px; font-size: 20px; }
.hint { color: var(--grey); margin: 0 0 12px; }
label { display: block; margin: 0 0 12px; font-weight: 600; font-size: 15px; }
label input { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
input {
  font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input[name="code"] { letter-spacing: 6px; font-size: 22px; max-width: 220px; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: 0.6; }
.primary { display: block; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-size: 17px; font-weight: 600; margin-top: 4px; }
.link { background: none; border: 0; color: var(--brand); padding: 12px 0; text-decoration: underline; }
.msg { min-height: 1.4em; margin: 12px 0 0; font-weight: 600; }

/* the jobs list */
input[type="search"] { display: block; width: 100%; margin-bottom: 10px; }
.chips { margin-bottom: 6px; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 16px; padding: 6px 12px; font-size: 14px; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.count { color: var(--grey); font-size: 14px; margin: 4px 0 8px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card {
  display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.card-title { font-weight: 600; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 14px; color: var(--grey); }
.empty { color: var(--grey); }
.tag { border: 1px solid var(--grey); border-radius: 4px; padding: 0 6px; font-size: 12px; }

/* stage colours (as the PC's stage pills) */
.stage { border-radius: 10px; padding: 1px 8px; font-size: 13px; font-weight: 600; color: #fff; background: #9aa1ab; }
.st-quo { background: #8a6d3b; }
.st-prod { background: #1f6feb; }
.st-rdy { background: #0e8a7e; }
.st-del { background: #2f8f46; }
.st-paid { background: #7b4bc4; }
.st-can { background: #9b2c2c; }
.st-none { background: #9aa1ab; }

/* one job */
.back { display: inline-block; color: var(--brand); text-decoration: none; padding: 6px 0 10px; font-weight: 600; }
.job-title { overflow-wrap: anywhere; }
.facts { margin: 0 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--grey); }
.fact dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
h3 { font-size: 17px; margin: 16px 0 8px; }
.docs { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.doc { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: 0; }
/* C10: a document's line and its Send (the job's documents; the form once saved) */
.doc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.doc-line { flex: 1 1 60%; overflow-wrap: anywhere; }
.doc .note { margin: 0; }
.sendctl { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.doc .sendctl { flex: 0 1 auto; justify-content: flex-end; }
.send { flex: none; min-width: 88px; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 600; }
.send-msg { flex: 1 1 100%; margin: 0; font-size: 14px; font-weight: 600; }
.send-msg:empty { display: none; }
.send-line { flex: 1 1 60%; font-weight: 600; overflow-wrap: anywhere; }
.send-wait { flex: 1 1 100%; margin: 0; }
.doc-send { margin: 12px 0 0; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.docs-pc { margin: 8px 0 0; }

.version { text-align: center; color: var(--grey); font-size: 12px; padding: 8px 16px 24px; margin: 0; }

/* money (C3): the "Owed to you" card, a card's balance, a job's money */
.owed {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 10px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 10px 12px;
}
.owed-label { color: var(--grey); font-size: 14px; width: 100%; }
.owed-sum { font-size: 22px; font-weight: 700; }
.owed-count { color: var(--grey); font-size: 14px; }
.card-owed { color: #9b2c2c; font-weight: 600; }

/* new job (C6) */
.newjob-btn { display: block; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-size: 17px; font-weight: 600; margin: 0 0 10px; text-align: center; text-decoration: none; }
select { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 400; }
.preview { background: var(--card); border: 1px dashed var(--brand); border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; font-weight: 600; overflow-wrap: anywhere; }
.preview.none { border-color: var(--line); color: var(--grey); font-weight: 400; }
.note { color: var(--grey); font-size: 14px; margin: 0 0 12px; }
.flash { background: #e6f4ea; color: #1e5631; border: 1px solid #b7dfc3; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-weight: 600; }

/* quote and invoice (C7): the job screen's buttons, the form, the question sheet */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.act { flex: 1 1 40%; display: block; text-align: center; text-decoration: none; padding: 12px 8px; border: 1px solid var(--brand); border-radius: 8px; background: #fff; color: var(--brand); font-weight: 600; }
.doc-job { color: var(--grey); margin: -4px 0 12px; overflow-wrap: anywhere; }
.doc-note { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #f0d78a; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-weight: 600; }
input[type="date"] { min-height: 46px; }
label.check { display: flex; align-items: center; gap: 10px; }
label.check input { display: inline-block; width: 22px; height: 22px; margin: 0; flex: none; }
.sitebox { display: flex; gap: 10px; }
.sitebox label { flex: 1; min-width: 0; }
.total { font-size: 18px; margin: 4px 0 12px; }
.total-v { font-weight: 700; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 3px solid var(--brand);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25); padding: 16px 16px max(16px, env(safe-area-inset-bottom));
}
.sheet-words { white-space: pre-line; font-weight: 600; margin: 0 auto 12px; max-width: 720px; overflow-wrap: anywhere; }
.sheet-btns { display: flex; flex-direction: column; gap: 8px; max-width: 720px; margin: 0 auto; }
.sheet-no { display: block; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 17px; }

/* add payment (C8): the amount, Full balance, the PC's methods as chips, the after-this line; where mistakes are put right (C11) */
.pay-job, .stage-job { color: var(--grey); margin: -4px 0 12px; overflow-wrap: anywhere; }
.fillbal { display: inline-block; margin: -4px 0 12px; padding: 6px 12px; border: 1px solid var(--brand); border-radius: 16px; background: #fff; color: var(--brand); font-size: 14px; font-weight: 600; }
.paidby { margin: 0 0 12px; }
.paidby .lab { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.methods { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip.method { font-size: 15px; padding: 8px 14px; }
.after { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-weight: 600; }
.mistakes { margin-top: -8px; }

/* the stage (C9): the PC's stages, the one it is at marked; Hide / Unhide */
.stage-now { font-weight: 600; margin: 0 0 12px; }
.stage-head { color: var(--grey); font-size: 14px; margin: 0 0 6px; }
.stage-picks { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.stage-pick { display: block; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 17px; }
.stage-pick.cur { border: 2px solid var(--brand); font-weight: 700; }
.stage-pick.cur::after { content: " - now"; color: var(--grey); font-weight: 400; }
.hide-btn { display: block; width: 100%; padding: 12px; border: 1px solid var(--grey); border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; margin: 0 0 8px; }
