:root {
  --blue: #00529C; --blue-deep: #003D73; --blue-tint: #E8F0F8;
  --paper: #F4F6F9; --surface: #FFFFFF; --ink: #1B2430; --muted: #5B6675; --line: #D9DEE5; --soft: #EEF1F4;
  --red: #B42318; --red-tint: #FDECEA; --amber: #B54708; --amber-tint: #FEF3E2; --green: #1F7A4D; --green-tint: #E7F4EC;
  --r: 6px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-feature-settings: "tnum" 1; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #7FB2E5; outline-offset: 2px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.015em; }
h2 { font-size: 1.05rem; margin: 0; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 68ch; }
.sub { color: var(--muted); font-size: .86rem; }

/* shell */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand .mark { height: 28px; padding: 0 7px; border-radius: 6px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: var(--r); font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--blue); background: var(--blue-tint); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .75rem; text-align: center; }
.who { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: .9rem; }
.role { font-size: .75rem; padding: 1px 7px; border-radius: 10px; background: var(--soft); color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 32px; padding-bottom: 64px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--blue); background: var(--blue); color: #fff;
  padding: 9px 16px; border-radius: var(--r); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-tint); }
.btn.danger { background: transparent; color: var(--red); border-color: #E8B4AE; }
.btn.danger:hover { background: var(--red-tint); }
.btn.small { padding: 5px 11px; font-size: .86rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 16px 0 6px; }
.opt { font-weight: 400; color: var(--muted); font-size: .84rem; }
input[type=text], input[type=email], input[type=password], input[type=date], select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); font: inherit; color: var(--ink); background: #fff; }
.invalid input, .invalid select, .invalid .file { border-color: var(--red); }
.err { color: var(--red); font-size: .84rem; margin-top: 4px; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid; }
.flash.error { background: var(--red-tint); border-color: #F3C2BC; color: #7A1A12; }
.flash.success { background: var(--green-tint); border-color: #B9DEC9; color: #155437; }
.flash.info { background: var(--blue-tint); border-color: #C3D7EC; color: #073B6C; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chip.menunggu { background: var(--amber-tint); color: var(--amber); }
.chip.aktif, .chip.selesai { background: var(--green-tint); color: var(--green); }
.chip.diproses { background: var(--blue-tint); color: var(--blue); }
.chip.ditolak, .chip.nonaktif, .chip.gagal { background: var(--red-tint); color: var(--red); }

/* auth */
.auth { display: grid; grid-template-columns: 1fr 420px; gap: 56px; align-items: center; min-height: calc(100vh - 160px); }
.auth-copy h1 { font-size: 2.1rem; max-width: 16ch; }
.auth-copy ol { padding-left: 20px; color: var(--muted); max-width: 44ch; }
.auth-copy li { margin-bottom: 8px; }
.auth-copy li strong { color: var(--ink); }
.auth .panel { padding: 28px; }
.auth .panel h2 { font-size: 1.25rem; margin-bottom: 4px; }
.auth-foot { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }
.done { max-width: 520px; margin: 64px auto; text-align: center; }
.done .icon { width: 52px; height: 52px; border-radius: 50%; background: var(--green-tint); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; font-size: 26px; }

/* tables */
.table-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.rowlink { color: var(--ink); font-weight: 600; text-decoration: none; }
.rowlink:hover { color: var(--blue); }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.search { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.search input { max-width: 420px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .n { font-size: .78rem; margin-left: 4px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* form analisa */
.form-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.steps { position: sticky; top: 20px; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; padding: 10px 0; color: var(--muted); }
.steps .no { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .82rem; font-weight: 700; background: #fff; }
.steps li.ok { color: var(--ink); }
.steps li.ok .no { background: var(--blue); border-color: var(--blue); color: #fff; }
.section { margin-bottom: 16px; }
.section h2 { margin-bottom: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.file { border: 1.5px dashed #AEB8C4; border-radius: 8px; padding: 18px; background: #FBFCFD; display: flex; gap: 14px; align-items: center; }
.file .ic { flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.file .meta { flex: 1; min-width: 0; }
.file .name, .file .meta .sub { display: block; }
.file .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file input { display: none; }
.file.has { border-style: solid; border-color: var(--blue); background: #fff; }
.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }

/* detail */
.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--muted); font-size: .9rem; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 24px; align-items: start; }
.kv { display: grid; grid-template-columns: 170px 1fr; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--soft); }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { font-weight: 500; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--soft); }
.timeline li:last-child::after { display: none; }
.timeline li.ok { color: var(--ink); } .timeline li.ok::before { background: var(--green); }
.timeline li.now { color: var(--ink); font-weight: 600; } .timeline li.now::before { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-tint); }
.output { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; }
.output .ic { flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--green-tint); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.output div { flex: 1; }
.files-list a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--soft); text-decoration: none; color: var(--ink); }
.files-list a:last-child { border-bottom: 0; }
.files-list a:hover .fname { color: var(--blue); text-decoration: underline; }

@media (max-width: 860px) {
  .auth, .form-grid, .cols, .two { grid-template-columns: 1fr; }
  .auth-copy { display: none; }
  .steps { display: none; }
  .topbar .wrap { flex-wrap: wrap; height: auto; padding: 10px 24px; gap: 8px 16px; }
  .kv { grid-template-columns: 1fr; } .kv dt { border-bottom: 0; padding-bottom: 0; }
}

/* hasil */
.result { display: flex; gap: 24px; align-items: center; }
.score { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; flex: none; }
.score .num { font-size: 3.6rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.score .of { color: var(--muted); }
.score.TINGGI .num { color: var(--red); } .score.SEDANG .num { color: var(--amber); } .score.RENDAH .num { color: var(--green); }
.chip.lv-TINGGI, .chip.st-MATCH { background: var(--red-tint); color: var(--red); }
.chip.lv-SEDANG, .chip.st-PARTIAL { background: var(--amber-tint); color: var(--amber); }
.chip.lv-RENDAH { background: var(--green-tint); color: var(--green); }
.finding { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 12px 0; }
.finding.MATCH { border-left-color: var(--red); } .finding.PARTIAL { border-left-color: #E9A23B; }
.finding p { margin: 4px 0 0; }
.timeline li.fail { color: var(--red); font-weight: 600; } .timeline li.fail::before { background: var(--red); }
@media (max-width: 860px) { .result { flex-direction: column; align-items: flex-start; } }

.output .ic.doc { background: var(--blue-tint); color: var(--blue); }

.role-box { background: var(--blue-tint); border-radius: var(--r); padding: 10px 14px; margin: 12px 0; font-weight: 600; }
.role-box span { display: block; font-size: .78rem; font-weight: 600; color: var(--blue); }
.prose { max-width: 80ch; margin: 0 0 10px; }
.todo { margin: 10px 0 0; padding-left: 22px; } .todo li { margin-bottom: 8px; max-width: 85ch; }

.suggest { border-left: 4px solid var(--amber); }
.suggest.ok { border-left-color: var(--green); }
.suggest-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.suggest-head h2 { margin: 2px 0 0; font-size: 1.15rem; }
.reasons { margin: 10px 0 0; padding-left: 20px; } .reasons li { margin-bottom: 4px; }
.verdict-ok { color: var(--green); font-weight: 600; margin: 12px 0 0; }
.verdict-diff { background: var(--amber-tint); color: #6B3A06; padding: 10px 12px; border-radius: var(--r); margin: 12px 0 10px; }
