:root {
  --wine: #4a0d26; --wine-2: #6b1838; --rose: #ff5a7e; --rose-soft: #ffe3ea;
  --ink: #1f1418; --muted: #6f5d64; --line: #ead9df; --bg: #fbf7f8; --card: #fff;
  --ok: #16794a; --ok-soft: #e3f5eb; --warn: #9a5b00; --warn-soft: #fff1d6; --bad: #b3261e; --bad-soft: #fde7e5;
  --radius: 10px;
  font-family: Inter, system-ui, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
h1, h2, h3 { font-family: Archivo, Inter, sans-serif; font-stretch: 112%; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
a { color: var(--wine-2); }
.boot { padding: 40px; color: var(--muted); }
button, .btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; min-height: 38px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--wine-2); }
button.pri, .btn.pri { background: var(--rose); border-color: var(--rose); color: #fff; }
button.pri:hover { background: #f0436a; }
button.dark { background: var(--wine); border-color: var(--wine); color: #fff; }
button.ghost { background: transparent; border-color: transparent; color: var(--wine-2); padding: 6px 8px; }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
button.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; min-height: 38px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--rose); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; }
label.check input { width: auto; min-height: 0; }

/* layout */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--wine); color: #f6dbe3; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { font-family: Archivo, sans-serif; font-stretch: 112%; font-weight: 800; font-size: 22px; color: #fff; padding: 4px 10px 14px; display: flex; align-items: center; gap: 8px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--rose); display: inline-block; }
.side a { color: #f6dbe3; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 500; display: block; }
.side a:hover { background: rgba(255,255,255,.08); }
.side a.on { background: #fff; color: var(--wine); font-weight: 700; }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: 12px 10px 4px; }
.side .foot { margin-top: auto; padding: 10px; font-size: 13px; border-top: 1px solid rgba(255,255,255,.15); }
.side .foot button { margin-top: 8px; background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.main { padding: 22px max(3vw, 16px) 60px; min-width: 0; }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.top .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.top .tools label { min-width: 150px; }
.menu-btn { display: none; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card > h2, .card > h3 { margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi b { display: block; font-family: Archivo, sans-serif; font-stretch: 112%; font-size: 24px; font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.15; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.alert { border-color: var(--rose); background: var(--rose-soft); }
.kpi { container-type: inline-size; }
.kpi b.long { font-size: clamp(15px, 12.5cqi, 24px); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: #fcf6f8; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #f1e8eb; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.rose { background: var(--rose-soft); color: #b0204a; }

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.queue li { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.queue li .pos { font-family: Archivo, sans-serif; font-weight: 800; font-size: 18px; color: var(--wine-2); text-align: center; }
.queue li.next { border-color: var(--rose); background: var(--rose-soft); }

.wo { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 12px 14px; display: grid; gap: 8px; }
.wo .items { font-size: 14px; color: var(--muted); }

.chat { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 80%; padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; line-height: 1.45; }
.msg.u { justify-self: end; background: var(--wine); color: #fff; border-bottom-right-radius: 4px; }
.msg.a { justify-self: start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(40, 10, 22, .45); }
dialog form { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fields .full { grid-column: 1 / -1; }
.items-editor { display: grid; gap: 8px; }
.items-editor .it { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) auto auto; gap: 6px; align-items: center; }

#toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 99; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
#toast.err { background: var(--bad); }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth .hero { background: var(--wine); color: #fff; padding: 48px max(5vw, 24px); display: flex; flex-direction: column; justify-content: space-between; }
.auth .hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin-top: 30px; }
.auth .hero p { color: #f6d9e1; max-width: 42ch; line-height: 1.5; }
.auth .panel { padding: 48px max(5vw, 24px); display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; }
.auth form { display: grid; gap: 12px; max-width: 380px; width: 100%; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.auth .tabs { max-width: 380px; }
.auth .tabs button { flex: 1 1 auto; }
.tabs button.on { background: var(--wine); color: #fff; border-color: var(--wine); }

/* staf (HP) */
.staff-app { max-width: 520px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 14px; }
.staff-head { background: var(--wine); color: #fff; margin: -18px -16px 0; padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 22px; border-radius: 0 0 18px 18px; }
.staff-head .big { font-family: Archivo, sans-serif; font-stretch: 112%; font-size: 44px; font-weight: 800; line-height: 1; }
.cam { width: 100%; aspect-ratio: 3 / 4; background: #000; border-radius: 12px; object-fit: cover; }
.clock-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clock-btns button { min-height: 52px; justify-content: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .split, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth .hero { padding-bottom: 28px; }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .items-editor .it { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  h1 { font-size: 22px; }
}

/* bahasa */
.lang { display: inline-flex; gap: 4px; margin: 8px 0 0; }
.lang button.on { background: var(--rose); border-color: var(--rose); color: #fff; }
.auth .panel .lang { justify-content: flex-end; width: 100%; margin: 0 0 6px; }

/* inbox */
.ib { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; height: calc(100vh - 130px); min-height: 480px; overflow: hidden; }
.ib-left { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; min-height: 0; }
.ib-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 10px; }
.ib-tools select { width: auto; }
.ib-tabs { padding: 0 10px; margin-bottom: 8px; overflow-x: auto; flex-wrap: nowrap; }
.ib-tabs button { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.ib-list { overflow-y: auto; flex: 1; min-height: 0; }
.ib-list .empty { margin: 10px; }
.ib-item { display: grid; gap: 3px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; background: #fff; white-space: normal; min-height: 0; font-weight: 400; }
.ib-item:hover { background: var(--bg); }
.ib-item.on { background: var(--rose-soft); }
.ib-item.unread b { color: var(--wine); }
.ib-item b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-tags { gap: 4px; }
.badge { margin-left: auto; background: var(--rose); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.ib-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-placeholder { margin: auto; border: 0; }
.ib-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ib-back { display: none; }
.ib-body-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; flex: 1; min-height: 0; }
.ib-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.ib-msg { max-width: 78%; padding: 8px 11px; border-radius: 12px; background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.ib-msg.out { align-self: flex-end; background: #ffe9ef; border-color: #f6c6d3; }
.ib-msg.out.auto { background: #f3eef0; border-color: var(--line); border-style: dashed; }
.ib-msg.preview { max-width: 100%; align-self: stretch; }
.ib-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.ib-meta { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.ib-composer { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; background: #fff; }
.ib-composer textarea { min-height: 64px; }
.ib-composer.closed { background: var(--warn-soft); }
.ib-composer select { width: auto; }
.ib-side { border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.warn-card { background: var(--warn-soft); border-color: #f2d49a; margin-bottom: 12px; }
@media (max-width: 1100px) { .ib-body-wrap { grid-template-columns: minmax(0, 1fr); } .ib-side { display: none; } }
@media (max-width: 760px) {
  .ib { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 110px); }
  .ib.chat-open .ib-left { display: none; }
  .ib:not(.chat-open) .ib-chat { display: none; }
  .ib-back { display: inline-flex; }
  .ib-msg { max-width: 90%; }
}

/* template WhatsApp */
.tpl-split { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl { display: grid; gap: 6px; align-content: start; }
.tpl b { overflow-wrap: anywhere; }
.tpl-head { font-weight: 700; }
.tpl-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
@media (max-width: 900px) { .tpl-split { grid-template-columns: minmax(0, 1fr); } }
.warn-card + .ib { height: calc(100vh - 200px); }

/* Tawaran pekerjaan di HP staf */
.offers { border-color: var(--rose); background: var(--rose-soft); }
.offer { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.offer:last-child { border-bottom: 0; }
.offer-btns { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 6px; }
.offer-btns button { min-height: 48px; justify-content: center; font-size: 16px; }
.offer-btns button:only-child { grid-column: 1 / -1; }
.hint { border-style: dashed; display: grid; gap: 6px; }
/* Item WO di layar front desk */
.wo .it-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; padding: 4px 0; border-top: 1px dashed var(--line); }
.wo .it-row:first-child { border-top: 0; }
.wo .it-row .it-name { flex: 1 1 180px; min-width: 0; }
/* Kode masuk staf */
.login-code { font-family: Archivo, ui-monospace, monospace; font-size: 28px; font-weight: 800; letter-spacing: .08em; color: var(--wine); }
.qr-box { display: grid; justify-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr-box svg { max-width: 100%; height: auto; }
.link-box { font-size: 13px; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

/* pengingat catatan customer */
.notes { display: grid; gap: 8px; }
.note { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; gap: 4px; overflow-wrap: anywhere; }
.note.alergi { border-color: #f3b8b3; background: var(--bad-soft); }
.note-badge { min-height: 0; padding: 2px 9px; font-size: 12px; border-radius: 99px; background: var(--warn-soft); border-color: transparent; color: var(--warn); vertical-align: 1px; }
.note-badge.alergi { background: var(--bad-soft); color: var(--bad); }
.known-customer { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; margin-bottom: 10px; background: var(--bg); }
.job-notes { display: grid; gap: 6px; margin: 8px 0 4px; }
dialog.reminders { max-width: 460px; }
dialog.reminders h2 { color: var(--wine); }

/* pesan terjadwal */
.msg-when b { white-space: nowrap; }
.msg-what { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.msg-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* survei kepuasan (halaman customer + pratinjau di Pengaturan) */
.sv header { background: var(--wine); color: #fff; margin: 0 -16px 18px; padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 26px; border-radius: 0 0 18px 18px; }
.sv header p { color: #f6d9e1; margin: 6px 0 0; }
.sv header h1 { color: #fff; }
.stars { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.stars button { font-size: 34px; min-height: 56px; width: 56px; justify-content: center; border-radius: 12px; color: #d9c4cb; }
.stars button.on { color: #f2a900; border-color: #f2a900; background: #fff8e6; }
.stars.sm { justify-content: flex-start; margin: 4px 0 0; gap: 4px; }
.stars.sm button { font-size: 22px; min-height: 40px; width: 40px; border-radius: 10px; padding: 0; }
.kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.kinds button.on { background: var(--wine); color: #fff; border-color: var(--wine); }
.sv-q { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.sv-q-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.sv-q-title .req { color: var(--bad); }
dialog.sv-preview { width: min(420px, calc(100vw - 24px)); background: var(--bg); }
dialog.sv-preview .sv { padding: 0 16px 16px; }
dialog.sv-preview form { padding: 0; }
dialog.sv-preview .sv header { padding-top: 22px; border-radius: 0 0 18px 18px; }
.preview-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; }

/* pengaturan pertanyaan survei */
.q-list { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; counter-reset: q; }
.q-list li { counter-increment: q; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; font-size: 14px; }
.q-list li::before { content: counter(q) "."; color: var(--muted); font-weight: 600; }
.q-edit { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: #fff; }
.q-edit .q-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.q-edit .q-tools { display: flex; gap: 2px; }
.q-edit .q-tools button { padding: 6px 9px; min-height: 36px; }

/* komplain */
.cp-tabs { margin: 0 0 10px; }
.cp-list { display: grid; gap: 8px; }
.cp { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); background: #fff; padding: 12px 14px; display: grid; gap: 6px; cursor: pointer; text-align: left; font-weight: 400; min-height: 0; width: 100%; white-space: normal; }
.cp:hover { border-color: var(--wine-2); }
.cp.baru { border-left-color: var(--bad); }
.cp.diproses { border-left-color: #e3a32a; }
.cp.selesai { border-left-color: var(--ok); }
.cp-desc { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cp-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cp-quote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--rose); background: var(--bg); border-radius: 0 8px 8px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--line); margin-left: 5px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.tindakan::before { background: var(--rose); }
.timeline li.status::before { background: var(--wine-2); }
.timeline li:last-child { border-left-color: transparent; }
dialog.cp-detail { width: min(620px, calc(100vw - 24px)); }
.cp-body { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cp-body form { padding: 0; }
.qbars { display: grid; gap: 10px; }
.qbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
.qbar .track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: #f1e8eb; overflow: hidden; }
.qbar .fill { height: 100%; background: var(--rose); border-radius: 99px; }
.qbar b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- panduan awal & data contoh ---------- */
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 14px; background: var(--warn-soft); border-color: #f1d39a; }
.demo-banner > div { min-width: 0; flex: 1 1 260px; }
.demo-banner p { margin: 4px 0 0; }
.onboard { margin-bottom: 14px; border-color: var(--rose); }
.onboard h2 { margin: 0; color: var(--wine); }
.onboard > .row.between { align-items: flex-start; flex-wrap: nowrap; gap: 12px; }
.progress { height: 6px; border-radius: 99px; background: var(--rose-soft); overflow: hidden; margin: 12px 0 6px; }
.progress span { display: block; height: 100%; background: var(--rose); border-radius: 99px; }
ol.steps { list-style: none; margin: 0; padding: 0; }
ol.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
ol.steps li:first-child { border-top: 0; }
ol.steps .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); color: var(--muted); }
ol.steps li.next .mark { background: var(--rose); border-color: var(--rose); color: #fff; }
ol.steps li.done .mark { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
ol.steps li.done b { color: var(--muted); font-weight: 500; }
ol.steps .btn, ol.steps button { white-space: nowrap; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.demo-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-top: 6px; padding: 12px; border-radius: 8px; background: var(--bg); }
.demo-offer > div { min-width: 0; flex: 1 1 260px; }
@media (max-width: 600px) {
  ol.steps li { grid-template-columns: 28px minmax(0, 1fr); }
  ol.steps li > .btn, ol.steps li > button { grid-column: 2; justify-self: start; }
}

dialog.wa-guide { width: min(620px, calc(100vw - 24px)); }
.wa-body { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.wa-body h2 { margin: 0; color: var(--wine); }
.wa-body p { margin: 0; }
ol.wa-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
ol.wa-steps li::marker { color: var(--rose); font-weight: 700; }
ol.wa-steps p { margin: 2px 0 0; overflow-wrap: anywhere; }
.wa-body .note { padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
.wa-body .row { flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.wa-body .row[hidden] { display: none; }

/* ---------- tab kecil, filter daftar, detail ---------- */
.tabs.compact { margin: 0; flex-wrap: nowrap; }
.filters { display: grid; gap: 10px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filter-grid .grow { grid-column: span 2; }
.filters button.on { background: var(--wine); color: #fff; border-color: var(--wine); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th-sort { min-height: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; white-space: nowrap; }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--wine); text-decoration: underline; font: inherit; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- kalender appointment (baris 30 menit = 26px, jam = 52px) ---------- */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-bar input[type=date] { width: auto; min-height: 30px; padding: 4px 8px; }
.cal-title { font-size: 17px; color: var(--wine); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 10px; color: var(--muted); }
.cal-legend b { color: var(--ink); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--ev, var(--muted)); }
.st-booked { --ev: #d99400; --ev-bg: #fff4d6; }
.st-confirmed { --ev: #2f6fdb; --ev-bg: #e7efff; }
.st-arrived { --ev: #c2185b; --ev-bg: #ffe3ea; }
.st-done { --ev: #16794a; --ev-bg: #e3f5eb; }
.st-no_show { --ev: #8a7a80; --ev-bg: #efe9eb; }
.st-cancelled { --ev: #b3261e; --ev-bg: #fde7e5; }
.cal-scroll { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cal-grid { display: grid; min-width: min-content; }
.cal-corner, .cal-head { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--line); }
.cal-corner { left: 0; z-index: 4; }
.cal-head { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 8px; border-left: 1px solid var(--line); }
.cal-head b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-head[role=button] { cursor: pointer; }
.cal-head[role=button]:hover { background: var(--rose-soft); }
.cal-head.today b { color: var(--rose); }
.cal-gutter { position: sticky; left: 0; z-index: 2; background: #fff; }
.cal-gutter span { position: absolute; right: 6px; margin-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 52px), repeating-linear-gradient(to bottom, #f6eef1 0 1px, transparent 1px 26px); }
.cal-col.edit { cursor: cell; }
.cal-off { position: absolute; left: 0; right: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(111, 93, 100, .07) 0 6px, transparent 6px 12px); }
.cal-ev { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 0; overflow: hidden;
  padding: 3px 6px; border: 0; border-left: 4px solid var(--ev); border-radius: 6px; background: var(--ev-bg); color: var(--ink);
  font-size: 12px; line-height: 1.25; text-align: left; box-shadow: 0 1px 2px rgba(31, 20, 24, .12); }
.cal-ev > * { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev .ev-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-ev.short { flex-direction: row; align-items: center; gap: 6px; }
.cal-ev.st-cancelled, .cal-ev.st-no_show { opacity: .55; }
.cal-ev.st-cancelled b, .cal-ev.st-no_show b { text-decoration: line-through; }
.cal-ev:hover, .cal-ev:focus-visible { z-index: 2; border-color: var(--ev); box-shadow: 0 3px 10px rgba(31, 20, 24, .22); }
.cal-now { position: absolute; left: 0; right: 0; z-index: 2; height: 2px; background: var(--bad); pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cal-wd { padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; min-height: 92px; padding: 6px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; text-align: left; }
.cal-day:hover { background: var(--rose-soft); }
.cal-day.out { background: #fcfafb; color: var(--muted); }
.cal-day .num { font-size: 13px; font-weight: 700; }
.cal-day.today .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--rose); color: #fff; }
.cal-mi { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-mi { font-size: 11px; }
  .filter-grid .grow { grid-column: auto; }
  .top .tools .tabs.compact { width: 100%; }
}
.nowrap { white-space: nowrap; }

/* ---------- batch 6: detail WO, prioritas, urutan antrean ---------- */
.wo.urgent { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
a.wo-no { font-weight: 700; color: inherit; }
.it-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; padding: 4px 0; }
.it-row .it-name { flex: 1 1 180px; min-width: 0; }
.wo-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.wo-detail > .stack { min-width: 0; }
ol.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ol.timeline li { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 10px; font-size: 14px; border-left: 2px solid var(--line); padding-left: 10px; }
ol.timeline .tl-time { color: var(--muted); font-variant-numeric: tabular-nums; }
ol.order-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
ol.order-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
ol.order-list .pos { font-family: Archivo, sans-serif; font-weight: 800; color: var(--wine-2); width: 22px; text-align: center; }
.queue li.muted { display: block; border-style: dashed; }
.split.wo-detail { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
@media (max-width: 900px) { .split.wo-detail { grid-template-columns: minmax(0, 1fr); } }

/* ---------- batch 7: HP staf (bantuan, laporan kerja, izin), notifikasi ---------- */
dialog.sheet { width: min(640px, calc(100vw - 16px)); }
dialog.sheet h3 { margin: 6px 0 0; font-size: 15px; }
.chips button.on { background: var(--wine); color: #fff; border-color: var(--wine); }
.my-report { display: grid; gap: 10px; min-width: 0; }
.my-report .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.my-report .kpi { padding: 8px 10px; }
.my-report .kpi b { font-size: 18px; }
.my-report .total { padding: 10px 12px; border-radius: 8px; background: var(--rose-soft); }
.push-panel { margin-top: 8px; }
.leave-list .row.between { align-items: flex-start; }

/* ---------- batch 8: jadwal, rekap absensi, detail staf, catatan, wajah ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; min-height: 34px; padding: 6px 14px; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--wine); color: #fff; }
.pill.info { background: #e7eefc; color: #2847a0; }
.daygrid { display: flex; flex-wrap: wrap; gap: 3px; max-width: 520px; }
.daygrid .d, .d.mini { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-size: 11px; font-weight: 600; background: #f1e8eb; color: var(--muted); font-variant-numeric: tabular-nums; }
.d.mini { width: 14px; height: 14px; border-radius: 4px; }
.d i { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--wine); }
.d.st-hadir { background: var(--ok-soft); color: var(--ok); }
.d.st-terlambat { background: var(--warn-soft); color: var(--warn); }
.d.st-tidak_hadir { background: var(--bad-soft); color: var(--bad); }
.d.st-masuk_libur { background: var(--rose-soft); color: var(--wine-2); }
.d.st-izin, .d.st-sakit, .d.st-cuti, .d.st-ganti_libur { background: #e7eefc; color: #2847a0; }
.d.st-libur { background: #fff; border: 1px dashed var(--line); }
.d.st-belum { background: #fff; border: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.detail-grid > * { min-width: 0; }
.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 16px; margin-top: 10px; }
.info > div { margin-top: 2px; overflow-wrap: anywhere; }
.kpi .up { color: var(--ok); }
.kpi .down { color: var(--bad); }
.note-row { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.note-row:last-child { border-bottom: 0; }
.note-row.done b { text-decoration: line-through; color: var(--muted); }
.warn-text { color: var(--warn); font-weight: 600; }
.face-dots { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.face-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--wine-2); }
.face-dots i.on { background: var(--ok); border-color: var(--ok); }
p.full { grid-column: 1 / -1; }
/* Batch 9: CCTV seperti di CRM */
.cctv-tabs { margin: -4px 0 14px; overflow-x: auto; }
.cctv-tabs .seg { flex-wrap: nowrap; }
.cctv-tabs .seg button { white-space: nowrap; }
.cctv-flag { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 14px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cctv-flag:last-of-type { border-bottom: 0; }
.cctv-flag > div:first-child { min-width: 0; flex: 1 1 260px; }
.cctv-flag.is-marked { opacity: .8; }
.cctv-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cctv-act select { width: auto; min-height: 30px; padding: 4px 8px; font-size: 13px; }
.cctv-ai { display: inline-block; margin-top: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.cctv-ai.ok { background: var(--bad-soft); color: var(--bad); }
.cctv-ai-warn { border-color: var(--bad); background: var(--bad-soft); }
.cctv-marked { margin-top: 10px; }
.cctv-marked summary, details.card > summary { cursor: pointer; font-weight: 700; }
.alert-card { border-color: var(--bad); }
.cctv-tl-row { display: grid; grid-template-columns: minmax(70px, 120px) minmax(0, 1fr) minmax(70px, 120px); gap: 8px; align-items: center; margin: 4px 0; }
.cctv-tl-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cctv-tl-track { position: relative; height: 18px; background: #f6eef1; border-radius: 6px; }
.cctv-tl-axis { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.cctv-tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.cctv-tl-axis span:first-child { transform: none; }
.cctv-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; background: var(--ok); }
.cctv-bar.bad { background: var(--bad); }
.cctv-bar.staff { background: #b9a9b0; }
.cctv-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cctv-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--ok); }
.cctv-legend .bad::before { background: var(--bad); }
.cctv-legend .staff::before { background: #b9a9b0; }
.cctv-legend .live::before { border-radius: 50%; background: var(--rose); }
.cctv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #cfc2c7; vertical-align: 1px; }
.cctv-dot.on { background: var(--rose); }
.cctv-dot.off { background: var(--bad); }
.cctv-camgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; margin: 10px 0 16px; }
.cctv-camgrid figure, .cctv-photos figure { margin: 0; min-width: 0; }
.cctv-camgrid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #eee; display: block; }
.cctv-camgrid figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cctv-noimg { aspect-ratio: 16 / 9; display: grid; place-items: center; border-radius: 8px; background: #f3ecef; color: var(--muted); font-size: 13px; }
.cctv-stage { position: relative; margin: 12px 0 6px; max-width: 960px; }
.cctv-stage img { width: 100%; display: block; border-radius: 8px; background: #eee; min-height: 120px; }
.cctv-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.cctv-zonelist { display: grid; gap: 8px; margin: 10px 0 14px; }
.cctv-zonerow { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cctv-zonerow > b { align-self: center; }
.cctv-zonerow > input { flex: 1 1 160px; width: auto; }
.cctv-num { min-width: 0; }
.cctv-num input { width: 90px; }
.cctv-num select { width: auto; max-width: 220px; }
.cctv-install details { margin: 8px 0; }
.cctv-install summary { cursor: pointer; font-weight: 700; }
.cctv-cmd { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; background: #241a1e; color: #fff; border-radius: 8px; padding: 10px; }
.cctv-cmd code { flex: 1 1 260px; overflow-wrap: anywhere; font-size: 12px; user-select: all; }
.cctv-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cctv-photos figure { position: relative; }
.cctv-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.cctv-photos button { position: absolute; top: 2px; right: 2px; min-height: 0; padding: 0 6px; background: rgba(255,255,255,.9); border-radius: 6px; }
.cctv-upload { cursor: pointer; display: inline-flex; align-items: center; }
.cctv-upload input { display: none; }
form.row.wrap { flex-wrap: wrap; align-items: flex-end; gap: 10px; }
form.row.wrap label { min-width: 0; }
form.row.wrap input, form.row.wrap select { width: auto; }
@media (max-width: 600px) {
  .cctv-tl-row { grid-template-columns: 64px minmax(0, 1fr); }
  .cctv-tl-row > :nth-child(3) { display: none; }
  .cctv-tl-axis span:nth-child(even) { display: none; }
}
/* Batch 10: Inbox seperti di CRM */
.ib-tools2 { padding-top: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ib-tools2 select { width: 100%; }
.ib-label { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: #efe6ea; color: var(--wine-2); white-space: nowrap; }
.ib-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ib-label-btn { min-height: 26px; padding: 2px 9px; font-size: 12px; font-weight: 600; border-radius: 99px; }
.ib-label-btn.on { background: var(--wine); border-color: var(--wine); color: #fff; }
.ib-labels label.check { font-size: 13px; }
.badge.late { background: var(--bad); }
.ib-msg.out.ai { background: #eef3ff; border-color: #c9d6f5; }
.ib-ai-note:empty { display: none; }
.ib-side-label { font-weight: 600; }
.ib-follow { gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ib-follow input { width: auto; flex: 1 1 160px; }
.ib-handover { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ib-info-btn { display: none; }
.cctv-filters { gap: 10px; align-items: flex-end; margin-bottom: 4px; }
.cctv-filters label { min-width: 0; }
.cctv-filters input, .cctv-filters select { width: auto; }
@media (max-width: 1100px) {
  .ib-info-btn { display: inline-flex; }
  .ib-body-wrap.side-open .ib-thread { display: none; }
  .ib-body-wrap.side-open .ib-side { display: grid; border-left: 0; }
}

/* ---------- Batch 11: layanan, paket, kursi bernama, peran khusus ---------- */
.bundle-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 260px; overflow: auto; padding: 6px 0; }
.chair-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.chair-row { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 11em); gap: 8px; align-items: center; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; }
.roles-table th, .roles-table td { text-align: center; white-space: nowrap; }
.roles-table th:first-child, .roles-table td:first-child { text-align: left; }
@media (max-width: 600px) { .chair-row { grid-template-columns: 2em minmax(0, 1fr); } .chair-row select { grid-column: 2; } }
/* Resto: meja & bill */
.cctv-bar.wait { background: #9db4c8; }
.cctv-legend .wait::before { background: #9db4c8; }
.cctv-legend .billkey::before { background: var(--wine-2); }
.res-hours { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 5px 10px; align-items: center; }
.res-hrow { display: contents; }
.res-hlab { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.res-hbars { display: grid; gap: 2px; }
.res-hbar { display: block; height: 7px; border-radius: 3px; min-width: 2px; }
.res-hbar.g { background: var(--ok); }
.res-hbar.b { background: var(--wine-2); }
.res-hnum { white-space: nowrap; }
@media (max-width: 560px) { .res-hours { grid-template-columns: max-content minmax(0, 1fr); } .res-hnum { grid-column: 2; white-space: normal; } }
.cctv-num input.pos-table { width: 130px; }
.bill-printer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; }
.bill-printer-row > .small.muted:last-child:not(.num) { flex-basis: 100%; }
.bad-text { color: var(--bad); }
.bill-steps { display: grid; gap: 4px; margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.bill-steps b { color: var(--ink); }
.bill-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; margin: 10px 0; }
.bill-map label { min-width: 0; }
.bill-map select { width: 100%; }
.bill-map .req { color: var(--bad); }
.bill-flag-nvr { font-size: 12px; color: var(--muted); }
tr.bill-void td { color: var(--muted); text-decoration: line-through; }
.cash-diff.bad { color: var(--bad); font-weight: 700; }
.cash-diff.ok { color: var(--ok); font-weight: 700; }
.dash-alerts { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.res-hbar.none { background: repeating-linear-gradient(90deg, #d9cfd3 0 4px, transparent 4px 8px); width: 100%; }
