:root{font-family:Arial,sans-serif;color:#182f3b;background:#f3f4f1;font-size:14px;--gold:#ffc000;--blue:#00b0f0;--line:#c4ccd1}*{box-sizing:border-box}body{margin:0}header{background:#173d48;color:white;padding:20px 4%;display:flex;justify-content:space-between;gap:16px;font-size:12px}header a{color:white}a{color:#21677a;text-decoration:none}main{max-width:1450px;margin:24px auto;padding:0 24px}nav{display:flex;gap:26px;margin:0 0 22px;padding:14px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}nav .active{font-weight:bold}.routing{display:flex;gap:8px;flex-direction:column;background:#e8eeeb;border:1px solid #d3dfd9;padding:16px 20px;border-radius:7px;margin-bottom:20px}.routing small{color:#5d6e72}.toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:16px}.toolbar label{font-weight:bold}.toolbar input{margin-left:10px}button{background:#185f6e;color:white;border:0;border-radius:5px;padding:11px 16px;font:inherit;font-weight:bold;cursor:pointer}button.secondary{background:#e7eeee;color:#27535d}button:disabled{opacity:.5;cursor:wait}input,select,textarea{font:inherit;color:#19333f;border:1px solid #c4cdd1;border-radius:4px;padding:9px;background:#fff8e8}input:focus,select:focus,textarea:focus{outline:2px solid #1f7f9b;outline-offset:1px}textarea{width:100%;min-height:68px;resize:vertical;line-height:1.5}input[type=number]{width:100px}label{font-size:13px}#report{background:white;border:1px solid #aebcc4}.brand{background:var(--gold);padding:18px 20px;display:flex;justify-content:space-between;gap:24px;line-height:1.6;font-size:15px}h1{background:var(--blue);margin:0;text-align:center;padding:16px;font-size:23px;font-weight:600}.reportMeta{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 20px;border-bottom:1px solid var(--line)}.reportMeta label{display:flex;align-items:center;gap:14px;flex:0 1 52%}.reportMeta input{flex:1;min-width:100px}.reportSection{margin:24px 0 0;border-top:1px solid var(--line)}.reportSection h2{font-size:14px;font-weight:bold;background:var(--gold);padding:11px 14px;margin:0}.sectionBody{padding:14px}.field{display:grid;grid-template-columns:minmax(180px,25%) 1fr;gap:18px;align-items:start;margin-bottom:12px}.field:last-child{margin-bottom:0}.field label{line-height:1.5;padding:8px 0}.field select{justify-self:start;min-width:180px}.readonly{white-space:pre-wrap;overflow-wrap:anywhere;background:white;border:0;padding:9px;min-height:35px;line-height:1.5}.empty{color:#7b878c;font-style:italic}.scroll{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:12px}th{background:#eaf1f5;text-align:center;padding:11px 8px;border-bottom:1px solid var(--line);white-space:normal;min-width:65px}td{padding:8px;border-bottom:1px solid #dce2e5;vertical-align:middle}td input,td select{width:100%;min-width:80px;font-size:12px;padding:8px}td input[data-key=name]{min-width:170px}td input[data-key=remarks]{min-width:160px}td input[data-key=location]{min-width:230px}td input[data-key=staffId]{max-width:100px;min-width:90px}td input[type=number]{width:85px}td input[type=date]{min-width:135px}td input[type=time]{min-width:115px}.hint{font-size:12px;color:#65777e;line-height:1.6;margin:12px 0 0}.sectionActions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.status{padding:10px 14px;background:#edf3f4;margin:0 0 14px;white-space:pre-wrap;line-height:1.6}.status.warn{background:#fff1d3;color:#7d501d}.tokenGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.tokenGrid label{display:flex;flex-direction:column;gap:8px}.tokenGrid input[type=number]{width:100%}.total{background:#edf3f5;padding:14px;font-size:16px;line-height:1.6}.submitBar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:24px 0}.submitBar span{color:#60737c;font-size:12px}#message{color:#216843;line-height:1.6;padding:4px 0}#message.error{color:#aa352b}#loadState{font-size:12px;color:#687a82}.opening{margin-top:20px;padding:20px;background:white;border:1px solid var(--line);border-radius:6px}.opening summary{cursor:pointer;font-weight:bold;font-size:15px}.opening>p{color:#63747c;line-height:1.6}.pendingPoint{border-top:1px solid #d8dfe2;padding:18px 0}.pendingPoint summary{font-size:13px;line-height:1.5}.pendingControls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px;margin:16px 0}.pendingControls label{display:flex;flex-direction:column;gap:7px}.pendingControls .wide{grid-column:1/-1}.photos{display:flex;gap:15px;flex-wrap:wrap;margin:12px 0}.photos img{max-width:260px;max-height:280px;object-fit:contain}.entry{background:white;padding:18px;border:1px solid var(--line);border-radius:5px;margin:10px 0}.entry p{white-space:pre-wrap;line-height:1.6;color:#5c717b}.entry button{margin:8px 8px 0 0}footer{text-align:center;color:#6b7b82;font-size:12px;padding:24px}.legacy{white-space:pre-wrap;color:#687780;font-size:12px}[hidden]{display:none!important}@media(max-width:760px){header span{display:none}main{padding:0 12px}.brand{font-size:12px;padding:14px}h1{font-size:21px}.reportMeta,.submitBar{flex-direction:column;align-items:stretch;gap:14px}.reportMeta label{flex-direction:column;align-items:stretch;gap:6px}.field{grid-template-columns:1fr;gap:3px}.field label{padding:0}.tokenGrid{grid-template-columns:1fr 1fr}.pendingControls{grid-template-columns:1fr}.sectionBody{padding:10px}.toolbar{gap:9px}.toolbar label{width:100%}}
@media print{@page{size:A4 landscape;margin:10mm}.no-print{display:none!important}body{background:white;font-size:10px}main{max-width:none;margin:0;padding:0}#report{border:0}.brand{padding:8px;font-size:11px;print-color-adjust:exact}h1{font-size:18px;padding:10px;print-color-adjust:exact}.reportMeta{padding:8px;gap:10px}.reportSection{margin-top:12px}.reportSection h2{font-size:11px;padding:7px;print-color-adjust:exact;break-after:avoid}.sectionBody{padding:8px}table{font-size:9px}thead{display:table-header-group}tr{break-inside:avoid}th,td{padding:5px}input,select,textarea{border:0;background:white;padding:2px;font-size:10px}textarea{resize:none;min-height:30px}.field{gap:10px}.readonly{font-size:10px;padding:4px}.status{padding:6px;font-size:10px}.hint{font-size:9px}.empty{font-style:normal}.scroll{overflow:visible}.tokenGrid{grid-template-columns:repeat(3,1fr)}}

.inlineSection{border-top:1px solid var(--line);margin-top:20px;padding-top:8px}.inlineSection h3{font-size:14px;color:#174c5d;margin:10px 0 16px}.inlineSection .hint{margin-bottom:8px}

/* Match the existing Visitor Management and Security Patrolling portal shell. */
@media screen{
:root{font-family:"Segoe UI",Tahoma,sans-serif;color:#18232d;--line:#d7d1c4}
body{padding:14px 24px 32px;background:radial-gradient(circle at left top,rgba(232,245,239,.95),transparent 32%),linear-gradient(180deg,#f8f5ed 0%,#f2efe6 100%)}
.print-only{display:none}
header.hero{max-width:1512px;margin:0 auto 12px;padding:12px 18px;display:grid;grid-template-columns:minmax(240px,.95fr) minmax(360px,1.25fr) minmax(260px,.95fr);gap:8px 18px;align-items:center;background:#fffdf8;border:1px solid var(--line);border-radius:20px;box-shadow:0 10px 28px rgba(20,32,43,.07);color:#18232d}
.brand-lockup{display:flex;justify-content:flex-start}.brand-lockup img{width:min(22vw,260px);max-width:100%;max-height:70px;height:auto;object-fit:contain}
.hero h1.portal-subtitle{background:none;margin:0;padding:0;text-align:center;color:#0f2f5b;font:bold clamp(28px,3.4vw,44px)/1.05 "Times New Roman",Times,serif}
.header-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.hero a,nav a{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#084a3e;text-decoration:none;font-size:12px;font-weight:700}
main{max-width:1512px;margin:auto;padding:0}nav{gap:8px;padding:0;border:0;margin:12px 0}nav a.active{background:#0d6a58;color:white;border-color:#0d6a58}
#report{border:0;background:transparent}.reportMeta,.reportSection,.routing,.opening,.entry{background:#fffdf8;border:1px solid var(--line);border-radius:20px;box-shadow:0 10px 28px rgba(20,32,43,.07)}
.reportSection{margin:12px 0;padding:18px}.reportSection h2{background:none;color:#0f2f5b;font-size:20px;padding:0;margin:0 0 10px}.sectionBody{padding:0}.reportMeta{padding:18px}.routing{background:#e8f3ef}
button{background:#0d6a58;border-radius:9px;min-height:38px}button.secondary{background:#e8f3ef;color:#084a3e}input,select,textarea{background:#fff;border-color:var(--line);border-radius:10px;min-height:38px}input:focus,select:focus,textarea:focus{outline:3px solid rgba(15,108,90,.13);border-color:#0d6a58}th{background:#e8f3ef;color:#084a3e}.inlineSection h3{color:#0f2f5b}.toolbar{padding:8px 0}.field label{font-weight:700}.status{border-radius:10px}
}
@media screen and (max-width:1000px){header.hero{grid-template-columns:1fr;text-align:center}.brand-lockup{justify-content:center}.brand-lockup img{width:min(100%,300px);max-height:86px}.header-actions{justify-content:center}.hero h1.portal-subtitle{font-size:32px}}
@media screen and (max-width:600px){body{padding:12px}.hero h1.portal-subtitle{font-size:28px}.reportSection{padding:14px}}
@media print{.report-title{text-align:center;background:#00b0f0;font-size:18px;padding:10px;margin:0;print-color-adjust:exact}}

.routing{min-width:0;overflow-wrap:anywhere}
#patrolConsolidation{min-width:0;margin:16px 0;padding:18px;background:#fffdf8;border:1px solid var(--line);border-radius:20px;box-shadow:0 10px 28px rgba(20,32,43,.07)}
#patrolConsolidation h2,#patrolConsolidation h3{color:#0f2f5b}
#patrolConsolidation>p{line-height:1.6;color:#5d6e72}
#patrolTables>div{max-width:100%;margin-bottom:20px}
#patrolTables td{vertical-align:top;min-width:100px;max-width:400px;overflow-wrap:anywhere}
@media print{#patrolConsolidation{break-before:page;border:0;box-shadow:none;padding:0}#patrolTables>div{overflow:visible!important}#patrolTables td{min-width:0}#patrolTables table{table-layout:fixed}}

/* Align each heading with the contents of its column in the form and print view. */
#dsrForm th,#dsrForm td{ text-align:left; }
#saveProblems{border:2px solid #b42318;background:#fff3f0;color:#7a1912;padding:16px;margin:16px 0;scroll-margin-top:20px}
[data-save-conflict]{outline:2px solid #b42318;background:#fff3f0}
.submitBar{position:sticky;bottom:0;z-index:10;background:white;border-top:2px solid #0f6c5a}
#draftStatus{font-weight:700}
