/* ── SOP: LAYOUT ── */
.sop-layout { display: flex; height: 100%; overflow: hidden; position: relative; }

/* ── LIST PANEL ── */
.sop-list-panel {
  width: 300px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-card);
  height: 100%; background: var(--bg-page);
}
.sop-list-header {
  padding: 20px 16px 12px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.sop-list-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sop-list-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sop-add-bab-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border: none; background: var(--brand-primary); color: #fff;
  border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  transition: background var(--transition-fast);
}
.sop-add-bab-btn:hover { background: var(--brand-dark); }
.sop-add-bab-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sop-list-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; background: var(--bg-input);
  border: 1px solid var(--border-card);
}
.sop-list-search-wrap i { color: var(--text-muted); font-size: 12px; }
.sop-list-search-wrap input {
  border: none; background: none; outline: none;
  font-size: 13px; font-family: inherit; color: var(--text-primary); flex: 1;
}

.sop-list-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; padding: 4px 16px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.sop-list-scroll::-webkit-scrollbar { display: none; }

.sop-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: 14px; cursor: pointer;
  transition: all var(--transition-fast);
}
.sop-item:hover { box-shadow: 0 2px 10px var(--shadow-sm); transform: translateY(-1px); }
.sop-item.active { border-color: var(--brand-mid); background: var(--brand-pale); }
.sop-item-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px; background: var(--brand-pale); color: var(--brand-primary);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.sop-item.active .sop-item-icon { background: var(--brand-primary); color: #fff; }
.sop-item-judul { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; }
.sop-item-arrow { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.sop-loading { text-align: center; color: var(--text-muted); font-size: 13px; padding: 40px 0; }

/* ── DETAIL WRAPPER ── */
.sop-detail-wrapper { flex: 1; padding: 12px; overflow: hidden; }
.sop-detail-panel {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  background: var(--bg-page); border-radius: 16px;
}

/* ── EMPTY STATE ── */
.sop-detail-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 40px;
}
.sop-empty-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--brand-pale), #f5e0c8);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--brand-mid);
}
.sop-empty-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sop-empty-sub { font-size: 12.5px; color: var(--text-muted); text-align: center; max-width: 320px; }

/* ── DETAIL CONTENT ── */
.sop-detail-content { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.sop-detail-header {
  padding: 18px 20px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-card);
}
.sop-detail-title-wrap { display: flex; align-items: center; gap: 10px; }
.sop-detail-title-input {
  flex: 1; font-size: 15px; font-weight: 700; color: var(--text-primary);
  border: 1px solid transparent; background: none; outline: none;
  padding: 6px 8px; border-radius: 8px; font-family: inherit;
}
.sop-detail-title-input[readonly] { cursor: default; }
.sop-detail-title-input:not([readonly]) { background: var(--bg-input); border-color: var(--brand-mid); }
.sop-detail-title-edit-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--border-card); background: var(--bg-hover);
  border-radius: 9px; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.sop-detail-title-edit-btn:hover { background: var(--brand-pale); color: var(--brand-primary); }

.sop-detail-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sop-search-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; background: var(--bg-input);
  border: 1px solid var(--border-card);
}
.sop-search-wrap i { color: var(--text-muted); font-size: 12px; }
.sop-search-wrap input {
  border: none; background: none; outline: none;
  font-size: 13px; font-family: inherit; color: var(--text-primary); flex: 1;
}
.sop-add-langkah-btn {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 10px 14px; background: var(--brand-primary); color: #fff;
  border: none; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: 'Poppins', sans-serif;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.sop-add-langkah-btn:hover { background: var(--brand-dark); }
.sop-add-langkah-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sop-detail-body {
  flex: 1; overflow-y: auto; padding: 20px; scrollbar-width: none;
}
.sop-detail-body::-webkit-scrollbar { display: none; }

.sop-body-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px;
  background: var(--bg-card); border: 1px dashed var(--border-card);
  border-radius: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sop-list-panel { width: 100%; border-right: none; }
  .sop-detail-wrapper {
    position: absolute; inset: 0; z-index: 10;
    padding: 0;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    background: var(--bg-page);
  }
  .sop-detail-wrapper.show { transform: translateX(0); }
  .sop-detail-panel { height: 100%; border-radius: 0; }
  .sop-detail-toolbar { flex-wrap: wrap; }
  .sop-add-langkah-btn { flex: 1; justify-content: center; }
}