@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/PlusJakartaSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/PlusJakartaSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/PlusJakartaSans-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #f4efe6;
  --surface: #fffdf8;
  --text: #1d1a16;
  --muted: #5e574e;
  --border: #e3d9c8;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, white);
  --sidebar: #17140f;
  --sidebar-text: #f6f1e8;
  --danger: #9f2d2d;
  --warning: #9a5b12;
  --success: #0f6e56;
  --radius: 16px;
  --shadow: 0 16px 40px rgba(40, 28, 12, 0.06);
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --navw: 248px;
}

html.dark {
  --bg: #12100e;
  --surface: #1c1916;
  --text: #f6f1e8;
  --muted: #c4b8a8;
  --border: #3a332b;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, #1c1916);
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at -10% -20%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, [role="button"], a.btn { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, white); outline-offset: 2px; }
a { color: var(--accent); }
img { max-width: 100%; }

.layout { display: grid; grid-template-columns: var(--navw) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; text-decoration: none; color: inherit; }
.mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800;
}
.brand b { display: block; font-size: 16px; letter-spacing: -0.03em; }
.brand small { color: #b7ad9f; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: #ddd4c6; text-decoration: none;
  min-height: 44px; padding: 0 12px; border-radius: 12px;
}
.nav a.on, .nav a:hover { background: #2a241c; color: white; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid #2e2820; color: #b7ad9f; font-size: 13px; }

.shell { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
}
.grow { flex: 1; }
.ws-switch { display: flex; align-items: center; gap: 8px; }
.ws-switch select, select, input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="color"], textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
}
textarea { min-height: 88px; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
label.field span.hint { font-weight: 400; color: var(--muted); }
.icon-btn, .btn {
  min-height: 44px; border-radius: 12px; border: 1px solid transparent;
  padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; background: transparent; color: var(--text);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-ghost { border-color: var(--border); background: var(--surface); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; padding: 0; border: 1px solid var(--border); background: var(--surface); }

.page { padding: 8px 22px 96px; max-width: 1180px; }
.kicker { margin: 0; letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; color: var(--accent); font-weight: 700; }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -0.04em; margin: 4px 0 8px; }
h2 { font-size: 20px; letter-spacing: -0.03em; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0; max-width: 62ch; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 22px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat span, .muted { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 32px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 12px; margin-top: 12px; }
.card { padding: 18px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars i {
  display: block; flex: 1; border-radius: 8px 8px 3px 3px;
  background: var(--accent); min-height: 4px; position: relative;
}
.bars i em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--muted); }
.bars b { display: block; text-align: center; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }

.list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list a, .row-link {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  text-decoration: none; color: inherit; padding: 10px 0; border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--text);
}
.badge.gagal, .badge.ditolak, .badge.late { background: #f8d7d2; color: #6d2018; }
.badge.acc, .badge.diposting, .badge.sukses { background: #d9f2e8; color: #0d4f3c; }
.badge.siap_review, .badge.menunggu, .badge.soon { background: #fde7c7; color: #6d4308; }
.badge.rendering, .badge.antre_render { background: #d9e6fb; color: #1a3f78; }
html.dark .badge.gagal, html.dark .badge.ditolak { background: #4a2420; color: #ffd2cb; }
html.dark .badge.acc, html.dark .badge.diposting { background: #1a3b32; color: #c8f3e2; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
tr.soon td:first-child { box-shadow: inset 3px 0 0 #d0892a; }
tr.late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }
.scene {
  display: grid; grid-template-columns: 88px 1fr; gap: 12px;
  padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); margin-bottom: 12px;
}
.scene-no {
  width: 88px; height: 120px; border-radius: 12px; background: #1d1a16; color: white;
  display: grid; place-items: center; font-weight: 800;
}
.scene-no img, .scene-no video { width: 88px; height: 120px; object-fit: cover; border-radius: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.toast {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; background: var(--accent-soft);
}
.toast.err { background: #f8d7d2; color: #6d2018; }
.player { width: min(100%, 360px); background: black; border-radius: 16px; }
.player.wide { width: min(100%, 640px); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { text-decoration: none; }
.stock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stock-grid button { padding: 0; border: 0; background: transparent; }
.stock-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.help { float: right; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps i { height: 6px; flex: 1; border-radius: 99px; background: var(--border); }
.steps i.on { background: var(--accent); }

.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; min-height: 44px; display: grid; place-items: center; }
.tabbar a.on { color: var(--accent); }
.menu-btn { display: none; }
.drawer-bg { display: none; }

@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; z-index: 30; width: min(86vw, 300px); }
  .sidebar.open { display: flex; }
  .drawer-bg.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .tabbar { display: flex; }
  .menu-btn { display: inline-flex; }
  h1 { font-size: 32px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
}
