/* SIDIG Worker — gaya mengikuti reels.zeusanimation.com, warna utama biru. */
:root {
  --paper: #F5F5F1; --white: #FFFFFF; --ink: #17202A; --black: #101214;
  --grey: #6E7479; --light: #E6E8E6; --line-strong: #D7DAD5;
  --blue: #1E4FD8; --blue-hover: #173FB0; --blue-soft: rgba(30, 79, 216, .10); --blue-ink: #143A9E;
  --lime: #D9FF66; --cyan: #8EEBE0; --coral: #FF725E;
  --ok: #1F7A4D; --ok-bg: rgba(31, 122, 77, .10);
  --danger: #D2452F; --danger-bg: rgba(255, 114, 94, .14);
  --warn-bg: rgba(217, 255, 102, .55); --warn: #D99A00;
  --radius: 10px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-ui: 'Outfit', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'Red Hat Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.45; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.shell { max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; }

/* ---------- header ---------- */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding-bottom: 22px; border-bottom: 1px solid var(--line-strong); margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brand-mark { color: var(--blue); font-weight: 800; letter-spacing: .02em; font-size: 16px; }
.brand-sep { width: 1px; height: 14px; background: var(--line-strong); }
.brand-sub { text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; font-weight: 600; color: var(--grey); }
.page-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 46px; line-height: 1.02;
  letter-spacing: -.02em; color: var(--black); }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--blue); }
.nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.icon-btn { border: 0; background: transparent; padding: 4px; cursor: pointer; color: var(--ink); display: inline-flex; border-radius: 6px; }
.icon-btn:hover { color: var(--blue); background: var(--blue-soft); }
.icon-btn svg { width: 19px; height: 19px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- section ---------- */
.section { margin-bottom: 30px; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin: 0 0 6px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.section-head .meta { color: var(--grey); font-size: 12px; }
.muted { color: var(--grey); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.small { font-size: 12px; }

.card { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .page-title { font-size: 36px; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 18px 20px; border-right: 1px solid var(--light); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--grey); font-size: 12px; }
.stat.accent b { color: var(--blue); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong);
  background: var(--white); color: var(--ink); border-radius: 8px; padding: 9px 14px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: .12s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; padding: 6px 8px; }
.btn.ghost:hover { background: var(--light); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--grey); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; background: var(--white); font-size: 13.5px; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { accent-color: var(--blue); width: 15px; height: 15px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline > .field { flex: 1; min-width: 110px; }
.error-text { color: var(--danger); font-size: 12.5px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }
.toolbar .meta { margin-left: auto; color: var(--grey); font-size: 12px; }

/* segmented / chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; background: var(--white); cursor: pointer; user-select: none; }
.chip.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-ink); }
.chip.static { cursor: default; }
.chip.rule { background: var(--warn-bg); border-color: transparent; }

/* ---------- tables ---------- */
.table-wrap { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th { text-align: left; padding: 12px 14px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--grey); border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--white); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--light); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FAFAF7; }
.tbl tr.clickable { cursor: pointer; }
.tbl .title b { display: block; font-weight: 600; }
.tbl .title span { display: block; color: var(--grey); font-size: 12px; }
/* Sel aksi tetap table-cell: td dengan display:flex keluar dari perhitungan kolom tabel
   sehingga lebar kolom terakhir kacau. Tombol disejajarkan lewat vertical-align, bukan flex. */
.tbl .actions { text-align: right; white-space: nowrap; vertical-align: middle; }
.tbl .actions > * { vertical-align: middle; }
.empty { padding: 36px 20px; text-align: center; color: var(--grey); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: var(--light); color: var(--ink); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.plain::before { display: none; }
.badge.ok, .badge.online, .badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.running, .badge.busy { background: var(--blue-soft); color: var(--blue-ink); }
.badge.queued { background: var(--warn-bg); color: #3D4A12; }
.badge.failed, .badge.unauthorized { background: var(--danger-bg); color: var(--danger); }
.badge.partial { background: rgba(142, 235, 224, .45); color: #135B53; }
.badge.cancelled, .badge.offline, .badge.skipped { background: var(--light); color: var(--grey); }
.badge.running::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; } }

.progress { height: 6px; background: var(--light); border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: var(--blue); }
.battery { display: inline-flex; align-items: center; gap: 6px; }
.battery .progress { width: 40px; min-width: 40px; }

/* ---------- login ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 40px; align-items: center; min-height: 60vh; }
.auth-art { color: var(--ink); opacity: .9; }
.auth-art svg { width: 100%; height: auto; max-height: 360px; stroke-width: 1.2; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- steps editor ---------- */
/* Daftar step: satu baris per step, dibuka satu-satu. Garis tipis di kiri menyambung
   titik-titik jenis step supaya urutannya terbaca sebagai alur, bukan tumpukan kartu. */
.steps { display: flex; flex-direction: column; gap: 5px; position: relative; }
.steps::before { content: ""; position: absolute; left: 34px; top: 12px; bottom: 12px; width: 1px; background: var(--light); }
.step { position: relative; background: var(--white); border: 1px solid #E3E5E1; border-radius: 8px; }
.step:hover { border-color: var(--line-strong); }
.step.open { border-color: #C3CDEA; box-shadow: 0 1px 2px rgba(23, 32, 42, .04); }
.step.dragging { opacity: .45; }
.step.over { border-color: var(--blue); box-shadow: 0 -2px 0 var(--blue); }

.srow { display: flex; align-items: center; gap: 9px; padding: 0 9px 0 4px; min-height: 34px; cursor: pointer; border-radius: 7px; }
.srow:hover, .step.open .srow { background: #FCFCFA; }
.srow:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.sgrip { width: 14px; text-align: center; color: #DCDED8; cursor: grab; font-size: 12px; letter-spacing: -2px; user-select: none; }
.step:hover .sgrip { color: #AFB3AC; }
.sno { font-family: var(--font-mono); font-size: 10.5px; color: #ADB1AB; width: 14px; }
.skind { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; width: 146px; flex: none;
  white-space: nowrap; overflow: hidden; }
.skind span { overflow: hidden; text-overflow: ellipsis; }
.srow .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: #9AA0A6;
  box-shadow: 0 0 0 3px var(--white); }                     /* cincin putih: titik tetap jelas di atas garis alur */
.step.k-app   .dot { background: #1E4FD8; }
.step.k-touch .dot { background: #1F7A4D; }
.step.k-wait  .dot { background: #D99A00; }
.step.k-input .dot { background: #6B37C4; }
.step.invalid .dot { background: var(--danger); }
.ssum { flex: 1; font-size: 12px; color: #9AA0A6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stags { display: flex; gap: 4px; flex: none; }
.stags .tag { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: #F0F1EE; color: #8A8F89; white-space: nowrap; }
.sacts { display: flex; gap: 1px; flex: none; width: 88px; justify-content: flex-end; opacity: 0; transition: opacity .1s; }
.step:hover .sacts, .step.open .sacts, .srow:focus-within .sacts { opacity: 1; }
.sacts .icon-btn { padding: 2px; }
.sacts .icon-btn svg { width: 15px; height: 15px; }
@media (hover: none) { .sacts { opacity: 1; } }             /* layar sentuh tidak punya hover */

/* Final Step: satu baris per skenario, memakai kerangka baris step di atas */
.step.seq .srow { cursor: default; min-height: 38px; }
.step.seq .dot { background: var(--blue); }
.step.seq .sacts { opacity: .5; }                            /* daftarnya pendek: aksi selalu tampak, redup */
.step.seq:hover .sacts, .step.seq .srow:focus-within .sacts { opacity: 1; }
.sname { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; }
.sname > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.sname .tag { font-size: 10.5px; font-weight: 500; padding: 1px 6px; border-radius: 999px; flex: none; }
.tag.bad { background: var(--danger-bg); color: var(--danger); }
.tbl .tag { font-size: 10.5px; font-weight: 500; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.tag.wait { background: #FBF3DF; color: #7A5D00; }
.tag.ok { background: #E6F2EC; color: #1F7A4D; }
.scol { flex: none; font-size: 11.5px; color: #9AA0A6; text-align: right; white-space: nowrap; }
.scol.n { width: 52px; }
.scol.r { width: 56px; font-family: var(--font-mono); font-size: 10.5px; }
.seq-id { display: grid; grid-template-columns: 1fr 120px; gap: 16px; }
.seq-id .check { height: 38px; }
.seq-id ~ .field textarea { min-height: 58px; }
.seq-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.seq-add select { height: 34px; padding: 5px 10px; font-size: 13px; }
.seq-add .btn { padding: 7px 12px; }
.seq-add .meta { margin-left: auto; color: #9AA0A6; font-size: 11.5px; }

.sbody { display: none; border-top: 1px solid #EEEFEC; padding: 10px 12px 11px 27px; }
.step.open .sbody { display: block; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.sgrid + .sgrid { margin-top: 8px; }
.sgrid .field { margin: 0; gap: 3px; min-width: 0; }
.sgrid .field > label, .sgrid .field > .label { font-size: 11px; font-weight: 400; color: #9AA0A6; }
.sgrid .field.wide { grid-column: 1 / -1; }
.sgrid input[type=text], .sgrid input[type=number], .sgrid select, .sgrid textarea {
  height: 30px; padding: 4px 8px; font-size: 12.5px; border-radius: 6px; border-color: #E1E3DF; }
.sgrid textarea { height: auto; min-height: 52px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; }
.sgrid .check { height: 30px; font-size: 12.5px; }
.sgrid .hint { font-size: 10.5px; }

.adv { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px;
  font-size: 11.5px; color: #9AA0A6; cursor: pointer; user-select: none; }
.adv:hover { color: var(--ink); }
.adv .caret { font-size: 9px; }
.advbox { margin-top: 8px; }

/* tombol "+" tipis di antara dua step */
.ins { position: relative; height: 5px; display: flex; align-items: center; justify-content: center; }
.ins::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--blue); opacity: 0; transition: opacity .1s; }
.ins button { position: relative; background: var(--white); border: 1px solid var(--line-strong); color: #A8ACA6;
  border-radius: 999px; width: 18px; height: 18px; font-size: 12px; line-height: 1; cursor: pointer; opacity: 0;
  transition: .1s; padding: 0; }
.ins:hover::before { opacity: .25; }
.ins:hover button { opacity: 1; color: var(--blue); border-color: var(--blue); }

@media (max-width: 720px) {
  .sgrid { grid-template-columns: 1fr; }
  .skind { width: auto; }
  .ssum, .steps::before, .scol.r { display: none; }
}
.steps.empty-list::before { display: none; }
.override { margin-top: 10px; background: #FAFAF7; border: 1px solid var(--light); border-radius: 8px; padding: 10px; }
.override-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; }

/* ---------- assets ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.asset { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.asset-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.asset-name { font-weight: 600; font-family: var(--font-mono); font-size: 13px; word-break: break-all; }
.variant { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--light); }
.thumb { width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--light); background:
  repeating-conic-gradient(#F0F0EC 0 25%, #fff 0 50%) 0 0 / 12px 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.shot { width: 72px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--light);
  cursor: zoom-in; padding: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- run detail ---------- */
.job { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.job-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--light); flex-wrap: wrap; }
.job-head .grow { flex: 1; }
/* Pager History (25 run per halaman): sama dengan pager reels.zeusanimation.com, warna dashboard. */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 16px; }
.pager-info { margin: 0; font-size: 12px; color: var(--grey); font-variant-numeric: tabular-nums; }
.pager-info b { color: var(--ink); font-weight: 600; }
.pager-info span + span::before { content: "·"; margin: 0 8px; }
.pager-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--white);
  color: var(--ink); font: 600 13px/1 var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer; transition: .12s; }
.pager-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pager-btn:hover:not(:disabled):not([aria-current]) { color: var(--blue); border-color: var(--blue); }
.pager-btn[aria-current=page] { background: var(--blue); border-color: var(--blue); color: #fff; cursor: default; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pager-gap { min-width: 20px; text-align: center; color: var(--grey); font-size: 13px; }
@media (max-width: 640px) { .pager { flex-direction: column; justify-content: center; } .pager-pages { justify-content: center; }
  .pager-btn { min-width: 32px; height: 32px; padding: 0 8px; } .pager-info { text-align: center; }
  .pager-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.job-head .tag { font-size: 10.5px; font-weight: 500; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.result-row td { font-size: 12.5px; }
.result-out { color: var(--grey); max-width: 520px; word-break: break-word; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16, 18, 20, .45); display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--white); border-radius: 14px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(16, 18, 20, .25); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--light); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--light); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 9px; font-size: 13px; max-width: 360px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--blue); }

.secret { font-family: var(--font-mono); background: var(--paper); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px; word-break: break-all; font-size: 12.5px; }
.notice { background: var(--blue-soft); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--blue-ink); }
.notice.warn { background: var(--warn-bg); color: #3D4A12; }

/* crop tool */
.crop-wrap { position: relative; display: inline-block; max-width: 100%; user-select: none; touch-action: none; cursor: crosshair; }
.crop-wrap img { display: block; max-width: 100%; max-height: 70vh; }
.crop-box { position: absolute; border: 2px solid var(--blue); background: rgba(30, 79, 216, .12); box-shadow: 0 0 0 9999px rgba(16, 18, 20, .35); }
.crop-layout { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .crop-layout { grid-template-columns: 1fr; } }

.foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line-strong);
  color: var(--grey); font-size: 12px; flex-wrap: wrap; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .badge.running::before { animation: none; } }

/* Riwayat run rangkaian: judul per skenario asal step */
.tbl tr.group-row td {
  background: var(--blue-soft, #EAF0FD);
  color: var(--ink, #17202A);
  border-top: 1px solid var(--line, #D7DAD5);
  padding-top: 9px;
  padding-bottom: 9px;
}

/* Item: kolom kumpulan, thumbnail, teks panjang */
.field-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 170px) auto; gap: 6px; align-items: center; }
.chip.static { cursor: default; font-family: var(--mono, ui-monospace, monospace); font-size: 12px; }
.item-thumb { width: 44px; height: 44px; padding: 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-strong, #C9CCC7);
  background: var(--light, #EEEEEA); cursor: zoom-in; display: block; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-text { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-list { margin: 6px 0 0; padding-left: 18px; color: var(--danger, #D2452F); font-size: 12.5px; max-height: 180px; overflow: auto; }
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* "Teruji di": status skenario/rangkaian per HP */
.compat { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.compat-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
.compat-chip.ok { background: var(--ok-bg); color: var(--ok); }
.compat-chip.failed { background: var(--danger-bg); color: var(--danger); }
.compat-chip.partial { background: var(--warn-bg); color: var(--ink, #222); }
.compat-chip.stale { border-style: dashed; border-color: currentColor; }
.compat-chip.none { background: var(--light); color: var(--grey); }
.compat.clickable { cursor: pointer; }

/* Pengaturan = ikon gear (seperti reels.zeusanimation.com) */
.nav a.nav-gear { display: inline-flex; align-items: center; padding: 4px 0; }
.nav a.nav-gear svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Tombol tambah di samping jumlah (Library / Final Step) */
.section-head .head-actions { display: inline-flex; align-items: center; gap: 12px; }

/* ---------- Dashboard: kesehatan HP & Device Controller ---------- */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.health-card { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.health-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.health-head .title b { display: block; font-size: 15px; }
.health-head .title span { color: var(--grey); font-size: 12px; overflow-wrap: anywhere; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gauge { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.ring-wrap svg.ring { width: 72px; height: 72px; stroke: none; }
.ring-bg { fill: none; stroke: var(--light); stroke-width: 7; }
.ring-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.gauge-val { position: absolute; top: 24px; left: 0; right: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge-label { font-size: 12px; font-weight: 600; margin-top: 2px; }
.gauge-sub { font-size: 11px; color: var(--grey); }
.gauge.danger .gauge-val { color: var(--danger); }
.spark-wrap svg.spark-svg { width: 100%; height: 64px; display: block; stroke: none; }
.spark-line { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.spark-grid { stroke: var(--light); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark { background: var(--paper); border-radius: 8px; padding: 8px 10px 6px; }
.spark-empty { background: var(--paper); border-radius: 8px; padding: 14px 12px; color: var(--grey); font-size: 12px; text-align: center; }
.spark-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; margin-top: 6px; }
.spark-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.health-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.health-note { font-size: 12px; color: var(--grey); }
.health-note.warn { color: var(--warn); font-weight: 600; }
.health-note.danger { color: var(--danger); font-weight: 600; }
.chart-card { padding: 16px 18px; }
.bar-wrap svg.bar-svg { width: 100%; height: auto; display: block; stroke: none; }
.bar-ok { fill: var(--blue); }
.bar-fail { fill: var(--coral); }
.bar-num { font-size: 11px; text-anchor: middle; fill: var(--ink); font-family: var(--font-mono); }
.bar-day { font-size: 10.5px; text-anchor: middle; fill: var(--grey); }
@media (max-width: 480px) { .health-grid { grid-template-columns: 1fr; } .gauges { grid-template-columns: repeat(2, 1fr); row-gap: 12px; } }

/* Drawer: panel dari kanan (kesehatan HP) */
.modal-back.drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.modal-back.drawer .modal { width: min(460px, 100%); height: 100%; border-radius: 0; overflow-y: auto;
  animation: drawer-in .22s ease-out; }
.modal-back.drawer .health-card { border: 0; padding: 0; }
.drawer-body .small { margin-top: 16px; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-back.drawer .modal { animation: none; } }

/* Dua bagian berdampingan setinggi baris (Server Health | Job 7 hari) */
.grid-2.equal > .section { display: flex; flex-direction: column; }
.grid-2.equal > .section > :last-child { flex: 1; }
.grid-2.equal .chart-card { display: flex; flex-direction: column; justify-content: center; }

/* Tombol Hubungkan di samping status Offline */
.status-connect { display: inline-flex; align-items: center; gap: 4px; }
.connect-btn { color: var(--blue); border: 1px solid var(--line-strong); background: var(--white); padding: 3px; border-radius: 999px; }
.connect-btn:hover { background: var(--blue-soft); border-color: var(--blue); }
.connect-btn svg { width: 14px; height: 14px; }
/* Preview layar HP di drawer */
.preview-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--light); }
.preview-box { margin-top: 10px; display: flex; justify-content: center; }
.preview-img { max-width: 100%; max-height: 70vh; border-radius: 14px; border: 6px solid var(--black); background: var(--black); }

/* Hitungan status HP di samping judul (bisa diklik = filter) */
.count-chips { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: var(--white);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; color: var(--ink); cursor: pointer; }
.count-chip b { font-size: 13px; font-variant-numeric: tabular-nums; }
.count-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.count-chip.online::before { background: var(--ok); }
.count-chip.offline::before { background: var(--grey); }
.count-chip.unauthorized::before { background: var(--danger); }
.count-chip:hover { border-color: var(--blue); color: var(--blue); }
.count-chip.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }

/* Baris status versi padat (lebih banyak kotak muat) + angka VPS */
.stats.compact { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.stats.compact .stat { padding: 11px 13px; }
.stats.compact .stat b { font-size: 21px; }
.stats.compact .stat span { font-size: 11px; letter-spacing: .01em; }
.stat i { display: block; font-size: 10.5px; color: var(--grey); font-style: normal; margin-top: 2px; }
.stat.warn b { color: var(--warn); }
.stat.danger b, .stat.bad b { color: var(--danger); }

/* Live status | VPS status berdampingan: kotak lebih rapat supaya 6 muat sebaris */
.overview-status > .section:only-child { grid-column: 1 / -1; }
.grid-2 .stats.compact { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.grid-2 .stats.compact .stat { padding: 10px 11px; }
.grid-2 .stats.compact .stat b { font-size: 19px; }
.grid-2 .stats.compact .stat i { font-size: 10px; }

/* Kotak status: isi rata tengah */
.stats.compact .stat { text-align: center; }

/* Kolom Kesehatan di tabel Device */
.health-cell { display: flex; flex-direction: column; gap: 3px; min-width: 138px; }
/* baris baterai tidak boleh patah: "100% ⚡" harus muat satu baris */
.health-cell > span:first-child { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hbits { display: flex; flex-wrap: wrap; gap: 6px; }
.hbit { font-size: 11px; color: var(--grey); font-variant-numeric: tabular-nums; }
.hbit.warn { color: var(--warn); font-weight: 600; }
.hbit.danger { color: var(--danger); font-weight: 600; }

/* Jaringan + lokasi di drawer kesehatan */
.netloc { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.nl-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.nl-row b { min-width: 62px; font-size: 12px; }

/* Jalankan Final Step: semua HP online atau HP tertentu */
input[type=radio] { accent-color: var(--blue); width: 15px; height: 15px; }
.run-mode { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.pick-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pick-tools input[type=search] { flex: 1; min-width: 160px; }
.pick-list { border: 1px solid var(--line-strong); border-radius: 8px; max-height: 320px; overflow-y: auto; margin-bottom: 12px; }
.pick-list .empty { padding: 18px; }
.pick-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--light); cursor: pointer; font-size: 13px; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: #FAFAF7; }
.pick-row .who { min-width: 0; }
.pick-row .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .who span { display: block; color: var(--grey); font-size: 11.5px; font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .st { display: flex; gap: 6px; align-items: center; }
/* Tombol Jalankan (gaya sama dengan Simpan) di atas "versi · diperbarui" di halaman Final Step */
.section-head .head-stack { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* Server Health: kartu Device Controller sebagai slider (geser / panah / titik) */
.hslider { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* kartu berderet di dalam slider tidak boleh melebarkan kolom grid (min-width:auto) */
.grid-2 > .section:has(.hslider) { min-width: 0; }
.hslider-track { display: flex; flex: 1; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: var(--radius); overscroll-behavior-x: contain; }
.hslider-track::-webkit-scrollbar { display: none; }
.hslider-track:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hslide { flex: 0 0 100%; min-width: 0; display: flex; scroll-snap-align: start; }
.hslide > * { flex: 1; min-width: 0; }      /* kartu apa pun memenuhi lebar slide */
.hslider-dots { display: flex; justify-content: center; gap: 6px; }
.hdot { width: 8px; height: 8px; border: 0; padding: 0; border-radius: 999px; background: var(--line-strong);
  cursor: pointer; transition: width .15s, background .15s; }
.hdot:hover { background: var(--grey); }
.hdot.on { width: 20px; background: var(--blue); }
.hslider-nav { display: inline-flex; align-items: center; gap: 4px; }
.hslider-nav .icon-btn:disabled { opacity: .3; cursor: default; background: transparent; color: var(--ink); }
.hslider-count { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .hdot { transition: none; } }

/* Grafik Job (1 hari / 7 hari / 1 bulan): keterangan rentang + area sorot per batang (tooltip) */
.chart-span { margin: 0 0 6px; font-size: 11.5px; color: var(--grey); }
.bar-hit { fill: transparent; }
.bar-svg g:hover .bar-hit { fill: var(--paper); }

/* Aset > Screenshot tombol (jenis 'bukti'): galeri screenshot riset, kotak merah = tombol yang diklik */
.bukti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bukti { background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bukti-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bukti-head b { display: block; overflow-wrap: anywhere; }
.bukti-head .small { display: block; overflow-wrap: anywhere; margin-top: 2px; }
.bukti-shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.bukti-shot { margin: 0; flex: 0 0 auto; width: 128px; display: flex; flex-direction: column; gap: 4px; }
.bukti-img { padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--ink);
  height: 228px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.bukti-img:hover { border-color: var(--blue); }
.bukti-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bukti-shot figcaption { font-size: 11px; line-height: 1.3; }
.bukti-shot figcaption b { display: block; font-size: 11.5px; }
.bukti-shot figcaption span { color: var(--grey); }
.bukti-zoom { display: flex; justify-content: center; background: var(--ink); border-radius: 10px; padding: 10px; }
.bukti-full { max-width: 100%; max-height: 78vh; display: block; }
@media (max-width: 480px) { .bukti-grid { grid-template-columns: 1fr; } }
