:root{--brick:#9a060d;--brick-dark:#730409;--brick-light:#bb141d;--black:#1e1e1e;--charcoal:#2b2b2b;--gray:#b5b2b3;--gray-dark:#6f6f6f;--gray-light:#ecebeb;--white:#fff;--bg:#f5f4f4;--text:#1e1e1e;--muted:#5e5e5e;--border:#d9d7d7;--safe-bottom:env(safe-area-inset-bottom,0px);--safe-top:env(safe-area-inset-top,0px);color:var(--text);background:var(--bg);-webkit-text-size-adjust:100%;font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}body{min-height:100dvh;margin:0}h1,h2{margin:0}button{font:inherit;cursor:pointer}input,select,textarea{font:inherit;font-size:16px}.btn{border:0;border-radius:10px;min-height:44px;padding:12px 16px;font-weight:600}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:var(--brick);color:var(--white)}.btn-primary:active{background:var(--brick-dark)}.btn-dark{background:var(--black);color:var(--white)}.btn-outline{background:var(--white);color:var(--black);border:2px solid var(--black)}.btn-ghost{color:var(--white);border:1px solid var(--gray);background:0 0}.btn-small{min-height:44px;padding:8px 14px;font-size:14px}.muted{color:var(--muted);font-size:14px}.error{color:var(--brick);margin:0;font-size:14px}.card{background:var(--white);border:1px solid var(--border);border-radius:12px;padding:14px}.app-loading{height:100dvh;color:var(--muted);place-items:center;display:grid}.login{background:var(--white);flex-direction:column;min-height:100dvh;display:flex}.login-hero{padding:calc(28px + var(--safe-top)) 24px 30px;background:var(--white);border-bottom:6px solid var(--brick);box-shadow:inset 0 -3px 0 var(--gray);justify-content:center;display:flex}.login-logo{width:min(300px,78vw);height:auto;display:block}.login-card{background:var(--white);text-align:center;flex:1;padding:22px 22px 32px}.login h1{color:var(--black);font-size:24px}.login-sub{color:var(--muted);margin:4px 0 20px;font-size:15px}.form{text-align:left;flex-direction:column;gap:14px;display:flex}.form label{color:var(--black);flex-direction:column;gap:6px;font-size:14px;font-weight:600;display:flex}.form input,.form select{border:1px solid var(--gray);background:var(--white);min-height:44px;color:var(--text);border-radius:10px;padding:12px}.demo-box{border:2px dashed var(--gray-dark);background:var(--gray-light);border-radius:12px;margin-top:22px;padding:14px;font-size:14px}.demo-box p{margin:0 0 10px}.demo-buttons{gap:10px;display:flex}.demo-buttons .btn{flex:1}.app{min-height:100dvh;padding-bottom:calc(70px + var(--safe-bottom))}.app-header{z-index:5;padding:calc(10px + var(--safe-top)) 14px 10px;background:var(--black);color:var(--white);border-bottom:4px solid var(--brick);justify-content:space-between;align-items:center;display:flex;position:sticky;top:0}.brand{align-items:center;gap:10px;display:flex}.brand img{width:auto;height:42px;display:block}.brand-name{font-weight:800}.brand-user{opacity:.85;font-size:12px}.screen{flex-direction:column;gap:10px;padding:14px;display:flex}.screen-head{justify-content:space-between;align-items:center;display:flex}.screen-head h2{color:var(--black);font-size:22px}.stage{background:var(--white);border:1px solid var(--border);border-left:5px solid var(--gray-dark);border-radius:12px;overflow:hidden}.stage-lead,.stage-callback,.stage-bid_sent{border-left-color:var(--brick)}.stage-finished{border-left-color:#2e7d32}.stage-lost{border-left-color:var(--gray)}.stage-head{width:100%;color:var(--black);background:0 0;border:0;justify-content:space-between;align-items:center;min-height:44px;padding:12px 14px;font-weight:700;display:flex}.count{background:var(--black);color:var(--white);border-radius:999px;padding:2px 9px;font-size:13px}.job-list{flex-direction:column;gap:8px;margin:0;padding:0 10px 10px;list-style:none;display:flex}.job-card{border:1px solid var(--border);border-radius:10px;flex-direction:column;gap:4px;padding:10px 12px;display:flex}.job-top{justify-content:space-between;align-items:center;gap:8px;display:flex}.empty{color:var(--muted);padding:4px 4px 2px;font-size:14px}.address{color:var(--brick);font-size:14px;font-weight:600;text-decoration:none}.lost{color:var(--muted);font-size:13px;font-style:italic}.chip{text-transform:uppercase;color:var(--text);background:#eee;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:700}.chip-facebook{color:#2d4aa8;background:#e3e8fa}.chip-phone{color:var(--brick-dark);background:#f8e3e4}.chip-referral{color:#2e7d32;background:#e6f4ea}.admin-list{flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;display:flex}.admin-list li{flex-direction:column;gap:4px;display:flex}.bottom-nav{background:var(--white);border-top:1px solid var(--border);padding-bottom:var(--safe-bottom);z-index:10;display:flex;position:fixed;bottom:0;left:0;right:0}.bottom-nav button{color:var(--muted);background:0 0;border:0;border-top:3px solid #0000;flex-direction:column;flex:1;align-items:center;gap:2px;min-height:56px;padding:8px 0 10px;font-size:12px;font-weight:600;display:flex}.bottom-nav button.active{color:var(--brick);border-top-color:var(--brick)}.nav-icon{font-size:20px}.crew-list{flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;display:flex}.crew-card{border-left:5px solid var(--brick);flex-direction:column;gap:10px;display:flex}.crew-card.crew-off{border-left-color:var(--gray);background:var(--gray-light)}.crew-card.crew-off .crew-name strong{color:var(--muted)}.crew-top{justify-content:space-between;align-items:flex-start;gap:8px;display:flex}.crew-name{flex-direction:column;gap:2px;min-width:0;display:flex}.crew-email{overflow-wrap:anywhere}.crew-chips{flex-wrap:wrap;justify-content:flex-end;gap:4px;display:flex}.chip-admin{background:var(--black);color:var(--white)}.chip-worker{background:var(--gray-light);color:var(--black);border:1px solid var(--gray)}.chip-owner{background:var(--brick);color:var(--white)}.chip-off{background:var(--gray-dark);color:var(--white)}.crew-actions{align-items:center;gap:8px;display:flex}.crew-actions .btn{flex:1}.crew-note{text-align:center;flex:1;font-size:13px}.crew-form{gap:12px}.role-picker{gap:8px;display:flex}.role-picker .btn{flex:1}.crew-flash{color:#1b5e20;background:#e6f4ea;border-radius:10px;margin:0;padding:10px 12px;font-size:14px;font-weight:600}.crew-demo{margin:0;font-style:italic}.crew-intro{margin:0}.view-toggle{background:var(--gray-light);border:1px solid var(--gray);border-radius:12px;gap:3px;padding:3px;display:flex}.view-toggle button{min-height:44px;color:var(--black);background:0 0;border:0;border-radius:9px;flex:1;font-size:15px;font-weight:700}.view-toggle button.on{background:var(--black);color:var(--white)}.map-filters{scrollbar-width:none;-webkit-overflow-scrolling:touch;flex-wrap:nowrap;gap:6px;margin:0 -14px;padding:2px 14px;display:flex;overflow-x:auto}.map-filters::-webkit-scrollbar{display:none}.filter-chip{border:1.5px solid var(--gray);background:var(--white);min-height:44px;color:var(--gray-dark);white-space:nowrap;border-radius:999px;flex:none;align-items:center;gap:6px;padding:0 12px;font-size:13px;font-weight:600;display:inline-flex}.filter-chip.on{border-color:var(--black);color:var(--black);background:var(--white);box-shadow:inset 0 0 0 1px var(--black)}.filter-chip:not(.on) .dot{opacity:.35}.dot{border:2px solid var(--white);width:12px;height:12px;box-shadow:0 0 0 1px var(--gray-dark);border-radius:50%;display:inline-block}.jobs-map{border:1px solid var(--gray);z-index:0;background:var(--gray-light);border-radius:12px;height:calc(100dvh - 390px);min-height:300px;overflow:hidden}.map-loading{color:var(--muted);place-items:center;display:grid}.map-count{margin:0}.map-error{color:var(--brick-dark);background:#f8e3e4;border-radius:10px;margin:0;padding:10px 12px;font-size:14px;font-weight:600}.unplaced h3{color:var(--black);margin:0 0 8px;font-size:16px}.unplaced{border-left:5px solid var(--gray-dark)}.unplaced-list{padding:0}.unplaced-actions{gap:8px;margin-top:4px;display:flex}.unplaced-actions .btn{flex:1;padding:10px 8px;font-size:14px}.job-highlight{outline:3px solid var(--brick);outline-offset:1px}.pin-wrap{background:0 0;border:0}.pin{border:3px solid var(--white);border-radius:50% 50% 50% 0;width:26px;height:26px;margin:2px;display:block;transform:rotate(-45deg);box-shadow:0 1px 4px #00000073}.pin-bg-lead{background:var(--brick)}.pin-bg-callback{background:var(--brick-light)}.pin-bg-bid_sent{background:var(--brick-dark)}.pin-bg-contracted{background:var(--black)}.pin-bg-scheduled{background:#444}.pin-bg-in_progress{background:var(--gray-dark)}.pin-bg-finished{background:var(--gray)}.pin-bg-lost{background:#d9d7d8}.map-pop{color:var(--text);flex-direction:column;gap:4px;font-size:14px;display:flex}.map-pop-title{color:var(--black);font-size:16px}.map-pop-line{color:var(--muted)}.map-pop-stage{color:var(--white);text-transform:uppercase;border-radius:999px;align-self:flex-start;padding:3px 9px;font-size:11px;font-weight:700}.map-pop-stage.pin-bg-finished,.map-pop-stage.pin-bg-lost{color:var(--black)}.map-pop-actions{gap:6px;margin-top:6px;display:flex}.map-pop-actions .btn{text-align:center;flex:1;justify-content:center;align-items:center;padding:10px 6px;font-size:14px;text-decoration:none;display:inline-flex}.leaflet-popup-content{margin:12px 14px}.leaflet-container a.btn-primary{color:var(--white)}.leaflet-touch .leaflet-bar a{width:44px;height:44px;line-height:44px}.splash{z-index:9999;pointer-events:none;background:radial-gradient(circle at 50% 42%, var(--white) 0%, var(--gray-light) 70%);flex-direction:column;justify-content:center;align-items:center;gap:22px;animation:4s ease-in-out forwards splash-out;display:flex;position:fixed;inset:0}.splash-logo{width:min(56vw,240px);height:auto;animation:4s cubic-bezier(.2,.8,.2,1) forwards splash-logo}.splash-bar{background:var(--brick);transform-origin:0;border-radius:2px;width:min(40vw,160px);height:4px;animation:4s cubic-bezier(.4,0,.2,1) forwards splash-bar}@keyframes splash-logo{0%{opacity:0;transform:translateY(14px)scale(.94)}30%,to{opacity:1;transform:none}}@keyframes splash-bar{0%,20%{transform:scaleX(0)}60%,to{transform:scaleX(1)}}@keyframes splash-out{0%,70%{opacity:1}to{opacity:0;visibility:hidden}}@media (prefers-reduced-motion:reduce){.splash,.splash-logo,.splash-bar{animation:none}.splash{animation:.45s linear forwards splash-fade}}@keyframes splash-fade{0%,50%{opacity:1}to{opacity:0}}.btn-link{color:var(--brick);background:0 0;border:0;min-height:44px;padding:10px 4px;font-size:16px;font-weight:700}.btn-link.small{padding:8px 6px;font-size:14px}.btn-link.danger{color:var(--brick-dark)}.btn-danger{background:var(--white);color:var(--brick-dark);border:2px solid var(--brick)}.btn-link-inline{text-align:left;color:inherit;background:0 0;border:0;padding:0}.small{font-size:13px}.sr-only{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.form textarea,.form-group select{border:1px solid var(--gray);background:var(--white);color:var(--text);border-radius:10px;width:100%;min-height:44px;padding:12px}.form textarea{resize:vertical;line-height:1.4}.form input:focus,.form textarea:focus,.form select:focus{outline:2px solid var(--brick);outline-offset:1px;border-color:var(--brick)}.form-group{border:1px solid var(--border);flex-direction:column;gap:12px;min-width:0;margin:0;display:flex}.form-group legend{color:var(--black);padding:0 6px;font-size:15px;font-weight:800}.row-2{grid-template-columns:1fr 1fr;gap:10px;display:grid}.row-2>label,.row-3>label{min-width:0}.row-2 input,.row-3 input,.row-2 select{width:100%;min-width:0}.row-3{grid-template-columns:1fr 64px 92px;gap:8px;display:grid}.seg{background:var(--gray-light);border:1px solid var(--gray);border-radius:12px;grid-template-columns:repeat(4,1fr);gap:4px;padding:3px;display:grid}.seg button{min-height:44px;color:var(--black);background:0 0;border:0;border-radius:9px;padding:0 2px;font-size:14px;font-weight:700}.seg button.on{background:var(--brick);color:var(--white)}.form-error{color:var(--brick-dark);background:#f8e3e4;border-radius:10px;margin:0;padding:10px 12px;font-size:14px;font-weight:600}.error-box{justify-content:space-between;align-items:center;gap:8px;display:flex}.ok-flash{color:#1b5e20;background:#e6f4ea;border-radius:10px;margin:0;padding:10px 12px;font-size:14px;font-weight:600}.sticky-actions{bottom:calc(64px + var(--safe-bottom));background:linear-gradient(to top, var(--bg) 75%, transparent);z-index:4;grid-template-columns:1fr 2fr;gap:10px;padding:12px 0 6px;display:grid;position:sticky}.two-btn{grid-template-columns:1fr 1fr;gap:8px;display:grid}.two-btn .btn{text-align:center;justify-content:center;align-items:center;text-decoration:none;display:inline-flex}.detail-bar{justify-content:space-between;align-items:center;margin:-6px 0 -4px;display:flex}.job-summary{border-left:5px solid var(--gray-dark);flex-direction:column;gap:10px;display:flex}.stage-edge-lead,.stage-edge-callback,.stage-edge-bid_sent{border-left-color:var(--brick)}.stage-edge-contracted,.stage-edge-scheduled{border-left-color:var(--black)}.stage-edge-finished{border-left-color:#2e7d32}.stage-edge-lost{border-left-color:var(--gray)}.job-title{color:var(--black);font-size:21px;line-height:1.2}.job-summary .job-top{align-items:flex-start}.job-summary .map-pop-stage{flex:none;margin-top:3px}.contact-line{justify-content:space-between;align-items:center;gap:8px;font-weight:600;display:flex}.address.big{font-size:16px}.unplaced-inline{border-top:1px dashed var(--border);flex-direction:column;gap:6px;padding-top:4px;display:flex}.detail-section{flex-direction:column;gap:10px;display:flex}.detail-section h3{color:var(--black);align-items:center;gap:8px;margin:0;font-size:17px;display:flex}.stage-grid{grid-template-columns:1fr 1fr;gap:8px;display:grid}.stage-btn{border:1.5px solid var(--gray);background:var(--white);min-height:48px;color:var(--black);text-align:left;border-radius:10px;align-items:center;gap:8px;padding:0 12px;font-size:15px;font-weight:700;display:flex}.stage-btn.current{background:var(--black);color:var(--white);border-color:var(--black)}.stage-btn:disabled:not(.current){opacity:.4}.stage-btn.current:disabled{opacity:1}.stage-btn.lost-btn:not(.current){border-style:dashed}.lost-form{padding-top:4px}.detail-list{grid-template-columns:1fr 1fr;gap:8px 12px;margin:0;display:grid}.detail-list div{min-width:0}.detail-list dt{text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-size:12px;font-weight:700}.detail-list dd{overflow-wrap:anywhere;margin:2px 0 0;font-weight:600}.scope{white-space:pre-wrap;background:var(--gray-light);border-radius:10px;margin:0;padding:10px;line-height:1.45}.plain-list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.history li{border-bottom:1px solid var(--gray-light);flex-direction:column;gap:1px;padding-bottom:8px;display:flex}.history li:last-child{border-bottom:0;padding-bottom:0}.fu-row{background:var(--gray-light);border-radius:10px;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;display:flex}.fu-main{flex-direction:column;min-width:0;display:flex}.fu-row.fu-overdue{background:#f8e3e4}.fu-row.fu-overdue strong{color:var(--brick-dark)}.fu-row.fu-today{background:#fff3d6}.chip-row{flex-wrap:wrap;gap:6px;display:flex}.chip-row .filter-chip.on{background:var(--black);color:var(--white)}.admin-divider{color:var(--brick-dark);align-items:center;gap:8px;margin:6px 0 -2px;font-size:13px;font-weight:700;display:flex}.admin-divider:before,.admin-divider:after{content:"";background:var(--brick);opacity:.35;flex:1;height:2px}.admin-section{border:1px solid var(--brick);border-top:4px solid var(--brick)}.lock-badge{text-transform:uppercase;background:var(--brick);color:var(--white);border-radius:999px;padding:2px 8px;font-size:11px;font-weight:800}.mat-list{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.mat-list>li{border-bottom:1px solid var(--gray-light);padding:10px 0}.mat-list>li:first-child{padding-top:0}.mat-row{grid-template-columns:minmax(64px,auto) 1fr auto;align-items:center;column-gap:10px;display:grid}.mat-main{flex-direction:column;min-width:0;display:flex}.mat-qty{color:var(--brick);white-space:nowrap;font-weight:800}.mat-name{overflow-wrap:anywhere}.mat-edit{min-width:64px}.mat-form{background:var(--gray-light);border-radius:10px;padding:10px}.note-list{flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;display:flex}.note{background:var(--gray-light);border-left:3px solid var(--brick);border-radius:10px;padding:10px}.note-body{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0 0;line-height:1.45}.note-actions{justify-content:flex-end;gap:4px;margin-bottom:-6px;display:flex}.job-card{gap:0;padding:0;overflow:hidden}.job-open{text-align:left;width:100%;color:inherit;background:0 0;border:0;flex-direction:column;gap:4px;min-height:44px;padding:10px 34px 6px 12px;display:flex;position:relative}.job-open:active{background:var(--gray-light)}.job-open .job-top{width:100%}.chev{color:var(--gray-dark);font-size:26px;position:absolute;top:50%;right:12px;transform:translateY(-50%)}.job-card>.address{padding:2px 12px 10px;display:block}.job-meta{color:var(--muted);flex-wrap:wrap;gap:4px 10px;font-size:13px;display:flex}.job-meta:empty{display:none}.fu-chip{color:var(--black);font-weight:700}.fu-chip.fu-overdue{color:var(--brick-dark)}.due-banner{background:#fff3d6;border:1px solid #e8c35c;border-left:5px solid #d39b00;border-radius:12px;padding:10px 12px}.due-banner ul{flex-direction:column;gap:2px;margin:6px 0 0;padding:0;list-style:none;display:flex}.due-link{text-align:left;color:var(--black);background:0 0;border:0;min-height:36px;padding:8px 0;font-size:14px;text-decoration:underline}.empty-state{text-align:center;flex-direction:column;gap:4px;padding:24px 14px;display:flex}.skeleton{flex-direction:column;gap:10px;display:flex}.sk{background:linear-gradient(90deg, var(--gray-light), #f7f6f6, var(--gray-light));background-size:200% 100%;border-radius:6px;height:14px;animation:1.2s linear infinite sk}.sk-title{width:60%;height:20px}.sk-short{width:40%}@keyframes sk{to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.sk{animation:none}}.field{flex-direction:column;gap:6px;display:flex}.field-label{color:var(--black);font-size:14px;font-weight:600}a.btn{justify-content:center;align-items:center;text-decoration:none;display:inline-flex}.fu-row .btn{white-space:nowrap;flex:none}.list-head{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:6px 0 0;font-size:14px}.admin-ready{border-left:5px solid #2e7d32}.admin-soon{border-left:5px solid var(--gray);opacity:.85}
