/* =====================================================
   E-Billing — Stylesheet
   Palet: hijau pinus (utama), kertas sejuk (latar),
   kuning amber (menunggu), merah bata (peringatan).
   Angka & nomor invoice memakai huruf monospace.
   ===================================================== */
:root {
  --hijau-tua:  #10312b;
  --hijau:      #1b7a53;
  --hijau-muda: #e3f0e9;
  --kertas:     #f2f4f3;
  --putih:      #ffffff;
  --tinta:      #1d2723;
  --abu:        #6b7a74;
  --garis:      #dde4e1;
  --amber:      #b97e14;
  --amber-muda: #fbf1dc;
  --merah:      #b3402e;
  --merah-muda: #f9e7e3;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
img, video, audio, iframe, table { max-width: 100%; }
.dua-kolom > *, .layout > * { min-width: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--kertas);
  color: var(--tinta);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--hijau); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--hijau-tua); color: #d8e6df;
  display: flex; flex-direction: column;
  padding: 22px 16px;
}
.konten { flex: 1; padding: 28px 34px; max-width: 1200px; }
.konten-header h1 { font-size: 1.45rem; margin-bottom: 18px; font-weight: 650; }

/* ---------- Brand & navigasi ---------- */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand-mark {
  font-family: var(--mono); font-weight: 700;
  background: var(--hijau); color: #fff;
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 700; font-size: 1.05rem; color: #fff; }
.brand-logo { height: 36px; max-width: 130px; object-fit: contain; border-radius: 7px; background: #fff; padding: 4px 6px; }
.logo-pratinjau { display: flex; align-items: center; gap: 12px; }
.logo-pratinjau span { color: var(--abu); font-size: .85rem; }
.logo-pratinjau img { height: 48px; max-width: 160px; object-fit: contain; border: 1px solid var(--garis); border-radius: 8px; padding: 4px; background: #fff; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: #bcd2c9; padding: 9px 12px; border-radius: 8px; font-size: .95rem;
  display: flex; align-items: center; gap: 10px;
}
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.aktif { background: var(--hijau); color: #fff; font-weight: 600; }
.nav-ikon { font-size: 1.05rem; line-height: 1; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; }
.sidebar-bawah { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.user-info strong { display: block; color: #fff; font-size: .92rem; }
.user-info small { color: #9eb6ac; }
.btn-keluar {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: #f3c9c0; font-size: .88rem;
}
.btn-keluar .nav-ikon { font-size: 1rem; width: auto; }

/* ---------- Kartu ---------- */
.kartu {
  background: var(--putih); border: 1px solid var(--garis);
  border-radius: 12px; padding: 20px 22px; margin-bottom: 20px;
}
.kartu-judul {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.kartu-judul h2 { font-size: 1.05rem; font-weight: 650; }
.dua-kolom { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }

/* ---------- Statistik ---------- */
.grid-stat {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.kartu-stat {
  background: var(--putih); border: 1px solid var(--garis);
  border-radius: 12px; padding: 16px 18px;
  border-left: 4px solid var(--hijau);
}
.kartu-stat small { color: var(--abu); display: block; margin-bottom: 4px; }
.kartu-stat .angka { font-size: 1.25rem; font-family: var(--mono); }
.stat-merah  { border-left-color: var(--merah); }
.stat-kuning { border-left-color: var(--amber); }
.stat-hijau  { border-left-color: var(--hijau); }

/* ---------- Tabel ---------- */
.tabel { width: 100%; border-collapse: collapse; }
.tabel th {
  text-align: left; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--abu);
  border-bottom: 2px solid var(--garis); padding: 8px 10px;
}
.tabel td { padding: 10px; border-bottom: 1px solid var(--garis); vertical-align: top; }
.tabel tr:last-child td { border-bottom: none; }
.tabel .kosong { text-align: center; color: var(--abu); padding: 24px; }
.aksi { white-space: nowrap; }

/* ---------- Pill status ---------- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.pill-hijau  { background: var(--hijau-muda); color: var(--hijau); }
.pill-kuning { background: var(--amber-muda); color: var(--amber); }
.pill-merah  { background: var(--merah-muda); color: var(--merah); }
.pill-abu    { background: #eef0ef; color: var(--abu); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--garis); background: var(--putih);
  color: var(--tinta); font-size: .9rem; cursor: pointer; font-weight: 600;
}
.btn:hover { text-decoration: none; border-color: var(--hijau); color: var(--hijau); }
.btn-utama { background: var(--hijau); border-color: var(--hijau); color: #fff; }
.btn-utama:hover { background: #166544; color: #fff; }
.btn-bahaya { color: var(--merah); border-color: #ecc8c0; }
.btn-bahaya:hover { background: var(--merah); border-color: var(--merah); color: #fff; }
.btn-kecil { padding: 5px 11px; font-size: .82rem; }
.btn-blok { width: 100%; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Formulir ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-lebar { max-width: 460px; }
.form label { font-size: .88rem; font-weight: 600; display: flex; flex-direction: column; gap: 5px; }
.form label small { color: var(--abu); font-weight: 400; }
.form input, .form select, .form textarea {
  padding: 9px 11px; border: 1px solid var(--garis); border-radius: 8px;
  font: inherit; background: var(--putih); width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--hijau); outline-offset: 0; border-color: var(--hijau);
}
.form-aksi { display: flex; gap: 8px; margin-top: 4px; }
.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; font-size: .92rem; }
.flash-hijau { background: var(--hijau-muda); color: #0e5237; border: 1px solid #bcdccb; }
.flash-merah { background: var(--merah-muda); color: var(--merah); border: 1px solid #ecc8c0; }
.flash-kuning { background: var(--amber-muda); color: var(--amber); border: 1px solid #ecd9a8; }

/* ---------- Keterangan ---------- */
.keterangan { color: var(--abu); margin-bottom: 16px; font-size: .92rem; max-width: 800px; }

/* ---------- Combobox uraian (searchable) ---------- */
.combo { position: relative; }
.combo-input { width: 100%; }
.combo-bantuan { display: block; color: var(--abu); font-weight: 400; margin-top: 3px; }
.combo-list {
  display: none; position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--putih); border: 1px solid var(--garis); border-radius: 10px;
  max-height: 260px; overflow-y: auto; box-shadow: 0 12px 30px rgba(10,35,28,.15);
}
.combo-list.buka { display: block; }
.combo-opsi { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--garis); }
.combo-opsi:last-child { border-bottom: none; }
.combo-opsi:hover { background: var(--hijau-muda); }
.combo-opsi strong { display: inline; font-weight: 600; }
.combo-opsi small { display: block; color: var(--abu); font-weight: 400; margin-top: 2px; }
.combo-harga { float: right; font-family: var(--mono); font-size: .82rem; color: var(--hijau); }
.combo-kosong { padding: 12px; color: var(--abu); text-align: center; }
.combo-caret { position: absolute; right: 12px; top: 11px; color: var(--abu); pointer-events: none; font-size: .9rem; }
.combo-input { padding-right: 30px; cursor: pointer; }

/* ---------- Toggle switch & baris pengaturan ---------- */
.kartu-sempit { max-width: 640px; }
.setel-baris {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--garis);
}
.setel-teks { flex: 1 1 0; min-width: 0; }
.setel-baris strong { display: block; }
.setel-baris small { color: var(--abu); display: block; margin-top: 2px; }
.setel-blok { padding: 16px 0 4px; }
.setel-judul { margin-bottom: 10px; }
.setel-judul strong { display: block; }
.setel-judul small { color: var(--abu); }
.keterangan-kecil { font-size: .85rem; margin: 0; }
.nada-custom { border-top: 1px solid var(--garis); padding-top: 14px; margin-top: 6px; }
.nada-custom strong { display: block; margin-bottom: 4px; }
.nada-custom small { display: block; color: var(--abu); margin-bottom: 8px; }
.nada-custom input[type=file] { font: inherit; max-width: 100%; }
#custom-info { margin-top: 8px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; cursor: pointer; background: #c7d0cc; border-radius: 99px; transition: .2s; }
.slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--hijau); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus + .slider { outline: 2px solid var(--hijau); outline-offset: 2px; }

/* ---------- Tombol install PWA ---------- */
.btn-install {
  display: block; width: 100%; margin-bottom: 12px; padding: 9px 12px;
  background: var(--hijau); color: #fff; border: none; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn-install:hover { background: #166544; }

/* ---------- Daftar pilihan nada ---------- */
.daftar-nada { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.nada-baris {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 10px; border-radius: 8px;
}
.nada-baris:hover { background: var(--kertas); }
.nada-pilih { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.nada-pilih input { width: 17px; height: 17px; accent-color: var(--hijau); }
.btn-preview { min-width: 38px; }

/* ---------- Badge notifikasi di sidebar ---------- */
.nav-notif { display: flex; align-items: center; gap: 10px; }
.badge-notif {
  margin-left: auto;
  background: var(--merah); color: #fff; border-radius: 99px;
  min-width: 20px; height: 20px; padding: 0 6px;
  font-size: .72rem; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center;
}

/* ---------- Daftar notifikasi ---------- */
.notif-item {
  display: flex; gap: 12px; padding: 13px 6px; align-items: flex-start;
  border-bottom: 1px solid var(--garis); color: var(--tinta);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { text-decoration: none; background: var(--kertas); border-radius: 8px; }
.notif-titik { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: transparent; }
.notif-baru { background: var(--hijau-muda); border-radius: 8px; }
.notif-baru .notif-titik { background: var(--hijau); }
.notif-isi strong { display: block; }
.notif-isi p { margin: 2px 0; color: #44504a; }
.notif-isi small { color: var(--abu); }

/* ---------- Detail invoice ---------- */
.kartu-invoice { border-top: 4px solid var(--hijau); }
.invoice-atas {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.invoice-atas small, .invoice-grid small {
  color: var(--abu); text-transform: uppercase; font-size: .72rem; letter-spacing: .06em;
}
.invoice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.jumlah-besar { font-size: 1.35rem; font-weight: 700; color: var(--hijau-tua); }

/* ---------- Bukti pembayaran ---------- */
.bukti-item {
  display: flex; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--garis); align-items: flex-start;
}
.bukti-item:last-child { border-bottom: none; }
.bukti-pratinjau img {
  width: 120px; height: 90px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--garis);
}
.bukti-info p { margin-bottom: 3px; }
.form-verifikasi { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.form-verifikasi input {
  padding: 6px 10px; border: 1px solid var(--garis); border-radius: 7px; font: inherit;
}

/* ---------- Halaman login ---------- */
.halaman-login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background:
    linear-gradient(160deg, var(--hijau-tua) 0%, #1b4a3c 55%, var(--hijau) 100%);
  padding: 20px;
}
.kotak-login {
  background: var(--putih); border-radius: 16px; padding: 34px 32px;
  width: 100%; max-width: 400px; box-shadow: 0 18px 50px rgba(10, 35, 28, .35);
}
.brand-login { margin-bottom: 8px; }
.brand-login .brand-name { color: var(--hijau-tua); font-size: 1.25rem; }
.login-sub { color: var(--abu); margin-bottom: 20px; font-size: .92rem; }
.kotak-login form { display: flex; flex-direction: column; gap: 14px; }
.kotak-login label { font-size: .88rem; font-weight: 600; display: flex; flex-direction: column; gap: 5px; }
.kotak-login input {
  padding: 10px 12px; border: 1px solid var(--garis); border-radius: 9px; font: inherit;
}
.kotak-login input:focus { outline: 2px solid var(--hijau); border-color: var(--hijau); }
.login-bantuan { margin-top: 18px; text-align: center; color: var(--abu); }
.login-atau { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--abu); font-size: .85rem; }
.login-atau::before, .login-atau::after { content: ""; flex: 1; height: 1px; background: var(--garis); }
.g_id_signin { display: flex; justify-content: center; width: 100%; overflow: hidden; }
.g_id_signin iframe { max-width: 100% !important; margin: 0 auto !important; }
.login-bantuan code { font-family: var(--mono); background: var(--kertas); padding: 1px 5px; border-radius: 5px; }

/* ---------- Input terkunci (read-only) ---------- */
.input-terkunci {
  background: var(--kertas); color: var(--tinta); font-weight: 600;
  border: 1px dashed var(--garis); width: 100%; padding: 9px 11px;
  border-radius: 8px; font: inherit; cursor: default;
}

/* ---------- Bottom nav & sheet (default tersembunyi di desktop) ---------- */
.bottom-nav, .sheet-lainnya, .sheet-overlay { display: none; }

/* ---------- Chat ---------- */
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--hijau); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.chat-list { display: flex; flex-direction: column; }
.chat-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--garis); color: var(--tinta); }
.chat-list-item:last-child { border-bottom: none; }
.chat-list-item:hover { background: var(--kertas); border-radius: 8px; text-decoration: none; }
.chat-list-item .chat-avatar { width: 36px; height: 36px; font-size: .9rem; }
.chat-list-teks { flex: 1; min-width: 0; }
.chat-list-teks strong { display: block; font-size: .9rem; }
.chat-list-teks small { color: var(--abu); display: block; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-wrap { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 70vh; }
.chat-judul { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--hijau-tua); color: #fff; }
.chat-judul small { color: rgba(255,255,255,.75); display: block; }
.chat-judul .chat-avatar { background: rgba(255,255,255,.22); color: #fff; }
.chat-back { color: #fff; font-size: 1.4rem; line-height: 1; text-decoration: none; display: none; }
.chat-back:hover { text-decoration: none; opacity: .8; }
.chat-pesan {
  flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 6px;
  background: #e9e2d8;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px);
  background-size: 22px 22px;
}
.chat-bubble { max-width: 80%; padding: 7px 11px 5px; border-radius: 12px; font-size: .92rem; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chat-bubble.dipilih { box-shadow: 0 0 0 2px rgba(27,122,83,.55); }
.chat-aksi-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8,20,16,.35); }
.chat-aksi-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; background: #fff;
  border-radius: 16px 16px 0 0; padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0,0,0,.2); transform: translateY(100%); transition: transform .2s ease;
}
.chat-aksi-sheet.buka { transform: translateY(0); }
.chat-aksi-sheet .grip { width: 42px; height: 5px; background: var(--garis); border-radius: 99px; margin: 6px auto 10px; }
.chat-aksi-sheet button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; padding: 14px 14px; font: inherit; cursor: pointer; color: var(--tinta); border-radius: 10px;
}
.chat-aksi-sheet button:hover { background: var(--kertas); }
.chat-aksi-sheet button.bahaya { color: var(--merah); }
.chat-aksi-sheet button.batal { justify-content: center; color: var(--abu); margin-top: 4px; }
.chat-bubble.kiri { align-self: flex-start; background: #fff; color: var(--tinta); border-top-left-radius: 4px; }
.chat-bubble.kanan { align-self: flex-end; background: #d9fdd3; color: #102a1e; border-top-right-radius: 4px; }
.chat-teks { white-space: pre-wrap; line-height: 1.4; }
.chat-waktu { font-size: .64rem; color: rgba(0,0,0,.45); margin-top: 2px; text-align: right; }
.chat-img { max-width: 220px; max-height: 240px; border-radius: 9px; display: block; margin-bottom: 4px; }
.chat-file { display: inline-block; padding: 8px 12px; background: rgba(0,0,0,.06); border-radius: 9px; margin-bottom: 4px; color: inherit; font-weight: 500; }
.chat-form { display: flex; align-items: center; gap: 6px; padding: 9px 8px; border-top: 1px solid var(--garis); background: #f4f1ec; }
.chat-form input[type=text] { flex: 1 1 0; min-width: 0; padding: 10px 14px; border: 1px solid var(--garis); border-radius: 99px; font: inherit; background: #fff; }
.chat-lampiran { cursor: pointer; font-size: 1.35rem; line-height: 1; padding: 3px; color: var(--abu); flex-shrink: 0; }
.chat-ikon { background: none; border: none; cursor: pointer; font-size: 1.3rem; line-height: 1; padding: 3px; color: var(--abu); flex-shrink: 0; }
.chat-ikon:hover { color: var(--hijau); }
.chat-audio { display: block; max-width: 230px; height: 40px; margin-bottom: 4px; }
.emoji-panel {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px 10px; background: #fff; border-top: 1px solid var(--garis); max-height: 168px; overflow-y: auto;
}
.emoji-panel button { background: none; border: none; cursor: pointer; font-size: 1.3rem; padding: 4px; border-radius: 6px; }
.emoji-panel button:hover { background: var(--kertas); }
.rekam-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #fff; border-top: 1px solid var(--garis); font-size: .9rem;
}
.rekam-bar .btn { margin-left: 0; }
.rekam-bar #rekam-batal { margin-left: auto; }
.rekam-titik { width: 11px; height: 11px; border-radius: 50%; background: var(--merah); animation: kedip 1s infinite; }
@keyframes kedip { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.chat-send { background: var(--hijau); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.05rem; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.chat-send:hover { background: #166544; }
.chat-file-info { font-size: .78rem; color: var(--abu); padding: 4px 14px 0; }

/* ---------- Responsif: navigasi bawah di mobile ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .konten { padding: 16px 14px 84px; }
  .dua-kolom { grid-template-columns: 1fr; }
  .tabel { display: block; overflow-x: auto; }
  .kartu-sempit { max-width: 100%; }

  .sidebar { display: none; }

  /* Bar navigasi bawah */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: var(--hijau-tua); border-top: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 -4px 16px rgba(8,28,22,.3);
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px 7px; color: #bcd2c9; background: transparent; border: none;
    font: inherit; font-size: .66rem; cursor: pointer; position: relative; text-decoration: none;
  }
  .bn-item.aktif { color: #fff; }
  .bn-item.aktif::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; background: var(--hijau); border-radius: 0 0 3px 3px; }
  .bn-ikon { font-size: 1.4rem; line-height: 1; }
  .bn-label { font-size: .64rem; }
  .bn-item .badge-notif { position: absolute; top: 3px; right: 50%; transform: translateX(15px); min-width: 16px; height: 16px; font-size: .6rem; padding: 0 4px; margin: 0; }
  .bn-dot { position: absolute; top: 6px; right: 50%; transform: translateX(12px); width: 9px; height: 9px; background: var(--merah); border-radius: 50%; }

  /* Sheet "Lainnya" */
  .sheet-overlay { display: block; position: fixed; inset: 0; background: rgba(8,20,16,.45); z-index: 110; }
  .sheet-lainnya {
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    background: #fff; border-radius: 16px 16px 0 0; padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
    transform: translateY(100%); transition: transform .22s ease; max-height: 70vh; overflow-y: auto;
  }
  .sheet-lainnya.buka { transform: translateY(0); }
  .sheet-grip { width: 42px; height: 5px; background: var(--garis); border-radius: 99px; margin: 6px auto 10px; }
  .sheet-lainnya a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; color: var(--tinta); border-radius: 10px; font-weight: 500; }
  .sheet-lainnya a:hover { background: var(--kertas); text-decoration: none; }
  .sheet-lainnya .badge-notif { margin-left: auto; }
  .sheet-keluar { color: var(--merah) !important; }

  .chat-wrap { height: calc(100vh - 188px); }

  /* Chat layar penuh (mirip WhatsApp) saat membuka percakapan */
  .layar-chat .bottom-nav { display: none; }
  .layar-chat .konten-header { display: none; }
  .layar-chat .konten { padding: 0; }
  .layar-chat .chat-wrap {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none; height: auto;  /* top+bottom mengisi viewport nyata, hindari 100vh berlebih */
    margin: 0; border: none; border-radius: 0; z-index: 60;
  }
  .layar-chat .chat-form { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .layar-chat .chat-back { display: inline-block; }
}

/* ---------- Tabel jadi kartu di mode mobile (≤900px) ---------- */
@media (max-width: 900px) {
  .tabel-responsif thead { display: none; }
  .tabel-responsif, .tabel-responsif tbody { display: block; width: 100%; }
  .tabel-responsif tr {
    display: block; background: #fff; border: 1px solid var(--garis);
    border-radius: 12px; padding: 4px 14px; margin-bottom: 12px;
  }
  .tabel-responsif td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 10px 0; border: none; border-bottom: 1px solid var(--garis); text-align: right;
  }
  .tabel-responsif td:last-child { border-bottom: none; }
  .tabel-responsif td::before {
    content: attr(data-label); font-weight: 600; color: var(--abu);
    text-align: left; flex-shrink: 0; white-space: nowrap;
  }
  .tabel-responsif td small { display: inline; }
  .tabel-responsif td.kosong { justify-content: center; text-align: center; color: var(--abu); }
  .tabel-responsif td.kosong::before { content: ""; }
  .tabel-responsif td.aksi { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .tabel-responsif td.aksi::before { display: none; }
  .tabel-responsif td.aksi .btn { flex: 1 1 auto; text-align: center; }

  /* Login lebih pas di HP */
  .kotak-login { padding: 26px 20px; }
  .g_id_signin iframe { max-width: 100% !important; }

  /* Judul kartu + filter rapi (mis. halaman Pengguna & Tagihan) */
  .kartu-judul { flex-direction: column; align-items: stretch; gap: 10px; }
  .kartu-judul .filter { width: 100%; }
  .kartu-judul .filter .btn { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
