*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{overflow-x:hidden}
body{font-family:'Segoe UI',system-ui,sans-serif;background:#f2f5f9;color:#1e2533;min-height:100vh}
:root{--p:#4f7c6e;--p2:#3a6358;--pl:#e8f3f0;--red:#d95f5f;--rl:#fdf0f0;--amber:#d4924a;--al:#fdf5ea;--blue:#4a7ab5;--bl:#edf3fb;--bd:#e4e9f0;--bg:#f2f5f9;--mu:#8492a6;--text:#1e2533;--nav-h:64px;--side-w:220px}

/* AUTH */
.auth-screen{display:none;position:fixed;inset:0;z-index:999;background:linear-gradient(160deg,#1a2235 0%,#2d4a3e 100%);overflow-y:auto}
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.auth-box{background:#fff;border-radius:20px;padding:28px;width:100%;max-width:380px;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.auth-logo{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.auth-logo-ico{width:46px;height:46px;border-radius:13px;background:linear-gradient(135deg,var(--p),var(--p2));display:flex;align-items:center;justify-content:center}
.auth-logo-ico svg{width:23px;height:23px;stroke:#fff;fill:none;stroke-width:2}
.auth-logo-name{font-size:22px;font-weight:900;letter-spacing:.5px}
.auth-logo-sub{font-size:11px;color:var(--mu);margin-top:1px}
.auth-title{font-size:15px;font-weight:700;margin:18px 0 4px}
.auth-desc{font-size:12px;color:var(--mu);margin-bottom:18px}
.auth-fg{margin-bottom:13px}
.auth-label{font-size:11px;font-weight:700;color:var(--mu);text-transform:uppercase;display:block;margin-bottom:5px}
.auth-input{width:100%;padding:11px 13px;border:1.5px solid var(--bd);border-radius:10px;font-size:14px;outline:none;font-family:inherit}
.auth-input:focus{border-color:var(--p)}
.auth-btn{width:100%;padding:13px;border:none;border-radius:12px;background:linear-gradient(135deg,var(--p),var(--p2));color:#fff;font-size:15px;font-weight:800;cursor:pointer;font-family:inherit}
.auth-err{background:var(--rl);border:1.5px solid #f0a0a0;color:#8b0000;border-radius:9px;padding:10px 13px;font-size:12px;margin-top:10px;display:none;font-weight:600}

/* TOPBAR */
.topbar{background:#1a2235;padding:0 16px;height:56px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:50}
.brand{display:flex;align-items:center;gap:10px}
.brand-ico{width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,var(--p),var(--p2));display:flex;align-items:center;justify-content:center}
.brand-ico svg{width:16px;height:16px;stroke:#fff;fill:none;stroke-width:2}
.brand-name{font-size:16px;font-weight:800;color:#fff}
.topbar-right{display:flex;align-items:center;gap:8px}
.user-pill{background:rgba(255,255,255,.1);border-radius:20px;padding:4px 10px 4px 6px;display:flex;align-items:center;gap:6px}
.user-av{width:24px;height:24px;border-radius:50%;background:var(--p);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;color:#fff}
.user-name{font-size:12px;color:rgba(255,255,255,.8);font-weight:600}
.logout-btn{background:rgba(255,255,255,.08);border:none;color:rgba(255,255,255,.5);font-size:12px;padding:4px 8px;border-radius:6px;cursor:pointer;font-family:inherit}

/* BOTTOM NAV (HP) */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--bd);height:var(--nav-h);display:flex;align-items:center;z-index:50;padding:0 4px;box-shadow:0 -4px 20px rgba(0,0,0,.06)}
.bn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 2px;cursor:pointer;gap:4px;border-radius:10px;position:relative}
.bn-icon{font-size:20px;line-height:1}
.bn-label{font-size:10px;font-weight:600;color:var(--mu)}
.bn.on .bn-label{color:var(--p2)}
.bn-bar{position:absolute;top:0;left:50%;transform:translateX(-50%);width:28px;height:3px;border-radius:0 0 4px 4px;background:var(--p);opacity:0}
.bn.on .bn-bar{opacity:1}
.bn-dot{position:absolute;top:6px;right:calc(50% - 14px);width:8px;height:8px;border-radius:50%;background:var(--red);display:none;border:2px solid #fff}

/* SIDEBAR (WEB) */
.sidebar{display:none}

/* MAIN */
.main{min-height:calc(100vh - 56px - var(--nav-h));padding-bottom:calc(var(--nav-h) + 12px)}
.section-title{font-size:16px;font-weight:800;padding:16px 14px 10px}

/* STAT CARDS */
.sgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 14px;margin-bottom:14px}
.sc{background:#fff;border-radius:14px;border:1px solid var(--bd);padding:14px}
.sc-label{font-size:10px;font-weight:700;color:var(--mu);text-transform:uppercase;margin-bottom:8px}
.sc-val{font-size:26px;font-weight:900;line-height:1;margin-bottom:3px}
.sc-sub{font-size:11px;color:var(--mu)}

/* CARD */
.card{background:#fff;border-radius:14px;border:1px solid var(--bd);margin:0 14px 12px;overflow:hidden}
.ch{padding:13px 16px;border-bottom:1px solid #f0f3f7;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.ct{font-size:14px;font-weight:700}
.cb{padding:12px 16px}

/* BADGE */
.b{display:inline-flex;align-items:center;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:700}
.bs{background:#e8f5ee;color:#267a4a}.bw{background:var(--al);color:#b5620a}
.bd2{background:var(--rl);color:#b83c3c}.bi{background:var(--bl);color:#2d5f99}.bg{background:#f0f3f8;color:#5a6a82}

/* BUTTON */
.btn{padding:10px 18px;border-radius:10px;border:1.5px solid var(--bd);cursor:pointer;font-size:13px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;font-family:inherit}
.bp{background:var(--p);color:#fff;border-color:var(--p)}
.br{background:var(--red);color:#fff;border-color:var(--red)}
.bo{background:#fff;color:#4a5568}
.btn-full{width:100%;margin-bottom:8px}
.btn-sm{padding:7px 14px;font-size:12px;border-radius:8px}

/* FORM */
.fg{margin-bottom:13px}
.fl{font-size:11px;font-weight:700;color:var(--mu);margin-bottom:5px;display:block;text-transform:uppercase}
.fi,.fs{width:100%;padding:11px 13px;border:1.5px solid var(--bd);border-radius:10px;font-size:14px;outline:none;background:#fff;font-family:inherit;-webkit-appearance:none;appearance:none}
.fi:focus,.fs:focus{border-color:var(--p)}
.form-section{background:#fff;border-radius:14px;border:1px solid var(--bd);margin:0 14px 12px;padding:16px}
.form-section .ct{margin-bottom:14px;padding-bottom:10px;border-bottom:1px solid var(--bd)}

/* MODAL */
.mo{position:fixed;inset:0;background:rgba(10,15,30,.5);display:none;align-items:flex-end;justify-content:center;z-index:100}
.mo.open{display:flex}
.md{background:#fff;border-radius:20px 20px 0 0;padding:20px 20px 32px;width:100%;max-height:90vh;overflow-y:auto;animation:slideup .25s ease}
@keyframes slideup{from{transform:translateY(100%)}to{transform:translateY(0)}}
.md-handle{width:36px;height:4px;background:#e0e5ed;border-radius:4px;margin:0 auto 18px}
.mt{font-size:16px;font-weight:800;margin-bottom:18px}
.mf{display:flex;flex-direction:column;gap:8px;margin-top:18px}

/* CHIP / FILTER */
.chip{display:inline-flex;padding:7px 16px;border-radius:20px;font-size:12px;font-weight:700;border:1.5px solid var(--bd);cursor:pointer;background:#fff;color:var(--mu);white-space:nowrap;flex-shrink:0}
.chip.on{background:var(--pl);border-color:var(--p);color:var(--p2)}
.si{width:100%;padding:11px 14px;border:1.5px solid var(--bd);border-radius:10px;font-size:14px;outline:none;background:#fff;font-family:inherit}
.av{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0;background:var(--pl);color:var(--p2)}
.alert{padding:12px 14px;border-radius:10px;font-size:13px;margin:0 14px 10px;font-weight:500;line-height:1.4}
.ad{background:#fff0f0;border:1.5px solid #f5c0c0;color:#9b2c2c}
.aw{background:#fffbf0;border:1.5px solid #f5d87a;color:#7a4800}
.hi{display:flex;align-items:center;gap:12px;padding:11px 16px;border-bottom:1px solid #f4f6f9}
.hi-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.hinf{flex:1;min-width:0}
.hn{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hm{font-size:11px;color:var(--mu);margin-top:2px}
.hq{font-size:14px;font-weight:800;flex-shrink:0}
.trx-item{padding:11px 16px;border-bottom:1px solid #f4f6f9;display:flex;align-items:flex-start;gap:10px}
.trx-type{width:6px;height:6px;border-radius:50%;flex-shrink:0;margin-top:5px}
.trx-info{flex:1;min-width:0}
.trx-nama{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.trx-meta{font-size:11px;color:var(--mu);margin-top:2px}
.trx-qty{font-size:15px;font-weight:900;flex-shrink:0}
code{background:#f0f3f8;padding:2px 6px;border-radius:5px;font-size:11px;font-family:monospace;color:#3a4a6a;font-weight:700}
.empty{text-align:center;color:var(--mu);padding:32px 20px;font-size:13px}

/* SEARCHABLE DROPDOWN */
.sp-picker{position:relative}
.sp-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:280px;overflow-y:auto;background:#fff;border:1.5px solid var(--bd);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);z-index:200}
.sp-option{padding:10px 14px;font-size:13px;cursor:pointer;border-bottom:1px solid #f4f6f9;display:flex;justify-content:space-between;align-items:center;gap:8px}
.sp-option:hover,.sp-option.hl{background:var(--pl)}
.sp-option:last-child{border-bottom:none}
.sp-option-info{flex:1;min-width:0}
.sp-option-nama{font-weight:700;color:var(--text);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sp-option-sku{font-size:11px;color:var(--mu);margin-top:2px}
.sp-option-stok{font-size:13px;font-weight:800;color:var(--p2);flex-shrink:0}
.sp-option-empty{padding:18px;text-align:center;color:var(--mu);font-size:13px}

/* FILTER BAR with arrow scroll */
.filter-wrap{position:relative;padding:0 14px;margin-bottom:12px}
.filter-bar{display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;scroll-behavior:smooth;padding:2px 0}
.filter-bar::-webkit-scrollbar{display:none}
.filter-arrow{position:absolute;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:50%;background:#fff;border:1.5px solid var(--bd);color:var(--text);font-size:20px;font-weight:900;cursor:pointer;z-index:5;box-shadow:0 2px 10px rgba(0,0,0,.12);display:none;align-items:center;justify-content:center;font-family:inherit;line-height:1}
.filter-arrow:hover{background:var(--pl);border-color:var(--p);color:var(--p2)}
.filter-arrow-left{left:-6px}
.filter-arrow-right{right:-6px}
.filter-wrap.has-scroll .filter-arrow{display:flex}
@media(max-width:767px){.filter-wrap .filter-arrow{display:none!important}}
.search-wrap{padding:0 14px;margin-bottom:12px}

/* PAGINATION */
.pager{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 10px;border-top:1px solid #f4f6f9;background:#fff;flex-wrap:wrap}
.pager-btn{padding:6px 12px;border-radius:8px;border:1.5px solid var(--bd);background:#fff;color:#4a5568;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;min-width:80px}
.pager-btn:disabled{opacity:.5;cursor:not-allowed}
.pager-info{font-size:12px;font-weight:700;color:var(--mu);min-width:90px;text-align:center}

/* COLLAPSIBLE */
.collapse-btn{padding:5px 10px;border:1.5px solid var(--bd);border-radius:8px;background:#fff;color:#4a5568;font-size:11px;font-weight:700;cursor:pointer;font-family:inherit}
.collapsible{overflow:hidden;max-height:5000px;opacity:1;transition:max-height .3s,opacity .25s}
.collapsible.is-closed{max-height:0;opacity:0;pointer-events:none}

.credit{text-align:center;padding:16px;font-size:11px;color:var(--mu);border-top:1px solid var(--bd);margin:8px 14px 0}
.credit strong{color:var(--p2);font-weight:800}
.admin-only{display:none!important}
body.is-admin .admin-only{display:inline-flex!important}
body.is-admin button.admin-only{display:inline-flex!important}
#toast{position:fixed;bottom:calc(var(--nav-h) + 14px);left:14px;right:14px;padding:13px 18px;border-radius:12px;font-size:13px;font-weight:700;z-index:999;display:none;color:#fff;text-align:center;box-shadow:0 8px 30px rgba(0,0,0,.2)}

/* ═══ WEB / DESKTOP LAYOUT — SIDEBAR FIXED ═══ */
@media(min-width:1024px){
  body{background:#eef3f8;overflow:hidden}
  html{overflow:hidden;height:100vh}
  #app{display:block;min-height:100vh;height:100vh;overflow:hidden}
  .topbar{position:fixed;top:0;left:0;right:0;z-index:60;height:56px}
  .bottom-nav{display:none!important}
  .sidebar{
    display:flex!important;flex-direction:column;background:#fff;
    border-right:1px solid var(--bd);padding:18px 12px;
    position:fixed;top:56px;left:0;width:var(--side-w);
    height:calc(100vh - 56px);overflow-y:auto;z-index:55;
  }
  .sd-item{
    display:flex;align-items:center;gap:12px;padding:12px 14px;
    border-radius:10px;cursor:pointer;color:var(--mu);font-weight:700;
    font-size:14px;margin-bottom:4px;border:1.5px solid transparent;
  }
  .sd-item:hover{background:#f7faf8}
  .sd-item.on{background:var(--pl);color:var(--p2);border-color:#b9d8cf}
  .sd-icon{font-size:18px;line-height:1;width:22px;text-align:center}
  .sd-label{flex:1}
  .sd-dot{width:8px;height:8px;border-radius:50%;background:var(--red);display:none}
  .sd-item.has-dot .sd-dot{display:block}
  .sd-sep{height:1px;background:var(--bd);margin:12px 0}
  .sd-section{font-size:10px;font-weight:800;color:var(--mu);text-transform:uppercase;padding:8px 14px 6px;letter-spacing:.05em}
  .main{
    position:fixed;top:56px;left:var(--side-w);right:0;bottom:0;
    overflow-y:auto;overflow-x:hidden;padding:18px 0 24px;
  }
  .section-title{padding:6px 32px 14px;font-size:22px}
  .sgrid,.card,.form-section,.alert,.credit{margin-left:32px;margin-right:32px}
  .search-wrap{padding:0 32px;margin-bottom:14px}
  .filter-wrap{padding:0 32px;margin-bottom:14px}
  .filter-bar{padding:2px 0}
  .filter-arrow{width:32px;height:32px;font-size:18px;box-shadow:0 2px 8px rgba(0,0,0,.12)}
  .filter-arrow-left{left:14px}
  .filter-arrow-right{right:14px}
  #page-transaksi > .ch{padding:6px 32px 0}
  .md{max-width:600px;border-radius:20px}
  .mo{align-items:center}
  #page-dashboard .sgrid{grid-template-columns:repeat(4,1fr)}
}
