/* Monitoring Shipment Diratu — adjustable glass dashboard. Tanpa CDN, font sistem. */
:root{
  --glass-blur:14px; --glass-opacity:.72; --glass-sat:1.15; --glass-edge:18px;
  --ink:#2b2620; --ink-soft:#5d564c; --line:rgba(43,38,32,.14);
  --accent:#8a6d3b; --accent-2:#5c6e58; --danger:#a33b2e; --ok:#3f6b4f;
}
body[data-tint="krem"]{ --tint:#f3ead9; --tint-soft:#efe3cb; --panel-solid:#f6efdf; --chip:#e7d9bd; }
body[data-tint="putih"]{ --tint:#f4f2ee; --tint-soft:#eceae5; --panel-solid:#faf9f7; --chip:#e3e0da; }
body[data-tint="sage"]{ --tint:#e3e8dd; --tint-soft:#d8e0d2; --panel-solid:#edf1e8; --chip:#ccd8c4; }
body[data-tint="pasir"]{ --tint:#ead9bd; --tint-soft:#e2cdaa; --panel-solid:#f2e6cf; --chip:#dcc49c; }
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,"Segoe UI",Roboto,Arial,sans-serif; color:var(--ink);
  min-height:100dvh; background-color:var(--tint);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='700' viewBox='0 0 1200 700' preserveAspectRatio='xMidYMid slice'%3E%3Crect width='1200' height='700' fill='%23cfd8d3'/%3E%3Crect y='0' width='1200' height='380' fill='%23b9c9c4'/%3E%3Ccircle cx='980' cy='110' r='52' fill='%23e8d9a8'/%3E%3Crect y='380' width='1200' height='320' fill='%237d94a0'/%3E%3Crect y='470' width='1200' height='230' fill='%236b8390'/%3E%3Cg fill='%23a4553f'%3E%3Crect x='60' y='470' width='120' height='60'/%3E%3Crect x='60' y='530' width='120' height='60'/%3E%3Crect x='185' y='500' width='120' height='60'/%3E%3C/g%3E%3Cg fill='%235c6e58'%3E%3Crect x='330' y='480' width='120' height='55'/%3E%3Crect x='330' y='535' width='120' height='55'/%3E%3Crect x='455' y='510' width='120' height='55'/%3E%3C/g%3E%3Cg fill='%23b08d4f'%3E%3Crect x='620' y='470' width='120' height='60'/%3E%3Crect x='745' y='500' width='120' height='60'/%3E%3Crect x='620' y='530' width='120' height='60'/%3E%3C/g%3E%3Cg fill='%234a5a63'%3E%3Crect x='880' y='480' width='120' height='55'/%3E%3Crect x='1005' y='510' width='120' height='55'/%3E%3C/g%3E%3Cg stroke='%233d4a52' stroke-width='10' fill='none'%3E%3Cpath d='M180 470 L180 180 L560 180 L560 470'/%3E%3Cpath d='M560 180 L700 300'/%3E%3C/g%3E%3Crect x='520' y='180' width='80' height='46' fill='%233d4a52'/%3E%3Crect x='700' y='300' width='26' height='60' fill='%233d4a52'/%3E%3C/svg%3E");
  background-size:cover; background-position:center; background-attachment:fixed;
}
a{color:var(--accent)}
button{font:inherit;cursor:pointer}
input,select,textarea{font:inherit;color:var(--ink)}
h1,h2,h3{margin:0 0 .5rem}

/* ---- layout: rail kiri + konten + dock bawah ---- */
.rail{position:fixed;left:10px;top:50%;transform:translateY(-50%);z-index:40;display:flex;flex-direction:column;gap:8px;padding:10px 8px;border-radius:22px}
.rail button{width:46px;height:46px;border-radius:14px;border:1px solid var(--line);background:transparent;font-size:21px;line-height:1}
.rail button.active{background:var(--chip)}
.rail button:hover{background:var(--chip)}
.shell{margin:0 auto;max-width:1080px;padding:16px 16px 110px 76px}
.glass{
  background:color-mix(in srgb, var(--tint) calc(var(--glass-opacity)*100%), transparent);
  backdrop-filter:blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(var(--glass-sat));
  border:1px solid rgba(255,255,255,.45); border-radius:var(--glass-edge);
  box-shadow:0 8px 28px rgba(43,38,32,.16);
}
.topbar{display:flex;align-items:center;gap:12px;padding:14px 18px;margin-bottom:14px;flex-wrap:wrap}
.topbar h1{font-size:20px;margin:0}
.topbar .sub{color:var(--ink-soft);font-size:13px}
.topbar .spacer{flex:1}
.panel{padding:18px;margin-bottom:14px}
.view{display:none}
.view.active{display:block}
.dock{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);z-index:40;display:flex;gap:6px;padding:8px;border-radius:20px}
.dock button{border:1px solid var(--line);background:transparent;border-radius:14px;padding:10px 16px;font-weight:600}
.dock button.active{background:var(--chip)}
.btn{border:1px solid var(--line);background:var(--chip);border-radius:12px;padding:9px 14px;font-weight:600}
.btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn.ghost{background:transparent}
.btn.danger{background:var(--danger);color:#fff;border-color:var(--danger)}
.btn.small{padding:6px 10px;font-size:13px}
.btn:disabled{opacity:.5;cursor:not-allowed}
.muted{color:var(--ink-soft);font-size:13px}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}

/* ---- kontrol sticky sheet ---- */
.stickybar{position:sticky;top:0;z-index:20;display:flex;gap:10px;align-items:center;flex-wrap:wrap;
  padding:12px 14px;margin:-18px -18px 14px;border-radius:var(--glass-edge) var(--glass-edge) 0 0;
  background:var(--panel-solid);border-bottom:1px solid var(--line)}

/* ---- dropdown staggered ---- */
.dd{position:relative;display:inline-block}
.dd-btn{border:1px solid var(--line);background:var(--panel-solid);border-radius:12px;padding:9px 14px;font-weight:600;display:flex;gap:8px;align-items:center}
.dd-panel{position:absolute;left:0;top:calc(100% + 6px);z-index:50;min-width:280px;max-width:92vw;max-height:60vh;overflow:auto;
  background:var(--panel-solid);border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 34px rgba(43,38,32,.25);padding:6px;display:none}
.dd.open .dd-panel{display:block}
.dd-item{display:flex;justify-content:space-between;gap:12px;width:100%;text-align:left;border:0;background:transparent;
  padding:10px 12px;border-radius:10px;opacity:1}
.dd-item:hover{background:var(--chip)}
.dd-item.sel{background:var(--chip);font-weight:700}
.dd.open .dd-item{animation:ddin .28s ease both}
.dd.open .dd-item:nth-child(1){animation-delay:.02s}.dd.open .dd-item:nth-child(2){animation-delay:.05s}
.dd.open .dd-item:nth-child(3){animation-delay:.08s}.dd.open .dd-item:nth-child(4){animation-delay:.11s}
.dd.open .dd-item:nth-child(5){animation-delay:.14s}.dd.open .dd-item:nth-child(6){animation-delay:.17s}
.dd.open .dd-item:nth-child(7){animation-delay:.20s}.dd.open .dd-item:nth-child(8){animation-delay:.23s}
.dd.open .dd-item:nth-child(9){animation-delay:.26s}.dd.open .dd-item:nth-child(10){animation-delay:.29s}
.dd.open .dd-item:nth-child(11){animation-delay:.32s}.dd.open .dd-item:nth-child(n+12){animation-delay:.35s}
@keyframes ddin{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
.dd .badge{background:var(--accent);color:#fff;border-radius:999px;font-size:12px;padding:1px 8px;font-weight:700}
.dd-foot{display:flex;gap:6px;flex-wrap:wrap;padding:8px 6px 4px;border-top:1px solid var(--line);margin-top:4px}
.dd-check{display:flex;align-items:center;gap:8px}
.dd-check input{width:17px;height:17px;accent-color:var(--accent)}

/* ---- kartu statistik ---- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:12px 0}
.stat{background:var(--panel-solid);border:1px solid var(--line);border-radius:14px;padding:12px}
.stat .n{font-size:26px;font-weight:800;line-height:1.1}
.stat .l{font-size:12px;color:var(--ink-soft);margin-top:2px}
.bars{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.bar-row{display:grid;grid-template-columns:150px 1fr 44px;gap:10px;align-items:center;font-size:13px}
.bar-track{height:18px;background:rgba(43,38,32,.09);border-radius:9px;overflow:hidden}
.bar-fill{height:100%;background:var(--accent-2);border-radius:9px}
.bar-row:nth-child(odd) .bar-fill{background:var(--accent)}

/* ---- grafik tren ---- */
.trend{display:flex;align-items:flex-end;gap:8px;height:190px;padding:10px 4px 0;border-bottom:2px solid var(--line)}
.trend .col{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;height:100%;justify-content:flex-end}
.trend .bar{width:100%;max-width:52px;background:var(--accent-2);border-radius:8px 8px 0 0;cursor:pointer;border:0;padding:0;min-height:4px}
.trend .col.sel .bar{background:var(--accent)}
.trend .col .v{font-size:12px;font-weight:700}
.trend .col .m{font-size:11px;color:var(--ink-soft);white-space:nowrap}

/* ---- tabel ---- */
.tbl-wrap{overflow-x:auto;margin:10px -6px 0;padding:0 6px}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left;white-space:nowrap}
th{background:var(--chip);position:sticky;top:0}
td.wrap{white-space:normal;min-width:140px}
.num{text-align:right}
.tag{display:inline-block;background:var(--chip);border-radius:999px;padding:2px 9px;font-size:12px;font-weight:600}

/* ---- dialog (solid, tidak tembus pandang) ---- */
.overlay{position:fixed;inset:0;z-index:100;background:rgba(43,38,32,.45);display:flex;align-items:flex-start;justify-content:center;padding:4vh 12px;overflow:auto}
.dialog{background:var(--panel-solid);border:1px solid var(--line);border-radius:18px;box-shadow:0 20px 50px rgba(0,0,0,.3);
  width:100%;max-width:640px;max-height:92dvh;display:flex;flex-direction:column}
.dialog header{padding:16px 18px 0;display:flex;justify-content:space-between;align-items:center}
.dialog .body{padding:14px 18px;overflow:auto}
.dialog footer{position:sticky;bottom:0;padding:14px 18px;border-top:1px solid var(--line);display:flex;gap:10px;justify-content:flex-end;background:var(--panel-solid);border-radius:0 0 18px 18px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field{display:flex;flex-direction:column;gap:4px}
.field.full{grid-column:1/-1}
.field label{font-size:12px;font-weight:700;color:var(--ink-soft)}
.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:#fff;width:100%}
.field textarea{resize:vertical;min-height:64px}

/* ---- presentasi ---- */
.slide-nav{position:sticky;top:0;z-index:20;display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  background:var(--panel-solid);border-bottom:1px solid var(--line);padding:12px 14px;margin:-18px -18px 14px}
.slide-nav button{border:1px solid var(--line);background:transparent;border-radius:999px;padding:8px 13px;font-weight:600}
.slide-nav button.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.slide{min-height:340px;display:flex;flex-direction:column;justify-content:center;padding:24px 8px}
.slide h2{font-size:28px}
.slide .big{font-size:52px;font-weight:800;line-height:1}
.slide .kicker{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft);font-weight:700}
.slide p.lead{font-size:17px;color:var(--ink-soft);max-width:640px}

/* ---- login ---- */
.login-wrap{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{width:100%;max-width:380px;padding:28px}
.login-card input{width:100%;border:1px solid var(--line);border-radius:10px;padding:11px 12px;background:#fff;margin:6px 0 12px}
.login-card label{font-size:13px;font-weight:700;color:var(--ink-soft)}
.err{background:#fbe9e5;color:var(--danger);border-radius:10px;padding:10px 12px;font-size:13px;margin-bottom:10px;display:none}

/* ---- atur kaca ---- */
.glass-ctl{display:grid;gap:10px;padding:4px 0}
.glass-ctl label{font-size:13px;font-weight:700;color:var(--ink-soft);display:flex;justify-content:space-between}
.glass-ctl input[type=range]{width:100%;accent-color:var(--accent)}
.tints{display:flex;gap:8px;flex-wrap:wrap}
.tints button{border:2px solid var(--line);border-radius:12px;padding:8px 12px;background:var(--panel-solid);font-weight:600}
.tints button.active{border-color:var(--accent)}

@media (max-width:720px){
  .shell{padding:12px 10px 120px 10px}
  .rail{display:none}
  .form-grid{grid-template-columns:1fr}
  .bar-row{grid-template-columns:100px 1fr 36px}
  .slide h2{font-size:23px}.slide .big{font-size:40px}
  .dock{width:calc(100% - 20px);justify-content:center}
  .dock button{flex:1;padding:10px 4px;font-size:13px}
}
@media print{
  body{background:#fff !important}
  .rail,.dock,.topbar .btn,.stickybar,.dd,.noprint{display:none !important}
  .shell{padding:0;max-width:none}
  .glass{box-shadow:none;border:0;background:#fff}
  .panel{padding:0}
  .view{display:none}.view.active{display:block}
}
