@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Source+Sans+3:wght@400;600;700&display=swap');

/* =========================================================
   Gaya seragam dengan Form Penilaian Investigator (Tatalogam Group)
   Biru #0054a4 + hijau lime #9cc814 · Montserrat (judul) + Source Sans 3 (isi)
   ========================================================= */
:root {
  --blue: #0054a4;
  --blue-deep: #003b7a;
  --lime: #9cc814;
  --navy: #0b2a4a;
  --bg: #eef3f9;
  --ink: #12263f;
  --muted: #5a6f88;
  --line: #e3ebf4;
  --field: #c4d3e6;
  --pill: #b9cfe8;
  --tint: #eaf2fc;
  --danger: #c0392b;
  --danger-line: #efc4bf;
  --ok-bg: #e9f5c9;
  --ok-ink: #3d5a00;
  --warn-bg: #fdf0d9;
  --warn-ink: #8a5200;
  --shadow: 0 8px 30px rgba(0, 60, 120, 0.1);
  --shadow-sm: 0 4px 16px rgba(0, 60, 120, 0.07);

  /* alias supaya JS lama yang memakai var(--...) tetap jalan */
  --navy-900: var(--navy);
  --navy-800: var(--blue);
  --navy-700: var(--blue);
  --gold-500: var(--lime);
  --gold-400: var(--lime);
  --paper: var(--bg);
  --paper-line: var(--line);
  --ink-soft: var(--muted);
  --ok: #3d7a00;
  --err: var(--danger);
  --radius: 14px;
  --font-display: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Source Sans 3', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 3px solid rgba(0, 84, 164, 0.35); outline-offset: 2px; }

/* ---------- Header + hero (form publik) ---------- */
.site-header { background: #fff; border-bottom: 4px solid var(--lime); }
.site-header-inner {
  max-width: 920px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.site-header img { height: 60px; width: auto; display: block; }
.site-header .divider { width: 1px; height: 36px; background: #d5dfec; }
.site-header .sys-name {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
}

.letterhead {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff; padding: 64px 20px 110px;
}
.letterhead .hero-art { position: absolute; right: -20px; top: 0; opacity: 0.95; pointer-events: none; }
.letterhead-inner { position: relative; max-width: 920px; margin: 0 auto; }
.hero-tag {
  display: inline-block; background: var(--lime); color: var(--navy);
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
}
.letterhead h1 {
  margin: 16px 0 12px; font-family: var(--font-display); font-weight: 800;
  font-size: 44px; line-height: 1.1; max-width: 640px; color: #fff;
}
.letterhead p.sub { margin: 0; max-width: 560px; font-size: 18px; color: #d6e6f7; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.chip {
  border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px;
  padding: 6px 14px; font-weight: 600; font-size: 14px;
}

/* ---------- Kontainer form ---------- */
.app { max-width: 960px; margin: -64px auto 0; padding: 0 20px 70px; position: relative; }
.app-body { display: flex; flex-direction: column; gap: 18px; }

.layout { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }

.layout .panel, .panel {
  background: #fff; border-radius: 18px; padding: 28px;
  box-shadow: var(--shadow); min-height: 420px;
}

/* Navigasi bagian (stepper) */
.sidenav {
  background: #fff; border-radius: 18px; padding: 14px 12px;
  box-shadow: var(--shadow-sm); position: sticky; top: 16px;
}
.sidenav .progress-label {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--muted);
  padding: 4px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.sidenav button {
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 4px; font-family: var(--font-display); font-weight: 700;
  font-size: 13.5px; line-height: 1.3; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 12px; transition: background .12s ease, color .12s ease;
}
.sidenav button .num {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #e6eef8; color: var(--blue); flex-shrink: 0;
}
.sidenav button:hover { background: var(--bg); color: var(--blue); }
.sidenav button.active { background: var(--blue); color: #fff; }
.sidenav button.active .num { background: var(--lime); color: var(--navy); }
.sidenav button.done .num { background: var(--ok-bg); color: var(--ok-ink); }

/* Judul bagian */
.panel-head { margin-bottom: 22px; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; align-items: center; }
.panel-head .sec-badge {
  width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800;
}
.panel-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--blue); margin: 0; }
.panel-head p { grid-column: 2; margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Field ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field label .req { color: var(--danger); margin-left: 3px; }
.field .field-desc { margin: -2px 0 8px; font-size: 13.5px; color: var(--muted); }
.field .field-desc a { color: var(--blue); font-weight: 700; text-decoration: underline; text-decoration-color: var(--lime); text-underline-offset: 2px; }

.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="number"], .field input[type="date"], .field input[type="month"],
.field input[type="url"], .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--field); border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 84, 164, 0.14);
}

.field .file-drop {
  display: block; border: 2px dashed #8fb0d6; border-radius: 14px; padding: 18px; text-align: center;
  background: #f6faff; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--blue);
}
.field .file-drop.has-file { border-color: var(--lime); background: #f5fae6; color: var(--ok-ink); }
.field input[type="file"] { display: none; }

.hint { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }

/* Pilihan radio / centang: pill seperti tombol Ya / Tidak di form investigator */
.yn { display: flex; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.yn label {
  display: flex; align-items: center; gap: 8px; margin: 0; min-height: 44px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--pill); border-radius: 999px;
  padding: 8px 18px; cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.yn label:hover { border-color: var(--blue); }
.yn input { width: 19px !important; height: 19px; margin: 0; accent-color: var(--blue); flex-shrink: 0; }
.yn label:has(input:checked) { background: var(--tint); border: 2px solid var(--blue); padding: 7.5px 17.5px; }
/* Ya = lime, Tidak = merah (sama dengan form investigator) */
.yn label:has(input[value="Ya"]),
.yn label:has(input[value="Tidak"]) { min-width: 84px; justify-content: center; }
.yn label:has(input[value="Ya"]) input,
.yn label:has(input[value="Tidak"]) input { position: absolute; opacity: 0; width: 1px !important; height: 1px; pointer-events: none; }
.yn label:has(input[value="Ya"]:checked) { background: var(--lime); border: 1.5px solid var(--lime); color: var(--navy); font-weight: 800; padding: 8px 18px; }
.yn label:has(input[value="Tidak"]:checked) { background: #fdeceb; border: 1.5px solid var(--danger); color: #a52a1d; font-weight: 800; padding: 8px 18px; }
.yn label:has(input:focus-visible) { outline: 3px solid rgba(0, 84, 164, 0.35); outline-offset: 2px; }

/* Grup berulang */
.repeater-item {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 22px 18px 6px;
  margin: 14px 0 12px; background: #f9fbfe; position: relative;
}
.repeater-item .rep-tag {
  position: absolute; top: -12px; left: 14px; background: var(--blue); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px; padding: 3px 12px; border-radius: 999px;
}
.rep-remove {
  position: absolute; top: -12px; right: 14px; background: #fff; border: 1.5px solid var(--danger-line);
  color: var(--danger); font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  padding: 2px 11px; border-radius: 999px; cursor: pointer;
}
.btn-add {
  display: inline-flex; align-items: center; gap: 6px; background: transparent;
  border: 1.5px solid var(--pill); color: var(--blue); font-family: var(--font-body);
  font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px; cursor: pointer; margin-top: 4px;
}
.btn-add:hover { background: var(--tint); }

/* Tanda tangan */
.sig-canvas {
  border: 2px dashed #8fb0d6; border-radius: 14px; background: #f6faff; width: 100%;
  max-width: 460px; height: 150px; touch-action: none; cursor: crosshair; display: block;
}

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  padding: 13px 28px; border-radius: 999px; border: 0; font-family: var(--font-display);
  font-weight: 800; font-size: 15px; cursor: pointer; transition: transform .1s ease, opacity .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-deep); }
.btn-gold { background: var(--lime); color: var(--navy); }
.btn-gold:hover:not(:disabled) { background: #8bb512; }
.btn-ghost {
  background: transparent; color: var(--blue); border: 1.5px solid var(--pill);
  padding: 8px 16px; font-family: var(--font-body); font-weight: 700; font-size: 13.5px; border-radius: 9px;
}
.btn-ghost:hover:not(:disabled) { background: var(--tint); }
.btn-outline {
  background: transparent; color: var(--blue); border: 1.5px solid var(--pill);
  padding: 12px 20px; font-family: var(--font-display); font-weight: 700; font-size: 13.5px;
}
.btn-outline:hover:not(:disabled) { background: var(--tint); }
.btn-danger {
  background: transparent; color: var(--danger); border: 1.5px solid var(--danger-line);
  padding: 6px 12px; font-family: var(--font-body); font-weight: 700; font-size: 13px; border-radius: 8px;
}

.nav-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.nav-actions .btn { width: auto; }
.nav-actions .btn-ghost { padding: 12px 20px; font-family: var(--font-display); font-weight: 700; font-size: 14px; border-radius: 999px; }
.nav-actions-right { display: flex; gap: 10px; align-items: center; }

/* ---------- Pesan, banner, progres file ---------- */
.msg { padding: 12px 14px; border-radius: 10px; font-size: 14.5px; margin-bottom: 16px; font-weight: 600; }
.msg-err { background: #fdeceb; color: #a52a1d; border: 1.5px solid var(--danger-line); }
.msg-ok { background: var(--ok-bg); color: var(--ok-ink); border: 1.5px solid #cfe58a; }
.resume-banner {
  padding: 12px 16px; border-radius: 12px; background: var(--tint);
  border: 1.5px solid #c9dcfb; color: var(--blue); font-size: 14.5px; font-weight: 600;
}
.resume-banner.resume-banner-err { background: #fdeceb; border-color: var(--danger-line); color: #a52a1d; }

.file-budget { background: #f6faff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.file-budget-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 7px; }
.file-budget-head b { color: var(--blue); }
.file-budget-head span { color: var(--muted); font-weight: 600; }
.file-budget-track { height: 8px; border-radius: 99px; background: #fff; overflow: hidden; border: 1px solid var(--line); }
.file-budget-fill { height: 100%; width: 0%; border-radius: 99px; background: var(--lime); transition: width .2s ease, background .2s ease; }
.file-budget-fill.warn { background: #e0a030; }
.file-budget-fill.over { background: var(--danger); }

#loadingState { background: #fff; border-radius: 18px; box-shadow: var(--shadow); text-align: center; font-weight: 600; }

.success-panel, #successState { text-align: center; padding: 48px 24px; }
#successState h2 { font-family: var(--font-display); font-weight: 800; color: var(--blue); }

.site-footer, footer.note {
  background: var(--navy); color: #b9cde4; padding: 26px 20px; text-align: center;
  font-size: 13px; border-top: 4px solid var(--lime); margin: 0;
}
.contact-line { margin-top: 4px; font-size: 13px; color: #b9cde4; }

/* ---------- Modal ---------- */
.modal-overlay, .modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 42, 74, 0.5); display: flex;
  align-items: center; justify-content: center; z-index: 60; padding: 16px;
}
.modal-box, .modal {
  background: #fff; border-radius: 18px; padding: 26px; max-width: 460px; width: 100%;
  box-shadow: 0 20px 60px rgba(11, 42, 74, 0.3);
}
.modal-box h3, .modal h3 { font-family: var(--font-display); font-weight: 800; color: var(--blue); margin: 0 0 6px; font-size: 18px; }
.modal p.desc { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.modal-link-row { display: flex; gap: 8px; margin-top: 14px; }
.modal-link-row input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--field); font-size: 13px; color: var(--blue); }
.modal-link-row .btn { width: auto; white-space: nowrap; padding: 10px 20px; }
.modal-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.modal-option { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--field); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.modal-option:hover { border-color: var(--blue); }
.modal-option:has(input:checked) { border: 2px solid var(--blue); background: var(--tint); padding: 11.5px 13.5px; }
.modal-option input { accent-color: var(--blue); }
.modal-option .opt-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.modal-option .opt-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; }
.progress-track { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); margin: 14px 0 8px; }
.progress-fill { height: 100%; width: 0%; background: var(--lime); border-radius: 99px; transition: width .25s ease; }
.progress-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* =========================================================
   ADMIN — sidebar navy + konten, sama seperti mockup admin investigator
   ========================================================= */
.login-box {
  max-width: 400px; margin: 12vh auto 0; background: #fff; border-radius: 18px;
  border-top: 8px solid var(--blue); padding: 30px 28px; box-shadow: var(--shadow);
}
.login-box .login-logo { height: 64px; width: auto; display: block; margin-bottom: 14px; }
.login-box h1 { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--blue); margin: 0 0 6px; }
.login-box .btn-primary { width: 100%; }

.admin-shell { min-height: 100vh; }
.admin-layout { display: flex; flex-wrap: wrap; min-height: 100vh; }

.admin-side {
  flex: 0 0 240px; background: var(--navy); color: #fff; display: flex; flex-direction: column;
  border-right: 4px solid var(--lime);
}
.admin-brand { background: #fff; padding: 14px 20px; display: flex; align-items: center; gap: 12px; }
.admin-brand img { height: 56px; width: auto; display: block; }
.admin-brand .brand-text {
  font-family: var(--font-display); font-weight: 800; font-size: 12px; line-height: 1.25;
  color: var(--blue); text-transform: uppercase; letter-spacing: 0.04em;
}
.tabs { display: flex; flex-direction: column; gap: 6px; padding: 18px 12px; }
.tab-btn {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #c5d7ec;
  background: transparent; border: 0; border-radius: 10px; padding: 12px 14px; cursor: pointer;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.tab-btn.active { background: var(--lime); color: var(--navy); }
.tab-btn svg { flex-shrink: 0; }
.admin-side-foot { margin-top: auto; padding: 16px 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.admin-side-foot .whoami { font-size: 12.5px; color: #c5d7ec; padding: 0 4px 4px; overflow-wrap: anywhere; margin: 0; }
.admin-side-foot a, .admin-side-foot button {
  font-family: var(--font-body); font-weight: 700; font-size: 13px; color: #fff; text-align: center; text-decoration: none;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 9px; padding: 9px 14px; cursor: pointer;
}
.admin-side-foot button { color: #c5d7ec; border-color: rgba(255, 255, 255, 0.2); }
.admin-side-foot a:hover, .admin-side-foot button:hover { background: rgba(255, 255, 255, 0.08); }

.admin-main { flex: 999 1 640px; min-width: 0; padding: 28px 32px 60px; }
.admin-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-topbar h1 { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--blue); margin: 0; }
.admin-topbar p { margin: 2px 0 0; color: var(--muted); }

.card { background: #fff; border-radius: 16px; padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--blue); margin: 0 0 12px; }

/* Kartu statistik */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--blue);
}
.stat .stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .stat-value { font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--ink); }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-input {
  width: 100%; padding: 10px 34px 10px 14px; border: 1.5px solid var(--field); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 84, 164, 0.14); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 18px; display: none; padding: 2px 6px; line-height: 1;
}
.search-clear.show { display: block; }
.result-count { font-size: 13px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
mark { background: #e9f5c9; color: inherit; border-radius: 3px; padding: 0 2px; }

#subFilterToolbar select, #tab-questions select, #tab-users select {
  font: inherit; font-size: 14px; border: 1.5px solid var(--field); border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--ink);
}
#subFilterToolbar .hint { font-weight: 700; }

/* Tabel: header biru, baris selang-seling */
#submissionsContainer, #usersListContainer, #loginLogContainer { overflow-x: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
table.sub-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.sub-table th {
  background: var(--blue); color: #fff; text-align: left; padding: 12px; font-family: var(--font-display);
  font-weight: 700; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
table.sub-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sub-table tbody tr:nth-child(even) { background: #f8fafd; }
table.sub-table td.mono { color: var(--muted); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block; font-size: 12.5px; font-weight: 700; background: #dcebfb; color: #0b4a8f;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.status-select {
  display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 0; font-family: var(--font-body);
}
.status-select.status-baru { background: #eef0f2; color: var(--muted); }
.status-select.status-diproses { background: var(--warn-bg); color: var(--warn-ink); }
.status-select.status-diterima { background: var(--ok-bg); color: var(--ok-ink); }
.status-select.status-ditolak { background: #fdeceb; color: #a52a1d; }

/* ---------- Pembuat form (admin) ---------- */
.sec-row, .q-row {
  display: flex; align-items: flex-start; gap: 10px; background: #fff; border-radius: 14px;
  border-left: 6px solid var(--lime); padding: 14px; margin-bottom: 10px;
  box-shadow: 0 3px 12px rgba(0, 60, 120, 0.06);
}
.sec-row .q-main, .q-row .q-main { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.q-row .q-order, .sec-row .q-order { display: flex; flex-direction: column; gap: 4px; }
.q-row .q-order button, .sec-row .q-order button {
  min-width: 34px; min-height: 26px; border: 1.5px solid #c4d6ec; background: transparent; color: var(--blue);
  border-radius: 8px; cursor: pointer; font-size: 12px;
}
.q-row input[type="text"], .q-row select, .sec-row input[type="text"] {
  padding: 9px 11px; font: inherit; font-size: 14px; border: 1.5px solid var(--field); border-radius: 10px; width: 100%; background: #fff;
}
.q-row .q-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.q-row .q-meta label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 600; }
.q-row .q-actions button { margin-left: 6px; }
.subfields-wrap { margin-top: 8px; padding: 12px; background: #f9fbfe; border: 1.5px dashed var(--pill); border-radius: 12px; }
.subfield-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.subfield-row input[type="text"], .subfield-row select {
  padding: 7px 9px; font: inherit; font-size: 13px; border: 1.5px solid var(--field); border-radius: 8px; background: #fff;
}
.subfield-row input[type="text"] { flex: 1; min-width: 110px; }

/* ---------- Detail review (overlay) ---------- */
.detail-overlay {
  position: fixed; inset: 0; background: rgba(11, 42, 74, 0.55); display: flex;
  align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; z-index: 50;
}
.detail-panel {
  background: #fff; border-radius: 18px; max-width: 800px; width: 100%;
  max-height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden;
}
.detail-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 22px; background: var(--blue); border-bottom: 4px solid var(--lime); flex-shrink: 0;
}
.detail-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: #fff; margin: 0; }
.detail-head .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.detail-head .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.detail-body { padding: 20px 22px; overflow-y: auto; }
.report-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.report-section { margin-bottom: 22px; }
.report-section h3 {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800;
  font-size: 14.5px; color: var(--blue); margin: 0 0 8px;
}
.report-section h3::before { content: ""; width: 5px; height: 16px; background: var(--lime); border-radius: 2px; }
.report-rows { display: flex; flex-direction: column; }
.report-row { padding: 10px 2px 12px; border-bottom: 1px solid var(--line); }
.report-row:last-child { border-bottom: none; }
.report-label { font-size: 13px; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.report-value { font-size: 14.5px; color: var(--ink); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.report-repeater-row { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; margin-bottom: 8px; background: #f9fbfe; }
.report-repeater-tag { font-family: var(--font-display); font-weight: 700; font-size: 11px; color: var(--blue); text-transform: uppercase; margin-bottom: 4px; }
.file-link { color: var(--blue); font-weight: 700; text-decoration: underline; text-decoration-color: var(--lime); }

/* ---------- Isi bersama (live) ---------- */
.collab-bar {
  align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px;
  background: var(--ok-bg); border: 1.5px solid #cfe58a; border-radius: 12px;
  font-size: 13.5px; color: var(--ok-ink);
}
.collab-bar.offline { background: var(--warn-bg); border-color: #f0d49b; color: var(--warn-ink); }
.collab-dot { width: 9px; height: 9px; border-radius: 50%; background: #5aa100; box-shadow: 0 0 0 0 rgba(90,161,0,.5); animation: pulse 1.8s infinite; }
.collab-bar.offline .collab-dot { background: #e0a030; animation: none; }
.collab-names { font-weight: 600; color: var(--ink); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(90,161,0,0); } 100% { box-shadow: 0 0 0 0 rgba(90,161,0,0); } }
.field.locked-by { position: relative; opacity: .75; }
.field.locked-by::before {
  content: "\270E  " attr(data-locker) " sedang mengisi\2026";
  position: absolute; top: -9px; right: 0; z-index: 2; background: var(--lime); color: var(--navy);
  font-family: var(--font-display); font-weight: 800; font-size: 11px; padding: 2px 10px; border-radius: 999px;
}
.field.locked-by input, .field.locked-by textarea, .field.locked-by select { background: #f4f8fd; border-color: var(--lime); }

/* ---------- Responsif ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .sidenav .progress-label { display: none; }
  .sidenav button { width: auto; white-space: nowrap; margin-bottom: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .admin-side { flex: 1 1 100%; border-right: 0; border-bottom: 4px solid var(--lime); }
  .tabs { flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .tab-btn { width: auto; }
  .admin-side-foot { flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: 0; padding-top: 0; }
  .admin-side-foot .whoami { flex: 1 1 100%; }
  .admin-main { padding: 20px 16px 50px; }
}
@media (max-width: 640px) {
  .site-header img { height: 48px; }
  .site-header .sys-name { font-size: 11px; }
  .letterhead { padding: 28px 16px 80px; }
  .letterhead h1 { font-size: 25px; line-height: 1.15; max-width: 85%; }
  .letterhead p.sub { font-size: 15px; }
  .letterhead .hero-art { width: 260px; height: auto; right: -50px; }
  .chip { font-size: 13px; padding: 5px 12px; }
  .app { margin-top: -48px; padding: 0 12px 50px; }
  .layout .panel, .panel { padding: 20px; border-radius: 16px; }
  .panel-head h2 { font-size: 17px; }
  .grid2 { grid-template-columns: 1fr; }
  .nav-actions { flex-wrap: wrap; gap: 10px; }
  .nav-actions-right { width: 100%; flex-direction: column-reverse; }
  .nav-actions-right .btn { width: 100%; }
  .modal-link-row { flex-direction: column; }
  table.sub-table thead { display: none; }
  table.sub-table, table.sub-table tbody, table.sub-table tr, table.sub-table td { display: block; width: 100%; }
  table.sub-table tr { border-bottom: 6px solid var(--bg); padding: 6px 4px; }
  table.sub-table td { border: none; padding: 5px 12px; }
  table.sub-table td::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
