/* =====================================================================
   POS Retail - gaya tampilan
   Palet hangat: oranye + krem + coklat tua.
   Untuk mengganti warna utama, ubah variabel --brand-* di bawah ini.
   ===================================================================== */

:root {
  --brand-50:  #FFF4EC;
  --brand-100: #FFE4CE;
  --brand-500: #F76707;
  --brand-600: #E8590C;
  --brand-700: #D9480F;
  --brand-800: #B83A0A;
  --brand-900: #8F2F08;
  --brand-500-rgb: 247,103,7;
  --brand-700-rgb: 217,72,15;

  --ink:     #2A2320;
  --muted:   #6F655F;
  --line:    #E9E0D7;
  --paper:   #FBF7F2;
  --surface: #FFFFFF;

  --side:       #2A1F1A;
  --side-2:     #3A2C25;
  --side-text:  #EADFD6;
  --side-muted: #A89A90;

  --ok:      #2B8A3E;
  --ok-bg:   #E6F4EA;
  --bad:     #C92A2A;
  --bad-bg:  #FDECEC;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(42,35,32,.06), 0 6px 20px rgba(42,35,32,.05);

  --accent: var(--brand-700);   /* dipakai gaya lama */
}

/* ---------- Dasar ---------- */
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .94rem;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); }
a:hover { color: var(--brand-800); }
h1, h2, h3, h4, .h4 { letter-spacing: -.01em; }
h1.h4, .h4 { font-weight: 700; }
.text-secondary { color: var(--muted) !important; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
code { color: var(--brand-800); background: var(--brand-50); padding: .08rem .35rem; border-radius: 5px; font-size: .85em; }

/* ---------- Kerangka aplikasi ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
@media (min-width: 992px) { .app-content { padding: 2rem 2.25rem 3rem; } }

/* ---------- Sidebar ---------- */
.sidebar {
  --bs-offcanvas-width: 280px;
  --bs-offcanvas-bg: var(--side);
  --bs-offcanvas-color: var(--side-text);
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar.offcanvas-lg {
    position: sticky;
    top: 0;
    flex: 0 0 260px;
    width: 260px !important;
    height: 100vh !important;
    background-color: var(--side) !important;
  }
}

.side-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; }
.side-brand-teks { display: flex; flex-direction: column; line-height: 1.15; }
.brand-nama { font-weight: 700; color: #fff; font-size: 1.02rem; }
.brand-sub  { font-size: .72rem; color: var(--side-muted); letter-spacing: .04em; }

.brand-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; font-size: 1.15rem;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 4px 12px rgba(var(--brand-500-rgb),.35);
  flex: none;
}
.brand-logo-kecil { width: 30px; height: 30px; border-radius: 9px; font-size: .95rem; box-shadow: none; }
.brand-logo-besar { width: 46px; height: 46px; border-radius: 13px; font-size: 1.35rem; background: rgba(255,255,255,.18); box-shadow: none; }

.side-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.side-grup {
  font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--side-muted);
  padding: 1rem .75rem .35rem;
}
.side-link {
  position: relative;
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .75rem;
  margin-bottom: 2px;
  border-radius: 10px;
  color: var(--side-text);
  font-weight: 500;
  text-decoration: none;
}
.side-link .bi { font-size: 1.05rem; opacity: .85; }
a.side-link:hover { background: var(--side-2); color: #fff; }
.side-link.aktif { background: rgba(var(--brand-500-rgb),.16); color: #fff; }
.side-link.aktif .bi { color: var(--brand-500); opacity: 1; }
.side-link.aktif::before {
  content: "";
  position: absolute; left: -.75rem; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand-500);
}
.side-soon { opacity: .5; cursor: default; }
.tag-segera {
  margin-left: auto;
  font-size: .62rem; font-weight: 600;
  padding: .08rem .45rem;
  border-radius: 999px;
  background: var(--side-2); color: var(--side-muted);
}

.side-user {
  display: flex; align-items: center; gap: .7rem;
  margin: 0;
  padding: .9rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-800);
  font-weight: 700;
}
.side-user-info { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.side-user-nama { color: #fff; font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-peran { color: var(--side-muted); font-size: .74rem; }
.btn-keluar {
  background: transparent; color: var(--side-text);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; padding: .3rem .55rem; line-height: 1;
}
.btn-keluar:hover { background: var(--side-2); color: #fff; }

/* ---------- Bilah atas (HP) ---------- */
.topbar-mobile {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.btn-menu {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; width: 38px; height: 38px; font-size: 1.3rem; line-height: 1;
  display: grid; place-items: center; padding: 0;
}

/* ---------- Panel dan kartu ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}
.ringkas-ok  { border-left: 4px solid var(--ok); }
.ringkas-bad { border-left: 4px solid var(--bad); }

/* ---------- Tombol ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem .95rem; }
.btn-sm { padding: .3rem .65rem; border-radius: 8px; font-size: .82rem; }
.btn .bi { margin-right: .4rem; }
.btn-aksi {
  background: var(--brand-700); border: 1px solid var(--brand-700); color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 4px 10px rgba(var(--brand-700-rgb),.18);
}
.btn-aksi:hover, .btn-aksi:focus { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--brand-50);
  --bs-btn-hover-color: var(--brand-800);
  --bs-btn-hover-border-color: var(--brand-100);
  --bs-btn-active-bg: var(--brand-100);
  --bs-btn-active-color: var(--brand-800);
  --bs-btn-active-border-color: var(--brand-100);
  background: var(--surface);
}

/* ---------- Formulir ---------- */
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: 10px; border-color: var(--line); padding: .55rem .8rem; background-color: var(--surface);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 .22rem rgba(var(--brand-500-rgb),.18);
}
.form-control:disabled, .form-select:disabled { background: var(--paper); }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand-700); border-color: var(--brand-700); }
.form-check-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 .22rem rgba(var(--brand-500-rgb),.18); }
.form-lebar { max-width: 680px; }
.input-kode { text-transform: uppercase; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-bar .form-control { flex: 1 1 260px; min-width: 200px; }
.filter-bar .form-select  { flex: 0 1 170px; }

/* ---------- Tabel ---------- */
.tabel-wrap { overflow-x: auto; padding: 0; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th {
  background: var(--paper);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .75rem 1rem; border-bottom-color: var(--line); }
.table tbody tr:hover > * { background: var(--brand-50); }
.table tbody tr:last-child > * { border-bottom: 0; }

/* ---------- Status dan pesan ---------- */
.status {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .18rem .65rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok  { background: var(--ok-bg);  color: var(--ok); }
.status.bad { background: var(--bad-bg); color: var(--bad); }

.pesan-ok, .pesan-bad { border-radius: 10px; padding: .7rem 1rem; font-size: .9rem; font-weight: 500; }
.pesan-ok  { background: var(--ok-bg);  color: var(--ok);  border: 1px solid #CDE8D4; }
.pesan-bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #F6CFCF; }
.pesan-ok .bi, .pesan-bad .bi { margin-right: .35rem; }

.badge-izin {
  display: inline-block;
  background: var(--paper); border: 1px solid var(--line); color: var(--muted);
  border-radius: 6px; padding: .08rem .5rem; margin: .15rem .15rem 0 0;
  font-size: .76rem; font-weight: 500;
}

/* ---------- Cek sistem ---------- */
.cek-table { width: 100%; border-collapse: collapse; }
.cek-table td { padding: .75rem .25rem; border-top: 1px solid var(--line); vertical-align: middle; }
.cek-table tr:first-child td { border-top: 0; }
.cek-table .detail { color: var(--muted); font-size: .85rem; }

/* ---------- Kartu master data ---------- */
.kartu-master {
  display: block; height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.kartu-master:hover { border-color: var(--brand-500); color: var(--ink); transform: translateY(-2px); }
.kartu-master-judul  { font-weight: 700; margin-bottom: .25rem; }
.kartu-master-isi    { color: var(--muted); font-size: .85rem; min-height: 2.6em; }
.kartu-master-jumlah { margin-top: .6rem; font-size: .78rem; font-weight: 700; color: var(--brand-700); }

/* ---------- Kelompok akses ---------- */
.grup-izin { margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.grup-izin:last-of-type { border-bottom: 0; }
.grup-izin-judul { font-size: .72rem; font-weight: 700; color: var(--brand-700); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }

/* ---------- Home ---------- */
.home-sapa {
  position: relative; overflow: hidden;
  border-radius: 16px;
  padding: 1.6rem 1.75rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700) 60%, #9A3409);
  box-shadow: 0 10px 28px rgba(var(--brand-700-rgb),.25);
}
.home-sapa::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.1);
}
.home-sapa h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 .25rem; position: relative; z-index: 1; }
.home-sapa p  { margin: 0; opacity: .92; position: relative; z-index: 1; }
.home-tanggal { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; opacity: .85; margin-bottom: .35rem; position: relative; z-index: 1; }

.stat-card {
  display: flex; align-items: center; gap: .9rem;
  height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
a.stat-card:hover { border-color: var(--brand-500); color: var(--ink); transform: translateY(-2px); }
.stat-ikon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--brand-50); color: var(--brand-700);
}
.stat-angka { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }

.judul-seksi { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 1.75rem 0 .75rem; }

.tile {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.tile:hover { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-800); }
.tile .bi { color: var(--brand-700); font-size: 1.2rem; }

details.rincian summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .85rem; }
details.rincian[open] summary { margin-bottom: .5rem; }

/* ---------- Login dan pemasangan ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-brand {
  position: relative; overflow: hidden;
  flex: 1 1 50%;
  flex-direction: column; justify-content: space-between;
  padding: 2.75rem 3.5rem;
  color: #fff;
  background: linear-gradient(150deg, var(--brand-500) 0%, var(--brand-700) 55%, var(--brand-900) 100%);
}
.auth-brand::before {
  content: ""; position: absolute; right: -180px; top: -160px;
  width: 520px; height: 520px; border-radius: 50%; background: rgba(255,255,255,.08);
}
.auth-brand::after {
  content: ""; position: absolute; left: -140px; bottom: -150px;
  width: 400px; height: 400px; border-radius: 50%; background: rgba(0,0,0,.1);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand-atas { display: flex; align-items: center; gap: .8rem; }
.auth-brand-nama { font-weight: 700; font-size: 1.15rem; }
.auth-judul { font-size: 2.1rem; font-weight: 800; line-height: 1.2; max-width: 440px; margin-bottom: .75rem; }
.auth-sub { font-size: 1.02rem; opacity: .92; margin-bottom: 1.75rem; }
.auth-poin { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.auth-poin li { display: flex; align-items: center; gap: .7rem; font-weight: 500; }
.auth-poin .bi { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.16); font-size: 1rem; }
.auth-kaki { font-size: .8rem; opacity: .75; }

.auth-form {
  flex: 1 1 50%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 2rem 1.25rem;
  background: var(--paper);
}
.auth-mini { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.5rem; }

/* Tampilan ponsel: latar terang berwarna lembut, logo besar tanpa kotak, kartu masuk di bawahnya.
   Latar netral dipilih supaya logo apa pun (berwarna atau gelap) tetap jelas terbaca. */
@media (max-width: 991.98px) {
  .auth-body { background: var(--paper); }
  .auth-form {
    position: relative; overflow: hidden;
    justify-content: flex-start; padding: 0 0 2.5rem;
    background:
      radial-gradient(120% 55% at 50% 0%, rgba(var(--brand-500-rgb), .16) 0%, rgba(var(--brand-500-rgb), 0) 72%),
      var(--paper);
  }
  .auth-form::before {
    content: ""; position: absolute; right: -90px; top: -100px;
    width: 260px; height: 260px; border-radius: 50%; background: rgba(var(--brand-500-rgb), .10);
  }
  .auth-form::after {
    content: ""; position: absolute; left: -70px; top: 120px;
    width: 160px; height: 160px; border-radius: 50%; background: rgba(var(--brand-700-rgb), .07);
  }
  .auth-form > * { position: relative; z-index: 1; }

  .auth-mini {
    align-self: stretch;
    flex-direction: column; justify-content: center; text-align: center; gap: .3rem;
    margin: 0; padding: 3.2rem 1.5rem 1.8rem;
  }
  .auth-logo-tile {
    display: flex; align-items: center; justify-content: center;
    margin: 0 0 .6rem; padding: 0; background: none; border: 0; box-shadow: none;
  }
  .auth-logo-tile .logo-toko {
    height: clamp(92px, 28vw, 116px); max-width: min(190px, 56vw);
    margin: 0 auto; object-position: center;
    filter: drop-shadow(0 8px 16px rgba(42, 35, 32, .20));
  }
  .auth-logo-tile .logo-toko.tanpa-nama { height: clamp(68px, 21vw, 88px); max-width: min(300px, 82vw); }
  .auth-logo-tile .brand-logo-hero { width: 84px; height: 84px; border-radius: 24px; font-size: 2.4rem; box-shadow: 0 10px 22px rgba(var(--brand-700-rgb), .30); }
  .auth-mini-nama { font-size: 1.55rem; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); }
  .auth-mini-sub { font-size: .9rem; color: var(--muted); max-width: 280px; margin: 0 auto; }

  .auth-flash { width: min(400px, calc(100% - 2.5rem)); }
  .kotak-masuk { width: min(400px, calc(100% - 2.5rem)); }
  .kotak-masuk .panel {
    padding: 1.7rem 1.5rem; border-radius: 22px; border: 1px solid rgba(var(--brand-500-rgb), .14);
    box-shadow: 0 18px 40px rgba(42, 35, 32, .12);
  }
  .kotak-masuk h1 { font-size: 1.4rem; }
  .kotak-masuk .form-control { padding-top: .72rem; padding-bottom: .72rem; border-radius: 12px; }
  .kotak-masuk .btn-aksi { padding-top: .8rem; padding-bottom: .8rem; font-size: 1.04rem; border-radius: 12px; }
}
.auth-flash { width: 100%; max-width: 400px; margin-bottom: 1rem; }
.kotak-masuk { width: 100%; max-width: 400px; margin: 0; }
.kotak-masuk .panel { padding: 2rem; }
.kotak-masuk h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }

/* ---------- Persediaan ---------- */
.status.warn { background: #FFF1D6; color: #9A5B00; }
.filter-bar .filter-tgl { flex: 0 1 150px; min-width: 140px; }
.rincian-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .15rem; }

.picker-wrap { position: relative; }
.picker-hasil {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(42,35,32,.14);
  max-height: 320px; overflow-y: auto;
}
.picker-item {
  display: flex; flex-direction: column; width: 100%; text-align: left;
  border: 0; background: transparent; padding: .6rem .9rem; border-bottom: 1px solid var(--line);
}
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover, .picker-item.aktif { background: var(--brand-50); }
.picker-nama { font-weight: 600; }
.picker-sub  { font-size: .78rem; color: var(--muted); }
.picker-pesan { font-size: .82rem; color: var(--muted); min-height: 1.3em; margin-top: .35rem; }
.picker-pesan.bad { color: var(--bad); }
.input-jumlah { width: 110px; margin-left: auto; }
tr.baris-baru > * { background: var(--brand-100) !important; }

/* ---------- Persediaan: tambahan 3B ---------- */
.selisih-plus { color: var(--ok); }
.selisih-min  { color: var(--bad); }
.link-item { color: var(--ink); font-weight: 600; text-decoration: none; }
.link-item:hover { color: var(--brand-700); text-decoration: underline; }
.baris-saldo > * { background: var(--paper); }

.badge-menu {
  margin-left: auto;
  min-width: 1.35rem; padding: .05rem .4rem;
  border-radius: 999px;
  background: var(--brand-500); color: #fff;
  font-size: .68rem; font-weight: 700; text-align: center;
}
.dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: 0 12px 30px rgba(42,35,32,.14); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-weight: 500; }
.dropdown-item .bi { margin-right: .6rem; color: var(--brand-700); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--brand-50); color: var(--brand-800); }
.btn-aksi.dropdown-toggle-split { border-left-color: rgba(255,255,255,.35); }

/* ---------- Layar kasir ---------- */
.ks-grid {
  display: grid; gap: 1rem; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "atas" "pilih" "cart" "ringkas";
}
.ks-atas    { grid-area: atas; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.ks-cart    { grid-area: cart; }
.ks-ringkas { grid-area: ringkas; }
.ks-pilih   { grid-area: pilih; }
@media (min-width: 992px) {
  .ks-atas { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* Kotak total besar */
.ks-total {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 130px; padding: 1rem 1.4rem; color: #fff; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700) 65%, #9A3409);
  box-shadow: 0 10px 28px rgba(var(--brand-700-rgb),.25);
}
.ks-total-label { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.ks-total-angka { font-size: clamp(2.1rem, 4.4vw, 3.1rem); font-weight: 800; line-height: 1.1; text-align: right; word-break: break-all; }
.ks-total-sub { font-size: .78rem; opacity: .92; text-align: right; margin-top: .35rem; }

/* Tabel keranjang dan tabel pilih cepat */
.ks-tabel { max-height: 420px; overflow: auto; }
.ks-tabel-pilih { max-height: 360px; }
.ks-pilih.tertutup .ks-tabel-pilih, .ks-pilih.tertutup .ks-pager { display: none; }
.ks-pilih.tertutup .ks-pilih-atas { border-bottom: 0; }
#per-hal { min-width: 112px; }
#filter-jenis { min-width: 150px; }
.tabel-keranjang .col-nama, .tabel-pilih .col-nama { min-width: 220px; }
.ks-tabel thead th { position: sticky; top: 0; z-index: 2; }
.keranjang-kosong { color: var(--muted); text-align: center; padding: 2rem 1rem !important; }
.tabel-keranjang td, .tabel-pilih td { padding-top: .45rem; padding-bottom: .45rem; }
.tabel-keranjang tr.baris-baru > * { background: var(--brand-100) !important; }

.k-qty { display: inline-flex; align-items: center; gap: .25rem; }
.k-qty input { width: 62px; }
.k-qty .btn { width: 30px; padding: .2rem 0; }
.k-harga-input { width: 110px; margin-left: auto; }
.k-stok { font-size: .74rem; color: var(--muted); }
.k-stok-kurang { color: var(--bad); font-weight: 600; }

.baris-pilih { cursor: pointer; }
.baris-pilih:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; background: var(--brand-50); }
.baris-pilih.nonaktif { opacity: .55; }

.ks-pilih-atas {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .9rem 1rem; border-bottom: 1px solid var(--line);
}
.ks-pilih-atas .form-select { width: auto; max-width: 170px; }
.ks-pager {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .7rem 1rem; border-top: 1px solid var(--line);
}
.pager { display: flex; align-items: center; gap: .3rem; }

/* Ringkasan dan pembayaran */
.ks-ringkas .form-control[readonly] { background: var(--paper); font-weight: 600; }
.form-control.kurang { color: var(--bad); border-color: var(--bad); }
.metode-grup { display: flex; flex-wrap: wrap; gap: .5rem; }
.metode-btn {
  flex: 1 1 90px; padding: .6rem .8rem; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.metode-btn:hover { border-color: var(--brand-500); }
.metode-btn.aktif { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.uang-cepat { display: flex; flex-wrap: wrap; gap: .4rem; }
.ringkasan > div { display: flex; justify-content: space-between; padding: .2rem 0; }
.ringkasan .grand { font-size: 1.35rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .5rem; color: var(--brand-800); }

/* Pemilih pelanggan */
.pel-wrap { position: relative; }
.pel-btn {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .55rem .8rem; font-weight: 600;
}
.pel-btn:hover { border-color: var(--brand-500); }
.pel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pel-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .6rem;
  box-shadow: 0 12px 30px rgba(42,35,32,.14); min-width: 260px;
}
.pel-panel #pel-hasil { max-height: 240px; overflow-y: auto; margin-top: .5rem; }
.pel-item { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; background: transparent; padding: .5rem .6rem; border-radius: 8px; }
.pel-item:hover { background: var(--brand-50); }

/* ---------- Detail penjualan ---------- */
.kembalian-besar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid #CDE8D4; border-radius: 12px; padding: 1rem 1.25rem;
  font-size: 1.1rem; font-weight: 600;
}
.kembalian-besar strong { font-size: 1.9rem; font-weight: 800; }

/* ---------- Laporan ---------- */
.tabel-laporan th, .tabel-laporan td { white-space: nowrap; }
.tabel-laporan tfoot .baris-total > * { background: var(--paper); font-weight: 700; border-top: 2px solid var(--line); }
.lap-grafik { width: 100%; height: auto; display: block; }
.lap-kunci { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

@media print {
  .sidebar, .topbar-mobile, .no-print, .filter-bar { display: none !important; }
  .app-shell { display: block; }
  .app-content { max-width: none; padding: 0 !important; }
  body { background: #fff; font-size: 11px; }
  .panel { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .tabel-wrap { overflow: visible; }
  .stat-card { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}


/* ---------- Logo toko ---------- */
.logo-preview { max-height: 90px; max-width: 100%; background: repeating-conic-gradient(#f1ece6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; }

/* ---------- Kolom password dengan ikon mata ---------- */
.pw-mata { background: var(--surface); border-color: var(--line); color: var(--muted); padding-left: .85rem; padding-right: .85rem; }
.pw-mata:hover, .pw-mata:focus { background: var(--brand-50); color: var(--brand-800); border-color: var(--line); }
.pw-mata .bi { margin: 0; font-size: 1.05rem; }
.pw-grup .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pw-grup .pw-mata { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.pw-grup .form-control:focus { z-index: 3; }

.kode-contoh { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; margin: .5rem 0; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }

/* ---------- Logo toko (PNG transparan, tanpa latar) ---------- */
.logo-toko { display: block; width: auto; object-fit: contain; object-position: left center; flex: none;
             filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.logo-sidebar { height: 44px; }
.logo-sidebar.dengan-nama { max-width: 56px; }
.logo-sidebar.tanpa-nama  { height: 48px; max-width: 200px; }
.logo-auth { height: 64px; }
.logo-auth.dengan-nama { max-width: 80px; }
.logo-auth.tanpa-nama  { height: 72px; max-width: 300px; }
.logo-mini { height: 40px; max-width: 170px; filter: none; }
.logo-hero { height: 54px; max-width: 200px; filter: none; }
.logo-hero.tanpa-nama { height: 58px; max-width: 240px; }
.brand-logo-hero { width: 54px; height: 54px; border-radius: 16px; font-size: 1.6rem; }
.logo-atas { height: 32px; max-width: 150px; filter: none; }

/* ---------- Pilihan tema ---------- */
.tema-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.tema-kartu { position: relative; display: block; cursor: pointer; margin: 0; }
.tema-kartu input[type="radio"] { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tema-isi { display: block; border: 2px solid var(--line); border-radius: 12px; padding: .6rem; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.tema-kartu:hover .tema-isi { border-color: var(--muted); }
.tema-kartu input[type="radio"]:checked + .tema-isi { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(var(--brand-500-rgb), .22); }
.tema-kartu input[type="radio"]:focus-visible + .tema-isi { outline: 2px solid var(--brand-700); outline-offset: 2px; }
.tema-swatch { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.08); }
.tema-swatch i { flex: 1; display: block; }
.tema-nama { display: block; margin-top: .45rem; font-size: .85rem; font-weight: 600; }

html[data-tema="biru"] {
  --brand-50: #EEF4FF; --brand-100: #D9E6FF; --brand-500: #2F6FED; --brand-600: #2A5FD1; --brand-700: #1F4DB8; --brand-800: #173D94; --brand-900: #102B6B;
  --brand-500-rgb: 47,111,237; --brand-700-rgb: 31,77,184;
  --side: #16233B; --side-2: #1F3050; --side-text: #DCE6F5; --side-muted: #8FA3C0;
  --paper: #F6F9FD; --line: #DDE6F2;
}

html[data-tema="hijau"] {
  --brand-50: #EDFAF2; --brand-100: #D3F2E0; --brand-500: #1FA463; --brand-600: #178A53; --brand-700: #11723F; --brand-800: #0D5B33; --brand-900: #093F23;
  --brand-500-rgb: 31,164,99; --brand-700-rgb: 17,114,63;
  --side: #14281F; --side-2: #1D382B; --side-text: #DDEBE3; --side-muted: #92AA9B;
  --paper: #F6FAF7; --line: #DCE8E0;
}

html[data-tema="toska"] {
  --brand-50: #E9FAF9; --brand-100: #C9F2EF; --brand-500: #0E9AA7; --brand-600: #0C8691; --brand-700: #0A6F79; --brand-800: #08585F; --brand-900: #063E43;
  --brand-500-rgb: 14,154,167; --brand-700-rgb: 10,111,121;
  --side: #112A2E; --side-2: #19393E; --side-text: #D8EBEC; --side-muted: #8CA9AC;
  --paper: #F4FAFA; --line: #D6E7E8;
}

html[data-tema="ungu"] {
  --brand-50: #F5F0FF; --brand-100: #E6DBFF; --brand-500: #7E57E0; --brand-600: #6C45CC; --brand-700: #5A36B0; --brand-800: #472B8C; --brand-900: #321E66;
  --brand-500-rgb: 126,87,224; --brand-700-rgb: 90,54,176;
  --side: #221A38; --side-2: #2F2450; --side-text: #E4DDF5; --side-muted: #A196C2;
  --paper: #F9F7FD; --line: #E4DEF1;
}

html[data-tema="merah"] {
  --brand-50: #FFF0F0; --brand-100: #FFDCDC; --brand-500: #E03A3A; --brand-600: #CC2E2E; --brand-700: #B02323; --brand-800: #8D1B1B; --brand-900: #661212;
  --brand-500-rgb: 224,58,58; --brand-700-rgb: 176,35,35;
  --side: #2E1A1A; --side-2: #3D2424; --side-text: #F0DFDF; --side-muted: #B39A9A;
  --paper: #FDF7F7; --line: #EDDFDF;
}

html[data-tema="rose"] {
  --brand-50: #FFF0F6; --brand-100: #FFDCEA; --brand-500: #E64980; --brand-600: #D6336C; --brand-700: #B82A5C; --brand-800: #96214A; --brand-900: #6B1733;
  --brand-500-rgb: 230,73,128; --brand-700-rgb: 184,42,92;
  --side: #2E1A24; --side-2: #3D2431; --side-text: #F2DFE8; --side-muted: #B59AA8;
  --paper: #FEF7FA; --line: #F0DFE7;
}

html[data-tema="slate"] {
  --brand-50: #F1F3F5; --brand-100: #E1E5EA; --brand-500: #556275; --brand-600: #475467; --brand-700: #3A4556; --brand-800: #2D3644; --brand-900: #1F2530;
  --brand-500-rgb: 85,98,117; --brand-700-rgb: 58,69,86;
  --side: #1B2028; --side-2: #262D38; --side-text: #E2E6EB; --side-muted: #98A2B0;
  --paper: #F7F8FA; --line: #E2E6EB;
}

html[data-tema="terakota"] {
  --brand-50: #FCF3F1; --brand-100: #F6E1DA; --brand-500: #D67551; --brand-600: #D06139; --brand-700: #C2552E; --brand-800: #A54827; --brand-900: #883C20;
  --brand-500-rgb: 214,117,81; --brand-700-rgb: 194,85,46;
  --side: #281A15; --side-2: #3C2720; --side-text: #E8DDD9; --side-muted: #AA9992;
  --paper: #FBF7F5; --line: #E8DFDB;
}

html[data-tema="coklat"] {
  --brand-50: #FAF6F2; --brand-100: #F2E7DE; --brand-500: #BB8658; --brand-600: #AE7747; --brand-700: #9C6B40; --brand-800: #825935; --brand-900: #69482B;
  --brand-500-rgb: 187,134,88; --brand-700-rgb: 156,107,64;
  --side: #281E15; --side-2: #3C2D20; --side-text: #E8E0D9; --side-muted: #AA9D92;
  --paper: #FBF8F5; --line: #E8E1DB;
}

html[data-tema="emas"] {
  --brand-50: #FEF9EE; --brand-100: #FDF0D3; --brand-500: #CB920B; --brand-600: #AE7D09; --brand-700: #966C08; --brand-800: #745306; --brand-900: #523B04;
  --brand-500-rgb: 203,146,11; --brand-700-rgb: 150,108,8;
  --side: #282315; --side-2: #3C3320; --side-text: #E8E3D9; --side-muted: #AAA392;
  --paper: #FBF9F5; --line: #E8E4DB;
}

html[data-tema="zaitun"] {
  --brand-50: #FAFBF1; --brand-100: #F1F5DB; --brand-500: #96A630; --brand-600: #818E29; --brand-700: #6F7B24; --brand-800: #565F1C; --brand-900: #3D4314;
  --brand-500-rgb: 150,166,48; --brand-700-rgb: 111,123,36;
  --side: #262815; --side-2: #383C20; --side-text: #E6E8D9; --side-muted: #A7AA92;
  --paper: #FAFBF5; --line: #E6E8DB;
}

html[data-tema="lime"] {
  --brand-50: #F5FCF0; --brand-100: #E5F8D8; --brand-500: #5CB21F; --brand-600: #4F981B; --brand-700: #448217; --brand-800: #346412; --brand-900: #24450C;
  --brand-500-rgb: 92,178,31; --brand-700-rgb: 68,130,23;
  --side: #1D2815; --side-2: #2C3C20; --side-text: #DFE8D9; --side-muted: #9CAA92;
  --paper: #F7FBF5; --line: #E1E8DB;
}

html[data-tema="mint"] {
  --brand-50: #EFFDF9; --brand-100: #D7F9EF; --brand-500: #1AB788; --brand-600: #169C74; --brand-700: #138663; --brand-800: #0F674C; --brand-900: #0A4735;
  --brand-500-rgb: 26,183,136; --brand-700-rgb: 19,134,99;
  --side: #152823; --side-2: #203C33; --side-text: #D9E8E3; --side-muted: #92AAA3;
  --paper: #F5FBF9; --line: #DBE8E4;
}

html[data-tema="langit"] {
  --brand-50: #EFF8FD; --brand-100: #D6ECFA; --brand-500: #239BE7; --brand-600: #178BD3; --brand-700: #157CBC; --brand-800: #11679C; --brand-900: #0E527C;
  --brand-500-rgb: 35,155,231; --brand-700-rgb: 21,124,188;
  --side: #152128; --side-2: #20313C; --side-text: #D9E2E8; --side-muted: #92A1AA;
  --paper: #F5F9FB; --line: #DBE3E8;
}

html[data-tema="indigo"] {
  --brand-50: #F1F1FB; --brand-100: #DADAF6; --brand-500: #6060D7; --brand-600: #4747D1; --brand-700: #3333CC; --brand-800: #2C2CAF; --brand-900: #252593;
  --brand-500-rgb: 96,96,215; --brand-700-rgb: 51,51,204;
  --side: #151528; --side-2: #20203C; --side-text: #D9D9E8; --side-muted: #9292AA;
  --paper: #F5F5FB; --line: #DBDBE8;
}

html[data-tema="magenta"] {
  --brand-50: #FCF0FC; --brand-100: #F8D8F8; --brand-500: #DE45DE; --brand-600: #DA2BDA; --brand-700: #C723C7; --brand-800: #A91EA9; --brand-900: #8B188B;
  --brand-500-rgb: 222,69,222; --brand-700-rgb: 199,35,199;
  --side: #281528; --side-2: #3C203C; --side-text: #E8D9E8; --side-muted: #AA92AA;
  --paper: #FBF5FB; --line: #E8DBE8;
}

html[data-tema="arang"] {
  --brand-50: #F5F3F1; --brand-100: #E6E2DE; --brand-500: #6B645E; --brand-600: #57514C; --brand-700: #44403C; --brand-800: #34312E; --brand-900: #24221F;
  --brand-500-rgb: 107,100,94; --brand-700-rgb: 68,64,60;
  --side: #1C1A18; --side-2: #272422; --side-text: #E7E3DF; --side-muted: #A29B94;
  --paper: #F8F7F5; --line: #E6E2DD;
}

/* ---------- Kartu "Warna sendiri" ---------- */
/* Kontrol warna kustom ditempatkan di atas lapisan radio supaya bisa diklik dan diketik */
.tema-kustom-kontrol { position: relative; z-index: 2; display: flex; align-items: center; gap: .45rem; margin-top: .4rem; }
.tema-picker { flex: none; width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px;
               background: var(--surface); cursor: pointer; }
.tema-hex { min-width: 0; flex: 1 1 auto; width: 90px; padding: .28rem .5rem; border: 1px solid var(--line); border-radius: 8px;
            font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; text-transform: uppercase; background: var(--surface); color: var(--ink); }
.tema-hex:focus { outline: 2px solid var(--brand-600); outline-offset: 1px; }
.tema-hex.is-invalid { border-color: var(--bad); }
.tema-kustom-info { position: relative; z-index: 2; display: block; margin-top: .3rem; font-size: .74rem; color: var(--muted); }


/* ---------- Jam digital dan durasi login (sidebar) ---------- */
.side-jam {
  position: relative; overflow: hidden;
  margin: .1rem 1rem .9rem; padding: .85rem 1rem .75rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(var(--brand-500-rgb), .24), rgba(255,255,255,.04) 70%);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.side-jam::after {
  content: ""; position: absolute; right: -34px; top: -38px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-500-rgb), .32), transparent 68%); pointer-events: none;
}
.side-jam > * { position: relative; z-index: 1; }
.jam-waktu { display: flex; align-items: baseline; color: #fff; font-weight: 800; font-size: 2rem; line-height: 1.05;
             letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.jam-detik { font-size: 1.05rem; font-weight: 600; color: var(--side-muted); margin-left: .12rem; min-width: 1.6em; }
.jam-tgl { margin-top: .25rem; font-size: .76rem; color: var(--side-text); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jam-sesi {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-top: .7rem; padding-top: .6rem; border-top: 1px solid rgba(255,255,255,.1);
  font-size: .74rem; color: var(--side-muted);
}
.jam-sesi-label { display: inline-flex; align-items: center; gap: .45rem; }
.jam-sesi strong { color: #fff; font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.titik-hidup { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; animation: denyut 2.2s infinite; }
@keyframes denyut {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@media (prefers-reduced-motion: reduce) { .titik-hidup { animation: none; } }

/* ---------- Foto profil ---------- */
.avatar-foto { background: none; overflow: hidden; }
.avatar-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-user .avatar { width: 40px; height: 40px; box-shadow: 0 0 0 2px rgba(var(--brand-500-rgb), .6); }
.avatar-sm { width: 30px; height: 30px; font-size: .8rem; vertical-align: middle; }
.avatar-lg { width: 104px; height: 104px; font-size: 2.6rem; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px rgba(var(--brand-500-rgb), .55); }
.foto-baris { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.foto-baris .avatar { display: inline-grid; flex: none; }
