:root {
  --bg: #F3F5FA; --surface: #FFFFFF; --surface-2: #F7F9FD; --surface-3: #EEF2F9; --border: #E2E7F1; --border-2: #D3DAE8;
  --text: #101A3D; --text-2: #46537A; --text-3: #8290AE;
  --brand: #3565F0; --brand-2: #5B8BFF; --brand-soft: #E8EEFF;
  --ok: #0FA877; --ok-soft: #DDF5EC; --warn: #D98E04; --warn-soft: #FFF2D4; --danger: #E5484D; --danger-soft: #FDE6E7;
  --r: 12px; --r-sm: 8px; --sh: 0 1px 2px rgb(16 26 61 / .05), 0 4px 14px -6px rgb(16 26 61 / .10);
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0F20; --surface: #111933; --surface-2: #16203E; --surface-3: #1B274A; --border: #243052; --border-2: #2F3C63;
    --text: #EAF0FF; --text-2: #B2BDDB; --text-3: #7C88A9;
    --brand: #6E8FFF; --brand-2: #8FA9FF; --brand-soft: #1B2956;
    --ok: #34D399; --ok-soft: #0D3528; --warn: #F5B83D; --warn-soft: #3A2C0B; --danger: #FF7078; --danger-soft: #3E1519;
    --sh: 0 1px 2px rgb(0 0 0 / .3), 0 6px 18px -8px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* atribut hidden selalu menang atas display: flex/grid */
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h2 { font-size: 16px; margin: 0 0 2px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.redup { color: var(--text-3); margin: 0; font-size: 12.5px; }
.teks-warn { color: var(--warn); } .teks-bahaya { color: var(--danger); }

/* ---- Kepala & tab ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 6; }
.merek { display: flex; align-items: center; gap: 11px; }
.merek b { font-size: 15px; }
.merek small { display: block; color: var(--text-3); font-size: 11.5px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 4px 12px -4px var(--brand); }
.bar-kanan { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-size: 12px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; } .chip.ok::before { background: var(--ok); }
.chip.gagal { color: var(--danger); background: var(--danger-soft); border-color: transparent; } .chip.gagal::before { background: var(--danger); }
.chip.tombol { cursor: pointer; font: inherit; font-size: 12px; }
.tab { display: flex; gap: 4px; padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab button { border: 0; background: none; color: var(--text-2); padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 99px; white-space: nowrap; transition: background .15s, color .15s; }
.tab button:hover { background: var(--surface-3); }
.tab button.aktif { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 18px 20px 90px; }
.panel { display: none; animation: muncul .2s ease; }
.panel.aktif { display: block; }
@keyframes muncul { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.kartu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--sh); }
.baris { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.baris.jarak { justify-content: space-between; }
.baris.kanan { justify-content: flex-end; }
.atas { margin-top: 12px; } .atas-kecil { margin: 10px 0; }

/* ---- Isian & tombol ---- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 7px 10px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; }
.btn { font: inherit; font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; transition: all .15s; }
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn.utama { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.utama:hover:not(:disabled) { filter: brightness(1.08); color: #fff; box-shadow: 0 4px 12px -4px var(--brand); }
.btn.bahaya { color: var(--danger); }
.btn.bahaya:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.btn.kecil { padding: 3px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.cek { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.segmen { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.segmen button { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 6px; color: var(--text-2); cursor: pointer; }
.segmen button.aktif { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--sh); }

/* ---- Pilih kota (Hitung Order) ---- */
.kota-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin-top: 12px; max-height: 280px; overflow: auto; padding: 2px; }
.kota-grid label { display: flex; gap: 8px; align-items: center; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: all .12s; }
.kota-grid label:hover { border-color: var(--brand); }
.kota-grid label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 500; }
.kota-grid input { accent-color: var(--brand); }

/* ---- Ringkasan angka ---- */
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.stat div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 14px; position: relative; overflow: hidden; }
.stat div::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.stat b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--text-3); }
.stat .warn::before { background: var(--warn); } .stat .warn b { color: var(--warn); }
.stat .bahaya::before { background: var(--danger); } .stat .bahaya b { color: var(--danger); }
.stat .ok::before { background: var(--ok); } .stat .ok b { color: var(--ok); }
.stat .redup-tile::before { background: var(--text-3); } .stat .redup-tile b { color: var(--text-3); }

/* ---- Tabel ---- */
.tabel-bungkus { overflow: auto; max-height: 65vh; border: 1px solid var(--border); border-radius: var(--r-sm); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); z-index: 1; }
tbody tr:hover td { background: var(--surface-2); }
td.angka, th.angka { text-align: right; font-variant-numeric: tabular-nums; }
tr.nol td { color: var(--text-3); }
tr.ubah td { background: var(--warn-soft); }
tr.masalah td { background: var(--danger-soft); }
td input, td select { width: 100%; }
.sumber { font-size: 12px; color: var(--text-2); }

/* ---- Pesan ---- */
.pesan { border-radius: var(--r-sm); padding: 10px 14px; margin: 10px 0; font-size: 13px; border: 1px solid transparent; }
.pesan.ok { background: var(--ok-soft); color: var(--ok); }
.pesan.warn { background: var(--warn-soft); color: var(--warn); }
.pesan.bahaya { background: var(--danger-soft); color: var(--danger); }
.pesan ul { margin: 6px 0 0; padding-left: 18px; }
details summary { cursor: pointer; }
.halaman { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.kode { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; font-family: var(--mono); font-size: 12px; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; }

/* ---- Mapping ---- */
.map-tata { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.map-kota { position: sticky; top: 118px; display: flex; flex-direction: column; gap: 8px; }
.map-kota input { width: 100%; }
.map-kota-daftar { display: flex; flex-direction: column; gap: 3px; max-height: calc(100vh - 230px); overflow: auto; padding-right: 2px; }
.map-kota-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--text); cursor: pointer; }
.map-kota-item:hover { background: var(--surface-2); }
.map-kota-item.aktif { background: var(--brand-soft); border-color: var(--brand); }
.map-kota-item .nama { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.map-kota-item .progres { grid-column: 1 / -1; height: 3px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.map-kota-item .progres i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.lencana { font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 99px; }
.lencana.ok { color: var(--ok); background: var(--ok-soft); }
.lencana.warn { color: var(--warn); background: var(--warn-soft); }
.lencana.bahaya { color: #fff; background: var(--danger); }
.lencana.kecil { font-size: 10.5px; font-weight: 600; margin-left: 6px; }
.map-isi { min-width: 0; border: 1px solid var(--border); border-radius: var(--r); padding: 14px; background: var(--surface); }
.map-kepala { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.map-kepala input { width: 180px; }
.map-daftar { display: flex; flex-direction: column; }
.map-baris { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-sm); border-bottom: 1px solid var(--border); }
.map-baris:hover { background: var(--surface-2); }
.map-baris.diubah { background: var(--warn-soft); }
.map-baris.salah select { border-color: var(--danger); color: var(--danger); }
.map-baris.belum select { color: var(--text-3); border-style: dashed; }
.map-nama { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13.5px; }
.map-nama > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titik { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.titik.ok { background: var(--ok); } .titik.belum { background: var(--warn); } .titik.salah { background: var(--danger); }
.map-panah { color: var(--text-3); text-align: center; }
.map-baris select { width: 100%; }
.kosong { padding: 24px; text-align: center; }
.map-lama { margin-top: 14px; border: 1px dashed var(--border-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; color: var(--text-2); }
.map-lama-isi { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; margin: 10px 0; }
.map-lama-isi div { display: flex; gap: 6px; font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- Rute & jadwal ---- */
.jadwal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; }
.minggu { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.hari-kolom { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; background: var(--surface-2); min-width: 0; }
.hari-kolom.ini { border-color: var(--ok); background: var(--ok-soft); }
.hari-kolom.besok { border-color: var(--brand); }
.hari-nama { font-weight: 600; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hari-jumlah { font-size: 12px; color: var(--text-3); margin: 4px 0 6px; }
.hari-jumlah b { font-size: 18px; color: var(--text); }
.hari-rute { display: flex; flex-direction: column; gap: 3px; }
.hari-rute span { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rute-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.rute-kartu { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.rute-kartu h3 { font-size: 15px; }
.hari-chip { display: flex; gap: 4px; flex-wrap: wrap; }
.hari-chip span { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-3); }
.hari-chip span.on { background: var(--brand); color: #fff; }
.kota-chip { display: flex; gap: 4px; flex-wrap: wrap; }
.kota-chip span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.kota-chip span.hilang { background: var(--warn-soft); color: var(--warn); text-decoration: line-through; }
.label-blok { display: block; margin: 12px 0; font-size: 13px; color: var(--text-2); }
.label-blok > input { width: 100%; margin-top: 5px; }
.hari-pilih { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hari-cek { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.hari-cek:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.rute-kota { max-height: 40vh; }
@media (max-width: 860px) { .minggu { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .minggu { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rute-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Kirim WA ---- */
.kirim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.kirim-kartu { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.kirim-kartu:hover { border-color: var(--border-2); box-shadow: var(--sh); }
.kirim-kartu.terpilih { border-color: var(--brand); background: var(--brand-soft); }
.kirim-kartu.tak-aktif { opacity: .7; }
.kirim-kartu b { font-size: 14px; }
.kirim-area { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.kirim-area input { flex: 1; font-family: var(--mono); font-size: 12.5px; padding: 5px 8px; }
.kirim-aksi { display: flex; flex-wrap: wrap; gap: 6px; }
.dlg-lebar { width: min(980px, calc(100vw - 24px)); }
.pratinjau-bingkai { margin-top: 12px; max-height: 68vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); background: #f0f2f7; display: grid; place-items: center; min-height: 200px; padding: 10px; }
.pratinjau-bingkai img { max-width: 100%; height: auto; box-shadow: var(--sh); background: #fff; }

/* ---- Bilah simpan & kaki ---- */
.bar-simpan { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 14px; background: var(--text); color: var(--surface); padding: 10px 12px 10px 18px; border-radius: 99px; box-shadow: 0 10px 30px -8px rgb(0 0 0 / .45); font-size: 13px; animation: naik .2s ease; max-width: calc(100vw - 24px); }
.bar-simpan .btn { border-color: transparent; }
.bar-simpan .btn:not(.utama) { background: transparent; color: var(--surface); }
@keyframes naik { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.kaki { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 20px; font-size: 12px; color: var(--text-3); z-index: 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kaki.gagal { color: var(--danger); }

dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); width: min(440px, calc(100vw - 32px)); padding: 22px; box-shadow: 0 20px 50px -12px rgb(0 0 0 / .4); }
dialog label { display: block; margin: 12px 0; font-size: 13px; color: var(--text-2); }
dialog input { width: 100%; margin-top: 5px; }
dialog::backdrop { background: rgb(10 15 32 / .45); backdrop-filter: blur(2px); }

@media (max-width: 860px) {
  .map-tata { grid-template-columns: minmax(0, 1fr); }
  .map-kota { position: static; }
  .map-kota-daftar { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .map-kota-item { min-width: 150px; }
}
@media (max-width: 640px) {
  main { padding: 12px 12px 90px; } .bar { padding: 8px 12px; } .tab { padding: 6px 12px; } .merek small { display: none; }
  .merek b { white-space: nowrap; font-size: 14px; } .logo { width: 30px; height: 30px; }
  .chip { font-size: 11px; padding: 4px 9px; } .bar-kanan { gap: 5px; }
  .bar-simpan { left: 8px; right: 8px; bottom: 36px; transform: none; border-radius: var(--r); justify-content: space-between; animation: none; }
  .kartu { padding: 14px; }
  .map-baris { grid-template-columns: minmax(0, 1fr); gap: 4px; } .map-panah { display: none; }
  .map-kepala input { width: 100%; }
}
@media (max-width: 460px) { #chipServer { display: none; } }

/* v0.7: kota baru, saran rentang & mapping */
.kotak-baru { border: 1px solid var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.langkah { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.langkah .nomor { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand); color: #fff; font-size: 13px; }
.langkah-isi { min-width: 0; }
.langkah-isi input { min-width: 260px; flex: 1; }
.saran-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.saran-rentang { display: grid; gap: 2px; text-align: left; border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; background: var(--surface-2); cursor: pointer; font: inherit; font-size: 12px; }
.saran-rentang:hover { border-color: var(--brand); }
.saran-rentang b { font-family: var(--mono); font-size: 12px; }
.tabel-bungkus.pendek { max-height: 260px; overflow: auto; }
.rute-pilih { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; }
.saran-map { margin-left: 8px; border: 1px dashed var(--brand); background: transparent; color: var(--brand); border-radius: 999px; padding: 1px 8px; font: inherit; font-size: 11px; cursor: pointer; }
.saran-map:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.teks-ok { color: var(--ok); }

/* Kotak centang berteks panjang di wizard: alirkan seperti paragraf agar terbungkus di layar HP */
#dlgKotaBaru .cek { display: block; line-height: 1.5; }
#dlgKotaBaru .cek input { vertical-align: middle; margin-right: 4px; }

/* ---- Di dalam GFI ERP (sub-halaman modul Penjualan): kepala & catatan teknis disembunyikan, isi mengisi bingkai ---- */
body.mode-erp { background: var(--bg); }
body.mode-erp .bar { display: none; }
body.mode-erp .tab { position: sticky; top: 0; z-index: 6; padding: 8px 16px; }
body.mode-erp main { max-width: none; padding: 14px 16px 64px; }
body.mode-erp .kaki:empty { display: none; }
.erp-gagal { max-width: 560px; margin: 40px auto; }
.erp-gagal h2 { margin-bottom: 10px; }
.erp-gagal .redup { margin-top: 10px; }
@media (max-width: 640px) { body.mode-erp main { padding: 10px 10px 60px; } }

/* ---- Pilih hari lain & lencana tab ---- */
#pilihHari { padding: 5px 9px; font-size: 12.5px; }
#pilihHari.aktif { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.lencana-tab { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }

/* ---- Ringkasan konfigurasi: daftar tindakan ---- */
.tindakan { border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 10px; background: var(--surface-2); display: grid; gap: 8px; }
.tindakan.warn { border-left-color: var(--warn); }
.tindakan.bahaya { border-left-color: var(--danger); }
.tindakan.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.tindakan-kepala { display: grid; gap: 2px; }
.tindakan-kepala b { font-size: 14px; }
.tindakan .baris { flex-wrap: wrap; }
.tindakan [data-utama] { background: var(--brand); color: #fff; border-color: var(--brand); }
.daftar-kota-masalah { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.kota-masalah { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 7px 10px; font: inherit; cursor: pointer; display: grid; gap: 1px; }
.kota-masalah:hover { border-color: var(--brand); }
.kota-masalah span { font-size: 11.5px; color: var(--warn); }

/* ---- Ambil Order ---- */
.ambil-kepala { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ambil-judul h2 { font-size: 18px; }
.ambil-judul p { margin-top: 2px; }
.ambil-kontrol { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ambil-kontrol .btn.utama { padding: 8px 18px; }
#bukaPilihKota b { color: var(--brand); }
.stat-ambil b small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.alat-hasil { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.alat-hasil input[type=search] { width: min(260px, 100%); }
.alat-hasil .spasi { flex: 1; }
.tabel-ambil { max-height: none; }
.tabel-ambil th.no, .tabel-ambil td.no { width: 44px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tabel-ambil .kolom-kota { width: 120px; text-align: right; }
.tabel-ambil td.nama { font-weight: 500; }
.baris-item { cursor: pointer; }
.baris-item:hover td { background: var(--surface-2); }
.baris-item.terbuka td { background: var(--brand-soft); }
.baris-item.nol td { color: var(--text-3); }
.jumlah-kota { display: inline-flex; gap: 4px; align-items: center; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--text-2); }
.jumlah-kota i { font-style: normal; font-size: 10px; transition: transform .15s; }
.baris-item.terbuka .jumlah-kota { background: var(--brand); color: #fff; }
.baris-item.terbuka .jumlah-kota i { transform: rotate(180deg); }
tr.rinci td { background: var(--surface-2); padding-top: 4px; padding-bottom: 10px; }
.rinci-kota { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-kota { display: inline-grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 4px 10px; font-size: 12.5px; }
.chip-kota em { font-style: normal; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.chip-kota small { grid-column: 1 / -1; color: var(--text-3); font-size: 11px; }
/* dialog pilih kota: pakai tata letak kotak kota, bukan gaya label/input dialog umum */
#dlgPilihKota label { margin: 0; }
#dlgPilihKota .kota-grid label { display: flex; }
#dlgPilihKota input[type=checkbox] { width: auto; margin: 0; }
#dlgPilihKota .kota-grid { max-height: min(55vh, 460px); }
#dlgPilihKota .pilih-kota-alat input[type=search] { width: min(260px, 100%); margin: 0; }
#dlgPilihKota .cek { display: inline-flex; }
@media (max-width: 640px) {
  .ambil-kontrol { width: 100%; }
  .ambil-kontrol .btn.utama { flex: 1; }
  .tabel-ambil .kolom-kota { width: 86px; }
}

/* ---- Ambil Order: kota dipilih & dua kolom (tabel | pratinjau Sheet bergulir) ---- */
.stat-ambil .stat-kota { grid-column: 1 / -1; display: grid; gap: 7px; }
.stat-ambil .stat-kota::before { background: var(--ok); }
.stat-kota > span { font-size: 11.5px; color: var(--text-3); }
.kota-chip-daftar { display: flex; flex-wrap: wrap; gap: 5px; }
.kota-chip { font: inherit; font-size: 12px; font-weight: 600; display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.kota-chip small { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.kota-chip.kosong { color: var(--text-3); border-style: dashed; }
.kota-chip.kosong small { color: var(--text-3); }
.kota-chip:hover:not(:disabled), .kota-chip.aktif { border-color: var(--brand); background: var(--brand-soft); }
.kota-chip:disabled { cursor: default; }
.ambil-dua { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ambil-dua.satu { grid-template-columns: minmax(0, 1fr); }
.ambil-dua > .kartu { margin-bottom: 0; }
.kartu-tabel .tabel-ambil { max-height: 78vh; }
.sheet-kartu { position: sticky; top: 64px; }
body.mode-erp .sheet-kartu { top: 58px; }
.sheet-kepala { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sheet-kepala select { font-weight: 600; max-width: 200px; }
.sheet-kepala .spasi { flex: 1; }
.sheet-ket { margin: 6px 0 8px; font-size: 11.5px; }
.sheet-isi { border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; height: 72vh; overflow: auto; display: grid; place-items: start center; }
.sheet-isi img { width: 100%; height: auto; display: block; animation: muncul .3s ease; }
.sheet-isi .sheet-muat, .sheet-isi .pesan { margin: 18px; place-self: center; }
.chip-kota[data-lihat] { cursor: pointer; }
.chip-kota[data-lihat]:hover { border-color: var(--brand); }
@media (max-width: 1000px) {
  .ambil-dua { grid-template-columns: minmax(0, 1fr); }
  .sheet-kartu { position: static; }
  .sheet-isi { height: 62vh; }
  .kartu-tabel .tabel-ambil { max-height: none; }
}

/* ---- v0.13: Qty dekat nama; pratinjau Sheet pas satu layar ---- */
.tabel-ambil table { table-layout: fixed; }
.tabel-ambil col.c-no { width: 44px; }
.tabel-ambil col.c-nama { width: min(300px, 58%); }
.tabel-ambil col.c-qty { width: 72px; }
.tabel-ambil .kolom-kota { width: auto; text-align: left; padding-left: 14px; }
.tabel-ambil td.nama { overflow-wrap: anywhere; }
.sheet-isi.pas { overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
.sheet-isi.pas img { width: auto; max-width: 100%; max-height: 100%; height: auto; object-fit: contain; cursor: zoom-in; }
.sheet-isi:not(.pas) img { cursor: zoom-out; }
.sheet-isi { height: min(72vh, 820px); }

/* ---- v0.13.1: kartu Daftar item & Lembar Sheet rapi (kepala sejajar) ---- */
.kartu-kepala { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; min-height: 34px; }
.kartu-kepala h3 { font-size: 15px; }
.kartu-kepala .redup { font-size: 11.5px; }
.saring-item { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.saring-item input[type=search] { flex: 1; min-width: 0; }
.saring-item .cek { white-space: nowrap; }
.sheet-kepala { padding: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 8px; }
.sheet-ket { margin: 6px 0 0; font-size: 11px; text-align: center; }
.tabel-ambil { border-radius: var(--r-sm); }
.tabel-ambil th, .tabel-ambil td { padding: 7px 10px; vertical-align: middle; }
.tabel-ambil th { background: var(--surface-3); }
.tabel-ambil tbody tr.baris-item:nth-child(4n+3) td { background: var(--surface-2); }
.tabel-ambil tbody tr.baris-item.terbuka td { background: var(--brand-soft); }
.tabel-ambil td.angka b { font-size: 13.5px; }
.tabel-ambil td.no { text-align: right; padding-right: 6px; }
.tabel-ambil th.no { text-align: right; padding-right: 6px; }

/* ---- v0.13.2: tabel item — nama bertitik penuntun ke Qty, kolom Kota tetap di kanan ---- */
.tabel-ambil col.c-nama { width: auto; }
.tabel-ambil col.c-qty { width: 76px; }
.tabel-ambil col.c-kota { width: 112px; }
.tabel-ambil .kolom-kota { text-align: right; padding-left: 8px; }
.nama-isi { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.nama-isi span { flex: 0 1 auto; min-width: 0; }
.nama-isi .titik { flex: 1 1 24px; min-width: 16px; border-bottom: 2px dotted var(--text-3); opacity: .45; transform: translateY(-4px); }
.baris-item.terbuka .nama-isi .titik { border-color: var(--brand); opacity: .5; }
.sheet-isi:not(.pas) img { width: 100%; height: auto; max-height: none; }
@media (max-width: 640px) { .tabel-ambil col.c-kota { width: 86px; } .tabel-ambil col.c-qty { width: 60px; } }

/* ---- Isi Order (HP diutamakan) ---- */
.isi-cari { width: 100%; margin: 10px 0; }
.isi-kota { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.isi-kota button { font: inherit; font-weight: 600; text-align: left; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); cursor: pointer; transition: all .15s; }
.isi-kota button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.isi-kepala { display: flex; align-items: center; gap: 10px; }
.isi-judul { flex: 1; min-width: 0; text-align: center; }
.isi-judul h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isi-item { display: flex; flex-direction: column; }
.isi-baris { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); border-radius: 6px; }
.isi-nama { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.isi-nama small { display: block; color: var(--text-3); font-size: 11px; font-family: var(--mono); }
.isi-baris input { width: 96px; flex: none; text-align: right; font-size: 16px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.isi-baris.diubah { background: var(--brand-soft); }
.isi-baris.diubah input { border-color: var(--brand); font-weight: 600; }
.isi-baris.salah input { border-color: var(--danger); background: var(--danger-soft); }
.isi-baris.kunci { opacity: .7; }
.isi-simpan { position: sticky; bottom: 10px; z-index: 5; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--sh); }
.isi-simpan span { margin-right: auto; font-weight: 600; }
@media (max-width: 640px) { .isi-kota { grid-template-columns: repeat(2, minmax(0, 1fr)); } .isi-baris input { width: 84px; } }
