/* ===== Tema aplikasi Penjualan & Stok ===== */
:root {
  --c-primary: #6366f1; --c-primary-2: #8b5cf6; --c-shopee: #ee4d2d;
  --c-bg: #f3f5fb; --c-text: #1e293b; --c-muted: #64748b;
  --radius: 16px; --sidebar-w: 250px;
  --shadow: 0 4px 20px rgba(30, 41, 59, .06);
  --shadow-hover: 0 10px 30px rgba(99, 102, 241, .18);
}
* { -webkit-tap-highlight-color: transparent; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--c-bg); color: var(--c-text); }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 260px; z-index: -1;
  background: radial-gradient(1200px 260px at 20% -40%, rgba(99,102,241,.18), transparent 70%),
              radial-gradient(900px 260px at 90% -60%, rgba(236,72,153,.15), transparent 70%); }

/* ---------- Sidebar ---------- */
.sidebar { --bs-offcanvas-width: 270px; width: var(--sidebar-w); background: linear-gradient(185deg, #312e81 0%, #5b21b6 55%, #9d174d 130%); color: #fff; border: 0 !important; }
@media (min-width: 992px) { .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030; } .main { margin-left: var(--sidebar-w); } }
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.25rem 1rem; font-weight: 800; font-size: 1.05rem; color: #fff; text-decoration: none; }
.sidebar .brand .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.15); font-size: 1.3rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.sidebar .brand small { display: block; font-weight: 500; font-size: .72rem; opacity: .7; }
.side-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: .9rem 1.4rem .3rem; }
.side-link { display: flex; align-items: center; gap: .8rem; margin: 2px .75rem; padding: .62rem .8rem; border-radius: 12px;
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: .92rem; transition: .2s; position: relative; }
.side-link i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; background: rgba(255,255,255,.08); transition: .2s; }
.side-link:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(3px); }
.side-link.active { background: #fff; color: #4338ca; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.side-link.active i { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)); color: #fff; }
.side-link .badge { margin-left: auto; }
.side-user { margin: 1rem .75rem; padding: .8rem; border-radius: 14px; background: rgba(255,255,255,.1); display: flex; align-items: center; gap: .7rem; }
.side-user .ava { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,#f472b6,#f59e0b); display: grid; place-items: center; font-weight: 800; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; backdrop-filter: blur(14px); background: rgba(243,245,251,.82); border-bottom: 1px solid rgba(15,23,42,.05); }
.topbar .judul { font-weight: 800; font-size: 1.15rem; margin: 0; }
.topbar .sub { font-size: .78rem; color: var(--c-muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--c-text); }
.page { padding: 1.25rem; }
@media (max-width: 767.98px) { .page { padding: .9rem .75rem 90px; } }

/* ---------- Bottom nav (HP) ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040; display: flex; background: #fff;
  box-shadow: 0 -6px 24px rgba(30,41,59,.1); border-radius: 20px 20px 0 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a, .bottom-nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .68rem; font-weight: 600; color: var(--c-muted); text-decoration: none; padding: 4px 0; }
.bottom-nav i { font-size: 1.25rem; width: 44px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: .25s; }
.bottom-nav .active { color: var(--c-primary); }
.bottom-nav .active i { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)); color: #fff; box-shadow: 0 6px 14px rgba(99,102,241,.4); }
.bottom-nav .fab i { width: 52px; height: 52px; border-radius: 18px; margin-top: -26px; font-size: 1.45rem; color: #fff;
  background: linear-gradient(135deg, #10b981, #06b6d4); box-shadow: 0 10px 20px rgba(16,185,129,.4); }

/* ---------- Kartu ---------- */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent !important; border-bottom: 1px solid rgba(15,23,42,.06); font-weight: 700; padding: .9rem 1.1rem; }
.card-header .ic { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; margin-right: .5rem; color: #fff; font-size: .9rem; }
.hover-lift { transition: transform .25s, box-shadow .25s; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.stat { color: #fff; overflow: hidden; position: relative; }
.stat .card-body { position: relative; z-index: 1; }
.stat::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -40px; top: -50px; background: rgba(255,255,255,.14); }
.stat::before { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: 30px; bottom: -50px; background: rgba(255,255,255,.1); }
.stat .label { font-size: .8rem; opacity: .9; font-weight: 600; }
.stat .angka { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.stat .ico { width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 1.3rem; }
@media (max-width: 575.98px) { .stat .angka { font-size: 1.1rem; } .stat .ico { width: 36px; height: 36px; font-size: 1.05rem; } }

.g-indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.g-shopee { background: linear-gradient(135deg, #ee4d2d, #f97316); }
.g-green  { background: linear-gradient(135deg, #10b981, #14b8a6); }
.g-pink   { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.g-blue   { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.g-amber  { background: linear-gradient(135deg, #f59e0b, #f97316); }
.g-purple { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.g-slate  { background: linear-gradient(135deg, #475569, #64748b); }

/* ---------- Tombol & form ---------- */
.btn { border-radius: 11px; font-weight: 600; }
.btn-grad { color: #fff; border: 0; background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)); box-shadow: 0 6px 16px rgba(99,102,241,.35); }
.btn-grad:hover, .btn-grad:focus { color: #fff; filter: brightness(1.07); transform: translateY(-1px); }
.btn-grad-green { color: #fff; border: 0; background: linear-gradient(135deg, #10b981, #06b6d4); box-shadow: 0 6px 16px rgba(16,185,129,.35); }
.btn-grad-green:hover { color: #fff; filter: brightness(1.07); }
.btn-shopee { color: #fff; border: 0; background: linear-gradient(135deg, #ee4d2d, #f97316); box-shadow: 0 6px 16px rgba(238,77,45,.3); }
.btn-shopee:hover { color: #fff; filter: brightness(1.07); }
.btn-soft { background: #eef2ff; color: #4338ca; border: 0; }
.btn-soft:hover { background: #e0e7ff; color: #3730a3; }
.btn-soft-danger { background: #fee2e2; color: #b91c1c; border: 0; }
.btn-soft-danger:hover { background: #fecaca; color: #991b1b; }
.btn-soft-success { background: #dcfce7; color: #15803d; border: 0; }
.btn-soft-success:hover { background: #bbf7d0; color: #166534; }
.form-control, .form-select { border-radius: 11px; border-color: #e2e8f0; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(99,102,241,.15); }
.form-label { font-weight: 600; color: #475569; }

/* ---------- Tabel ---------- */
.table-modern { margin: 0; }
.table-modern thead th { background: #f8fafc; color: #64748b; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border: 0; padding: .7rem .75rem; white-space: nowrap; }
.table-modern td { border-color: #f1f5f9; padding: .65rem .75rem; vertical-align: middle; }
.table-modern tbody tr { transition: background .15s; }
.table-modern tbody tr:hover { background: #f8faff; }

/* ---------- Badge & pill ---------- */
.badge { font-weight: 600; border-radius: 8px; padding: .38em .6em; }
.badge-shopee { background: linear-gradient(135deg, #ee4d2d, #f97316); color: #fff; }
.badge-toko { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.pill-green { background: #dcfce7; color: #15803d; } .pill-red { background: #fee2e2; color: #b91c1c; }
.pill-amber { background: #fef3c7; color: #b45309; } .pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-gray { background: #f1f5f9; color: #475569; } .pill-purple { background: #ede9fe; color: #6d28d9; }

/* ---------- Foto produk ---------- */
.foto-produk, .foto-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.foto-avatar { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; }
.foto-lg { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; font-size: 2.6rem; }
.foto-sm { width: 36px; height: 36px; border-radius: 10px; font-size: .9rem; }

.produk-card { overflow: hidden; height: 100%; }
.produk-card .foto-wrap { position: relative; }
.produk-card .foto-wrap .foto-lg { border-radius: 0; }
.produk-card .stok-chip { position: absolute; left: 8px; top: 8px; }
.produk-card .shopee-chip { position: absolute; right: 8px; top: 8px; }
.produk-card .nama { font-weight: 700; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }

.foto-picker .preview { width: 100%; aspect-ratio: 1; border-radius: 16px; border: 2px dashed #c7d2fe; background: #f5f7ff center/cover no-repeat;
  display: grid; place-items: center; color: #818cf8; text-align: center; transition: .2s; overflow: hidden; }
.foto-picker .preview.ada { border-style: solid; border-color: transparent; }
.foto-picker .preview.ada .kosong { display: none; }

/* ---------- Animasi ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.6); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }
.anim { opacity: 0; animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) forwards; }
.anim-pop { animation: pop .3s ease-out; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #10b981; display: inline-block; animation: pulse-dot 1.8s infinite; }
@media (prefers-reduced-motion: reduce) { .anim, .anim-pop { animation: none; opacity: 1; } }

#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b); transition: width .4s ease; }

.empty { text-align: center; padding: 2.2rem 1rem; color: var(--c-muted); }
.empty i { font-size: 2.4rem; display: block; margin-bottom: .5rem; background: linear-gradient(135deg, #a5b4fc, #f9a8d4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-pills-modern .nav-link { border-radius: 11px; font-weight: 600; color: var(--c-muted); }
.nav-pills-modern .nav-link.active { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)); box-shadow: 0 6px 14px rgba(99,102,241,.3); }

/* SweetAlert2 menyesuaikan tema */
.swal2-popup { border-radius: 20px !important; font-family: inherit !important; }
.swal2-toast { border-radius: 14px !important; box-shadow: 0 10px 30px rgba(30,41,59,.18) !important; }
.swal2-styled.swal2-confirm { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)) !important; border-radius: 11px !important; }
.swal2-styled.swal2-cancel { border-radius: 11px !important; }
.swal2-styled.swal2-confirm.swal-bahaya { background: linear-gradient(135deg, #ef4444, #f97316) !important; }

/* Kasir */
.kasir-item { cursor: pointer; border-radius: 14px; transition: .15s; border: 2px solid transparent; }
.kasir-item:hover { border-color: #c7d2fe; transform: translateY(-2px); }
.kasir-item:active { transform: scale(.97); }
.kasir-total { background: linear-gradient(135deg, #312e81, #6d28d9); color: #fff; border-radius: 14px; padding: .9rem 1rem; }

@media print {
  .sidebar, .topbar, .bottom-nav, .no-print { display: none !important; }
  .main { margin: 0 !important; } body { background: #fff; } body::before { display: none; }
  .card { box-shadow: none; } .anim { opacity: 1; animation: none; }
}
.min-w-0 { min-width: 0; }
.sticky-aksi { position: sticky; bottom: 0; z-index: 3; }
@media (max-width: 767.98px) { .sticky-aksi { bottom: 78px; } }
@media (min-width: 992px) { .sticky-lg { position: sticky; top: 80px; } }
@media (max-width: 767.98px) { .foto-picker .preview { max-width: 230px; margin-left: auto; margin-right: auto; } }
@media (max-width: 575.98px) {
  .stat .card-body.d-flex { flex-direction: column; align-items: flex-start !important; gap: .5rem !important; }
  .stat .angka { font-size: 1.15rem; }
}
