:root {
  --navy: #0f1b2e;
  --navy2: #17263e;
  --green: #16a34a;
  --green2: #dcfce7;
  --bg: #f3f5f8;
  --card: #fff;
  --border: #e5e9ef;
  --text: #10151f;
  --muted: #6b7686;
  --danger: #dc2626;
  --blue: #2563eb;
  --radius: 14px;
  --sidebar: 258px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar);
  background: var(--navy);
  color: #cbd5e1;
  padding: 20px 13px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-shrink: 0;
  /* Menu tetap di tempat saat isi halaman di-scroll */
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 9px 16px;
  border-bottom: 1px solid #ffffff12;
}
.brand b {
  display: block;
  color: #fff;
  font-size: 14px;
}
.brand small {
  display: block;
  color: #94a3b8;
  font-size: 10.5px;
}
.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
/* Logo ISO (public/logo.svg). Untuk logo sendiri, cukup ganti file logo.svg / ubah src di index.html */
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand.big .brand-logo {
  width: 52px;
  height: 52px;
}
.brand.big {
  padding: 0;
  border: 0;
  margin-bottom: 28px;
}
/* Halaman login: kartu berlatar putih, jadi judul memakai warna gelap (di sidebar putih) */
.brand.big b {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.brand.big small {
  font-size: 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 9px 12px 5px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  gap: 9px;
  align-items: center;
}
.nav-item:hover,
.nav-item.is-active {
  background: var(--green);
  color: #fff;
}
/* Menu anak (contoh: Audit Internal di bawah SOP) */
.nav-item.nav-child {
  width: calc(100% - 18px);
  margin-left: 18px;
  padding: 8px 12px;
  font-size: 12.5px;
  border-left: 1px solid #ffffff26;
  border-radius: 0 8px 8px 0;
}
.logout {
  margin-top: auto;
  border: 1px solid #ffffff1a;
  background: #ffffff08;
  color: #cbd5e1;
  border-radius: 9px;
  padding: 10px;
}
.sidebar-backdrop {
  display: none;
}
.main {
  flex: 1;
  min-width: 0;
}
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
}
.topbar h1 {
  font-size: 16px;
  margin: 0;
}
.topbar-user {
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar-user b,
.topbar-user small {
  display: block;
}
.topbar-user b {
  font-size: 12px;
}
.topbar-user small {
  font-size: 10px;
  color: var(--muted);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green2);
  color: #166534;
  font-weight: 800;
}
.content {
  padding: 28px;
}
.page-heading h2 {
  margin: 0 0 5px;
  font-size: 22px;
}
.page-heading p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card,
.panel,
.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-card {
  padding: 17px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--green2);
  color: #166534;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.stat-card strong {
  font-size: 20px;
}
.panel-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}
.panel-grid > *,
.stat-grid > *,
.profile-grid > *,
.detail-grid > * {
  min-width: 0;
}
.content,
.main {
  max-width: 100%;
}
.panel {
  padding: 20px;
}
.panel h3 {
  font-size: 14px;
  margin: 0 0 18px;
}
.chart-holder {
  min-height: 210px;
}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.bar-row {
  display: grid;
  grid-template-columns: 75px 1fr 45px;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
  font-size: 12px;
}
.bar-track {
  height: 12px;
  background: #eef1f5;
  border-radius: 20px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 20px;
}
.donut {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.donut-hole {
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  align-content: center;
}
.donut-hole b {
  font-size: 23px;
}
.donut-hole small {
  color: var(--muted);
}
.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  margin: 16px 0 0;
  font-size: 11px;
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 5px;
}
.unit-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 14px;
}
.unit-tab {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.unit-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.toolbar-right {
  display: flex;
  gap: 8px;
}
.search-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 11px;
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 300px;
}
.search-box input {
  border: 0;
  outline: 0;
  padding: 10px 0;
  width: 100%;
}
.toolbar-right select,
.status-filter {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  background: #fff;
}
.btn-primary,
.btn-secondary,
.btn-danger {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary.full {
  width: 100%;
  margin-top: 6px;
}
.btn-secondary {
  background: #eef1f5;
  color: #374151;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.table-scroll {
  overflow: auto;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}
.doc-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.doc-table td {
  padding: 12px;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
  vertical-align: middle;
}
.doc-table tr:last-child td {
  border-bottom: 0;
}
.badge {
  display: inline-block;
  border-radius: 99px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-terkendali {
  background: #dcfce7;
  color: #166534;
}
.badge-disahkan {
  background: #dcfce7;
  color: #166534;
}
.badge-menunggu-pengesahan,
.badge-menunggu-review {
  background: #fef3c7;
  color: #92400e;
}
.badge-draft {
  background: #eef1f5;
  color: #64748b;
}
.badge-diarsipkan {
  background: #fee2e2;
  color: #991b1b;
}
.actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.mini {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 10px;
}
.mini.good {
  color: #166534;
}
.mini.danger {
  color: #b91c1c;
}
.table-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.page-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 11px;
}
.page-btn:disabled {
  opacity: 0.4;
}
.modal {
  position: fixed;
  inset: 0;
  background: #0f172a99;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}
.modal[hidden],
.login-view[hidden],
.app-shell[hidden] {
  display: none;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  width: min(500px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
}
.modal-card.wide {
  width: min(820px, 100%);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
}
.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.icon-btn {
  border: 0;
  background: #f1f5f9;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.form-grid label,
#userForm label,
#passwordForm label,
#loginForm label,
#registerForm label,
#forgotForm label,
#resetForm label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-grid input,
.form-grid select,
#userForm input,
#userForm select,
#passwordForm input,
#loginForm input,
#registerForm input,
#registerForm select,
#forgotForm input,
#resetForm input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  outline: none;
  color: var(--text);
  background: #fff;
}
.span2 {
  grid-column: span 2;
}
.form-grid input:disabled,
.form-grid select:disabled {
  background: #f8fafc;
  color: #7b8491;
  cursor: not-allowed;
}
#passwordForm {
  display: grid;
  gap: 13px;
}
#passwordForm input:focus {
  border-color: var(--green);
}
#passwordForm input {
  width: 100%;
  box-sizing: border-box;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.form-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 9px;
  font-size: 11px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.detail-grid div {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
}
.detail-grid small,
.detail-grid b {
  display: block;
}
.detail-grid small {
  font-size: 10px;
  color: var(--muted);
}
.detail-grid b {
  font-size: 12px;
  margin-top: 4px;
}
.detail-actions {
  margin: 15px 0;
}
.modal-card h4 {
  font-size: 13px;
  margin: 20px 0 10px;
}
.timeline > div {
  border-left: 2px solid #dbe3ec;
  padding: 4px 0 8px 12px;
  margin-bottom: 8px;
}
.timeline b,
.timeline span,
.timeline small {
  display: block;
}
.timeline b {
  font-size: 11px;
}
.timeline span {
  font-size: 11px;
}
.timeline small {
  font-size: 10px;
  color: var(--muted);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--navy);
  padding: 20px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 15px 45px #0f172a12;
}
.login-card h1 {
  font-size: 22px;
  margin: 0 0 6px;
}
.login-card > p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 20px;
}
.login-card form {
  display: grid;
  gap: 13px;
}
.demo-box {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  font-size: 10px;
  display: grid;
  gap: 3px;
}
.demo-box span {
  color: var(--muted);
}
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 0;
}
.link-btn:hover {
  text-decoration: underline;
}
.form-success {
  background: var(--green2);
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 9px;
  font-size: 11px;
}
.sidebar-toggle {
  display: none;
}
@media (max-width: 1050px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    bottom: auto;
    height: 100vh;
    height: 100dvh; /* mengikuti tinggi layar yang terlihat (bilah alamat HP muncul/hilang) */
    overflow-y: auto;
    overscroll-behavior: contain; /* geser di menu tidak menggeser halaman di belakangnya */
    z-index: 30;
    transition: 0.2s;
  }
  .sidebar.is-open {
    left: 0;
  }
  /* Saat menu terbuka: halaman di belakang dikunci dan diberi latar gelap */
  body.sidebar-open {
    overflow: hidden;
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #0f172a99;
    z-index: 29;
  }
  /* Tombol ☰ pindah ke pojok kanan atas menu agar tidak menutupi logo */
  body.sidebar-open .sidebar-toggle {
    left: calc(var(--sidebar) - 46px);
  }
  .sidebar-toggle {
    display: block;
    position: fixed;
    z-index: 31;
    top: 14px;
    left: 12px;
    border: 0;
    background: var(--navy);
    color: #fff;
    border-radius: 7px;
    padding: 8px;
  }
  .topbar {
    padding-left: 58px;
    /* Bilah atas tetap di atas saat scroll, sehingga tombol ☰ tidak menutupi isi halaman */
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .content {
    padding: 18px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .search-box {
    min-width: 0;
  }
  .toolbar-right {
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span2 {
    grid-column: span 1;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .topbar-user > div:first-child {
    display: none;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Profile page */
.topbar-user {
  position: relative;
  cursor: pointer;
}
.topbar-user:focus {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 8px;
}
.profile-menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px #0f172a18;
  padding: 6px;
  z-index: 25;
}
.profile-menu[hidden] {
  display: none;
}
.profile-menu button {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
}
.profile-menu button:hover {
  background: #f1f5f9;
}
.profile-menu #profileLogout {
  color: var(--danger);
}
.profile-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 18px;
  align-items: start;
}
.profile-card-main {
  padding: 24px;
}
.profile-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--green2);
  color: #166534;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
}
.profile-identity h3 {
  margin: 0 0 5px;
  font-size: 18px;
}
.profile-identity p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.profile-status {
  display: inline-block;
  background: var(--green2);
  color: #166534;
  border-radius: 99px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
}
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.profile-info-grid label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-info-grid input,
.profile-info-grid select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.profile-info-grid input:disabled {
  background: #f8fafc;
  color: #7b8491;
}
.profile-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.profile-side {
  display: grid;
  gap: 18px;
}
.profile-side .panel {
  padding: 18px;
}
.panel-muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 0 0 14px;
}
.full-btn {
  width: 100%;
}
.permission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.permission-list li {
  font-size: 11px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.permission-list li span {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--green2);
  color: #166534;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.profile-side .timeline {
  max-height: 260px;
  overflow: auto;
}
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  .profile-card-main {
    padding: 18px;
  }
}

/* =========================================================
   Pemantauan Pelaksanaan SOP — tabel isian langsung
   ========================================================= */
.monitor-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 13px;
}
.monitor-table th,
.monitor-table td {
  border: 1px solid #1f2937;
  padding: 0;
  vertical-align: middle; /* teks sel rata tengah secara vertikal (seperti Cell > Vertical alignment: Center di Word) */
}
.monitor-table th {
  background: #92d67f;
  color: #10151f;
  font-weight: 800;
  text-align: center;
  padding: 9px 8px;
}
.monitor-table .col-no {
  width: 48px;
  text-align: center;
}
.monitor-table td.col-no {
  padding: 8px 4px;
  color: var(--muted);
}
.monitor-table .col-aksi {
  width: 46px;
  text-align: center;
}
.monitor-table td.col-aksi {
  padding: 6px 4px;
}
.monitor-table .col-paraf {
  width: 170px;
}
.monitor-table td input,
.monitor-table td textarea,
.monitor-table td select {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 9px;
  font-size: 13px;
  color: var(--text);
  outline: 0;
}
.monitor-table td textarea {
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  min-height: 0;
  display: block;
  overflow: hidden;
  field-sizing: content; /* tinggi mengikuti isi, sehingga sel bisa diratakan ke tengah */
}
.monitor-table td input:focus,
.monitor-table td textarea:focus,
.monitor-table td select:focus {
  background: #f0fdf4;
  box-shadow: inset 0 0 0 2px var(--green);
}
.monitor-table td input:disabled,
.monitor-table td textarea:disabled,
.monitor-table td select:disabled {
  color: #4b5563;
  cursor: default;
  -webkit-text-fill-color: #4b5563;
  opacity: 1;
  appearance: none;
}
/* Mode Lihat: tabel hanya dibaca, tanpa tombol ✕ / Unggah / Ganti / Hapus */
.monitor-view .col-aksi,
.monitor-view .paraf-actions,
.monitor-view .dokumen-actions {
  display: none;
}
.monitor-view .monitor-table td input,
.monitor-view .monitor-table td textarea,
.monitor-view .monitor-table td select {
  pointer-events: none;
  resize: none;
  appearance: none;
  -webkit-appearance: none;
}
.monitor-view .monitor-table td input::-webkit-calendar-picker-indicator {
  display: none;
}
.monitor-view .monitor-table td ::placeholder {
  color: transparent;
}
.monitor-status {
  font-size: 12px;
  color: var(--green);
  min-height: 1em;
}
.monitor-status.is-error {
  color: var(--danger);
}

/* Kolom Paraf: gambar tanda tangan */
.paraf-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
}
.paraf-thumb {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: zoom-in;
}
.paraf-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 0;
}
.paraf-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
label.paraf-btn {
  cursor: pointer;
  display: inline-block;
}
.paraf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0b1220cc;
  cursor: zoom-out;
}
.paraf-lightbox img {
  max-width: min(92vw, 900px);
  max-height: 88vh;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
}
/* Tombol lihat/sembunyikan password */
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 42px;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.pw-toggle:hover {
  background: #f1f5f9;
  color: var(--text);
}
/* Manajemen User: tombol aksi berdampingan & catatan kecil */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.muted-note {
  color: var(--muted);
  font-size: 13px;
}

/* Kolom Dokumen: file pendukung yang diunggah pada baris pemantauan */
.monitor-table .col-dokumen {
  width: 190px;
}
.dokumen-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  text-align: center;
}
.dokumen-link {
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.dokumen-link:hover {
  border-color: var(--green);
  color: var(--green);
}
.dokumen-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Baris disorot sebentar saat dibuka dari link dokumen di Excel */
@keyframes row-flash {
  0%, 60% { background: #fef9c3; }
  100% { background: transparent; }
}
.monitor-table tr.row-flash td {
  animation: row-flash 3s ease-out;
}

/* ===== Dashboard Overview: grafik bertumpuk (Rekapitulasi & Dokumen per Menu) ===== */
.bar-row.recap-row {
  grid-template-columns: 110px 1fr 36px;
  margin: 14px 0;
}
.bar-row.menu-row {
  grid-template-columns: 170px 1fr 36px;
  margin: 12px 0;
}
.bar-row b {
  text-align: right;
}
.bar-track {
  height: 22px;
}
.stack {
  display: flex;
  height: 100%;
  min-width: 0;
}
.stack-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.25);
}
.dashboard-menu-panel {
  margin: 18px 0;
}
.dashboard-menu-panel h3 {
  margin-bottom: 4px;
}
.dashboard-menu-panel .legend {
  margin: 8px 0 16px;
}

/* ===== Dashboard Audit Manajemen Internal ===== */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.audit-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.audit-card:hover,
.audit-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--tone, var(--green));
  box-shadow: 0 8px 22px rgba(15, 27, 46, 0.08);
}
.audit-card.tone-blue { --tone: #2563eb; --tone-bg: #dbeafe; }
.audit-card.tone-green { --tone: #16a34a; --tone-bg: #dcfce7; }
.audit-card.tone-purple { --tone: #9333ea; --tone-bg: #f3e8ff; }
.audit-card.tone-orange { --tone: #ea580c; --tone-bg: #ffedd5; }
.audit-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--tone-bg);
  color: var(--tone);
}
.audit-logo svg {
  width: 38px;
  height: 38px;
}
.audit-card-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.audit-card-text b {
  font-size: 16px;
}
.audit-card-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.audit-card-text em {
  color: var(--tone);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.audit-card-arrow {
  color: var(--muted);
  font-size: 22px;
  transition: transform 0.15s;
}
.audit-card.is-open .audit-card-arrow {
  transform: rotate(180deg);
}
.audit-iso-panel {
  margin-top: 16px;
}
.audit-iso-panel h3 {
  margin-bottom: 4px;
}
.audit-iso-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.audit-sub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.audit-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.audit-sub:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.back-link {
  margin-bottom: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.back-link:hover {
  color: var(--green);
  border-color: var(--green);
}
@media (max-width: 900px) {
  .audit-sub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .audit-grid {
    grid-template-columns: 1fr;
  }
  .bar-row.menu-row {
    grid-template-columns: 110px 1fr 30px;
  }
}

/* ===== Jenis Dokumen (dropdown ceklis) & tag di tabel ===== */
.jenis-field {
  display: grid;
  gap: 6px;
}
.jenis-field[hidden],
.jenis-menu[hidden],
.jenis-keterangan[hidden] {
  display: none;
}
.jenis-label {
  font-size: 11px;
  color: var(--muted);
}
.jenis-label small {
  font-size: 11px;
}
.jenis-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.jenis-toggle[aria-expanded="true"] {
  border-color: var(--green);
}
.jenis-menu {
  max-height: 250px;
  margin-top: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}
.jenis-option {
  display: flex !important;
  flex-direction: row !important; /* menimpa aturan label di form (kolom) */
  align-items: flex-start;
  gap: 10px !important;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text) !important;
  font-size: 13px !important;
  cursor: pointer;
}
.jenis-option:last-child {
  border-bottom: 0;
}
.jenis-option:hover {
  background: #f8fafc;
}
.jenis-option input {
  width: auto !important;
  margin-top: 3px;
  padding: 0 !important;
}
.jenis-option span {
  display: grid;
  gap: 2px;
}
.jenis-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.jenis-tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 20px;
  background: #e8f5ec;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.jenis-cell {
  min-width: 150px;
}

/* Kode dan nomor revisi tidak dipotong ke baris kedua */
.doc-body td:first-child,
.nowrap {
  white-space: nowrap;
}

/* =========================================================
   Bar chart VERTIKAL: Dokumen per Menu berdasarkan Unit
   Warna segmen = menu tempat dokumen diunggah
   ========================================================= */
.vchart {
  --vchart-h: 240px; /* sama dengan VCHART_HEIGHT di charts.js */
  padding-top: 22px; /* ruang untuk angka total di atas batang tertinggi */
}
.vchart-plot {
  position: relative;
  height: var(--vchart-h);
  margin-left: 34px; /* ruang angka sumbu Y */
  border-left: 1px solid var(--border);
}
.vchart-tick {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border);
}
.vchart-tick span {
  position: absolute;
  right: calc(100% + 8px);
  top: -8px;
  font-size: 10px;
  color: var(--muted);
}
.vchart-bars {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--vchart-cols), 1fr);
}
.vcol {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.vtotal {
  font-size: 12px;
  margin-bottom: 4px;
}
.vstack {
  width: min(64px, 70%);
  display: flex;
  flex-direction: column-reverse; /* segmen pertama (menu teratas di legenda) berada paling bawah */
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}
.vseg {
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  border-top: 1px solid #ffffff90;
}
.vseg:first-child {
  border-top: 0;
}
.vchart-labels {
  margin-left: 34px;
  display: grid;
  grid-template-columns: repeat(var(--vchart-cols), 1fr);
  padding-top: 8px;
  text-align: center;
  font-size: 12px;
}
.vchart-labels span {
  min-width: 0;
  overflow-wrap: normal;
}

@media (max-width: 760px) {
  .vchart {
    --vchart-h: 200px;
  }
  .vchart-labels {
    font-size: 9px;
  }
}

/* ---------- Pemantauan SOP & Progress Temuan ---------- */
.monitor-panel,
.progress-panel {
  margin-top: 18px;
}
.progress-panel h3 {
  margin-bottom: 4px;
}
.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.progress-cell .bar-track {
  flex: 1;
  height: 10px;
}
.muted-text {
  color: #94a3b8;
  font-size: 12px;
}
.badge-belum-ditindaklanjuti {
  background: #fee2e2;
  color: #b91c1c;
}
.progress-doc-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
}
.progress-doc-info[hidden] {
  display: none;
}

.monitor-panel .chart-holder:has(> .empty) {
  min-height: 0;
}