*{box-sizing:border-box} body{margin:0;font:14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#1f2937;background:#f8fafc}
#test-banner{background:repeating-linear-gradient(45deg,#fde047,#fde047 12px,#facc15 12px,#facc15 24px);color:#111;font-weight:800;text-align:center;padding:6px;letter-spacing:.04em;position:sticky;top:0;z-index:50}
#topbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:8px 12px;background:#fff;border-bottom:1px solid #e5e7eb;position:sticky;top:31px;z-index:40}
.brand{font-weight:700}.tag{background:#fef3c7;color:#92400e;border-radius:4px;padding:1px 6px;font-size:11px}
#nav a{margin-right:4px;padding:6px 9px;border-radius:6px;text-decoration:none;color:#374151}#nav a.on{background:#1f2937;color:#fff}
#search{flex:1;min-width:200px;padding:7px 9px;border:1px solid #cbd5e1;border-radius:6px}
.pill{border:0;border-radius:999px;padding:6px 12px;font-weight:600;cursor:pointer}
.st-synced{background:#dcfce7;color:#166534}.st-pending{background:#fef9c3;color:#854d0e}.st-failed{background:#fee2e2;color:#991b1b}.st-offline{background:#e0e7ff;color:#3730a3}.st-conflict{background:#fde68a;color:#7c2d12}
.who{font-size:12px} select,input,textarea{font:inherit} .small{font-size:12px;padding:3px 7px}
button{cursor:pointer;border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:6px 10px} button.primary{background:#1d4ed8;color:#fff;border-color:#1d4ed8} button.danger{background:#fff1f2;color:#9f1239;border-color:#fecdd3} button.ghost{background:transparent}
button:disabled{opacity:.5;cursor:not-allowed}
#notice:empty{display:none}#notice{padding:8px 12px;background:#fff7ed;border-bottom:1px solid #fed7aa}
main{padding:12px}
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.grid-wrap{overflow:auto;border:1px solid #e5e7eb;background:#fff;max-height:calc(100vh - 210px)}
.day{display:grid;position:relative}
.colhead{position:sticky;top:0;background:#f1f5f9;border-bottom:1px solid #cbd5e1;border-left:1px solid #e5e7eb;padding:4px 6px;font-size:12px;z-index:5;min-height:58px}
.colhead b{display:block;font-size:13px}.ovr{color:#b45309;font-weight:600}
.colhead select{display:block;width:100%;box-sizing:border-box;margin:0 0 3px;padding:3px 4px;border:1px solid #cbd5e1;border-radius:5px;background:#fff;font-size:12.5px;min-height:28px}
.colhead .hd-crane{font-weight:700;font-size:13px}.colhead .hd-op.ovr-sel{border-color:#d97706;background:#fffbeb;color:#92400e;font-weight:600}
.colhead .hd-note{display:block;font-size:11px;margin:-1px 0 3px}.colhead .hd-route{display:block;text-align:center;margin-top:2px;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.colhead .eq-badge{margin:0 0 3px}
.timecol .slot{font-size:11px;color:#64748b;text-align:right;padding-right:4px;border-bottom:1px solid #f1f5f9}
.timecol .slot.hour{color:#111;font-weight:600}
.col{position:relative;border-left:1px solid #e5e7eb}
.col .slot{border-bottom:1px dashed #eef2f7}.col .slot.hour{border-bottom:1px solid #e2e8f0}.slot.after{background:#fafaf9}
.appt{position:absolute;left:3px;right:3px;background:#dbeafe;border:1px solid #60a5fa;border-radius:5px;padding:2px 5px;font-size:11.5px;overflow:hidden;cursor:pointer;z-index:2}
.appt.confirmed{background:#dcfce7;border-color:#4ade80}.appt.completed{background:#e5e7eb;border-color:#9ca3af}.appt.inactive{background:#f3f4f6;border-style:dotted;opacity:.7}
.appt.pending{background:#fff;border:2px dashed #f59e0b}.appt.warn{box-shadow:0 0 0 2px #ef4444}
.travel{position:absolute;left:12px;right:12px;background:repeating-linear-gradient(135deg,#f1f5f9,#f1f5f9 4px,#e2e8f0 4px,#e2e8f0 8px);border-radius:3px;font-size:10px;color:#475569;text-align:center;z-index:1;pointer-events:none}
.badge{display:inline-block;padding:0 5px;border-radius:4px;font-size:10.5px;font-weight:700;background:#e5e7eb;margin-right:3px}
.b-warn{background:#fee2e2;color:#991b1b}.b-pend{background:#fef3c7;color:#92400e}.b-sim{background:#ede9fe;color:#5b21b6}.b-nb{background:#fee2e2;color:#7f1d1d}.b-ok{background:#dcfce7;color:#166534}
table.list{border-collapse:collapse;width:100%;background:#fff}table.list th,table.list td{border-bottom:1px solid #e5e7eb;padding:6px 8px;text-align:left;vertical-align:top}table.list tr.click{cursor:pointer}table.list tr.click:hover{background:#f8fafc}
.week td{min-width:130px;height:70px}.week .wi{background:#dbeafe;border-radius:4px;margin:2px 0;padding:2px 4px;font-size:11px;cursor:pointer}.week .wi.pending{border:2px dashed #f59e0b;background:#fff}
#editor{position:fixed;top:0;right:0;bottom:0;width:min(760px,100%);background:#fff;box-shadow:-4px 0 20px rgba(0,0,0,.15);z-index:60;overflow:auto;padding:0 16px 40px}
.ed-head{position:sticky;top:0;background:#fff;padding:10px 0;border-bottom:1px solid #e5e7eb;display:flex;gap:8px;align-items:center;flex-wrap:wrap;z-index:3}
.ed-head h2{margin:0;font-size:17px;flex:1}
fieldset{border:1px solid #e5e7eb;border-radius:8px;margin:10px 0;padding:8px 10px}legend{font-weight:700;font-size:13px}
.fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px}
.fields label{display:flex;flex-direction:column;font-size:12px;color:#475569}.fields label.wide{grid-column:1/-1}
.fields input,.fields select,.fields textarea{padding:6px;border:1px solid #cbd5e1;border-radius:5px;color:#111}
.fields label.chk{flex-direction:row;gap:6px;align-items:center}
.req::after{content:" *";color:#dc2626}
.draftline{font-size:12px;color:#475569}
.box{border:1px solid #e5e7eb;border-radius:8px;padding:8px 10px;margin:8px 0;background:#f8fafc}
.cols2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hist .ev{border-bottom:1px solid #eef2f7;padding:6px 0;font-size:12.5px}.hist .meta{color:#64748b;font-size:11.5px}
.chg td{background:#fef9c3;font-weight:600}
#dialog-wrap{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;z-index:100}
#dialog{background:#fff;border-radius:10px;max-width:640px;width:94%;padding:16px 18px;max-height:90vh;overflow:auto}
#dialog h2{margin:0 0 10px;font-size:18px}#dialog-buttons{display:flex;gap:8px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap}
#dialog table{border-collapse:collapse;width:100%}#dialog td,#dialog th{border:1px solid #e5e7eb;padding:5px 8px;text-align:left}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:12px;margin-bottom:10px}
.job-card .big{font-size:18px;font-weight:700}.btn-complete{font-size:18px;padding:14px;width:100%;margin-top:8px;background:#16a34a;color:#fff;border:0}
.nb{border-left:4px solid #dc2626}.sim{border-left:4px solid #7c3aed}
pre.tpl{white-space:pre-wrap;background:#f8fafc;border:1px solid #e5e7eb;padding:8px;border-radius:6px}
.muted{color:#64748b}.warnline{color:#b91c1c;font-weight:600}
@media (max-width:700px){#topbar{top:52px}.cols2{grid-template-columns:1fr}.colhead select,.colhead .hd-crane{font-size:16px;min-height:34px}.colhead .hd-route{padding:6px 4px}}
[hidden]{display:none !important}
a.button,label.button{display:inline-block;border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:6px 10px;text-decoration:none;color:#1f2937;cursor:pointer;margin:2px 0}
a.button.primary,label.button.primary{background:#1d4ed8;color:#fff;border-color:#1d4ed8}a.button.small,label.button.small{font-size:12px;padding:3px 7px}
.colhead.eq-block{background:#fee2e2}.colhead.eq-warn{background:#fef3c7}.eq-badge{display:inline-block;margin-top:2px}
.col.col-out_of_service{background:repeating-linear-gradient(135deg,#fff1f2,#fff1f2 8px,#fee2e2 8px,#fee2e2 16px)}.col.col-in_shop{background:#fffbeb}
td.col-out_of_service{background:#fff1f2}td.col-in_shop{background:#fffbeb}
.att{display:flex;gap:10px;align-items:center;border-bottom:1px solid #eef2f7;padding:6px 0}.att.archived{opacity:.6}.att-main{flex:1}.att .meta{color:#64748b;font-size:11.5px}
.thumb{width:48px;height:48px;object-fit:cover;border-radius:4px;border:1px solid #e5e7eb}.fileicon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;background:#eef2ff;color:#3730a3;font-weight:700;font-size:11px;border-radius:4px}
.screen.lv-nochart,.screen.lv-beyond{border-left:4px solid #f59e0b}.screen.lv-within{border-left:4px solid #16a34a}.screen.lv-exceeds{border-left:4px solid #dc2626}.screen.lv-incomplete{border-left:4px solid #94a3b8}
#screen-result{font-weight:700;margin:4px 0}.lv-exceeds{color:#b91c1c}.lv-within{color:#166534}.lv-nochart,.lv-beyond{color:#92400e}
.box.ok{border-left:4px solid #16a34a;background:#f0fdf4}.box.bad{border-left:4px solid #dc2626;background:#fef2f2}
tr.tot th{border-top:2px solid #cbd5e1}.op-att{margin-top:6px;font-size:13px}
h4{margin:6px 0}
#attachments .toolbar select{width:auto}#attachments .toolbar input{width:260px}
/* Oct 28: Drive links */
.fileicon.drive{background:#e8f5e9;color:#1b5e20}.drive-form{flex-wrap:wrap;align-items:flex-end}.drive-form label{display:flex;flex-direction:column;font-size:12px}.drive-form .grow{flex:1;min-width:260px}.drive-form .grow input{width:100%}
.auth-card { max-width: 420px; margin: 40px auto; }
.auth-card label { display: block; margin: 10px 0; }
.auth-card input { width: 100%; font-size: 16px; padding: 8px; box-sizing: border-box; }
#users-table input, #users-table select { font-size: 14px; }
body.hosted #topbar{top:0}

.travel.drive{background:repeating-linear-gradient(135deg,#eff6ff,#eff6ff 4px,#dbeafe 4px,#dbeafe 8px);color:#1e3a8a;overflow:hidden;white-space:nowrap;line-height:12px}.travel.drive-manual{background:repeating-linear-gradient(135deg,#f8fafc,#f8fafc 4px,#e2e8f0 4px,#e2e8f0 8px);color:#334155}.travel.drive-short{background:#fee2e2;color:#991b1b;box-shadow:0 0 0 1px #ef4444}.drive-note{font-size:12px;margin:2px 0 6px}
.drive-attr{display:block;font-size:11px;margin-top:2px}.drive-attr a{color:inherit}
