/* ============================================================
   Gebang Render Pro - UI v2
   Design: modern SaaS desktop, dark default + light mode,
   burgundy & gold accent, subtle glassmorphism.
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* dark theme (default) */
  --bg: #0b1012;
  --bg-glow1: rgba(226, 85, 128, 0.10);
  --bg-glow2: rgba(227, 178, 60, 0.06);
  /* Latar burgundy gelap -> hitam (hanya background, bukan komponen) */
  --body-bg:
    radial-gradient(ellipse 75% 45% at 50% -6%, rgba(180, 36, 70, 0.30), transparent 70%),
    radial-gradient(ellipse 90% 85% at 50% 48%, transparent 52%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(180deg, #4c1020 0%, #2c0714 34%, #18030a 64%, #070109 100%);
  --surface: rgba(15, 22, 25, 0.82);      /* sidebar / glass */
  --topbar: rgba(11, 16, 18, 0.80);
  --card: rgba(20, 29, 32, 0.72);
  --card2: rgba(26, 37, 41, 0.85);        /* input bg */
  --border: rgba(148, 178, 168, 0.14);
  --border-strong: rgba(148, 178, 168, 0.28);
  --text: #e8efec;
  --muted: #8ea3a0;
  --faint: #5f7374;
  --accent: #e25580;
  --accent-strong: #b63a63;
  --accent-soft: rgba(226, 85, 128, 0.15);
  --accent-rgb: 226, 85, 128;
  --gold: #e3b23c;
  --gold-soft: rgba(227, 178, 60, 0.13);
  --ok: #f0a0bc;
  --warn: #fbbf24;
  --err: #f87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --tr: 0.18s ease;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 238px;
  --sidebar-w-c: 66px;
}

html[data-theme="light"] {
  --bg: #f2f6f4;
  --bg-glow1: rgba(194, 37, 92, 0.08);
  --bg-glow2: rgba(201, 138, 26, 0.08);
  --body-bg:
    radial-gradient(1100px 560px at 85% -10%, var(--bg-glow1), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--bg-glow2), transparent 55%),
    var(--bg);
  --surface: rgba(238, 243, 241, 0.85);
  --topbar: rgba(242, 246, 244, 0.82);
  --card: rgba(255, 255, 255, 0.78);
  --card2: rgba(240, 245, 243, 0.9);
  --border: rgba(20, 48, 42, 0.10);
  --border-strong: rgba(20, 48, 42, 0.22);
  --text: #16201e;
  --muted: #5c706b;
  --faint: #8ba09b;
  --accent: #c2255c;
  --accent-strong: #9d1848;
  --accent-soft: rgba(194, 37, 92, 0.10);
  --accent-rgb: 194, 37, 92;
  --gold: #c98a1a;
  --gold-soft: rgba(201, 138, 26, 0.12);
  --ok: #be2d62;
  --warn: #b45309;
  --err: #dc2626;
  --shadow: 0 10px 30px rgba(20, 48, 42, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Atribut hidden harus selalu menang atas display (mis. display:flex di .update-banner) */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--body-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow: hidden;
}

::selection { background: var(--accent-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------- utilities -- */

.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.err-text { color: var(--err); }

/* ------------------------------------------------------- svg defs -- */

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* -------------------------------------------------------- layout -- */

.app { display: flex; height: 100vh; }

.sidebar {
  position: relative;
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-right: 1px solid var(--border);
  transition: width var(--tr);
  z-index: 40;
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 28px 44px;
}

/* ------------------------------------------------------ sidebar -- */

.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px 16px; }
.brand-mark { display: flex; align-items: center; flex-shrink: 0; }
.brand-mark svg,
.brand-mark img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; filter: drop-shadow(0 6px 14px rgba(var(--accent-rgb), 0.35)); }
.brand-text { min-width: 0; line-height: 1.2; }
.brand-text strong { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -0.3px; white-space: nowrap; }
.brand-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }

.side-toggle {
  position: absolute; right: -14px; top: 56px; z-index: 5;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2); border: 1px solid var(--border-strong);
  color: var(--muted); cursor: pointer;
  box-shadow: var(--shadow);
  transition: color var(--tr), background var(--tr), border-color var(--tr), transform var(--tr);
}
.side-toggle svg { width: 15px; height: 15px; transition: transform var(--tr); }
.side-toggle:hover { color: var(--accent); border-color: var(--accent); }
.side-toggle:active { transform: scale(0.92); }

.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 6px 10px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  text-align: left; cursor: pointer;
  transition: background var(--tr), color var(--tr);
  white-space: nowrap;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--accent-soft); color: var(--text); }
.nav-item:active { transform: translateY(0.5px); }
.nav-item.active {
  background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft));
  color: var(--text); font-weight: 600;
}
.nav-item.active svg { color: var(--accent); }

.side-foot { padding: 12px 10px 16px; border-top: 1px solid var(--border); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; min-width: 0; }
.side-user:hover { background: var(--card); }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft));
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.avatar svg { width: 17px; height: 17px; }
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.user-meta a {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted); text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-meta a svg { width: 12px; height: 12px; flex-shrink: 0; }
.user-meta a:hover { color: var(--accent); }

/* sidebar collapsed (icon-only) */
.app.sidebar-collapsed .sidebar { width: var(--sidebar-w-c); }
.app.sidebar-collapsed .side-brand { justify-content: center; padding: 18px 8px 16px; }
.app.sidebar-collapsed .brand-mark svg,
.app.sidebar-collapsed .brand-mark img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  filter: drop-shadow(0 2px 6px rgba(var(--accent-rgb), 0.22));
}
.app.sidebar-collapsed .brand-text,
.app.sidebar-collapsed .nav-item span,
.app.sidebar-collapsed .user-meta { display: none; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; position: relative; }

/* Tooltip nama halaman saat sidebar collapsed (icon-only) */
.app.sidebar-collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%);
  z-index: 70; pointer-events: none;
  background: var(--card2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: tipIn 0.15s ease;
}
@keyframes tipIn {
  from { opacity: 0; transform: translateY(-50%) translateX(-4px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.app.sidebar-collapsed .side-foot { padding: 12px 8px 16px; }
.app.sidebar-collapsed .side-user { justify-content: center; padding: 8px 0; }
.app.sidebar-collapsed .side-toggle { display: none; }
.app.sidebar-collapsed .side-brand { cursor: pointer; }

/* -------------------------------------------------------- topbar -- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px 12px;
  background: var(--topbar);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); min-width: 0; }
.crumb .sep { flex-shrink: 0; }
.crumb b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* --------------------------------------------------- page header -- */

.page { animation: pageIn 0.22s ease; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head { margin: 6px 0 20px; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------------------------------------------------------- card -- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
  transition: border-color var(--tr);
}

.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card-head.between { align-items: center; justify-content: space-between; }
.card-head .icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.card-head .icon svg { width: 17px; height: 17px; }
.card-head .icon.gold { background: var(--gold-soft); color: var(--gold); }
.card-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* --------------------------------------------------------- field -- */

.field { margin-top: 4px; }
.field > label, .field > .field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.pick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.label-value {
  font-size: 12.5px; color: var(--text); user-select: text;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; max-width: 100%;
}
.label-value.muted { color: var(--faint); }

/* -------------------------------------------------------- inputs -- */

input[type="text"], input[type="number"], select, textarea {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.num { width: 72px; }
input.dur { width: 132px; font-variant-numeric: tabular-nums; }
select { cursor: pointer; }

.opt-control { display: flex; align-items: center; gap: 8px; }
.opt-control .unit { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

/* --------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; line-height: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--tr), border-color var(--tr), color var(--tr),
              box-shadow var(--tr), transform 0.08s ease, opacity var(--tr);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35); }
.btn-primary:active:not(:disabled) { filter: brightness(0.96); }

.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--card2); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--card2); }

.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.35); color: var(--err); }
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.5); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { flex: 1; }

.btn.loading { pointer-events: none; }
.btn.loading svg { display: none; }
.btn.loading::before {
  content: ""; width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); background: var(--card2); border-color: var(--border-strong); }
.icon-btn.danger-ic:hover { color: var(--err); background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.4); }

@keyframes spin { to { transform: rotate(360deg); } }

/* tombol Periksa Update menyala bila ada update tersedia */
.btn.has-update {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-color: transparent; color: #fff; font-weight: 600;
  animation: update-pulse 2s ease-in-out infinite;
}
@keyframes update-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0); }
}

/* ---------------------------------------------------- update banner -- */

.update-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 28px 14px;
  padding: 11px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft));
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  font-size: 13px;
  animation: bannerIn 0.25s ease;
}
.update-banner span { flex: 1; }
.update-banner .btn { flex-shrink: 0; }

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------- playlist -- */

.playlist {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card2);
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
}
.playlist .empty { padding: 28px 16px; text-align: center; color: var(--faint); font-size: 13px; }

.vitem {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.vitem:last-child { border-bottom: none; }
.vitem:hover { background: rgba(255, 255, 255, 0.025); }
.vitem .num { width: 26px; color: var(--faint); font-size: 11px; text-align: right; flex-shrink: 0; }
.vitem .ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.vitem .dur {
  color: var(--faint); font-size: 11px; min-width: 58px; text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.vitem .views { display: flex; gap: 2px; opacity: 0.5; transition: opacity var(--tr); flex-shrink: 0; }
.vitem:hover .views { opacity: 1; }

.vitem.working .ttl { color: var(--text); }
.vitem.done .ttl { color: var(--ok); }
.vitem.error .ttl { color: var(--err); }

.mini {
  width: 24px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}
.mini svg { width: 13px; height: 13px; }
.mini:hover { background: var(--card2); color: var(--text); }
.mini.danger:hover { background: rgba(248, 113, 113, 0.12); color: var(--err); }

/* --------------------------------------------------------- accordion -- */

.accordion { margin-bottom: 16px; }
.accordion > summary {
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color var(--tr);
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { border-color: var(--border-strong); }
.accordion > summary .sum-ic { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.accordion > summary .chev { margin-left: auto; width: 15px; height: 15px; color: var(--faint); transition: transform var(--tr); flex-shrink: 0; }
.accordion[open] > summary .chev { transform: rotate(180deg); }
.opt-summary {
  font-weight: 400; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.accordion .acc-body {
  background: var(--card);
  border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 6px 18px 18px;
  margin-top: -1px;
}

.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 20px;
}
.opt { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.opt > label { font-size: 12px; color: var(--muted); }

.acc-actions { margin-top: 16px; display: flex; align-items: center; gap: 10px; }

/* ----------------------------------------------------------- status -- */

.status-card .row { gap: 12px; }
.status-text { font-size: 13.5px; font-weight: 600; }
.badge {
  font-size: 11.5px; color: var(--muted);
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 8px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--border);
  overflow: hidden; margin: 14px 0;
}
#bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--ok) 55%, var(--gold));
  border-radius: inherit;
  transition: width 0.25s ease;
}

#log {
  height: 150px; overflow-y: auto;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  color: var(--faint); user-select: text;
  white-space: pre-wrap; word-break: break-all;
}
#log .ok { color: var(--ok); }
#log .err { color: var(--err); }
#log .prog { color: var(--text); }
#log .muted { color: var(--faint); }

.status-actions { display: flex; gap: 10px; margin-top: 14px; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 10px; }
.hint b { color: var(--text); font-weight: 600; }

/* -------------------------------------------------------- dashboard -- */

.hero {
  display: flex; align-items: center; gap: 24px;
  padding: 28px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 55%),
    linear-gradient(315deg, var(--gold-soft), transparent 50%),
    var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.hero h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.hero p { color: var(--muted); margin-top: 6px; max-width: 460px; line-height: 1.55; font-size: 13.5px; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-art { margin-left: auto; flex-shrink: 0; }
.hero-art svg { width: 96px; height: 96px; opacity: 0.95; filter: drop-shadow(0 12px 28px rgba(var(--accent-rgb), 0.35)); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.stat-card {
  text-align: left; padding: 16px;
  border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; font-family: inherit; color: var(--text);
  transition: border-color var(--tr), transform 0.12s ease, box-shadow var(--tr);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card:active { transform: translateY(0); }
.stat-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 10px;
}
.stat-icon svg { width: 19px; height: 19px; }
.stat-card .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); }
.stat-card .v { display: block; font-size: 14px; font-weight: 600; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.step {
  display: flex; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px;
}
.step-n {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #062015; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.step strong { display: block; font-size: 13px; font-weight: 600; }
.step p { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* ------------------------------------------------------ empty state -- */

.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  background: var(--card);
}
.empty-icon {
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 14px;
}
.empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { font-size: 17px; font-weight: 700; }
.empty-state p { color: var(--muted); font-size: 13.5px; max-width: 400px; line-height: 1.55; margin-top: 6px; }
.empty-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }

/* ---------------------------------------------------------- settings -- */

.proj-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card);
  margin-bottom: 8px;
}
.proj-row:hover { background: var(--card-hover, var(--card2)); }
.proj-info { flex: 1; min-width: 0; }
.proj-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-meta { margin-top: 2px; }
.proj-actions { display: flex; gap: 6px; }

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 11px;
  margin-top: 6px;
}
.seg-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr), box-shadow var(--tr);
}
.seg-btn svg { width: 15px; height: 15px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.3);
}
.seg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.seg.locked .seg-btn:not(.active) { opacity: 0.4; cursor: not-allowed; }

.about-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.about-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 10px 12px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.about-row > span:first-child { color: var(--muted); flex-shrink: 0; }
.about-row > span:last-child, .about-row > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.about-row .err-text { color: var(--err); }

.link {
  color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
}
.link:hover { text-decoration: underline; }
.ic-inline { width: 13px; height: 13px; flex-shrink: 0; }

/* ------------------------------------------------------------- help -- */

.faq { margin-top: 6px; display: flex; flex-direction: column; }
.faq details {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card2); margin-bottom: 10px;
}
.faq summary {
  list-style: none;
  padding: 12px 16px; font-weight: 600; font-size: 13.5px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { margin-left: auto; width: 14px; height: 14px; color: var(--faint); transition: transform var(--tr); }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq .faq-body { padding: 0 16px 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ----------------------------------------------------------- toasts -- */

.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  min-width: 280px; max-width: 400px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  animation: toastIn 0.22s ease;
  pointer-events: auto;
}
.toast .t-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.toast .t-icon svg { width: 15px; height: 15px; }
.toast .t-msg { line-height: 1.4; }
.toast.success .t-icon { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.toast.error .t-icon { background: rgba(248, 113, 113, 0.15); color: var(--err); }
.toast.warn .t-icon { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.toast.info .t-icon { background: var(--accent-soft); color: var(--accent); }
.toast.out { animation: toastOut 0.18s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* ------------------------------------------------------ responsive -- */

@media (max-width: 940px) {
  /* sidebar dikelola JS: matchMedia menambah class .sidebar-collapsed */
}

@media (max-width: 720px) {
  .content { padding: 8px 16px 40px; }
  .topbar { padding: 14px 16px 12px; }
  .update-banner { margin: 0 16px 14px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-art { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.playlist-item { cursor: grab; }
.playlist-item:active { cursor: grabbing; }
.playlist-item.dragging { opacity: 0.45; border-style: dashed; }
.playlist-item.drag-over { border-top: 2px solid var(--accent); }
.playlist-item.playing { background: var(--accent-soft); }
.playlist-item.playing .num { color: var(--accent); font-weight: 800; }

/* ---- tombol play per lagu + drag & drop playlist ---- */
.rowplay { display: inline-flex; align-items: center; }
.rowplay .mini.play {
  color: var(--muted);
}
.rowplay .mini.play:hover { color: var(--accent); border-color: var(--accent); }
.playlist-item.playing .rowplay .mini.play {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}
.playlist-item { cursor: grab; }
.playlist-item:active { cursor: grabbing; }
.playlist-item.dragging { opacity: 0.45; border-style: dashed; }
.playlist-item.drag-over { border-top: 2px solid var(--accent); }
.playlist-item.playing { background: var(--accent-soft); }
.playlist-item.playing .num { color: var(--accent); font-weight: 800; }

/* Volume popover Suno-style (ikon speaker + slider vertikal mengambang) */
.vol-group { display: inline-flex; align-items: center; }
.vol-btn.active { color: var(--accent); border-color: var(--accent); }
.vol-popover {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  background: #23232e;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.vol-popover[hidden] { display: none; }
.vol-pop-label {
  font-size: 11px;
  font-weight: 600;
  color: #ff4d6d;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.vol-track {
  position: relative;
  width: 6px;
  height: 130px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
}
.vol-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ff4d6d;
  border-radius: 999px;
}
.vol-thumb {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, 50%);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
html[data-theme="light"] .vol-popover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] .vol-track { background: rgba(0, 0, 0, 0.15); }

/* Halaman Projects */
.projects-actions { margin: 12px 0 20px; display: flex; gap: 8px; }
.proj-list { display: flex; flex-direction: column; gap: 10px; }
.proj-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 14px 16px; border-radius: 10px; background: var(--card);
  border: 1px solid var(--line);
}
.proj-title { font-weight: 600; }
.proj-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.proj-actions { display: flex; gap: 6px; align-items: center; }

/* Modal inline (pengganti window.prompt yang diblokir Electron) */
.grp-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
}
.grp-modal-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; min-width: 340px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.grp-modal-card h3 { margin: 0 0 10px; }
.grp-modal-card input {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  color: inherit; font-size: 14px; outline: none;
}
.grp-modal-card input:focus { border-color: var(--accent); }
.grp-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px;
}

.proj-actions button:disabled { opacity: .45; cursor: not-allowed; }

/* Banner project aktif di halaman Create */
.proj-banner {
  display: none; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent); font-size: 13px; margin-bottom: 14px;
}
.proj-banner.show { display: block; }

/* --------------------------------------------- dialog input nama -- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFade 0.16s ease;
}
.modal-card {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modalPop 0.18s ease;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: -6px; }
.modal-card input { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }

@keyframes modalFade { from { opacity: 0; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
