/* ===========================================
   SERIKAT PETSHOP - Tampilan Aplikasi Kasir
   =========================================== */
:root {
  --utama: #0F766E;
  --utama-gelap: #0B5953;
  --utama-muda: #E6F4F2;
  --aksen: #F59E0B;
  --aksen-muda: #FEF3C7;
  --bg: #F4F6F5;
  --kartu: #FFFFFF;
  --teks: #1F2A2E;
  --teks-2: #5B6B70;
  --garis: #E2E8E6;
  --merah: #DC2626;
  --merah-muda: #FEE2E2;
  --hijau: #16A34A;
  --hijau-muda: #DCFCE7;
  --biru: #2563EB;
  --biru-muda: #DBEAFE;
  --ungu: #7C3AED;
  --radius: 14px;
  --bayangan: 0 1px 2px rgba(16, 40, 36, .06), 0 4px 14px rgba(16, 40, 36, .06);
  --sidebar: 212px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--teks); font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--utama); }
.ikon { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }
.angka { font-variant-numeric: tabular-nums; }
.redup { color: var(--teks-2); }
.kecil { font-size: 13px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--utama); color: #fff; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 20px; letter-spacing: 1.5px; font-weight: 800; }
.brand-text small { font-size: 11px; letter-spacing: 5px; color: var(--aksen); font-weight: 800; margin-top: 4px; }
.menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.menu a, .menu-btn { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.menu a:hover, .menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.menu a.aktif { background: #fff; color: var(--utama); }
.sidebar-bawah { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255,255,255,.15); padding-top: 10px; }
.akun { display: flex; align-items: center; gap: 12px; padding: 8px 12px; color: #fff; font-weight: 600; }
.akun span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.akun small { color: rgba(255,255,255,.7); font-weight: 500; font-size: 12px; }
.konten { flex: 1; margin-left: var(--sidebar); min-width: 0; padding: 20px 24px 40px; }

.judul-hal { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.judul-hal h1 { font-size: 22px; margin: 0; }
.judul-hal p { margin: 2px 0 0; color: var(--teks-2); }

/* ---------- Komponen umum ---------- */
.kartu { background: var(--kartu); border-radius: var(--radius); box-shadow: var(--bayangan); padding: 16px; }
.kartu h2 { font-size: 16px; margin: 0 0 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--garis); background: #fff; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--teks); min-height: 42px; white-space: nowrap; }
.btn:hover { border-color: #c8d3d0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-utama { background: var(--utama); border-color: var(--utama); color: #fff; }
.btn-utama:hover { background: var(--utama-gelap); }
.btn-aksen { background: var(--aksen); border-color: var(--aksen); color: #1c1403; }
.btn-bahaya { background: #fff; border-color: #f3b4b4; color: var(--merah); }
.btn-besar { min-height: 56px; font-size: 18px; border-radius: 12px; width: 100%; }
.btn-kecil { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn-ikon { width: 42px; padding: 0; }

input[type=text], input[type=search], input[type=number], input[type=password], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--garis); border-radius: 10px; background: #fff; min-height: 44px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(15,118,110,.25); border-color: var(--utama); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--teks-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .penuh { grid-column: 1 / -1; }
.cek { flex-direction: row; align-items: center; gap: 10px; }
.cek input { width: 20px; height: 20px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--garis); background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip.aktif { background: var(--utama); border-color: var(--utama); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }

.lencana { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.lencana-Tunai { background: var(--hijau-muda); color: #166534; }
.lencana-QRIS { background: var(--biru-muda); color: #1e40af; }
.lencana-Transfer { background: #EDE9FE; color: #5B21B6; }
.lencana-batal { background: var(--merah-muda); color: #991b1b; }
.lencana-abu { background: #EEF2F1; color: var(--teks-2); }

.alert { padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.alert-err { background: var(--merah-muda); color: #991b1b; }
.alert-ok { background: var(--hijau-muda); color: #166534; }
.alert-info { background: var(--aksen-muda); color: #78350f; }

.tabel-wrap { overflow-x: auto; }
table.tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabel th, .tabel td { padding: 10px 10px; border-bottom: 1px solid var(--garis); text-align: left; white-space: nowrap; }
.tabel th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--teks-2); background: #F8FAF9; position: sticky; top: 0; cursor: default; }
.tabel th[data-urut] { cursor: pointer; user-select: none; }
.tabel th[data-urut]:hover { color: var(--utama); }
.tabel td.r, .tabel th.r { text-align: right; }
.tabel tfoot td { font-weight: 800; background: #F8FAF9; border-top: 2px solid var(--garis); }
.tabel tbody tr:hover { background: #FAFCFB; }
.untung { color: var(--hijau); }
.rugi { color: var(--merah); }

.kosong { text-align: center; color: var(--teks-2); padding: 40px 10px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 30, 28, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-isi { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-kepala { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--garis); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-kepala h3 { margin: 0; font-size: 18px; }
.modal-badan { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-kaki { padding: 14px 18px; border-top: 1px solid var(--garis); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.tutup { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--teks-2); width: 40px; height: 40px; border-radius: 10px; }
.tutup:hover { background: var(--bg); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1F2A2E; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 90vw; }
.toast.tampil { opacity: 1; transform: translateX(-50%); }
.toast.gagal { background: var(--merah); }

/* ---------- Login ---------- */
.hal-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(160deg, var(--utama-muda), #fff 55%, var(--aksen-muda)); }
.kartu-login { background: #fff; padding: 28px; border-radius: 20px; box-shadow: 0 10px 40px rgba(15,118,110,.15); width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.logo-login { width: 100%; max-width: 300px; margin: 0 auto 6px; display: block; }
.kartu-login h1 { margin: 0; font-size: 22px; }
.sub { margin: 0; color: var(--teks-2); }

/* ---------- KASIR ---------- */
.hal-kasir .konten { padding: 0; }
.kasir { display: grid; grid-template-columns: 1fr 380px; height: 100vh; }
.kasir-produk { display: flex; flex-direction: column; min-width: 0; padding: 16px 20px 0; overflow: hidden; }
.kasir-atas { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.cari-besar { position: relative; flex: 1; }
.cari-besar input { padding-left: 44px; min-height: 52px; font-size: 17px; border-radius: 14px; border-width: 2px; }
.cari-besar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--teks-2); }
.ringkas-hari { display: flex; gap: 6px; flex-direction: column; font-size: 12px; color: var(--teks-2); text-align: right; line-height: 1.2; }
.ringkas-hari b { color: var(--teks); font-size: 15px; }
.grid-produk { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-content: start; grid-auto-rows: max-content; padding: 12px 2px 20px; }
.kartu-produk { position: relative; background: #fff; border: 2px solid transparent; border-radius: 14px; padding: 12px 12px 12px 16px; text-align: left; cursor: pointer; box-shadow: var(--bayangan); min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; transition: transform .08s, border-color .15s; height: auto; }
.kartu-produk::before { content: ""; position: absolute; left: -2px; top: -2px; bottom: -2px; width: 8px; border-radius: 14px 0 0 14px; background: var(--warna, var(--utama)); }
.kartu-produk:hover { border-color: var(--warna, var(--utama)); }
.kartu-produk:active { transform: scale(.97); }
.kartu-produk .nm { font-weight: 700; font-size: 15px; line-height: 1.25; }
.kartu-produk .hg { font-weight: 800; color: var(--utama); font-size: 16px; }
.kartu-produk .kt { font-size: 11px; color: var(--teks-2); text-transform: uppercase; letter-spacing: .4px; }
.kartu-produk .jml { position: absolute; top: 8px; right: 8px; background: var(--aksen); color: #1c1403; font-weight: 800; font-size: 13px; min-width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; padding: 0 7px; }
.kartu-produk.pop { animation: pop .25s; }
@keyframes pop { 50% { transform: scale(1.05); } }

.keranjang { background: #fff; border-left: 1px solid var(--garis); display: flex; flex-direction: column; height: 100vh; }
.keranjang-kepala { padding: 16px 18px; border-bottom: 1px solid var(--garis); display: flex; justify-content: space-between; align-items: center; }
.keranjang-kepala h2 { margin: 0; font-size: 18px; }
.keranjang-daftar { flex: 1; overflow-y: auto; padding: 8px 12px; }
.item-krj { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 6px; border-bottom: 1px dashed var(--garis); }
.item-krj .nm { font-weight: 700; line-height: 1.25; }
.item-krj .hs { font-size: 13px; color: var(--teks-2); }
.item-krj .hs button { background: none; border: 0; color: var(--utama); font-size: 13px; padding: 0; cursor: pointer; text-decoration: underline; }
.item-krj .sub { font-weight: 800; text-align: right; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--garis); background: #fff; font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper button:active { background: var(--utama-muda); }
.stepper input { width: 52px; text-align: center; min-height: 38px; padding: 4px; font-weight: 700; }
.hapus-item { background: none; border: 0; color: var(--merah); cursor: pointer; font-size: 13px; font-weight: 600; justify-self: end; }
.keranjang-kaki { padding: 14px 18px 18px; border-top: 1px solid var(--garis); display: flex; flex-direction: column; gap: 12px; background: #FBFCFB; }
.total-baris { display: flex; justify-content: space-between; align-items: baseline; }
.total-baris span { color: var(--teks-2); font-weight: 600; }
.total-baris b { font-size: 30px; color: var(--utama); }
.keranjang-kosong { text-align: center; color: var(--teks-2); padding: 50px 20px; }
.keranjang-kosong img { width: 90px; opacity: .35; margin-bottom: 10px; }
.bar-mobile { display: none; }

/* Modal pembayaran */
.bayar-total { text-align: center; background: var(--utama-muda); border-radius: 14px; padding: 14px; }
.bayar-total small { color: var(--teks-2); font-weight: 600; }
.bayar-total div { font-size: 36px; font-weight: 800; color: var(--utama); }
.pilih-metode { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pilih-metode button { min-height: 66px; padding: 6px 4px; font-size: 17px !important; border-radius: 14px; border: 2px solid var(--garis); background: #fff; font-size: 18px; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pilih-metode button small { font-size: 12px; font-weight: 500; color: var(--teks-2); }
.pilih-metode button.aktif { border-color: var(--utama); background: var(--utama-muda); color: var(--utama); }
.uang-cepat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.uang-cepat button { min-height: 48px; border-radius: 10px; border: 1px solid var(--garis); background: #fff; font-weight: 700; cursor: pointer; }
.uang-cepat button:hover { border-color: var(--utama); }
.input-uang { font-size: 26px !important; font-weight: 800; text-align: right; min-height: 60px !important; }
.kembalian { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--hijau-muda); font-weight: 700; }
.kembalian b { font-size: 26px; color: #166534; }
.kembalian.kurang { background: var(--merah-muda); }
.kembalian.netral { background: #EEF2F1; }
.kembalian.netral b { color: var(--teks-2); }
.kembalian.kurang b { color: var(--merah); }
.sukses { text-align: center; padding: 10px 0; }
.sukses .centang { width: 84px; height: 84px; border-radius: 50%; background: var(--hijau-muda); color: var(--hijau); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.sukses .centang svg { width: 48px; height: 48px; }
.sukses h3 { margin: 4px 0; font-size: 22px; }
.sukses .kmb { font-size: 34px; font-weight: 800; color: var(--hijau); }

/* ---------- Riwayat ---------- */
.ringkasan { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--bayangan); padding: 14px 16px; }
.stat small { color: var(--teks-2); font-weight: 600; font-size: 13px; display: block; }
.stat b { font-size: clamp(17px, 1.45vw, 21px); display: block; margin-top: 2px; white-space: nowrap; }
.stat .delta { font-size: 12px; font-weight: 700; margin-top: 4px; display: inline-block; }
.delta.naik { color: var(--hijau); }
.delta.turun { color: var(--merah); }
.stat.sorot { background: var(--utama); color: #fff; }
.stat.sorot small { color: rgba(255,255,255,.8); }
.stat.sorot .delta { color: #fff; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filter-bar label { min-width: 150px; }
.daftar-trx { display: flex; flex-direction: column; gap: 8px; }
.trx { background: #fff; border-radius: 12px; box-shadow: var(--bayangan); }
.trx-kepala { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.trx-kepala .jam { font-weight: 800; font-size: 16px; }
.trx-kepala .ringkas { min-width: 0; }
.trx-kepala .ringkas div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-kepala .tot { text-align: right; font-weight: 800; }
.trx.batal { opacity: .6; }
.trx.batal .tot { text-decoration: line-through; }
.trx-detail { border-top: 1px dashed var(--garis); padding: 12px 14px; display: none; }
.trx.buka .trx-detail { display: block; }
.trx-detail table { width: 100%; font-size: 14px; border-collapse: collapse; }
.trx-detail td { padding: 4px 0; }
.trx-detail .aksi { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Analisa ---------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-2s { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grafik { position: relative; height: 280px; }
.grafik.pendek { height: 220px; }
.wawasan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wawasan li { display: flex; gap: 10px; align-items: flex-start; background: #FAFCFB; border: 1px solid var(--garis); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.wawasan li::before { content: "💡"; }
.wawasan li.warn::before { content: "⚠️"; }
.bar-mini { height: 8px; background: var(--utama-muda); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar-mini i { display: block; height: 100%; background: var(--utama); }
.periode { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.periode input[type=date] { width: auto; min-height: 38px; padding: 6px 10px; }
.tab { display: flex; gap: 6px; border-bottom: 2px solid var(--garis); margin-bottom: 14px; overflow-x: auto; }
.tab button { background: none; border: 0; padding: 10px 14px; font-weight: 700; color: var(--teks-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab button.aktif { color: var(--utama); border-bottom-color: var(--utama); }

/* ---------- Produk ---------- */
.warna-kat { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.margin-info { font-size: 13px; padding: 10px 12px; background: var(--utama-muda); border-radius: 10px; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  :root { --sidebar: 76px; }
  .brand-text, .menu span, .sidebar-bawah span { display: none; }
  .brand { justify-content: center; padding: 4px 0 14px; }
  .menu a, .menu-btn, .akun { justify-content: center; padding: 12px 0; }
  .kasir { grid-template-columns: 1fr 340px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .sidebar { inset: auto 0 0 0; width: auto; height: calc(62px + env(safe-area-inset-bottom)); flex-direction: row; padding: 0 4px env(safe-area-inset-bottom); }
  .brand, .sidebar-bawah .akun, #btnInstall { display: none; }
  .sidebar-bawah { border: 0; padding: 0; flex-direction: row; }
  .menu { flex-direction: row; justify-content: space-around; gap: 0; }
  .menu a, .menu-btn { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 11px; border-radius: 10px; margin: 6px 0; }
  .menu span, .sidebar-bawah span { display: block; }
  .menu a.aktif { background: rgba(255,255,255,.18); color: #fff; }
  .konten { margin-left: 0; padding: 14px 14px calc(90px + env(safe-area-inset-bottom)); }
  .kasir { grid-template-columns: 1fr; height: calc(100vh - 62px); }
  .kasir-produk { padding: 12px 12px 0; }
  .ringkas-hari { display: none; }
  .kasir-aktif > span:last-child { display: none; }
  .kasir-aktif { padding: 4px; }
  .grid-produk { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding-bottom: 90px; }
  .kartu-produk { min-height: 88px; padding: 10px 10px 10px 14px; }
  .keranjang { position: fixed; inset: 0; z-index: 60; height: auto; transform: translateY(100%); transition: transform .25s; border: 0; }
  .keranjang.buka { transform: none; }
  .bar-mobile { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 40; background: var(--utama); color: #fff; border: 0; border-radius: 16px; padding: 12px 16px; align-items: center; justify-content: space-between; font-weight: 700; box-shadow: 0 8px 24px rgba(15,118,110,.35); cursor: pointer; }
  .bar-mobile b { font-size: 20px; }
  .bar-mobile .lihat { background: var(--aksen); color: #1c1403; padding: 8px 14px; border-radius: 10px; }
  .form-grid, .grid-2s { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-isi { border-radius: 18px 18px 0 0; max-height: 94vh; }
  .trx-kepala { grid-template-columns: 56px 1fr auto; gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 16px; }
  .ringkasan { grid-template-columns: 1fr 1fr; gap: 8px; }
  .judul-hal h1 { font-size: 20px; }
}
@media (min-width: 761px) { .tutup-krj { display: none; } }

/* ---------- Cetak ---------- */
@media print {
  .sidebar, .no-print, .filter-bar, .tab, .periode, .toast { display: none !important; }
  .konten { margin: 0; padding: 0; }
  body { background: #fff; }
  .kartu, .stat { box-shadow: none; border: 1px solid #ddd; }
  .tabel th { position: static; }
}

/* ---------- Ringkasan ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.kartu-periode .kp-kepala { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kartu-periode .kp-kepala b { font-size: 16px; }
.kp-omzet { font-size: 30px; font-weight: 800; color: var(--utama); margin-top: 6px; }
.kartu-periode.utama { border: 2px solid var(--utama); }
.kp-tabel { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.kp-tabel td { padding: 6px 0; }
.kp-tabel td.r { text-align: right; }
.kp-tabel tr.garis-atas td { border-top: 1px dashed var(--garis); }
.banding { padding: 0 4px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Pengeluaran ---------- */
.form-cepat { display: grid; grid-template-columns: 160px 1fr 170px 1fr auto; gap: 10px; align-items: end; }
.kat-pilih { display: flex; flex-wrap: wrap; gap: 6px; }
.item-keluar { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; background: #fff; border-radius: 12px; box-shadow: var(--bayangan); }
.item-keluar .jml { font-weight: 800; color: var(--merah); text-align: right; }
.item-keluar .aksi { grid-column: 1 / -1; display: flex; gap: 6px; }
@media (max-width: 1100px) { .form-cepat { grid-template-columns: 1fr 1fr; } .form-cepat .penuh { grid-column: 1 / -1; } }

/* navigasi bawah bisa digeser di HP */
@media (max-width: 760px) {
  .sidebar { overflow-x: auto; }
  .menu { justify-content: flex-start; }
  .menu a, .menu-btn { min-width: 64px; width: auto; flex: 1 0 64px; }
  .menu { flex: 1 0 auto; }
  .sidebar-bawah { flex: none; }
  .kp-omzet { font-size: 26px; }
}
.kp-tabel td.r, .kp-tabel td.redup { white-space: nowrap; }
.kp-tabel td:first-child { padding-right: 6px; }

/* ---------- QRIS & bukti bayar ---------- */
.blok-qris { display: flex; flex-direction: column; gap: 12px; }
.qris-kartu { background: #fff; border: 2px solid var(--garis); border-radius: 16px; padding: 12px; text-align: center; }
.qris-kartu img { width: 100%; max-width: 320px; max-height: 52vh; object-fit: contain; display: block; margin: 0 auto; cursor: zoom-in; border-radius: 8px; }
.qris-kartu .qris-total { font-size: 26px; font-weight: 800; color: var(--utama); margin-top: 6px; }
.qris-kartu .qris-bantu { font-size: 13px; color: var(--teks-2); }
.qris-kosong { padding: 18px; border: 2px dashed var(--garis); border-radius: 14px; text-align: center; color: var(--teks-2); font-size: 14px; }
.foto-bukti { border: 2px dashed var(--aksen); background: #FFFBEB; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.foto-bukti.ada { border-style: solid; border-color: var(--hijau); background: var(--hijau-muda); }
.foto-bukti .judul-bukti { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.foto-bukti img { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: #fff; align-self: center; cursor: zoom-in; }
.foto-bukti .tombol { display: flex; gap: 8px; }
.foto-bukti .tombol .btn { flex: 1; }
.foto-bukti input[type=file] { display: none; }
.thumb-bukti { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--garis); cursor: zoom-in; background: #fff; }
.layar-penuh { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; gap: 10px; }
.layar-penuh img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; background: #fff; border-radius: 12px; }
.layar-penuh .lp-atas { position: absolute; top: 8px; left: 16px; right: 8px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.layar-penuh .lp-bawah { color: #fff; text-align: center; font-size: 28px; font-weight: 800; }
.layar-penuh .lp-bawah small { display: block; font-size: 14px; font-weight: 500; opacity: .8; }
.qris-mini { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; border: 1px solid var(--garis); background: #fff; cursor: zoom-in; vertical-align: middle; }

.foto-bukti label.btn { flex-direction: row; cursor: pointer; font-size: 15px; }

.trx-kepala .ringkas div:last-child { white-space: normal; }

/* ---------- Masuk cepat PIN ---------- */
.pilih-kasir { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.kasir-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 2px solid var(--garis); background: #fff; border-radius: 14px; cursor: pointer; }
.kasir-btn.aktif { border-color: var(--utama); background: var(--utama-muda); }
.kasir-btn small { color: var(--teks-2); font-size: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--utama); color: #fff; font-weight: 800; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.kasir-btn:nth-child(3n+2) .avatar { background: var(--aksen); color: #1c1403; }
.kasir-btn:nth-child(3n+3) .avatar { background: #7C3AED; }
.input-pin { text-align: center; font-size: 30px !important; letter-spacing: 12px; font-weight: 800; margin-bottom: 10px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinpad button { min-height: 58px; font-size: 22px; font-weight: 800; border-radius: 12px; border: 1px solid var(--garis); background: #fff; cursor: pointer; }
.pinpad button:active { background: var(--utama-muda); }
.pinpad .ok { background: var(--utama); color: #fff; border-color: var(--utama); font-size: 17px; }
.kasir-aktif { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 999px; background: var(--utama-muda); color: var(--utama); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; }
.kasir-aktif .avatar { width: 30px; height: 30px; font-size: 14px; }
.kasir-aktif small { color: var(--teks-2); font-weight: 600; }

/* ---------- Stok ---------- */
.stok-angka { display: inline-block; min-width: 44px; padding: 3px 10px; border-radius: 8px; font-weight: 800; font-size: 16px; text-align: center; background: #EEF2F1; }
.stok-angka.habis { background: var(--merah-muda); color: var(--merah); }
.stok-angka.menipis { background: var(--aksen-muda); color: #92400e; }
.stok-angka.aman { background: var(--hijau-muda); color: #166534; }
.in-stok { width: 90px !important; min-height: 38px !important; text-align: right; padding: 6px 8px !important; font-weight: 700; }
.kartu-produk .stk { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: #EEF2F1; color: var(--teks-2); }
.kartu-produk .stk.menipis { background: var(--aksen-muda); color: #92400e; }
.kartu-produk .stk.habis { background: var(--merah-muda); color: var(--merah); }
.kartu-produk.kosong-stok { opacity: .6; }

/* ---------- Riwayat v5: rinci, ubah, hapus ---------- */
.segmen { display: inline-flex; border: 1px solid var(--garis); border-radius: 10px; overflow: hidden; background: #fff; }
.segmen button { border: 0; background: none; padding: 9px 14px; font-weight: 700; cursor: pointer; color: var(--teks-2); min-height: 42px; }
.segmen button.aktif { background: var(--utama); color: #fff; }
.tabel-item { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabel-item th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--teks-2); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--garis); }
.tabel-item td { padding: 6px; border-bottom: 1px dashed var(--garis); }
.tabel-item .r { text-align: right; }
.tabel-item tfoot td { border: 0; padding-top: 6px; }
.info-trx { margin-top: 10px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.tabel-rinci td { vertical-align: top; }
.tabel-rinci tr.awal-trx td { border-top: 2px solid var(--garis); }
.tabel-rinci tr.baris-batal td { color: var(--teks-2); text-decoration: line-through; background: #FEF2F2; }
.tabel-rinci tr.baris-batal td .lencana, .tabel-rinci tr.baris-batal td .btn { text-decoration: none; }
.cari-tambah { position: relative; }
.hasil-cari { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--garis); border-radius: 10px; box-shadow: var(--bayangan); z-index: 5; max-height: 260px; overflow: auto; }
.hasil-cari button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; cursor: pointer; text-align: left; border-bottom: 1px solid var(--garis); }
.hasil-cari button:hover { background: var(--utama-muda); }
.tabel-ubah td { vertical-align: middle; padding: 6px; white-space: normal; }
.in-harga { width: 100px !important; min-height: 38px !important; text-align: right; padding: 6px 8px !important; }
.banding-total { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 10px; background: var(--utama-muda); border-radius: 12px; flex-wrap: wrap; }
.banding-total b { font-size: 18px; }
.log-item { border: 1px solid var(--garis); border-radius: 12px; padding: 10px 12px; }
.log-banding { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; font-size: 13px; }
.log-banding > div { background: #F8FAF9; border-radius: 8px; padding: 8px; }
.log-banding small { color: var(--teks-2); font-weight: 700; display: block; margin-bottom: 4px; }
@media (max-width: 760px) { .log-banding { grid-template-columns: 1fr; } .tabel-ubah .stepper button { width: 32px; height: 32px; } .tabel-ubah .stepper input { width: 42px; } }
