/* ==========================================================================
   Ngafee POS — tampilan disamakan dengan aplikasi lama (pra-Laravel)
   Diambil dari pos/assets/styles.css aplikasi lama: sidebar navy gelap,
   topbar krem, kartu lembut, aksen caramel.
   Nama kelas lama (.btn, .card) dan nama kelas aplikasi Laravel (.btn-utama,
   .kartu, .isian, .label) sama-sama dipetakan supaya semua halaman ikut.
   ========================================================================== */

:root {
  --navy: #182635;
  --navy-2: #22384d;
  --navy-3: #2c465e;
  --cream: #f5f1ea;
  --paper: #fffdfa;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #7c8794;
  --line: #e8e1d6;
  --line-soft: #f0ebe3;
  --caramel: #b07a4a;
  --caramel-soft: #f1dfcd;
  --green: #2f7d5d;
  --green-soft: #e3f3ea;
  --red: #b3452f;
  --red-soft: #fbe8e4;
  --amber: #a86a12;
  --amber-soft: #fbf0da;
  --shadow: 0 10px 30px rgba(24, 38, 53, .08);
  --shadow-sm: 0 3px 10px rgba(24, 38, 53, .06);
  --r: 18px;
  --r-sm: 12px;
  --sidebar: 236px;
  --topbar: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Segoe UI', Roboto, -apple-system, system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--caramel); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
::selection { background: var(--caramel-soft); }
[x-cloak] { display: none !important; }

/* ---------- kerangka ---------- */
.app { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: linear-gradient(180deg, #16232f 0%, #1b2c3b 55%, #203446 100%);
  color: #e9eef3; display: flex; flex-direction: column; padding: 18px 14px 14px;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 6px 8px 20px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #b07a4a, #8c5a32); color: #fff2e3;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25); flex: 0 0 auto; overflow: hidden;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong { display: block; font-size: 15.5px; letter-spacing: .2px; color: #fff; max-width: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #93a4b4; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow-y: auto; }
.nav-judul { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6d7f8f; padding: 14px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border-radius: 12px; color: #c9d5df; font-size: 13px; font-weight: 600;
  text-align: left; transition: .15s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--caramel); }
.nav-item em {
  margin-left: auto; font-style: normal; font-size: 10px; font-weight: 800;
  background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 2px 7px; min-width: 20px; text-align: center;
}
.nav-ic { width: 19px; height: 19px; display: inline-grid; place-items: center; flex: 0 0 auto; opacity: .9; }
.nav-ic svg { width: 18px; height: 18px; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.shift-mini {
  display: flex; gap: 10px; align-items: center; text-align: left; width: 100%;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 13px; padding: 10px 11px; color: #e6edf3;
}
.shift-mini:hover { background: rgba(255, 255, 255, .1); }
.shift-mini b { display: block; font-size: 11.5px; }
.shift-mini small { display: block; font-size: 10px; color: #9fb0bf; margin-top: 2px; }
.shift-mini .dot { width: 8px; height: 8px; border-radius: 50%; background: #7c8794; flex: 0 0 auto; }
.shift-mini .dot.on { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .15); }

.who { display: flex; gap: 9px; align-items: center; padding: 8px 4px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.who .avatar { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: 0 0 auto; }
.who b { display: block; font-size: 11.5px; color: #fff; }
.who small { display: block; font-size: 9.5px; color: #93a4b4; margin-top: 1px; }
.who .keluar { margin-left: auto; color: #93a4b4; display: grid; place-items: center; }
.who .keluar:hover { color: #fff; }

.main { margin-left: var(--sidebar); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: rgba(245, 241, 234, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title h1 { font-size: 18px; letter-spacing: -.2px; }
.topbar-title p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.chip-shift {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 11.5px; font-weight: 700; color: var(--ink);
}
.chip-shift .dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.chip-shift .dot.on { background: var(--green); }
.hamburger { display: inline-flex; flex-direction: column; align-items: stretch; justify-content: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 11px; cursor: pointer; flex: none; }
.hamburger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 4px 0; }
.content { padding: 22px 24px 40px; max-width: 1480px; width: 100%; margin: 0 auto; flex: 1; }

/* ---------- elemen umum ---------- */
.btn, .btn-utama, .btn-garis {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 700; transition: .15s;
  white-space: nowrap;
}
.btn:hover, .btn-garis:hover { border-color: #d8cfc2; background: #fff; }
.btn-utama, .btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-utama:hover, .btn.primary:hover { background: var(--navy-2); }
.btn-caramel { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.btn-bahaya { background: var(--red-soft); border-color: #f3cfc7; color: var(--red); }
.btn.ghost, .btn-garis { background: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card, .kartu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; line-height: 1.5; }
.empty {
  padding: 42px 18px; text-align: center; color: var(--muted); font-size: 12.5px;
  border: 1px dashed #d9d0c4; border-radius: var(--r); background: rgba(255, 255, 255, .5);
}

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.gray { background: #eef2f6; color: #5b6b7c; }

/* form */
.isian, .label + input, .label + select, .label + textarea {
  min-height: 40px; width: 100%; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; padding: 0 12px; font-size: 13px; color: var(--ink);
}
input.isian, select.isian, textarea.isian { height: auto; min-height: 40px; padding: 9px 12px; }
.isian:focus, input:focus, select:focus, textarea:focus { outline: 2px solid rgba(176, 122, 74, .25); outline-offset: 1px; border-color: #d8cfc2; }
.label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
select.isian { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8794' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* tabel */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #faf7f2; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }

/* ---------- layar masuk (tanpa sidebar) ---------- */
.auth { min-height: 100dvh; padding: 18px 14px 44px; background: var(--cream); }
.auth > div { max-width: 1100px; margin: 0 auto; width: 100%; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 24px; box-shadow: var(--shadow); }
.auth-brand { display: flex; gap: 11px; align-items: center; margin-bottom: 18px; }
.auth-brand strong { display: block; font-size: 15px; }
.auth-brand span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-top: 2px; }

/* ---------- HP / tablet ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: 262px; z-index: 65; overflow-y: auto; overscroll-behavior: contain; }
  .sidebar.open { transform: none; box-shadow: 20px 0 50px rgba(10, 18, 26, .3); }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; height: 60px; gap: 10px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .clock { display: none; }
}
.backdrop { position: fixed; inset: 0; background: rgba(16, 25, 34, .5); backdrop-filter: blur(3px); z-index: 60; }

@media print {
  .sidebar, .topbar, .backdrop { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff; }
}

/* ---------- kartu produk di layar kasir (mirip aplikasi lama) ---------- */
.produk-tile {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px; text-align: left; min-height: 112px; transition: .15s; position: relative;
}
.produk-tile:hover { border-color: #d8cfc2; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.produk-tile:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.produk-tile span[class^="mt-1"], .produk-tile .produk-nama { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.produk-gbr { width: 100%; height: 54px; object-fit: cover; border-radius: 11px; }
.produk-emoji {
  display: grid; place-items: center; height: 54px; border-radius: 11px;
  background: linear-gradient(135deg, #f3ece2, #efe4d6); font-size: 26px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 11.5px; font-weight: 700; color: #5d6a76;
}
.pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* input berkas: samakan dengan isian lain */
input[type="file"].isian { padding: 7px 10px; font-size: 12px; color: var(--muted); }
input[type="file"].isian::file-selector-button {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 6px 10px; margin-right: 10px; font-size: 11.5px; font-weight: 700; color: var(--ink); cursor: pointer;
}
input[type="file"].isian::file-selector-button:hover { border-color: #d8cfc2; }

/* chips kategori (toko & filter) */
.chips-row { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 11.5px; font-weight: 700; color: #5d6a76; white-space: nowrap; transition: .15s;
}
.chip:hover { border-color: #d8cfc2; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ================= etalase toko publik ================= */
.toko-hero { position: relative; overflow: hidden; border-radius: 22px; box-shadow: var(--shadow); }
.toko-hero .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.toko-hero .lapis {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22, 35, 47, .10) 0%, rgba(22, 35, 47, .55) 52%, rgba(20, 33, 44, .92) 100%);
}
.toko-hero .isi {
  position: relative; min-height: 232px; padding: 18px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; color: #fff;
}
.toko-hero h1 { font-size: clamp(22px, 4.8vw, 32px); letter-spacing: -.5px; line-height: 1.1; }
.toko-hero p { font-size: 13px; color: #e6edf3; max-width: 42ch; }
.toko-hero .meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: #c8d5e0; margin-top: 2px; }
.toko-hero .aksi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-hero { min-height: 38px; font-size: 12.5px; }
.btn-caramel { background: var(--caramel); border: 1px solid var(--caramel); color: #fff; }
.btn-caramel:hover { filter: brightness(1.06); }
.btn-putih { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(6px); }
.btn-putih:hover { background: rgba(255, 255, 255, .22); }

.toko-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { .toko-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1024px) { .toko-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.toko-kartu {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); transition: .15s;
}
.toko-kartu:hover { border-color: #d8cfc2; box-shadow: var(--shadow); transform: translateY(-1px); }
.toko-thumb { position: relative; flex: 0 0 auto; aspect-ratio: 4 / 3; background: #f0e7db; cursor: pointer; overflow: hidden; }
.toko-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.toko-thumb .tanda {
  position: absolute; top: 7px; left: 7px; padding: 3px 7px; border-radius: 999px;
  background: rgba(255, 253, 250, .94); color: #4a5a68; font-size: 9.5px; font-weight: 800; letter-spacing: .02em;
}
.toko-isi { display: flex; flex-direction: column; flex: 1; padding: 8px 9px 9px; gap: 2px; }
.toko-nama { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.toko-ket { font-size: 10.5px; color: var(--muted); line-height: 1.35; min-height: 14px; }
.toko-baris { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 5px; }
.toko-harga { font-size: 12.5px; font-weight: 800; color: var(--caramel); }
.toko-plus {
  width: 28px; height: 28px; border-radius: 9px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 15px; line-height: 1; transition: .15s;
}
.toko-plus:hover { background: var(--navy-2); }
.toko-plus:disabled { opacity: .4; cursor: not-allowed; }
.toko-qty { display: flex; align-items: center; gap: 3px; }
.toko-qty button, .toko-qty-btn {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; font-size: 13px; line-height: 1;
}

/* sheet bawah (varian, keranjang) */
.sheet-bawah {
  position: absolute; inset: auto 0 0 0; max-height: 88dvh; overflow-y: auto;
  background: #fff; border-radius: 22px 22px 0 0; padding: 10px 16px 20px;
  box-shadow: 0 -18px 50px rgba(10, 18, 26, .25);
}
.sheet-puncak { width: 42px; height: 4px; border-radius: 999px; background: #e3d9cb; margin: 2px auto 12px; }
.pilih-kotak {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid #d8cfc0; border-radius: 12px; padding: 9px 10px; font-size: 12.5px;
}
.pilih-kotak:has(input:checked) { border-color: var(--caramel); background: #fdf7f1; }

/* ---------- kerapian jarak (kasir) ---------- */
/* bar keranjang HP: padding sejajar konten (14px) + aman dari home indicator */
.bar-keranjang { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(16, 24, 32, .06); }
/* sheet/modal bawah: tombol tidak tertutup home indicator */
.sheet-aman { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
/* scrollbar sidebar dibuat tipis supaya tidak tampak seperti garis tebal */
.sidebar, .nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.sidebar::-webkit-scrollbar, .nav::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 999px; }
.sidebar::-webkit-scrollbar-track, .nav::-webkit-scrollbar-track { background: transparent; }

/* ---------- sidebar bisa disembunyikan (tombol burger di topbar) ---------- */
.sidebar { transition: transform .22s ease; }
.main { transition: margin-left .22s ease; }
@media (min-width: 901px) {
  .app.sempit .sidebar { transform: translateX(-100%); }
  .app.sempit .main { margin-left: 0; }
}
