/* Floor Purchasers staff desk. Two parts: the screens staff work in, and the A4 documents they print or save as a PDF.
   The desk's Content-Security-Policy allows no inline style, so every rule lives here. */

/* ---------- screens ---------- */
*,*::before,*::after{box-sizing:border-box}
body.app{margin:0;background:#f4f7f8;color:#1c2b2e;font:15px/1.5 system-ui,"Segoe UI",Arial,sans-serif}
a{color:#006e6e}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.top{display:flex;flex-wrap:wrap;align-items:center;gap:6px 22px;padding:10px 24px;background:#062e31;color:#fff}
.top .brand{color:#fff;font-weight:700;text-decoration:none}
.top .brand span{font-weight:400;color:#9fd3cf}
.top nav{display:flex;flex-wrap:wrap;gap:4px 18px}
.top nav a,.top .who a{color:#cfe9e6;text-decoration:none}
.top nav a:hover,.top .who a:hover,.top nav a[aria-current]{color:#fff}
.top nav a[aria-current]{border-bottom:2px solid #ff4b5c}
.top .who{margin-left:auto;display:flex;align-items:center;gap:12px}
.wrap{max-width:1240px;margin:0 auto;padding:20px 24px 60px}
.head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin:4px 0 14px}
h1{font-size:1.5rem;margin:0}
h2{font-size:1.05rem;margin:0 0 10px}
.card h2:not(:first-child){margin-top:22px}
.card{background:#fff;border:1px solid #d7dfe0;border-radius:8px;padding:16px 18px;margin:0 0 16px}
.card.narrow{max-width:460px;margin:8vh auto}
.card.narrow.wide{max-width:560px;margin-top:4vh}
.steps{margin:0 0 14px;padding-left:22px}
.steps li{margin:0 0 12px}
.qrbox{margin:10px 0 6px;min-height:40px}
.qr{display:block;max-width:100%;height:auto;border:1px solid #d7dfe0;border-radius:6px;image-rendering:pixelated}
.key{display:inline-block;font-size:1rem;letter-spacing:.06em;white-space:nowrap}
.small,small{font-size:.82rem;color:#52666a}
label small{display:block;margin-top:2px}
.ids{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.tag{display:inline-block;padding:1px 10px;border-radius:99px;background:#e0ecec;font-size:.8rem;white-space:nowrap}
.tag.s-quoted{background:#fff0cc}.tag.s-accepted{background:#d8f1e2}.tag.s-complete{background:#d5e6fb}.tag.s-cancelled{background:#f6dcdc}
.flash{margin:0 0 14px;padding:9px 13px;border-left:4px solid #1c8a52;background:#e9f7ef;border-radius:0 6px 6px 0}
.flash.err{border-color:#b3202f;background:#fff0f0}
.flash.warn{border-color:#c98a00;background:#fff6dc}

label{display:block;margin:0 0 12px}
label>span{display:block;margin-bottom:3px;font-size:.84rem;font-weight:600}
input,select,textarea{width:100%;font:inherit;color:inherit;padding:7px 9px;border:1px solid #b0c0c2;border-radius:6px;background:#fff}
textarea{resize:vertical}
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #ff4b5c;outline-offset:1px}
label.check{display:flex;align-items:flex-start;gap:8px;margin-top:10px}
label.check input{width:auto;margin-top:5px}
label.check span{font-weight:400;font-size:.95rem;margin:0}
label.inline{display:flex;align-items:center;gap:8px;margin:0}
label.inline span{margin:0;white-space:nowrap}
label.inline input{width:11em}
.grid{display:grid;gap:0 14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.btn{display:inline-block;font:inherit;font-weight:600;line-height:1.3;padding:8px 15px;border:1px solid #007c7c;border-radius:6px;background:#007c7c;color:#fff;text-decoration:none;cursor:pointer}
.btn:hover{background:#006464}
.btn.sec{background:#fff;color:#1c2b2e;border-color:#b0c0c2}
.btn.sec:hover{background:#eef3f3}
.btn.small{padding:4px 10px;font-size:.85rem;font-weight:500}
.x{width:28px;height:28px;padding:0;border:1px solid #d7dfe0;border-radius:6px;background:#fff;color:#8a2130;font-size:1.1rem;line-height:1;cursor:pointer}
.x:hover{background:#fff0f0}
.savebar{position:sticky;bottom:0;margin:0 -6px 16px;padding:10px 6px;background:linear-gradient(#f4f7f800,#f4f7f8 30%)}
.filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.filters input{flex:1 1 260px}
.filters select{flex:0 0 170px}

.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.empty{color:#52666a;text-align:center;padding:16px}
.list{width:100%;border-collapse:collapse;background:#fff;border:1px solid #d7dfe0}
.list th,.list td{padding:8px 10px;border-bottom:1px solid #e6ecec;text-align:left;vertical-align:top;font-size:.92rem}
.list thead th{background:#eef3f3;font-size:.76rem;text-transform:uppercase;letter-spacing:.05em}
.list th.num,.list td.num{text-align:right}
.list.compact{max-width:720px}
.list tfoot th,.list tfoot td{font-weight:700;border-bottom:0}
.list .acts{display:flex;flex-wrap:wrap;gap:6px}
.list .reset{display:flex;gap:6px}
.list .reset input{width:13em;padding:4px 8px}

.qline{margin:0 0 14px;padding:12px 14px;border:1px solid #c9d6d7;border-radius:8px;background:#fafcfc}
.qline legend{padding:0 6px;font-weight:700;font-size:.9rem;color:#006e6e}
.scroll{overflow-x:auto}
.rows{width:100%;min-width:880px;border-collapse:collapse}
.rows caption{caption-side:top;text-align:left;font-size:.8rem;color:#52666a;padding:2px 0 5px}
.rows th{padding:3px 4px;text-align:left;font-size:.74rem;text-transform:uppercase;letter-spacing:.04em;color:#52666a}
.rows td{padding:2px 3px;vertical-align:middle}
.rows input,.rows select{padding:5px 7px}
.rows .c-kind{width:112px}.rows .c-unit{width:84px}.rows .c-n{width:92px}.rows .c-ord{width:120px}.rows .c-sup{width:17%}.rows .c-x{width:34px}.rows .c-amt{width:190px}
.rows .c-n input{text-align:right}
.rows.wide{min-width:0}
.linefoot{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:8px;font-size:.9rem}
.linefoot .grow{flex:1;text-align:right}
.sum{width:100%;max-width:400px;margin-left:auto;border-collapse:collapse;align-self:start}
.sum th{text-align:left;font-weight:400;padding:4px 8px}
.sum td{padding:4px 8px}
.sum .grand th,.sum .grand td{font-weight:700;border-top:2px solid #1c2b2e}
.sum .staff th,.sum .staff td{color:#52666a;font-size:.88rem}
.sum .staff.first th,.sum .staff.first td{border-top:1px dashed #b0c0c2}

.doclist{list-style:none;margin:0 0 6px;padding:0}
.doclist li{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:9px 0;border-bottom:1px solid #e6ecec}
.doclist li>b{flex:0 0 210px}
.doclink{font-weight:600}
.payform{display:flex;flex-wrap:wrap;align-items:flex-end;gap:0 12px;max-width:900px;margin-top:10px}
.payform label{flex:1 1 150px}
.payform .btn{margin-bottom:12px}
code{background:#eef3f3;padding:1px 5px;border-radius:4px;font-size:.9em}

@media (max-width:820px){
  .wrap{padding:14px}.top{padding:10px 14px}
  .g2,.g3,.g4{grid-template-columns:1fr}
  .list{display:block;overflow-x:auto}
  .doclist li>b{flex-basis:100%}
  .sum{margin:0}
}

/* ---------- documents (A4) ---------- */
body.doc{margin:0;background:#dfe5e6;color:#111;font:9.5pt/1.3 Calibri,Carlito,"Segoe UI",Arial,sans-serif;overflow-x:auto}
.docbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;padding:10px 18px;background:#062e31;font:15px/1.4 system-ui,"Segoe UI",Arial,sans-serif}
.docbar a{color:#cfe9e6}
.docbar button{font:inherit;font-weight:600;padding:7px 14px;border:0;border-radius:6px;background:#ff4b5c;color:#fff;cursor:pointer}
.docbar .warn{color:#ffe7a8}
.sheet{position:relative;display:flex;flex-direction:column;width:210mm;min-height:297mm;margin:14px auto;padding:9mm 14mm 7mm;background:#fff;box-shadow:0 2px 14px rgba(0,0,0,.25)}
.sheet main{flex:1}
.sheet.draft::before{content:"DRAFT";position:absolute;top:118mm;left:0;right:0;text-align:center;font-size:110pt;font-weight:700;letter-spacing:.1em;color:rgba(0,0,0,.06);transform:rotate(-28deg);pointer-events:none}
.sheet h1{margin:0 0 2mm;font-size:16pt;font-style:italic;text-align:right}
.sheet h1 small{font-size:11pt;font-style:normal;font-weight:400}
.sheet h2{margin:3mm 0 1mm;font-size:10pt}
.sheet h2.tight{margin-top:0}
.sheet p{margin:0 0 1.5mm}
.sheet .num{text-align:right;white-space:nowrap}
.sheet .empty{padding:5mm;color:#555}
.lh{display:flex;justify-content:space-between;align-items:flex-start;gap:10mm;margin-bottom:3mm;padding-bottom:3mm;border-bottom:1.5pt solid #009a96}
.lh-brand img{display:block;width:46mm;height:auto}
.lh-brand p{margin:1.5mm 0 0;font-size:7.5pt;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#d9342b}
.lh-branch{font-style:normal;font-size:8.5pt;line-height:1.25}
.lh-branch b{font-size:10pt}
.lf{display:flex;align-items:center;gap:7mm;margin-top:4mm;padding-top:2.5mm;border-top:1.5pt solid #009a96;font-size:7.5pt;line-height:1.3;color:#222}
.lf img{flex:0 0 auto;width:36mm;height:auto}
.lf p{margin:0}
.sub{margin-top:-2mm;text-align:right;font-size:9pt}
.meta{display:grid;grid-template-columns:1fr 1fr;gap:0 10mm;margin-bottom:3mm}
.kv{border-collapse:collapse}
.kv th{padding:.4mm 4mm .4mm 0;text-align:left;vertical-align:top;white-space:nowrap}
.kv td{padding:.4mm 0;vertical-align:top}
.kv.pay{width:100%;margin-bottom:3mm}
.kv.pay th{font-weight:400;white-space:normal}
.party h2{margin:0 0 1mm;font-size:9pt;text-transform:uppercase;letter-spacing:.05em;color:#333}
.heading{margin-top:3mm;font-weight:700}
.lines{width:100%;margin:1.5mm 0 3mm;border-collapse:collapse}
.lines th,.lines td{padding:1.1mm 2mm;border:.75pt solid #222;vertical-align:top;text-align:left}
.lines thead th{background:#ececec;text-align:center}
.lines th.num,.lines td.num{text-align:right}
.lines tfoot th{text-align:right}
.lines .c-area{width:34mm}.lines .c-prod{width:38mm}.lines .c-amt{width:31mm}.lines .c-qty{width:19mm}.lines .c-unit{width:15mm}.lines .c-ord{width:27mm}
.doc-quote .lines tbody td{font-weight:700}
.below{display:grid;grid-template-columns:1fr 74mm;gap:6mm;align-items:start}
.notes p{white-space:normal}
.notes ul{margin:1mm 0 0;padding-left:5mm}
.notes.solo{margin-bottom:4mm}
.totals{width:100%;margin-bottom:1.5mm;border-collapse:collapse}
.totals th{padding:.7mm 2mm;text-align:left;font-weight:400}
.totals td{padding:.7mm 2mm;border:.75pt solid #222;width:34mm}
.totals .grand th,.totals .grand td,.totals .deposit th,.totals .deposit td{font-weight:700}
.totals .deposit td{border-width:1.5pt}
.terms{margin-top:3mm;font-size:8.5pt;font-weight:700}
.terms p{margin-bottom:.7mm}
.sign{display:flex;gap:8mm;margin:5mm 0 0}
.sign span{flex:1;display:flex;align-items:flex-end;gap:2mm}
.sign i{font-style:normal;white-space:nowrap}
.sign b{flex:1;height:5mm;border-bottom:.75pt solid #111}
.sign.wide span{flex:0 0 62%}
.sign.wide em{margin-left:auto;font-style:normal}
.bottom{display:grid;grid-template-columns:66mm 1fr;gap:6mm;margin-top:5mm;align-items:start}
.bank{padding:1.5mm 3mm;border:.75pt solid #222;font-size:8.5pt}
.bank p{margin:1mm 0 0}
.bank .kv th{font-weight:400}
.notes .bank{max-width:80mm}
.sheet .small{font-size:7.5pt;line-height:1.3;color:#111;text-align:justify}
.form{margin-top:6mm;font-size:11pt}
.fill{display:flex;align-items:flex-end;gap:3mm;margin:0 0 6mm}
.fill span{white-space:nowrap}
.fill b{flex:1;min-height:5mm;border-bottom:.75pt dotted #111;font-weight:700}
.ask{margin:8mm 0}
.choice{white-space:nowrap}
.box{display:inline-block;width:4mm;height:4mm;margin:0 1mm 0 4mm;border:.75pt solid #111;vertical-align:-0.6mm}
.nb{margin-top:8mm;font-weight:700}

@page{size:A4;margin:0}
@media print{
  body.doc{background:#fff;overflow:visible}
  .docbar{display:none}
  .sheet{margin:0;box-shadow:none;min-height:296mm}   /* a hair under A4, so rounding never adds an empty second page */
  .lines tr,.totals,.sign,.bank,.lf{break-inside:avoid}
}
