*{box-sizing:border-box} :root{--bg:#f5f7fb;--card:#fff;--text:#111827;--muted:#6b7280;--line:#e5e7eb;--dark:#111827;--blue:#2563eb;--green:#047857;--orange:#b45309;--red:#b91c1c} body{margin:0;font-family:system-ui,-apple-system,"Segoe UI","Noto Sans Thai",Tahoma,sans-serif;background:var(--bg);color:var(--text)} a{color:inherit} button,input,select,textarea{font:inherit}.topbar{background:var(--dark);color:#fff;padding:14px max(16px,calc((100% - 1280px)/2));display:flex;align-items:center;justify-content:space-between;gap:18px}.brand{font-size:20px;font-weight:900}.top-sub{font-size:12px;color:#cbd5e1}.admin-box{display:flex;align-items:center;gap:12px;font-size:14px}.admin-box a{background:#374151;padding:8px 10px;border-radius:9px;text-decoration:none}.nav{background:#fff;border-bottom:1px solid var(--line);display:flex;gap:4px;padding:0 max(16px,calc((100% - 1280px)/2));overflow:auto}.nav a{text-decoration:none;padding:13px 15px;font-weight:800;color:#4b5563;white-space:nowrap}.nav a.active{color:#111827;border-bottom:3px solid #111827}.container{max-width:1280px;margin:auto;padding:20px 16px}.footer{text-align:center;color:var(--muted);padding:26px 16px}.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}.page-head h1{font-size:24px;margin:0}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:10px 13px;font-weight:800;text-decoration:none;cursor:pointer;background:#e5e7eb;color:#111827}.btn.primary{background:var(--blue);color:#fff}.btn.dark{background:#111827;color:#fff}.btn.good{background:var(--green);color:#fff}.btn.danger{background:var(--red);color:#fff}.btn.outline{background:#fff;border:1px solid var(--line)}.btn.small{padding:7px 9px;font-size:13px}.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px}.kpi small{display:block;color:var(--muted);font-weight:800}.kpi strong{display:block;font-size:28px;margin-top:3px}.toolbar{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:14px}.field{min-width:160px}.field.grow{flex:1;min-width:220px}label{display:block;font-size:12px;font-weight:800;color:#4b5563;margin-bottom:5px}input,select,textarea{width:100%;border:1px solid #d1d5db;border-radius:10px;padding:10px 11px;background:#fff;color:#111827;min-height:42px}textarea{min-height:100px;resize:vertical}.jobs{display:flex;flex-direction:column;gap:10px}.job{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px}.job-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.job-title{font-size:18px;font-weight:900}.job-sub{color:var(--muted);font-size:13px;margin-top:3px}.badges{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.badge{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:12px;font-weight:900;background:#f3f4f6}.badge.pickup{background:#ecfdf5;color:#047857}.badge.delivery{background:#eff6ff;color:#1d4ed8}.badge.open{background:#fff7ed;color:#b45309}.badge.closed{background:#ecfdf5;color:#047857}.job-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 14px;margin-top:12px}.meta-label{font-size:11px;color:var(--muted);font-weight:800}.meta-val{font-size:14px;font-weight:700;word-break:break-word}.actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.alert{padding:11px 13px;border-radius:10px;margin-bottom:14px;font-weight:700}.alert.success{background:#ecfdf5;color:#065f46}.alert.error{background:#fef2f2;color:#991b1b}.alert.info{background:#eff6ff;color:#1e40af}.empty{text-align:center;color:var(--muted);padding:34px 15px;border:1px dashed #cbd5e1;border-radius:14px;background:#fff}.form-card{max-width:900px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.full{grid-column:1/-1}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px;flex-wrap:wrap}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px;background:#fff}table{border-collapse:collapse;width:100%;min-width:760px}th,td{padding:11px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;font-size:14px}th{font-size:12px;color:var(--muted);background:#f9fafb}.inline-form{display:inline}.login-page{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(430px,100%);background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px}.login-card h1{margin:0 0 5px}.login-card p{margin:0 0 18px;color:var(--muted)}.login-card .field{margin-bottom:12px}.install-note{font-size:13px;color:var(--muted);margin-top:14px}.date-nav{display:flex;gap:7px;flex-wrap:wrap}.summary-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.summary-row a{text-decoration:none}.muted{color:var(--muted)}
@media(max-width:900px){.cards{grid-template-columns:repeat(2,1fr)}.job-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.topbar{padding:12px}.brand{font-size:17px}.admin-box span{display:none}.container{padding:14px 10px}.cards{grid-template-columns:1fr 1fr}.form-grid,.job-grid{grid-template-columns:1fr}.full{grid-column:auto}.job-head{flex-direction:column}.badges{justify-content:flex-start}.page-head .btn{width:100%}.toolbar>.field,.toolbar>.btn{width:100%}.top-sub{display:none}}
.section-line{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.image-help{font-size:12px;margin-top:4px}.image-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.image-card{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff;min-width:0}.image-card>a{display:block;aspect-ratio:4/3;background:#f3f4f6}.image-card img{width:100%;height:100%;object-fit:cover;display:block}.image-card-meta{padding:8px}.image-name{font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px}.image-preview{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:10px}.preview-item{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;min-width:0}.preview-item img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block;background:#f3f4f6}.preview-item span{display:block;padding:6px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.job-image-strip{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.job-image-strip a{width:76px;height:62px;border-radius:9px;overflow:hidden;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;background:#f3f4f6;text-decoration:none}.job-image-strip img{width:100%;height:100%;object-fit:cover}.job-image-strip .more-images{font-size:12px;font-weight:900;padding:6px;text-align:center;color:#374151}@media(max-width:900px){.image-gallery{grid-template-columns:repeat(3,1fr)}.image-preview{grid-template-columns:repeat(4,1fr)}}@media(max-width:600px){.image-gallery{grid-template-columns:repeat(2,1fr)}.image-preview{grid-template-columns:repeat(3,1fr)}.job-image-strip a{width:64px;height:54px}}
.portal-link{text-align:center;margin-top:14px;padding-top:14px;border-top:1px solid var(--line);font-size:14px}.portal-link a{color:#1d4ed8;font-weight:800;text-decoration:none}.check-row{display:flex;align-items:center;gap:9px;font-size:14px;color:var(--text);cursor:pointer}.check-row input{width:20px;min-height:20px;height:20px;margin:0}.driver-topbar{position:sticky;top:0;z-index:20}.driver-nav{position:sticky;top:65px;z-index:19}.driver-container{max-width:980px}.driver-date-card{margin-bottom:14px}.driver-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.driver-job{border-width:2px}.job-number{display:inline-flex;font-size:12px;font-weight:900;color:#374151;background:#f3f4f6;border-radius:999px;padding:4px 8px;margin-bottom:5px}.driver-primary-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.driver-primary-actions .btn{min-height:48px}.driver-map-btn{font-size:16px}.driver-job-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.note-box{background:#fffbeb;border:1px solid #fde68a;border-radius:10px;padding:10px}.driver-image-section{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.driver-images a{width:100px;height:82px}.driver-date-nav .btn{min-height:44px}@media(max-width:600px){.driver-cards{grid-template-columns:repeat(3,1fr);gap:7px}.driver-cards .card{padding:11px}.driver-cards .kpi strong{font-size:23px}.driver-cards .kpi small{font-size:10px}.driver-primary-actions>.btn{width:100%}.driver-job-grid{grid-template-columns:1fr}.driver-images a{width:82px;height:68px}.driver-nav{top:58px}}
.badge.priority{letter-spacing:.2px}.badge.priority-1{background:#f3f4f6;color:#6b7280}.badge.priority-2{background:#f0fdf4;color:#166534}.badge.priority-3{background:#eff6ff;color:#1d4ed8}.badge.priority-4{background:#fff7ed;color:#c2410c}.badge.priority-5{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}
.page-head-actions{display:flex;gap:8px;flex-wrap:wrap}.report-filter-card{margin-bottom:16px}.report-toolbar{margin-bottom:8px}.report-mode-field{min-width:280px}.report-quick-actions{display:flex;gap:7px;flex-wrap:wrap}.print-report{color:#111827}.report-sheet{background:#fff;border:1px solid var(--line);border-radius:14px;padding:18px;margin-bottom:18px}.report-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding-bottom:12px;border-bottom:2px solid #111827;margin-bottom:12px}.report-company{font-size:13px;font-weight:900;margin-bottom:3px}.report-title-row h2{font-size:22px;margin:0 0 4px}.report-summary-box{min-width:220px;border:1px solid var(--line);border-radius:10px;padding:9px 11px;font-size:13px;line-height:1.7}.report-summary-box strong{font-size:15px}.report-table-wrap{overflow:auto}.report-table{width:100%;min-width:1080px;border-collapse:collapse}.report-table th,.report-table td{border:1px solid #cbd5e1;padding:7px 6px;font-size:12px;vertical-align:top}.report-table th{background:#f3f4f6;color:#111827;text-align:center;font-weight:900}.report-table .tiny{font-size:9px;color:#4b5563;margin-top:2px}.report-table .center{text-align:center}.report-table .right{text-align:right}.report-table .nowrap{white-space:nowrap}.report-table .col-no{width:32px}.report-table .location-cell{min-width:150px;max-width:230px}.report-table .priority-print{white-space:nowrap;font-size:11px}.report-table .check-cell{font-size:18px;text-align:center;width:38px}.report-footer-line{font-size:10px;color:#6b7280;text-align:right;margin-top:8px}.report-empty{padding:35px;text-align:center;border:1px dashed #cbd5e1;color:#6b7280}.driver-report-id{min-width:250px;display:grid;gap:4px}.driver-report-id>div{display:grid;grid-template-columns:78px 1fr;gap:8px}.driver-report-id span{font-size:11px;color:#6b7280;font-weight:800}.driver-report-id strong{font-size:13px}.driver-sheet-summary{font-size:12px;font-weight:800;margin-bottom:9px}.driver-sign-row{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-top:16px;padding-top:12px;border-top:1px solid #9ca3af;font-size:12px;font-weight:700}.no-print{display:block}@media(max-width:700px){.page-head-actions{width:100%}.page-head-actions .btn{flex:1}.report-title-row{flex-direction:column}.report-summary-box,.driver-report-id{width:100%;min-width:0}.report-table-wrap{overflow:auto}.report-sheet{padding:11px}.report-mode-field{min-width:0}}
@media print{@page{size:A4 landscape;margin:8mm}body{background:#fff!important;color:#000}.topbar,.nav,.footer,.no-print{display:none!important}.container{max-width:none!important;margin:0!important;padding:0!important}.print-report{display:block!important}.report-sheet{border:0!important;border-radius:0!important;padding:0!important;margin:0!important;background:#fff!important;box-shadow:none!important}.report-title-row{margin-bottom:7px;padding-bottom:7px}.report-title-row h2{font-size:16pt}.report-summary-box{border:1px solid #777}.report-table-wrap{overflow:visible!important}.report-table{min-width:0!important;width:100%!important;table-layout:fixed}.report-table th,.report-table td{font-size:7.4pt!important;padding:3px 2px!important;border-color:#777!important;line-height:1.2;word-break:break-word}.report-table th{background:#eee!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.report-table .tiny{font-size:6pt!important}.report-table .priority-print{font-size:6.6pt!important}.report-table .location-cell{min-width:0;max-width:none}.combined-table th:nth-child(1),.combined-table td:nth-child(1){width:3%}.combined-table th:nth-child(2),.combined-table td:nth-child(2){width:5%}.combined-table th:nth-child(3),.combined-table td:nth-child(3){width:8%}.combined-table th:nth-child(4),.combined-table td:nth-child(4){width:5%}.combined-table th:nth-child(5),.combined-table td:nth-child(5){width:7%}.combined-table th:nth-child(6),.combined-table td:nth-child(6){width:11%}.combined-table th:nth-child(7),.combined-table td:nth-child(7){width:13%}.combined-table th:nth-child(8),.combined-table td:nth-child(8){width:17%}.combined-table th:nth-child(9),.combined-table td:nth-child(9){width:7%}.combined-table th:nth-child(10),.combined-table td:nth-child(10){width:12%}.combined-table th:nth-child(11),.combined-table td:nth-child(11){width:8%}.combined-table th:nth-child(12),.combined-table td:nth-child(12){width:4%}.driver-report-table th:nth-child(1),.driver-report-table td:nth-child(1){width:3%}.driver-report-table th:nth-child(2),.driver-report-table td:nth-child(2){width:5%}.driver-report-table th:nth-child(3),.driver-report-table td:nth-child(3){width:8%}.driver-report-table th:nth-child(4),.driver-report-table td:nth-child(4){width:5%}.driver-report-table th:nth-child(5),.driver-report-table td:nth-child(5){width:12%}.driver-report-table th:nth-child(6),.driver-report-table td:nth-child(6){width:15%}.driver-report-table th:nth-child(7),.driver-report-table td:nth-child(7){width:20%}.driver-report-table th:nth-child(8),.driver-report-table td:nth-child(8){width:7%}.driver-report-table th:nth-child(9),.driver-report-table td:nth-child(9){width:13%}.driver-report-table th:nth-child(10),.driver-report-table td:nth-child(10){width:8%}.driver-report-table th:nth-child(11),.driver-report-table td:nth-child(11){width:4%}.driver-sign-row{font-size:8pt;margin-top:8px;padding-top:7px}.report-footer-line{font-size:6.5pt;margin-top:4px}.driver-report-sheet{break-after:page;page-break-after:always}.driver-report-sheet:last-child{break-after:auto;page-break-after:auto}}
