:root {
  --bg: #0d1020;
  --panel: #141830;
  --panel2: #1b2040;
  --line: #262c52;
  --text: #eef0fa;
  --muted: #9aa1c4;
  --amber: #ffc44d;
  --amber2: #ff9f1c;
  --green: #3ddc97;
  --red: #ff6b6b;
  --blue: #6ea8ff;
  --r: 12px;
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); }
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ---------- top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #0f1328; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--amber), var(--amber2)); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 7px; transform: rotate(45deg) scale(.82); }
.logo span { background: #1a1205; border-radius: 2px; }
.logo span:nth-child(3) { grid-column: span 2; }
.office-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mode { font-weight: 700; }
.mode.claude { color: var(--green); }
.mode.demo { color: var(--amber); }
.top-ctl { display: flex; align-items: center; gap: 8px; flex: 1 1 290px; }   /* basis tetap: ganti tema tidak mengubah tinggi header */
.dd { position: relative; min-width: 0; }
.dd-btn { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 260px; font-size: 12.5px; }
.dd-btn[aria-expanded="true"] { border-color: var(--amber); }
.dd-label { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 600; }
.dd-label b { color: var(--text); font-weight: 700; }
.dd-caret { flex: none; color: var(--muted); transition: transform .15s ease; }
.dd-btn[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 100%; width: max-content; max-width: min(320px, calc(100vw - 24px)); max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 5px; background: var(--panel2); border: 1px solid #3a4278; border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.5); }
.dd-menu[hidden] { display: none; }
.dd-menu button { display: block; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 8px; text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-menu button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.dd-menu button[aria-selected="true"] { background: var(--amber); color: #1a1205; }
.dd-btn:focus-visible, .dd-menu button:focus-visible, #btnTema:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
#btnTema { flex: none; font-size: 12.5px; }
.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #3a4278; }
.btn.primary { background: var(--amber); color: #1a1205; border-color: var(--amber); }
.btn.primary:hover { background: #ffd273; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 8px 11px; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
#btnSiaran { color: #ff7a7a; }

/* ---------- layout */
.main { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0,1fr) 400px; min-height: 0; }
.main > * { min-width: 0; }
.top > * { min-width: 0; }
.stage { position: relative; min-height: 0; }
#office { width: 100%; height: 100%; display: block; }
.stage-hint { position: absolute; left: 14px; bottom: 12px; color: var(--muted); font-size: 12px; background: rgba(13,16,32,.7); padding: 4px 10px; border-radius: 999px; }
.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 6px; }
.tab { background: none; border: 0; padding: 12px 10px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; }
.tab.on { color: var(--text); border-bottom-color: var(--amber); }
.tab b { background: var(--amber); color: #1a1205; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.tab b:empty { display: none; }
.pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pane.on { display: flex; }

/* ---------- bilah agent */
.titik { display: block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--panel); background: #858ba8; }
.titik.kerja { background: var(--green); animation: pulse 1.2s infinite; }
.titik.antre { background: var(--amber); }
@media (prefers-reduced-motion: reduce) { .titik.kerja { animation: none; } }
.agent-bar { position: absolute; left: 14px; bottom: 44px; z-index: 5; display: flex; gap: 6px; max-width: calc(100% - 28px); padding: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: rgba(13,16,32,.78); border: 1px solid var(--line); border-radius: 999px; }
.agent-bar:empty { display: none; }
.agent-bar::-webkit-scrollbar { display: none; }
.ab { position: relative; flex: none; width: 40px; height: 40px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--baju); color: var(--teks); font-weight: 800; font-size: 15px; cursor: pointer; }
.ab:hover { border-color: rgba(255,255,255,.65); }
.ab:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.ab[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(255,196,77,.35); }
.ab .titik { position: absolute; right: -2px; bottom: -2px; }
.agent-tip { position: absolute; bottom: 104px; z-index: 6; max-width: 240px; padding: 6px 10px; background: var(--panel2); border: 1px solid #3a4278; border-radius: 9px; box-shadow: 0 6px 20px rgba(0,0,0,.4); font-size: 12.5px; pointer-events: none; }
.agent-tip b { display: block; }
.agent-tip span { color: var(--muted); }
.agent-tip[hidden] { display: none; }

/* ---------- kartu peran */
.kartu { position: absolute; left: 14px; bottom: 108px; z-index: 30; display: flex; flex-direction: column; width: 360px; max-height: calc(100% - 124px); background: var(--panel); border: 1px solid #3a4278; border-radius: 14px; box-shadow: 0 14px 44px rgba(0,0,0,.55); outline: none; }
.kartu[hidden] { display: none; }
.k-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 8px 14px; }
.k-av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; font-size: 17px; }
.k-id { flex: 1; min-width: 0; }
.k-id b { display: block; font-size: 15px; }
.k-id span { color: var(--muted); font-size: 12.5px; }
.kartu .x { flex: none; width: 36px; height: 36px; padding: 0; align-self: flex-start; }
.k-status { display: flex; gap: 8px; align-items: flex-start; margin: 0 14px 8px; padding: 7px 10px; background: var(--panel2); border-radius: 9px; font-size: 12.5px; overflow-wrap: anywhere; }
.k-status .titik { flex: none; margin-top: 3px; border-color: var(--panel2); }
.k-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 14px 10px; }
.k-body h3 { margin: 12px 0 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.k-body p { margin: 0; font-size: 13px; }
.k-kosong { color: var(--muted); font-size: 12.5px; }
.k-cmd { display: block; width: 100%; margin-top: 5px; padding: 7px 10px; background: transparent; border: 1px dashed var(--line); border-radius: 9px; text-align: left; font-size: 12.5px; cursor: pointer; }
.k-cmd:hover, .k-cmd:focus-visible { border-color: var(--amber); outline: none; }
.k-file { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; padding: 7px 10px; background: var(--panel2); border-radius: 9px; color: var(--text); font-size: 12.5px; text-decoration: none; }
.k-file:hover, .k-file:focus-visible { outline: 1px solid var(--amber); }
.k-file .nm { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.k-file .mt { flex: none; color: var(--muted); font-size: 11.5px; }
.k-foot { display: flex; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.k-foot .btn { padding: 8px 10px; font-size: 12.5px; }
.k-foot .btn.primary { flex: 1; }
.k-foot .btn[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
@media (min-width: 901px) and (max-width: 1180px) {
  /* area kantor sempit: kartu menutup panel samping supaya karakter yang difokuskan tetap terlihat */
  .kartu { left: auto; right: 12px; bottom: 12px; width: 376px; max-height: calc(100% - 24px); }
}

/* ---------- chat */
.who { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.av { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; position: relative; }
.av i { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--panel); background: #5d6488; }
.av i.on { background: var(--green); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.who .meta { flex: 1; min-width: 0; }
.who .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .rl { color: var(--muted); font-size: 12.5px; }
#whoAct { flex: none; }
.who .who-btn { display: inline-flex; width: auto; max-width: 100%; min-height: 26px; margin-left: -6px; padding: 2px 6px; background: none; border: 1px solid transparent; border-radius: 7px; font-size: 14px; color: var(--text); cursor: pointer; justify-content: flex-start; gap: 6px; }
.who .who-btn:hover, .who .who-btn[aria-expanded="true"] { border-color: var(--line); background: var(--panel2); }
.who-menu button { display: flex; align-items: center; gap: 8px; }
.who-menu .nama { flex: none; color: var(--text); font-weight: 700; }
.who-menu .jab { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 12px; }
.who-menu button[aria-selected="true"] .nama { color: inherit; }
.who-menu .titik { position: static; flex: none; }
.who .st { color: var(--amber); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #2a2410; border-color: #4d4020; }
.msg .from { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 6px; padding-left: 20px; }
.msg code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.msg pre { background: rgba(0,0,0,.3); padding: 8px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.msg h3, .msg h4 { margin: 8px 0 4px; font-size: 14px; }
.msg table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; display: block; overflow-x: auto; }
.msg td, .msg th { border: 1px solid var(--line); padding: 4px 6px; }
.chip-file { display: inline-flex; align-items: center; gap: 6px; margin: 6px 6px 0 0; padding: 5px 10px; background: #12301f; border: 1px solid #1f5a39; color: #9ef0c4; border-radius: 8px; text-decoration: none; font-size: 12.5px; font-weight: 600; }
.empty { color: var(--muted); text-align: center; margin: auto; padding: 20px; max-width: 280px; }
.composer { border-top: 1px solid var(--line); padding: 10px; }
.composer textarea { width: 100%; resize: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; outline: none; }
.composer textarea:focus { border-color: var(--amber); }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.quick button { background: transparent; border: 1px dashed var(--line); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.quick button:hover { color: var(--text); border-color: var(--amber); }

/* ---------- feed */
.feed { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ev { display: flex; gap: 10px; align-items: flex-start; }
.ev .av { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.ev .tx { flex: 1; font-size: 13px; }
.ev .tm { color: var(--muted); font-size: 11px; }
.ev.kerja .tx { color: var(--muted); }
.ev.gagal .tx { color: var(--red); }
.ev.selesai .tx { color: var(--green); }
.ev.tugas .tx b { color: var(--amber); }

/* ---------- files & team */
.files, .team { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--text); text-decoration: none; }
.file .ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; flex: none; }
.file .ic.xlsx { background: #1f7a45; } .file .ic.md { background: #3a4b8f; } .file .ic.other { background: #5b5f7a; }
.file .nm { font-weight: 600; word-break: break-all; }
.file .mt { color: var(--muted); font-size: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel2); }
.card .hd { display: flex; gap: 10px; align-items: center; }
.card .ds { color: var(--muted); font-size: 12.5px; margin: 8px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,196,77,.12); color: var(--amber); border: 1px solid rgba(255,196,77,.3); }
.card .btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- modal */
.modal { position: fixed; inset: 0; background: rgba(5,7,15,.66); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; }
.sheet.wide { width: min(760px, 100%); }
.sheet.small { width: min(360px, 100%); }
.sheet h2 { margin: 0; font-size: 18px; }
.sheet h3 { margin: 18px 0 4px; font-size: 15px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.x { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); }
.sheet label { display: block; margin: 10px 0; font-weight: 600; font-size: 13px; }
.sheet label small { display: block; color: var(--muted); font-weight: 400; }
.sheet input, .sheet textarea, .sheet select { display: block; width: 100%; margin-top: 5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; outline: none; }
.sheet input:focus, .sheet textarea:focus { border-color: var(--amber); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.cc { padding: 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
.cc.ok { background: #0f2a1d; border-color: #1f5a39; }
.cc.no { background: #2c2110; border-color: #5a4520; }
.cc code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }
.sehat { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.sehat h3 { margin: 0 0 6px; font-size: 13px; }
.sehat-baris { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; margin-top: 4px; }
.sehat-bar { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.sehat-bar i { display: block; height: 100%; background: var(--green); }
.sehat-baris.bahaya .sehat-bar i { background: var(--red); }
.sehat-baris.bahaya b { color: var(--red); }
.sehat-kerja { margin-top: 6px; color: var(--muted); }
.sehat-warn { margin-top: 6px; color: var(--red); }
.server-warn { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 32px); padding: 6px 12px; border: 1px solid var(--red); border-radius: 8px; background: #2c1414; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
body.siaran .server-warn { display: none; }
.kt-media { margin: 2px 0; font-size: 12.5px; }
.kt-simpan { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12.5px; }
.kt-simpan input { width: auto; }
.paket, .toko { display: grid; gap: 10px; }
.toko { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.price { font-weight: 800; color: var(--amber); }
.err { color: var(--red); min-height: 1em; }
#loginForm { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
#loginForm input { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #23294f; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.4); }

/* ---------- mode siaran (live TikTok) */
.live-feed, .live-head, .live-brand { display: none; }
body.siaran .top, body.siaran .side, body.siaran .stage-hint, body.siaran .agent-bar, body.siaran .agent-tip, body.siaran .kartu { display: none; }
body.siaran .main { grid-template-columns: minmax(0,1fr); }
body.siaran .live-head { display: block; position: absolute; top: 16px; left: 16px; }
.live-dot { display: inline-block; background: #ff2d55; color: #fff; font-weight: 800; font-size: 12px; padding: 3px 10px; border-radius: 6px; letter-spacing: .08em; animation: pulse 1.6s infinite; }
.live-title { font-size: 26px; font-weight: 800; margin-top: 6px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.live-sub { color: #d7dbf0; font-size: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
body.siaran .live-feed { display: flex; flex-direction: column; gap: 6px; position: absolute; left: 16px; bottom: 44px; width: min(420px, 60%); }
.live-feed .ev { background: rgba(10,12,26,.72); backdrop-filter: blur(6px); padding: 7px 10px; border-radius: 10px; animation: rise .4s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
body.siaran .live-brand { display: block; position: absolute; right: 16px; bottom: 14px; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 600; }
body.siaran .stage { cursor: pointer; }

/* ---------- HP */
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .top-ctl { order: 3; flex-basis: 100%; }
  .dd { flex: 1; }
  .dd-btn { max-width: none; justify-content: space-between; min-height: 40px; }
  #btnTema { min-height: 40px; }
  .dd-menu button { min-height: 44px; }
  .clock { display: none; }
  .btn.ghost { padding: 7px 9px; font-size: 12.5px; }
  .main { grid-template-columns: minmax(0,1fr); grid-template-rows: 46vh minmax(0,1fr); }
  .actions { flex-wrap: wrap; justify-content: flex-end; }
  .stage { grid-row: 1; grid-column: 1; }
  .side { grid-row: 2; grid-column: 1; border-left: 0; border-top: 1px solid var(--line); }
  /* kartu menutup panel bawah (sel grid yang sama), area kantor di atasnya tetap terlihat */
  .kartu { position: relative; left: auto; bottom: auto; grid-row: 2; grid-column: 1; width: auto; max-height: none; min-height: 0; border-width: 1px 0 0; border-radius: 14px 14px 0 0; overflow-y: auto; overscroll-behavior: contain; }
  /* panel bawah pendek: seluruh kartu ikut bergulir, tombol aksi tetap terlihat */
  .k-head, .k-status { flex: none; }
  .k-body { flex: none; overflow: visible; }
  .k-foot { flex: none; position: sticky; bottom: 0; margin-top: auto; background: var(--panel); }
  .agent-bar { left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .ab { width: 44px; height: 44px; }
  .agent-tip { bottom: 72px; }
  .k-foot .btn { min-height: 44px; }
  .k-cmd { min-height: 44px; }
  .k-file { min-height: 44px; align-items: center; }
  .who .who-btn { min-height: 36px; }
  body.siaran .main { grid-template-rows: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .stage-hint { display: none; }
  body.siaran .live-feed { width: calc(100% - 32px); }
}

/* ---------- rekrut agent */
.sheet.rekrut { width: min(980px, 100%); }
.rk-grid { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 14px; min-height: 460px; }
.rk-list { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.rk-list input { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; outline: none; }
.rk-div { display: flex; flex-wrap: wrap; gap: 5px; }
.rk-div button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; }
.rk-div button.on { background: var(--amber); color: #1a1205; border-color: var(--amber); }
.rk-items { overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.rk-item { text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.rk-item.on { border-color: var(--amber); }
.rk-item b { display: block; font-size: 13px; }
.rk-item span { color: var(--muted); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk-form { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel2); overflow-y: auto; max-height: 64vh; }
.rk-form h3 { margin: 0 0 4px; }
.rk-form .ds { color: var(--muted); font-size: 12.5px; }
.rk-form label { display: block; margin: 9px 0; font-weight: 600; font-size: 13px; }
.rk-form input, .rk-form select, .rk-form textarea { display: block; width: 100%; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; outline: none; }
.rk-form details { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.rk-form pre { white-space: pre-wrap; max-height: 220px; overflow-y: auto; background: rgba(0,0,0,.25); padding: 8px; border-radius: 8px; font-size: 11.5px; }
@media (max-width: 900px) { .rk-grid { grid-template-columns: 1fr; } .rk-items { max-height: 30vh; } }

/* ---------- persetujuan email */
.approve { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.mail { border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); padding: 12px; }
.mail.draf { border-color: rgba(255,196,77,.45); }
.mail .hd { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mail .st { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.07); white-space: nowrap; }
.mail .st.draf { background: rgba(255,196,77,.15); color: var(--amber); }
.mail .st.terkirim { background: rgba(61,220,151,.15); color: var(--green); }
.mail .st.dibalas { background: rgba(61,220,151,.25); color: var(--green); }
.mail .st.terpental { background: rgba(255,107,107,.25); color: var(--red); }
.mail.terpental { border-color: rgba(255,107,107,.5); }
.mail.dibalas { border-color: rgba(61,220,151,.5); }
.mail .balasan { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--green); background: rgba(61,220,151,.07); border-radius: 6px; font-size: 12.5px; line-height: 1.5; }
.mail .st.gagal, .mail .st.ditolak { background: rgba(255,107,107,.12); color: var(--red); }
.mail label { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
.mail input, .mail textarea { width: 100%; margin-top: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; outline: none; font-size: 13px; }
.mail textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
.mail .btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mail .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.mail .err { font-size: 12px; margin-top: 6px; }
.mailbar { font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); }
.mailbar b { color: var(--text); }

/* ---------- filter & kartu konten */
.seg { flex: none; display: flex; gap: 4px; padding: 3px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { flex: 1; min-height: 32px; padding: 4px 8px; background: none; border: 0; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--amber); color: #1a1205; }
.seg button:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.seg b { padding: 0 5px; border-radius: 999px; background: rgba(255,196,77,.2); font-size: 11px; }
.seg button[aria-pressed="true"] b { background: rgba(26,18,5,.18); }
.seg.kecil { background: var(--panel); }
.mail.draft { border-color: rgba(255,196,77,.45); }
.mail.diposting { border-color: rgba(61,220,151,.5); }
.mail .st.draft { background: rgba(255,196,77,.15); color: var(--amber); }
.mail .st.disetujui { background: rgba(110,168,255,.18); color: var(--blue); }
.mail .st.diposting { background: rgba(61,220,151,.2); color: var(--green); }
.konten .hd b { min-width: 0; overflow-wrap: anywhere; }
.konten h4 { margin: 14px 0 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.konten label.kt-hook { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.konten label.kt-hook:has(input:checked) { border-color: var(--amber); }
.konten label.kt-hook input { flex: none; width: auto; margin: 3px 0 0; accent-color: var(--amber); }
.kt-plat { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.plat { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.plat.tiktok { color: #6fe7e0; border-color: rgba(111,231,224,.4); }
.plat.instagram { color: #ff8fb4; border-color: rgba(255,143,180,.4); }
.plat.facebook { color: #8fb6ff; border-color: rgba(143,182,255,.4); }
.kt-warn { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--amber); background: rgba(255,196,77,.08); border-radius: 6px; font-size: 12.5px; }
.kt-warn ul { margin: 3px 0 0; padding-left: 18px; }
.kt-naskah { max-height: 220px; overflow-y: auto; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.kt-tabel { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.kt-tabel table { width: 100%; border-collapse: collapse; font-size: 12px; }
.kt-tabel th { color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; }
.kt-tabel th, .kt-tabel td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kt-tabel tr:last-child td { border-bottom: 0; }
.kt-tabel td { min-width: 44px; }
.kt-slide { margin: 0; padding-left: 20px; font-size: 13px; }
.kt-slide li { margin-bottom: 5px; }
.kt-slide div { color: var(--muted); font-size: 12.5px; }
.kt-cap { margin-top: 6px; }
.kt-cap[hidden] { display: none; }
.mail .kt-cap textarea { min-height: 110px; margin-top: 0; }
.kt-lipat { margin-top: 8px; font-size: 12.5px; }
.kt-lipat summary { color: var(--muted); cursor: pointer; font-weight: 600; }
.kt-lipat .kt-tabel { margin-top: 6px; }
.kt-angka { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 8px; }
.kt-angka div { padding: 6px 8px; background: var(--panel); border-radius: 8px; }
.kt-angka b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.kt-angka span { color: var(--muted); font-size: 11px; }
a.btn { display: inline-block; color: inherit; text-decoration: none; }
.ask-isian { margin: -4px 0 12px; }
.ask-isian.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ask-isian.dua label { margin: 6px 0; align-self: end; }

/* ---------- laporan pilot */
.laporan { flex: 1; overflow-y: auto; padding: 12px 14px; }
.lap-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.lap-bar label { flex: 1 1 130px; color: var(--muted); font-size: 12px; font-weight: 600; }
.lap-bar input { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color-scheme: dark; }
.laporan h3 { margin: 18px 0 4px; font-size: 13px; }
.lap-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lap-row span { color: var(--muted); }
.lap-row b { font-variant-numeric: tabular-nums; }
.lap-top { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lap-top .no { flex: none; color: var(--amber); font-weight: 800; }
.lap-top a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lap-top b { flex: none; font-variant-numeric: tabular-nums; }
.lap-cat { margin-top: 14px; font-size: 12px; }
.lap-unduh { margin-top: 6px; }
@media (max-width: 900px) { .tab { padding: 8px 10px; } }
