:root {
  --bg: #eef1f4; --card: #fff; --ink: #1b2430; --ink2: #556070; --ink3: #8a94a3; --line: #dde3ea;
  --brand: #0f5f8a; --brand2: #e6f1f8; --red: #c62828; --red-bg: #fdecea; --ok: #1f7a4d;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #12263a; color: #fff; }
.logo { width: 34px; height: 34px; }
.judul { display: flex; flex-direction: column; line-height: 1.2; }
.judul small { color: #9fb3c8; font-size: 12px; }
.tabs { margin-left: auto; display: flex; gap: 4px; background: #0b1a29; padding: 4px; border-radius: 9px; }
.tab { border: 0; background: none; color: #b9c7d6; padding: 7px 14px; border-radius: 6px; cursor: pointer; }
.tab.active { background: var(--brand); color: #fff; }
.tab:disabled { opacity: .4; cursor: default; }

.wrap { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; overflow: auto; padding: 18px; position: relative; }
.panel { width: 340px; flex-shrink: 0; background: var(--card); border-left: 1px solid var(--line); overflow-y: auto; padding: 6px 16px 30px; }
.panel section { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.panel h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink2); }
.panel label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.panel input[type=number], .panel select { border: 1px solid #cfd7e0; border-radius: 7px; padding: 7px 9px; background: #fff; font-weight: 400; color: var(--ink); width: 100%; min-width: 0; }
.panel input:focus, .panel select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #0f5f8a22; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint { margin: 0; font-size: 12px; color: var(--ink3); font-weight: 400; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; text-align: left; font-size: 12px; }
.cek { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 400 !important; }

.btn { border: 1px solid #cfd7e0; background: #fff; border-radius: 8px; padding: 9px 12px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.primary:disabled { opacity: .5; cursor: wait; }
.btn.stop { background: var(--red); border-color: var(--red); color: #fff; }

.files { display: flex; flex-direction: column; gap: 6px; }
.file { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; grid-template-columns: 10px 1fr auto; gap: 4px 8px; align-items: center; }
.file .dot { width: 10px; height: 10px; border-radius: 3px; }
.file .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .x { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--ink3); line-height: 1; }
.file .x:hover { color: var(--red); }
.file .meta { grid-column: 2 / -1; font-size: 12px; color: var(--ink2); }
.file .ctl { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 86px; gap: 6px; }
.file .ctl select, .file .ctl input { padding: 4px 6px !important; font-size: 12px; }
.file .fw { grid-column: 2 / -1; font-size: 11px; color: #a45a00; }
.sum { font-size: 12px; color: var(--ink2); }

.prog { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink2); }
.bar { height: 6px; background: var(--brand2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat { background: var(--brand2); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 18px; color: var(--brand); }
.stat span { font-size: 11px; color: var(--ink2); }
.warn { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 8px 10px; font-size: 12px; }

.drop { position: absolute; inset: 18px; border: 2px dashed #b8c4d0; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: var(--ink2); text-align: center; padding: 20px; }
.drop-ico { font-size: 40px; color: var(--brand); }
.drop small { color: var(--ink3); }
.stage.over .drop, .stage.over { outline: 3px solid var(--brand); outline-offset: -6px; }

.sheets { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.card canvas { display: block; cursor: zoom-in; border-radius: 4px; }
.cap { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12px; color: var(--ink2); }
.cap b { color: var(--ink); font-size: 13px; }
.cap .btn { padding: 4px 10px; font-size: 12px; }

.modal { position: fixed; inset: 0; background: #0b1a29cc; display: grid; place-items: center; z-index: 20; padding: 16px; }
.zoom-box { background: #fff; border-radius: 12px; padding: 10px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 8px; }
.zoom-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.x { border: 0; background: #eef1f4; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #12263a; color: #fff;
  padding: 10px 18px; border-radius: 8px; z-index: 30; box-shadow: 0 6px 24px #0003; max-width: 90vw; }
.toast.err { background: var(--red); }

@media (max-width: 820px) {
  body { height: auto; }
  .wrap { flex-direction: column; }
  .panel { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .stage { min-height: 50vh; }
  .top { flex-wrap: wrap; }
  .tabs { margin-left: 0; width: 100%; }
  .tab { flex: 1; }
}
