/* ============================================================
   SI-AMI STIKES RSPAD Gatot Soebroto
   ============================================================ */
:root {
  --brand:        #16643c;   /* hijau institusi */
  --brand-dark:   #0f4a2c;
  --brand-light:  #e6f2ec;
  --accent:       #c49a2a;   /* emas */
  --navy:         #1f2d3d;
  --bg:           #f4f6f8;
  --card:         #ffffff;
  --text:         #253141;
  --muted:        #6b7888;
  --border:       #e2e7ec;
  --danger:       #c0392b;
  --warn:         #b8860b;
  --ok:           #1e8449;
  --info:         #2471a3;
  --radius:       10px;
  --shadow:       0 1px 3px rgba(16,30,50,.08), 0 1px 2px rgba(16,30,50,.06);
  --shadow-lg:    0 10px 30px rgba(16,30,50,.12);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); margin: 0 0 .4em; line-height: 1.25; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 255px; background: var(--navy); color: #cdd6e0; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 18px 20px; display: flex; gap: 12px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo {
  width: 42px; height: 42px; border-radius: 9px; background: var(--brand);
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 18px;
  border: 2px solid var(--accent); flex-shrink: 0;
}
.sidebar .brand .logo-img { width: 44px; height: 44px; border-radius: 9px; object-fit: contain;
  background: #fff; padding: 3px; flex-shrink: 0; }
.sidebar .brand b { color: #fff; font-size: 16px; display: block; }
.sidebar .brand span { font-size: 11.5px; color: #9fb0c2; }
.nav { padding: 10px 0; overflow-y: auto; flex: 1; }
.modesw { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 12px 12px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 3px; }
.modesw a { flex: 1 1 auto; text-align: center; padding: 7px 6px; font-size: 12.5px; font-weight: 700;
  color: #cdd6e0; border-radius: 6px; letter-spacing: 0; white-space: nowrap; }
.modesw a:hover { text-decoration: none; color: #fff; }
.modesw a.on { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.nav .group { padding: 14px 20px 6px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: #7d8da0; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 20px; color: #cdd6e0;
  font-size: 14px; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.05); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(22,100,60,.25); border-left-color: var(--accent); color: #fff; }
.nav a .ic { width: 18px; text-align: center; opacity: .9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 26px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
}
.topbar .who { text-align: right; font-size: 13px; }
.topbar .who b { color: var(--navy); }
.topbar .who small { color: var(--muted); }
.content { padding: 26px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.role-super_admin { background: #e8e0f6; color: #5b2a8a; }
.badge.role-admin_lpmi  { background: var(--brand-light); color: var(--brand-dark); }
.badge.role-waket1      { background: #fdebd0; color: #9c640c; }
.badge.role-auditor     { background: #d6eaf8; color: #1a5276; }
.badge.role-kaprodi     { background: #d5f5e3; color: #196f3d; }
.badge.role-unit        { background: #eaecee; color: #515a5a; }
.badge.gray  { background: #eaecee; color: #566; }
.badge.green { background: #d5f5e3; color: #196f3d; }
.badge.gold  { background: #fdebd0; color: #9c640c; }
.badge.blue  { background: #d6eaf8; color: #1a5276; }
.badge.red   { background: #fadbd8; color: #922b21; }

.status-dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:5px; }
.status-persiapan  { background:#95a5a6; } .st-persiapan{color:#7f8c8d}
.status-berlangsung{ background:#27ae60; } .st-berlangsung{color:#1e8449}
.status-penilaian  { background:#2980b9; } .st-penilaian{color:#1f618d}
.status-selesai    { background:#8e44ad; } .st-selesai{color:#6c3483}

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; }
.card .card-head { padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .card-head h3 { margin: 0; font-size: 16px; }
.card .card-body { padding: 18px; }
.card.flush .card-body { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }

.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: var(--brand-light); color: var(--brand); flex-shrink: 0; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- Tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl th { background: #fafbfc; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .03em; font-weight: 700; }
table.tbl tbody tr:hover { background: #fafcfb; }
table.tbl td.num, table.tbl th.num { text-align: center; }

/* ---------- Progress ---------- */
.progress { height: 8px; background: #edf1f4; border-radius: 999px; overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,100,60,.12); }
textarea { resize: vertical; min-height: 90px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 1px solid transparent;
  border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; background: #eef1f4; color: var(--navy); }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.accent  { background: var(--accent); color: #fff; }
.btn.danger  { background: var(--danger); color: #fff; }
.btn.ghost   { background: #fff; border-color: var(--border); color: var(--navy); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; border: 1px solid; font-size: 14px; }
.alert.success { background: #eafaf1; border-color: #abebc6; color: #196f3d; }
.alert.danger  { background: #fdedec; border-color: #f5b7b1; color: #922b21; }
.alert.info    { background: #eaf2f8; border-color: #aed6f1; color: #1f618d; }
.alert.warn    { background: #fef9e7; border-color: #f9e79f; color: #9a7d0a; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 23px; margin-bottom: 3px; }
.page-head p { color: var(--muted); margin: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }

/* ---------- Instrumen butir ---------- */
.butir { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; background: #fff; overflow: hidden; }
.butir > .butir-head { padding: 14px 16px; background: #fafbfc; border-bottom: 1px solid var(--border); }
.butir .kode { font-weight: 800; color: var(--brand); }
.butir .pernyataan { font-weight: 600; color: var(--navy); margin-top: 3px; }
.butir .indikator { font-size: 13px; color: var(--muted); margin-top: 5px; }
.butir .butir-body { padding: 16px; }
.bukti-list { list-style: none; margin: 10px 0 0; padding: 0; }
.bukti-list li { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 7px; background: #fcfdfe; font-size: 14px; }
.bukti-list li .ic { color: var(--brand); }
.bukti-list li .nm { flex: 1; }

.kategori-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-light); }
.kategori-title .kk { background: var(--brand); color: #fff; padding: 3px 10px; border-radius: 7px; font-size: 13px; font-weight: 700; }
.kategori-title h3 { margin: 0; font-size: 16px; }

.mini { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, var(--brand-dark), var(--navy)); }
.login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 410px; overflow: hidden; }
.login-card .head { background: var(--brand); color: #fff; padding: 26px; text-align: center; }
.login-card .head .logo { width: 64px; height: 64px; border-radius: 14px; background: #fff; color: var(--brand);
  display: grid; place-items: center; font-size: 28px; font-weight: 800; margin: 0 auto 12px; border: 3px solid var(--accent); }
.login-card .head h2 { color: #fff; margin: 0; font-size: 20px; }
.login-card .head p { margin: 4px 0 0; font-size: 13px; opacity: .9; }
.login-card .body { padding: 26px; }
.login-demo { font-size: 12px; color: var(--muted); margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 12px; }

/* ---------- Modal (pure CSS via :target) ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,30,45,.55); display: none; place-items: center;
  z-index: 100; padding: 20px; }
.modal:target { display: grid; }
.modal .box { background: #fff; border-radius: 12px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal .box .m-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal .box .m-head h3 { margin: 0; }
.modal .box .m-body { padding: 20px; }
.modal .box .m-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal .close { font-size: 22px; color: var(--muted); line-height: 1; }

/* ---------- Notifikasi ---------- */
.notif { position: relative; }
.notif-btn { background: none; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px;
  font-size: 17px; cursor: pointer; position: relative; }
.notif-btn:hover { background: #f4f6f8; }
.notif-badge { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; padding: 0 4px;
  display: grid; place-items: center; }
.notif-drop { position: absolute; right: 0; top: 46px; width: 330px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; }
.notif-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.linkbtn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 600; }
.notif-item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:hover { background: #fafbfc; text-decoration: none; }
.notif-item.unread { background: var(--brand-light); }
.notif-item .ni-title { font-weight: 600; font-size: 13.5px; color: var(--navy); }
.notif-item .ni-msg { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notif-item .ni-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-all { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 600; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Panel panduan (guide) ---------- */
.guide { background: linear-gradient(180deg, var(--brand-light), #fff); border: 1px solid #cfe3d7;
  border-left: 4px solid var(--brand); border-radius: 10px; padding: 15px 18px; margin-bottom: 20px; }
.guide h4 { margin: 0 0 6px; color: var(--brand-dark); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.guide ol { margin: 8px 0 0; padding-left: 20px; }
.guide ol li { margin: 3px 0; font-size: 14px; }
.guide .next { margin-top: 8px; font-size: 13px; color: var(--muted); }
.guide .next b { color: var(--brand-dark); }

/* Rubrik skor */
.rubric { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.rubric .r { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fff; }
.rubric .r b { display: block; color: var(--brand); font-size: 15px; }
.rubric .r span { font-size: 12.5px; color: var(--muted); }

/* Alur langkah (panduan page) */
.steps-flow { display: grid; gap: 12px; }
.steps-flow .sf { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.steps-flow .sf .no { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 800; }
.steps-flow .sf .no.gold { background: var(--accent); }
.steps-flow .sf .no.navy { background: var(--navy); }
.steps-flow .sf h4 { margin: 2px 0 3px; font-size: 15.5px; }
.steps-flow .sf .who { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.steps-flow .sf p { margin: 4px 0 0; font-size: 14px; color: var(--text); }
.steps-flow .sf .arrow { font-size: 12px; color: var(--muted); margin-top: 5px; }

.role-card { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.role-card .rc-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.role-card .rc-head h3 { margin: 0; font-size: 16px; }
.role-card .rc-body { padding: 14px 16px; }
.role-card .rc-body .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 10px 0 4px; }
.role-card .rc-body .lbl:first-child { margin-top: 0; }
.role-card ul { margin: 0; padding-left: 18px; } .role-card ul li { font-size: 13.5px; margin: 2px 0; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; opacity: .4; }

/* ---------- Dialog konfirmasi aplikasi ---------- */
.cmodal { position: fixed; inset: 0; background: rgba(15,30,45,.55); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.cmodal[hidden] { display: none !important; }
.cmodal .cm-box { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  max-width: 420px; width: 100%; overflow: hidden; }
.cmodal .cm-title { padding: 15px 20px; font-weight: 700; color: var(--navy); font-size: 16px;
  border-bottom: 1px solid var(--border); }
.cmodal .cm-msg { padding: 20px; color: var(--text); font-size: 14.5px; line-height: 1.5; }
.cmodal .cm-actions { padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Risiko: level & peta ---------- */
.lvl-low  { background: #dff0e6; color: #1e7a4d; }
.lvl-med  { background: #f9efc9; color: #9a7d0a; }
.lvl-high { background: #fbe3c8; color: #b45309; }
.lvl-ext  { background: #f8d6d1; color: #b02a1e; }
.lvlbadge { display:inline-block; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:700; }

.riskmatrix { display:grid; grid-template-columns:auto repeat(5, 1fr); gap:6px; max-width:640px; }
.riskmatrix .maxis { display:grid; place-items:center; font-size:12px; color:var(--muted); font-weight:700; }
.riskmatrix .mcell { min-height:60px; border-radius:8px; padding:6px; display:flex; flex-direction:column;
  gap:3px; align-items:center; justify-content:center; text-align:center; }
.riskmatrix .mcell .sc { font-size:11px; opacity:.7; font-weight:700; }
.riskmatrix .mcell .chip { font-size:11px; font-weight:700; background:rgba(255,255,255,.7); border-radius:5px; padding:0 5px; }
.riskmatrix .ytitle { grid-row:1 / span 5; grid-column:0; }
.matrix-legend { display:flex; gap:14px; flex-wrap:wrap; margin-top:14px; }
.matrix-legend .it { display:flex; align-items:center; gap:7px; font-size:13px; }
.matrix-legend .sw { width:16px; height:16px; border-radius:4px; }

details.inline-form > summary { cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 600; list-style: none; }
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > summary { margin-bottom: 10px; }

.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.right { text-align: right; } .center { text-align: center; }
.nilai-box { font-size: 28px; font-weight: 800; color: var(--brand); }

@media (max-width: 900px) {
  .grid.c4 { grid-template-columns: repeat(2,1fr); }
  .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; z-index: 200; transition: left .2s; }
  .sidebar.open { left: 0; }
  .content { padding: 16px; }
}

/* ---------- Cetak ---------- */
@media print {
  .sidebar, .topbar, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .content { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
