:root{
  --bg:#f7f7fb;
  --card:#fff;
  --ink:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;
  --brand:#ef4444;
  --ring:#d1d5db;

  /* khusus HP (digunakan saat map & header dibuat fixed) */
  --topbar-h: 57px;
  --map-h: 52vh;  /* tinggi map saat fixed di HP */
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
}

/* =================== TOPBAR =================== */
.topbar{
  position:sticky; top:0; z-index:50;
  background:#fff; border-bottom:1px solid var(--border); width:100%;
}
.topbar .wrap{
  width:100%;
  display:flex; align-items:center; gap:12px;
  padding:12px 16px;
  flex-wrap:wrap;
}

/* Brand cluster: Home | KoridorMap | UNSRI */
.brand-group{
  display:flex; align-items:center; gap:10px; min-width:220px;
}
.home-btn{
  display:inline-grid; place-items:center;
  width:34px; height:34px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff; color:#111; text-decoration:none;
  transition:transform .08s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 14px rgba(0,0,0,.08);
  border-color:#d0d5dd;
}
.home-btn:active{ transform:translateY(0); }
.brand{ font-weight:700; color:#e11d48; }
.unsri-logo{
  width:28px; height:28px;
  object-fit:cover; display:block;
  box-shadow:0 2px 6px rgba(0,0,0,.06);
}

/* Info pills */
.pills{ display:flex; gap:8px; flex-wrap:wrap; }
.pill{
  font-size:13px; border:1px solid var(--border); background:#fff;
  border-radius:999px; padding:8px 10px; color:#111;
}

/* Search full sampai kanan */
.searchbar{ display:flex; align-items:center; gap:8px; flex:1 1 300px; min-width:180px; }
.searchbar input{
  width:100%; padding:10px 12px; border:1px solid var(--border);
  border-radius:10px; outline:none;
}
.searchbar button{
  border:1px solid var(--border); background:#fff; padding:10px 12px;
  border-radius:10px; cursor:pointer;
}

/* =================== LAYOUT DESKTOP/TABLET =================== */
.app{
  position:relative; width:100%;
  height:calc(100vh - var(--topbar-h));
  display:grid; grid-template-columns:2fr 3fr;
  gap:16px; padding:16px;
  transition:grid-template-columns .35s ease;
}
.app.full{ grid-template-columns:0fr 1fr; }

.list{
  position:relative; height:100%;
  overflow:auto; background:transparent;
}

.toggler{
  position:absolute; top:50%;
  left: calc((100% - 16px) * 0.4 - 18px);
  transform:translateY(-50%);
  z-index:2000; width:36px; height:36px; border-radius:50%;
  border:1px solid var(--border); background:#fff; display:grid; place-items:center;
  cursor:pointer; box-shadow:0 4px 16px rgba(0,0,0,.08);
  transition:left .35s ease, transform .35s ease;
}
.toggler span{ font-size:18px; line-height:1; }
.app.full .toggler{ left:8px; }
.app.full .toggler span{ transform:rotate(180deg); }

.mapwrap{
  height:100%; position:relative;
  border-radius:16px; overflow:hidden;
  border:1px solid var(--border);
  transition:border-radius .35s ease;
}
.app.full .mapwrap{ border-radius:0; }
#map{ height:100%; width:100%; }

/* =================== CARDS (tanpa thumbs) =================== */
.h1{ font-size:22px; font-weight:800; margin:6px 0 8px; }
.filters{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.btn{
  appearance:none; border:1px solid var(--border); background:#fff;
  border-radius:10px; padding:8px 10px; font-size:13px; cursor:pointer;
}
.btn.primary{ background:var(--brand); border-color:var(--brand); color:#fff; }

.cards{ display:flex; flex-direction:column; gap:12px; }

.card{
  display:flex; flex-direction:column;
  border:1px solid var(--border); background:var(--card);
  border-radius:16px; overflow:hidden;
}

/* Header kartu: warnanya di-inject inline style="background: c.color" via JS */
.card__header{
  color:#fff; padding:10px 12px;
  font-weight:800; letter-spacing:.2px;
}

/* Isi kartu */
.content{ padding:12px; }

.title-row{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.title{ font-weight:800; font-size:18px; margin:0; line-height:1.25; }
.meta{ display:inline-flex; gap:8px; align-items:center; font-size:12px; color:var(--muted); }
.badge{
  font-size:11px; border:1px solid var(--border);
  border-radius:999px; padding:3px 7px; background:#f8fafc;
}

.row{ display:flex; justify-content:space-between; align-items:center; margin-top:10px; }
.actions{ display:flex; gap:8px; }

/* Drawer titik koridor */
.drawer{ margin-top:10px; border-top:1px dashed var(--border); padding-top:8px; display:none; }
.drawer.open{ display:block; }
.stop{
  display:flex; justify-content:space-between; align-items:center;
  border:1px solid var(--border); border-radius:10px; padding:6px 8px; margin-top:6px; font-size:13px;
}
.stop .go{
  border:1px solid #ffd7dd; background:#fff0f2; color:#e11d48;
  border-radius:8px; padding:4px 7px; cursor:pointer;
}

/* =================== RESPONSIF (HP) =================== */
@media (max-width:1100px){
  /* Header & Map fixed di atas */
  .topbar{ position:fixed; top:0; left:0; right:0; z-index:1000; }
  .app{
    height:auto; min-height:100vh;
    display:block; padding:12px;
    /* ruang untuk topbar + peta fixed agar list tidak tertutup */
    padding-top: calc(var(--topbar-h) + var(--map-h) + 16px);
  }

  .mapwrap{
    position:fixed; top:var(--topbar-h); left:0; right:0;
    height:var(--map-h); min-height:var(--map-h);
    border-radius:0; z-index:900;
  }
  #map{ height:100%; }

  .list{ height:auto; max-height:none; overflow:visible; }
  .toggler{ display:none; }

  .title{ font-size:18px; }
}

@media (max-width:640px){
  .searchbar{ order:3; width:100%; }
  .pills{ order:2; }
}
