/* Studio Konten — gaya minimalis 3D (v4). Tema lewat atribut data-theme. */
:root,
[data-theme="terang"] {
  --bg: #e8e3da; --fg: #2b2622; --muted: #6f665c; --acc: #e8643a;
  --accGrad: linear-gradient(145deg, #f27d55, #d9532a); --ink: #ffffff; --frame: #16130f;
  --raise: 12px 12px 26px #c6c0b4, -12px -12px 26px #fffdf8;
  --raiseSm: 5px 5px 12px #c6c0b4, -5px -5px 12px #fffdf8;
  --sink: inset 5px 5px 12px #c9c3b8, inset -5px -5px 12px #fffdf8;
  --okBg: #d6e5d1; --okFg: #2d6a3a; --warnBg: #efdfba; --warnFg: #7a5a12;
  --infoBg: #d7dcef; --infoFg: #33478f; --badBg: #f0d1c9; --badFg: #98342a;
  --accText: #b43f1b;
}
[data-theme="gelap"] {
  --bg: #1e1c1b; --fg: #f3eee8; --muted: #a39b92; --acc: #ff8a4c;
  --accGrad: linear-gradient(145deg, #ffa36b, #f2702f); --ink: #2a1204; --frame: #0b0a09;
  --raise: 12px 12px 26px #0f0e0d, -10px -10px 24px #2d2a28;
  --raiseSm: 5px 5px 12px #0f0e0d, -4px -4px 10px #2d2a28;
  --sink: inset 5px 5px 12px #0f0e0d, inset -4px -4px 10px #2d2a28;
  --okBg: #28362b; --okFg: #a9dfb4; --warnBg: #3b3222; --warnFg: #f0cd85;
  --infoBg: #262c3d; --infoFg: #aebdf5; --badBg: #3d2523; --badFg: #ffb0a6;
  --accText: #ffb48a;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
[data-theme="gelap"] { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.err { color: var(--badFg); }
.ok-text { color: var(--okFg); font-weight: 600; }
.lbl { font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; font-weight: 600; }
.h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 18px; }

/* ---------- Permukaan ---------- */
.raise { background: var(--bg); box-shadow: var(--raise); border-radius: 24px; }
.well { background: var(--bg); box-shadow: var(--sink); border-radius: 16px; }
.pad { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.pad-sm { padding: 18px; display: flex; flex-direction: column; gap: 10px; border-radius: 22px; }

/* ---------- Bar atas ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 40px;
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px; background: var(--accGrad); box-shadow: var(--raiseSm);
  display: flex; align-items: center; justify-content: center; color: var(--ink); flex: none;
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 22px; line-height: 1.1; }
.nav { display: flex; gap: 4px; padding: 5px; border-radius: 20px; background: var(--bg); box-shadow: var(--sink); }
.nav a {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 15px;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.nav a.on { background: var(--accGrad); color: var(--ink); box-shadow: var(--raiseSm); }
.top-right { display: flex; align-items: center; gap: 12px; }
.logout { margin: 0; }
.job-pill { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Kontrol ---------- */
.seg { display: flex; gap: 4px; padding: 5px; border-radius: 16px; background: var(--bg); box-shadow: var(--sink); }
.segbtn {
  min-height: 38px; padding: 0 14px; border-radius: 12px; border: 0; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.segbtn.on { background: var(--accGrad); color: var(--ink); box-shadow: var(--raiseSm); }
.btn {
  min-height: 44px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--bg);
  box-shadow: var(--raiseSm); color: var(--fg); font-size: 13px; font-weight: 600;
}
.btn:active:not(:disabled) { box-shadow: var(--sink); }
.btn-sm { min-height: 38px; padding: 0 14px; }
.cta {
  min-height: 52px; padding: 0 24px; border-radius: 16px; border: 0; background: var(--accGrad);
  box-shadow: var(--raiseSm); color: var(--ink); font-size: 15px; font-weight: 700;
}
.cta:active { box-shadow: var(--sink); }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap;
}
.chip.sm { min-height: 26px; padding: 0 10px; white-space: normal; }
.chip.ok { background: var(--okBg); color: var(--okFg); }
.chip.warn { background: var(--warnBg); color: var(--warnFg); }
.chip.info { background: var(--infoBg); color: var(--infoFg); }
.chip.bad { background: var(--badBg); color: var(--badFg); }
.chip.acc { background: var(--accGrad); color: var(--ink); box-shadow: var(--raiseSm); }
.chip.mute { background: var(--bg); box-shadow: var(--sink); }

.field {
  width: 100%; min-height: 44px; padding: 12px 14px; border: 0; border-radius: 14px;
  background: var(--bg); color: var(--fg); outline: none;
}
.well-in { box-shadow: var(--sink); }
textarea.field { resize: vertical; line-height: 1.5; }
.field:focus-visible { outline: 2px solid var(--acc); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.check input { width: 20px; height: 20px; accent-color: var(--acc); }

.switch {
  flex: none; width: 56px; height: 32px; padding: 3px; border-radius: 999px; border: 0;
  background: var(--bg); box-shadow: var(--sink); display: flex; align-items: center;
}
.switch span { width: 26px; height: 26px; border-radius: 50%; background: var(--muted); transition: transform 0.18s, background 0.18s; }
.switch.on span { transform: translateX(24px); background: var(--accGrad); box-shadow: var(--raiseSm); }

.bar { height: 14px; padding: 3px; border-radius: 999px; background: var(--bg); box-shadow: var(--sink); }
.bar span { display: block; height: 100%; min-width: 6px; border-radius: 999px; background: var(--accGrad); }

/* ---------- Tata letak halaman ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 8px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 34px; letter-spacing: -0.02em; margin: 0; }
.job-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.stage-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage-center { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 12px 0; }
.stack-center { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 420px; }

/* Telepon 3D */
.phone-3d { perspective: 1100px; padding: 10px 24px; }
.phone-3d::before { content: none; }
.phone-3d > .phone-3d-screen {
  width: 250px; height: 470px; border-radius: 30px; padding: 16px; position: relative;
  background: linear-gradient(170deg, #1b1917, #080706); color: #f4efe9;
  border: 9px solid #1a1817; box-shadow: 26px 32px 50px rgba(0, 0, 0, 0.38), -3px -3px 10px rgba(255, 255, 255, 0.08);
  transform: rotateY(-14deg) rotateX(4deg);
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
}
.phone-3d-sm > .phone-3d-screen { width: 180px; height: 280px; padding: 12px; }
.phone-note { font-size: 13px; color: #b9b2aa; }
.phone-cap { font-size: 12px; color: #b9b2aa; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 8px 0; }

/* Kesiapan */
.ready-list { display: flex; flex-direction: column; gap: 14px; }
.ready-item { display: flex; align-items: center; gap: 12px; }
.ready-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ready-text strong { font-size: 13.5px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: var(--raiseSm); }
.dot.ok { background: var(--okFg); }
.dot.warn { background: var(--warnFg); }

/* Proses */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-item { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }

/* Momen */
.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-item { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }

/* Antrian */
.board-wrap { display: flex; flex-direction: column; gap: 26px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px;
  border-radius: 20px; background: var(--bg); box-shadow: var(--raiseSm);
}
.day.today { box-shadow: var(--sink); }
.day-n { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 24px; }
.day.today .day-n { color: var(--acc); }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.kcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.empty-card { padding: 22px; text-align: center; }
.post-head { display: flex; gap: 12px; align-items: center; }
.thumb {
  flex: none; width: 44px; height: 78px; border-radius: 12px; background: var(--frame); box-shadow: var(--sink);
  color: #9a948c; font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.post-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Akun */
.acc-row { display: flex; flex-direction: column; gap: 8px; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ring {
  width: 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--acc) 0 var(--deg), transparent var(--deg) 360deg), var(--bg); box-shadow: var(--sink);
}
.ring-in {
  width: 116px; height: 116px; border-radius: 50%; background: var(--bg); box-shadow: var(--raiseSm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-in strong { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 24px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; margin-top: 4px; }
.cabang { padding: 16px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.brand-box { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.logo-prev { max-width: 140px; max-height: 80px; object-fit: contain; align-self: flex-start; background: var(--frame); border-radius: 12px; padding: 8px; }

/* Toast dan dialog konfirmasi */
.toasts { position: fixed; top: 84px; right: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  padding: 14px 18px; border-radius: 16px; background: var(--bg); box-shadow: var(--raise); font-weight: 600;
  border-left: 5px solid var(--infoFg); animation: tin 0.2s ease-out;
}
.toast.ok { border-left-color: var(--okFg); }
.toast.bad { border-left-color: var(--badFg); }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(400px, 100%); padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* Halaman masuk */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(380px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.login-brand { margin-bottom: 8px; }
.login-error { color: var(--badFg); font-weight: 600; }

/* ---------- Ponsel: menu pindah ke footer ---------- */
@media (max-width: 1100px) {
  .stage-grid { grid-template-columns: 1fr; }
  .stage-center { order: -1; }
  .kanban { grid-template-columns: 1fr; }
  .two-col, .cards-2, .brand-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { padding-bottom: 104px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .brand-text small { display: none; }
  .brand-mark { width: 40px; height: 40px; border-radius: 14px; }
  .brand-text strong { font-size: 18px; }
  .nav {
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 30; padding: 8px; gap: 6px;
    border-radius: 26px; background: var(--bg); box-shadow: var(--raise);
  }
  .nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 0 4px; border-radius: 18px; font-size: 11px; }
  .nav-long { display: none; }
  .wrap { padding: 4px 16px 32px; }
  .page-title { font-size: 26px; }
  .phone-3d > .phone-3d-screen { width: 190px; height: 340px; }
  .phone-3d-sm > .phone-3d-screen { width: 160px; height: 240px; }
  .job-pill { display: none; }
  .logout { display: none; }
  .week { grid-template-columns: repeat(7, minmax(72px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .day span { white-space: nowrap; }
  .toasts { top: 70px; right: 16px; }
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .switch span, .toast { transition: none; animation: none; }
}

/* ---------- Editor potong klip ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.ed-clips { grid-column: 1 / -1; }
.ed-stage { position: relative; border-radius: 18px; overflow: hidden; background: #000; box-shadow: var(--sink); }
.ed-stage video { display: block; width: 100%; max-height: 62vh; background: #000; }
.ed-frame { position: absolute; border: 2px solid var(--acc); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); pointer-events: none; border-radius: 6px; }
.ed-frame .chip { position: absolute; top: 8px; left: 8px; }
.ed-times { display: flex; flex-wrap: wrap; gap: 10px; }
.ed-form { display: flex; flex-direction: column; gap: 14px; }
.ed-form input[type=range] { width: 100%; margin-top: 10px; accent-color: var(--acc); }
.clip-prev { width: 100%; max-width: 220px; border-radius: 14px; background: #000; }
@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } }
.page-head a { color: var(--acc); font-weight: 600; text-decoration: none; }
.page-head a:hover { text-decoration: underline; }

/* ---------- Kandidat, hook, caption ---------- */
.cand-actions { flex-wrap: wrap; gap: 10px; }
.cand-actions select { max-width: 180px; min-height: 38px; }
.hook-opt { cursor: pointer; }
.hook-opt input { accent-color: var(--acc); }
.hook-box { display: flex; flex-direction: column; gap: 10px; }
.clip-prev.big { max-width: 300px; }
.cap-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cap-style { position: relative; cursor: pointer; display: inline-flex; align-items: center; }
.cap-style input { position: absolute; opacity: 0; inset: 0; }
.cap-style:has(input:checked) { background: var(--accGrad); color: var(--ink); box-shadow: var(--raiseSm); }
.cap-style:has(input:focus-visible) { outline: 2px solid var(--acc); }
.cap-ta { display: none; min-height: 110px; }
.cap-card:has(input[value=santai]:checked) .cap-santai,
.cap-card:has(input[value=promo]:checked) .cap-promo,
.cap-card:has(input[value=informatif]:checked) .cap-informatif { display: block; }
.cap-final { white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 8px 0 0; color: var(--muted); }
a.btn, a.cta { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
