/* Pronto Dashboard 0.15.0 — PHONE LAYOUT (David 31 Oct 20:43: "very clunky, the layout of the dashboard and also the add job").
   Everything here is inside @media (max-width:760px): desktop and tablet are untouched. Layout and presentation only:
   no field removed, nothing about saving changed. */
.mb-nav,.mb-sheet,.mb-shade,.mb-logo,.mb-jltools{display:none}
@media (max-width:760px){
 :root{--mbnav:64px}
 /* ---------- shell: the left icon rail becomes a bottom bar (frees ~72px of width) ---------- */
 .shell>.side{display:none!important}
 .col{width:100%;min-width:0}
 .main{padding:14px 14px calc(var(--mbnav) + 28px + env(safe-area-inset-bottom,0px))!important;max-width:100%;box-sizing:border-box}
 body.mb-form .main{padding-bottom:28px!important}
 .leaflet-container,.db-mapw,.jlx .mapbox{isolation:isolate}
 /* top bar: logo mark, date, sync chip. Add job lives in the bottom bar */
 .topbar{height:60px;padding:0 12px 0 10px!important;gap:10px}
 .topbar .addwrap{display:none!important}
 .mb-logo{display:grid;place-items:center;width:40px;height:40px;flex:none;border-radius:10px}
 .mb-logo img{width:34px;height:34px;border-radius:9px;display:block}
 .tb-date{flex:1 1 auto;min-width:0;font-size:14px!important;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #toast.toast{bottom:calc(var(--mbnav) + 16px + env(safe-area-inset-bottom,0px))!important}
 body.mb-form #toast.toast{bottom:104px!important}
 .ps-toast,.ps-banner{bottom:calc(var(--mbnav) + 16px + env(safe-area-inset-bottom,0px))!important;max-width:calc(100vw - 24px);box-sizing:border-box}
 body.mb-form .ps-toast,body.mb-form .ps-banner{bottom:104px!important}
 /* bottom bar */
 .mb-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:35;height:calc(var(--mbnav) + env(safe-area-inset-bottom,0px));padding:0 4px env(safe-area-inset-bottom,0px);box-sizing:border-box;background:rgba(255,255,255,.97);border-top:1px solid #d5dce5;box-shadow:0 -6px 18px rgba(16,24,40,.06)}
 body.mb-form .mb-nav{display:none}
 .mb-nav>a,.mb-nav>button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:48px;border:0;background:none;padding:6px 2px 4px;font:inherit;font-size:11.5px;font-weight:700;color:#5b6675;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
 .mb-nav>a>span,.mb-nav>button>span{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mb-nav svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
 .mb-nav>.on{color:var(--brand,#1E88E5)}
 .mb-nav>a:focus:not(:focus-visible),.mb-nav>button:focus:not(:focus-visible){outline:none}
 .mb-nav>.on::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;border-radius:0 0 3px 3px;background:var(--brand,#1E88E5)}
 .mb-nav>.mb-add{color:var(--brand,#1E88E5)}
 .mb-nav>.mb-add i{display:grid;place-items:center;width:44px;height:34px;border-radius:12px;background:var(--brand,#1E88E5);color:#fff;box-shadow:0 4px 12px rgba(30,136,229,.35)}
 .mb-nav>.mb-add i svg{width:22px;height:22px;stroke-width:2.6}
 .mb-nav>.mb-add.on::before{display:none}
 .mb-cnt{position:absolute;top:4px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:9px;background:#e53935;color:#fff;font-size:11px;font-weight:800;line-height:18px;text-align:center}
 /* "More" sheet: every other page from the old side menu */
 .mb-shade{display:block;position:fixed;inset:0;z-index:36;background:rgba(16,24,40,.38)}
 .mb-shade[hidden],.mb-sheet[hidden]{display:none!important}
 .mb-sheet{display:block;position:fixed;left:0;right:0;bottom:0;z-index:37;max-height:82vh;overflow:auto;background:#fff;border-radius:18px 18px 0 0;padding:8px 12px calc(var(--mbnav) + 12px + env(safe-area-inset-bottom,0px));box-shadow:0 -10px 30px rgba(16,24,40,.18)}
 .mb-sheet::before{content:"";display:block;width:40px;height:4px;border-radius:2px;background:#d0d6de;margin:4px auto 10px}
 .mb-sheet h2{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink3);margin:12px 6px 6px}
 .mb-sheet a{display:flex;align-items:center;gap:14px;min-height:52px;padding:0 10px;border-radius:12px;color:var(--ink);text-decoration:none;font-weight:650;font-size:16px}
 .mb-sheet a svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--ink2);flex:none}
 .mb-sheet a.on{background:var(--bluebg);color:var(--blue)} .mb-sheet a.on svg{color:var(--blue)}
 .mb-sheet a .nav-cnt{margin-left:auto}
 .mb-sheet .mb-foot{margin:10px 6px 0;color:var(--ink3);font-size:12.5px}
 .mb-sheet .side-usage{margin:8px 0 0}
 body.mb-sheet-open .mb-nav{z-index:38}

 /* ---------- DASHBOARD ---------- */
 #db-root{gap:14px!important}
 .db-top{flex-wrap:wrap}
 .db-top h1{font-size:22px!important;white-space:normal!important;line-height:1.2}
 .db-top .jl-add{display:none!important}
 /* the five numbers: one clear row each (label left, number right), nothing cut off */
 .db-kpis{display:flex!important;flex-direction:column;gap:8px!important}
 .db-k{display:flex!important;flex-flow:row wrap;align-items:center;gap:8px 12px!important;padding:13px 14px 12px!important;border-radius:14px;min-height:56px}
 .db-k:hover{transform:none}
 .db-kh{flex:1 1 auto;font-size:15px!important;color:var(--ink)!important;white-space:normal!important;flex-wrap:nowrap!important;gap:10px!important;min-width:0}
 .db-kh .go{display:none}
 .db-ki{width:30px!important;height:30px!important;border-radius:9px}
 .db-ki svg{width:17px;height:17px}
 .db-kv{flex:0 0 auto;margin-left:auto;justify-content:flex-end;gap:6px}
 .db-kv b{font-size:24px!important}
 .db-kv em{font-size:13px}
 .db-k .db-bar,.db-k .db-tries{flex:1 1 100%}
 .db-ks{flex:1 1 100%;white-space:normal!important;font-size:13px!important}
 /* cards stack in the order that matters on the go: today's schedule, needs attention, map, last 7 days */
 .db-grid{display:flex!important;flex-direction:column;gap:14px!important}
 .db-rc{display:contents!important}
 .db-sch{order:1} .db-att{order:2} .db-map{order:3} .db-wk{order:4}
 .db-card{border-radius:16px;overflow:visible}
 .db-scroll{overflow:visible!important;max-height:none!important;flex:none!important}
 .db-ch{flex-wrap:wrap;row-gap:4px;padding-top:14px!important;padding-bottom:10px!important}
 .db-ch h2{font-size:17px!important}
 .db-link{min-height:40px;display:inline-flex;align-items:center;margin-left:auto}
 .db-map .db-mapw{flex:none!important;height:260px;border-radius:0 0 16px 16px;overflow:hidden}
 .db-v{min-height:56px}
 .db-att .db-a:nth-child(n+7){display:none}
 .db-a{min-height:56px}
 .db-bars{min-height:150px}

 /* ---------- JOBS LIST: one card per job instead of a sideways-scrolling table ---------- */
 .jlx .jl-top{display:grid!important;grid-template-columns:minmax(0,1fr);gap:10px!important;padding:2px 0 12px!important}
 .jlx .jl-top .jl-add{display:none!important}
 .jlx .jl-search{width:auto!important;min-width:0!important;max-width:none!important;margin:0!important;flex:none!important;height:48px;box-sizing:border-box}
 .jlx .jl-search input{min-width:0;width:100%}
 .jlx .jl-search input{font-size:16px}
 .jlx .jl-search kbd{display:none}
 .mb-jltools{display:flex;gap:8px;margin:0 0 10px}
 .mb-jltools>*{flex:1 1 0;min-width:0;height:44px;border:1px solid var(--line);border-radius:12px;background:#fff;font:inherit;font-size:15px;font-weight:650;color:var(--ink);padding:0 12px;box-sizing:border-box}
 .mb-jltools button{display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer}
 .mb-jltools button b{background:var(--brand,#1E88E5);color:#fff;border-radius:9px;font-size:12px;min-width:18px;height:18px;line-height:18px;padding:0 5px}
 .mb-jltools button.open{border-color:var(--brand,#1E88E5);color:var(--brand,#1E88E5)}
 .jlx .jl-filters.jl-fgrid{display:none!important}
 .jlx .jl-filters.jl-fgrid.mb-open{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(9em,1fr))!important;gap:8px}
 .jlx .jl-fgrid .jl-f{min-height:54px}
 .jlx .jl-fgrid .jl-f select,.jlx .jl-fgrid .jl-fcl .jm-ac input{height:28px;font-size:15px}
 .jlx .jl-fgrid .jl-clear{min-height:44px!important}
 .jlx .jl-card{overflow:visible!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
 .jlx .jl-tbl{display:block!important;overflow:visible!important;width:100%;min-width:0!important}
 .jlx .jl-tbl thead{display:none}
 .jlx .jl-tbl tbody{display:flex;flex-direction:column;gap:10px}
 .jlx .jl-tbl tbody tr{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 10px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:13px 14px 12px;position:relative;overflow:hidden}
 .jlx .jl-tbl tbody tr[hidden]{display:none!important}
 .jlx .jl-tbl tbody tr::before{content:"";order:5;flex-basis:100%;height:0}
 .jlx .jl-tbl tbody tr::after{content:"";order:9;flex-basis:100%;height:0}
 .jlx .jl-tbl tbody td{display:block;padding:0!important;border:0!important;height:auto!important;width:auto!important;min-width:0!important;max-width:none!important;background:none!important;box-shadow:none!important;white-space:normal}
 .jlx .jl-tbl tbody tr:hover td{background:none!important}
 .jlx .jl-tbl tr.at-red{box-shadow:inset 5px 0 0 #e53935;background:#fffafa} .jlx .jl-tbl tr.at-amber{box-shadow:inset 5px 0 0 #f59e0b;background:#fffcf5}
 .jlx .jl-tbl td.c-site{order:1;flex:1 1 100%}
 .jlx .jl-tbl td.c-site .st{font-size:16px;font-weight:750;line-height:1.25;white-space:normal!important;overflow:visible!important}
 .jlx .jl-tbl td.c-site .ss{flex-wrap:wrap;white-space:normal!important;margin-top:3px}
 .jlx .jl-tbl td.c-status{order:2;flex:none}
 .jlx .jl-tbl td.c-ref{order:3;flex:none;font-size:13px}
 .jlx .jl-tbl td.c-client{order:4;flex:1 1 150px;font-size:14px;overflow-wrap:anywhere}
 .jlx .jl-tbl td.c-client .cl{white-space:normal!important;overflow:visible!important}
 .jlx .jl-tbl td.c-bt{order:6;flex:none} .jlx .jl-tbl td.c-acc{order:7;flex:none}
 .jlx .jl-tbl td.c-doors{order:8;flex:none;font-size:13px;color:var(--ink2);text-align:left!important}
 .jlx .jl-tbl td.c-doors .doors::before{content:"Doors ";font-weight:600;color:var(--ink3)}
 .jlx .jl-tbl td.c-when{order:10;flex:1 1 auto;font-size:13.5px}
 .jlx .jl-tbl td.c-surv{order:11;flex:none}
 .jlx .jl-tbl td.c-added{display:none!important}
 .jlx .jl-tbl td.c-act{order:12;flex:none;margin-left:auto}
 .jlx .jl-tbl td.c-act>svg{display:none}
 .jlx .jl-tbl td.c-act .btn{height:40px}
 .jlx .jl-tbl td:empty,.jlx .jl-tbl td.c-surv:has(> .muted:only-child),.jlx .jl-tbl td.c-bt:has(> .muted:only-child){display:none!important}
 .jlx .jl-tbl.grp tr.gh{padding:10px 14px}
 .jlx .jl-foot{display:none}

 /* ---------- ADD JOB (New job form): roomy numbered cards, big fields, save bar always in reach ---------- */
 body.mb-form .topbar .tb-date{visibility:visible}
 .main .jm-head{margin-bottom:12px}
 .main .jm-head h1{font-size:24px}
 .main .jm-head .sub{font-size:14px;line-height:1.4}
 .main .jm-back.pg-back{height:40px!important;padding:0 16px 0 10px;font-size:15px}
 #jm-new.jm-form{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;overflow:visible!important}
 #jm-new .jm-fsec{display:block!important;position:relative;background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px 14px 16px!important;margin:0 0 12px}
 #jm-new .jm-fnum{position:absolute;left:14px;top:14px;width:30px;height:30px;font-size:15px}
 #jm-new .jm-fsec h3{font-size:17px!important;margin:4px 0 14px 42px!important;line-height:22px}
 #jm-new .jm-cs{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
 #jm-new .jm-f{font-size:14px;gap:6px}
 #jm-new .jm-f input,#jm-new .jm-f select,#jm-new .jm-ac input{height:50px!important;font-size:16px!important;border-radius:12px}
 #jm-new textarea{font-size:16px!important;min-height:96px;border-radius:12px}
 #jm-new .jm-acrow{gap:8px}
 #jm-new .jm-acadd{width:50px!important;height:50px!important;flex:none;border-radius:12px}
 #jm-new .jm-ac .jm-acl{max-height:46vh}
 #jm-new .jm-acl [role=option],#jm-new .jm-acl .jm-aci{min-height:48px}
 #jm-new .jm-row3{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(10em,1fr))!important;gap:14px 12px!important;margin-bottom:14px}
 #jm-new .jm-row3>:nth-child(3){grid-column:1/-1}
 #jm-new .bt-accrow{gap:8px}
 #jm-new .nf-list{grid-template-columns:repeat(2,minmax(0,1fr))}
 #jm-new .mb-more{margin-top:14px;border-top:1px solid var(--line);padding-top:4px}
 #jm-new .mb-more>summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;min-height:52px;padding:6px 0;box-sizing:border-box;font-weight:700;font-size:15.5px;color:var(--blue);cursor:pointer}
 #jm-new .mb-more>summary::-webkit-details-marker{display:none}
 #jm-new .mb-more>summary::after{content:"";width:9px;height:9px;border-right:2.4px solid currentColor;border-bottom:2.4px solid currentColor;transform:rotate(45deg);margin:0 6px 4px 0;transition:transform .15s}
 #jm-new .mb-more[open]>summary::after{transform:rotate(-135deg);margin-bottom:-4px}
 #jm-new .mb-more>summary small{grid-column:1;grid-row:2;font-weight:600;color:var(--ink3);font-size:13px;margin-top:2px}
 #jm-new .mb-more>summary::after{grid-column:2;grid-row:1/span 2}
 #jm-new .mb-more .jm-row3{margin:4px 0 6px}
 #jm-new .mb-more .jm-row3>:nth-child(3){grid-column:1/-1}
 /* save bar: pinned to the bottom of the screen while you fill in the form */
 #jm-new .jm-ffoot{position:sticky!important;bottom:0;left:auto!important;right:auto!important;width:auto!important;max-width:none!important;z-index:20;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px!important;margin:0 -14px;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px))!important;background:rgba(255,255,255,.97)!important;border-top:1px solid var(--line);box-shadow:0 -8px 18px -10px rgba(16,24,40,.22)!important}
 #jm-new .jm-ffoot .btn{height:50px!important;font-size:15.5px;justify-content:center;white-space:normal!important;line-height:1.15;border-radius:12px}
 #jm-new .jm-ffoot .btn-primary{order:-1;grid-column:1/-1}
}
/* very narrow phones: slightly smaller bottom-bar labels (pairs of fields stack by themselves when the text is enlarged, via em-based columns) */
@media (max-width:360px){
 .mb-nav>a,.mb-nav>button{font-size:10.5px}
}
