/* ==========================================================
   SIMPEL LP2M UPA — gaya antarmuka
   ========================================================== */
:root {
  --ink: #16243b;          /* teks utama, sidebar */
  --ink-2: #4a5872;        /* teks sekunder */
  --ink-3: #7b879c;        /* teks redup */
  --bg: #f3f5f8;           /* latar halaman */
  --surface: #ffffff;
  --line: #dfe4eb;
  --line-2: #eef1f5;
  --green: #0f6b5c;        /* aksi utama */
  --green-2: #0b5549;
  --green-soft: #e3f1ee;
  --saffron: #e0a526;      /* sorotan tahap aktif */
  --saffron-soft: #fdf3dc;
  --red: #b3261e;
  --red-soft: #fbe9e7;
  --blue: #2a5ea8;
  --blue-soft: #e6eefa;
  --radius-s: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 36, 59, .06), 0 2px 8px rgba(22, 36, 59, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--green); }
a:hover { color: var(--green-2); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--saffron) 70%, white); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-red { color: var(--red) !important; }

.boot { padding: 4rem 1rem; text-align: center; color: var(--ink-3); }

/* ---------- Tata letak utama ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink);
  color: #c9d2e0;
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; color: #fff; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand b { display: block; font-size: 1.02rem; letter-spacing: .01em; }
.brand span { display: block; font-size: .75rem; color: #9fb0c8; }
.nav-group { margin-top: 12px; padding: 0 10px 4px; font-size: .74rem; color: #8a9bb5; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-s);
  color: #d5dce8; text-decoration: none; font-size: .94rem;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--saffron); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; background: var(--saffron); color: var(--ink); font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: .75rem; color: #7f90aa; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; }
.topbar .spacer { flex: 1; }
.role-switch { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-2); }
.role-switch select { padding: 6px 8px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.user-chip .who { line-height: 1.2; }
.user-chip .who small { display: block; }

.content { padding: 24px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 16px 20px 0; }
.panel.attention { border-color: color-mix(in srgb, var(--saffron) 55%, var(--line)); background: linear-gradient(var(--saffron-soft), var(--surface) 70%); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1.6fr 1fr; }
.grid.half { grid-template-columns: 1fr 1fr; }
.grid > .panel { margin-bottom: 0; }

/* ---------- Angka ringkas ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .88rem; }
.stat small { display: block; margin-top: 4px; }

/* ---------- Antrean tugas ---------- */
.queue { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.queue a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--ink); background: var(--surface); }
.queue a:hover { border-color: var(--green); }
.queue a b { font-size: 1.4rem; min-width: 2ch; font-variant-numeric: tabular-nums; }
.queue a.zero { color: var(--ink-3); }
.queue a.zero b { color: var(--ink-3); }
.queue a:not(.zero) b { color: var(--green); }

/* ---------- Tabel ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: .82rem; background: #f8f9fb; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .title-link { font-weight: 600; color: var(--ink); text-decoration: none; }
td .title-link:hover { color: var(--green); text-decoration: underline; }
td small { display: block; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty p { margin-bottom: 12px; }

/* bar proporsional di tabel */
.bar-cell { min-width: 140px; }
.bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* ---------- Label status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.s-draf { background: #eef0f3; color: #5d6779; }
.badge.s-diajukan, .badge.s-lolos_adm, .badge.s-dalam_review, .badge.s-selesai_review { background: var(--blue-soft); color: var(--blue); }
.badge.s-perlu_perbaikan { background: var(--saffron-soft); color: #8a5c00; }
.badge.s-ditolak_adm, .badge.s-tidak_didanai { background: var(--red-soft); color: var(--red); }
.badge.s-berjalan { background: var(--green-soft); color: var(--green-2); }
.badge.s-selesai { background: #e5ecf3; color: var(--ink); }
.badge.l-diajukan { background: var(--blue-soft); color: var(--blue); }
.badge.l-perlu_perbaikan { background: var(--saffron-soft); color: #8a5c00; }
.badge.l-diterima { background: var(--green-soft); color: var(--green-2); }
.badge.l-belum { background: #eef0f3; color: #5d6779; }
.badge.l-terlambat { background: var(--red-soft); color: var(--red); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: .76rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.tag.pkm { background: #f1e8f7; color: #6a3d8c; }
.tag.penelitian { background: var(--blue-soft); color: var(--blue); }

/* ---------- Rel tahapan proposal ---------- */
.track { display: grid; grid-template-columns: repeat(7, 1fr); margin: 18px 0 4px; counter-reset: step; }
.track li { list-style: none; position: relative; text-align: center; font-size: .8rem; color: var(--ink-3); padding-top: 30px; }
.track li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; z-index: 1;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink-3);
  font-weight: 700; font-size: .75rem; line-height: 20px;
}
.track li::after { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--line); }
.track li:first-child::after { display: none; }
.track li.done { color: var(--ink-2); }
.track li.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.track li.done::after, .track li.now::after { background: var(--green); }
.track li.now { color: var(--ink); font-weight: 700; }
.track li.now::before { background: var(--saffron); border-color: var(--saffron); color: var(--ink); box-shadow: 0 0 0 5px var(--saffron-soft); }
.track li.fail { color: var(--red); font-weight: 700; }
.track li.fail::before { content: "!"; background: var(--red); border-color: var(--red); color: #fff; }
.track li.fail::after { background: var(--green); }
.track-note { text-align: center; font-size: .86rem; color: var(--ink-2); margin-top: 8px; }

/* ---------- Detail ---------- */
.detail-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; color: var(--ink-2); font-size: .9rem; }
.detail-title { font-size: 1.5rem; margin: 0 0 4px; }
dl.facts { display: grid; grid-template-columns: 180px 1fr; gap: 8px 18px; margin: 0; font-size: .93rem; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
dl.facts dd small, .review-card header small { display: block; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.callout { padding: 12px 14px; border-radius: var(--radius-s); margin-bottom: 14px; font-size: .92rem; border-left: 4px solid; }
.callout.warn { background: var(--saffron-soft); border-color: var(--saffron); }
.callout.err { background: var(--red-soft); border-color: var(--red); }
.callout.ok { background: var(--green-soft); border-color: var(--green); }
.callout.info { background: var(--blue-soft); border-color: var(--blue); }
.callout b { display: block; margin-bottom: 2px; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; font-size: .92rem; }
.checklist li { padding: 4px 0 4px 26px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.checklist li.ok::before { background: var(--green); border-color: var(--green); }
.checklist li.ok::after { content: "✓"; position: absolute; left: 4px; top: 4px; color: #fff; font-size: .7rem; font-weight: 700; }
.checklist li.no { color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 17px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--ink-3); font-size: .8rem; }
.timeline .note { color: var(--ink-2); white-space: pre-wrap; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fafbfc; flex-wrap: wrap; }
.file-row svg { width: 22px; height: 22px; color: var(--red); flex: none; }
.file-row .grow { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.review-card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; margin-bottom: 12px; }
.review-card header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.score { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Formulir ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
label .opt { font-weight: 400; color: var(--ink-3); }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: .94rem; color: var(--ink);
  background: var(--surface); border: 1px solid #cfd6e0; border-radius: var(--radius-s);
}
textarea { min-height: 110px; resize: vertical; }
input[readonly] { background: var(--bg); color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--green); vertical-align: -3px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.field { margin-bottom: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters > * { flex: 1 1 150px; }
.filters .search { flex: 2 1 220px; }
.repeater { border: 1px solid var(--line); border-radius: var(--radius-s); }
.repeater-row { display: grid; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line-2); align-items: center; }
.repeater-row:last-child { border-bottom: 0; }
.repeater-row.anggota { grid-template-columns: 130px 1.4fr 1fr 1.2fr 36px; }
.repeater-row.luaran { grid-template-columns: 1fr 1.4fr 36px; }
.repeater-row.rubrik { grid-template-columns: 1fr 90px 36px; }
.repeater-empty { padding: 12px; color: var(--ink-3); font-size: .9rem; }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.combo-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; font-size: .9rem; cursor: pointer; }
.combo-list button:hover, .combo-list button:focus { background: var(--green-soft); }
.combo-list small { display: block; }
.linked { font-size: .78rem; color: var(--green); margin-top: 2px; }
.counter { float: right; font-weight: 400; color: var(--ink-3); font-size: .8rem; }
.score-input { display: grid; grid-template-columns: 1fr 70px 100px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.score-input .w { color: var(--ink-3); font-size: .85rem; text-align: right; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-s); border: 1px solid transparent;
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--green); color: #fff;
}
.btn:hover { background: var(--green-2); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: #cfd6e0; }
.btn.secondary:hover { background: var(--line-2); color: var(--ink); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #8f1e18; }
.btn.ghost { background: none; color: var(--green); padding: 6px 8px; }
.btn.ghost:hover { background: var(--green-soft); color: var(--green-2); }
.btn.sm { padding: 5px 10px; font-size: .84rem; }
.btn.icon { width: 34px; height: 34px; padding: 0; background: none; color: var(--ink-3); border-color: transparent; }
.btn.icon:hover { background: var(--red-soft); color: var(--red); }
.btn svg { width: 16px; height: 16px; }
.btn.block { width: 100%; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--ink); color: #dbe2ee; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h1 { color: #fff; font-size: 2.1rem; max-width: 16ch; margin: 28px 0 12px; }
.auth-side p { max-width: 46ch; color: #b8c4d6; }
.auth-side .stages { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; max-width: 360px; }
.auth-side .stages li { display: flex; gap: 12px; align-items: center; font-size: .92rem; }
.auth-side .stages li span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #3c4f6e; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: #9fb0c8; flex: none; }
.auth-side .stages li:nth-child(4) span { background: var(--saffron); border-color: var(--saffron); color: var(--ink); }
.auth-side small { color: #7f90aa; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 1.45rem; }
.demo-box { margin-top: 18px; font-size: .84rem; color: var(--ink-2); background: var(--bg); border-radius: var(--radius-s); padding: 12px 14px; }
.demo-box code { font-size: .82rem; }

/* ---------- Modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(22, 36, 59, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(22, 36, 59, .25); }
.modal.wide { max-width: 820px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 1.1rem; }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line-2); }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-s); box-shadow: var(--shadow); font-size: .92rem; animation: toastIn .18s ease-out; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green-2); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.notif-list li.unread { background: #f6fbfa; }
.notif-list li.unread .t::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; }
.notif-list .t { font-weight: 600; }
.notif-list .grow { flex: 1; min-width: 0; }
.announce { border-bottom: 1px solid var(--line-2); padding: 10px 0; }
.announce:last-child { border-bottom: 0; }
.announce .prose { font-size: .92rem; color: var(--ink-2); }

/* ---------- Bukti pengajuan (cetak) ---------- */
.print-sheet { background: #fff; max-width: 800px; margin: 0 auto; padding: 40px 48px; border: 1px solid var(--line); color: #000; }
.kop { display: flex; gap: 16px; align-items: center; border-bottom: 3px double #000; padding-bottom: 12px; margin-bottom: 20px; }
.kop img { width: 60px; height: 60px; }
.kop .t1 { font-size: 1.05rem; font-weight: 700; }
.kop .t2 { font-size: .95rem; }
.kop .t3 { font-size: .8rem; }
.print-sheet h2 { text-align: center; font-size: 1.15rem; text-decoration: underline; margin-bottom: 4px; }
.print-sheet .nomor { text-align: center; margin-bottom: 20px; }
.print-sheet table td { border: 0; padding: 4px 6px; }
.print-sheet table td:first-child { width: 190px; }
.ttd { margin-top: 40px; display: flex; justify-content: flex-end; text-align: center; }
.ttd div { min-width: 240px; }
.ttd .space { height: 70px; }

/* ---------- Responsif ---------- */
@media (max-width: 1000px) {
  .grid.two, .grid.half { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(22, 36, 59, .4); }
  .topbar { padding: 10px 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .user-chip .who { display: none; }
  .role-switch span { display: none; }
  .content { padding: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 22px; }
  .auth-side h1 { font-size: 1.6rem; margin-top: 18px; }
  .auth-side .stages { display: none; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
  .repeater-row.anggota, .repeater-row.luaran { grid-template-columns: 1fr; }
  /* di ponsel hanya label tahap aktif yang ditampilkan */
  .track li { font-size: 0; }
  .track li.now, .track li.fail { font-size: .72rem; white-space: nowrap; }
  .print-sheet { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }


/* ---------- Modul v1.1: luaran, kerja sama, RAB, peneliti, katalog ---------- */
.badge.v-menunggu { background: var(--blue-soft); color: var(--blue); }
.badge.v-terverifikasi { background: var(--green-soft); color: var(--green-2); }
.badge.v-ditolak { background: var(--saffron-soft); color: #8a5c00; }
.badge.k-aktif { background: var(--green-soft); color: var(--green-2); }
.badge.k-segera { background: var(--saffron-soft); color: #8a5c00; }
.badge.k-berakhir { background: #eef0f3; color: #5d6779; }
.tag.kat { background: #eaf0f0; color: #2d5b55; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: .85rem; text-decoration: none; }
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--green); color: var(--green-2); }
.chip.on { background: var(--green-soft); border-color: var(--green); color: var(--green-2); }
.chip button { border: 0; background: none; padding: 0; margin-left: 2px; cursor: pointer; color: inherit; display: inline-flex; }
.chip button svg { width: 14px; height: 14px; }
.field .chips { margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--green-2); border-bottom-color: var(--green); }

.id-links { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.id-links a { font-size: .76rem; font-weight: 600; padding: 1px 8px; border-radius: 4px; background: var(--blue-soft); color: var(--blue); text-decoration: none; }
.id-links a:hover { background: var(--blue); color: #fff; }
.cite { line-height: 1.55; overflow-wrap: anywhere; }

.repeater-row.rab { grid-template-columns: 170px 1.6fr 80px 90px 130px 120px 36px; }
.repeater-row.rab.head { padding-top: 8px; padding-bottom: 6px; font-size: .76rem; color: var(--ink-3); font-weight: 600; background: var(--bg); }
.rab-jml { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.rab-ringkas { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .85rem; color: var(--ink-2); }
tr.group td { background: var(--bg); }
tfoot td { border-top: 2px solid var(--line); }

.profile-head { display: flex; gap: 18px; align-items: flex-start; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; flex: none; }
.profile-head .grow { flex: 1; min-width: 0; }

.public { min-height: 100vh; background: var(--bg); }
.public-top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--ink); }
.public-top .brand { padding: 0; }
.public-top .spacer { flex: 1; }
.public-main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 48px; }
.public-hero h1 { font-size: 1.8rem; margin-bottom: 6px; }
.public-hero p { color: var(--ink-2); max-width: 70ch; }
.public-hero .stats { margin-top: 18px; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li { padding: 14px 0; border-bottom: 1px solid var(--line-2); display: grid; gap: 4px; }
.pub-list li:first-child { padding-top: 0; }
.pub-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.auth.single { grid-template-columns: 1fr; background: var(--bg); }
.auth.single .auth-form { background: transparent; }
.auth.single .auth-form > form, .auth.single .auth-form > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); width: 100%; max-width: 420px; }

@media (max-width: 1000px) {
  .repeater-row.rab { grid-template-columns: 1fr 1fr; }
  .repeater-row.rab.head { display: none; }
  .repeater-row.rab > select { grid-column: 1; grid-row: 1; }
  .repeater-row.rab > button { grid-column: 2; grid-row: 1; justify-self: end; }
  .repeater-row.rab input[data-f=uraian] { grid-column: 1 / -1; }
  .rab-jml { text-align: left; }
}
@media (max-width: 860px) {
  .public-top { padding: 10px 14px; }
  .public-hero h1 { font-size: 1.4rem; }
  .profile-head { flex-direction: column; gap: 10px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .toast-wrap { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  .print-sheet { border: 0; padding: 0; max-width: none; }
}
