:root{
  --ink:#0c2d3a; --deep:#0b5563; --aqua:#1397ab; --aqua-dark:#0d7a8c;
  --mist:#e9f2f4; --line:#d3e3e8; --user:#ef6a32; --white:#fff; --muted:#5b7580;
  --radius:10px;
}
html{scroll-behavior:smooth}
body{font-family:'Figtree',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;color:var(--ink);background:var(--mist);font-size:16px;line-height:1.5}
h1,h2,h3,.brand{font-family:'Bricolage Grotesque','Figtree',system-ui,sans-serif;letter-spacing:-.01em}
a{color:var(--aqua-dark)}
:focus-visible{outline:3px solid var(--aqua);outline-offset:2px}

/* Navigasi */
.site-nav{background:var(--deep);padding:.6rem 0}
.site-nav .nav-link{color:#d7eef2;font-weight:500;padding:.4rem .75rem;border-radius:6px}
.site-nav .nav-link:hover,.site-nav .nav-link.active{color:#fff;background:rgba(255,255,255,.12)}
.site-nav .navbar-toggler{border-color:rgba(255,255,255,.4);filter:invert(1)}
.brand{display:inline-flex;align-items:center;gap:.55rem;color:#fff;font-weight:700;font-size:1.15rem;text-decoration:none}
.brand:hover{color:#fff}
.brand-dark,.brand-dark:hover{color:var(--deep)}
.brand-mark{width:18px;height:18px;background:var(--aqua);border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:inset 0 0 0 4px #fff3;display:inline-block}

/* Intro */
.intro{background:var(--deep);color:#fff;padding:1.25rem 0 1.5rem}
.intro h1{font-size:clamp(1.4rem,3.4vw,2.1rem);font-weight:700;margin:0 0 .35rem;max-width:30ch}
.intro p{margin:0;color:#c8e4ea;max-width:62ch}
.count-chip{display:inline-block;background:#fff;color:var(--deep);border-radius:999px;padding:.35rem .9rem;font-weight:600;white-space:nowrap}
.count-chip b{font-size:1.15rem}

/* Layout peta */
.workspace{display:grid;grid-template-columns:400px 1fr;gap:0;height:calc(100vh - 210px);min-height:560px;background:#fff;border-bottom:1px solid var(--line)}
.panel{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line);background:#fff}
.panel-top{padding:1rem;border-bottom:1px solid var(--line)}
.panel-list{flex:1;overflow-y:auto;padding:.25rem 0}
.map-wrap{position:relative;min-height:360px}
#map{position:absolute;inset:0;z-index:0}
#map.picking{cursor:crosshair}
.map-hint{position:absolute;z-index:500;left:50%;top:12px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:.4rem .9rem;border-radius:999px;font-size:.9rem;box-shadow:0 4px 14px #0004}

.btn-brand{background:var(--aqua-dark);border-color:var(--aqua-dark);color:#fff;font-weight:600}
.btn-brand:hover,.btn-brand:focus{background:var(--deep);border-color:var(--deep);color:#fff}
.btn-user{background:var(--user);border-color:var(--user);color:#fff;font-weight:600}
.btn-user:hover{background:#d4561f;border-color:#d4561f;color:#fff}
.btn-outline-user{border-color:var(--user);color:#b4410f;font-weight:600}
.btn-outline-user:hover,.btn-outline-user.active{background:var(--user);color:#fff;border-color:var(--user)}

.status{font-size:.9rem;margin-top:.75rem;padding:.55rem .75rem;border-radius:8px;display:none}
.status.show{display:block}
.status.info{background:#e4f3f6;color:var(--deep)}
.status.error{background:#fdeae3;color:#8a2e0b}
.status.ok{background:#e3f5ea;color:#17613a}
.note-line{font-size:.82rem;color:var(--muted);margin:.6rem 0 0}

.list-head{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem .35rem}
.list-head h2{font-size:1rem;margin:0;font-weight:700}
.depot-item{display:block;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid var(--line);padding:.8rem 1rem;cursor:pointer;color:inherit}
.depot-item:hover,.depot-item.active{background:var(--mist)}
.depot-item.active{box-shadow:inset 4px 0 0 var(--aqua)}
.depot-name{font-weight:600;display:block}
.depot-addr{font-size:.88rem;color:var(--muted);display:block}
.depot-meta{font-size:.82rem;color:var(--muted);display:flex;flex-wrap:wrap;gap:.25rem .9rem;margin-top:.2rem}
.dist{flex:none;background:var(--ink);color:#fff;border-radius:6px;padding:.15rem .55rem;font-weight:600;font-size:.85rem;white-space:nowrap}
.dist-first{background:var(--user)}
.rank{font-weight:700;color:var(--aqua-dark);min-width:1.4rem}
.empty{padding:1.5rem 1rem;color:var(--muted)}

/* Marker Leaflet */
.pin{width:30px;height:30px;background:var(--aqua-dark);border:3px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 6px #0006}
.pin::after{content:'';position:absolute;width:8px;height:8px;background:#fff;border-radius:50%;left:8px;top:8px}
.pin.sel{background:var(--ink);transform:rotate(-45deg) scale(1.2)}
.me{width:20px;height:20px;border-radius:50%;background:var(--user);border:4px solid #fff;box-shadow:0 0 0 3px var(--user),0 2px 8px #0006}
.leaflet-popup-content{margin:12px 14px;font-family:'Figtree',sans-serif}
.pop-title{font-weight:700;font-size:1rem;margin-bottom:.2rem}
.pop-row{font-size:.88rem;margin:.1rem 0}
.pop-dist{display:inline-block;background:var(--ink);color:#fff;border-radius:6px;padding:0 .45rem;font-size:.8rem;margin-bottom:.35rem}

/* Detail */
.detail-photo{width:100%;max-height:320px;object-fit:cover;border-radius:var(--radius)}
.photo-empty{background:var(--mist);border:1px dashed var(--line);color:var(--muted);border-radius:var(--radius);padding:2.5rem 1rem;text-align:center}
.detail-map{height:300px;border-radius:var(--radius);border:1px solid var(--line)}
.dl-row{display:grid;grid-template-columns:150px 1fr;gap:.25rem 1rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.dl-row dt{font-weight:600;color:var(--muted)}
.dl-row dd{margin:0}

/* Admin */
.admin-body{background:var(--mist)}
.card-lite{background:#fff;border:1px solid var(--line);border-radius:var(--radius)}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1rem 1.1rem;height:100%}
.stat-num{font-family:'Bricolage Grotesque',sans-serif;font-size:2.2rem;font-weight:700;line-height:1;color:var(--deep)}
.stat-label{color:var(--muted);font-size:.9rem;margin-top:.3rem}
.picker-map{height:340px;border-radius:var(--radius);border:1px solid var(--line)}
.thumb{width:84px;height:64px;object-fit:cover;border-radius:6px;border:1px solid var(--line)}
.table thead th{font-size:.85rem;color:var(--muted);font-weight:600;background:#f6fafb}
.login-body{min-height:100vh;display:grid;place-items:center;padding:1rem;background:var(--mist)}
.login-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:2rem;width:100%;max-width:400px}

.site-footer{padding:1rem 0;font-size:.85rem;color:var(--muted)}

/* Responsif */
@media (max-width:900px){
  .workspace{grid-template-columns:1fr;height:auto;min-height:0}
  .map-wrap{order:-1;height:56vh;min-height:320px}
  .panel{border-right:0}
  .panel-list{max-height:none;overflow:visible}
  .dl-row{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}
