:root {
  --bg: #0b1020; --panel: #121933; --panel2: #18213f; --line: #26305a; --text: #e8ecf7; --muted: #94a0c4;
  --blue: #3b82f6; --purple: #a78bfa; --green: #34d399; --yellow: #fbbf24; --orange: #fb923c; --red: #f87171; --teal: #2dd4bf; --pink: #ec4899;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, "Segoe UI", Roboto, Arial, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: var(--red); min-height: 1em; }
h1 { margin: 0 0 4px; font-size: 22px; } h3 { margin: 22px 0 8px; font-size: 15px; }
.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 7px 14px; border-radius: 8px; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--blue); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); font-weight: 600; }
.btn.good { background: #065f46; border-color: var(--green); } .btn.warn { background: #78350f; border-color: var(--yellow); } .btn.bad { background: #7f1d1d; border-color: var(--red); }
.btn.ghost { background: transparent; }
input, select, textarea { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.badge.demo { color: var(--yellow); border-color: var(--yellow); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(360px, 100%); display: grid; gap: 12px; }
.login-card label { display: grid; gap: 4px; color: var(--muted); }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.logo { font-weight: 800; font-size: 18px; color: #fff; } .logo span { color: var(--pink); }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); }

.attention { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px 0; }
.attention .item { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.attention .item.orange { border-left-color: var(--orange); } .attention .item.ok { border-left-color: var(--green); cursor: default; }

.tabs { display: flex; gap: 4px; padding: 12px 20px 0; overflow-x: auto; }
.tabs button { background: none; border: none; color: var(--muted); padding: 8px 14px; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--blue); }
.count { background: var(--yellow); color: #111; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
main { padding: 16px 20px 40px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.s-bekerja { background: var(--blue); } .s-spv { background: var(--purple); } .s-berhasil { background: var(--green); } .s-menunggu { background: var(--yellow); }
.s-error { background: var(--orange); } .s-ditegur { background: var(--red); } .s-idle { background: #475176; }

/* Kantor */
.office { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.room { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: relative; }
.room h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.room.soon { opacity: .4; border-style: dashed; } .room.soon::after { content: "segera"; position: absolute; top: 12px; right: 12px; font-size: 11px; color: var(--muted); }
.desks { display: grid; gap: 8px; }
.desk { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; }
.desk:hover { border-color: var(--blue); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #0b1020; position: relative; }
.avatar.kind-pekerja { background: #93c5fd; } .avatar.kind-spv { background: var(--purple); } .avatar.kind-kepala { background: var(--teal); }
.avatar .st { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel2); }
.desk .name { font-weight: 600; } .desk .what { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.desk.status-bekerja .avatar { animation: bob 1.2s ease-in-out infinite; }
.desk.status-menunggu { border-color: var(--yellow); } .desk.status-error { border-color: var(--orange); } .desk.status-ditegur { border-color: var(--red); }
.desk.status-berhasil { border-color: var(--green); }
.typing::after { content: " ···"; animation: blink 1s steps(2) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,.5); } 50% { box-shadow: 0 0 0 6px rgba(59,130,246,0); } }

/* Pipeline */
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.node { min-width: 112px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; position: relative; }
.node .label { font-size: 12px; color: var(--muted); } .node .n { font-size: 20px; font-weight: 800; }
.node.active { border-color: var(--blue); animation: pulse 1.6s infinite; } .node.gate { border-color: var(--teal); }
.node.wait { border-color: var(--yellow); background: #2a2410; } .node.err { border-color: var(--orange); background: #2b1a0e; }
.node.hl { outline: 2px solid var(--pink); }
.arrow { align-self: center; color: var(--muted); }
.contents { display: grid; gap: 8px; }
.content { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.content.sel { border-color: var(--pink); }
.content .path { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.content .path span { font-size: 11px; background: var(--panel2); border-radius: 6px; padding: 1px 6px; color: var(--muted); }

/* Log */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.check { color: var(--muted); display: flex; gap: 6px; align-items: center; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ev { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 8px 10px; }
.ev .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.ev .tipe { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel2); color: var(--text); }
.ev .konten { cursor: pointer; text-decoration: underline dotted; }
.t-TERIMA, .t-POIN, .t-PELAJARAN { border-left-color: var(--green) !important; } .t-REVISI, .t-TEGURAN { border-left-color: var(--red) !important; }
.t-TOLAK { border-left-color: #b91c1c !important; } .t-MENUNGGU_MANUSIA { border-left-color: var(--yellow) !important; }
.t-ERROR { border-left-color: var(--orange) !important; } .t-PERBAIKAN { border-left-color: var(--teal) !important; } .t-PUTUSAN { border-left-color: var(--purple) !important; }

/* Approval & CS */
.appr, .thread { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.appr pre, .thread pre { white-space: pre-wrap; font: inherit; margin: 8px 0; background: var(--panel2); padding: 10px; border-radius: 8px; }
.appr .actions, .thread .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.appr textarea { width: 100%; min-height: 60px; margin: 6px 0; }
.st-pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--panel2); }
.st-terkirim { color: var(--green); } .st-eskalasi, .st-ditahan { color: var(--orange); } .st-cek { color: var(--yellow); }

/* Posting */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.thumb { display: grid; gap: 2px; text-align: center; color: var(--muted); font-size: 12px; text-decoration: none; }
.thumb img { width: 108px; height: 135px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); }
.thumb:hover img { border-color: var(--blue); }
.post .actions .grow { flex: 1 1 260px; min-width: 0; }
.st-menunggu_manual { color: var(--yellow); } .st-diposting { color: var(--green); } .st-gagal { color: var(--orange); }

/* Switches */
.switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.sw { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.toggle { width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: #2a3355; position: relative; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #cbd5e1; transition: left .15s; }
.toggle.on { background: #1d4ed8; border-color: var(--blue); } .toggle.on::after { left: 23px; }
.toggle:disabled { opacity: .5; cursor: not-allowed; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 10; }
.panel { position: fixed; right: 16px; top: 70px; width: min(380px, calc(100% - 32px)); max-height: calc(100vh - 90px); overflow: auto; z-index: 8; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.panel .close { float: right; }

@media (max-width: 640px) { .top { flex-direction: column; gap: 6px; align-items: flex-start; } main { padding: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
