/* ============================================================================
   Form Asesmen — Aplikasi Manajemen English Center
   Desain: modern, bersih, ramah seluler
   ============================================================================ */

/* ------------------------------------------------------------------ TOKENS */
:root {
  --primary:        #4338CA;
  --primary-hover:  #3730A3;
  --primary-soft:   #EEF2FF;
  --primary-100:    #E0E7FF;
  --accent:         #F59E0B;
  --accent-soft:    #FEF3C7;
  --success:        #059669;
  --success-soft:   #D1FAE5;
  --danger:         #DC2626;
  --danger-soft:    #FEE2E2;
  --info:           #0284C7;
  --info-soft:      #E0F2FE;

  --bg:             #F4F5FA;
  --card:           #FFFFFF;
  --text:           #0F172A;
  --text-soft:      #475569;
  --muted:          #64748B;
  --border:         #E4E7EC;
  --border-strong:  #CBD5E1;

  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 16px -4px rgba(15, 23, 42, .10), 0 2px 6px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 44px -12px rgba(15, 23, 42, .22);

  --topbar-h: 74px;
  --navbar-h: 76px;
  --sidebar-w: 276px;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------------- RESET */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Atribut [hidden] HARUS selalu menang atas display dari aturan lain.
   Tanpa ini, .btn { display: inline-flex } membuat tombol ber-[hidden]
   tetap tampil dan dapat merusak tata letak (mis. bilah bawah meluber). */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92em;
       background: var(--primary-soft); color: var(--primary); padding: 1px 6px; border-radius: 5px; }

:focus-visible { outline: 3px solid rgba(67, 56, 202, .35); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1280px; margin: 0 auto; height: var(--topbar-h);
  padding: 0 26px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #6D5BE8 100%);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px rgba(67, 56, 202, .6);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 15px; }
.brand__text small  { font-size: 12px; color: var(--muted); }

.topbar__progress { flex: 1; min-width: 0; max-width: 460px; }
.progress { height: 7px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress__bar {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary) 0%, #7C6CF0 100%);
  transition: width .45s var(--ease);
}
.progress__meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.progress__pct { color: var(--primary); }

.topbar__actions { margin-left: auto; flex-shrink: 0; }
.save-state {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 99px; transition: all .3s var(--ease);
}
.save-state__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: background .3s; }
.save-state.is-saved  { color: var(--success); border-color: #A7F3D0; background: var(--success-soft); }
.save-state.is-saved .save-state__dot { background: var(--success); }
.save-state.is-saving { color: var(--info); border-color: #BAE6FD; background: var(--info-soft); }
.save-state.is-saving .save-state__dot { background: var(--info); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ------------------------------------------------------------------ ALERT */
.alert {
  max-width: 1228px; margin: 18px auto 0; padding: 14px 20px;
  border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 13.5px; line-height: 1.5;
}
.alert--error { background: var(--danger-soft); border: 1px solid #FCA5A5; color: #7F1D1D; }
.alert strong { width: 100%; }

/* ----------------------------------------------------------------- LAYOUT */
.layout {
  max-width: 1280px; margin: 0 auto;
  padding: 26px 26px calc(var(--navbar-h) + 34px);
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 26px; align-items: start;
}

/* ---------------------------------------------------------------- SIDEBAR */
.sidebar { position: sticky; top: calc(var(--topbar-h) + 26px); min-width: 0; }
.sidebar__title {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px; padding-left: 4px;
}
.stepsnav { display: flex; flex-direction: column; gap: 4px; }
.stepsnav__item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-soft); transition: all .2s var(--ease);
}
.stepsnav__item:hover { background: rgba(255,255,255,.75); border-color: var(--border); }
.stepsnav__item[aria-current="true"] {
  background: var(--card); border-color: var(--border);
  box-shadow: var(--shadow-sm); color: var(--text);
}
.stepsnav__no {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
  transition: all .2s var(--ease);
}
.stepsnav__item[aria-current="true"] .stepsnav__no {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.stepsnav__item.is-done .stepsnav__no { background: var(--success-soft); color: var(--success); border-color: #A7F3D0; }
.stepsnav__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.stepsnav__title { font-size: 13.5px; font-weight: 600; }
.stepsnav__sub   { font-size: 11.5px; color: var(--muted); }
.stepsnav__check { opacity: 0; color: var(--success); font-weight: 700; transition: opacity .2s; }
.stepsnav__item.is-done .stepsnav__check { opacity: 1; }
.stepsnav__item--review { margin-top: 8px; border-top: 1px dashed var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding-top: 14px; }

/* ---------------------------------------------------------------- CONTENT */
.content { min-width: 0; }
.panel { animation: fadeUp .38s var(--ease); }
.panel[hidden] { display: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.panel__head { margin-bottom: 22px; }
.panel__eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-soft); padding: 4px 11px; border-radius: 99px; margin-bottom: 12px;
}
.panel__title { font-size: 30px; }
.panel__sub   { color: var(--muted); font-size: 14.5px; margin-top: 5px; }

/* ----------------------------------------------------------------- INTRO */
.panel--intro { max-width: 940px; }
.intro {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 44px 44px 38px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.intro::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--primary) 0%, #7C6CF0 55%, var(--accent) 100%);
}
.intro__eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-soft); padding: 5px 12px; border-radius: 99px;
}
.intro__title    { font-size: 33px; margin-top: 16px; letter-spacing: -.02em; }
.intro__subtitle { color: var(--muted); font-size: 15.5px; margin-top: 8px; }

.intro__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.intro__card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.intro__card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.ticklist li { position: relative; padding-left: 24px; margin-bottom: 9px; font-size: 13.5px; line-height: 1.55; color: var(--text-soft); }
.ticklist li::before {
  content: ''; position: absolute; left: 4px; top: 8px; width: 10px; height: 6px;
  border-left: 2.2px solid var(--primary); border-bottom: 2.2px solid var(--primary);
  transform: rotate(-45deg);
}
.legend li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 11px; font-size: 13px; color: var(--text-soft); }

.picbox { margin-top: 26px; background: var(--primary-soft); border: 1px solid var(--primary-100); border-radius: var(--radius); padding: 22px; }
.picbox h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: 14px; }
.picbox__grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.picbox__hint { font-size: 12px; color: var(--muted); margin-top: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field__label em { color: var(--danger); font-style: normal; }

.intro__cta { display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.intro__meta { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- SECTION */
.section {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); margin-bottom: 22px; overflow: hidden;
}
.section__head { padding: 22px 28px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #FCFCFE 0%, #FFF 100%); }
.section__title { font-size: 19px; }
.section__desc  { font-size: 13px; color: var(--muted); margin-top: 5px; }
.section__body  { padding: 24px 28px 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 26px; }

/* -------------------------------------------------------------- PERTANYAAN */
.q { grid-column: 1 / -1; }
.q--half { grid-column: span 1; }
.q--wide { grid-column: 1 / -1; }
.q__label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; cursor: pointer; }
.q__code {
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 8px; border-radius: 6px; flex-shrink: 0;
}
.q__text { font-size: 14.5px; font-weight: 600; line-height: 1.5; flex: 1; min-width: 200px; }
.q__req  { color: var(--danger); font-weight: 800; }
.q__hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; white-space: pre-line; }
.q__error { font-size: 12.5px; font-weight: 600; color: var(--danger); margin-top: 8px; }
.q__note { margin-top: 12px; padding: 14px 16px; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.q__note-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

.q.is-invalid .input, .q.is-invalid .choices { border-color: var(--danger) !important; }
.q.is-invalid .q__error { display: block; }
.q.is-invalid { animation: shake .35s var(--ease); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-5px); }
  75%     { transform: translateX(5px); }
}

/* ----------------------------------------------------------------- BADGE */
.badge {
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
}
.badge--kritis   { background: var(--danger-soft);  color: #991B1B; }
.badge--penting  { background: var(--info-soft);    color: #075985; }
.badge--opsional { background: #F1F5F9;             color: #475569; }

/* ----------------------------------------------------------------- INPUT */
.input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card); color: var(--text);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  font-size: 14px;
}
.input::placeholder { color: #94A3B8; }
.input:hover  { border-color: var(--border-strong); }
.input:focus  { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(67, 56, 202, .12); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.6; }
.input--sm     { font-size: 13px; padding: 9px 12px; min-height: 60px; }
.input--other  { margin-top: 10px; }
.input--cell   { padding: 9px 11px; font-size: 13.5px; border-radius: 8px; }
.input--select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.picbox .input { background: #fff; }

/* --------------------------------------------------------------- CHOICES */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer;
  transition: all .18s var(--ease);
}
.choice:hover { border-color: var(--primary-100); background: #FCFCFF; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice__mark {
  width: 19px; height: 19px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  border: 2px solid var(--border-strong); background: var(--card);
  transition: all .18s var(--ease); position: relative;
}
.choice__mark--box { border-radius: 6px; }
.choice__mark::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  transform: scale(0); transition: transform .18s var(--ease);
}
.choice__mark--box::after {
  width: 10px; height: 6px; border-radius: 0; background: none;
  border-left: 2.4px solid #fff; border-bottom: 2.4px solid #fff;
  transform: rotate(-45deg) scale(0); margin-top: -3px;
}
.choice__text { font-size: 13.5px; line-height: 1.5; color: var(--text-soft); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(67,56,202,.09); }
.choice:has(input:checked) .choice__mark { border-color: var(--primary); background: var(--primary); }
.choice:has(input:checked) .choice__mark::after { transform: scale(1); }
.choice:has(input:checked) .choice__mark--box::after { transform: rotate(-45deg) scale(1); }
.choice:has(input:checked) .choice__text { color: var(--text); font-weight: 600; }
.choice:has(input:focus-visible) { outline: 3px solid rgba(67,56,202,.3); outline-offset: 2px; }

/* ---------------------------------------------------------------- SWITCH */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 40px; height: 23px; border-radius: 99px; background: var(--border-strong);
  position: relative; transition: background .2s var(--ease); flex-shrink: 0;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track::after { transform: translateX(17px); }
.switch__label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ----------------------------------------------------------------- TABLE */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.ftable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ftable thead th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ftable tbody td { padding: 9px 14px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.ftable tbody tr:last-child td { border-bottom: none; }
.ftable tbody tr:hover { background: #FCFCFE; }
.cell-label { font-weight: 600; color: var(--text); font-size: 13.5px; }
.cell-label--center { text-align: center; }
.cell-check  { text-align: center; }
.cell-radio  { text-align: center; }
.cell-action { text-align: center; width: 48px; }
.btn-row-remove {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); font-size: 16px; line-height: 1;
  display: grid; place-items: center; transition: all .16s var(--ease);
}
.btn-row-remove:hover { background: var(--danger-soft); border-color: #FCA5A5; color: var(--danger); }

.btn-add {
  margin-top: 10px; padding: 9px 15px; font-size: 12.5px; font-weight: 700;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--primary); transition: all .18s var(--ease);
}
.btn-add:hover { background: var(--primary-soft); border-color: var(--primary); border-style: solid; }

/* --------------------------------------------------------------- MODULES */
.table-wrap--modules { max-height: 620px; overflow-y: auto; }
.ftable--modules thead th { position: sticky; top: 0; z-index: 3; }
.ftable--modules thead th:not(:first-child) { text-align: center; }
.group-row td {
  background: var(--primary-soft) !important; font-weight: 700; font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--primary);
  padding: 8px 14px !important; position: sticky; top: 42px; z-index: 2;
}
.mod-no {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 9px;
  border-radius: 6px; background: var(--bg); border: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.radio-mini { display: inline-grid; place-items: center; cursor: pointer; padding: 4px; }
.radio-mini input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-mini__mark {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: var(--card); transition: all .16s var(--ease); position: relative;
}
.radio-mini input:checked + .radio-mini__mark { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px rgba(67,56,202,.14); }
.radio-mini input:checked + .radio-mini__mark::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px;
  border-radius: 50%; background: #fff;
}
.modules-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-ghost {
  padding: 8px 14px; font-size: 12.5px; font-weight: 600; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card); color: var(--text-soft);
  transition: all .18s var(--ease);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.modules-count { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-left: auto; }

/* ------------------------------------------------------------- CHECKLIST */
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.checklist__item {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; transition: all .18s var(--ease);
}
.checklist__item:hover { border-color: var(--primary-100); }
.checklist__item input { position: absolute; opacity: 0; width: 0; height: 0; }
.checklist__mark {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong);
  background: var(--card); flex-shrink: 0; position: relative; transition: all .18s var(--ease);
}
.checklist__mark::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 6px; height: 10px;
  border-left: 2.4px solid #fff; border-bottom: 2.4px solid #fff;
  transform: rotate(-45deg) scale(0); transition: transform .18s var(--ease);
}
.checklist__item:has(input:checked) { border-color: var(--success); background: var(--success-soft); }
.checklist__item:has(input:checked) .checklist__mark { border-color: var(--success); background: var(--success); }
.checklist__item:has(input:checked) .checklist__mark::after { transform: rotate(-45deg) scale(1); }
.checklist__text { font-size: 13.5px; color: var(--text-soft); }
.checklist__item:has(input:checked) .checklist__text { color: var(--text); font-weight: 600; }

/* -------------------------------------------------------------- DROPZONE */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 34px 22px; text-align: center; background: var(--bg);
  cursor: pointer; transition: all .2s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone__inner { pointer-events: none; }
.dropzone__icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 12px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--border);
  font-size: 22px; color: var(--primary);
}
.dropzone__title { font-size: 14px; font-weight: 600; color: var(--text); }
.dropzone__hint  { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.filelist { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.filelist li {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px;
}
.filelist .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.filelist .fsize { color: var(--muted); font-size: 12px; }
.filelist .fdel  { background: none; border: none; color: var(--danger); font-size: 17px; line-height: 1; padding: 0 4px; }

/* ---------------------------------------------------------------- REVIEW */
.review-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat__value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.stat__label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.stat--primary .stat__value { color: var(--primary); }
.stat--warn    .stat__value { color: var(--accent); }
.stat--ok      .stat__value { color: var(--success); }

.review-body { display: flex; flex-direction: column; gap: 14px; }
.review-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.review-block__head {
  padding: 14px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.review-block__title { font-size: 14.5px; font-weight: 700; }
.review-block__jump {
  font-size: 12px; font-weight: 700; color: var(--primary); background: none; border: none;
  padding: 5px 10px; border-radius: 7px; transition: background .16s;
}
.review-block__jump:hover { background: var(--primary-soft); }
.review-list { padding: 4px 20px 12px; }
.review-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #F1F5F9; }
.review-row:last-child { border-bottom: none; }
.review-row__q { width: 44%; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.review-row__a { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.review-row__a.is-empty { font-weight: 500; color: #B0BAC9; font-style: italic; }

.consent { margin-top: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.consent__item { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.consent__item input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.consent__text { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); }

/* ---------------------------------------------------------------- NAVBAR */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
}
.navbar__inner {
  max-width: 1280px; margin: 0 auto; height: var(--navbar-h);
  padding: 0 26px; display: flex; align-items: center; gap: 16px;
}
.navbar__info { flex: 1; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- BUTTON */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-size: 14px; font-weight: 700; transition: all .18s var(--ease); white-space: nowrap;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(67,56,202,.6); }
.btn--primary:hover:not([disabled]) { background: var(--primary-hover); transform: translateY(-1px); }
.btn--success { background: var(--success); color: #fff; box-shadow: 0 6px 16px -6px rgba(5,150,105,.6); }
.btn--success:hover:not([disabled]) { background: #047857; transform: translateY(-1px); }
.btn--ghost { background: var(--card); border-color: var(--border); color: var(--text-soft); }
.btn--ghost:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.btn--lg { padding: 14px 26px; font-size: 15px; }

/* --------------------------------------------------------------- OVERLAY */
.overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
  animation: fadeIn .2s var(--ease);
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay__card {
  background: var(--card); border-radius: var(--radius-lg); padding: 38px 46px;
  text-align: center; box-shadow: var(--shadow-lg); animation: fadeUp .3s var(--ease);
}
.spinner {
  width: 42px; height: 42px; margin: 0 auto 18px; border-radius: 50%;
  border: 3.5px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay__title { font-size: 16px; font-weight: 700; }
.overlay__sub   { font-size: 13px; color: var(--muted); margin-top: 5px; }

/* ---------------------------------------------------------------- RESULT */
.result {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  background: var(--bg); padding: 24px; overflow-y: auto;
}
.result[hidden] { display: none; }
.result__card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 48px 46px; max-width: 560px; text-align: center; box-shadow: var(--shadow-lg);
  animation: fadeUp .45s var(--ease);
}
.result__icon {
  width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; font-size: 32px; font-weight: 700;
  animation: pop .5s var(--ease);
}
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.result__title { font-size: 24px; }
.result__sub   { color: var(--muted); font-size: 14px; margin-top: 8px; }
.result__code {
  margin: 26px 0 8px; padding: 18px; background: var(--primary-soft);
  border: 1px dashed var(--primary-100); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 5px;
}
.result__code-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.result__code strong { font-size: 23px; letter-spacing: .05em; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--primary); }
.result__note { font-size: 12.5px; color: var(--muted); }
.result__actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ------------------------------------------------------------- RESPONSIVE */
/* ============================================================================
   TAMPILAN SELULER
   Sasaran: HP 360–430 px (Android & iPhone), tablet, HP lanskap
   Prinsip: sasaran sentuh ≥44 px · input ≥16 px (cegah zoom iOS) ·
            tabel lebar jadi kartu bertumpuk · tanpa geser mendatar
   ============================================================================ */

/* --- Tablet & layar sedang: sidebar jadi bilah langkah mendatar --- */
@media (max-width: 1080px) {
  /* minmax(0, 1fr) — tanpa ini grid item tidak boleh menyusut
     sehingga bilah langkah mendatar memaksa halaman jadi lebar */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-width: 0; }
  .stepsnav {
    flex-direction: row; gap: 8px; padding-bottom: 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; scrollbar-width: none;
    min-width: 0; max-width: 100%;
  }
  .stepsnav::-webkit-scrollbar { display: none; }
  .stepsnav__item {
    flex: 0 0 auto; min-width: 172px; max-width: 230px;
    scroll-snap-align: start;
    background: var(--card); border-color: var(--border);
  }
  .stepsnav__sub { display: none; }
  .stepsnav__item--review { border-top: none; margin-top: 0; padding-top: 11px; }
}

/* --- HP & tablet kecil --- */
@media (max-width: 820px) {
  :root { --navbar-h: 70px; }

  /* Cegah Safari iOS memperbesar halaman saat input difokuskan */
  .input, select.input, textarea.input { font-size: 16px; }
  .input--cell { font-size: 16px; padding: 10px 12px; }

  /* Sasaran sentuh */
  .btn, .choice, .checklist__item, .stepsnav__item, .radio-mini,
  .dropzone, .btn-ghost, .btn-add { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

  /* --- Bilah atas: ringkas, progres tetap terlihat --- */
  .topbar__inner {
    flex-wrap: wrap; height: auto;
    padding: 9px 14px 8px; gap: 8px; row-gap: 0;
  }
  .brand { flex: 1; min-width: 0; }
  .brand__mark { width: 36px; height: 36px; font-size: 14px; }
  .brand__text strong { font-size: 14px; }
  .brand__text small { display: none; }
  .topbar__actions { margin-left: 0; }
  .save-state { padding: 5px 10px; }
  .save-state__text { display: none; }
  .topbar__progress { display: block; order: 3; flex: 1 0 100%; max-width: 100%; margin: 5px 0 0; }
  .progress { height: 5px; }
  .progress__meta { margin-top: 4px; font-size: 11px; }

  /* --- Susunan utama --- */
  .layout { padding: 14px 14px calc(var(--navbar-h) + 26px); gap: 16px; }
  .sidebar { margin-bottom: 2px; }
  .sidebar__title { display: none; }

  /* --- Judul & bagian --- */
  .panel__eyebrow { font-size: 10px; padding: 3px 10px; margin-bottom: 9px; }
  .panel__title { font-size: 22px; }
  .panel__sub { font-size: 13.5px; }
  .section { border-radius: var(--radius); margin-bottom: 16px; }
  .section__head { padding: 15px 16px 12px; }
  .section__title { font-size: 17px; }
  .section__desc { font-size: 12.5px; }
  .section__body { grid-template-columns: 1fr; padding: 16px; gap: 20px; }
  .q--half { grid-column: 1 / -1; }

  /* --- Pertanyaan --- */
  .q__label { gap: 6px; margin-bottom: 8px; }
  .q__text { font-size: 14px; min-width: 0; }
  .q__code { font-size: 11px; }
  .q__hint { font-size: 12px; }
  .badge { font-size: 9.5px; padding: 3px 7px; }
  .q__note { padding: 12px; }

  /* --- Halaman pembuka --- */
  .panel--intro { max-width: none; }
  .intro { padding: 24px 18px 20px; border-radius: var(--radius); }
  .intro::before { height: 4px; }
  .intro__title { font-size: 22px; margin-top: 12px; }
  .intro__subtitle { font-size: 14px; }
  .intro__grid { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
  .intro__card { padding: 16px; }
  .intro__card h3 { font-size: 12px; }
  .ticklist li, .legend li { font-size: 13px; }
  .picbox { padding: 18px 16px; margin-top: 18px; }
  .picbox__grid { grid-template-columns: 1fr; gap: 12px; }
  .intro__cta { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 22px; }
  .intro__cta .btn { width: 100%; }
  .intro__meta { text-align: center; }

  /* --- Pilihan --- */
  .choices { grid-template-columns: 1fr; gap: 8px; }
  .choice { padding: 12px 13px; }
  .choice__text { font-size: 14px; }
  .choice__mark { width: 21px; height: 21px; }
  .checklist { grid-template-columns: 1fr; gap: 8px; }
  .checklist__item { padding: 13px; }
  .checklist__mark { width: 22px; height: 22px; }

  /* --- Tabel sederhana: kompak, geser mendatar bila perlu --- */
  .table-wrap { border-radius: var(--radius-sm); }
  .ftable { font-size: 13px; }
  .ftable thead th { padding: 9px 10px; font-size: 10px; }
  .ftable tbody td { padding: 8px 10px; }
  .cell-label { font-size: 12.5px; }
  .cell-action { width: 42px; }

  /* ========================================================
     TABEL LINGKUP MODUL → kartu bertumpuk
     ======================================================== */
  .table-wrap--modules { max-height: none; overflow: visible; }
  .ftable--modules,
  .ftable--modules > tbody { display: block; }
  .ftable--modules > thead { display: none; }

  .ftable--modules > tbody > tr.group-row {
    display: block; position: static;
    margin: 16px 8px 8px; padding: 7px 13px;
    background: var(--primary-soft); border: none; border-radius: 8px;
  }
  .ftable--modules > tbody > tr.group-row > td { padding: 0 !important; font-size: 11px; }

  .ftable--modules > tbody > tr:not(.group-row) {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; align-items: stretch;
    margin: 8px; padding: 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--card);
  }
  .ftable--modules > tbody > tr:not(.group-row) > td { display: block; padding: 0; border: 0; }
  .ftable--modules > tbody > tr:not(.group-row) > td:first-child {
    grid-column: 1 / -1; font-size: 13.5px; line-height: 1.45;
    padding-bottom: 9px !important; border-bottom: 1px solid #F1F5F9;
  }

  .ftable--modules td.cell-radio {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg); border-radius: 9px; padding: 9px 4px 8px;
  }
  .ftable--modules td.cell-radio:has(input:checked) { background: var(--primary-soft); }
  .ftable--modules .radio-mini {
    display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0;
  }
  .ftable--modules .radio-mini__mark { width: 22px; height: 22px; }
  .ftable--modules .radio-mini::after {
    content: attr(title); display: block;
    font-size: 10px; font-weight: 700; line-height: 1.25;
    color: var(--muted); text-align: center;
  }
  .ftable--modules td.cell-radio:has(input:checked) .radio-mini::after { color: var(--primary); }

  .modules-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .modules-actions .btn-ghost { width: 100%; min-height: 46px; }
  .modules-count { margin-left: 0; text-align: center; }

  /* ========================================================
     TABEL YANG BISA DITAMBAH BARIS → kartu bertumpuk
     ======================================================== */
  .table-wrap:has(tbody[data-tbody]) { overflow: visible; }
  .ftable:has(tbody[data-tbody]),
  .ftable:has(tbody[data-tbody]) > tbody { display: block; }
  .ftable:has(tbody[data-tbody]) > thead { display: none; }

  tbody[data-tbody] > tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px;
    margin: 10px; padding: 13px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--card);
  }
  tbody[data-tbody] > tr > td { display: block; padding: 0; border: 0; }
  tbody[data-tbody] > tr > td::before {
    display: block; font-size: 10px; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 4px;
  }

  /* roles → Peran | Jumlah akun | Perlu login | hapus */
  tbody[data-tbody="roles"] > tr > td:nth-child(1) { grid-column: 1 / -1; }
  tbody[data-tbody="roles"] > tr > td:nth-child(1)::before { content: "Peran"; }
  tbody[data-tbody="roles"] > tr > td:nth-child(2)::before { content: "Jumlah akun"; }
  tbody[data-tbody="roles"] > tr > td:nth-child(3) { display: flex; flex-direction: column; justify-content: center; }
  tbody[data-tbody="roles"] > tr > td:nth-child(3)::before { content: "Perlu login"; }
  tbody[data-tbody="roles"] > tr > td:nth-child(4) { grid-column: 1 / -1; text-align: right; }

  /* migration → Jenis data | Jumlah | Format | Perlu dipindah | hapus */
  tbody[data-tbody="migration"] > tr > td:nth-child(1) { grid-column: 1 / -1; }
  tbody[data-tbody="migration"] > tr > td:nth-child(1)::before { content: "Jenis data"; }
  tbody[data-tbody="migration"] > tr > td:nth-child(2)::before { content: "Jumlah"; }
  tbody[data-tbody="migration"] > tr > td:nth-child(3)::before { content: "Format sekarang"; }
  tbody[data-tbody="migration"] > tr > td:nth-child(4) { grid-column: 1 / -1; display: flex; flex-direction: column; }
  tbody[data-tbody="migration"] > tr > td:nth-child(4)::before { content: "Perlu dipindah"; }
  tbody[data-tbody="migration"] > tr > td:nth-child(5) { grid-column: 1 / -1; text-align: right; }

  /* reports → Nama laporan | Penerima | Frekuensi | Format | hapus */
  tbody[data-tbody="reports"] > tr > td:nth-child(1) { grid-column: 1 / -1; }
  tbody[data-tbody="reports"] > tr > td:nth-child(1)::before { content: "Nama laporan"; }
  tbody[data-tbody="reports"] > tr > td:nth-child(2) { grid-column: 1 / -1; }
  tbody[data-tbody="reports"] > tr > td:nth-child(2)::before { content: "Penerima"; }
  tbody[data-tbody="reports"] > tr > td:nth-child(3)::before { content: "Frekuensi"; }
  tbody[data-tbody="reports"] > tr > td:nth-child(4)::before { content: "Format"; }
  tbody[data-tbody="reports"] > tr > td:nth-child(5) { grid-column: 1 / -1; text-align: right; }

  .btn-row-remove { width: 36px; height: 36px; font-size: 20px; }
  .btn-add { width: 100%; min-height: 46px; padding: 12px; font-size: 13.5px; }

  /* Saklar lebih mudah disentuh */
  .switch { padding: 4px 0; }
  .switch__track { width: 46px; height: 27px; }
  .switch__track::after { width: 21px; height: 21px; }
  .switch input:checked + .switch__track::after { transform: translateX(19px); }
  .switch__label { font-size: 13px; }

  /* --- Unggah berkas --- */
  .dropzone { padding: 24px 16px; }
  .dropzone__title { font-size: 13.5px; }
  .filelist li { flex-wrap: wrap; gap: 6px; }

  /* --- Ringkasan --- */
  .review-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
  .stat { padding: 12px 10px; }
  .stat__value { font-size: 20px; }
  .stat__label { font-size: 10.5px; line-height: 1.3; }
  .review-block__head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .review-block__title { font-size: 13.5px; }
  .review-block__jump { min-height: 38px; }
  .review-list { padding: 4px 14px 10px; }
  .review-row { flex-direction: column; gap: 3px; padding: 11px 0; }
  .review-row__q { width: 100%; font-size: 12.5px; }
  .review-row__a { font-size: 13px; }
  .consent { padding: 16px; }
  .consent__text { font-size: 13px; }

  /* --- Bilah bawah --- */
  .navbar__inner { padding: 9px 12px 12px; gap: 8px; }
  .navbar__info { display: none; }
  .btn { min-height: 46px; padding: 12px 16px; font-size: 14px; }
  .btn--lg { min-height: 52px; width: 100%; }
  #btnPrev { flex: 0 0 40%; }
  #btnNext, #btnSubmit { flex: 1; }

  /* --- Lapisan proses & layar hasil --- */
  .overlay__card { padding: 28px 22px; }
  .result { padding: 20px 14px; align-items: start; }
  .result__card { padding: 30px 20px; border-radius: var(--radius); }
  .result__icon { width: 58px; height: 58px; font-size: 27px; }
  .result__title { font-size: 20px; }
  .result__sub { font-size: 13px; }
  .result__code { padding: 15px; margin: 20px 0 8px; }
  .result__code strong { font-size: 19px; }
  .result__actions { flex-direction: column; margin-top: 20px; }
  .result__actions .btn { width: 100%; }
}

/* --- HP kecil (≤520 px) --- */
@media (max-width: 520px) {
  .brand__mark { width: 33px; height: 33px; font-size: 13px; }
  .brand__text strong { font-size: 13px; }
  .layout { padding: 12px 12px calc(var(--navbar-h) + 22px); gap: 14px; }
  .section__body { padding: 14px; }
  .intro { padding: 20px 15px 18px; }
  .intro__title { font-size: 20px; }
  .panel__title { font-size: 20px; }

  .review-stats { grid-template-columns: 1fr 1fr; }
  .review-stats .stat:last-child { grid-column: 1 / -1; }

  tbody[data-tbody] > tr { grid-template-columns: 1fr; }
  tbody[data-tbody] > tr > td { grid-column: 1 / -1 !important; }

  .choices { gap: 7px; }
  .choice { padding: 11px 12px; }
}

/* --- HP sangat kecil (≤380 px) --- */
@media (max-width: 380px) {
  .layout { padding: 10px 10px calc(var(--navbar-h) + 20px); }
  .section__body { padding: 12px; }
  .intro__title { font-size: 19px; }
  .q__text { font-size: 13.5px; }

  /* Modul: opsi jadi satu baris mendatar per modul */
  .ftable--modules > tbody > tr:not(.group-row) { grid-template-columns: 1fr; gap: 6px; }
  .ftable--modules td.cell-radio { flex-direction: row; justify-content: center; gap: 8px; padding: 10px; }
  .ftable--modules .radio-mini { flex-direction: row; gap: 8px; }
  .ftable--modules .radio-mini::after { margin: 0; }
  .ftable--modules .radio-mini__mark { width: 24px; height: 24px; }

  .review-stats { grid-template-columns: 1fr; }
  .review-stats .stat:last-child { grid-column: auto; }
  #btnPrev { flex: 0 0 34%; }
}

/* --- HP lanskap (layar pendek) --- */
@media (max-height: 520px) and (orientation: landscape) {
  .navbar { position: static; }
  .layout { padding-bottom: 24px; }
  .stepsnav__item { min-width: 150px; }
  .panel__title { font-size: 20px; }
}

/* ----------------------------------------------------------------- PRINT */
@media print {
  .topbar, .sidebar, .navbar, .overlay, .result__actions, .save-state { display: none !important; }
  body { background: #fff; }
  .layout { display: block; padding: 0; max-width: none; }
  .section, .review-block, .stat { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  .panel[hidden] { display: block !important; }
  .result { position: static; background: #fff; padding: 0; }
}
