/* Build 105: the desktop (Mac / iPhone) Sales Desk look, ported to the web.
   Colours, card shapes, board columns and pills come straight from the app's own skin (SalesSkin.swift, SalesBoards.swift).
   Loaded after styles.css, so it wins. */
:root{
 --forest:#10241B;--forest-soft:#17352A;--green:#1D6B49;--leaf:#2E8B5E;--amber:#E0A230;--amber-text:#7A4B00;
 --canvas:#F1F3EE;--board:#E7ECE5;--line:#E3E7E2;--ink:#17231D;--muted:#5B6B63;--alert:#C4573A;--sky:#4C8FD0;
 --attn-fill:#FFF7E3;--attn-line:#F0D58E;--red:#C0392B;--orange:#E8872B;--dorange:#B45F06;--slate:#5B6B63;--good:#1D6B49;
 font:17px/1.5 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);
}
body{background:var(--canvas);color:var(--ink);font-size:17px}
a{color:var(--green)}
h1,h2,h3{color:var(--ink)}
h2{font-size:18px;font-weight:700;letter-spacing:-.01em;margin:0 0 12px}
main h1{font-size:30px;font-weight:800;letter-spacing:-.02em;line-height:1.15;margin:0 0 4px}
.muted,.subtle{color:var(--muted)}
.subtle{font-size:17px;margin:2px 0 0}
small{color:var(--muted);font-size:17px}

/* ---- page frame: light top bar with tab pills (no sidebar) ---- */
.shell{display:block;min-height:100vh}
.deskbar{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.deskrow{display:flex;align-items:center;gap:10px;padding:10px 20px 4px;flex-wrap:wrap}
.mark{display:inline-grid;place-items:center;width:34px;height:34px;background:var(--green);color:#fff;border-radius:10px;font-weight:800}
.deskbrand{font-size:20px;letter-spacing:-.02em;color:var(--forest);margin-right:6px}
.deskchip{background:var(--amber);color:var(--forest);font-weight:700;font-size:17px;border-radius:999px;padding:9px 14px;white-space:nowrap}
.spacer{flex:1}
.deskwho{display:flex;flex-direction:column;text-align:right;line-height:1.25;font-size:17px;color:var(--ink)}
.deskwho small{font-size:17px}
.desklink{font-weight:600;font-size:17px;text-decoration:none;padding:8px 6px}
button.ghost{border-color:transparent;background:transparent;min-height:40px;color:var(--ink)}
.desktabs{display:flex;gap:4px;padding:2px 14px 8px;flex-wrap:wrap;overflow:visible}
button.tabpill{border:0;background:transparent;color:var(--ink);font-weight:600;font-size:17px;min-height:44px;padding:0 14px;border-radius:10px;white-space:nowrap}
button.tabpill:hover{background:var(--board)}
button.tabpill.active{background:var(--green);color:#fff}
main{max-width:none;width:100%;padding:20px 24px 48px;margin:0}
.pagehead{display:flex;justify-content:space-between;align-items:flex-end;gap:14px 20px;flex-wrap:wrap;margin:0 0 16px}
.kicker{font-size:17px;font-weight:600;letter-spacing:0;color:var(--muted);margin:0 0 2px;text-transform:none}
.pagectl{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* ---- controls ---- */
button{background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:10px;font-weight:600;min-height:44px;padding:0 16px}
button:hover{background:var(--board)}
button.primary{background:var(--green);border-color:var(--green);color:#fff}
button.primary:hover{background:#185a3d}
button.amber{background:var(--amber);border-color:var(--amber);color:var(--forest);border-radius:999px;font-weight:700}
button.amber:hover{background:#d19524}
button.small{min-height:36px;padding:0 12px;font-size:17px}
button.linkbtn{border:0;background:none;color:var(--green);padding:0;min-height:0;font-weight:700;font-size:inherit}
input,select,textarea{background:#fff;border:1px solid #cfd8d1;border-radius:12px;min-height:44px;font-size:17px;color:var(--ink);padding:10px 14px;box-shadow:none}
select{padding-right:10px}
input:focus,select:focus,textarea:focus{outline:3px solid #b6dcc6;border-color:var(--green)}
label{color:var(--muted);font-size:17px;font-weight:600}
.toolbar{margin:0 0 14px}
.toolbar input{max-width:340px}
.seg{display:inline-flex;background:var(--board);border-radius:10px;padding:3px;gap:2px}
.seg button{border:0;background:transparent;min-height:38px;padding:0 14px;border-radius:8px;font-weight:600;color:var(--muted)}
.seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
button.chip{border-radius:999px;background:#fff;font-weight:700;padding:0 16px}
button.chip.on{background:var(--green);border-color:var(--green);color:#fff}

/* ---- cards ---- */
.skincard,.panel{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px 18px;margin:0 0 16px;box-shadow:none}
.panel{padding:20px}
.skincard.tablewrap,.panel.tablewrap{overflow:auto}
.smhead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.smhead h2{margin:0}
.pill{display:inline-block;font-size:17px;font-weight:600;line-height:1;padding:5px 9px;border-radius:999px;white-space:nowrap}
.pill.green{color:var(--good);background:rgba(29,107,73,.14)}
.pill.orange{color:var(--dorange);background:rgba(180,95,6,.14)}
.pill.red{color:var(--red);background:rgba(192,57,43,.14)}
.pill.slate{color:var(--slate);background:rgba(91,107,99,.14)}
.good{color:var(--good);font-weight:600}.late{color:var(--red);font-weight:700}.amber-text,small.amber{color:var(--amber-text);font-weight:600}
.empty{border:1px dashed #cfd8d1;border-radius:14px;background:#fff;padding:30px;text-align:center;color:var(--muted)}

/* ---- overview tiles ---- */
.otiles{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 10px}
.otile{flex:1 1 190px;border-radius:10px;padding:16px 18px;background:rgba(91,107,99,.07)}
.otile small{display:block;font-size:17px;font-weight:500;color:var(--muted);margin-bottom:2px}
.otile b{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}
.otile.orange{background:rgba(232,135,43,.08)}.otile.orange b{color:var(--orange)}
.otile.slate b{color:var(--slate)}
.otile.red{background:rgba(192,57,43,.07)}.otile.red b{color:var(--red)}
.otile.dorange{background:rgba(180,95,6,.07)}.otile.dorange b{color:var(--dorange)}
.otile.green{background:rgba(29,107,73,.07)}.otile.green b{color:var(--good)}
.otiles.three .otile{flex:0 1 220px}
.otiles.pipeline{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:0}
.otiles.pipeline .otile{background:var(--board);border-radius:14px;padding:7px 7px 14px;display:flex;flex-direction:column;gap:2px}
.otiles.pipeline .otile .colbar{margin-bottom:8px}
.otiles.pipeline .otile small,.otiles.pipeline .otile b{padding:0 10px}
@media(max-width:900px){.otiles.pipeline{grid-template-columns:repeat(2,minmax(0,1fr))}}
.obar{display:flex;gap:2px;height:8px;background:var(--line);border-radius:999px;overflow:hidden}
.obar i{display:block;height:100%}.obar .red{background:var(--red)}.obar .orange{background:var(--orange)}.obar .green{background:var(--good)}

/* ---- attention strip ---- */
.attention{background:var(--attn-fill);border:1px solid var(--attn-line);border-radius:16px;padding:16px;margin:0 0 16px}
.atthead{display:flex;align-items:center;gap:10px;margin-bottom:10px}.atthead h2{margin:0;font-size:18px}
.attcount{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--amber);color:var(--forest);font-weight:800;font-size:17px}
.attscroll{display:flex;gap:10px;overflow-x:auto;padding-bottom:2px}
button.attcard{flex:0 0 270px;text-align:left;background:#fff;border:1px solid var(--attn-line);border-radius:12px;padding:12px;min-height:0;display:block}
button.attcard b{display:block;color:var(--ink);font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
button.attcard span{display:block;color:var(--amber-text);font-size:17px;font-weight:400;margin-top:3px}

/* ---- boards: same columns, bars and cards as the desktop pipeline ---- */
.board{display:grid;grid-template-columns:repeat(var(--cols,4),minmax(220px,420px));gap:8px;overflow-x:auto;padding:4px 0 8px;margin:0;align-items:start;justify-content:start}
.board .col{background:var(--board);border-radius:14px;padding:7px;min-height:0;display:flex;flex-direction:column;gap:8px}
.colbar{height:4px;border-radius:3px;background:var(--bar,#A8B0AB)}
.board .col h3{display:flex;align-items:baseline;gap:8px;margin:0;padding:0 2px;font-size:17px}
.ctitle{font-weight:700}.ccount{color:var(--muted);font-weight:700}
.ctotal{margin-left:auto;font-size:17px;font-weight:700;font-variant-numeric:tabular-nums}
.nothing{margin:0;padding:8px;font-size:17px;color:var(--muted)}
.board .card,.dcard{background:#fff;border:0;border-radius:12px;padding:11px;margin:0;box-shadow:0 1px 2px rgba(0,0,0,.06);cursor:pointer;font-size:17px;text-align:left}
.dcard:hover{box-shadow:0 2px 6px rgba(0,0,0,.12)}
.dcard:focus-visible{outline:3px solid #b6dcc6}
.dtop{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.dwho{min-width:0;display:flex;flex-direction:column;gap:2px}
.dwho b{font-size:17px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dwho small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dwho small.co{color:var(--green);font-weight:600}
.repbadge{flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:var(--forest);color:#fff;font-size:17px;font-weight:800;display:inline-grid;place-items:center}
.dmid{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin:8px 0}
.damt{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
.dmid small{font-weight:600;font-size:17px}
.dbot{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid var(--line);padding-top:8px}
.note{font-size:17px;font-weight:600}.note.muted{color:var(--muted)}.note.amber{color:var(--amber-text)}.note.green{color:var(--good)}.note.red{color:var(--red)}
.act{font-size:17px;font-weight:700;color:var(--green)}
.clickrow{cursor:pointer}.clickrow:hover{background:#f7f9f6}
.lockline{margin:0 0 12px}

/* ---- rows (customers, documents, work orders) ---- */
.docrow,.contactrow,.custmain,.cityjob{display:flex;align-items:center;gap:12px}
.docrow{justify-content:space-between;padding:14px 4px;border-bottom:1px solid var(--line);cursor:pointer}
.docrow:last-of-type{border-bottom:0}
.docrow:hover,.custmain:hover,.contactrow:hover{background:#f7f9f6}
.docrow small,.custinfo small{display:block}
.docamt{margin-left:auto;text-align:right;display:flex;flex-direction:column}
.docamt b{font-variant-numeric:tabular-nums}
.chev{color:var(--muted);font-weight:700;font-size:18px}
small.req{color:var(--green);font-weight:600}
.custcard{padding:0;overflow:hidden}
.custmain{padding:14px 16px;cursor:pointer}
.custinfo{flex:1;min-width:0}
.custnum{margin-left:auto;text-align:right}
.custnum b{display:block;font-variant-numeric:tabular-nums}
.avatar{flex:0 0 44px;width:44px;height:44px;border-radius:50%;background:var(--forest);color:#fff;font-weight:700;display:inline-grid;place-items:center}
.avatar.sm{flex-basis:34px;width:34px;height:34px;font-size:17px;background:var(--forest-soft)}
.contactlist{border-top:1px solid var(--line);background:#fbfcfa}
.contactrow{padding:10px 16px 10px 40px;cursor:pointer;border-top:1px solid var(--line)}
.contactrow:first-child{border-top:0}
.contactrow.wide{padding-left:4px}
.role{color:var(--green);font-weight:600;margin-left:4px}
.infogrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px 20px;margin-bottom:12px}
.infogrid p{margin:2px 0 0}
.cityjobs{margin-top:12px;display:flex;flex-direction:column;gap:8px}
.cityhead{display:flex;justify-content:space-between;align-items:baseline}
button.cityjob{background:var(--canvas);border:0;border-radius:12px;padding:10px 12px;text-align:left;min-height:0;width:100%}
button.cityjob i{flex:0 0 14px;width:14px;height:14px;border-radius:50%;border:1.5px solid #fff;box-shadow:0 0 1px rgba(0,0,0,.5)}
button.cityjob span{display:flex;flex-direction:column;flex:1;min-width:0;font-weight:400}
button.cityjob span.r{flex:0 0 auto;align-items:flex-end;gap:3px}
button.cityjob small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---- tables inside cards ---- */
table{font-size:17px}
th{background:transparent;color:var(--muted);font-size:17px;letter-spacing:.06em;border-bottom:1px solid var(--line)}
td{border-bottom:1px solid var(--line)}
td button{min-height:36px}

/* ---- jobs map ---- */
.jobmapview{position:relative;height:440px;border-radius:14px;border:1px solid var(--line);overflow:hidden;background:#e9e7e0;touch-action:none;cursor:grab;margin-bottom:12px}
.jobmapview.jm-drag{cursor:grabbing}
.jm-tiles,.jm-markers{position:absolute;inset:0}
.jm-tiles img{position:absolute;max-width:none;user-select:none;-webkit-user-drag:none}
.jm-marker{position:absolute;left:0;top:0;will-change:transform}
.jm-marker[hidden]{display:none}
.jm-pin{position:absolute;left:0;top:0;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;min-width:44px;min-height:44px;justify-content:center;cursor:pointer}
.cbubble{display:inline-grid;place-items:center;border-radius:50%;background:var(--forest);color:#fff;font-weight:700;font-size:17px;border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.35)}
.cbubble.sel{background:var(--amber);color:var(--forest)}
.cdots{display:flex;gap:3px;margin-top:3px}
.cdots i{width:11px;height:11px;border-radius:50%;border:1.5px solid #fff;box-shadow:0 0 1px rgba(0,0,0,.5)}
.jm-pin .dot{width:26px;height:26px;border-radius:50%;border:3px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.4)}
.jm-zoom{position:absolute;top:10px;right:10px;display:flex;flex-direction:column;gap:1px;z-index:5}
.jm-zoom button{width:38px;height:38px;min-height:0;padding:0;border-radius:8px;font-size:20px;line-height:1;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.jm-credit{position:absolute;right:0;bottom:0;background:rgba(255,255,255,.8);font-size:17px;padding:2px 6px;z-index:5}
.jm-credit a{color:#333}
.legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin-bottom:8px}
.legend span{display:inline-flex;align-items:center;gap:6px;font-size:17px;font-weight:600}
.legend i{width:14px;height:14px;border-radius:50%;border:1.5px solid #fff;box-shadow:0 0 1px rgba(0,0,0,.5)}

/* ---- closing rate bars, editor, forms: same cards ---- */
.bar{background:var(--line)}.bar i{background:var(--green)}
.usage-row{border-bottom:1px solid var(--line)}
.document-actions{background:#fff;border:1px solid var(--line);border-radius:16px}
.line-editor{background:#f7f9f6;border:1px solid var(--line);border-radius:14px}
.decision-banner{background:var(--attn-fill);border:1px solid var(--attn-line)}
.metric{border-radius:16px;border:1px solid var(--line)}
.auth{background:#fff;border:1px solid var(--line);border-radius:20px;padding:28px}
.auth .brand:before{background:var(--green)}
.paper{border:1px solid var(--line);border-radius:16px}
.product-return{background:var(--board)}
#message{background:var(--forest)}

@media(max-width:800px){
 main{padding:16px 14px 40px}
 .deskwho{display:none}
 .deskrow{padding:8px 14px 2px}
 .board{grid-template-columns:repeat(var(--cols,4),minmax(250px,82vw))}
 .pagectl{width:100%}
 .toolbar input{max-width:none}
 .docrow{flex-wrap:wrap}
 .jobmapview{height:360px}
}
@media print{.deskbar{display:none}main{padding:0}.skincard,.panel{border:0}}

/* Customer suggestions (Build 107) */
label:has(> #custSuggest){position:relative}
.suggest{position:absolute;left:0;right:0;top:100%;z-index:30;margin-top:4px;background:#fff;border:1px solid var(--line,#E3E7E2);border-radius:12px;box-shadow:0 10px 28px rgba(16,36,27,.16);max-height:320px;overflow:auto;padding:4px}
.suggest[hidden]{display:none}
.sugg{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:9px 12px;font:inherit;color:#17231D;cursor:pointer}
.sugg small{color:#5B6B63;font-weight:400}
.sugg:hover,.sugg.on{background:#E7F0EA}

/* Question dialog (Build 111) */
.askdialog{border:0;border-radius:16px;padding:22px 24px;max-width:440px;width:calc(100% - 32px);box-shadow:0 20px 60px rgba(16,36,27,.3);color:#17231D}
.askdialog::backdrop{background:rgba(16,36,27,.45)}
.askdialog h2{margin:0 0 8px;font-size:20px}.askdialog p{margin:0 0 16px;color:#5B6B63;line-height:1.45}
.askdialog .actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

/* Menus with drop-downs (Build 112) */
.tabgroup{position:relative;display:inline-block}
.tabgroup .caret{font-size:17px;opacity:.7}
.tabmenu{display:none;position:absolute;left:0;top:100%;min-width:200px;z-index:50;padding:6px;background:#fff;border:1px solid var(--line,#E3E7E2);border-radius:12px;box-shadow:0 12px 30px rgba(16,36,27,.16)}
.tabgroup:hover .tabmenu,.tabgroup.open .tabmenu,.tabgroup:focus-within .tabmenu{display:block}
.tabmenu .menuitem{display:block;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:10px 12px;font:inherit;font-weight:600;color:#17231D;cursor:pointer}
.tabmenu .menuitem:hover{background:#E7F0EA}
.tabmenu .menuitem.active{background:#1D6B49;color:#fff}
/* PDF preview window (Build 112) */
.pdfdialog{border:0;border-radius:16px;padding:0;width:min(920px,calc(100% - 24px));height:min(90vh,1100px);box-shadow:0 20px 60px rgba(16,36,27,.35);overflow:hidden}
.pdfdialog[open]{display:flex;flex-direction:column}
.pdfdialog::backdrop{background:rgba(16,36,27,.5)}
.pdfbar{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid #E3E7E2;background:#F1F3EE}
.pdfbar .spacer{flex:1}
.pdfbar a.button{text-decoration:none;display:inline-block;padding:10px 14px;border-radius:10px}
.pdfdialog iframe{flex:1;border:0;width:100%;background:#fff}
.pdfbar a.button.primary{background:var(--green,#1D6B49);color:#fff;font-weight:600}

.savebar{position:sticky;bottom:0;z-index:20;display:flex;flex-direction:row;gap:12px;align-items:center;padding:12px 16px;margin-top:16px;background:rgba(255,255,255,.97);border:1px solid var(--line);border-radius:14px 14px 0 0;box-shadow:0 -6px 18px rgba(23,35,29,.08)}
.savebar>*{flex:0 0 auto}
.panel.summary{position:static!important}

th{text-transform:none!important;letter-spacing:0!important;font-size:17px;font-weight:600}
