*{box-sizing:border-box}html,body{overflow-x:clip}body{font-family:'Barlow',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;margin:0;background:#faf8fc;color:#241a2e}
h1,h2,h3{font-family:'Barlow Condensed','Arial Narrow','Helvetica Neue',system-ui,sans-serif;font-weight:600;letter-spacing:.01em;line-height:1.1}
header{background:linear-gradient(180deg,#5b21b6,#4c1d95);color:#fff;padding:14px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
header h1{font-size:26px;margin:0;letter-spacing:.02em}
header p{margin:2px 0 0;color:#e9d5ff;font-size:13px}
main{max-width:1100px;margin:0 auto;padding:16px;padding-bottom:96px}
.card{background:#fff;border:1px solid #e6def0;border-radius:10px;padding:16px;margin:0 0 14px;box-shadow:0 1px 3px rgba(91,33,182,.08)}
#gate,#mustChange{max-width:480px;margin:24px auto;padding:0 16px}
#gate .card{border-top:4px solid #5b21b6}
label{display:block;margin:12px 0 4px;font-weight:600}
input,select,textarea{width:100%;min-width:0;max-width:100%;padding:10px;border:1px solid #d8cfee;border-radius:8px;font:inherit;background:#fff;color:inherit}
input:focus,select:focus,textarea:focus{outline:2px solid #c4b5fd;outline-offset:0;border-color:#5b21b6}
button{background:#f3eff8;border:0;padding:10px 14px;border-radius:10px;font-weight:600;cursor:pointer;max-width:100%;color:#3b2a52}
button:hover{background:#e9defa}
button.primary{background:#5b21b6;color:#fff}
button.primary:hover{background:#4c1d95}
button.danger{background:#b91c1c;color:#fff}
.danger-zone{margin-top:36px;padding-top:20px;border-top:2px solid #fee2e2}
.danger-zone h3{margin:0 0 6px;font-size:14px;color:#7f1d1d}
button.danger-quiet{background:#fff;color:#b91c1c;border:1px solid #fca5a5}
button.small{padding:6px 10px;font-size:13px}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:5;display:flex;gap:4px;justify-content:space-around;align-items:stretch;background:#fff;border-top:1px solid #e6def0;box-shadow:0 -2px 12px rgba(91,33,182,.10);padding:6px 6px calc(6px + env(safe-area-inset-bottom));max-width:none;margin:0}
.tabs button{flex:1 1 0;display:flex;flex-direction:column;align-items:center;gap:2px;background:transparent;border-radius:10px;padding:6px 2px;font-family:'Barlow Condensed','Arial Narrow',system-ui,sans-serif;font-size:15px;letter-spacing:.03em;color:#5b4a6e;min-width:0}
.tabs button .tab-icon{font-size:20px;line-height:1}
.tabs button .tab-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.tabs button.on{background:#f3eff8;color:#5b21b6;box-shadow:inset 0 0 0 1px #ddd0f5}
.muted{color:#6b5f7a;font-size:13px}
.empty{background:#f3eff8;border:1px dashed #d8cfee;border-radius:10px;padding:12px;color:#5b4a6e;font-size:14px}
.err{background:#fee2e2;border:1px solid #fca5a5;padding:10px;border-radius:8px;margin:8px 0;color:#7f1d1d}
.warn{background:#fef3c7;border:1px solid #fde68a;padding:10px;border-radius:8px;margin:8px 0;color:#713f12}
.ok{background:#dcfce7;border:1px solid #a7f3d0;padding:10px;border-radius:8px;margin:8px 0;color:#14532d}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}
.grid>*,.cols>*{min-width:0}
.card{min-width:0;overflow-wrap:break-word}
.col{background:#f3eff8;border:1px solid #e6def0;border-radius:10px;padding:10px;min-height:80px;min-width:0;overflow-wrap:break-word}
.col h3{margin:0 0 8px;font-size:20px}
.dispatch-hero{border-top:4px solid #5b21b6}
.dispatch-hero h2{font-size:38px;margin:0}
.day-pills{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.day-pills button{border-radius:999px;padding:8px 12px;font-family:'Barlow Condensed','Arial Narrow',system-ui,sans-serif;font-size:16px}
.day-pills button.on{background:#5b21b6;color:#fff}
.job{border:1px solid #e6def0;border-left:4px solid #c4b5fd;border-radius:10px;padding:10px;margin:0 0 8px;background:#fff;cursor:pointer}
.job.status-booked{border-left-color:#d97706}
.job.status-in-progress{border-left-color:#2563eb}
.job.status-done{border-left-color:#16a34a}
.job.status-cancelled{border-left-color:#dc2626}
.job .meta{color:#6b5f7a;font-size:13px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;min-width:0}
.row>*{margin:0;min-width:0}
.spacer{height:10px}
table{width:100%;border-collapse:collapse}
td,th{padding:8px 6px;border-bottom:1px solid #e6def0;text-align:left;font-size:14px}
.num{text-align:right}
.tot{font-size:19px;font-weight:700}
#sheetWrap{position:fixed;inset:0;background:rgba(36,26,46,.45);display:flex;align-items:flex-start;justify-content:center;overflow:auto;z-index:10}
#sheet{background:#fff;border:1px solid #e6def0;border-radius:10px;max-width:640px;width:calc(100% - 24px);margin:24px 12px;padding:18px;min-width:0;overflow-wrap:break-word;overflow-x:clip}
#sheet>*{min-width:0;max-width:100%}
.job-datetime{display:block;width:100%;min-width:0;max-width:100%;margin:0}
.job-datetime label{margin:12px 0 4px}
.job-datetime input{width:100%;min-width:0;max-width:100%}
input[type=date],input[type=time]{width:100%;min-width:0;max-width:100%;padding-left:8px;padding-right:8px}
input[type=date]::-webkit-datetime-edit,input[type=time]::-webkit-datetime-edit{min-width:0;max-width:100%;overflow:hidden}
input[type=date]::-webkit-datetime-edit-fields-wrapper,input[type=time]::-webkit-datetime-edit-fields-wrapper{min-width:0;max-width:100%}
#sheet a{overflow-wrap:anywhere}
canvas.sig{border:1px solid #d8cfee;border-radius:8px;width:100%;max-width:100%;height:160px;touch-action:none;background:#fff}
img.thumb{max-width:120px;border-radius:8px;display:block;margin:6px 0}
.badge{display:inline-block;background:#ede9fe;color:#5b21b6;border-radius:999px;padding:2px 8px;font-size:12px;font-weight:700}
.badge.status-paid,.badge.status-done{background:#dcfce7;color:#14532d}
.badge.status-unpaid,.badge.status-cancelled{background:#fee2e2;color:#7f1d1d}
.badge.status-draft,.badge.status-booked{background:#fef3c7;color:#713f12}
.badge.status-in-progress{background:#dbeafe;color:#1e40af}
.badge.status-sent{background:#ccfbf1;color:#115e59}
.timer{font-size:26px;font-weight:800;font-family:'Barlow Condensed','Arial Narrow',system-ui,sans-serif}
.card a{overflow-wrap:anywhere}
@media(max-width:640px){main{padding:10px;padding-bottom:96px}.tabs{padding:6px 4px calc(6px + env(safe-area-inset-bottom))}.tabs button{font-size:13px}.tabs button .tab-icon{font-size:18px}#sheet{margin:16px 8px;width:calc(100% - 16px);padding:14px}#sheet .row>input:not([type=checkbox]):not([type=file]),#sheet .row>select,#sheet .row>textarea{flex:1 1 0;min-width:0}#dfItems .row{flex-direction:column;align-items:stretch}#sheet #dfItems .row input{flex:none;width:100%}.photo-row{flex-direction:column;align-items:stretch}.photo-row>*{width:100%}#custSearch,#priceSearch{flex:1 1 140px;min-width:0}input[type=date],input[type=time]{min-width:0}}
.sheet-close-bar{position:sticky;top:0;z-index:20;display:flex;justify-content:flex-end;background:#fff;border-bottom:1px solid #e6def0;padding:2px 0 8px;margin:0 0 8px}
#sheetCloseBtn{width:44px;height:44px;min-width:44px;border-radius:999px;background:#fff;border:1px solid #d8cfee;box-shadow:0 1px 4px rgba(0,0,0,.15);font-size:20px;line-height:1;display:flex;align-items:center;justify-content:center;padding:0;flex:none;color:#5b21b6}
#sheetCloseBtn:active{background:#f3eff8}
@media(prefers-color-scheme:dark){
body{background:#17101f;color:#f5f0fa}
header{background:linear-gradient(180deg,#4c1d95,#3b1470)}
.card,#sheet{background:#221730;border-color:#3d2d52;box-shadow:0 1px 3px rgba(0,0,0,.4)}
.col,.empty{background:#2c1f3d;border-color:#3d2d52;color:#d9cdf0}
button{background:#2c1f3d;color:#efe8fa}
button:hover{background:#3d2d52}
button.primary{background:#8b5cf6;color:#fff}
button.primary:hover{background:#6d28d9}
.tabs{background:#221730;border-top-color:#3d2d52}
.tabs button{color:#c4b5d6}
.tabs button.on{background:#2c1f3d;color:#c4b5fd;box-shadow:inset 0 0 0 1px #4c1d95}
.muted{color:#b8a8cc}
.job{background:#221730;border-color:#3d2d52}
input,select,textarea{background:#17101f;border-color:#4a3566;color:#f5f0fa}
.sheet-close-bar{background:#221730;border-bottom-color:#3d2d52}
#sheetCloseBtn{background:#2c1f3d;border-color:#4a3566;color:#e9d5ff}
#sheetCloseBtn:active{background:#3d2d52}
canvas.sig{background:#17101f;border-color:#4a3566}
.err{background:#450a0a;border-color:#7f1d1d;color:#fecaca}
.warn{background:#422006;border-color:#713f12;color:#fde68a}
.ok{background:#052e16;border-color:#14532d;color:#bbf7d0}
.badge{background:#3d2d52;color:#ddd0f5}
.badge.status-paid,.badge.status-done{background:#052e16;color:#bbf7d0}
.badge.status-unpaid,.badge.status-cancelled{background:#450a0a;color:#fecaca}
.badge.status-draft,.badge.status-booked{background:#422006;color:#fde68a}
.badge.status-in-progress{background:#172554;color:#bfdbfe}
.badge.status-sent{background:#134e4a;color:#99f6e4}
}
