:root {
  --navy: #12324a; --navy-2: #0d2436; --teal: #1f7f86; --green: #2f6b3a; --green-2: #3d8a4a; --lime: #7ab648;
  --ink: #17232d; --muted: #5d6c78; --line: #dde6e3; --bg: #f4f7f6; --card: #fff;
  --ok: #1e7a3c; --ok-bg: #e8f5ec; --warn: #a45f00; --warn-bg: #fff4e0; --bad: #b42318; --bad-bg: #fdecea;
  --r: 12px; --sh: 0 1px 2px rgba(16, 38, 58, .06), 0 2px 8px rgba(16, 38, 58, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--teal); }
h1 { font-size: 1.5rem; margin: 0 0 2px; color: var(--navy); line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 12px; color: var(--navy); }
h3 { font-size: .98rem; margin: 0 0 10px; color: var(--navy); }
h4 { margin: 10px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .b { font-weight: 700; } .big { font-size: 1.25rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: -.01em; }
.r { text-align: right; } .center { text-align: center; } .mt { margin-top: 12px; }
.due { color: var(--bad); } .ok { color: var(--ok); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 60px; }
.row { display: flex; gap: 8px; align-items: center; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .wrap-row { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

/* header */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.top.admin { background: var(--navy-2); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-weight: 800; letter-spacing: .05em; color: #9fd77a; } .brand small { font-size: .6rem; letter-spacing: .2em; opacity: .8; margin-top: 3px; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: #d7e4ee; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .92rem; white-space: nowrap; position: relative; }
.top nav a:hover { background: rgba(255,255,255,.08); }
.top nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.top nav a i { font-style: normal; background: #e5484d; color: #fff; font-size: .7rem; border-radius: 99px; padding: 0 6px; margin-left: 6px; }
.top nav .admin-link { color: #9fd77a; margin-left: auto; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { border-color: #b8c8c3; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--green); border-color: var(--green); color: #fff; } .btn.pri:hover { background: var(--green-2); }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.warn { background: var(--warn-bg); border-color: #f0c77d; color: var(--warn); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; } .btn.ghost.danger { color: var(--bad); border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: .85rem; } .btn.lg { padding: 12px 20px; min-height: 48px; font-size: 1rem; }
.btn.block { width: 100%; } .btn.dashed { border-style: dashed; color: var(--teal); background: transparent; margin-top: 8px; }
.top .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.link { background: none; border: 0; color: var(--teal); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; } .link.danger { color: var(--bad); }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); margin-bottom: 14px; }
.grid > .card { margin-bottom: 0; } .grid { margin-bottom: 14px; }
.card.alert { border-color: #f3b3ad; background: #fffafa; } .card.empty { text-align: center; color: var(--muted); padding: 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.rule { background: var(--navy); color: #dbe7f0; padding: 12px 16px; border-radius: var(--r); font-size: .88rem; } .rule b { color: #fff; margin-right: 8px; }

/* forms */
.f { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; } .f > span { font-size: .82rem; font-weight: 600; color: #3b4a55; }
input, select, textarea { font: inherit; border: 1px solid #cfdad6; border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); width: 100%; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 127, 134, .35); border-color: var(--teal); }
textarea { resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; margin: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; } .check.big { font-size: 1rem; background: var(--ok-bg); padding: 12px; border-radius: 10px; }
.seg { display: inline-flex; background: #e9efed; border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); min-height: 38px; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--sh); } .seg.sm button { padding: 5px 12px; min-height: 32px; }
.search { display: flex; gap: 6px; } .search input { min-width: 260px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: .85rem; text-decoration: none; color: var(--ink); cursor: pointer; font: inherit; font-size: .85rem; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ok-box { background: var(--ok-bg); color: var(--ok); padding: 9px 12px; border-radius: 9px; font-size: .9rem; margin-bottom: 10px; }
.warn-box { background: var(--warn-bg); color: var(--warn); padding: 9px 12px; border-radius: 9px; font-size: .9rem; margin: 8px 0; }
.errs { color: var(--bad); padding-left: 18px; } .errs li { margin: 4px 0; }

/* badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #e6edf2; color: var(--navy); vertical-align: middle; font-family: inherit; letter-spacing: 0; }
.badge.late, .st-KOMPLAIN.badge { background: var(--bad-bg); color: var(--bad); }
.st-PICKUP.badge { background: #ede7fb; color: #5b3ea8; } .st-DITERIMA.badge { background: #e3eefb; color: #1d5aa6; }
.st-CUCI.badge, .st-SELESAI_LAUNDRY.badge { background: #e0f3f4; color: #146a70; } .st-QC.badge, .st-PACKING.badge { background: var(--warn-bg); color: var(--warn); }
.st-SIAP.badge { background: var(--ok-bg); color: var(--ok); } .st-DISERAHKAN.badge, .st-SELESAI.badge { background: #eef1f3; color: #4a5a66; } .st-BATAL.badge { background: #f1f1f1; color: #888; }

/* dashboard */
.pipe { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pipe-i { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); box-shadow: var(--sh); }
.pipe-i b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--navy); } .pipe-i span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.pipe-i.st-QC, .pipe-i.st-PACKING { border-left-color: #e3a33b; } .pipe-i.st-SIAP { border-left-color: var(--ok); } .pipe-i.st-KOMPLAIN { border-left-color: var(--bad); } .pipe-i.st-PICKUP { border-left-color: #7b5cd6; }
.mini { list-style: none; padding: 0; margin: 0; } .mini li a { display: block; padding: 7px 0; border-bottom: 1px solid #eef2f0; text-decoration: none; color: var(--ink); font-size: .9rem; }
.mini small { display: block; color: var(--muted); }

/* list */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-i { display: flex; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; text-decoration: none; color: var(--ink); align-items: center; }
.list-i:hover { border-color: var(--teal); } .list-i .r { white-space: nowrap; }

/* new order */
.new-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.step h2 { display: flex; align-items: center; gap: 10px; } .step h2 i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.summary { position: sticky; top: 74px; }
.sum-items { list-style: none; padding: 0; margin: 0 0 10px; font-size: .88rem; } .sum-items li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0 0 12px; font-size: .92rem; } dt { color: var(--muted); } dd { margin: 0; text-align: right; }
.svc-cat { margin-bottom: 6px; } .svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.svc-grid button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; min-height: 64px; }
.svc-grid button:hover { border-color: var(--green); background: #f5faf3; } .svc-grid b { display: block; font-size: .9rem; } .svc-grid span { font-size: .78rem; color: var(--muted); }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fbfcfc; }
.item-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; } .item-h .link { margin-left: auto; }
.stepper { display: flex; } .stepper button { width: 42px; border: 1px solid #cfdad6; background: #fff; font-size: 1.2rem; cursor: pointer; }
.stepper button:first-child { border-radius: 9px 0 0 9px; } .stepper button:last-child { border-radius: 0 9px 9px 0; }
.stepper input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; }
.cond { display: flex; flex-wrap: wrap; gap: 6px; }
.cond button, .cond span { border: 1px solid #cfdad6; background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .84rem; cursor: pointer; }
.cond button.on { background: #fdecea; border-color: #e7928a; color: var(--bad); font-weight: 600; }
.cond button.okc.on { background: var(--ok-bg); border-color: #8fcaa1; color: var(--ok); }
.cond.ro span { cursor: default; background: #fdecea; border-color: #f2c1bb; color: var(--bad); padding: 2px 10px; font-size: .78rem; } .cond.ro span.okc { background: var(--ok-bg); border-color: #b9e0c4; color: var(--ok); }
.cond.ed span { cursor: default; } .cond.ed button { border: 0; background: none; padding: 0 0 0 4px; color: var(--bad); }
.photos { margin-top: 6px; } .thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.thumb { position: relative; } .thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; cursor: pointer; line-height: 1; }
.review .t { margin: 8px 0; }

/* detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.stepper-wrap, .stepper { } ol.stepper { list-style: none; display: flex; padding: 0; margin: 0 0 14px; gap: 4px; overflow-x: auto; }
ol.stepper li { flex: 1; min-width: 92px; text-align: center; font-size: .74rem; font-weight: 600; padding: 8px 4px; background: #e9efed; color: var(--muted); border-radius: 8px; }
ol.stepper li.done { background: #d9ecdf; color: var(--ok); } ol.stepper li.now { background: var(--navy); color: #fff; }
.card.action { border: 2px solid var(--navy); } .card.action h3 { font-size: 1.08rem; }
.qc { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; margin-bottom: 8px; }
.pay-box { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.d-item { border-bottom: 1px solid #eef2f0; padding: 10px 0; } .d-item:last-child { border-bottom: 0; } .d-item .cond { margin: 6px 0; }
.ph-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .ph { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--line); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { border-left: 3px solid var(--line); padding: 4px 0 10px 12px; font-size: .9rem; }
.timeline li.t-status { border-left-color: var(--teal); } .timeline li.t-wa { border-left-color: #1fa855; } .timeline li.t-payment { border-left-color: var(--green); } .timeline li.t-create { border-left-color: var(--navy); }
.timeline pre { white-space: pre-wrap; font-family: inherit; background: #f4f7f6; padding: 8px; border-radius: 8px; }

/* tables */
.t { width: 100%; border-collapse: collapse; font-size: .9rem; } .t th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 7px 8px; }
.t td { border-bottom: 1px solid #eef2f0; padding: 8px; vertical-align: top; } .t th.r, .t td.r { text-align: right; } .t tr.off td { opacity: .5; }
.card { overflow-x: auto; }

/* admin report */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sh); }
.kpi span { font-size: .75rem; font-weight: 600; color: var(--muted); display: block; } .kpi b { font-size: 1.25rem; color: var(--navy); display: block; margin: 2px 0; } .kpi small { font-size: .74rem; color: var(--muted); }
.range { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; } .range .chips { margin: 0; } .range input { width: auto; }
.chart { width: 100%; height: auto; } .chart .gl { stroke: #e7edeb; } .chart .ax { font-size: 11px; fill: var(--muted); }
.chart .ba { fill: var(--navy); } .chart .bb { fill: var(--lime); }
.legend { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; } .legend span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-a { background: var(--navy); } .lg-b { background: var(--lime); margin-left: 10px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #e3f2f6, #f4f7f6 60%); }
.auth-card { background: #fff; border-radius: 18px; padding: 28px; width: min(440px, 100%); box-shadow: 0 10px 40px rgba(16, 38, 58, .12); text-align: center; }
.auth-card form { text-align: left; } .auth-logo { width: 72px; height: 72px; margin: 0 auto 10px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.staff-grid button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 8px; cursor: pointer; font: inherit; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.staff-grid button:hover { border-color: var(--green); } .staff-grid small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.av { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 1.2rem; text-transform: uppercase; }
.pin-dots { font-size: 1.6rem; letter-spacing: .3em; color: var(--navy); margin: 10px 0; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinpad button { font: inherit; font-size: 1.4rem; font-weight: 700; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #f8faf9; cursor: pointer; }
.pinpad button.pri { background: var(--green); color: #fff; border-color: var(--green); }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 25, 38, .5); display: grid; place-items: center; z-index: 50; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; position: relative; }
.modal.wide { width: min(860px, 100%); } .modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.modal h3 { font-size: 1.15rem; padding-right: 30px; } .lightbox { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; border-radius: 8px; }
.big-ok { font-size: 3rem; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); font-weight: 600; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.err { background: var(--bad); }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .pipe { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) {
  .new-grid, .detail-grid { grid-template-columns: 1fr; } .summary { position: static; }
  .g3 { grid-template-columns: 1fr 1fr; } .top-in { flex-wrap: wrap; padding: 8px 16px; gap: 8px; } .top nav { order: 3; flex-basis: 100%; } .who { margin-left: auto; }
}
@media (max-width: 600px) {
  .g2, .g3, .g4, .qc { grid-template-columns: 1fr; } .span2 { grid-column: auto; } .pipe { grid-template-columns: repeat(2, 1fr); } .kpis { grid-template-columns: 1fr 1fr; }
  .search input { min-width: 0; } .search { width: 100%; } .wrap { padding: 14px 12px 60px; } h1 { font-size: 1.3rem; }
}
