/* Fitur kustom perusahaan: Laporan lapangan, kolom tambahan Lokasi Kerja. */
.custom-reports{padding:18px 20px}
.cr-filter{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:14px}
.cr-filter label{display:grid;gap:4px;font-size:13px;color:var(--muted);font-weight:600}
.cr-filter input,.cr-filter select{min-height:42px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);font:inherit;min-width:150px}
.cr-count{margin:0 0 10px;color:var(--muted);font-size:13px;min-height:20px}
.cr-list{display:grid;gap:10px}
.cr-item{border:1px solid var(--line);border-radius:10px;padding:14px 16px}
.cr-item header{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline}
.cr-item header strong{font-size:15px}
.cr-site{font-size:13px;color:var(--link);font-weight:600}
.cr-site.is-general{color:var(--muted);font-weight:500}
.cr-item time{margin-left:auto;font-size:12.5px;color:var(--muted)}
.cr-item h3{margin:8px 0 0;font-size:15px}
.cr-item p{margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
.cr-empty{padding:26px 8px;text-align:center;color:var(--muted)}
.cr-empty strong{display:block;color:var(--ink);margin-bottom:4px}
.cr-empty p{margin:0}
@media(max-width:600px){.custom-reports{padding:14px}.cr-filter label,.cr-filter input,.cr-filter select{width:100%}.cr-filter .btn{width:100%}.cr-item time{margin-left:0;width:100%}}
/* Kolom tambahan di daftar lokasi dan formulir lokasi */
.loc-custom{display:block;color:var(--muted)}
.loc-custom b{font-weight:600;color:var(--ink)}
.site-fields .site-extra{display:grid;gap:10px;margin:18px 0 0}
.site-fields .site-extra label{display:grid;gap:6px;margin:0;font-size:14px;font-weight:600}
.site-fields .site-extra input{margin:0;width:100%}
.loc-actions{flex-wrap:wrap;gap:6px}
.loc-actions>*{white-space:nowrap}
/* Saklar aktif/nonaktif lokasi (semua perusahaan): kecil, di kanan atas baris lokasi. Nonaktif = abu-abu, garis putus-putus, titik berongga. */
.loc-item{position:relative}
.loc-item.has-switch .loc-pick{padding-right:72px}
.loc-switch{position:absolute;top:6px;right:6px;display:flex;flex-direction:column;align-items:center;gap:3px;min-width:60px;min-height:48px;padding:6px 4px 4px;background:none;border:0;border-radius:10px;font:inherit;color:var(--muted);cursor:pointer}
.loc-switch-track{position:relative;width:38px;height:22px;border-radius:999px;background:#aab6bd;transition:background-color .18s ease}
.loc-switch-knob{position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.28);transition:transform .18s ease}
.loc-switch.is-on .loc-switch-track{background:var(--green,#1f9d61)}
.loc-switch.is-on .loc-switch-knob{transform:translateX(16px)}
.loc-switch-text{font-size:11px;font-weight:700;line-height:1;letter-spacing:.01em}
.loc-switch.is-on .loc-switch-text{color:#12683e}
.loc-switch:hover .loc-switch-track{filter:brightness(.94)}
.loc-switch:focus-visible{outline:2px solid var(--link);outline-offset:1px}
.loc-switch[disabled]{opacity:.6;cursor:progress}
@media(prefers-reduced-motion:reduce){.loc-switch-track,.loc-switch-knob{transition:none}}
:root[data-theme=dark] .loc-switch-track{background:#4b5a62}
:root[data-theme=dark] .loc-switch.is-on .loc-switch-track{background:#2bb673}
:root[data-theme=dark] .loc-switch.is-on .loc-switch-text{color:#7fe0ae}
.loc-item.loc-off{border-left:3px dashed var(--line);background:repeating-linear-gradient(135deg,transparent 0 9px,rgba(120,140,150,.08) 9px 18px)}
.loc-item.loc-off .loc-text strong{color:var(--muted)}
.loc-item.loc-off:hover{background:repeating-linear-gradient(135deg,transparent 0 9px,rgba(120,140,150,.08) 9px 18px)}
.loc-pick-static{cursor:default}
.loc-dot.v-off{background:transparent;border:2px solid #9aa8b0;box-sizing:border-box}
.loc-type.loc-type-off{color:#5d6b73;background:#e8edf0}
:root[data-theme=dark] .loc-type.loc-type-off{color:#b3c0c7;background:#26333a}
.loc-off-count{font-weight:600;color:var(--muted)}
.off-sites{margin-top:18px;padding:18px 20px}
.off-sites h2{margin:0 0 8px;font-size:16px}

/* ---- Kartu laporan lapangan: rapi, progres bergambar, lampiran seragam ---- */
.cr-list{gap:12px}
.cr-item{padding:16px 18px;background:var(--panel,transparent)}
.cr-item header{margin-bottom:2px}
.cr-body{margin-top:8px!important}
.cr-body.is-clamped{display:-webkit-box;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}
.cr-body.is-folded.is-clamped{display:none}
.cr-prog+h3{margin-top:12px}
.cr-more{margin:6px 0 0;padding:6px 0;min-height:32px;background:none;border:0;color:var(--link);font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.cr-more:hover{text-decoration:underline}
.cr-more:focus-visible,.cr-wa-resend:focus-visible,.cr-more-img:focus-visible,.cr-thumb:focus-visible,.cr-doc:focus-visible{outline:2px solid var(--link);outline-offset:2px}
/* Ringkasan progres: kotak kecil, hanya Realisasi, Rencana, Deviasi */
.cr-prog{width:min(100%,360px);margin:10px 0 2px;padding:10px 12px 12px;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.cr-prog-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:6px 16px;margin-bottom:9px}
.cr-prog-n{display:grid;gap:0}
.cr-prog-n small{font-size:11.5px;font-weight:600;color:var(--muted);line-height:1.3}
.cr-prog-n strong{font-size:20px;line-height:1.15;font-weight:800;letter-spacing:-.01em;color:var(--ink);font-variant-numeric:tabular-nums}
.cr-prog-n.is-plan strong{color:var(--muted);font-weight:700}
.cr-dev{margin-left:auto;display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.2;white-space:nowrap}
.cr-dev svg{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.cr-dev.is-behind{background:#fdeadf;color:#9a3d0e}
.cr-dev.is-ok{background:#e1f5ea;color:#12683e}
.cr-meter{position:relative;height:10px;border-radius:5px;background:rgba(80,100,108,.18);overflow:visible}
.cr-meter .cr-fill{position:absolute;left:0;top:0;bottom:0;border-radius:5px 3px 3px 5px;background:#1f9d61;min-width:3px}
.cr-meter .cr-plan{position:absolute;top:-4px;bottom:-4px;width:3px;margin-left:-1.5px;border-radius:2px;background:var(--ink);box-shadow:0 0 0 2px var(--soft)}
/* Animasi menurut keparahan deviasi: 1 ringan (diam), 2 sedang, 3 berat, 4 kritis */
.cr-dev.sev-2{animation:cr-ring 2.6s ease-out infinite}
.cr-dev.sev-3{animation:cr-ring 1.5s ease-out infinite}
.cr-dev.sev-4{animation:cr-ring 0.9s ease-out infinite}
.cr-prog.sev-3 .cr-dev svg,.cr-prog.sev-4 .cr-dev svg{animation:cr-nudge 1.5s ease-in-out infinite}
.cr-prog.sev-4 .cr-dev svg{animation-duration:.9s}
.cr-prog.sev-4 .cr-plan{animation:cr-blink .9s ease-in-out infinite}
.cr-prog.sev-3{border-color:rgba(239,116,61,.55)}
.cr-prog.sev-4{border-color:#ef743d}
@keyframes cr-ring{0%{box-shadow:0 0 0 0 rgba(239,116,61,.5)}70%,100%{box-shadow:0 0 0 9px rgba(239,116,61,0)}}
@keyframes cr-nudge{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.5px) scale(1.12)}}
@keyframes cr-blink{0%,100%{opacity:1}50%{opacity:.25}}
/* Lampiran: gambar persegi seragam, dokumen sebagai label */
.cr-files{margin-top:12px;display:grid;gap:8px}
.cr-thumbs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-width:540px} /* kotak persegi 4 kolom di HP maupun laptop; di laptop lebar kisi dibatasi supaya kotak tidak terlalu besar */
.cr-thumb{position:relative;width:100%;aspect-ratio:1;padding:0;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--soft);cursor:zoom-in}
.cr-thumb[hidden]{display:none}
.cr-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.cr-thumb:hover{border-color:var(--link)}
.cr-ph{display:block;width:100%;height:100%;background:linear-gradient(110deg,transparent 30%,rgba(120,140,150,.14) 50%,transparent 70%) 0 0/200% 100%;animation:cr-sh 1.4s linear infinite}
.cr-ph.is-failed{animation:none;background:repeating-linear-gradient(135deg,transparent 0 6px,rgba(120,140,150,.18) 6px 12px)}
@keyframes cr-sh{to{background-position:-200% 0}}
.cr-more-img{width:100%;aspect-ratio:1;display:grid;place-content:center;gap:0;border:1px solid var(--line);border-radius:8px;background:var(--soft);color:var(--ink);font:inherit;font-size:20px;font-weight:800;cursor:pointer}
.cr-more-img small{font-size:11.5px;font-weight:600;color:var(--muted)}
.cr-more-img:hover{border-color:var(--link)}
.cr-docs{display:flex;flex-wrap:wrap;gap:6px}
.cr-doc{display:inline-flex;align-items:center;gap:8px;max-width:100%;min-height:36px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);font:inherit;font-size:13px;font-weight:600;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cr-doc small{color:var(--muted);font-weight:500}
.cr-doc:hover{border-color:var(--link)}
.cr-lightbox{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:24px;background:rgba(7,26,34,.86)}
.cr-lightbox img{max-width:min(96vw,1280px);max-height:88vh;border-radius:8px;background:#fff}
.cr-close{position:absolute;top:14px;right:14px;min-height:40px;padding:0 16px;border:0;border-radius:8px;background:#fff;color:#10232b;font:inherit;font-weight:700;cursor:pointer}
/* Status kirim ke grup WA (Owner/Admin): satu baris kecil */
.cr-wa{margin:12px 0 0!important;font-size:12.5px;color:var(--muted);display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.cr-wa.is-bad{color:#9a3d0e}
.cr-wa-err{font-size:12px;opacity:.85;overflow-wrap:anywhere}
.cr-wa-resend{padding:4px 0;min-height:28px;background:none;border:0;color:var(--link);font:inherit;font-size:12.5px;font-weight:700;cursor:pointer}
.cr-wa-resend:hover{text-decoration:underline}
.cr-wa-resend[disabled]{opacity:.6;cursor:progress}
:root[data-theme=dark] .cr-prog{background:#14232a}
:root[data-theme=dark] .cr-dev.is-behind{background:#3a2318;color:#ffb08a}
:root[data-theme=dark] .cr-dev.is-ok{background:#14281f;color:#7fe0ae}
:root[data-theme=dark] .cr-meter{background:rgba(180,200,208,.2)}
:root[data-theme=dark] .cr-meter .cr-fill{background:#2bb673}
:root[data-theme=dark] .cr-wa.is-bad{color:#ffb08a}
@media(max-width:600px){.cr-prog{width:100%}.cr-thumbs{max-width:none}}
@media(prefers-reduced-motion:reduce){.cr-ph,.cr-dev,.cr-dev svg,.cr-plan{animation:none!important}}

/* ---- Daftar laporan sebagai kotak-kotak: tiap laporan satu kartu, 4 per baris di laptop ---- */
.custom-reports{container-type:inline-size}
.cr-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:stretch}
.cr-list>.cr-empty{grid-column:1/-1}
.cr-item{display:flex;flex-direction:column;min-width:0;padding:14px;border-radius:12px;box-shadow:0 1px 2px rgba(16,35,43,.05)}
.cr-item header{display:grid;gap:2px;margin:0}
.cr-item header strong{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.cr-item .cr-site{font-size:13px;line-height:1.3;overflow-wrap:anywhere}
.cr-item header time{margin:0;width:auto;font-size:12.5px}
.cr-item .cr-prog{width:100%;margin:12px 0 2px;padding:9px 10px 11px}
.cr-item .cr-prog-n strong{font-size:18px}
.cr-item h3{font-size:14.5px;line-height:1.35}
.cr-item .cr-body.is-clamped{-webkit-line-clamp:4}
.cr-item .cr-files{margin-top:auto;padding-top:12px}
.cr-item .cr-more{align-self:flex-start}
.cr-item .cr-thumbs{max-width:none;gap:5px}
.cr-item .cr-wa{margin:10px 0 0!important}
.cr-item .cr-doc{min-height:32px;padding:0 10px;font-size:12.5px}
@container (max-width:1060px){.cr-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container (max-width:760px){.cr-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container (max-width:480px){.cr-list{grid-template-columns:minmax(0,1fr)}}
:root[data-theme=dark] .cr-item{box-shadow:none}
.cr-item .cr-prog-row{gap:4px 12px;flex-wrap:nowrap}
.cr-item .cr-dev{padding:3px 8px;font-size:11.5px;gap:4px;min-width:0}
.cr-item .cr-dev svg{width:13px;height:13px}
@container (max-width:480px){.cr-item .cr-prog-row{gap:6px 16px}}

/* 0.4.193 Laporan lapangan di HP: filter 2 kolom, tombol sebaris, kartu ringkas */
@media(max-width:600px){
 html body .custom-reports{padding:10px}
 html body .cr-filter{display:grid;grid-template-columns:1fr 1fr;gap:6px 8px;margin-bottom:8px}
 html body .cr-filter label{font-size:11px;gap:2px;min-width:0}
 html body .cr-filter input,html body .cr-filter select{min-height:34px;min-width:0;font-size:13px;padding:0 8px;width:100%}
 html body .cr-filter .btn{width:100%;min-height:36px;font-size:13px;padding:0 10px;margin:0}
 html body .cr-filter .btn:only-of-type{grid-column:1/-1}
 html body .cr-count{font-size:12px;margin:0 0 6px;min-height:0}
 html body .cr-list{gap:8px}
 html body .cr-item{padding:10px 12px;border-radius:10px}
 html body .cr-item header strong{font-size:13.5px}
 html body .cr-site{font-size:11.5px}
 html body .cr-item time{font-size:11.5px}
 html body .cr-item h3{margin:5px 0 0;font-size:13.5px}
 html body .cr-item p{margin:4px 0 0;font-size:12.5px;line-height:1.45}
 html body .page-heading p{font-size:12px}
}
