/* DistroHub — dark theme elegan ala aplikasi musik pro */
:root {
  --bg: #0a0e14;
  --bg-soft: #0f1420;
  --card: #131a29;
  --card-2: #182032;
  --border: #232d44;
  --text: #eef2fa;
  --muted: #8b94a9;
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, .14);
  --accent-2: #8b5cf6;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0;
  background: linear-gradient(180deg, #0d1220, #0a0e14);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; font-size: 22px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; text-decoration: none;
  color: var(--muted); font-weight: 600; transition: all .15s;
}
.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px;
}
.api-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.api-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: rgba(10, 14, 20, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.page-title { margin: 0; font-size: 21px; font-weight: 800; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.icon-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; width: 38px; height: 38px; font-size: 17px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.content { padding: 26px; max-width: 1240px; width: 100%; margin: 0 auto; }

/* ---------- Auth ---------- */
body.auth .sidebar, body.auth .topbar { display: none; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 6px; font-size: 24px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-alt a { color: var(--accent); font-weight: 600; }

/* ---------- Cards / stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: linear-gradient(160deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: .9;
}
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.stat-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 17px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 10px 12px; color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: rgba(255,255,255,.02); }
.cell-title { font-weight: 700; }
.cell-sub { color: var(--muted); font-size: 13px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--card-2); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-draft { background: #374151; color: #d1d5db; }
.badge-submitted { background: rgba(59,130,246,.16); color: #93c5fd; }
.badge-in_review { background: rgba(245,158,11,.16); color: #fcd34d; }
.badge-delivered { background: rgba(139,92,246,.18); color: #c4b5fd; }
.badge-live { background: var(--accent-soft); color: #34d399; }
.badge-takedown_requested { background: rgba(249,115,22,.16); color: #fdba74; }
.badge-taken_down, .badge-rejected, .badge-failed { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-queued { background: #374151; color: #d1d5db; }
.badge-sent { background: rgba(59,130,246,.16); color: #93c5fd; }
.badge-paid { background: var(--accent-soft); color: #34d399; }
.badge-requested { background: rgba(245,158,11,.16); color: #fcd34d; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 11px 13px; font-size: 14px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.check-row input { width: auto; accent-color: var(--accent); }
.form-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; border-radius: 10px; padding: 11px 14px; margin-bottom: 15px; font-size: 14px; display: none; }
.form-error.show { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; padding: 11px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform .08s, filter .15s;
  font-family: inherit; color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #0ea472); color: #04120c; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--card-2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.5); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.22); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 26px; }
.step { flex: 1; text-align: center; padding: 12px 6px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--muted); }
.step .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); margin-right: 6px; font-size: 12px; }
.step.active { border-color: var(--accent); color: var(--text); }
.step.active .n { background: var(--accent); color: #04120c; border-color: var(--accent); }
.step.done { color: var(--accent); }
.step.done .n { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ---------- Tracks ---------- */
.track-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: var(--bg-soft);
}
.track-num { width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.track-info { flex: 1; min-width: 0; }
.track-title { font-weight: 700; }
.track-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.track-audio-ok { color: var(--accent); font-size: 13px; font-weight: 700; }
.track-audio-no { color: var(--warning); font-size: 13px; font-weight: 700; }
.upload-zone { display: flex; align-items: center; gap: 10px; }
.progress { height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .2s; }
audio.player { width: 100%; margin-top: 8px; height: 36px; }

/* ---------- Delivery ---------- */
.delivery { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.delivery:last-child { border-bottom: none; }
.delivery-name { width: 150px; font-weight: 700; flex-shrink: 0; }
.delivery-steps { display: flex; gap: 5px; flex: 1; }
.dstep { flex: 1; height: 8px; border-radius: 99px; background: var(--card-2); }
.dstep.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.dstep.fail { background: var(--danger); }
.delivery-time { color: var(--muted); font-size: 12px; width: 130px; text-align: right; flex-shrink: 0; }

/* ---------- Detail header ---------- */
.detail-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.cover-lg { width: 200px; height: 200px; border-radius: 16px; object-fit: cover; background: var(--card-2); border: 1px solid var(--border); box-shadow: var(--shadow); }
.detail-info { flex: 1; min-width: 260px; }
.detail-info h2 { margin: 0 0 6px; font-size: 26px; }
.detail-info .artist { color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.info-item { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; }
.info-item .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.info-item .v { font-weight: 700; margin-top: 3px; }

/* ---------- Artists ---------- */
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.artist-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.artist-card h4 { margin: 0 0 4px; font-size: 17px; }
.artist-card .type { color: var(--accent); font-size: 13px; font-weight: 700; }
.artist-card .bio { color: var(--muted); font-size: 13px; margin: 10px 0; min-height: 38px; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card-2); border: 1px solid var(--border); border-left: 4px solid var(--info);
  color: var(--text); padding: 13px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); max-width: 360px; animation: slideIn .25s ease;
}
.toast.success { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,7,12,.7); backdrop-filter: blur(4px); z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 28px; width: 100%; max-width: 480px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 18px; }

/* ---------- Misc ---------- */
.spinner { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner::after { content: ""; display: block; width: 38px; height: 38px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.notfound { text-align: center; padding: 80px 20px; }
.notfound h2 { font-size: 56px; margin: 0; }
.check-list { list-style: none; padding: 0; margin: 14px 0; }
.check-list li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.check-list li:last-child { border: none; }
.check-ok { color: var(--accent); font-weight: 800; margin-right: 8px; }
.check-no { color: var(--danger); font-weight: 800; margin-right: 8px; }
.review-cover { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.cover-preview { max-width: 280px; border-radius: 14px; border: 1px solid var(--border); margin-top: 12px; display: block; }
.mt { margin-top: 16px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .menu-toggle { display: block; }
  .field-row, .field-row3 { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .detail-head { flex-direction: column; }
  .delivery-name { width: 110px; }
  .delivery-time { display: none; }
}

/* File input yang disembunyikan visual tapi tetap ada di accessibility tree
   (jangan pakai [hidden]/display:none — label tidak bisa diaktivasi keyboard/automation) */
.file-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0;
}
label.upload-label { position: relative; }
label.upload-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
