/* Ditmedia Production Hub — gaya dasar
   Arah: ruang produksi yang tenang. Navy + putih, garis tipis, angka kuota besar
   bergaya kredit film (Antonio) sebagai satu-satunya elemen yang "berbicara keras". */

:root {
  --ink: #0B1B3F;          /* navy: teks utama, sidebar */
  --ink-2: #33415C;
  --muted: #5A6376;        /* teks sekunder (kontras 5.9:1 di putih) */
  --blue: #002DA6;         /* warna brand Ditmedia: aksi utama */
  --blue-700: #00227F;
  --blue-50: #EAF0FF;
  --paper: #F5F6F8;        /* latar off-white dingin */
  --surface: #FFFFFF;
  --line: #DCE0E7;
  --line-2: #EEF0F4;
  --ok: #1A6B34;  --ok-bg: #E6F4EA;
  --warn: #7A4F00; --warn-bg: #FFF1CF;
  --bad: #B42318; --bad-bg: #FDECEA;
  --radius-s: 6px; --radius-m: 10px;
  --shadow: 0 1px 2px rgba(11, 27, 63, .06), 0 4px 16px rgba(11, 27, 63, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Antonio", "Arial Narrow", "Roboto Condensed", sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--ink); background: var(--paper);
}
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Kerangka ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--ink); }
.brand img { height: 22px; width: auto; }
.brand .word { font-family: var(--display); font-size: 20px; letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px;
}
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 32px); }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; min-height: 44px;
}
.bottomnav a[aria-current="page"] { color: var(--blue); }
.bottomnav a[aria-current="page"] .icon { stroke-width: 2.2; }
.sidenav { display: none; }

@media (min-width: 1024px) {
  .shell { flex-direction: row; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; width: 232px; flex: none;
    padding: 20px 12px; background: var(--ink); color: #C9D3EA;
  }
  .sidenav .brand { color: #fff; padding: 4px 10px 20px; }
  .sidenav .brand img { filter: brightness(0) invert(1); }
  .sidenav a.nav {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s);
    color: inherit; text-decoration: none; font-weight: 500;
  }
  .sidenav a.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
  .sidenav a.nav[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
  .sidenav .grow { flex: 1; }
  .sidenav .who { padding: 10px 12px; font-size: 14px; border-top: 1px solid rgba(255,255,255,.12); }
  .content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar .brand { display: none; }
  .bottomnav { display: none; }
  .main { padding: 28px 32px 48px; }
}

/* ---------- Tipografi ---------- */
h1 { font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.1; letter-spacing: .01em; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head .lede { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-size: 14px; min-height: 44px; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; touch-action: manipulation;
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.btn:hover { border-color: #B8C0CE; }
.btn:active { background: var(--line-2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-700); }
.btn.danger { color: var(--bad); border-color: #F3C4BF; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Panel & daftar ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; margin-bottom: 16px; }
.panel > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel > h2 .count { font-family: var(--display); font-size: 22px; color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line-2); }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 56px;
  color: inherit; text-decoration: none;
}
a.row:hover { background: var(--paper); }
.row .main-txt { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .sub { font-size: 14px; color: var(--muted); }
.row .code { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 20px 4px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Status (selalu teks + warna) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--blue-50); color: var(--blue); }

/* ---------- Kuota: angka kredit film + tanda per deliverable ---------- */
.quota { display: grid; gap: 16px; }
@media (min-width: 640px) { .quota { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.qblock { padding: 4px 0; }
.qhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qfigure { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.qfigure .of { color: var(--muted); font-size: 28px; }
.qlabel { font-weight: 600; }
.ticks { display: flex; flex-wrap: wrap; gap: 3px; margin: 10px 0 6px; }
.tick { width: 14px; height: 18px; border-radius: 2px; background: var(--line-2); border: 1px solid var(--line); }
.tick.done { background: var(--ink); border-color: var(--ink); }
.tick.appr { background: repeating-linear-gradient(135deg, var(--blue) 0 2px, transparent 2px 5px); border-color: var(--blue); }
.qlegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }

/* ---------- Formulir ---------- */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--bad); }
.req { color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #C5CCD8; border-radius: var(--radius-s); background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 45, 166, .18); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; }
.choice input { width: 20px; height: 20px; margin-top: 2px; }

/* ---------- Filter & tab ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters select { width: auto; min-width: 140px; flex: 1 1 140px; }
.stagebar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.stagebar a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
}
.stagebar a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.stagebar .n { font-variant-numeric: tabular-nums; color: inherit; opacity: .75; }

/* ---------- Detail konten ---------- */
.pipeline { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; padding: 0; list-style: none; }
.pipeline li { font-size: 13px; padding: 4px 8px; border-radius: 4px; color: var(--muted); background: var(--line-2); }
.pipeline li.done { color: var(--ink-2); background: #E3E8F2; }
.pipeline li.now { color: #fff; background: var(--blue); font-weight: 600; }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: var(--blue-50); color: var(--ink); font-size: 14px; margin-bottom: 16px; }
.notice.warn { background: var(--warn-bg); }
.notice.bad { background: var(--bad-bg); }

/* ---------- Dialog, toast, loading ---------- */
dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: var(--radius-m);
  padding: 0; box-shadow: var(--shadow); color: var(--ink);
}
dialog::backdrop { background: rgba(11, 27, 63, .5); }
dialog form { padding: 20px; display: grid; gap: 14px; }
dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; }
}
.toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(480px, calc(100vw - 24px)); }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast { padding: 12px 14px; border-radius: var(--radius-s); background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 15px; }
.toast.bad { background: var(--bad); }
.skeleton { height: 56px; border-radius: var(--radius-s); background: linear-gradient(90deg, var(--line-2), #F9FAFB, var(--line-2)); background-size: 200% 100%; animation: sh 1.2s infinite linear; margin-bottom: 8px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: var(--radius-m); padding: 28px 24px; }
.login-card img { height: 26px; margin-bottom: 20px; }
.login-card h1 { font-size: 30px; }

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