/* Tema mengikuti logo TM Consultant: biru tua #023C6A dan abu #B3B4B8 */
/* Font Poppins (SIL Open Font License, lihat fonts/Poppins-OFL.txt) disimpan di aplikasi */
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/poppins-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/poppins-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/poppins-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/poppins-latin-700-normal.woff2') format('woff2');
}

:root {
  --navy: #023C6A;
  --navy-dark: #012A4B;
  --navy-soft: #E6EEF5;
  --gray: #B3B4B8;
  --gray-light: #F3F4F6;
  --text: #1F2933;
  --muted: #5F6B7A;
  --border: #D5D8DD;
  --ok: #1E7B46;
  --ok-bg: #E5F4EA;
  --warn: #9A6200;
  --warn-bg: #FFF4DC;
  --err: #B42318;
  --err-bg: #FDECEA;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--gray-light);
  min-height: 100vh; display: flex; flex-direction: column;
}
[hidden] { display: none !important; }

.topbar { background: #fff; border-bottom: 4px solid var(--navy); }
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo { height: 38px; width: auto; }
.app-name {
  font-weight: 600; color: var(--navy); font-size: 17px; letter-spacing: .2px;
  padding-left: 16px; border-left: 2px solid var(--gray);
}
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.user-box span { overflow-wrap: anywhere; font-weight: 600; color: var(--navy); }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: 0 1px 2px rgba(2, 60, 106, .06);
}
.card.narrow { max-width: 420px; margin: 32px auto; }
h1 { font-size: 21px; margin: 0 0 6px; color: var(--navy); }
h2 { font-size: 17px; margin: 0; color: var(--navy); }
.muted { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
code { white-space: nowrap; background: var(--navy-soft); color: var(--navy); padding: 1px 4px; border-radius: 4px; font-size: 13px; }
.center-msg { text-align: center; color: var(--muted); padding: 60px 0; }

.layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

label { display: block; font-weight: 500; font-size: 14px; margin: 12px 0 4px; }
.field label { color: var(--navy); }
input, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); background: var(--err-bg); }

.btn {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  border-radius: 8px; padding: 9px 18px; border: 1px solid transparent;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-dark); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--gray); }
.btn-ghost:hover:not(:disabled) { background: var(--navy-soft); }
.btn-sm { padding: 5px 12px; font-size: 14px; }
.btn-block { width: 100%; margin-top: 16px; }
.link { background: none; border: 0; padding: 0; margin-top: 14px; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.msg { font-size: 14px; margin-top: 12px; }
.msg:empty { display: none; }
.msg.err { color: var(--err); background: var(--err-bg); padding: 8px 10px; border-radius: 8px; }
.msg.ok { color: var(--ok); background: var(--ok-bg); padding: 8px 10px; border-radius: 8px; }

.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.history { list-style: none; margin: 0; padding: 0; }
.history > li { border-top: 1px solid var(--border); padding: 12px 0; }
.history > li:first-child { border-top: 0; }
.h-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.h-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.h-perlu { margin-top: 6px; font-size: 13px; color: var(--muted); }
.h-perlu summary { cursor: pointer; color: var(--warn); font-weight: 600; }
.h-perlu ul { margin: 4px 0 0; padding-left: 18px; }
.rev-panel { margin-top: 10px; padding: 12px; background: var(--navy-soft); border-radius: 8px; }
.rev-title { font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.rev-hint { font-size: 13px; color: var(--navy); background: #fff; border-left: 3px solid var(--navy); padding: 6px 8px; border-radius: 4px; margin: 6px 0 4px; }
.h-sudah { font-size: 12px; color: var(--muted); max-width: 110px; text-align: center; }
.rev-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.rev-label { font-size: 13px; font-weight: 600; margin: 10px 0 3px; color: var(--text); }
.rev-panel input, .rev-panel textarea { font-size: 14px; }
.h-main { min-width: 0; }
.h-title { font-weight: 600; overflow-wrap: anywhere; }
.h-meta { color: var(--muted); font-size: 13px; }
.h-err { color: var(--err); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
.badge.diproses { color: var(--warn); background: var(--warn-bg); }
.badge.selesai { color: var(--ok); background: var(--ok-bg); }
.badge.gagal { color: var(--err); background: var(--err-bg); }

/* ---------- Halaman login dua panel ---------- */
body.is-login .topbar, body.is-login .foot { display: none; }
body.is-login main { max-width: none; padding: 0; display: flex; }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; width: 100%; }
.brand-panel {
  background: radial-gradient(circle at 15% 15%, #0a5a96 0%, var(--navy) 45%, var(--navy-dark) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px 40px;
  position: relative; overflow: hidden;
}
.brand-panel::after {  /* aksen lengkung kecil di pojok, tidak menyentuh teks */
  content: ''; position: absolute; right: -110px; bottom: -110px; width: 240px; height: 240px;
  border-radius: 50%; border: 32px solid rgba(255,255,255,.05); pointer-events: none;
}
@media (max-width: 1100px) { .brand-panel::after { display: none; } }
.brand-isi { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.brand-logo { display: block; width: 200px; height: auto; filter: brightness(0) invert(1); }
.brand-garis { display: block; width: 48px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.55); margin: 32px 0 24px; }
.brand-title { color: #fff; font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -.3px; margin: 0 0 8px; }
.brand-by { display: block; font-size: 17px; font-weight: 500; letter-spacing: .3px; color: rgba(255,255,255,.75); margin-top: 6px; }
.brand-tagline { margin-top: 14px !important; font-size: 16px; line-height: 1.5; font-weight: 400; color: rgba(255,255,255,.8); margin: 0; letter-spacing: .2px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--gray-light); }
.login-card { width: 100%; max-width: 400px; padding: 32px; box-shadow: 0 10px 30px rgba(2,60,106,.08); }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .brand-panel { padding: 32px 24px; justify-content: flex-start; }
  .brand-panel::after { display: none; }
  .brand-isi { max-width: 400px; margin: 0 auto; }
  .brand-logo { width: 150px; }
  .brand-garis { margin: 20px 0 14px; width: 36px; }
  .brand-title { font-size: 26px; }
  .brand-tagline { font-size: 14px; }
  .brand-by { font-size: 14px; margin-top: 4px; }
  .login-panel { align-items: flex-start; padding: 24px 16px 32px; }
}

/* ---------- Riwayat per SOP ---------- */
.history > li.sop-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; transition: box-shadow .15s, border-color .15s; }
.history > li.sop-card:first-child { border-top: 1px solid var(--border); }
.history > li.sop-card:hover { border-color: var(--gray); box-shadow: 0 4px 14px rgba(2,60,106,.07); }
.ver-badge { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: #fff; background: var(--navy); padding: 1px 7px; border-radius: 999px; vertical-align: 2px; }
.ver-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ver-label { font-size: 12px; color: var(--muted); }
.chip { font: inherit; font-size: 12px; font-weight: 500; color: var(--navy); background: var(--navy-soft); border: 1px solid transparent; border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.chip:hover { border-color: var(--navy); }

/* ---------- Indikator proses ---------- */
.proses { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; background: var(--warn-bg); border-radius: 8px; font-size: 13px; color: var(--warn); }
.proses-est { margin-left: auto; font-size: 12px; opacity: .8; white-space: nowrap; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(154,98,0,.25); border-top-color: var(--warn); border-radius: 50%; animation: putar .8s linear infinite; flex-shrink: 0; }
@keyframes putar { to { transform: rotate(360deg); } }

/* ---------- Notifikasi ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 50; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 12px; background: #fff; border-left: 5px solid var(--ok); border-radius: 10px; padding: 12px 12px 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); width: 360px; max-width: 100%; animation: masuk .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.err { border-left-color: var(--err); }
.toast.hide { opacity: 0; transform: translateY(8px); }
.toast-text { flex: 1; font-size: 14px; }
.toast-x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
@keyframes masuk { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Penyempurnaan form ---------- */
.progres { margin: 4px 0 6px; }
.progres-teks { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.progres-bar { height: 6px; background: var(--navy-soft); border-radius: 999px; overflow: hidden; }
.progres-bar span { display: block; height: 100%; width: 0; background: var(--navy); border-radius: 999px; transition: width .3s ease, background .3s; }
.progres.lengkap .progres-teks { color: var(--ok); }
.progres.lengkap .progres-bar span { background: var(--ok); }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; }
.field-head label { margin: 0; display: inline-flex; align-items: center; gap: 7px; }
.ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--navy-soft); color: var(--navy); flex-shrink: 0; }
.cek { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; transform: scale(0); transition: transform .2s ease; }
.field.terisi .cek { transform: scale(1); }
.contoh-btn { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12px; font-weight: 500; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.contoh-box { background: var(--navy-soft); border-left: 3px solid var(--navy); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.contoh-label { font-weight: 600; color: var(--navy); margin-bottom: 2px; font-size: 12px; }
.contoh-isi { white-space: pre-line; color: var(--text); }

/* ---------- Sentuhan kecil ---------- */
.sapaan { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.sapaan span { color: var(--navy); font-weight: 600; }
.kosong { text-align: center; padding: 22px 10px 14px; }
.kosong-ilustrasi { display: block; margin: 0 auto 10px; }
.kosong-judul { font-weight: 600; color: var(--navy); font-size: 15px; }
.kosong-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* efek halus saat kursor diarahkan */
.btn { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease, color .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(2,60,106,.18); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { border-color: var(--navy); }
.chip, .contoh-btn, .link, .h-perlu summary { transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.chip:hover { background: #fff; }
.contoh-btn:hover { color: var(--navy-dark); }
.history > li.sop-card { transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease; }
.history > li.sop-card:hover { transform: translateY(-2px); }
.card { transition: box-shadow .2s ease; }
.layout > .card:hover { box-shadow: 0 8px 24px rgba(2,60,106,.08); }
input, textarea { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
input:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--gray); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Tombol mata password ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-mata { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; transition: color .15s ease, background-color .15s ease; }
.pw-mata:hover { color: var(--navy); background: var(--navy-soft); }
.pw-mata:focus-visible { outline: 2px solid var(--navy); }

/* ---------- Saran AI ---------- */
.opsional { font-weight: 400; color: var(--muted); font-size: 12px; }
.field-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-opsional .ico { background: #F1EAFB; color: #6B3FA0; }
.h-saran { margin-top: 6px; font-size: 13px; }
.h-saran summary { cursor: pointer; color: #6B3FA0; font-weight: 600; }
.h-saran ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.h-saran li { background: #F7F3FC; border-radius: 6px; padding: 6px 8px; color: var(--text); }
.saran-bagian { display: inline-block; font-size: 11px; font-weight: 600; color: #6B3FA0; background: #EADFF7; border-radius: 999px; padding: 0 7px; margin-right: 6px; }
.saran-catatan { font-size: 12px; color: var(--muted); margin-top: 6px; }
.rev-saran { display: grid; gap: 6px; margin: 6px 0 4px; }
.rev-cek { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 13px; margin: 0; background: #fff; border-radius: 6px; padding: 7px 9px; cursor: pointer; border: 1px solid transparent; transition: border-color .15s ease; }
.rev-cek:hover { border-color: #C9B5E6; }
.rev-cek input { width: auto; margin-top: 3px; accent-color: var(--navy); }

/* ---------- Kartu riwayat ringkas ---------- */
.h-ringkas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-perlu, .tag-saran { font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 9px; }
.tag-perlu { color: var(--warn); background: var(--warn-bg); }
.tag-saran { color: #6B3FA0; background: #F1EAFB; }
.chip-lagi { text-decoration: none; background: #fff; border: 1px dashed var(--gray); }
.h-actions a.btn { text-decoration: none; text-align: center; white-space: nowrap; }

/* ---------- Halaman detail & revisi ---------- */
.detail-wrap { max-width: 1120px; margin: 0 auto; }
.link-kembali { display: inline-block; color: var(--navy); font-weight: 500; font-size: 14px; text-decoration: none; margin-bottom: 14px; }
.link-kembali:hover { text-decoration: underline; }
.detail-kepala { margin-bottom: 18px; }
.detail-kepala .h-row { align-items: center; }
.detail-judul { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.detail-judul .ver-badge { font-size: 13px; vertical-align: middle; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid h2 { margin-bottom: 12px; }
.rev-form .rev-hint { margin: 0 0 14px; background: var(--navy-soft); }
.rev-seksi { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.rev-seksi:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.rev-seksi h3 { font-size: 15px; margin: 0 0 4px; color: var(--navy); }
.rev-seksi h3.judul-saran { color: #6B3FA0; }
.rev-seksi h3.judul-perlu { color: var(--warn); }
.rev-seksi-kepala { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-kecil { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--navy); text-decoration: underline; cursor: pointer; }
.rev-form .rev-saran .rev-cek { background: #F7F3FC; }
.rev-form .rev-label { margin-top: 10px; }
.rev-form textarea { margin-top: 6px; }
.ver-list { list-style: none; margin: 0; padding: 0; }
.ver-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.ver-list li:first-child { border-top: 0; padding-top: 0; }
.ver-baris { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ver-baris .ver-badge { margin-left: 0; }
.ver-baris .badge { margin-right: 0; }
.ver-ket { font-size: 12px; color: var(--muted); margin-top: 4px; }

a.btn { text-decoration: none; display: inline-block; text-align: center; }

/* =====================================================================
   POLESAN TAMPILAN (tata letak tetap; hanya warna, bayangan, sudut, gerak)
   ===================================================================== */
:root {
  --border: #E3E8EF;
  --muted: #64748B;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 10px 28px rgba(2, 60, 106, .09);
  --grad: linear-gradient(135deg, #012A4B 0%, #023C6A 55%, #0A5A96 100%);
  --sky: #38BDF8;
}
body {
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(56, 189, 248, .10), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(2, 60, 106, .07), transparent 60%),
    #F4F6FA;
}

/* header: putih bening, garis bawah bergradasi, menempel saat digulir */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 0; box-shadow: 0 1px 0 var(--border);
}
.topbar::after { content: ''; display: block; height: 3px; background: linear-gradient(90deg, var(--navy), var(--sky)); }

/* kartu */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow-sm); }
.layout > .card:hover, .detail-grid > .card:hover { box-shadow: var(--shadow-md); }
h1 { letter-spacing: -.2px; }
.sapaan { font-size: 14px; }

/* tombol */
.btn { border-radius: 11px; }
.btn-primary { background: var(--grad); box-shadow: 0 4px 12px rgba(2, 60, 106, .22); }
.btn-primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.08); box-shadow: 0 8px 20px rgba(2, 60, 106, .28); }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--navy); background: var(--navy-soft); }

/* isian */
input, textarea { border-radius: 12px; border-color: var(--border); background: #FBFCFE; }
input:focus, textarea:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(2, 60, 106, .10); }
.field.terisi input, .field.terisi textarea { border-color: #B7E1C6; background: #fff; }
.ico { border-radius: 9px; background: linear-gradient(135deg, #E6EEF5, #F1F7FC); box-shadow: inset 0 0 0 1px rgba(2, 60, 106, .06); }

/* penanda kemajuan */
.progres { background: #F8FAFC; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.progres-bar { height: 8px; }
.progres-bar span { background: linear-gradient(90deg, var(--sky), var(--navy)); }
.progres.lengkap .progres-bar span { background: linear-gradient(90deg, #4ADE80, var(--ok)); }

/* kartu riwayat: garis warna status di sisi kiri */
.history > li.sop-card { border-radius: 14px; position: relative; overflow: hidden; padding-left: 18px; background: #fff; }
.history > li.sop-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ok); opacity: .85; }
.history > li.sop-card.st-diproses::before { background: linear-gradient(180deg, var(--sky), var(--navy)); }
.history > li.sop-card.st-gagal::before { background: var(--err); }
.history > li.sop-card.st-perlu::before { background: #F59E0B; }
.history > li.sop-card:hover { border-color: #BFDBFE; box-shadow: var(--shadow-md); }
.h-title { font-size: 15px; }
.ver-badge { background: var(--grad); }
.badge { padding: 2px 9px; }
.chip { background: #F1F5F9; }
.chip:hover { background: var(--navy-soft); border-color: transparent; }
.proses { background: linear-gradient(90deg, #EFF6FF, #FEF9EC); color: var(--navy); }
.spinner { border-color: rgba(2, 60, 106, .18); border-top-color: var(--navy); }

/* riwayat kosong & notifikasi */
.toast { border-radius: 14px; border-left-width: 0; box-shadow: 0 16px 36px rgba(15, 23, 42, .18); }
.toast::before { content: ''; width: 6px; align-self: stretch; border-radius: 6px; background: var(--ok); }
.toast.err::before { background: var(--err); }

/* halaman detail */
.detail-kepala { background: linear-gradient(135deg, #fff 60%, #F0F7FD); }
.rev-cek { border-radius: 10px; transition: border-color .15s, background-color .15s, transform .15s; }
.rev-cek:hover { transform: translateY(-1px); }
.rev-cek:has(input:checked) { border-color: #C4B5FD; background: #F5F0FF; }
.ver-list li { border-radius: 10px; }

/* gerak masuk halus */
@keyframes naik { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#viewApp .card, #viewDetail .card, .history > li { animation: naik .35s ease both; }
.history > li:nth-child(2) { animation-delay: .04s; } .history > li:nth-child(3) { animation-delay: .08s; }
.history > li:nth-child(4) { animation-delay: .12s; } .history > li:nth-child(5) { animation-delay: .16s; }

/* =====================================================================
   OPSI B: header navy + pita navy di belakang kartu
   ===================================================================== */
body:not(.is-login) { background: linear-gradient(180deg, #012A4B 0, #023C6A 190px, #F4F6FA 190px, #F4F6FA 100%); }
.topbar { background: #012A4B; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar::after { background: rgba(255,255,255,.12); height: 1px; }
.logo { filter: brightness(0) invert(1); }
.app-name { color: #fff; border-left-color: rgba(255,255,255,.35); }
.user-box span { color: #fff; }
.user-box .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.user-box .btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.2); border-color: #fff; }
.link-kembali { color: #fff; }
.card { border: 0; box-shadow: 0 12px 32px rgba(2, 30, 60, .14); }
.layout > .card:hover, .detail-grid > .card:hover { box-shadow: 0 16px 40px rgba(2, 30, 60, .18); }
.history > li.sop-card { border-color: #EEF1F5; }

/* ---------- HP (≤ 600px): header satu baris, tombol di bawah judul ---------- */
@media (max-width: 600px) {
  body:not(.is-login) { background: linear-gradient(180deg, #012A4B 0, #023C6A 140px, #F4F6FA 140px, #F4F6FA 100%); }
  .topbar-inner { flex-wrap: nowrap; gap: 10px; padding: 14px 14px 12px; }
  .logo { height: 28px; }
  .app-name { font-size: 14px; padding-left: 10px; white-space: nowrap; }
  .user-box { gap: 0; }
  .user-box span { display: none; }               /* nama sudah tampil di sapaan */
  .user-box .btn { padding: 6px 12px; font-size: 13px; }
  main { padding: 16px 12px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  h1 { font-size: 21px; }

  /* kartu riwayat & kepala detail: tombol pindah ke bawah, lebar penuh */
  .history .h-row, .detail-kepala .h-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .history .h-actions, .detail-kepala .h-row > :last-child { flex-direction: row; width: 100%; }
  .history .h-actions .btn, .detail-kepala .h-row > :last-child .btn { flex: 1; }
  .detail-judul { font-size: 21px; }
  .h-sudah { max-width: none; }
}

/* ---------- tablet rebah (861–1100px): kolom riwayat sempit, tombol pindah ke bawah judul ---------- */
@media (min-width: 861px) and (max-width: 1100px) {
  .history .h-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .history .h-actions { flex-direction: row; width: 100%; }
  .history .h-actions .btn { flex: 1; }
  .h-sudah { max-width: none; }
}

/* =====================================================================
   MENU UTAMA (Portal AI): kotak pilihan alat + halaman "Coming soon"
   ===================================================================== */
body.is-home { background: linear-gradient(180deg, #012A4B 0, #023C6A 232px, #F4F6FA 232px, #F4F6FA 100%); }
.sambut { color: #fff; margin: 14px 0 64px; }
.sambut-halo { font-size: 15px; opacity: .8; }
.sambut h1 { color: #fff; font-size: 28px; margin: 2px 0 4px; }
.sambut p { margin: 0; font-size: 15px; opacity: .8; }
.ubin { display: grid; grid-template-columns: repeat(auto-fill, 200px); gap: 18px; }
.alat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  aspect-ratio: 1 / 1; padding: 16px; text-align: center; text-decoration: none;
  background: #fff; border-radius: 20px; box-shadow: 0 12px 32px rgba(2, 30, 60, .14);
  transition: transform .2s ease, box-shadow .2s ease;
}
.alat:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(2, 30, 60, .22); }
.alat:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.alat-ikon {
  width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #023C6A, #0A5A96); box-shadow: 0 10px 22px rgba(2, 60, 106, .3);
}
.alat-notulen .alat-ikon, .segera-ikon { background: linear-gradient(135deg, #0E7490, #22B8CF); box-shadow: 0 10px 22px rgba(14, 116, 144, .3); }
.alat-judul { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.3; }
#viewHome .alat { animation: naik .35s ease both; }
#viewHome .alat:nth-child(2) { animation-delay: .05s; }

.segera { max-width: 560px; margin: 8px auto 0; text-align: center; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.segera-ikon { width: 84px; height: 84px; border-radius: 24px; }
.segera-label { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: #FEF3C7; color: #B45309; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.segera h1 { margin: 2px 0 0; }
.segera p { max-width: 420px; margin: 0 0 10px; }
#viewApp > .link-kembali, #viewSegera > .link-kembali { display: inline-block; margin-bottom: 14px; }

@media (max-width: 600px) {
  body.is-home { background: linear-gradient(180deg, #012A4B 0, #023C6A 206px, #F4F6FA 206px, #F4F6FA 100%); }
  .sambut { margin: 6px 0 48px; }
  .sambut h1 { font-size: 22px; }
  .ubin { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .alat { border-radius: 16px; gap: 10px; padding: 10px; }
  .alat-ikon { width: 48px; height: 48px; border-radius: 14px; }
  .alat-ikon svg { width: 24px; height: 24px; }
  .alat-judul { font-size: 13px; }
  .segera { padding: 32px 18px; }
}
