/* app.css — CapCut Console
   Sistem desain: satu skala spasi (4px), satu skala radius, dua bobot permukaan.
   Warna disimpan sebagai token supaya tema gelap/terang konsisten. */

/* ============================================================
   1. TOKEN
   ============================================================ */
:root {
  color-scheme: dark;

  /* permukaan — makin tinggi angka, makin dekat ke mata */
  --bg: #0a0e14;
  --surface-1: #11161f;
  --surface-2: #161d28;
  --surface-3: #1d2635;
  --line: #232d3d;
  --line-strong: #2f3b4d;

  /* teks */
  --text: #e7ecf3;
  --text-dim: #9aa7b8;
  --text-faint: #6b7889;

  /* aksen */
  --accent: #00e0a4;
  --accent-dim: #00a87b;
  --accent-ghost: rgba(0, 224, 164, 0.12);
  --danger: #ff5f7e;
  --danger-ghost: rgba(255, 95, 126, 0.12);
  --warn: #ffc857;
  --warn-ghost: rgba(255, 200, 87, 0.12);
  --info: #5aa9ff;
  --info-ghost: rgba(90, 169, 255, 0.12);

  /* bentuk */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  /* elevasi */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);

  /* tipografi */
  --mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Menlo", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --header-h: 56px;
  --sidebar-w: 232px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface-1: #ffffff;
  --surface-2: #f0f3f7;
  --surface-3: #e6ebf2;
  --line: #dde3ec;
  --line-strong: #c6cfdc;
  --text: #121824;
  --text-dim: #56637a;
  --text-faint: #8592a6;
  --accent: #00996f;
  --accent-dim: #007a59;
  --accent-ghost: rgba(0, 153, 111, 0.1);
  --danger: #d63a5c;
  --danger-ghost: rgba(214, 58, 92, 0.1);
  --warn: #a87400;
  --warn-ghost: rgba(168, 116, 0, 0.12);
  --info: #2a6fd4;
  --info-ghost: rgba(42, 111, 212, 0.1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, 0.14);
}

/* ============================================================
   2. DASAR
   ============================================================ */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}
button {
  font-family: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
::selection {
  background: var(--accent-ghost);
}

/* scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
  background-clip: content-box;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.spacer {
  flex: 1;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   3. GERBANG LOGIN
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(110% 70% at 50% -10%, #16222e 0%, var(--bg) 62%);
}
:root[data-theme="light"] .gate {
  background: radial-gradient(110% 70% at 50% -10%, #e3ecf5 0%, var(--bg) 62%);
}
.gate-card {
  width: min(400px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.gate-card h1 {
  font-size: 19px;
  margin-bottom: 4px;
}
.gate-card .sub {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 13px;
}
.gate-card .err {
  color: var(--danger);
  font-size: 12.5px;
  min-height: 18px;
  margin-top: 10px;
}
.gate-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 11.5px;
}

/* logo mark */
.mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-dim));
  color: #04120d;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.04em;
}

/* ============================================================
   4. FORM
   ============================================================ */
label.fld {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
input,
textarea,
select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.14s, box-shadow 0.14s;
}
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background: var(--surface-1);
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}
textarea {
  resize: vertical;
  min-height: 128px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}
input[type="number"] {
  font-family: var(--mono);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.hint {
  color: var(--text-dim);
  font-size: 12.5px;
  margin: 6px 0 0;
}

/* ============================================================
   5. TOMBOL
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 550;
  background: var(--accent);
  color: #04120d;
  transition: filter 0.14s, background 0.14s, border-color 0.14s, opacity 0.14s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn:active:not(:disabled) {
  filter: brightness(0.94);
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn.block {
  width: 100%;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--surface-3);
  filter: none;
}
.btn.subtle {
  background: var(--surface-3);
  color: var(--text);
}
.btn.subtle:hover:not(:disabled) {
  background: var(--line);
  filter: none;
}
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn.danger-ghost:hover:not(:disabled) {
  background: var(--danger-ghost);
  filter: none;
}
.btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
}
.btn.icon {
  padding: 8px;
  width: 34px;
  height: 34px;
}
.btn svg {
  flex: none;
}

/* ============================================================
   6. RANGKA APLIKASI
   ============================================================ */
.app {
  display: none;
  min-height: 100%;
  flex-direction: column;
}
.app.on {
  display: flex;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}
.topbar .brand .mark {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}
.chip.ok .dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}
.chip.off .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-ghost);
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}

/* --- sidebar --- */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-label {
  padding: 8px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-ghost);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.nav-item svg {
  flex: none;
  opacity: 0.85;
}
.nav-item .badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.nav-item.active .badge {
  background: var(--accent);
  color: #04120d;
}

/* --- konten --- */
.content {
  padding: 22px;
  min-width: 0;
  max-width: 1240px;
}
.view {
  display: none;
  animation: fade 0.18s ease;
}
.view.active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  margin-bottom: 20px;
}
.page-head h2 {
  font-size: 20px;
  margin-bottom: 3px;
}
.page-head p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 72ch;
}

/* ============================================================
   7. KARTU & TATA LETAK
   ============================================================ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card > h3 {
  font-size: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-head h3 {
  font-size: 14px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.go-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.note {
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ============================================================
   8. STATISTIK
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.stat .k {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.stat .v {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.stat.ok .v {
  color: var(--accent);
}
.stat.bad .v {
  color: var(--danger);
}
.stat.warn .v {
  color: var(--warn);
}

/* status pill */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 550;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status.running {
  background: var(--info-ghost);
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
}
.status.running::before {
  animation: pulse 1.3s ease-in-out infinite;
}
.status.done {
  background: var(--accent-ghost);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.status.error {
  background: var(--danger-ghost);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.status.cancelled,
.status.stopped {
  background: var(--warn-ghost);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ============================================================
   9. TABEL
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover td {
  background: var(--surface-2);
}
td.empty,
.empty {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 26px 12px;
}
.seat {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--accent-ghost);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.linkcell {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
}
.linkcell a {
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy {
  flex: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-size: 11px;
  transition: background 0.14s, color 0.14s;
}
.copy:hover {
  background: var(--surface-3);
  color: var(--text);
}
.copy.done {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   10. LOG KONSOL
   ============================================================ */
.log {
  height: 340px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}
:root[data-theme="light"] .log {
  background: var(--surface-2);
}
.logline {
  display: flex;
  gap: 8px;
  padding: 1px 0;
  word-break: break-word;
}
.logline .ts {
  color: var(--text-faint);
  flex: none;
}
.logline .lvl {
  flex: none;
  font-weight: 600;
  width: 44px;
}
.logline.info .lvl {
  color: var(--info);
}
.logline.ok .lvl {
  color: var(--accent);
}
.logline.warn .lvl {
  color: var(--warn);
}
.logline.err .lvl {
  color: var(--danger);
}
.logline.err .msg {
  color: var(--danger);
}
.log-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.log-toolbar input[type="search"] {
  max-width: 220px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.switch input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* ============================================================
   11. PILIHAN MODE
   ============================================================ */
.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.mode-opt {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.mode-opt:hover {
  border-color: var(--line-strong);
}
.mode-opt.sel {
  border-color: var(--accent);
  background: var(--accent-ghost);
}
.mode-opt .t {
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mode-opt .t::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.mode-opt.sel .t::before {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent);
}
.mode-opt .d {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 3px;
  padding-left: 20px;
}
.collapse {
  display: none;
  margin-top: 14px;
}
.collapse.show {
  display: block;
}

/* ============================================================
   12. PROGRESS PER-LINK
   ============================================================ */
.lp-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 13px;
  margin-bottom: 8px;
  background: var(--surface-2);
  transition: border-color 0.14s;
}
.lp-item.running {
  border-color: color-mix(in srgb, var(--info) 45%, transparent);
}
.lp-item.done {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.lp-item.stopped,
.lp-item.partial,
.lp-item.skipped {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}
.lp-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.lp-top .lk {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.lp-top .cnt {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}
.lp-top .cnt .s {
  color: var(--accent);
}
.lp-bar {
  height: 5px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.lp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: var(--r-full);
  transition: width 0.35s ease;
}
.lp-badge {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-dim);
  text-transform: lowercase;
}
.lp-badge.running {
  background: var(--info-ghost);
  color: var(--info);
}
.lp-badge.done {
  background: var(--accent-ghost);
  color: var(--accent);
}
.lp-badge.stopped,
.lp-badge.partial,
.lp-badge.skipped {
  background: var(--warn-ghost);
  color: var(--warn);
}

/* ============================================================
   13. LANGKAH BERIKUT / CALLOUT
   ============================================================ */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.callout .ic {
  flex: none;
  margin-top: 1px;
}
.callout .body {
  flex: 1;
  min-width: 0;
}
.callout .body strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}
.callout .body p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12.5px;
}
.callout.accent {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-ghost);
}
.callout.accent .ic {
  color: var(--accent);
}
.callout.danger {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-ghost);
}
.callout.danger .ic {
  color: var(--danger);
}
.callout.warn {
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
  background: var(--warn-ghost);
}
.callout.warn .ic {
  color: var(--warn);
}
.hidden-block {
  display: none;
}
.hidden-block.show {
  display: flex;
}

/* ============================================================
   14. RIWAYAT
   ============================================================ */
.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.hist-item .type {
  font-weight: 600;
  font-size: 13px;
  min-width: 88px;
}
.hist-item .meta {
  color: var(--text-dim);
  font-size: 12px;
  flex: 1;
  min-width: 180px;
}
.hist-item .acts {
  display: flex;
  gap: 6px;
  flex: none;
}

/* ============================================================
   15. TOAST & MODAL
   ============================================================ */
.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: slide-in 0.2s ease;
}
.toast.ok {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.toast.err {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.toast.warn {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}
.toast .x {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 13, 0.72);
  backdrop-filter: blur(3px);
}
.modal-back.show {
  display: grid;
}
.modal {
  width: min(440px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.modal h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.modal p {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 13px;
}
.modal-acts {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ============================================================
   16. PENGATURAN
   ============================================================ */
/* input dengan tombol aksi di sebelah kanan */
.input-btn {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.input-btn input {
  flex: 1;
  min-width: 0;
}
.input-btn .btn {
  flex: none;
}

/* baris toggle dengan penjelasan */
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.14s;
}
.switch-row:hover {
  border-color: var(--line-strong);
}
.switch-row input {
  width: auto;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--accent);
  transform: scale(1.15);
}
.switch-row span {
  flex: 1;
  min-width: 0;
}
.switch-row b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}
.switch-row em {
  display: block;
  font-style: normal;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 2px;
}

/* penanda field yang dikunci environment variable */
.lock {
  display: none;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--warn-ghost);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.lock.on {
  display: inline-block;
}
input:disabled,
.switch-row input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.switch-row:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.75;
}

/* baris simpan yang menempel di bawah */
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface-1) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   17. RESPONSIF
   ============================================================ */
@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  :root {
    --sidebar-w: 0px;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 232px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: none;
  }
  .content {
    padding: 16px;
  }
  .nav-toggle {
    display: inline-flex !important;
  }
  .topbar .chip.hide-sm {
    display: none;
  }
  .linkcell {
    max-width: 220px;
  }
}
.nav-toggle {
  display: none;
}
@media (min-width: 761px) {
  .sidebar {
    transform: none !important;
  }
}
