:root {
  --navy: #10263f; --navy-2: #1b3756; --teal: #14958a; --teal-2: #0e7a71; --teal-bg: #e7f4f2;
  --amber: #f0b44c; --amber-bg: #fdf3e0; --red: #c9453b; --red-bg: #fbeceb; --green: #2f8a4e;
  --ink: #1d2733; --muted: #6b7785; --line: #e2e7ec; --bg: #f5f7f9; --card: #fff;
  --r: 12px; --shadow: 0 1px 2px rgba(16,38,63,.06), 0 4px 14px rgba(16,38,63,.05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--teal-2); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* layout */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; border-left: 6px solid var(--teal); }
.top-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; }
.brand small { display: block; font-weight: 400; color: #a9bacb; font-size: 11px; letter-spacing: .04em; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: #c8d4e0; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; position: relative; }
.nav a.on, .nav a:hover { background: var(--navy-2); color: #fff; }
.nav .dot { background: var(--amber); color: var(--navy); border-radius: 10px; font-size: 11px; padding: 0 6px; margin-left: 4px; font-weight: 800; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #c8d4e0; }
.main { max-width: 1240px; margin: 0 auto; padding: 20px 18px 80px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* ui */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line); }
.card + .card, .stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.side { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
@media (max-width: 900px) { .g2, .g3, .side { grid-template-columns: 1fr; } }
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #c5ced8; }
.btn.pri { background: var(--teal); border-color: var(--teal); color: #fff; } .btn.pri:hover { background: var(--teal-2); }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.warn { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.btn.danger { color: var(--red); border-color: #efc9c5; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
label.f { display: block; font-size: 13px; font-weight: 600; color: #445262; }
label.f > span { display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #cfd7df; border-radius: 9px; background: #fff; color: var(--ink); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20,149,138,.25); border-color: var(--teal); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--teal); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; padding: 6px 0; cursor: pointer; }
.seg { display: inline-flex; background: #e9eef2; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; background: #e9eef2; color: var(--navy); white-space: nowrap; }
.b-PICKUP_DIJADWALKAN { background: #e8eefb; color: #2d4f9e; }
.b-DITERIMA, .b-CUCI, .b-QC { background: var(--teal-bg); color: var(--teal-2); }
.b-SELESAI_LAUNDRY, .b-PACKING { background: var(--amber-bg); color: #8a5a07; }
.b-SIAP { background: #1fa855; color: #fff; }
.b-DISERAHKAN { background: #eef0f3; color: #445262; }
.b-KOMPLAIN { background: var(--red-bg); color: var(--red); }
.b-SELESAI { background: #e6f3ea; color: var(--green); }
.b-BATAL { background: #f1f1f1; color: #999; text-decoration: line-through; }
.tag-late { background: var(--red-bg); color: var(--red); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: #f8fafb; }
.scroll-x { overflow-x: auto; }

/* pipeline */
.pipe { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1000px) { .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pipe a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; border-left: 5px solid var(--teal); color: var(--ink); box-shadow: var(--shadow); }
.pipe a.wa { border-left-color: var(--amber); }
.pipe a b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.pipe a span { font-size: 12px; color: var(--muted); font-weight: 600; }
.list-mini a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-mini a:last-child { border-bottom: 0; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.stat b { font-size: 24px; display: block; }

/* stepper */
.steps { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 30px; }
.step::before { content: ''; position: absolute; top: 11px; left: 0; right: 0; height: 3px; background: var(--line); }
.step:first-child::before { left: 50%; } .step:last-child::before { right: 50%; }
.step i { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; font-style: normal; font-size: 11px; line-height: 16px; color: #fff; }
.step.done { color: var(--teal-2); } .step.done::before { background: var(--teal); } .step.done i { background: var(--teal); border-color: var(--teal); }
.step.cur { color: var(--navy); } .step.cur i { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }

/* items editor */
.item-ed { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfcfd; position: relative; }
.item-ed + .item-ed { margin-top: 10px; }
.item-ed .x { position: absolute; top: 8px; right: 8px; }
.ig { display: grid; gap: 8px; grid-template-columns: 2fr 1fr 70px 2fr 1fr; }
.ig2 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr 1fr; margin-top: 8px; }
@media (max-width: 760px) { .ig, .ig2 { grid-template-columns: 1fr 1fr; } }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.photos figcaption { font-size: 11px; color: var(--muted); margin-top: 2px; }
.photos .rm { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.drop { border: 2px dashed #c9d3dc; border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; display: block; font-size: 14px; }
.drop:hover { border-color: var(--teal); color: var(--teal-2); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); }
.timeline li.wa::before { background: #1fa855; } .timeline li.qc::before { background: var(--amber); } .timeline li.payment::before { background: var(--navy); } .timeline li.note::before, .timeline li.photo::before, .timeline li.edit::before { background: #b8c2cc; }
.timeline .meta { font-size: 12px; color: var(--muted); }
.timeline details { font-size: 12px; } .timeline pre { white-space: pre-wrap; background: #f3f6f8; padding: 8px; border-radius: 8px; font: 12px/1.4 inherit; }

.action { border: 2px solid var(--amber); background: #fffdf8; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.sum { font-size: 14px; } .sum div { display: flex; justify-content: space-between; padding: 3px 0; } .sum .tot { font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 6px 11px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); }
.chips a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(16,38,63,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(620px, 100%); max-height: 92vh; overflow: auto; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin-bottom: 12px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; margin-top: 6px; box-shadow: var(--shadow); font-weight: 600; }
#toast div.err { background: var(--red); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 70; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0 55%, var(--bg) 55%); }
.login .card { width: min(380px, 100%); padding: 26px; }
.pin { letter-spacing: .5em; text-align: center; font-size: 22px; }

.rule { background: var(--navy); color: #c8d4e0; border-radius: var(--r); padding: 12px 16px; font-size: 13px; }
.rule b { color: #fff; margin-right: 8px; }

/* HP: menu atas jadi satu baris yang bisa digeser */
@media (max-width: 760px) {
  .top-in { gap: 8px; padding: 8px 12px; }
  .brand { flex: 1; } .brand small { display: none; }
  .who { font-size: 12px; }
  .nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .main { padding: 14px 12px 60px; }
  h1 { font-size: 19px; }
}
