/* Miraz UI (rencana bagian 1). Sumber: shared/miraz-ui.css, disalin oleh `node shared/sync.mjs`; ubah HANYA di shared/.
   Workshop/Sprint: @import "./miraz-ui.css" setelah Tailwind. Mitra: <link rel="stylesheet" href="/miraz-ui.css">.
   Ikon: <svg class="m-ico" aria-hidden="true"><use href="/icons.svg#check"/></svg>. Tanpa mode gelap. */

@font-face { font-family: Geist; src: url(/fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f9fafb; --surface: #fff; --ink: #111827; --ink-2: #374151; --mute: #6b7280; --line: #e5e7eb; --line-2: #d1d5db;
  --pri: #2563eb; --pri-hover: #1d4ed8; --pri-soft: #eff6ff;
  --ai: #7e22ce; --ai-soft: #faf5ff; --ai-line: #e9d5ff;
  --ok: #15803d; --ok-bg: #dcfce7; --proses: #1d4ed8; --proses-bg: #dbeafe; --tunggu: #a16207; --tunggu-bg: #fef9c3;
  --gagal: #b91c1c; --gagal-bg: #fee2e2; --netral: #4b5563; --netral-bg: #f3f4f6;
  --r-ctl: 8px; --r-card: 12px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;
  --w-page: 1024px; --w-form: 672px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05);
  --grad: linear-gradient(135deg, #22d3ee, #6366f1 55%, #a855f7);
  --sans: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
.m-h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -.01em; }
.m-h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.m-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.m-small { font-size: 12px; line-height: 16px; color: var(--mute); }
.m-mute { color: var(--mute); }
.m-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-rp { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; } /* boleh turun baris, tidak elipsis */
.m-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.m-ico-lg { width: 20px; height: 20px; }
.m-ico-xl { width: 32px; height: 32px; stroke-width: 1.5; }
.m-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(a) { color: var(--pri); text-decoration: none; }
:where(a):hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }

/* ---------- tata letak ---------- */
.m-page { width: 100%; max-width: calc(var(--w-page) + 2 * var(--s4)); margin: 0 auto; padding: var(--s6) var(--s4) var(--s8); }
.m-page-form { max-width: calc(var(--w-form) + 2 * var(--s4)); }
.m-stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.m-section { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s6); }
.m-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
.m-spacer { flex: 1; }
.m-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .m-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .m-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .m-grid-side { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .m-sticky { position: sticky; top: var(--s4); } }

/* ---------- header app + benang merah ---------- */
.m-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.m-top-in { display: flex; align-items: center; gap: var(--s3); height: 56px; max-width: calc(var(--w-page) + 2 * var(--s4)); margin: 0 auto; padding: 0 var(--s4); }
.m-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; }
.m-brand:hover { text-decoration: none; }
.m-logo { width: 28px; height: 28px; flex: none; display: block; } /* logo.svg = file yang sama dengan miraz.id (shared/logo.svg) */
.m-brand-app { color: var(--mute); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-who { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 50%; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--surface); }
.m-who > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--pri-soft); color: var(--pri); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.m-role { font-size: 12px; color: var(--mute); font-weight: 500; }
.m-thread { border-top: 1px solid var(--line); background: #fcfcfd; }
.m-thread ol { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0 auto; padding: 0 var(--s4); height: 40px; max-width: calc(var(--w-page) + 2 * var(--s4)); overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: 13px; color: var(--mute); }
.m-thread ol::-webkit-scrollbar { display: none; }
.m-thread li { display: inline-flex; align-items: center; gap: 2px; }
.m-thread li + li::before { content: ""; width: 14px; height: 14px; margin: 0 4px; background: currentColor; opacity: .5; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9.5 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9.5 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
.m-thread a { color: var(--mute); padding: 4px 6px; border-radius: 6px; }
.m-thread a:hover { color: var(--ink); background: var(--netral-bg); text-decoration: none; }
.m-thread [aria-current] { color: var(--ink); font-weight: 600; padding: 4px 6px; }
.m-code { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }

/* ---------- judul halaman ---------- */
.m-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-bottom: var(--s2); color: var(--mute); font-size: 14px; font-weight: 500; }
.m-back:hover { color: var(--ink); text-decoration: none; }
.m-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-bottom: var(--s6); }
.m-head-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-width: 0; flex: 1 1 280px; }
.m-head-title .m-h1 { overflow-wrap: anywhere; }
.m-head-sub { flex-basis: 100%; margin: 0; color: var(--mute); font-size: 14px; }
.m-head-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 639px) { .m-head-actions { width: 100%; } .m-head-actions > * { flex: 1 1 auto; } }

/* ---------- kartu ---------- */
.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--s4); min-width: 0; }
@media (min-width: 640px) { .m-card { padding: var(--s6); } }
.m-card-flush { padding: 0; overflow: hidden; }
.m-card-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); min-width: 0; }
.m-card-head .m-h2 { flex: 1; min-width: 0; }
.m-card-head > .m-ico { color: var(--mute); width: 20px; height: 20px; }
.m-card-foot { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.m-card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
.m-card-link:hover { border-color: var(--line-2); box-shadow: 0 2px 8px rgb(0 0 0 / .06); text-decoration: none; }
.m-divider { height: 1px; background: var(--line); margin: var(--s4) 0; border: 0; }

/* ---------- tombol ---------- */
.m-btn, .m-btn-2, .m-btn-danger, .m-btn-ai, .m-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4);
  border: 1px solid transparent; border-radius: var(--r-ctl); font: 500 15px/1.2 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.m-btn:hover, .m-btn-2:hover, .m-btn-danger:hover, .m-btn-ai:hover, .m-btn-ghost:hover { text-decoration: none; }
.m-btn { background: var(--pri); color: #fff; }
.m-btn:hover { background: var(--pri-hover); }
.m-btn-2 { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); box-shadow: var(--shadow); }
.m-btn-2:hover { background: var(--bg); color: var(--ink); }
.m-btn-danger { background: var(--gagal-bg); color: var(--gagal); border-color: #fecaca; }
.m-btn-danger:hover { background: #fecaca; }
.m-btn-ai { background: var(--ai-soft); color: var(--ai); border-color: var(--ai-line); }
.m-btn-ai:hover { background: #f3e8ff; }
.m-btn-ghost { background: transparent; color: var(--mute); }
.m-btn-ghost:hover { background: var(--netral-bg); color: var(--ink); }
.m-btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 14px; }
.m-btn-block { width: 100%; }
.m-icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--mute); cursor: pointer; flex: none; }
.m-icon-btn:hover { background: var(--netral-bg); color: var(--ink); }
@media (pointer: coarse) { .m-icon-btn { width: 44px; height: 44px; } .m-btn-sm { min-height: 44px; } }
:is(.m-btn, .m-btn-2, .m-btn-danger, .m-btn-ai, .m-btn-ghost, .m-icon-btn):disabled, :is(.m-btn, .m-btn-2, .m-btn-danger, .m-btn-ai)[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.m-btn[aria-busy="true"]::after, .m-btn-ai[aria-busy="true"]::after, .m-btn-2[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: m-spin .7s linear infinite; }
@keyframes m-spin { to { transform: rotate(360deg); } }

/* Batang aksi lengket di bawah (HP): satu tombol biru selebar layar */
.m-bar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: var(--s2); margin: var(--s6) calc(-1 * var(--s4)) calc(-1 * var(--s8)); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: rgb(255 255 255 / .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.m-bar > .m-btn { flex: 1; }
@media (min-width: 640px) { .m-bar { position: static; margin: var(--s6) 0 0; padding: 0; background: none; border: 0; backdrop-filter: none; justify-content: flex-end; } .m-bar > .m-btn { flex: none; } }

/* ---------- tab ---------- */
.m-tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s4); }
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3); margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--mute); font: 500 15px var(--sans); white-space: nowrap; cursor: pointer; text-decoration: none; }
.m-tab:hover { color: var(--ink); text-decoration: none; }
.m-tab[aria-selected="true"], .m-tab[aria-current="page"], .m-tab.is-active { color: var(--pri); border-bottom-color: var(--pri); }
.m-tab-done { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ok); color: var(--ok); display: inline-grid; place-items: center; }
.m-tab-done .m-ico { width: 10px; height: 10px; stroke-width: 3; vertical-align: 0; }
.m-tab-count { font-size: 12px; color: inherit; opacity: .8; }

/* ---------- badge ---------- */
.m-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap; background: var(--netral-bg); color: var(--netral); }
.m-badge .m-ico { width: 12px; height: 12px; vertical-align: 0; }
.m-badge-ok { background: var(--ok-bg); color: var(--ok); }
.m-badge-proses { background: var(--proses-bg); color: var(--proses); }
.m-badge-tunggu { background: var(--tunggu-bg); color: var(--tunggu); }
.m-badge-gagal { background: var(--gagal-bg); color: var(--gagal); }
.m-badge-netral { background: var(--netral-bg); color: var(--netral); }
.m-badge-ai { background: var(--ai-soft); color: var(--ai); }

/* ---------- AI: chip Saran AI, titik sumber, panel saran ---------- */
.m-ai { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border: 1px solid var(--ai-line); border-radius: var(--r-ctl); background: var(--ai-soft); color: var(--ai); font: 500 13px var(--sans); cursor: pointer; white-space: nowrap; }
.m-ai:hover { background: #f3e8ff; }
.m-ai .m-ico { width: 14px; height: 14px; vertical-align: 0; }
@media (pointer: coarse) { .m-ai { min-height: 36px; } }
.m-dot-ai { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ai); flex: none; box-shadow: 0 0 0 3px var(--ai-soft); }
.m-est { font-size: 12px; font-weight: 500; color: var(--ai); }
.m-est.m-mute { color: var(--mute); }
.m-suggest { margin-top: var(--s3); padding: var(--s4); border: 1px solid var(--ai-line); border-radius: var(--r-card); background: var(--ai-soft); }
.m-suggest-head { display: flex; align-items: center; gap: 6px; color: var(--ai); font-size: 14px; font-weight: 600; margin-bottom: var(--s2); }
.m-suggest-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.m-suggest-reason { margin-top: var(--s2); font-size: 13px; color: var(--mute); }
.m-suggest-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.m-fv-edit > .m-suggest-actions { margin-top: 0; }

/* ---------- formulir ---------- */
.m-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-field + .m-field { margin-top: var(--s4); }
:is(.m-grid, .m-stack, .m-row) > .m-field + .m-field { margin-top: 0; }
.m-field-label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--s2); min-height: 28px; }
.m-field-label > .m-label { display: inline-flex; align-items: center; gap: 6px; }
.m-field-label > .m-ai, .m-field-label > .m-field-tools { margin-left: auto; }
.m-field-tools { display: inline-flex; align-items: center; gap: 2px; }
.m-req { color: var(--gagal); }
.m-input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: 400 16px/1.5 var(--sans); transition: border-color .15s, box-shadow .15s; }
.m-input::placeholder { color: #9ca3af; }
.m-input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgb(37 99 235 / .18); }
textarea.m-input { min-height: 96px; resize: vertical; }
select.m-input { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") right 10px center/18px no-repeat; }
.m-input[aria-invalid="true"] { border-color: var(--gagal); box-shadow: 0 0 0 3px rgb(185 28 28 / .12); }
.m-input-wrap { display: flex; align-items: stretch; min-width: 0; }
.m-input-wrap > .m-input { flex: 1; min-width: 0; }
.m-affix { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--mute); font-size: 15px; }
.m-affix:first-child { border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.m-affix:last-child { border-left: 0; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.m-input-wrap > .m-affix:first-child + .m-input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.m-input-wrap > .m-input:has(+ .m-affix) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.m-help { font-size: 13px; color: var(--mute); }
.m-error { font-size: 13px; color: var(--gagal); font-weight: 500; }

/* Field baca/ubah (komponen Field / field.js) */
.m-fv { display: flex; align-items: flex-start; gap: var(--s2); min-height: 44px; padding: 10px 4px 10px 12px; border: 1px solid transparent; border-radius: var(--r-ctl); background: var(--bg); }
.m-fv-val { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 1px; }
.m-fv-val.is-empty { color: #9ca3af; font-style: italic; }
.m-fv .m-dot-ai { margin-top: 8px; }
.m-fv .m-field-tools { margin: -6px 0; }
.m-fv-edit { display: flex; flex-direction: column; gap: var(--s2); }
.m-fv-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.m-hist { list-style: none; margin: var(--s2) 0 0; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.m-hist li { display: flex; gap: var(--s2); align-items: baseline; overflow-wrap: anywhere; }
.m-hist li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; transform: translateY(-1px); }
.m-hist li.is-ai::before { background: var(--ai); }
.m-hist time { color: var(--mute); white-space: nowrap; }

/* ---------- empty state + peringatan ---------- */
.m-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s8) var(--s4); text-align: center; color: var(--mute); }
.m-empty > .m-ico { width: 32px; height: 32px; stroke-width: 1.5; color: #9ca3af; }
.m-empty p { margin: 0; max-width: 36ch; }
.m-note { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid; border-radius: var(--r-card); font-size: 14px; line-height: 20px; }
.m-note > .m-ico { width: 18px; height: 18px; margin-top: 1px; }
.m-note-title { display: block; font-weight: 600; margin-bottom: 2px; }
.m-note p { margin: 0; }
.m-note-warn { background: #fffbeb; border-color: #fde68a; color: #854d0e; }
.m-note-fail { background: #fef2f2; border-color: #fecaca; color: var(--gagal); }
.m-note-info { background: var(--pri-soft); border-color: #bfdbfe; color: var(--pri-hover); }

/* ---------- angka besar, rumus, progres ---------- */
.m-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s3); }
.m-stat { padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); min-width: 0; }
.m-stat-label { font-size: 13px; color: var(--mute); font-weight: 500; }
.m-stat-value { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.m-stat-sub { font-size: 13px; color: var(--mute); }
.m-formula { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--mute); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.m-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2) var(--s4); margin: 0; }
.m-kv dt { color: var(--mute); }
.m-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; overflow-wrap: anywhere; }
.m-kv .m-kv-full { grid-column: 1 / -1; margin-top: -6px; text-align: left; font-weight: 400; }
.m-kv .m-kv-total { padding-top: var(--s2); border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.m-progress { height: 6px; border-radius: var(--r-pill); background: var(--netral-bg); overflow: hidden; }
.m-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--pri); }
.m-progress.is-done > span { background: var(--ok); }
.m-progress.is-late > span { background: var(--gagal); }
.m-chart { overflow-x: auto; }
.m-chart svg { display: block; width: 100%; min-width: 320px; height: auto; }

/* ---------- stepper: strip 8 titik + timeline tegak ---------- */
.m-steps { display: flex; list-style: none; margin: 0 0 var(--s4); padding: 0; }
.m-steps li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--mute); text-align: center; }
.m-steps li::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.m-steps li:first-child::before { display: none; }
.m-steps li.is-done::before, .m-steps li.is-run::before, .m-steps li.is-late::before { background: var(--ok); }
.m-step-dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); color: var(--mute); font-size: 11px; font-weight: 600; }
.m-step-dot .m-ico { width: 13px; height: 13px; stroke-width: 3; vertical-align: 0; }
.is-done > .m-step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.is-run > .m-step-dot { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 0 0 4px var(--pri-soft); }
.is-late > .m-step-dot { background: var(--gagal); border-color: var(--gagal); color: #fff; box-shadow: 0 0 0 4px var(--gagal-bg); }
.m-steps .m-step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; padding: 0 2px; }
.m-steps li.is-run, .m-steps li.is-late { color: var(--ink); font-weight: 600; }
@media (max-width: 639px) { .m-steps .m-step-name { display: none; } .m-steps li.is-run .m-step-name, .m-steps li.is-late .m-step-name { display: block; position: absolute; top: 30px; white-space: nowrap; overflow: visible; } .m-steps { padding-bottom: 20px; } .m-steps li:last-child .m-step-name { right: 0; } .m-steps li:first-child .m-step-name { left: 0; } }

.m-timeline { list-style: none; margin: 0; padding: 0; }
.m-tl { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 0 var(--s4); padding-bottom: var(--s4); }
.m-tl::before { content: ""; position: absolute; left: 11px; top: 28px; bottom: 4px; width: 2px; background: var(--line); border-radius: 2px; }
.m-tl:last-child::before { display: none; }
.m-tl.is-done::before { background: var(--ok); }
.m-tl > .m-step-dot { margin-top: 2px; }
.m-tl-body { min-width: 0; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.m-tl.is-run > .m-tl-body { border-color: #bfdbfe; box-shadow: 0 0 0 3px var(--pri-soft); }
.m-tl.is-late > .m-tl-body { border-color: #fecaca; }
.m-tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); }
.m-tl-name { font-weight: 600; font-size: 16px; margin-right: auto; }
.m-tl-meta { display: flex; flex-wrap: wrap; gap: 4px var(--s4); margin-top: 4px; font-size: 13px; color: var(--mute); }
.m-tl-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.m-tl-meta .m-ico { width: 14px; height: 14px; vertical-align: 0; }
.m-tl-prog { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3); font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.m-tl-prog .m-progress { flex: 1; }
.m-tl-next { margin: var(--s2) 0 0; font-size: 14px; color: var(--ink-2); }
.m-tl details { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s2); }
.m-tl summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--pri); }

/* ---------- tabel (di bawah 640px tiap baris menjadi kartu; td butuh data-label) ---------- */
.m-table-wrap { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.m-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.m-table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); background: #fcfcfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.m-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.m-table tr:last-child td { border-bottom: 0; }
.m-table tbody tr:hover { background: #fcfcfd; }
.m-table .m-r, .m-table th.m-r { text-align: right; font-variant-numeric: tabular-nums; }
.m-table .m-c { text-align: center; }
.m-table .m-strong { font-weight: 600; color: var(--ink); }
@media (max-width: 639px) {
  .m-table-wrap { border: 0; background: none; box-shadow: none; overflow: visible; }
  .m-table, .m-table tbody, .m-table tr, .m-table td { display: block; width: 100%; }
  .m-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .m-table tr { margin-bottom: var(--s3); padding: var(--s2) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
  .m-table tbody tr:hover { background: var(--surface); }
  .m-table td { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; overflow-wrap: anywhere; }
  .m-table td.m-r, .m-table td.m-c { text-align: right; }
  .m-table tr td:last-child { border-bottom: 0; }
  .m-table td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
  .m-table td.m-cell-title { display: block; text-align: left; font-size: 16px; font-weight: 600; }
  .m-table td.m-cell-title::before { display: none; }
  .m-table td:empty { display: none; }
}

/* ---------- daftar kartu ide (Workshop) / baris kartu ---------- */
.m-list { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .m-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.m-checks { display: inline-flex; gap: 4px; }
.m-checks > span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--netral-bg); color: #9ca3af; }
.m-checks > span.is-on { background: var(--ok-bg); color: var(--ok); }


/* Pola portal sederhana (Daftar -> Detail): baris daftar, baris dokumen, bagian lipat, slot Tanya. Dari mockup staff/bima/ringkas. */
.x-rows { padding: 0; overflow: hidden; }
.x-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: inherit; }
.x-row:last-child { border-bottom: 0; }
.x-row:hover { background: #fcfcfd; text-decoration: none; }
.x-row-title { font-weight: 600; overflow-wrap: anywhere; }
.x-row-sub { font-size: 13px; color: var(--mute); }
.x-row-next { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.x-row-next.is-warn { color: #854d0e; } .x-row-next.is-late { color: var(--gagal); }
.x-row-side { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.x-row > .m-ico { grid-column: 2; grid-row: 1 / span 2; color: var(--mute); }
@media (min-width: 640px) {
  .x-row { grid-template-columns: minmax(0,1fr) auto 16px; padding: 16px 24px; }
  .x-row-side { grid-column: 2; flex-direction: column; align-items: flex-end; gap: 4px; }
  .x-row > .m-ico { grid-column: 3; grid-row: 1; }
}
.x-doc { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.x-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.x-line > :last-child { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.x-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 13px; color: var(--mute); }
.x-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 14px; }
@media (max-width: 639px) { .x-tabs .m-tab { flex: 1 1 auto; justify-content: center; padding: 0 6px; font-size: 14px; gap: 4px; } }
.x-ask { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px dashed var(--ai-line); border-radius: var(--r-card); color: var(--ai); background: var(--ai-soft); opacity: .8; }
.x-ask b { display: block; font-weight: 600; } .x-ask span { font-size: 13px; }
.x-sec { padding: 0; }
.x-sec > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.x-sec > summary::-webkit-details-marker { display: none; }
.x-sec > summary > .m-ico:first-child { color: var(--mute); width: 20px; height: 20px; }
.x-sec > summary > .m-ico:last-child { color: var(--mute); transition: transform .15s; }
.x-sec[open] > summary > .m-ico:last-child { transform: rotate(90deg); }
.x-sec-t { flex: 1; min-width: 0; } .x-sec-t b { display: block; font-size: 16px; font-weight: 600; } .x-sec-t span { font-size: 13px; color: var(--mute); }
.x-sec-b { padding: 0 16px 16px; }
@media (min-width: 640px) { .x-sec > summary { padding: 18px 24px; } .x-sec-b { padding: 0 24px 24px; } }
.x-tl-in { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.x-tl-in li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; } .x-tl-in li span:last-child { color: var(--mute); white-space: nowrap; }
.is-todo > .m-tl-body { background: #fcfcfd; box-shadow: none; border-style: dashed; }
.x-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .x-tools > .m-input { flex: 1 1 200px; } .x-tools > select.m-input { flex: 0 1 220px; }
.x-foot { margin-top: 16px; font-size: 13px; color: var(--mute); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.x-sec-b .x-row { padding-left: 0; padding-right: 0; }
@media (max-width: 639px) { .x-tools > select.m-input { flex: 1 1 100%; } }
@media (max-width: 899px) { .x-side { display: contents; } .x-sum { order: -1; } }
