/* ===== Sales Track Pro — desain sistem ===== */
:root{
  --navy:#0b2545; --navy-2:#103a63; --navy-3:#16467a;
  --blue:#1d6fe0; --blue-d:#1558b8; --blue-l:#e8f1fe;
  --bg:#f2f5fa; --card:#ffffff; --line:#e3e9f2; --line-2:#eef2f8;
  --text:#0f1c2e; --muted:#64748b; --muted-2:#94a3b8;
  --green:#16a34a; --green-l:#e7f7ee; --orange:#f59e0b; --orange-l:#fef4e5;
  --red:#dc2626; --red-l:#fdeaea; --purple:#7c3aed; --purple-l:#f1eafe;
  --teal:#0ea5a5; --r:14px; --r-sm:10px;
  --shadow:0 1px 2px rgba(15,28,46,.06), 0 4px 14px rgba(15,28,46,.05);
  --shadow-lg:0 10px 34px rgba(11,37,69,.16);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Segoe UI",Inter,system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--text); font-size:14px; -webkit-font-smoothing:antialiased;
}
a{color:var(--blue); text-decoration:none}
button{font-family:inherit; cursor:pointer}
input,select,textarea{font-family:inherit; font-size:14px}
.hidden{display:none !important}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:#c7d3e3;border-radius:8px}
::-webkit-scrollbar-track{background:transparent}

/* ---------- util ---------- */
.row{display:flex; align-items:center; gap:10px}
.between{display:flex; align-items:center; justify-content:space-between; gap:10px}
.grow{flex:1; min-width:0}
.muted{color:var(--muted)}
.small{font-size:12px}
.bold{font-weight:700}
.tc{text-align:center}
.tr{text-align:right}
.wrap{flex-wrap:wrap}
.grid{display:grid; gap:14px}
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}
.mb0{margin-bottom:0}
.nowrap{white-space:nowrap}
.ellip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pill{border-radius:999px}
.chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:600}
.chip.green{background:var(--green-l);color:var(--green)}
.chip.red{background:var(--red-l);color:var(--red)}
.chip.orange{background:var(--orange-l);color:#b45309}
.chip.blue{background:var(--blue-l);color:var(--blue)}
.chip.grey{background:#eef2f8;color:var(--muted)}
.chip.purple{background:var(--purple-l);color:var(--purple)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line);
  background:#fff;color:var(--text);padding:9px 15px;border-radius:var(--r-sm);font-weight:600;font-size:13.5px;transition:.15s}
.btn:hover{background:#f7f9fc}
.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.btn.primary:hover{background:var(--blue-d)}
.btn.dark{background:var(--navy);border-color:var(--navy);color:#fff}
.btn.ghost{background:transparent;border-color:transparent;color:var(--blue)}
.btn.sm{padding:6px 11px;font-size:12.5px;border-radius:9px}
.btn.block{width:100%;padding:13px;font-size:15px}
.btn.danger{background:var(--red);border-color:var(--red);color:#fff}
.btn:disabled{opacity:.55;cursor:not-allowed}
.icon-btn{width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:#fff;display:grid;place-items:center}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow)}
.card .head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line-2)}
.card .head h3{margin:0;font-size:14px;font-weight:700}
.card .body{padding:14px}
.field{display:flex;align-items:center;gap:9px;border:1px solid var(--line);background:#fff;border-radius:var(--r-sm);padding:10px 12px;margin-bottom:10px}
.field svg{flex:none;color:var(--muted-2)}
.field input,.field select,.field textarea{border:0;outline:0;width:100%;background:transparent;color:var(--text)}
.field textarea{resize:vertical;min-height:52px}
.field.plain{padding:0;border:0}
.label{font-size:11.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;margin:0 0 6px}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;color:var(--muted);font-weight:600;font-size:11.5px;text-transform:uppercase;letter-spacing:.3px;padding:9px 10px;border-bottom:1px solid var(--line)}
td{padding:10px;border-bottom:1px solid var(--line-2);vertical-align:middle}
tbody tr:hover{background:#f8fafd}
.progress{height:8px;border-radius:99px;background:#e6edf7;overflow:hidden}
.progress i{display:block;height:100%;background:linear-gradient(90deg,#1d6fe0,#3b9bfb);border-radius:99px}
.empty{padding:26px;text-align:center;color:var(--muted)}

/* ---------- LOGIN (mockup layar 1) ---------- */
#login{min-height:100vh;background:linear-gradient(160deg,#0a2140 0%,#0b2545 42%,#123f6e 100%);display:flex;align-items:center;justify-content:center;padding:22px}
.login-box{width:100%;max-width:390px}
.login-brand{text-align:center;color:#fff;margin-bottom:26px}
.login-brand .logo{width:96px;height:96px;margin:0 auto 16px;border-radius:50%;background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.22);display:grid;place-items:center;box-shadow:0 12px 30px rgba(0,0,0,.25)}
.login-brand h1{margin:0 0 8px;font-size:25px;letter-spacing:.2px}
.login-brand p{margin:0;color:#b9cde8;font-size:12.5px;line-height:1.6;max-width:300px;margin-inline:auto}
.login-card{background:#fff;border-radius:16px;padding:16px;box-shadow:var(--shadow-lg)}
.login-card .field{margin-bottom:11px}
.login-err{background:var(--red-l);color:var(--red);padding:10px 12px;border-radius:10px;font-size:12.5px;margin-bottom:10px}
.login-foot{margin-top:14px;text-align:center;color:#a9c1e0;font-size:12px}
.login-foot a{color:#cfe0f6}
.demo-hint{margin-top:14px;background:rgba(255,255,255,.08);border:1px dashed rgba(255,255,255,.25);color:#cfe0f6;
  border-radius:12px;padding:10px 12px;font-size:11.5px;line-height:1.7}

/* ---------- SHELL MOBILE ---------- */
#app{min-height:100vh}
.mobile-shell{max-width:440px;margin:0 auto;background:#fff;min-height:100vh;position:relative;box-shadow:0 0 40px rgba(11,37,69,.08);display:flex;flex-direction:column}
.m-top{background:linear-gradient(135deg,#0b2545,#16467a);color:#fff;padding:14px 16px 16px;position:sticky;top:0;z-index:30}
.m-top .greet{font-size:12px;color:#b9cde8}
.m-top h2{margin:2px 0 0;font-size:18px}
.m-top .sub{font-size:11.5px;color:#b9cde8}
.m-scroll{flex:1;padding:14px 14px 96px}
.bell{position:relative;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.13);display:grid;place-items:center;color:#fff;border:0}
.bell .dot{position:absolute;top:-3px;right:-3px;min-width:17px;height:17px;border-radius:99px;background:var(--red);color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center;padding:0 4px;border:2px solid #10365f}
.m-card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:13px;box-shadow:var(--shadow)}
.m-card .ttl{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:13.5px;margin-bottom:10px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat{border:1px solid var(--line);border-radius:12px;padding:11px;display:flex;gap:9px;align-items:center;background:#fff}
.stat .ic{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;flex:none}
.stat .ic.blue{background:var(--blue-l);color:var(--blue)}
.stat .ic.green{background:var(--green-l);color:var(--green)}
.stat .ic.orange{background:var(--orange-l);color:#b45309}
.stat .ic.purple{background:var(--purple-l);color:var(--purple)}
.stat .v{font-weight:700;font-size:14.5px;line-height:1.25}
.stat .l{font-size:11px;color:var(--muted)}
.m-nav{position:fixed;bottom:0;left:0;right:0;max-width:440px;margin:0 auto;background:#fff;border-top:1px solid var(--line);
  display:grid;grid-template-columns:repeat(4,1fr);padding:7px 4px 9px;z-index:40}
.m-nav button{background:0;border:0;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10.5px;font-weight:600;padding:3px}
.m-nav button.on{color:var(--blue)}
.m-sec{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;margin:16px 2px 9px}
.tabs{display:flex;gap:7px;overflow-x:auto;padding-bottom:2px}
.tab{border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 13px;font-size:12.5px;font-weight:600;color:var(--muted);white-space:nowrap}
.tab.on{background:var(--blue);border-color:var(--blue);color:#fff}
.m-item{display:flex;gap:10px;padding:11px;border:1px solid var(--line);border-radius:12px;background:#fff;margin-bottom:9px;align-items:flex-start}
.m-item .av{width:38px;height:38px;border-radius:10px;background:var(--blue-l);color:var(--blue);display:grid;place-items:center;flex:none}
.m-item .av.red{background:var(--red-l);color:var(--red)}
.m-item .av.green{background:var(--green-l);color:var(--green)}
.m-item h4{margin:0;font-size:13.5px}
.m-item .meta{font-size:11.5px;color:var(--muted);margin-top:2px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.trx-row{display:grid;grid-template-columns:1fr auto auto auto;gap:8px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line-2)}
.stepper{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.stepper button{width:26px;height:26px;border:0;background:#f6f9fd;color:var(--text);font-weight:700}
.stepper span{min-width:26px;text-align:center;font-weight:600;font-size:13px}
.kv{display:flex;align-items:center;justify-content:space-between;padding:9px 0;border-bottom:1px dashed var(--line-2)}
.kv:last-child{border-bottom:0}
.kv .k{color:var(--muted);font-size:12.5px;display:flex;align-items:center;gap:7px}
.kv .v{font-weight:700;font-size:13.5px}
.pay-opts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pay{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px;background:#fff;font-weight:600;font-size:12.5px}
.pay.on{border-color:var(--blue);background:var(--blue-l);color:var(--blue)}
.photo-box{border:1px dashed #c7d3e3;border-radius:12px;background:#f8fafd;height:92px;display:grid;place-items:center;color:var(--muted);position:relative;overflow:hidden}
.photo-box img{width:100%;height:100%;object-fit:cover}
.badge-gps{background:var(--green);color:#fff;font-size:11px;font-weight:700;padding:4px 10px;border-radius:999px;display:inline-flex;gap:5px;align-items:center}
.dotpulse{width:7px;height:7px;border-radius:99px;background:#fff;animation:pulse 1.4s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}
#mapMobile{height:290px;border-radius:12px;overflow:hidden;border:1px solid var(--line)}
.leaflet-container{font-size:12px;font-family:inherit}
.map-pin{width:26px;height:26px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.3)}
.map-pin.green{background:var(--green)}.map-pin.red{background:var(--red)}.map-pin.blue{background:var(--blue)}
.map-pin i{display:block;width:100%;height:100%;transform:rotate(45deg)}
.toko-modal{position:fixed;inset:0;background:rgba(11,37,69,.45);z-index:60;display:none;align-items:flex-end;justify-content:center}
.toko-modal.on{display:flex}
.sheet{background:#fff;width:100%;max-width:440px;border-radius:18px 18px 0 0;padding:16px;max-height:88vh;overflow:auto}

/* ---------- ADMIN / DESKTOP ---------- */
.admin{display:grid;grid-template-columns:232px 1fr;min-height:100vh}
.side{background:linear-gradient(180deg,#0b2545,#0f3358);color:#cdddf1;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.side .brand{display:flex;gap:10px;align-items:center;padding:16px 16px 14px;color:#fff;font-weight:700;font-size:14.5px;border-bottom:1px solid rgba(255,255,255,.08)}
.side .brand .lg{width:34px;height:34px;border-radius:10px;background:var(--blue);display:grid;place-items:center;flex:none}
.side nav{padding:8px;overflow:auto;flex:1}
.side nav a{display:flex;align-items:center;gap:10px;padding:9.5px 11px;border-radius:10px;color:#cdddf1;font-size:13px;font-weight:500;margin-bottom:1px;position:relative}
.side nav a:hover{background:rgba(255,255,255,.07);color:#fff}
.side nav a.on{background:var(--blue);color:#fff;font-weight:600;box-shadow:0 4px 12px rgba(29,111,224,.35)}
.side nav a .nbadge{margin-left:auto;background:var(--red);color:#fff;border-radius:99px;font-size:10.5px;font-weight:700;padding:1px 6px}
.side .user{border-top:1px solid rgba(255,255,255,.08);padding:12px;display:flex;gap:10px;align-items:center}
.side .user .av{width:34px;height:34px;border-radius:50%;background:var(--blue);color:#fff;display:grid;place-items:center;font-weight:700}
.main{min-width:0;display:flex;flex-direction:column}
.top{background:#fff;border-bottom:1px solid var(--line);padding:10px 18px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:20}
.searchbox{flex:1;max-width:460px;display:flex;align-items:center;gap:9px;background:#f4f7fb;border:1px solid var(--line);border-radius:10px;padding:8px 12px;color:var(--muted)}
.searchbox input{border:0;background:transparent;outline:0;width:100%}
.content{padding:16px 18px 30px}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px;display:flex;gap:12px;align-items:center;box-shadow:var(--shadow)}
.kpi .ic{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;flex:none}
.kpi .l{font-size:12px;color:var(--muted)}
.kpi .v{font-size:20px;font-weight:800;letter-spacing:-.4px;white-space:nowrap}
.kpi .s{font-size:11px;color:var(--muted);margin-top:2px}
.kpi .s.up{color:var(--green);font-weight:600}
.dash-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:14px;margin-top:14px;align-items:start}
.dash-grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}
.dash-grid3{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:14px;margin-top:14px;align-items:start}
#mapAdmin{height:330px}
.legend{display:flex;gap:14px;padding:9px 14px;border-top:1px solid var(--line-2);flex-wrap:wrap;font-size:11.5px;color:var(--muted)}
.legend i{width:9px;height:9px;border-radius:99px;display:inline-block;margin-right:5px}
.rank{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:11px;font-weight:700;background:#eef2f8;color:var(--muted)}
.rank.g1{background:#fff3c4;color:#a16207}.rank.g2{background:#e8eaf0;color:#475569}.rank.g3{background:#fbe7d3;color:#b45309}
.mini{font-size:11.5px;color:var(--muted)}
.donut{width:132px;height:132px;border-radius:50%;position:relative;flex:none}
.donut::after{content:"";position:absolute;inset:22px;background:#fff;border-radius:50%}
.donut .lbl{position:absolute;inset:0;display:grid;place-items:center;z-index:2;font-weight:800;font-size:19px}
.gauge{width:96px;height:96px;border-radius:50%;position:relative;flex:none}
.gauge::after{content:"";position:absolute;inset:15px;background:#fff;border-radius:50%}
.gauge .lbl{position:absolute;inset:0;display:grid;place-items:center;z-index:2;font-weight:800;font-size:17px}
.bars{display:flex;align-items:flex-end;gap:12px;height:150px;padding:10px 4px 0}
.bars .b{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;height:100%}
.bars .b .bar{width:100%;max-width:44px;background:linear-gradient(180deg,#3b9bfb,#1d6fe0);border-radius:6px 6px 0 0;min-height:4px}
.bars .b .lb{font-size:11px;color:var(--muted)}
.notif-item{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--line-2);align-items:flex-start}
.notif-item:last-child{border-bottom:0}
.notif-item .ic{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none}
.toast-wrap{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:9px;z-index:200}
.toast{background:var(--navy);color:#fff;padding:11px 15px;border-radius:11px;box-shadow:var(--shadow-lg);font-size:13px;max-width:340px}
.toast.ok{background:#0f7a3d}.toast.err{background:#b91c1c}
.modal{position:fixed;inset:0;background:rgba(11,37,69,.5);z-index:150;display:none;align-items:center;justify-content:center;padding:18px}
.modal.on{display:flex}
.modal .sheet{max-width:620px;border-radius:16px;max-height:90vh}
.filters{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.filters .field{margin:0;min-width:170px}
.pager{display:flex;gap:6px;align-items:center;justify-content:flex-end;padding:10px 4px 0;font-size:12.5px;color:var(--muted)}
@media(max-width:1080px){.kpis{grid-template-columns:1fr 1fr}.dash-grid,.dash-grid2,.dash-grid3{grid-template-columns:1fr}}
@media(max-width:820px){
  .admin{grid-template-columns:1fr}
  .side{position:fixed;left:0;top:0;bottom:0;width:232px;z-index:100;transform:translateX(-100%);transition:.2s}
  .side.open{transform:none}
  .menu-toggle{display:grid !important}
}
.menu-toggle{display:none}
